import { Placement, UseFloatingOptions } from '@floating-ui/react'; import { AriaAttributes, KeyboardEvent, ReactElement, RefObject } from 'react'; export 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; onKeyDown?: (e: KeyboardEvent) => 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; };