import React from 'react'; import { type AriaMenuProps } from 'react-aria'; import { Section } from '@react-stately/collections'; import type { ItemProps } from '@react-types/shared'; export interface MenuProps extends AriaMenuProps { className?: string; style?: React.CSSProperties; } export interface MenuItemProps extends ItemProps { /** * Only on a row that opens a submenu: the row's label. Its children are then * the submenu's MenuItems rather than its label. Submenus open only inside a * MenuTrigger — a standalone Menu has nothing to open them from. */ title?: React.ReactNode; /** Figma's `Show Leading Icon` + `Leading Icon` swap. */ icon?: React.ReactNode; /** Whether the item is disabled. Listed, skipped by the arrow keys. */ isDisabled?: boolean; /** * @deprecated Use `isDisabled`. Accepted as an alias for one minor version. */ disabled?: boolean; /** * @deprecated Put the item's key in Menu's `selectedKeys`. Accepted for one * minor version: when no item's key is in `selectedKeys` and Menu is given * neither `selectedKeys` nor `defaultSelectedKeys`, the items passing this * become the selection. */ isSelected?: boolean; } /** * One row of a Menu. A collection element, like TabItem: it renders nothing * itself — Menu reads its props and draws the row — so it only means anything * as a direct child of Menu or MenuSection. Give it a `key`; that key is what * `onAction` and `selectedKeys` speak in. */ export declare function MenuItem(_props: MenuItemProps): React.ReactElement | null; export declare namespace MenuItem { var displayName: string; } /** * A named group of MenuItems. `title` is Figma's `Menu Section Title`; without * one, pass `aria-label` and the group is set off by a rule instead. */ export { Section as MenuSection }; /** * Menu — Figma `Menu` (82:306), `Menu Item` and `Menu Section Title`. * * A real ARIA menu: `role="menu"`, one tab stop, arrow keys, Home and End, * typeahead, and disabled rows listed but skipped. Figma's `Type` is * `selectionMode` — Single draws one check, Multi draws several — and with * a selection mode the rows become `menuitemradio` / `menuitemcheckbox` and * announce their checked state. * * On its own it is the surface only, rendered in flow. Inside a MenuTrigger it * floats, opens and closes, is named by its trigger, and can open submenus. */ export declare const Menu: (props: MenuProps & { ref?: React.Ref; }) => React.ReactElement; export type MenuTriggerPlacement = 'bottom start' | 'bottom end' | 'top start' | 'top end'; export interface MenuTriggerProps { /** * Exactly two children: the Button that opens the menu, then the Menu. The * Button must accept a ref and react-aria press props — IonBase's Button * does; a plain `