Commit Graph

5 Commits

Author SHA1 Message Date
maoyingjie 043a5418f3 fix: align Dropdown/Menu with the HeroUI baseline after fidelity audit
- menu-item.css keys disabled styling off the presence attribute Reka emits.
- Dropdown surfaces drive the ported enter/exit animations and use data-side
  for placement-specific motion.
- One role=menu per popup; items render their key as DOM id; submenu surfaces
  point aria-labelledby at the real trigger; MenuSection names its group from a
  nested Header.
- Custom (asChild) triggers stay keyboard focusable; library Button/Avatar keep
  their own layout instead of the custom-trigger rules.
- Items emit data-focused/data-hovered/data-pressed, expose the upstream render
  props to slots, and merge caller classes through tailwind-variants.
- Submenu triggers declare hasSubmenu explicitly and forward class/ARIA; the
  default submenu indicator uses the baseline chevron artwork.
- Demos restore Kbd slot="keyboard" (27x), IconSquarePlus, and remove the added
  comment, stray space and duplicated indicator SVGs.
- Document the page after the official structure and API tables, including
  renamed props, Vue extensions and remaining gaps.
2026-10-24 22:14:10 +08:00
maoyingjie 64aaf5e53f test: cover keyboard item activation and cancellation for menu items 2026-10-24 21:43:10 +08:00
maoyingjie e797c25d46 fix: real trigger owns long press, Vue click chain and layered Esc
- DropdownTrigger takes over the longPress press lifecycle in capture phase and
  cancels Reka's own open/toggle through its defaultPrevented guard; DropdownRoot
  no longer wraps the whole menu content. Short click, Enter and Space now open
  exactly once, and release cannot close the menu again.
- MenuItem hands user handlers plus activation to Vue as one DOM onClick array,
  so preventDefault, capture and stopImmediatePropagation keep native semantics
  instead of a hand-rolled handler loop.
- DropdownSubmenuTrigger owns its own open state and closes only its level on
  Escape, restoring focus to the submenu trigger; the parent menu stays open and
  a second Escape closes the root.
2026-10-24 21:42:25 +08:00
maoyingjie 1692c6b0ac fix: menu selection ARIA, cancelable activation, submenu and long-press
- Selected items use menuitemradio/menuitemcheckbox + aria-checked + data-selected
- onClick preventDefault cancels action/selection/close (user handlers first)
- Submenu trigger is a single menuitem (asChild); standalone Menu owns Reka root
- DropdownRoot trigger=longPress with threshold, keyboard fallback, cleanup
- Export *Props types; independent tarball ESM/CSS + NodeNext/bundler contracts
- Esc still closes the full submenu stack (recorded gap)
2026-10-24 21:19:04 +08:00
maoyingjie 06ddb6662a 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.
2026-10-24 20:43:04 +08:00