import { default as React, HTMLAttributes, ReactNode, RefObject } from 'react'; import { MotionAnimation, MotionStyle } from '../../types'; import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFloatingMode, ElementFocusEffect, ElementFont, ElementPlacement, ElementSelectedEffect, ElementShape, ElementTouchEffect, SurfaceColor } from '../../utils'; /** * Visual style preset for the Menu component. * * - `modern` – MD3 menu (expressive). * - `classic` – MD3 menu (baseline). * * @category Menu */ export type MenuVariant = 'modern' | 'classic'; /** * Animation setting for the Menu component. * * - `auto` – resolves to the default animation (`"scale"`). * - `none` – disables all animations. * - `MotionAnimation` – any supported motion animation type. * * @category Menu */ export type MenuAnimation = 'auto' | 'none' | MotionAnimation; /** * Props for the {@link Menu} component. * * @category Menu */ export interface MenuProps extends Omit, 'color'> { /** Reference to the trigger element used for positioning. */ anchorRef?: RefObject | null; /** Animation setting (`auto`, `none`, or motion animation type). */ animation?: MenuAnimation; /** Border width (0–4). */ border?: ElementBorder; /** Border color token. */ borderColor?: BorderColor; /** Icon used for checked checkbox items. */ checkedIcon?: ReactNode; /** Menu items. Must be `MenuItem` or compatible custom nodes. */ children?: ReactNode; /** Whether menu closes automatically on item change. */ closeOnChange?: boolean; /** Surface background token for the menu container. */ color?: SurfaceColor; /** Density preset (`comfortable`, `compact`, `dense`). */ density?: ElementDensity; /** Text color for item descriptions. */ descriptionColor?: SurfaceColor; /** Font token applied to menu item descriptions. */ descriptionFont?: ElementFont; /** Enables docked positioning mode. */ docked?: boolean; /** Elevation level of the menu surface when docked. */ dockedElevation?: ElementElevation; /** Duration (ms) of open/close animation. Default: 250 */ duration?: number; /** Elevation level of the menu surface. */ elevation?: ElementElevation; /** Reserves leading slot for all menu items. */ fixedLeading?: boolean; /** Floating behaviour mode (`menu`, `submenu`, `dropdown`, `tooltip`). */ floatingMode?: ElementFloatingMode; /** Alias for labelFont */ font?: ElementFont; /** Enables horizontal menu layout. */ horizontal?: boolean; /** Focus effects applied to menu items. */ itemFocusEffects?: ElementFocusEffect[]; /** Selected state effects applied to menu items. */ itemSelectedEffects?: ElementSelectedEffect[]; /** Touch and click feedback effects for menu items. */ itemTouchEffects?: ElementTouchEffect[]; /** Text color for item labels. */ labelColor?: SurfaceColor; /** Font token applied to menu item primary labels. */ labelFont?: ElementFont; /** Motion style variant (expressive or regular). */ motionStyle?: MotionStyle; /** Offset (px) between menu and anchor. @default 4 */ offset?: number; /** Callback fired when the menu requests to close. */ onClose?: () => void; /** Controls visibility of the menu. */ open?: boolean; /** Opens the menu on pointer hover. */ openOnHover?: boolean; /** Preferred placement relative to the anchor. */ placement?: ElementPlacement; /** Icon used for checked radio items. */ radioCheckedIcon?: ReactNode; /** Icon used for unchecked radio items. */ radioUncheckedIcon?: ReactNode; /** Background color used for selected items. */ selectedColor?: SurfaceColor; /** Shape token controlling menu corner rounding. */ shape?: ElementShape; /** Text color for shortcut labels. */ shortcutColor?: SurfaceColor; /** Font token applied to menu item shortcut labels. */ shortcutFont?: ElementFont; /** Overrides automatic text color. */ textColor?: SurfaceColor; /** Icon used for unchecked checkbox items. */ uncheckedIcon?: ReactNode; /** Visual preset (`modern` = MD3 expressive, `classic` = MD3 baseline). */ variant?: MenuVariant; } /** * Internal props used for nested and recursive menu rendering. * * These props are injected automatically by the Menu system * and must not be provided manually. * * @category Menu * @internal */ export interface MenuInternalProps { /** Closes the root menu instance. */ __closeRootMenu?: () => void; /** Shared group identifier for nested menus. */ __groupId?: string; /** Horizontal nesting depth for keyboard navigation. */ __horizontalDepth?: number; /** Nesting depth of the menu tree (0 = root). */ __level?: number; /** Handles horizontal navigation between sibling menus. */ __navigateHorizontal?: (goNext: boolean) => void; } /** * **Menu** - menu component with optional docking and multi-level submenus. * * Renders a menu component following the MD3 specification. * The menu can be positioned relative to an anchor element using floating * layout logic or rendered in a docked mode without floating positioning. * * Supports nested submenus, keyboard navigation, * motion configuration, density presets, elevation, shape, borders * and two MD3 visual variants (`modern`, `classic`). * * * @param props * * @example * ```tsx * * * * * * ``` * * @example * ```tsx * * * * * ``` * * @example * ```tsx * * * * * * * * * ``` * * @category Menu * @function */ export declare const Menu: React.ForwardRefExoticComponent>;