-
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
Create <SegmentedPicker />
, <Button />
, <ButtonGroup />
components
#1516
Conversation
🦋 Changeset detectedLatest commit: 5480a36 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Visit the preview URL for this PR (updated for commit 5480a36): https://penumbra-ui-preview--pr1516-jessepinho-segmented-d5zkeqe2.web.app (expires Tue, 30 Jul 2024 18:58:37 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1 |
<SegmentedPicker />
component<SegmentedPicker />
component
<SegmentedPicker />
component<SegmentedPicker />
, <Button />
, <ButtonGroup />
components
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.
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.
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.
122abba
to
5147459
Compare
5147459
to
3b0325e
Compare
3b0325e
to
c9dd66b
Compare
<SegmentedPicker />
, <Button />
, <ButtonGroup />
components<SegmentedPicker />
, <Button />
, <ButtonGroup />
components
Moving back to draft to address some changes that came up in my recent 1:1 with Sam |
Just was one change after all. This PR is ready for review again 👍🏻 |
return ( | ||
<Root> | ||
{options.map(option => ( | ||
<SegmentButton |
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.
thought/issue (a11y): semantically, SegmentedPicker
is used as either a radio button group, or as tabs. Each of these usages have their W3C standards for accessibility. For now, the component doesn't fill the standards fully:
- Tabs: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/.
SegmentedPicker
doesn't support arrow navigation and aria attributes likearia-selected
for the selected button, etc. - Radio group: https://www.w3.org/WAI/ARIA/apg/patterns/radio/.
SegmentedPicker
doesn't use the required roles and keyboard navigation.
I don't mind having this version of a component for now – it looks good and works correctly, at least partially accessible with the keyboard. Yet, I believe that in the future SegmentedPicker
should be split into RadioGroup
and Tabs
components correspondingly.
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.
Ah, this is a good call-out — this seems like a great candidate for using an already existing component (like Radix UI's Tabs). Since we're going to be using <SegmentedPicker />
for tabs anyway, that seems like the right fit. I'll move this PR back to draft until this is addressed.
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.
Actually, on second thought, I'll do this as a separate PR to keep PRs smaller.
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.
Ready to merge!
Originally was going to split out
<SegmentedPicker />
and<Button* />
to separate PRs, but it turned out that they used shared styles, so I'm PRing them together.In this PR
<SegmentedPicker />
component<Button />
component<ButtonGroup />
componentCloses #115