import { Accessibility, MenuButtonBehaviorProps } from '@fluentui/accessibility'; import { StyledComponentProps } from '../../utils'; import { ShorthandValue, ComponentEventHandler, ShorthandCollection, FluentComponentStaticProps } from '../../types'; import { PopupProps, PopupEvents, PopupEventsArray } from '../Popup/Popup'; import { MenuProps } from '../Menu/Menu'; import { MenuItemProps } from '../Menu/MenuItem'; import { PositioningProps } from '../../utils/positioner'; import { ComponentWithAs } from '@fluentui/react-bindings'; export interface MenuButtonSlotClassNames { menu: string; } export interface MenuButtonProps extends StyledComponentProps, PositioningProps { /** * Accessibility behavior if overridden by the user. * @default menuButtonBehavior */ accessibility?: Accessibility; /** Additional CSS class name(s) to apply. */ className?: string; /** Initial value for 'open'. */ defaultOpen?: boolean; /** Existing element the popup should be bound to. */ mountNode?: HTMLElement; /** Delay in ms for the mouse leave event, before the popup will be closed. */ mouseLeaveDelay?: number; /** Events triggering the popup. */ on?: PopupEvents | PopupEventsArray; /** Defines whether popup is displayed. */ open?: boolean; /** * Called after user's click on a menu item. * * @param event - React's original SyntheticEvent. * @param data - All props. */ onMenuItemClick?: ComponentEventHandler; /** * Event for request to change 'open' value. * @param event - React's original SyntheticEvent. * @param data - All props and proposed value. */ onOpenChange?: ComponentEventHandler; /** A popup can show a pointer to trigger. */ pointing?: boolean; /** * DOM element that should be used as popup's target - instead of 'trigger' element that is used by default. */ target?: HTMLElement; /** Element to be rendered in-place where the popup is defined. */ trigger?: JSX.Element; /** Whether the trigger should be tabbable */ tabbableTrigger?: boolean; /** Shorthand for menu configuration */ menu?: ShorthandValue | ShorthandCollection; /** Determines if the MenuButton behaves as context menu */ contextMenu?: boolean; } export interface MenuButtonState { open: boolean; menuId: string; triggerId: string; } export declare const menuButtonClassName = "ui-menubutton"; export declare const menuButtonSlotClassNames: MenuButtonSlotClassNames; export declare type MenuButtonStylesProps = never; /** * A MenuButton displays a menu connected to trigger element. * @accessibility */ export declare const MenuButton: ComponentWithAs<'div', MenuButtonProps> & FluentComponentStaticProps;