import type { JSX } from "@solidjs/web"; /** * `createMenubar` — headless primitive for the Menubar compound. * * Owns: * - `orientation` — horizontal or vertical. * - `modal` — modal mode flag. * - `disabled` — whole-menubar disabled state. * - `loopFocus` — whether arrow-key navigation wraps. * - `hasSubmenuOpen` — whether any child menu is currently open. * - `registerOpenMenu` / `closeAll` — single-open coordinator. * * DOM concerns (FloatingTree, FloatingNode, role="menubar" element, keyboard * handler) stay in ``. */ import { type Accessor } from "solid-js"; import { type MaybeAccessor } from "../internals/maybe-accessor.js"; import type { MenuRootOrientation } from "../menu/root/menu-root-context.js"; export interface CreateMenubarOptions { /** * The orientation of the menubar. * @default "horizontal" */ orientation?: MaybeAccessor; /** * Whether the menubar is modal. * @default true */ modal?: MaybeAccessor; /** * Whether the whole menubar is disabled. * @default false */ disabled?: MaybeAccessor; /** * Whether arrow-key focus loops at the ends. * @default true */ loopFocus?: MaybeAccessor; } export interface MenubarApi { /** Visual/keyboard orientation. */ orientation: Accessor; /** Whether the menubar is modal. */ modal: Accessor; /** Whether the whole menubar is disabled. */ disabled: Accessor; /** Whether arrow-key focus loops at the ends. */ loopFocus: Accessor; /** Whether any child menu is currently open. */ hasSubmenuOpen: Accessor; /** * Called by a child menu when it opens. Returns an unregister fn the * child should call on close / unmount. Enforces single-open invariant * by closing the previously-open sibling. */ registerOpenMenu: (closer: () => void) => () => void; /** Force-close all registered open menus. */ closeAll: () => void; /** * Internal — called by a child `` when its open state changes. * Both register and direct setHasSubmenuOpen paths are preserved for * idempotency (matches existing Menubar implementation). */ setHasSubmenuOpen: (open: boolean) => void; /** Context provider — expose the api via `useMenubar()`. */ Provider: (props: { children: JSX.Element; }) => JSX.Element; } /** * Read the nearest {@link MenubarApi}. Throws unless `optional` is true. */ export declare function useMenubar(): MenubarApi; export declare function useMenubar(optional: true): MenubarApi | null; /** * Headless primitive for the Menubar compound. Owns logical state — orientation, * modal, disabled, loopFocus, hasSubmenuOpen, and the single-open coordinator. * DOM concerns (FloatingTree, role="menubar" element, keyboard handler) live * in ``. */ export declare function createMenubar(options?: CreateMenubarOptions): MenubarApi; //# sourceMappingURL=create-menubar.d.ts.map