import { s as ComboboxStoreState, t as ComboboxStore } from "../combobox-store-FilGAecN.js";
import { n as CompositeOptions } from "../composite-BoZZ9Es6.js";
import { Props } from "@ariakit/react-utils";
import { AriaAttributes, ChangeEvent, ElementType, KeyboardEvent, MouseEvent } from "react";
import { BooleanOrCallback, StringWithValue } from "@ariakit/utils";
//#region src/combobox/combobox.d.ts
declare const TagName = "input";
type TagName = typeof TagName;
/**
 * Returns props to create a `Combobox` component.
 * @see https://ariakit.com/components/combobox
 * @example
 * ```jsx
 * const store = useComboboxStore();
 * const props = useCombobox({ store });
 * <Role {...props} />
 * <ComboboxPopover store={store}>
 *   <ComboboxItem value="Apple" />
 *   <ComboboxItem value="Banana" />
 *   <ComboboxItem value="Orange" />
 * </ComboboxPopover>
 * ```
 */
declare const useCombobox: import("@ariakit/react-utils").Hook<"input", ComboboxOptions<"input">>;
/**
 * **Alias**: [`ComboboxInput`](https://ariakit.com/reference/combobox-input)
 *
 * Renders a combobox input element that can be used to filter a list of items.
 * @see https://ariakit.com/components/combobox
 * @example
 * ```jsx {2}
 * <ComboboxProvider>
 *   <Combobox />
 *   <ComboboxPopover>
 *     <ComboboxItem value="Apple" />
 *     <ComboboxItem value="Banana" />
 *     <ComboboxItem value="Orange" />
 *   </ComboboxPopover>
 * </ComboboxProvider>
 * ```
 */
declare const Combobox: (props: ComboboxProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
interface ComboboxOptions<T extends ElementType = TagName> extends CompositeOptions<T> {
  /**
   * Object returned by the
   * [`useComboboxStore`](https://ariakit.com/reference/use-combobox-store)
   * hook. If not provided, the closest
   * [`ComboboxProvider`](https://ariakit.com/reference/combobox-provider)
   * component's context will be used.
   */
  store?: ComboboxStore;
  /**
   * Determines if the first enabled item will be automatically focused when the
   * combobox input value changes. If set to `true` or `"always"`, the exact
   * behavior hinges on the value of the
   * [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete) prop:
   * - If [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete)
   *   is `both` or `inline`, the first enabled item is automatically focused as
   *   the user types in the input. The value gets appended with the completion
   *   string if it matches. The inline completion string will be highlighted
   *   and selected.
   * - If [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete)
   *   is `list` or `none`, the first enabled item is automatically focused as
   *   the user types in the input, but the input value is not appended with the
   *   item value.
   *
   * If set to `"always"`, the first enabled item is auto-highlighted when the
   * combobox list opens, not just when the input value changes.
   *
   * To change which item gets auto-selected, use the
   * [`getAutoSelectId`](https://ariakit.com/reference/combobox#getautoselectid)
   * prop.
   *
   * Live examples:
   * - [Command Menu with
   *   Tabs](https://ariakit.com/examples/dialog-combobox-tab-command-menu)
   * - [ComboboxGroup](https://ariakit.com/examples/combobox-group)
   * - [Combobox with links](https://ariakit.com/examples/combobox-links)
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * - [Menu with Combobox](https://ariakit.com/examples/menu-combobox)
   * - [Select with Combobox](https://ariakit.com/examples/select-combobox)
   * @default false
   */
  autoSelect?: boolean | "always";
  /**
   * Function that takes the currently rendered items and returns the id of the
   * item to be auto selected when the
   * [`autoSelect`](https://ariakit.com/reference/combobox#autoselect) prop is
   * `true`.
   *
   * By default, the first enabled item is auto selected. This function is handy
   * if you prefer a different item to be auto selected. Returning `undefined`
   * from this function will result in the default behavior.
   * @example
   * ```jsx
   * <Combobox
   *   autoSelect
   *   getAutoSelectId={(items) => {
   *     // Auto select the first enabled item with a value
   *     const item = items.find((item) => {
   *       if (item.disabled) return false;
   *       if (!item.value) return false;
   *       return true;
   *     });
   *     return item?.id;
   *   }}
   * />
   * ```
   */
  getAutoSelectId?: (renderedItems: ComboboxStoreState["renderedItems"]) => string | null | undefined;
  /**
   * Whether the items will be filtered based on
   * [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   * and
   * whether the input value will temporarily change based on the active item.
   *
   * This prop is based on the standard
   * [`aria-autocomplete`](https://w3c.github.io/aria/#aria-autocomplete)
   * attribute, accepting the same values:
   * - `list` (default): indicates that the items will be dynamically rendered
   *   based on
   *   [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   *   and the input value will _not_ change based on the active item. The
   *   filtering logic must be implemented by the consumer of this component.
   * - `inline`: indicates that the items are static, that is, they won't be
   *   filtered, but the input value will temporarily change based on the active
   *   item. Ariakit will automatically provide the inline autocompletion
   *   behavior.
   * - `both`: indicates that the items will be dynamically rendered based on
   *   [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   *   and the
   *   input value will temporarily change based on the active item. The
   *   filtering logic must be implemented by the consumer of this component,
   *   whereas Ariakit will automatically provide the inline autocompletion
   *   behavior.
   * - `none`: the items are static and the input value will _not_ change based
   *   on the active item.
   *
   * Live examples:
   * - [ComboboxGroup](https://ariakit.com/examples/combobox-group)
   * @default "list"
   */
  autoComplete?: StringWithValue<Required<AriaAttributes>["aria-autocomplete"]>;
  /**
   * Determines if the highlighted item should lose focus when the user clicks
   * on the combobox input element. By default, this prop's value is set
   * according to the
   * [`compositeElementInFocusOrder`](https://ariakit.com/reference/combobox-provider#compositeelementinfocusorder)
   * value.
   */
  blurActiveItemOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
  /**
   * Specifies the minimum character count the input value should have before
   * the [`ComboboxList`](https://ariakit.com/reference/combobox-list) or
   * [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components are displayed.
   *
   * The [`showOnChange`](https://ariakit.com/reference/combobox#showonchange),
   * [`showOnClick`](https://ariakit.com/reference/combobox#showonclick), and
   * [`showOnKeyPress`](https://ariakit.com/reference/combobox#showonkeypress)
   * props allow you to tailor the behavior for each unique event.
   * @default 0
   * @example
   * In the following example, the combobox list will be shown when the input
   * value has at least one character. However, if the user presses the arrow
   * keys, the list will be shown regardless of the input value length.
   * ```jsx
   * <Combobox showMinLength={1} showOnKeyPress />
   * ```
   */
  showMinLength?: number;
  /**
   * Whether the [`ComboboxList`](https://ariakit.com/reference/combobox-list)
   * or [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components should be shown when the input value changes.
   *
   * Live examples:
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * @default true
   * @example
   * ```jsx
   * <Combobox showOnChange={(event) => event.target.value.length > 1} />
   * ```
   */
  showOnChange?: BooleanOrCallback<ChangeEvent<HTMLElement>>;
  /**
   * Whether the [`ComboboxList`](https://ariakit.com/reference/combobox-list)
   * or [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components should be shown when the input is clicked.
   * @deprecated Use
   * [`showOnClick`](https://ariakit.com/reference/combobox#showonclick)
   * instead.
   * @default true
   */
  showOnMouseDown?: BooleanOrCallback<MouseEvent<HTMLElement>>;
  /**
   * Whether the [`ComboboxList`](https://ariakit.com/reference/combobox-list)
   * or [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components should be shown when the input is clicked.
   *
   * Live examples:
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * @default true
   * @example
   * ```jsx
   * <Combobox showOnClick={value.length > 1} />
   * ```
   */
  showOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
  /**
   * Whether the [`ComboboxList`](https://ariakit.com/reference/combobox-list)
   * or [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components should be shown when the user presses the arrow up or down keys
   * while focusing on the combobox input element.
   * @deprecated Use
   * [`showOnKeyPress`](https://ariakit.com/reference/combobox#showonkeypress)
   * instead.
   * @default true
   */
  showOnKeyDown?: BooleanOrCallback<KeyboardEvent<HTMLElement>>;
  /**
   * Whether the [`ComboboxList`](https://ariakit.com/reference/combobox-list)
   * or [`ComboboxPopover`](https://ariakit.com/reference/combobox-popover)
   * components should be shown when the user presses the arrow up or down keys
   * while focusing on the combobox input element.
   *
   * Live examples:
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * @default true
   * @example
   * ```jsx
   * <Combobox showOnKeyPress={value.length > 1} />
   * ```
   */
  showOnKeyPress?: BooleanOrCallback<KeyboardEvent<HTMLElement>>;
  /**
   * Whether the combobox
   * [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   * state
   * should be updated when the input value changes. This is useful if you want
   * to customize how the store
   * [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   * is updated
   * based on the input element's value.
   *
   * Live examples:
   * - [Textarea with inline
   *   Combobox](https://ariakit.com/examples/combobox-textarea)
   * @default true
   */
  setValueOnChange?: BooleanOrCallback<ChangeEvent<HTMLElement>>;
  /**
   * Whether the combobox
   * [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   * state
   * should be updated when the combobox input element gets clicked. This
   * usually only applies when
   * [`autoComplete`](https://ariakit.com/reference/combobox#autocomplete) is
   * `both` or `inline`, because the input value will temporarily change based
   * on the active item and the store
   * [`inputValue`](https://ariakit.com/reference/combobox-provider#inputvalue)
   * will not be updated until the user confirms the selection.
   * @default true
   */
  setValueOnClick?: BooleanOrCallback<MouseEvent<HTMLElement>>;
}
type ComboboxProps<T extends ElementType = TagName> = Props<T, ComboboxOptions<T>>;
//#endregion
export { Combobox, ComboboxOptions, ComboboxProps, useCombobox };
//# sourceMappingURL=combobox.d.ts.map