import React from "react"; import type { InputPrimitiveProps } from "../../Input/index.js"; import type { AutoCompleteOption } from "../domains/index.js"; import type { Icon } from "../../Icon/index.js"; interface AutoCompletePrimitiveProps { /** * Indicates if the reset action should be displayed. */ displayResetAction?: boolean; /** * Indicates if the field is disabled. */ disabled?: boolean; /** * Message to display when there are no options. */ emptyMessage?: React.ReactNode; /** * Message to display when there are no options loaded or selected. * Use it to invite the user to interact with the autocomplete by typing a value. */ initialMessage?: React.ReactNode; /** * Reference to the input element. */ inputRef?: React.Ref; /** * Indicates if the input field is invalid. * Refer to `InputPrimitiveProps["invalid"]` for possible values. */ invalid?: InputPrimitiveProps["invalid"]; /** * Accessible label for the command menu. Not shown visibly. */ label?: string; /** * Indicates if the autocomplete is loading options. */ loading?: boolean; /** * Message to display while loading options. */ loadingMessage?: React.ReactNode; /** * Callback triggered when the open state changes. */ onOpenChange?: (open: boolean) => void; /** * Callback triggered to reset the value. */ onValueReset?: () => void; /** * Callback triggered when a value has been searched by the user. */ onValueSearch?: (value: string) => void; /** * Callback triggered when the value changes. */ onValueChange: (value: string) => void; /** * List of options for the autocomplete. */ options?: AutoCompleteOption[]; /** * Custom renderer for the options. */ optionRenderer?: (item: any, index: number) => React.ReactNode; /** * Placeholder text for the input field. */ placeholder?: string; /** * Size of the input field. * Refer to `InputPrimitiveProps["size"]` for possible values. */ size?: InputPrimitiveProps["size"]; /** * Icon to be displayed at the start of the input field. */ startIcon?: React.ReactElement | React.ReactElement; /** * Variant of the input field. * Refer to `InputPrimitiveProps["variant"]` for possible values. */ variant?: InputPrimitiveProps["variant"]; /** * Optional selected item. */ value?: string; } declare const AutoCompletePrimitive: ((props: AutoCompletePrimitiveProps) => React.JSX.Element) & { original: (props: AutoCompletePrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: ((props: AutoCompletePrimitiveProps) => React.JSX.Element) & { original: (props: AutoCompletePrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: AutoCompletePrimitiveProps) => React.JSX.Element) & { original: (props: AutoCompletePrimitiveProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; export { AutoCompletePrimitive, type AutoCompletePrimitiveProps };