
import { Styles } from "../../../tasty/styles/types.js";
import { BasePropsWithoutChildren, BaseStyleProps, ColorStyleProps, OuterStyleProps } from "../../../tasty/types.js";
import "../../../tasty/index.js";
import { FieldBaseProps } from "../../../shared/form.js";
import "../../../shared/index.js";
import { _CollectionItem } from "../../CollectionItem.js";
import React, { ForwardedRef, ReactElement, ReactNode, RefObject } from "react";
import { Section } from "react-stately";
import { FocusableRef, Key as Key$1 } from "@react-types/shared";

//#region src/components/fields/ComboBox/ComboBox.d.ts
type FilterFn = (textValue: string, inputValue: string) => boolean;
type PopoverTriggerAction = 'focus' | 'input' | 'manual';
interface CubeComboBoxProps<T> extends BasePropsWithoutChildren, BaseStyleProps, OuterStyleProps, ColorStyleProps, FieldBaseProps {
  /** The selected key in controlled mode */
  selectedKey?: string | null;
  /** The default selected key in uncontrolled mode */
  defaultSelectedKey?: string | null;
  /** Callback fired when selection changes */
  onSelectionChange?: (key: string | null) => void;
  /** The input value in controlled mode */
  inputValue?: string;
  /** The default input value in uncontrolled mode */
  defaultInputValue?: string;
  /** Callback fired when input value changes */
  onInputChange?: (value: string) => void;
  /** Placeholder text for the input */
  placeholder?: string;
  /** Whether the input should have autofocus */
  autoFocus?: boolean;
  /** HTML autocomplete attribute for the input */
  autoComplete?: string;
  /** Callback fired when focus enters the component (input, trigger, or popover). Does not receive event object. */
  onFocus?: () => void;
  /** Callback fired when focus leaves the component entirely. Does not receive event object. */
  onBlur?: () => void;
  /** Callback fired when a key is pressed on the input */
  onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
  /** Popover trigger behavior: 'focus', 'input', or 'manual'. Defaults to 'input' */
  popoverTrigger?: PopoverTriggerAction;
  /** Items for the listbox (alternative to children) */
  items?: Iterable<T>;
  /** Children for the listbox (static items or render function) */
  children?: ReactNode | ((item: T) => ReactElement);
  /**
   * Custom filter function for determining if an option should be included.
   * Pass `false` to disable internal filtering completely.
   */
  filter?: FilterFn | false;
  /** Whether to allow entering custom values that are not in the predefined options */
  allowsCustomValue?: boolean;
  /** Whether to commit custom value on blur in allowsCustomValue mode (default: true) */
  shouldCommitOnBlur?: boolean;
  /** Whether to clear selection and input on blur (default: false, only applies to non-custom-value mode) */
  clearOnBlur?: boolean;
  /** Whether the combobox is clearable using ESC key or clear button */
  isClearable?: boolean;
  /** Callback called when the clear button is pressed */
  onClear?: () => void;
  /** Left input icon */
  icon?: ReactElement;
  /** Input decoration before the main input */
  prefix?: ReactNode;
  /** Input decoration after the main input */
  suffix?: ReactNode;
  /** Whether to hide the trigger button */
  hideTrigger?: boolean;
  /** Size of the combobox */
  size?: 'small' | 'medium' | 'large' | (string & {});
  /** Ref for accessing the input element */
  inputRef?: RefObject<HTMLInputElement>;
  /** Ref for accessing the wrapper element */
  wrapperRef?: RefObject<HTMLDivElement>;
  /** Ref for accessing the listbox element */
  listBoxRef?: RefObject<HTMLDivElement>;
  /** Ref for accessing the popover element */
  popoverRef?: RefObject<HTMLDivElement>;
  /** Ref for accessing the trigger button element */
  triggerRef?: FocusableRef<HTMLButtonElement>;
  /** Custom styles for the input */
  inputStyles?: Styles;
  /** Custom styles for the trigger button */
  triggerStyles?: Styles;
  /** Custom styles for the listbox */
  listBoxStyles?: Styles;
  /** Custom styles for the popover overlay */
  overlayStyles?: Styles;
  /** Custom styles for individual options */
  optionStyles?: Styles;
  /** Custom styles for sections */
  sectionStyles?: Styles;
  /** Custom styles for section headings */
  headingStyles?: Styles;
  /** Whether the combobox is disabled */
  isDisabled?: boolean;
  /** Whether the combobox is in loading state */
  isLoading?: boolean;
  /** Validation state of the combobox */
  validationState?: 'valid' | 'invalid';
  /** Keys of disabled items */
  disabledKeys?: Iterable<Key$1>;
  /** Whether to flip the popover placement */
  shouldFlip?: boolean;
  /** Placement direction for the popover */
  direction?: 'bottom' | 'top';
  /** Offset for the popover */
  overlayOffset?: number;
  /** Minimum padding in pixels between the popover and viewport edges */
  containerPadding?: number;
  /** Whether the combobox is read-only */
  isReadOnly?: boolean;
  /** Suffix position goes before or after the validation and loading statuses */
  suffixPosition?: 'before' | 'after';
  /**
   * Sort selected item to the top when the popover opens.
   * Only works when using the `items` prop (data-driven mode).
   * Ignored when using JSX children.
   * @default true when items are provided, false when using JSX children
   */
  sortSelectedToTop?: boolean;
  /** Callback called when the popover open state changes */
  onOpenChange?: (isOpen: boolean) => void;
}
declare const ComboBox: (<T>(props: CubeComboBoxProps<T> & {
  ref?: ForwardedRef<HTMLDivElement>;
}) => ReactElement) & {
  Item: typeof _CollectionItem;
  Section: typeof Section;
};
//#endregion
export { ComboBox, CubeComboBoxProps };
//# sourceMappingURL=ComboBox.d.ts.map