Commit Graph

9 Commits

Author SHA1 Message Date
maoyingjie c8d54abefb feat(collections): auto incremental async loading, shared filtering and submenu delay
HD-10 scope, against heroui ce90ea3 collection sources and their
react-aria/react-stately dependencies:

- the ComboBox async demo now auto-loads on scroll-to-bottom
  (IntersectionObserver sentinel + fill chain mirroring the pinned
  ListBoxLoadMoreItem re-observe semantics), never duplicates requests
  (loading guards + monotonic sequence token), drops stale responses on
  query switches, keeps a retry path for failures (injectable mock
  failure) and documents its differences from the pinned SWAPI source;
  the Select demo's observer stays untouched (real-network scroll
  triggering verified in browser)
- the Autocomplete virtualization demo and the default filter share one
  locale-sensitive matcher: createBaseContains (Intl.Collator base
  sensitivity, cafe matches Cafe with accent folding) is now exported
  from the package root
- Autocomplete trigger semantics verified complete (single tab stop,
  Enter/Space/Escape/Delete/IME, single and multiple selection) and the
  scoped slots gained composition data instead of child copying:
  AutocompleteValue exposes selectedItem and per-entry source item,
  the ComboBox root exposes selectedItem
- DropdownSubmenuTrigger exposes the pinned delay contract (default
  200ms): the controlled open gate retimes Reka's fixed 100ms hover,
  keyboard opens stay immediate and cancel the pending hover, pointer
  leave cancels; the dead side/align forwarding is gone (Reka fixes the
  submenu side per direction); Button/Avatar trigger layout
  compensation kept after browser proof it is what wins the cascade
- tests/fixtures/collections-rtl.vue drives the real-browser delay and
  RTL geometry checks; b02-pickers contract pins the new export and
  slot typing

Full suite 111 files / 1666 tests, typecheck, build:docs and the
b02-pickers + api-root-aliases tarball contracts pass.
2026-10-29 13:46:34 +08:00
maoyingjie 145a208687 docs: close documentation facts, structure and related-component mapping
HD-04 scope, against heroui ce90ea3 cn sources:

- stale/fictional content: input.md no longer claims TextField is
  unmigrated; color-field.md no longer claims ColorPicker is private;
  header.md drops the fictional Header.Root subcomponent and the stale
  'menus not migrated' wording (MenuSection label registration is now
  documented from HeaderRoot source); radio-group.md drops three copied
  CheckboxGroup wordings (variant override is Radio's, scalar emits,
  native single-value submit); input-otp.md drops the fictional
  data-complete state and lists the real missing upstream props
- toggle-button disabled row now matches the real CSS hooks
  (:disabled / [aria-disabled], with data-disabled as a marker only)
- part API / CSS classes / interactive states restored per pinned
  sources: button (full class lists + real variable-based global CSS),
  accordion (per-part tables + variant/state lists), card (per-part
  tables + variant list), switch (SwitchGroup snippet + Switch/
  SwitchGroup class lists + states), color-field Group (class list +
  states), input-otp (variant notes, global CSS, class/state lists);
  input-group gains the two upstream usage chapters
- RelatedComponents restored from the pinned componentRelationships
  (first-3, filtered against componentsMap): 64 pages rewritten,
  list-box/slider sections added, 7 empty-mapping pages' fabricated
  entries removed; RelatedShowcases left unmigrated with its real data
  inventory recorded (2 cases, showcase-site cards)
- defaults unified on implementation evidence: granularity (inferred
  day/minute) and visibleYears (full min-max span, no "or 20" fallback);
  HD-03 hand-offs resolved (trigger focus-visible noted for HD-06,
  width guards kept)
- new demos: header-collection-grouping (MenuSection/ListBoxSection
  label wiring), empty-state-collection (collection empty slot);
  empty-state page deduplicated with a boundary compatibility note
- ComponentPreview minHeight/isBgSolid restored per the 30 upstream
  marks; tabs-overflow max-w-full kept after measuring internal scroll
- tests: +3 header registration/demo cases, +1 empty-state collection
  case; full suite 110 files / 1630 tests, typecheck and build:docs
  pass
2026-10-28 22:32:10 +08:00
maoyingjie f8de4529f6 fix(dropdown): preserve grouped root attrs and events without breaking seams 2026-10-28 12:35:35 +08:00
maoyingjie 123e3f9cba fix(dropdown): keep dropdown trigger positional inside ButtonGroup
Review of the restored button-group demos found the merged pull-request
group's seam broken: DropdownRoot renders a .hv-dropdown wrapper (a recorded
Vue adaptation) so the trigger button stopped being a positional child of
.button-group and matched :first-child:last-child, taking a full 24px radius
against the merge button's 24/0 end cap. The internal __button_group_child
marker also leaked onto the DOM.

Upstream Dropdown has no DOM root (RAC MenuTrigger renders a bare
SlotProvider and drops root props), so the trigger naturally occupies the
group's :last-child slot and the shared seam rules apply unchanged.

- DropdownRoot absorbs the ButtonGroup direct-child marker and skips the
  wrapper when marked, restoring positional seam radii and outline seam
  borders without touching the styles package (kept line-parity with the
  pinned source)
- wrapper contract (data-slot=dropdown-root, data-trigger, root class host)
  unchanged outside ButtonGroup; documented in dropdown.md
- regression tests: positional trigger + no marker leak in groups, wrapper
  still hosts root class standalone
2026-10-28 11:39:39 +08:00
maoyingjie b474a63303 fix: resolve close policy, handler merging and submenu panel props
- Menu forwards the raw close policy and the item resolves item > menu
  (boolean or function) > per-mode default, so action items close by default and
  an explicit single/multiple policy is no longer pre-empted.
- Root popover chains caller handlers with the internal ones for keydown,
  escape, interact-outside, auto focus and animation end; callers run first and
  a prevented event stops the internal logic.
- Submenu panels receive the nested popover's data/style/id/extra events, honour
  isKeyboardDismissDisabled without closing the parent level or a modal, and
  forward shouldCloseOnInteractOutside.
- A standalone Menu provides its own content-attribute channel so the
  accessible name/description land on the real role=menu node.
2026-10-24 23:42:05 +08:00
maoyingjie 53b4639b0e fix: portal dropdown surfaces and close the review capability gaps
- Root and submenu surfaces render through the dropdown portal with the overlay
  z-index, so clipping/isolation ancestors no longer cut the menu; panel height
  is capped by the floating available height and the animation origin maps the
  real transform origin.
- Standalone Menu is a static in-flow list: no scroll lock, no outside pointer
  blocking, no floating placement and no focus stealing.
- Selection ownership is isolated per level: section disabled keys add to the
  menu list, and a nested Menu resets the section owner.
- closeOnSelect resolves item > menu policy > per-mode default for selection
  items; actions and radio items close, checkboxes stay open.
- Business keys no longer become DOM ids (instance ids + data-key), and submenu
  surfaces label themselves from the real trigger.
- Long-press keydown runs the caller's handlers first and only opens when not
  cancelled; submenu panels merge caller keydown with the internal Escape.
- Link items render a real anchor, aria labels land on the role=menu node,
  submenu panels forward placement/offset/collision props and caller attrs, and
  the popover provides the default Surface variant.
- Wrapper parts declare real props/emits, plus the missing official capability
  props (disallowEmptySelection, escapeKeyBehavior, shouldFocusWrap, autoFocus,
  shouldCloseOnSelect, close, empty slot, isKeyboardDismissDisabled,
  shouldCloseOnInteractOutside, placement/offset family, scoped slots).
- Ship an independent consumer fixture for browser-level verification.
2026-10-24 22:56:44 +08:00
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 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