import type { JSX } from "@solidjs/web"; import { type MaybeAccessor } from "../../internals/maybe-accessor.js"; import type { MenuHandle } from "../store/menu-store.js"; import { type MenuPayloadChildRenderFunction, type MenuRootChangeEventDetails, type MenuRootChangeEventReason, type MenuRootOrientation } from "./menu-root-context.js"; export type { MenuRootChangeEventDetails, MenuRootChangeEventReason }; export interface MenuRootActions { /** Force-unmount the menu popup subtree. */ unmount: () => void; /** Imperatively close the menu. */ close: () => void; } export type MenuRootState = Record; export interface MenuRootProps { /** * Controlled open state. When provided (resolved value not * `undefined`), the consumer owns the state — pair with * {@link onOpenChange}. When omitted, the menu manages its own open * state (seeded from {@link defaultOpen}). */ open?: MaybeAccessor; /** * Initial open state when uncontrolled. Read once at mount. * @default false */ defaultOpen?: MaybeAccessor; /** Whether arrow keys loop at the ends. @default true */ loopFocus?: boolean | undefined; /** Highlight items on hover. @default true */ highlightItemOnHover?: boolean | undefined; /** Modal mode — locks outside interaction while open. @default true */ modal?: boolean | undefined; /** Called when the menu opens or closes. */ onOpenChange?: ((open: boolean, eventDetails: MenuRootChangeEventDetails) => void) | undefined; /** Called after any animations complete when the menu is closed. */ onOpenChangeComplete?: ((open: boolean) => void) | undefined; /** Visual/keyboard orientation. @default "vertical" */ orientation?: MenuRootOrientation | undefined; /** Whether the menu ignores user interaction. @default false */ disabled?: boolean | undefined; /** Escape-key bubbling in submenus. @default false */ closeParentOnEsc?: boolean | undefined; /** Imperative actions surface. */ actionsRef?: ((actions: MenuRootActions | null) => void) | { current: MenuRootActions | null; } | undefined; /** * ID of the trigger associated with the menu (controlled). When supplied, * the root uses this as the active trigger id for positioning + focus return. */ triggerId?: string | null | undefined; /** * Handle to connect the root with detached `` * components. Allows external triggers to drive the menu's open * state and to associate multiple triggers with one menu. */ handle?: MenuHandle | undefined; /** * Children. May be a regular node or a render function that receives the * active trigger's payload. */ children?: JSX.Element | MenuPayloadChildRenderFunction; } /** * Groups all parts of a menu. Renders no DOM element — the root is a pure * context provider. Wraps itself in a `` when not already * inside one. */ export declare function MenuRoot(props: MenuRootProps): JSX.Element; //# sourceMappingURL=menu-root.d.ts.map