chore(accordion): full fidelity feature update#6319
Conversation
Co-authored-by: Nikki Massaro <massaro@adobe.com>
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…0-full-fidelity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| outline-offset: calc(token("accordion-focus-indicator-gap") * -1); | ||
| } | ||
|
|
||
| @media (hover: hover) { |
There was a problem hiding this comment.
Sidenote: I know this comes from the CSS repo but we haven't consistently applied it. Maybe we need a tiny spike to figure out if it's still worth doing, and if so, update our docs accordingly so it gets applied. Or, conversely, mark it as an anti-pattern if not.
There was a problem hiding this comment.
Would we prefer that it stay out for now, and we add it back if needed? I don't see it in other 2nd-gen components.
| }; | ||
|
|
||
| // ──────────────────────────────── | ||
| // ACCESSIBILITY STORIES |
There was a problem hiding this comment.
This is fine, just maybe check in both the a11y and documentation phases if there need to be any updates
| --_swc-accordion-item-border-color: transparent; | ||
| --_swc-accordion-item-header-corner-radius: var(--_swc-accordion-corner-radius); |
There was a problem hiding this comment.
This is a unique scenario where the quiet attribute isn't passed on to the children, hence the custom property overrides. So I'm a bit torn on if these should be allowed to be fully exposed. They are currently technically exposed for non-quiet variants, unless you remove the .swc-Accordion scoping.
I think to reduce ambiguity against our guidelines, since they need to be exposed for purposes of this override, we should remove the private syntax and the scoping in this selector so that they can be fully exposed and therefore documented in our API. I don't want to get into a scenario of getting a mix of private and non-private syntax-using listed via @cssprops, as that muddies the usage guidelines.
There was a problem hiding this comment.
Ok, this is how I have it addressed right now:
--swc-accordion-item-border-colorand--swc-accordion-item-header-corner-radiusnow have exposed syntax and I changed the selector to:host([quiet]) ::slotted(swc-accordion-item)because it matched the density selectors- Keeping track of what all the corner-radius custom props were for was making me a feel a bit crazy, so I changed
--swc-accordion-item-corner-radiusto--swc-accordion-item-focus-indicator-corner-radiusbecause all that I see it doing is changing the border radius for the focus indicator, but if that doesn't seem right, let me know
I find it fully irritating that I'm declaring the same corner radius tokens for each t-shirt size in accordion-item.css and accordion.css (once for focus outline and once for the hover), I'm not seeing a way around it but if you know of one, I'm happy to make the change!
There was a problem hiding this comment.
I think your solution is elegant, nice work!
f741213 to
4b0e1eb
Compare
5t3ph
left a comment
There was a problem hiding this comment.
Super close! Good job figuring out how to smooth out the custom property hand-off 🙌
| outline-offset: calc(token("accordion-focus-indicator-gap") * -1); | ||
| } | ||
|
|
||
| @media (hover: hover) { |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b6d8ccb
into
swc-1854/accordion-migration
* docs(accordion): refine planning docs (#6269) Co-authored-by: Nikki Massaro <massaro@adobe.com> * chore: scaffold core package * chore: scaffold swc package * chore: add Chevron300Icon for xl accordion * chore: set up storybook story * chore: commit preview.ts updates * feat: implement AccordionItem API and render template * feat: implement Accordion API and propagation * feat: implement open and toggle logic * feat: wire up dynamic heading levels * feat: implement disabled item functionality * fix: handle space keyboard behavior (SWC-1487) * refactor: address missing migration-setup items * refactor: rename methods, align file names * refactor: typing, heading rendering, sizing * refactor: move toggle() into base, smooth a11y behavior * refactor: use assignedItems() helper * test: add a11y tests * docs: add a11y docs * fix: freeze accordion open state when disabled * feat: 1st-gen deprecation warnings/tests * docs: jsdoc comments * chore(accordion): full fidelity feature update * chore: changeset * fix: revert 1st-gen refactor work * chore(accordion): defer tests, deprecations, and changeset to part two Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(accordion): refine planning docs (#6269) Co-authored-by: Nikki Massaro <massaro@adobe.com> * chore: scaffold core package * chore: scaffold swc package * chore: add Chevron300Icon for xl accordion * chore: set up storybook story * chore: commit preview.ts updates * feat: implement AccordionItem API and render template * feat: implement Accordion API and propagation * feat: implement open and toggle logic * feat: wire up dynamic heading levels * feat: implement disabled item functionality * fix: handle space keyboard behavior (SWC-1487) * refactor: address missing migration-setup items * refactor: rename methods, align file names * refactor: typing, heading rendering, sizing * refactor: move toggle() into base, smooth a11y behavior * refactor: use assignedItems() helper * test: add a11y tests * docs: add a11y docs * fix: freeze accordion open state when disabled * feat: 1st-gen deprecation warnings/tests * docs: jsdoc comments * chore: changeset * fix: revert 1st-gen refactor work * chore(accordion): defer tests, deprecations, and changeset to part two Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(accordion): update css font * fix: class selectors * feat: set up accordion file structure, API, and a11y (#6300) * chore: scaffold core package * chore: scaffold swc package * chore: add Chevron300Icon for xl accordion * chore: set up storybook story * chore: commit preview.ts updates * feat: implement AccordionItem API and render template * feat: implement Accordion API and propagation * feat: implement open and toggle logic * feat: wire up dynamic heading levels * feat: implement disabled item functionality * fix: handle space keyboard behavior (SWC-1487) * refactor: address missing migration-setup items * refactor: rename methods, align file names * refactor: typing, heading rendering, sizing * refactor: move toggle() into base, smooth a11y behavior * refactor: use assignedItems() helper * test: add a11y tests * docs: add a11y docs * fix: freeze accordion open state when disabled * feat: 1st-gen deprecation warnings/tests * docs: jsdoc comments * chore: changeset * fix: revert 1st-gen refactor work * chore(accordion): defer tests, deprecations, and changeset to part two Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: class selectors * refactor: use ObserveSlotPresence instead of bespoke method * refactor: remove stop propagation on actions container * refactor: add open/close events --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(accordion): address PR review feedback on CSS and stories Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(accordion): restore row wrapper and register swc-button in stories * fix(accordion): change ceiling amount to spacing-300 * fix(accordion): fix token names for header and content sections * fix: move private custom properties from accordion-item :host * fix: adjust .swc-AccordionItem-header custom properties * fix: adjust content inline padding custom properties * chore: update preview.ts and migration plan * feat: spacing on direct actions * docs: improve ai skill * fix: use <p>s in stories and account for their margin * docs: add cssprops to jsdocs * chore: rename custom props for accordion item * feat: handle panel animation * fix: use better selectors * docs: docs updates * fix: handle quiet and corner radius tokens * chore: update migration plan * fix: feedback fixes --------- Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com> Co-authored-by: Nikki Massaro <massaro@adobe.com> Co-authored-by: Rise Erpelding <rise@heysparkbox.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
Completes full-fidelity rendering, styling, and Storybook documentation for
<swc-accordion>and<swc-accordion-item>.Changes:
accordion-item.css— new file with all Spectrum 2 token-driven item styles: header layout, chevron, panel, sizes (s/m/l/xl), and forced-colors supportaccordion.css— density overrides (compact/spacious) andquietvariant (transparent dividers, rounded header corners) cascaded to child items via custom propertiesAccordionItem.ts— fix incorrect CSS import (accordion.css→accordion-item.css)accordion.stories.ts— Storybook stories: Anatomy, Options (sizes, density, quiet, allow-multiple, heading level), States (disabled, item-disabled), Behaviors (toggle event, exclusive open), and Accessibility.Note: Storybook stories are for testing for full fidelity review. Storybook docs will be further refined in following tickets.
Motivation and context
Phase 5 (styling) of the accordion 2nd-gen migration. This PR adds the visual layer and Storybook coverage on top.
Related issue(s)
Screenshots (if appropriate)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases