-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearer handling of expandable list steps #2333
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
47829b5
fix dark mode hover effect
rohitpaulk d4ba6eb
Add NonExpandableStep component and refactor ExpandableStepList logic.
rohitpaulk 3b52212
Remove shadow-sm class from SVG and text in non-expandable-step compo…
rohitpaulk 2e57b3f
Update non-expandable step styles for improved visibility and clarity.
rohitpaulk 6a2ab5c
Update non-expandable step styles and add amber color to Tailwind con…
rohitpaulk 9106a9c
Fix data-test attribute in non-expandable step and update condition i…
rohitpaulk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
app/components/expandable-step-list/non-expandable-step.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="py-2 px-1 cursor-not-allowed group/non-expandable-step relative" data-test-expandable-step-list-non-expandable-step ...attributes> | ||
<div class="flex items-center justify-between gap-2"> | ||
<div class="prose dark:prose-invert" data-test-step-title> | ||
{{markdown-to-html (concat "**Step " @number "**: " @step.titleMarkdown)}} | ||
</div> | ||
</div> | ||
<div | ||
class="absolute inset-0 flex gap-1 items-center justify-center bg-gray-50/80 dark:bg-gray-800/80 backdrop-blur-[3px] opacity-0 group-hover/non-expandable-step:opacity-100 transition-opacity" | ||
> | ||
{{svg-jar "information-circle" class="w-5 h-5 fill-current text-yellow-500 shadow-sm"}} | ||
<div class="text-sm text-gray-500 dark:text-yellow-500 font-semibold shadow-sm" data-test-step-title> | ||
Complete previous step to expand this step | ||
</div> | ||
</div> | ||
</div> | ||
19 changes: 19 additions & 0 deletions
19
app/components/expandable-step-list/non-expandable-step.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Component from '@glimmer/component'; | ||
import type { Step } from '../expandable-step-list'; | ||
|
||
interface Signature { | ||
Element: HTMLDivElement; | ||
|
||
Args: { | ||
number: number; | ||
step: Step; | ||
}; | ||
} | ||
|
||
export default class NonExpandableStepComponent extends Component<Signature> {} | ||
|
||
declare module '@glint/environment-ember-loose/registry' { | ||
export default interface Registry { | ||
'ExpandableStepList::NonExpandableStep': typeof NonExpandableStepComponent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider using semantic HTML elements and enhancing accessibility.
The overall structure of the component is well-organized, but it could benefit from using more semantic HTML elements and improving accessibility. Here are some suggestions:
<article>
or<section>
instead of the outermost<div>
to better represent the step content semantically.aria-label
to the main container to describe its purpose.<h3>
) for the step title instead of a<div>
.Here's an example of how you could refactor the component:
These changes would improve the semantic structure and accessibility of the component.