refactor(components): menu component upgrade#3011
Draft
Conversation
As part of our epic to improve existing components, this refactor introduces a new composable sub-component API alongside the legacy API, enabling richer item layouts (prefix, suffix, singleSelect, submenu) and better responsive behavior. The legacy API remains fully supported. Added: - New composable API: Menu.Trigger, Menu.Content, Menu.Item, Menu.ItemLabel, Menu.ItemPrefix, Menu.ItemSuffix, Menu.ItemIcon, Menu.GroupLabel, Menu.Separator - Menu.Item type prop: "action" (default), "singleSelect", "submenu" - Menu.Item variation prop: "destructive" - Menu.Item selected prop: controlled boolean for singleSelect items - Submenu support: type="submenu" accepts a nested Menu.Content child - Mobile drill-down: submenu on ≤767px opens a second bottom sheet with back navigation - SPEC.md design handoff document - Storybook stories: ActionGroup, SingleSelectGroup, SubmenuGroup, MixedGroup Changed: - Bottom sheet breakpoint extended to ≤767px (was ~500px) - Dim overlay now only shown on ≤489px; hidden on tablet and desktop - Layout model changed from CSS subgrid to flexbox per-item - Min-width set to 160px; menu width hugs content, no max-width - Group label padding: 8px top, 4px bottom - Checkmark icon color uses --color-icon token - Destructive item hover background persists on pointer leave - Equal border-radius on all corners (--radius-base) - No horizontal scrollbar (overflow-x: hidden) Made-with: Cursor
20d7b53 to
739b617
Compare
Deploying atlantis with
|
| Latest commit: |
739b617
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://49636c0e.atlantis.pages.dev |
| Branch Preview URL: | https://component-menu.atlantis.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivations
As part of our epic to improve existing components, this refactor introduces a new composable sub-component API alongside the legacy API, enabling richer item layouts (prefix, suffix, singleSelect, submenu) and better responsive behavior. The legacy API remains fully supported.
Changes
Added
Menu.Trigger,Menu.Content,Menu.Item,Menu.ItemLabel,Menu.ItemPrefix,Menu.ItemSuffix,Menu.ItemIcon,Menu.GroupLabel,Menu.SeparatorMenu.Itemtypeprop:"action"(default),"singleSelect","submenu"Menu.Itemvariationprop:"destructive"Menu.Itemselectedprop: controlled boolean forsingleSelectitems; shows checkmark trailing icon whentruetype="submenu"accepts a nestedMenu.ContentchildSPEC.mddesign handoff documentActionGroup,SingleSelectGroup,SubmenuGroup,MixedGroupChanged
160px; menu width hugs content, nomax-width8pxtop,4pxbottom--color-icontoken--color-critical--surface) persists on pointer leave--radius-base)overflow-x: hidden)Testing
ActionGroup,SingleSelectGroup,SubmenuGroup,MixedGroupstories render correctly↑ ↓between items,Enter/Spaceto activate,Escapeto close,→/←to open/close submenusitems-based stories (Horizontal,CustomActivator) still work unchangedIn Atlantis we use Github's built in pull request reviews.
Made with Cursor