import * as React from 'react'; import type { ButtonProps } from "../Button/index.js"; import type { MenuProps } from "../Menu/index.js"; import type { PopupProps } from "../Popup/index.js"; import type { DropdownMenuItem, DropdownMenuItemAction, DropdownMenuItemMixed, DropdownMenuSize } from "./types.js"; import "./DropdownMenu.css"; type SwitcherProps = { onKeyDown: React.KeyboardEventHandler; onClick: React.MouseEventHandler; }; export type DropdownMenuProps = { /** * Array of items. * Nested arrays of items represent visually separated groups. */ items?: (DropdownMenuItem | DropdownMenuItem[])[]; /** * Switcher icon. */ icon?: React.ReactNode; open?: boolean; onOpenToggle?: (open: boolean) => void; hideOnScroll?: boolean; /** * Applied for the switcher and the menu. */ size?: DropdownMenuSize; /** * A payload passed to the actions called from the menu. * (Can be useful for context menus.) */ data?: T; /** * Setting this prop to `true` disables the switcher button * and prevents the menu from being opened. */ disabled?: boolean; /** * Menu toggle control. * @deprecated Use renderSwitcher instead */ switcher?: React.ReactNode; /** * Menu toggle control. */ renderSwitcher?: (props: SwitcherProps) => React.ReactNode; switcherWrapperClassName?: string; /** * Overrides the default switcher button props. */ defaultSwitcherProps?: ButtonProps; defaultSwitcherClassName?: string; onSwitcherClick?: React.MouseEventHandler; /** * Overrides the default dropdown menu props. */ menuProps?: Partial; /** * Overrides the default dropdown popup props. */ popupProps?: Partial; /** * Custom content inside the menu popup. */ children?: React.ReactNode; }; export type ControlledDropdownMenuProps = DropdownMenuProps & { open: boolean; onOpenToggle: React.Dispatch>; }; declare const DropdownMenuExport: (({ items, size, icon, open, onOpenToggle, hideOnScroll, data, disabled, switcher, renderSwitcher, switcherWrapperClassName, defaultSwitcherProps, defaultSwitcherClassName, onSwitcherClick, menuProps, popupProps, children, }: DropdownMenuProps | ControlledDropdownMenuProps) => import("react/jsx-runtime").JSX.Element) & { Item: ({ text, action, items: subMenuItems, popupProps, closeMenu, children, path, size, ...props }: import("./DropdownMenuItem.js").DropdownMenuItemProps) => import("react/jsx-runtime").JSX.Element; }; export { DropdownMenuExport as DropdownMenu }; export type { DropdownMenuItem, DropdownMenuItemMixed, DropdownMenuItemAction };