import { ReactNode } from 'react'; /** An entry in a {@link MenuBar} dropdown. */ export interface IMenuItem { /** Stable identifier reported to `onSelect`. */ id: string; /** Label shown in the dropdown. */ label: string; /** Keybinding hint shown right-aligned, e.g. `"⌘S"`. */ keybinding?: string; /** Nested items. An item with a submenu is not itself selectable. */ submenu?: IMenuItem[]; } export interface MenuBarProps { /** * Menus keyed by top-level label, e.g. `{ File: [...], Edit: [...] }`. * Insertion order determines display order. */ menus?: Record; /** Called with the chosen leaf item. Items with a `submenu` never fire this. */ onSelect?: (item: IMenuItem) => void; /** * Branding shown at the far left. Pass a string, a logo element, or omit it * for the default wordmark. Providing a `title` switches the bar to its * taller, translucent variant. */ title?: ReactNode; /** * Slot between the menus and the right edge, sized for a search input. The * bar renders whatever you pass — it does not embed a search component. */ center?: ReactNode; /** Slot at the far right, for a theme switcher, avatar, or actions. */ right?: ReactNode; /** Extra classes merged onto the root `
`. */ className?: string; } /** * The application menu bar: a row of menu buttons with dropdowns and optional * one-level submenus, plus slots for branding, a centre widget and right-hand * actions. * * Presentational and fully controlled — menus come in as data and selections go * out through `onSelect`. It reads no registry. For the variant wired to the * {@link menuRegistry} and {@link commandRegistry}, see `ConnectedMenuBar`. * * # Open and closed are state, not hover * * The menus used to be CSS hover: shown while the pointer was over them. So a * menu stayed open after an item was chosen (the pointer was still there), * Escape could not close it, and a keyboard could not open one at all. Now a * menu opens on a click or a key and closes when an item is chosen, on * Escape, on Tab, or on a click elsewhere. While one is open, pointing at * another switches to it, as desktop menu bars do. * * Keys, following the WAI-ARIA menu button pattern: Enter, Space or ↓ on a * menu name opens it at its first item, ↑ at its last; ↑ ↓ Home End move * through items; ← → move to the neighbouring menu; → or Enter on an item with * a submenu opens it and ← closes it; Escape closes and returns focus to the * menu's name. * * @example * ```tsx * run(item.id)} * right={} * /> * ``` */ export declare const MenuBar: ({ menus, onSelect, title, center, right, className, }: MenuBarProps) => import("react/jsx-runtime").JSX.Element;