import { Menu as HeadlessMenu, MenuItem as HeadlessMenuItem, MenuItems as HeadlessMenuItems, MenuButton as HeadlessMenuButton, MenuSection as HeadlessMenuSection, MenuHeading as HeadlessMenuHeading, MenuSeparator as HeadlessMenuSeparator } from '@headlessui/react'; import type { MouseEventHandler, HTMLAttributeAnchorTarget } from 'react'; import React from 'react'; import type { ExtractProps } from '../../util/utility-types'; import type { PopoverListItemProps } from '../PopoverListItem/PopoverListItem'; export type MenuProps = ExtractProps & { /** * Allow custom classes to be applied to the menu container. */ className?: string; }; export type MenuButtonProps = { /** * The button contents placed left of the chevron icon. */ children: string; /** * Allow custom classes to be applied to the menu button. */ className?: string; }; export type MenuSeparatorProps = ExtractProps; export type MenuPlainButtonProps = ExtractProps; export type MenuHeadingProps = ExtractProps; export type MenuSectionProps = ExtractProps; export type MenuItemsProps = ExtractProps; export type MenuItemProps = ExtractProps & PopoverListItemProps & { anchor?: MenuItemsProps['anchor']; /** * Target URL for the menu item action */ href?: string; /** * Configurable action for the menu item upon click */ onClick?: MouseEventHandler; __type?: PopoverListItemProps['__type']; /** * Specify the target of the link if present */ target?: HTMLAttributeAnchorTarget; }; /** * ## Usage * * | Type/Use | Description | Example | * |----------|-------------|---------| * | Dropdown | A list of actions or links that appears when a button or label is clicked. | Filter selectors; user profile actions; navigation inside buttons. | * | Context | Appears on right-click or long-press; offers contextual options. | File actions; custom user interactions. | * | Hamburger | Collapsible navigation menu, often hidden behind an icon. | Mobile nav; space-constrained UIs. | * | Overflow/More | Compact menu for additional actions, often shown as "⋮" or "...". | Table row actions; toolbar options. | * * ## Interaction * * The most common trigger for a Menu is a button with a chevron. An icon-only button might also trigger a Menu, and designers can define a custom trigger. * * ## Content & Accessibility * * ### Do's * * * Use short, precise labels. * * Place the most-used options at the top of the menu. * * Group similar commands, and order meaningfully in long menus using dividers between sections. * * ### Don'ts * * * Overload menus; try to stay below 12 options in a menu. * * Use helper text with menu options unless absolutely necessary. * * Truncate menu items unless absolutely necessary. If truncation is required, use a tooltip to reveal the full text on hover. */ export declare const Menu: { ({ className, ...other }: MenuProps): React.JSX.Element; displayName: string; PlainButton: { ({ className, ...other }: MenuPlainButtonProps): React.JSX.Element; displayName: string; }; Separator: { (props: MenuSeparatorProps): React.JSX.Element; displayName: string; }; Heading: { (props: MenuHeadingProps): React.JSX.Element; displayName: string; }; Section: { (props: MenuSectionProps): React.JSX.Element; displayName: string; }; Button: { (props: MenuButtonProps): React.JSX.Element; displayName: string; }; Items: { ({ anchor, ...other }: MenuItemsProps): React.JSX.Element; displayName: string; }; Item: { ({ children, className, href, onClick, target, isDestructiveAction, isFocused, isDisabled, leadingContent, subLabel, trailingContent, __type, ...other }: MenuItemProps): React.JSX.Element; displayName: string; }; };