feat(Details): Add summary subcomponent
Closes https://github.com/github/primer/issues/3518
Adds Details.Summary subcomponent that can be used within Details for the summary and adds summary prop to Details component which will render the supplied node within the new Details.Summary subcomponent. Also adds a default "See Details" summary value to be rendered to improve accessibility in case authors fail to supply one.
Changelog
New
- Adds
Details.Summarysubcomponent - Adds tests for new
Details.Summarysubcomponent
Changed
- Updates
Details.docs.jsonto include data for newDetails.Summarysubcomponent and its props - Use new
Details.Summarysubcomponent inDetailsstory - Refactor
Detailscomponent to render a defaultDetails.Summaryif one hasn't been supplied by author - Rewrite
Detailscomponent export to include newDetails.Summarysubcomponent - Update
Detailstests to use newDetails.Summarysubcomponent
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
- Verify no visual/behavioral regressions in deploy preview
Detailsstory - All tests should pass sniff test and CI
Merge checklist
- [x] Added/updated tests
- [x] Added/updated documentation
- [x] Added/updated previews (Storybook)
- [ ] Changes are SSR compatible
- [x] Tested in Chrome
- [ ] Tested in Firefox
- [ ] Tested in Safari
- [ ] Tested in Edge
- [x] (GitHub staff only) Integration tests pass at github/github (Learn more about how to run integration tests)
🦋 Changeset detected
Latest commit: e6ce3b32f3fb3693acea8dfc0ef345fda13ac185
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 | 97.94 KB (+0.19% 🔺) |
| packages/react/dist/browser.umd.js | 98.25 KB (+0.21% 🔺) |
:wave: Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!
🟢 golden-jobs completed with status success.
:wave: Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/349552