UNPKG

@chakra-ui/react

Version:

Responsive and accessible React UI components built with React and Emotion

164 lines (163 loc) • 9.45 kB
import { type Assign } from "@ark-ui/react"; import { Combobox as ArkCombobox } from "@ark-ui/react/combobox"; import { Dialog as ArkDialog } from "@ark-ui/react/dialog"; import { type JSX } from "react"; import { type HTMLChakraProps, type SlotRecipeProps, type UnstyledProp } from "../../styled-system"; import { type DialogBackdropProps, type DialogContentProps, type DialogRootProps, type DialogTriggerProps } from "../dialog"; import { type CommandSource, type UseCommandProps, type UseCommandReturn } from "./use-command"; declare const useCommandStyles: () => Record<string, import("../..").SystemStyleObject>; export { useCommandStyles }; export interface CommandProviderProps<T extends CommandItem = CommandItem> { /** * The value of `useCommandCollection`, shared with * every `Command.Root` inside. */ value: CommandSource<T>; children?: React.ReactNode | undefined; } export declare function CommandProvider<T extends CommandItem>(props: CommandProviderProps<T>): JSX.Element; export interface CommandRootProviderBaseProps extends Assign<HTMLChakraProps<"div">, SlotRecipeProps<"command">>, UnstyledProp { /** * The value returned by `useCommand`. */ value: UseCommandReturn<any>; } export interface CommandRootProviderProps extends CommandRootProviderBaseProps { } export declare const CommandRootProvider: import("react").ForwardRefExoticComponent<CommandRootProviderProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandRootBaseProps<T extends CommandItem = CommandItem> extends Assign<UseCommandProps<T>, SlotRecipeProps<"command">>, UnstyledProp { } export interface CommandRootProps<T extends CommandItem = CommandItem> extends Assign<HTMLChakraProps<"div">, CommandRootBaseProps<T>> { } export interface CommandRootComponent { <T extends CommandItem>(props: CommandRootProps<T> & React.RefAttributes<HTMLDivElement>): JSX.Element; } export declare const CommandRoot: CommandRootComponent; export declare const CommandPropsProvider: React.Provider<CommandRootBaseProps>; export interface CommandDialogTriggerProps extends DialogTriggerProps { } export declare const CommandDialogTrigger: import("react").ForwardRefExoticComponent<DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>; export interface CommandDialogProps extends DialogRootProps { } export declare const CommandDialog: (props: CommandDialogProps) => JSX.Element; export interface CommandDialogContentProps extends Omit<DialogContentProps, "title"> { /** * The accessible title of the dialog. Visually hidden. * @default "Command palette" */ title?: React.ReactNode | undefined; /** * The accessible description of the dialog. Visually hidden. * @default "Search for a command to run" */ description?: React.ReactNode | undefined; } export declare const CommandDialogContent: import("react").ForwardRefExoticComponent<CommandDialogContentProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandDialogBackdropProps extends DialogBackdropProps { } export declare const CommandDialogBackdrop: import("react").ForwardRefExoticComponent<DialogBackdropProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandLabelProps extends HTMLChakraProps<"label", ArkCombobox.LabelBaseProps>, UnstyledProp { } export declare const CommandLabel: import("react").ForwardRefExoticComponent<CommandLabelProps & import("react").RefAttributes<HTMLLabelElement>>; export interface CommandControlProps extends HTMLChakraProps<"div", ArkCombobox.ControlBaseProps>, UnstyledProp { } export declare const CommandControl: import("react").ForwardRefExoticComponent<CommandControlProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandIndicatorProps extends HTMLChakraProps<"div">, UnstyledProp { } export declare const CommandIndicator: import("react").ForwardRefExoticComponent<CommandIndicatorProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandInputProps extends HTMLChakraProps<"input", ArkCombobox.InputBaseProps>, UnstyledProp { } export declare const CommandInput: import("react").ForwardRefExoticComponent<CommandInputProps & import("react").RefAttributes<HTMLInputElement>>; export interface CommandClearTriggerProps extends HTMLChakraProps<"button", ArkCombobox.ClearTriggerBaseProps>, UnstyledProp { } export declare const CommandClearTrigger: import("react").ForwardRefExoticComponent<CommandClearTriggerProps & import("react").RefAttributes<HTMLButtonElement>>; export interface CommandListProps extends HTMLChakraProps<"div", ArkCombobox.ContentBaseProps>, UnstyledProp { } export declare const CommandList: import("react").ForwardRefExoticComponent<CommandListProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandItemGroupProps extends HTMLChakraProps<"div", ArkCombobox.ItemGroupBaseProps>, UnstyledProp { } export declare const CommandItemGroup: import("react").ForwardRefExoticComponent<CommandItemGroupProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandItemGroupLabelProps extends HTMLChakraProps<"div", ArkCombobox.ItemGroupLabelBaseProps>, UnstyledProp { } export declare const CommandItemGroupLabel: import("react").ForwardRefExoticComponent<CommandItemGroupLabelProps & import("react").RefAttributes<HTMLDivElement>>; /** * The shape the palette expects for each collection item. Every field is * optional, so extend it with your own data. */ export interface CommandItem { /** * The item's value. Read by default; use `itemToValue` on the collection to * derive it from another field. */ value?: string | undefined; /** * The item's text. Read by default; use `itemToString` on the collection to * derive it from another field. */ label?: string | undefined; /** * Whether the item is disabled. Read by default; use `isItemDisabled` on * the collection to derive it from another field. */ disabled?: boolean | undefined; /** * Extra words that match the item when searching. */ keywords?: string[] | undefined; /** * The value of the item whose page lists this item. An item with children * opens its page when selected instead of running. */ parent?: string | undefined; /** * Whether selecting the item opens its page even without children, such as * a page that loads its items or renders custom content. */ page?: boolean | undefined; /** * Runs when the item is selected, before the Root `onSelect`. */ onSelect?: ((details: CommandSelectionDetails) => void) | undefined; /** * Overrides the Root `closeOnSelect` for this item. */ closeOnSelect?: boolean | undefined; [key: string]: any; } export interface CommandItemProps extends HTMLChakraProps<"div", ArkCombobox.ItemBaseProps>, UnstyledProp { } export declare const CommandItem: import("react").ForwardRefExoticComponent<CommandItemProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandItemTextProps extends HTMLChakraProps<"div", ArkCombobox.ItemTextBaseProps>, UnstyledProp { /** * Whether to highlight the characters that match the search query. Applies * when the children are a string. */ highlight?: boolean | undefined; } export declare const CommandItemText: import("react").ForwardRefExoticComponent<CommandItemTextProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandItemCommandProps extends HTMLChakraProps<"kbd">, UnstyledProp { } export declare const CommandItemCommand: import("react").ForwardRefExoticComponent<CommandItemCommandProps & import("react").RefAttributes<HTMLElement>>; export interface CommandLoadingProps extends HTMLChakraProps<"div">, UnstyledProp { } export declare const CommandLoading: import("react").ForwardRefExoticComponent<CommandLoadingProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandEmptyProps extends HTMLChakraProps<"div">, UnstyledProp { } export declare const CommandEmpty: import("react").ForwardRefExoticComponent<CommandEmptyProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandSeparatorProps extends HTMLChakraProps<"div">, UnstyledProp { } export declare const CommandSeparator: import("react").ForwardRefExoticComponent<CommandSeparatorProps & import("react").RefAttributes<HTMLDivElement>>; export interface CommandFooterProps extends HTMLChakraProps<"div">, UnstyledProp { } export declare const CommandFooter: import("react").ForwardRefExoticComponent<CommandFooterProps & import("react").RefAttributes<HTMLDivElement>>; export declare const CommandContext: <T extends unknown>(props: ArkCombobox.ContextProps<T>) => import("react").ReactNode; export declare const CommandDialogContext: (props: ArkDialog.ContextProps) => import("react").ReactNode; export declare const CommandItemContext: (props: ArkCombobox.ItemContextProps) => import("react").ReactNode; export interface CommandHighlightChangeDetails<T extends CommandItem = CommandItem> extends ArkCombobox.HighlightChangeDetails<T> { } export interface CommandInputValueChangeDetails extends ArkCombobox.InputValueChangeDetails { } export interface CommandOpenChangeDetails extends ArkDialog.OpenChangeDetails { } export interface CommandSelectionDetails extends ArkCombobox.SelectionDetails { }