import { Factory, StylesApiProps } from '../../core'; import { __PopoverProps, PopoverStylesNames } from '../Popover'; import { type MenuContextValue } from './Menu.context'; import { MenuDivider, type MenuDividerProps } from './MenuDivider/MenuDivider'; import { MenuDropdown, type MenuDropdownProps } from './MenuDropdown/MenuDropdown'; import { MenuItem, type MenuItemProps } from './MenuItem/MenuItem'; import { MenuLabel, type MenuLabelProps } from './MenuLabel/MenuLabel'; import { MenuSub, type MenuSubProps } from './MenuSub/MenuSub'; import { MenuTarget, type MenuTargetProps } from './MenuTarget/MenuTarget'; import type { MenuSubDropdownProps } from './MenuSubDropdown/MenuSubDropdown'; import type { MenuSubItemProps } from './MenuSubItem/MenuSubItem'; import type { MenuSubTargetProps } from './MenuSubTarget/MenuSubTarget'; export type MenuStylesNames = 'item' | 'itemLabel' | 'itemSection' | 'label' | 'divider' | 'chevron' | PopoverStylesNames; export type MenuFactory = Factory<{ props: MenuProps; stylesNames: MenuStylesNames; staticComponents: { Item: typeof MenuItem; Label: typeof MenuLabel; Dropdown: typeof MenuDropdown; Target: typeof MenuTarget; Divider: typeof MenuDivider; Sub: typeof MenuSub; }; }>; export interface MenuProps extends __PopoverProps, StylesApiProps { variant?: string; /** Menu children */ children?: React.ReactNode; /** Controlled menu opened state */ opened?: boolean; /** Uncontrolled menu initial opened state */ defaultOpened?: boolean; /** If set, focus is trapped within the menu dropdown when it is opened */ trapFocus?: boolean; /** Called when menu opened state changes */ onChange?: (opened: boolean) => void; /** Called when Menu is opened */ onOpen?: () => void; /** Called when Menu is closed */ onClose?: () => void; /** If set, the Menu is closed when one of the items is clicked. Can be overridden per item with `closeMenuOnClick` prop */ closeOnItemClick?: boolean; /** If set, arrow key presses wrap around from last item to first and vice versa */ loop?: boolean; /** If set, the dropdown is closed when the `Escape` key is pressed @default true */ closeOnEscape?: boolean; /** Event trigger to open menu. Note: 'hover' is not keyboard accessible; prefer 'click-hover' for accessible hover menus */ trigger?: 'click' | 'hover' | 'click-hover'; /** Open delay in ms, applicable only to `trigger="hover"` variant */ openDelay?: number; /** Close delay in ms, applicable only to `trigger="hover"` variant */ closeDelay?: number; /** If set, the dropdown is closed on outside clicks */ closeOnClickOutside?: boolean; /** Events that trigger outside click detection. Includes mousedown for desktop clicks, touchstart for mobile, and keydown for Escape key handling @default ['mousedown', 'touchstart', 'keydown'] */ clickOutsideEvents?: string[]; /** Id base to create accessibility connections */ id?: string; /** Set the `tabindex` on all menu items. Use `0` to allow Tab key navigation through menu items (required for navigation menus following WAI-ARIA disclosure pattern). @default -1 */ menuItemTabIndex?: -1 | 0; /** Adds a hidden focusable element at the start of the dropdown to prevent unexpected focus jumps when opening with keyboard. Set to false if you need custom focus management. @default true */ withInitialFocusPlaceholder?: boolean; /** Determines whether focus should be automatically returned to control when dropdown closes @default `true` */ returnFocus?: boolean; } export declare const Menu: import("../..").MantineComponent<{ props: MenuProps; stylesNames: MenuStylesNames; staticComponents: { Item: typeof MenuItem; Label: typeof MenuLabel; Dropdown: typeof MenuDropdown; Target: typeof MenuTarget; Divider: typeof MenuDivider; Sub: typeof MenuSub; }; }>; export declare namespace Menu { type Props = MenuProps; type StylesNames = MenuStylesNames; type Factory = MenuFactory; type ContextValue = MenuContextValue; namespace Item { type Props = MenuItemProps; } namespace Label { type Props = MenuLabelProps; } namespace Divider { type Props = MenuDividerProps; } namespace Dropdown { type Props = MenuDropdownProps; } namespace Target { type Props = MenuTargetProps; } namespace Sub { type Props = MenuSubProps; } namespace SubDropdown { type Props = MenuSubDropdownProps; } namespace SubItem { type Props = MenuSubItemProps; } namespace SubTarget { type Props = MenuSubTargetProps; } }