/** * Command — BASIC self-contained fork of Studio's `Command` (which wraps `cmdk`). * A searchable, filtered list: Input / List / Empty / Group / Item (+ Item * Content/Title/Description, Shortcut, Separator). Classes ported 1:1 from * Studio (tokens remapped, icons sized down a half-step). Used by the model * picker (Popover + Command). No `cmdk` dependency. * * Filtering uses case-insensitive substring matching. The input retains focus * while arrow keys move the active descendant through the visible options. * * @module react/components/ui/command */ import * as React from "react"; type CommandMoveDirection = "first" | "last" | "next" | "previous"; /** Internal matching rule shared by the registry and its focused tests. */ export declare function commandItemMatches(search: string, text: string): boolean; /** Resolve the next active option without coupling navigation to the DOM. */ export declare function getNextCommandItemId(itemIds: readonly string[], activeId: string | undefined, direction: CommandMoveDirection): string | undefined; /** Compose a caller's change handler with the controlled search state. */ export declare function handleCommandInputChange(event: React.ChangeEvent, onChange: React.ChangeEventHandler | undefined, setSearch: (value: string) => void): void; /** Apply command navigation only after the caller and IME have yielded the key. */ export declare function handleCommandInputKeyDown(event: React.KeyboardEvent, onKeyDown: React.KeyboardEventHandler | undefined, actions: { moveActive: (direction: CommandMoveDirection) => void; selectActive: () => boolean; }): void; /** * Command root — owns the filter query and item registry. * * Each root accepts one {@link CommandList}; use {@link CommandGroup} to * organize sections within it. */ export declare function Command({ className, children, ...props }: React.HTMLAttributes): React.ReactElement; /** Props accepted by ``. */ export interface CommandDialogProps { children: React.ReactNode; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; } /** A Command palette inside a modal Dialog overlay. */ export declare function CommandDialog({ children, open, defaultOpen, onOpenChange, }: CommandDialogProps): React.ReactElement; /** Props accepted by ``. */ export interface CommandInputProps extends Omit, "value"> { icon?: React.ReactNode; /** Consumer ref for the search input. */ ref?: React.Ref; } /** Search input row — bound to the command's filter query. */ export declare function CommandInput({ className, icon, placeholder, onChange, onKeyDown, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-controls": ariaControls, "aria-expanded": ariaExpanded, ref, ...inputProps }: CommandInputProps): React.ReactElement; /** The root's single scrollable results list. */ export declare function CommandList({ className, variant, id: suppliedId, children, ref, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...listProps }: React.HTMLAttributes & { variant?: "default" | "flush"; ref?: React.Ref; }): React.ReactElement; /** Shown when the query matches no items. */ export declare function CommandEmpty({ className, ...props }: React.HTMLAttributes): React.ReactElement | null; /** A labelled group of items; auto-hides when all its items are filtered out. */ export declare function CommandGroup({ className, heading, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...groupProps }: React.HTMLAttributes & { heading?: React.ReactNode; }): React.ReactElement; /** Divider between groups. */ export declare function CommandSeparator({ className }: { className?: string; }): React.ReactElement; /** Props accepted by ``. */ export interface CommandItemProps extends Omit, "onSelect"> { /** Searchable text for filtering (falls back to nothing → always visible). */ value?: string; /** Top-align the icon for two-line items. */ align?: "center" | "start"; disabled?: boolean; onSelect?: (value?: string) => void; /** Consumer ref for the rendered command item. */ ref?: React.Ref; } /** A selectable, filterable result row nested within {@link CommandList}. */ export declare function CommandItem({ className, align, value, disabled, onSelect, children, id: suppliedId, onClick, onMouseMove, ref, ...itemProps }: CommandItemProps): React.ReactElement; /** Flex column wrapper for an item's title + description. */ export declare function CommandItemContent({ className, ...props }: React.HTMLAttributes): React.ReactElement; /** Item primary text. */ export declare function CommandItemTitle({ className, ...props }: React.HTMLAttributes): React.ReactElement; /** Item secondary text. */ export declare function CommandItemDescription({ className, ...props }: React.HTMLAttributes): React.ReactElement; /** Trailing shortcut / metadata text. */ export declare function CommandShortcut({ className, ...props }: React.HTMLAttributes): React.ReactElement; export {}; //# sourceMappingURL=command.d.ts.map