import { type ComponentPropsWithoutRef, type ReactNode } from 'react'; import * as RadixDropdownMenu from '@radix-ui/react-dropdown-menu'; import { type VariantProps } from 'class-variance-authority'; import { type KbdNamedKey } from '../kbd/kbd'; declare const contentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string; /** A named settings row (a ChoiceSub or SwitchItem given a `name`) and * its current state, as an agent reads it. Values only, never labels. */ export interface DropdownMenuSetting { setting: string; kind: 'choice' | 'switch'; /** ChoiceSub: the selected value and every option's value. */ value?: string; options?: string[]; /** SwitchItem: whether it is on. */ checked?: boolean; disabled: boolean; } export interface DropdownMenuHandle { getIsOpen: () => boolean; open: () => void; close: () => void; /** The named settings rows, while the menu is open (closed: none). */ getSettings: () => DropdownMenuSetting[]; /** Pick `value` on the named ChoiceSub. A closed menu opens for the * moment and closes again. Rejects on an unknown row, value or a * disabled one. */ setValue: (setting: string, value: string) => Promise; /** Turn the named SwitchItem on or off, as `setValue` does. */ setChecked: (setting: string, checked: boolean) => Promise; } export interface DropdownMenuRootProps extends ComponentPropsWithoutRef { /** Opaque instance id — forwarded to DropdownMenu.Content as `data-component-id`. */ id?: string; } export interface DropdownMenuContentProps extends ComponentPropsWithoutRef, VariantProps { } export interface DropdownMenuItemProps extends ComponentPropsWithoutRef { startIcon?: ReactNode; endIcon?: ReactNode; description?: ReactNode; /** Convenience — renders a DS on the inline-end. */ shortcut?: Array; } export type DropdownMenuCheckboxItemProps = ComponentPropsWithoutRef; export interface DropdownMenuSwitchItemProps extends ComponentPropsWithoutRef { /** Names the row for agents (the menu's `set_checked` action and * `settings` state) and emits `data-setting`. */ name?: string; } export type DropdownMenuRadioItemProps = ComponentPropsWithoutRef; export type DropdownMenuLabelProps = ComponentPropsWithoutRef; export type DropdownMenuSeparatorProps = ComponentPropsWithoutRef; export interface DropdownMenuShortcutProps { keys: Array; separator?: 'none' | 'plus' | 'then'; } export interface DropdownMenuSubTriggerProps extends ComponentPropsWithoutRef { startIcon?: ReactNode; } export type DropdownMenuSubContentProps = ComponentPropsWithoutRef; export interface DropdownMenuChoiceOption { value: T; label: ReactNode; disabled?: boolean; } export interface DropdownMenuChoiceSubProps { /** The setting's name, shown at the start of the row. */ label: ReactNode; /** The selected option's value; its label shows at the end of the row. */ value: T; onValueChange: (value: T) => void; options: ReadonlyArray>; startIcon?: ReactNode; disabled?: boolean; /** Close the whole menu after a pick. @default false */ closeOnSelect?: boolean; /** Names the row for agents (the menu's `set_value` action and * `settings` state) and emits `data-setting`. */ name?: string; className?: string; } declare function ChoiceSub({ label, value, onValueChange, options, startIcon, disabled, closeOnSelect, name, className, }: DropdownMenuChoiceSubProps): import("react/jsx-runtime").JSX.Element; declare namespace ChoiceSub { var displayName: string; } export declare const DropdownMenu: { Root: { ({ dir, id, open: openProp, defaultOpen, onOpenChange, ...props }: DropdownMenuRootProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; Trigger: import("react").ForwardRefExoticComponent>; Portal: import("react").FC; Content: import("react").ForwardRefExoticComponent>; Group: import("react").ForwardRefExoticComponent>; Item: import("react").ForwardRefExoticComponent>; CheckboxItem: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; SwitchItem: import("react").ForwardRefExoticComponent>; RadioGroup: import("react").ForwardRefExoticComponent>; RadioItem: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Label: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Separator: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; Shortcut: import("react").ForwardRefExoticComponent>; Sub: import("react").FC; SubTrigger: import("react").ForwardRefExoticComponent>; SubContent: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; ChoiceSub: typeof ChoiceSub; }; export {}; //# sourceMappingURL=dropdown-menu.d.ts.map