-
Notifications
You must be signed in to change notification settings - Fork 662
feat: implement ADR-023 Part 1 #7724
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
Open
francinelucca
wants to merge
32
commits into
main
Choose a base branch
from
chore/implement-adr-023
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
abfe9c4
feat(ActionBar): add data-component attributes for better accessibility
francinelucca 6381280
fix test
francinelucca 091de76
Merge branch 'main' of github.com:primer/react into chore/implement-a…
francinelucca 32d4062
fix(ActionBar): update data-component attributes for IconButton and Menu
francinelucca c7c0da7
Add data-component for ActionList
francinelucca 4cf2494
fix(ActionList): add data-component attributes for Item and LinkItem
francinelucca 2962363
test(Tooltip): add tests for data-component attributes in Tooltip and…
francinelucca 3f92c21
Merge branch 'main' of github.com:primer/react into chore/implement-a…
francinelucca 273f681
fix: update data-component attribute for GroupHeading to GroupHeading…
francinelucca 8c38035
fix comment
francinelucca 8c3d244
Merge branch 'main' into chore/implement-adr-023
francinelucca 8ca6eac
add data-component attribute to Pagination
francinelucca ddca738
Merge branch 'chore/implement-adr-023' of github.com:primer/react int…
francinelucca 6f96ebd
Add data-component attributes to TextInput components for improved ac…
francinelucca 17f2bf0
test: add nested ActionList data-component attribute tests for Filter…
francinelucca ff94d66
Merge branch 'main' into chore/implement-adr-023
francinelucca 79e42d4
Merge branch 'chore/implement-adr-023' of github.com:primer/react int…
francinelucca b05df83
test: enhance data-component attribute tests for FilteredActionList a…
francinelucca db67cc2
test: add data-component attribute tests for Table and Pagination com…
francinelucca e71ce27
test: add data-component attribute tests for Table.Header and Table.S…
francinelucca f2b0a1f
test: add data-component attribute to Button and ButtonReset components
francinelucca e94fe52
test: add data-component attribute for LinkButton and its tests
francinelucca 8c886da
test: add data-component attribute to Link component and its tests
francinelucca 76bb50d
test: add data-component attributes for SelectPanel.CloseButton and S…
francinelucca bba65c1
test: add stable data-component selectors to DataTable, Button, Link,…
francinelucca 9aaead8
rearrange stuff
francinelucca 8429e82
chore: auto-fix lint and formatting issues
francinelucca a874ad0
Merge branch 'main' of github.com:primer/react into chore/implement-a…
francinelucca 34ac550
chore: update octicon
francinelucca 6e784d9
Merge branch 'chore/implement-adr-023' of github.com:primer/react int…
francinelucca 8e7bf4c
Merge branch 'main' into chore/implement-adr-023
francinelucca e20e7a9
test(vrt): update snapshots
francinelucca 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I feel like this indeed makes no sense, but does that mean that subcomponents like ActionBar.Menu don't have a data-component, despite being public subcomponents? how would you target them then?:
[data-component="ActionBar"] [data-component="IconButton"]isn't specific enough because ActionBar.IconButton would match this as well 🤔Should we wrap everything top-level in a span for these cases just so we can attach the data-component attribute? is there any chance for that to mess anything up?
Uh oh!
There was an error while loading. Please reload this page.
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.
In this scenario, i think it makes sense to override the menu IconButton because there are other IconButtons in this component as well. (I'd call it
ActionBar.MoreIconButtonorActionBar.MenuIconButton)It's likely that it will be used with a classname on the ActionBar root
.myActionBar [data-component=ActionBar.MoreIconButton]That said, I don't think
<Actionbar.IconButton>should get a data-component at all becauseNot a good idea because it will introduce nesting, which in best of cases is unnecessary and in the worst cases breaks dom validation rules or slots constraints
There will be other similar scenarios where we might choose to override the child's data-component when there are two distinct IconButtons that are baked in the component and not accessible in the API, for example the previous and next icon buttons in Pagination.