import { OverrideProps } from '@mui/types'; import { ElementType } from 'react'; import { BackdropProps } from '../Backdrop'; import { PaperProps } from '../Paper'; import { PopoverProps } from '../Popover'; import { TransitionProps } from '../transitions'; import { CreateSlotsAndSlotProps, SlotCommonProps, SlotProps } from '../types/slot'; export type MenuSlot = 'root'; export interface MenuSlots { /** * The component that renders the root. * @default 'div' */ root?: React.ElementType; /** * The component that renders the root. * @default 'ul' */ listbox?: React.ElementType; /** * The component used for the paper. * @default PopoverPaper */ paper?: React.ElementType; /** * The component used for the transition slot. * @default Grow */ transition?: React.ElementType; /** * The component used for the backdrop slot. * @default Backdrop */ backdrop?: React.ElementType; } export type MenuSlotsAndSlotProps = CreateSlotsAndSlotProps; listbox: SlotProps<'ul', object, MenuOwnerState>; paper: SlotProps, object, MenuOwnerState>; backdrop: SlotProps, object, MenuOwnerState>; transition: SlotProps; }>; export interface MenuTypeMap

{ props: P & MenuSlotsAndSlotProps & Omit & { /** * Whether the menu is currently open. */ open?: boolean; /** * The `size` attribute for the MenuItem. If both `size` and `density` are provided, `size` will take precedence. * @default 'medium' */ size?: 'small' | 'medium' | 'large'; /** * The `density` attribute for the MenuItem. It will be mapped to `size` internally. * @deprecated Use the `size` prop instead. The `density` prop will be removed in future major release. */ density?: 'compact' | 'standard' | 'comfortable'; /** * Triggered when focus leaves the menu and the menu should close (e.g., when the user clicks the `MenuItem` or press the `Esc` key). */ onClose?: () => void; /** * Function called when the items displayed in the menu change. */ onItemsChange?: (items: string[]) => void; }; defaultComponent: D; } export type MenuProps = OverrideProps, D>; export interface MenuOwnerState extends MenuProps { }