import { Placement, UseFloatingOptions } from '@floating-ui/react'; import { ReactElement, AriaAttributes, RefObject } from 'react'; import { ButtonProps } from '../Button'; import { IconProps } from '../Icon'; type MenuReturnProps = { "data-open"?: boolean; "aria-controls"?: AriaAttributes["aria-controls"]; "aria-expanded"?: AriaAttributes["aria-expanded"]; "aria-haspopup"?: AriaAttributes["aria-haspopup"]; "data-state": "open" | "close"; onClick?: () => void; ref?: RefObject; }; /** * Common props shared between Menu components * @extends ComponentPropsWithoutRef<"button"> */ export type MenuCommonProps = { /** * Disables the shift of floating element * @internal */ disableShift?: boolean; /** * Disables the flip of floating element * @internal */ disableFlip?: boolean; /** * Disables the flip cross-axis fallback of floating element * @internal */ disableFlipFallback?: boolean; /** * Changes height and positioning for select/combobox * @default bottom-start */ placement?: Extract; /** @deprecated to be removed on next major - Menu should open by user interaction */ open?: boolean; /** @deprecated to be removed on next major - Menu should open by user interaction */ defaultOpen?: boolean; /** * Callback fired when the menu opens or closes */ onOpenChange?: UseFloatingOptions["onOpenChange"]; /** * Callback fired when clicking outside the menu */ onOutsidePress?: (e: globalThis.MouseEvent) => void; /** * Disables automatic height adjustment for the menu */ disableAutoHeight?: boolean; /** * Custom trigger element render function */ trigger?: (props: MenuReturnProps) => ReactElement; /** * The label text displayed on the menu button */ label?: string; contentClassName?: string; /** * Maximum height of the popover content */ maxHeight?: number | string; /** * @deprecated to be removed on next major * This is not needed anymore as the Popover API is used. * Popover API uses top-layer for its popover content. */ root?: HTMLElement | React.MutableRefObject | null; }; /** * Props for the Menu component * @extends Omit * @extends MenuCommonProps */ export type MenuProps = Omit & MenuCommonProps & { /** * Icon to display on the menu button */ icon?: IconProps["svg"]; }; /** * Context props for Menu components */ export type MenuContextProps = { /** * Function to close the root menu */ closeRootMenu: () => void; /** * Whether auto height is disabled */ disableAutoHeight: MenuProps["disableAutoHeight"]; }; export declare const MenuContext: import('react').Context; export declare const MenuElement: import('react').ForwardRefExoticComponent & MenuCommonProps & { /** * Icon to display on the menu button */ icon?: IconProps["svg"]; } & import('react').RefAttributes>; /** * Menu component for displaying dropdown menus with navigation and actions. * * Features: * - Supports both controlled and uncontrolled modes * - Automatic positioning with fallback strategies * - Keyboard navigation with arrow keys and escape * - Custom trigger elements * - Nested menu support * - Automatic height adjustment * - Scroll indicators for overflow content * - Fully accessible with proper ARIA attributes * - Popover API support with legacy fallback * - Outside click detection and handling * * @example * * console.log('Cut clicked')} /> * console.log('Copy clicked')} /> * * console.log('Copy as Text')} /> * console.log('Copy as Video')} /> * * console.log('Copy as PNG')} /> * console.log('Copy as JPG')} /> * * */ export declare const Menu: import('react').ForwardRefExoticComponent & MenuCommonProps & { /** * Icon to display on the menu button */ icon?: IconProps["svg"]; } & import('react').RefAttributes> & { /** * MenuItem component for individual menu options. * * Features: * - Supports icons and labels * - Keyboard navigation support * - Disabled state handling * - Automatic menu closing on selection * - Fully accessible with proper ARIA attributes * - Focus management and tab index handling * - Click and mouse enter event handling * * @example * console.log('Edit profile clicked')} * /> */ Item: import('react').ForwardRefExoticComponent<{ icon?: IconProps["svg"]; label: import('react').ReactNode; disabled?: boolean; } & Omit, HTMLButtonElement>, "ref"> & import('react').ButtonHTMLAttributes & import('react').RefAttributes>; }; export {};