
import { FieldBaseProps } from "../../../shared/form.js";
import "../../../shared/index.js";
import { _CollectionItem } from "../../CollectionItem.js";
import { BasePropsWithoutChildren, BaseStyleProps, ColorStyleProps, OuterStyleProps, Styles } from "@tenphi/tasty";
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/SearchComboBox/SearchComboBox.d.ts
type FilterFn = (textValue: string, inputValue: string) => boolean;
type PopoverTriggerAction = 'focus' | 'input' | 'manual';
interface CubeSearchComboBoxProps<T> extends BasePropsWithoutChildren, BaseStyleProps, OuterStyleProps, ColorStyleProps, Omit<FieldBaseProps, 'name' | 'form' | 'rules' | 'shouldUpdate' | 'validationDelay' | 'validateTrigger' | 'insideForm' | 'idPrefix'> {
  /**
   * Callback fired when the user picks a suggestion from the list.
   * Receives the option key and its text value. The input is cleared afterwards.
   */
  onSelect?: (key: string, textValue: string) => void;
  /**
   * Opt-in callback fired when the user presses Enter while no suggestion is
   * visible (the popover has no results). Receives the trimmed input text. The
   * input is cleared afterwards. When suggestions are visible, Enter selects the
   * top result via `onSelect` instead. When not provided, Enter with no visible
   * suggestion is a no-op.
   */
  onSubmit?: (value: string) => void;
  /**
   * Label displayed when the list is empty (no results). Defaults to a
   * context-aware "No results found" / "Loading…" message.
   */
  emptyLabel?: ReactNode;
  /** 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 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 (external/server-side filtering).
   */
  filter?: FilterFn | false;
  /** Whether the search combobox is clearable using ESC key or clear button. Defaults to true. */
  isClearable?: boolean;
  /** Callback called when the clear button is pressed */
  onClear?: () => void;
  /** Left input icon. Defaults to a search icon. */
  icon?: ReactElement | null;
  /** Input decoration before the main input */
  prefix?: ReactNode;
  /** Input decoration after the main input */
  suffix?: ReactNode;
  /** Whether to show the trigger button. Hidden by default (search field look). */
  hideTrigger?: boolean;
  /** Size of the search combobox */
  size?: 'small' | 'medium' | 'large' | (string & {});
  /** Ref for accessing the input element */
  inputRef?: RefObject<HTMLInputElement | null>;
  /** 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 search combobox is disabled */
  isDisabled?: boolean;
  /**
   * Whether items are being loaded (e.g. from a server). While loading, the
   * previous results stay visible; the loading indicator only appears after
   * `loadingDelay` to avoid flicker on fast responses.
   */
  isLoading?: boolean;
  /** Delay in milliseconds before the loading indicator is shown. Defaults to 1000. */
  loadingDelay?: number;
  /** Validation state of the search 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 search combobox is read-only */
  isReadOnly?: boolean;
  /** Suffix position goes before or after the validation and loading statuses */
  suffixPosition?: 'before' | 'after';
  /** Callback called when the popover open state changes */
  onOpenChange?: (isOpen: boolean) => void;
}
declare const SearchComboBox: (<T>(props: CubeSearchComboBoxProps<T> & {
  ref?: ForwardedRef<HTMLDivElement>;
}) => ReactElement) & {
  Item: typeof _CollectionItem;
  Section: typeof Section;
};
//#endregion
export { CubeSearchComboBoxProps, SearchComboBox };
//# sourceMappingURL=SearchComboBox.d.ts.map