feat: migrate Menu and Dropdown with selection and submenus

Port HeroUI menu family and Dropdown from ce90ea3: Reka DropdownMenu base,
MenuKey[] selection with section owners, 17 official demos, dropdown docs
and B01 tests. Long-press stays demo-level; submenu close is level-scoped.
This commit is contained in:
maoyingjie
2026-10-24 20:43:04 +08:00
parent 1c4ecc3def
commit 06ddb6662a
48 changed files with 3091 additions and 5 deletions
+47
View File
@@ -1580,3 +1580,50 @@ export const tableVariants = tv({
});
export type TableVariants = VariantProps<typeof tableVariants>;
export const menuVariants = tv({
base: "hv-menu",
});
export type MenuVariants = VariantProps<typeof menuVariants>;
export const menuItemVariants = tv({
defaultVariants: {
variant: "default",
},
slots: {
indicator: "hv-menu-item__indicator",
item: "hv-menu-item",
submenuIndicator:
"hv-menu-item__indicator hv-menu-item__indicator--submenu",
},
variants: {
variant: {
danger: {
item: "hv-menu-item--danger",
},
default: {
item: "hv-menu-item--default",
},
},
},
});
export type MenuItemVariants = VariantProps<typeof menuItemVariants>;
export const menuSectionVariants = tv({
base: "hv-menu-section",
});
export type MenuSectionVariants = VariantProps<typeof menuSectionVariants>;
export const dropdownVariants = tv({
slots: {
menu: "hv-dropdown__menu",
popover: "hv-dropdown__popover",
root: "hv-dropdown",
trigger: "hv-dropdown__trigger",
},
});
export type DropdownVariants = VariantProps<typeof dropdownVariants>;