import { SpringValue, SpringConfig } from 'react-spring'; import { StyleProps } from './styles'; import { AnimationFunction } from './animation'; import { PopupPlacement, PopupSide } from './PopupController'; export interface MenuProps extends StyleProps<[MenuProps]> { /** Content of the dropdown menu */ menu: (props: MenuRenderProps) => React.ReactNode; /** Trigger element that menu will be attached to */ children: (ref: any, props: MenuRenderProps) => React.ReactNode; /** Placement of the menu relative to the target */ placement?: Partial; /** Function that is called when `` is selected */ onSelect?: (value?: string) => void; /** Whether the menu should close when an item is selected */ closeOnSelect?: boolean; /** Component for hide and show animation */ animation?: AnimationFunction; /** Maximum height of the list, in px. */ maxHeight?: number; /** Select first item on open */ autoSelectFirstItem?: boolean; /** If `true`, menu width will match the width of the button element. */ matchWidth?: boolean; /** Config for `react-spring` animation */ springConfig?: SpringConfig; } export interface MenuListProps extends StyleProps<[MenuListProps]> { children: React.ReactNode; focusLock: boolean; onFocus?: () => void; onBlur?: () => void; onClose: () => void; onSelect?: (value?: string) => void; autoSelectFirstItem: boolean; closeOnSelect?: boolean; } export interface MenuItemProps extends StyleProps<[MenuItemProps, { isSelected: boolean; }]> { /** Value of the item that will be passed to the `onSelect()` handler of * the Menu */ value?: string; /** * Handler that is called when the item is selected by clicking on it or * pressing the `Enter` key */ onSelect?: () => void; isDisabled?: boolean; onHover?: () => void; onBlur?: () => void; children: React.ReactNode | ((isSelected: boolean) => React.ReactNode); } declare const MenuItem: import("react").ForwardRefExoticComponent>; declare const MenuList: import("react").ForwardRefExoticComponent>; export type MenuRenderProps = { isOpen: boolean; isActive: boolean; open: () => void; close: () => void; side: PopupSide; triggerWidth: number; openValue: SpringValue; }; declare const Menu: (inProps: MenuProps) => import("react/jsx-runtime").JSX.Element; export { Menu, MenuList, MenuItem };