/** * Menu — actions behind one trigger (W2 §The Kit). * * ONE API: `items` plus one `onSelect`, which is what a WIRE tree can express. * * Children are REFUSED by the floor — Menu is childless in the Kit specs, and the * nesting check names `items={[…]}` + `onSelect` as the fix — because the branch * that used to accept them wrapped every child in an entry with NO handler. A * menu written that way opened, listed its entries, highlighted them on hover, * and did nothing at all when one was chosen. There is no version of that branch * worth keeping: a nested Menu cannot say which value an entry carries, so a * refusal that names the fix is the only outcome the author can act on. */ import { Menu as Base } from "@base-ui/react/menu"; import type { ComponentProps } from "react"; import { type KitStyled, type KitEngine, type KitRendered } from "../tokens.js"; export interface MenuItem { label: string; /** What `onSelect` receives; defaults to the label. */ value?: string; /** lucide icon name in kebab-case. */ icon?: string; disabled?: boolean; } interface MenuOwnProps extends KitStyled { /** The trigger's text. */ label: string; items?: MenuItem[]; /** Bound handler; receives the chosen item's value. */ onSelect?: (value: string) => void; } /** Plus any Base UI `