IconButton: Add `keyshortcuts` prop to allow labelling and describing support for keyboard shortcut (through tooltips)
This PR proposes an addition to the icon button API as it is accepted on https://github.com/github/primer/pull/2650 (internal link only). The keyshortcuts prop is added to the IconButton component to allow labelling and describing support for keyboard shortcuts through tooltips. This change is beneficial as it provides a more accessible user experience.
Changelog
New
- Add
keyshortcutsprop to icon buttons
Changed
- Rendered HTML when
keyshortcutsprop is present (Only when tooltips are enabled which will be the default behaviour very soon)
Rollout strategy
- [ ] Patch release
- [x] 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)
🦋 Changeset detected
Latest commit: 7974ffb2a844dd9db2887c73124a83650ef1561f
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @primer/react | Minor |
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
size-limit report 📦
| Path | Size |
|---|---|
| packages/react/dist/browser.esm.js | 91.21 KB (+0.07% 🔺) |
| packages/react/dist/browser.umd.js | 91.46 KB (-0.03% 🔽) |
:wave: Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/332131