[🔨 WIP] Support responsive overflow in ButtonGroup
Closes https://github.com/github/primer/issues/6096
NOTE: ⚠️ This is a WIP PR, the approach here can be changed as there's multiple ways of tackling this issue.
- Added automatic overflow detection and handling in
ButtonGroup.tsx, including logic to measure button widths, calculate how many buttons fit, and move excess buttons into an overflow menu triggered by an icon button. The overflow menu usesAnchoredOverlayfor accessibility and keyboard navigation. - Introduced the
overflowAriaLabelprop toButtonGroup, with a default value of "More actions", ensuring the overflow trigger button is accessible to screen readers.
Changelog
New
Changed
Removed
Rollout strategy
- [ ] Patch release
- [ ] Minor release
- [ ] Major release; if selected, include a written rollout or migration plan
- [ ] None; if selected, include a brief description as to why
Testing & Reviewing
Merge checklist
- [ ] Added/updated tests
- [ ] Added/updated documentation
- [ ] Added/updated previews (Storybook)
- [ ] Changes are SSR compatible
- [ ] Tested in Chrome
- [ ] Tested in Firefox
- [ ] Tested in Safari
- [ ] Tested in Edge
- [ ] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)
⚠️ No Changeset found
Latest commit: 1f8a13350a7e1cc2af7e8ca78e7f087945669804
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
:wave: Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.