/** * Dependency-free anchored menu with the Studio part API used by Veryfront. * It provides menu ARIA wiring, roving keyboard navigation, typeahead, focus * restoration, collision-aware positioning, and outside/Escape dismissal. * * @module react/components/ui/dropdown-menu */ import * as React from "react"; import { type PolymorphicButtonAttributes } from "./slot.js"; import { type AnchoredSlottedTriggerProps, type AnchoredTriggerPublicProps } from "./anchored-surface.js"; /** Props accepted by ``. */ export interface DropdownMenuProps { children: React.ReactNode; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; } /** DropdownMenu root — owns open state and the positioning anchor. */ export declare function DropdownMenu(props: DropdownMenuProps): React.ReactElement; /** * Trigger — toggles the menu; the positioning anchor. `asChild` merges onto * the child element, which must forward `ref` to its DOM node. */ export interface DropdownMenuTriggerProps extends AnchoredTriggerPublicProps { } /** Literal slotted trigger contract with an element-specific ref. */ export type DropdownMenuSlottedTriggerProps = AnchoredSlottedTriggerProps; export declare function DropdownMenuTrigger(props: DropdownMenuSlottedTriggerProps): React.ReactElement; export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): React.ReactElement; /** Props accepted by ``. */ export interface DropdownMenuContentProps extends React.HTMLAttributes { /** Horizontal alignment relative to the trigger. */ align?: "start" | "end"; /** Consumer ref for the rendered menu surface. */ ref?: React.Ref; } /** Menu surface — rendered below the trigger while open. No border (Studio). */ export declare function DropdownMenuContent({ children, className, align, onKeyDown, ...props }: DropdownMenuContentProps): React.ReactElement | null; /** Groups related items with a tight inner gap (Studio: `gap-px p-0.5`). */ export declare function DropdownMenuGroup({ children, className }: { children: React.ReactNode; className?: string; }): React.ReactElement; /** * Backward-compatible props accepted by ``. * * Keep this as an interface with a broad boolean `asChild` so existing wrapper * interfaces, conditional `asChild` values, and prop spreads remain valid. * The component overload below adds the element-specific contract for callers * that opt into a literal `asChild` value. */ export interface DropdownMenuItemProps extends Omit, "onSelect"> { /** Called when the item is chosen (also closes the menu). */ onSelect?: (event: React.MouseEvent) => void; /** `asChild` merges item styling and behavior onto one child element. */ asChild?: boolean; ref?: React.Ref; } /** Slotted-element props accepted by ``. */ export type DropdownMenuSlottedItemProps = Omit, "children" | "ref" | "type"> & { /** Called when the item is chosen (also closes the menu). */ onSelect?: (event: React.MouseEvent) => void; /** Merge menu-item behavior and styling onto one custom child element. */ asChild: true; children: React.ReactElement; disabled?: boolean; /** Applied only when `children` is an intrinsic `