import "./Autocomplete.css"; import { AriaLabelingProps, InteractionStatesProps } from "../../shared"; import { BoxProps } from "../../box"; import { OverlayProps as OverlayPropsForDocumentation } from "../../overlay"; import type { ComponentProps, ElementType, ForwardedRef, ReactElement, ReactNode, SyntheticEvent } from "react"; interface OverlayProps extends Partial { } export interface InnerAutocompleteProps extends InteractionStatesProps, AriaLabelingProps { /** * Whether or not to open the autocomplete element. */ open?: boolean | null; /** * The initial value of open when in auto controlled mode. */ defaultOpen?: boolean; /** * A controlled autocomplete value. */ value?: string | null; /** * The default value of `value` when uncontrolled. */ defaultValue?: string; /** * Temporary text that occupies the autocomplete trigger when no value is selected. */ placeholder?: string; /** * @ignore */ name?: string; /** * Whether or not the autocomplete should display a loading state. */ loading?: boolean; /** * Whether or not the query should be cleared when a result is selected. */ clearOnSelect?: boolean; /** * Message to display when there are no results matching the query. */ noResultsMessage?: string; /** * Minimum characters to query for results. */ minCharacters?: number; /** * Whether or not a user input is required before form submission. */ required?: boolean; /** * Whether or not the autocomplete should display as "valid" or "invalid". */ validationState?: "valid" | "invalid"; /** * Called when the input query change and new search results are expected. * @param {SyntheticEvent} event - React's original event. * @param {string} query - The search query. * @returns {void} */ onSearch?: (event: SyntheticEvent, query: string) => void; /** * Called when the autocomplete value change. * @param {SyntheticEvent} event - React's original event. * @param {Object} selection - The new selection. * @param {string} selection.key - The selected key. * @param {string} selection.value - The selected value. * @returns {void} */ onSelectionChange?: (event: SyntheticEvent, selection: { key: string; value: string; }) => void; /** * Called when the autocomplete open state change. * @param {SyntheticEvent} event - React's original event. * @param {boolean} isOpen - Indicate if the menu is open. * @returns {void} */ onOpenChange?: (event: SyntheticEvent, isOpen: boolean) => void; /** * A trigger icon. */ icon?: ReactElement; /** * The direction the autocomplete menu will open relative to the input. */ direction?: "bottom" | "top"; /** * The horizontal alignment of the autocomplete menu relative to the input. */ align?: "start" | "end"; /** * Whether or not the autocomplete should autofocus on render. */ autoFocus?: boolean | number; /** * Whether or not the autocomplete take up the width of its container. */ fluid?: boolean; /** * Whether or not the autocomplete is disabled. */ disabled?: boolean; /** * Whether or not the autocomplete is readonly. */ readOnly?: boolean; /** * Whether or not the autocomplete menu can flip when it will overflow it's boundary area. */ allowFlip?: boolean; /** * Whether or not the selection menu position can change to prevent it from being cut off so that it stays visible within its boundary area. */ allowPreventOverflow?: boolean; /** * The z-index of the overlay element. */ zIndex?: number; /** * Additional props to render on the wrapper element. */ wrapperProps?: Partial; /** * Additional props to render on the menu of options. */ overlayProps?: Partial; /** * An HTML element type or a custom React element type to render as. */ as?: ElementType; /** * React children. */ children: ReactNode; /** * @ignore */ forwardedRef: ForwardedRef; } export declare function InnerAutocomplete(props: InnerAutocompleteProps): JSX.Element; export declare const Autocomplete: import("../../shared").OrbitComponent<"input", InnerAutocompleteProps>; export declare type AutocompleteProps = ComponentProps; export {};