feat(menu): scaffold 2nd-gen file structure - #6596
Conversation
Creates base classes, concrete components, stub CSS, and swc-<tag>.ts entry points for Menu, MenuItem, MenuGroup, and MenuSeparator, bundled in one 2nd-gen package to match how Tabs and Accordion structure their composite sub-parts. Wires the core package.json exports for the new components and adds a Playground story for a Storybook smoke test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
📚 Branch Preview Links🔍 Gen1 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 |
Description
Creates the core and SWC directory structure for Menu in the 2nd-gen package: base classes, concrete components, stub CSS, and
swc-<tag>.tsregistration entry points forswc-menu,swc-menu-item,swc-menu-group, andswc-menu-separator, bundled together in onecomponents/menupackage. Wires the new./components/menuexport intocore'spackage.json. Adds a minimal Playground story for a Storybook smoke test.MenuItem/MenuGroup/MenuSeparatorare bundled into this same pass (rather than scaffolded separately) to match how Tabs (Tab/TabPanel) and Accordion (AccordionItem) structure their composite sub-parts — confirmed against the workstream status table, which tracks "Menu" as a single row with no separate rows for those three units.No behavior is implemented yet: components extend
SpectrumElementdirectly and render only a slot. Trigger wiring,swc-popoveranchoring, ARIA/keyboard, and the full API surface are out of scope for this phase (2nd-genswc-menuis a full menu-button host per the accessibility/rendering analysis docs — a larger departure from 1st-gen's list-onlysp-menuthan a typical port, so intentionally deferred rather than guessed at here).Motivation and context
First step ("Set up file structure in 2nd-gen") of the Menu 1st-gen → 2nd-gen migration, so implementation work (API, a11y, styling) has a structure to build on.
Note for reviewer: no
migration-plan.mdexists yet for Menu underCONTRIBUTOR-DOCS/03_project-planning/03_components/menu/— only the accessibility and rendering-and-styling analysis docs, which this scaffolding is based on. Worth closing out before the API migration phase starts.Related issue(s)
Screenshots (if appropriate)
N/A — no visual output yet beyond an unstyled slot passthrough.
Author's checklist
No automated tests, changeset, or documentation were added: this is Phase 2 (file-structure) scaffolding only, with no publishable behavior change. Validation for this PR was
yarn build(both packages),eslint/stylelint/prettier, andyarn storybook:build(confirmscomponents-menu--playgroundrenders). Dedicated tests land in the testing phase; docs land in the documentation phase.Manual review test cases
yarn storybookin2nd-gen/packages/swcswc-menuto render its slottedswc-menu-item/swc-menu-group/swc-menu-separatorchildren with no console errorsDevice review
Accessibility testing checklist
CONTRIBUTOR-DOCS/03_project-planning/03_components/menu/accessibility-migration-analysis.md.