
import { Styles } from "../../../tasty/styles/types.js";
import { BasePropsWithoutChildren } from "../../../tasty/types.js";
import "../../../tasty/index.js";
import { FieldBaseProps } from "../../../shared/form.js";
import "../../../shared/index.js";
import { CubeCollectionItemProps, _CollectionItem } from "../../CollectionItem.js";
import { ForwardedRef, ReactElement, ReactNode, RefObject } from "react";
import { AriaListBoxProps } from "react-aria";
import { Section } from "react-stately";
import { CollectionBase, Key as Key$1 } from "@react-types/shared";

//#region src/components/fields/ListBox/ListBox.d.ts
interface CubeListBoxProps<T> extends AriaListBoxProps<T>, CollectionBase<T>, FieldBaseProps, BasePropsWithoutChildren {
  /** Custom styles for the list container */
  listStyles?: Styles;
  /** Custom styles for individual options */
  optionStyles?: Styles;
  /** Custom styles for section containers */
  sectionStyles?: Styles;
  /** Custom styles for section headings */
  headingStyles?: Styles;
  /** Whether the ListBox is disabled */
  isDisabled?: boolean;
  /** The selected key in controlled single selection mode */
  selectedKey?: Key$1 | null;
  /** The selected keys in controlled multiple selection mode. Use "all" to select all items or an array of keys */
  selectedKeys?: 'all' | Key$1[];
  /** The default selected key in uncontrolled single selection mode */
  defaultSelectedKey?: Key$1 | null;
  /** The default selected keys in uncontrolled multiple selection mode. Use "all" to select all items or an array of keys */
  defaultSelectedKeys?: 'all' | Key$1[];
  /** Callback fired when selection changes */
  onSelectionChange?: (key: Key$1 | null | 'all' | Key$1[]) => void;
  /** The selection mode of the ListBox */
  selectionMode?: 'single' | 'multiple';
  /** Ref for accessing the list DOM element */
  listRef?: RefObject<HTMLUListElement | null>;
  /** Whether to disallow empty selection */
  disallowEmptySelection?: boolean;
  /** Whether to wrap focus when reaching the end of the list */
  shouldFocusWrap?: boolean;
  /**
   * Ref to access the internal ListState instance.
   * This allows parent components to access selection state and other list functionality.
   */
  stateRef?: RefObject<any | null>;
  /**
   * Whether moving the pointer over an option will move DOM focus to that option.
   * Set to false for components that keep DOM focus outside (e.g. searchable FilterListBox).
   * Defaults to true.
   */
  focusOnHover?: boolean;
  /** Custom header content displayed above the list */
  header?: ReactNode;
  /** Custom footer content displayed below the list */
  footer?: ReactNode;
  /** Custom styles for the header */
  headerStyles?: Styles;
  /** Custom styles for the footer */
  footerStyles?: Styles;
  /** Additional modifiers for styling the ListBox */
  mods?: Record<string, boolean>;
  /** Size variant of the ListBox */
  size?: 'small' | 'medium' | 'large';
  /**
   * When `true`, clicking an already-selected item keeps it selected instead of toggling it off.
   * Useful when embedding ListBox inside components like ComboBox.
   */
  disableSelectionToggle?: boolean;
  /**
   * Whether to use virtual focus for keyboard navigation.
   * When true, DOM focus stays outside individual option elements (useful for searchable lists).
   * Defaults to false for backward compatibility.
   */
  shouldUseVirtualFocus?: boolean;
  /**
   * Callback fired when the user presses Escape key.
   * When provided, this prevents React Aria's default Escape behavior (selection reset).
   */
  onEscape?: () => void;
  /**
   * Whether to show checkboxes for multiple selection mode.
   * This adds a checkbox icon to the left of each option.
   */
  isCheckable?: boolean;
  /**
   * Callback fired when an option is clicked but not on the checkbox area.
   * Used by FilterPicker to close the popover on non-checkbox clicks.
   */
  onOptionClick?: (key: Key$1) => void;
  /**
   * Whether to show the "Select All" option in multiple selection mode.
   * This adds a select all option to the header that allows selecting/deselecting all items.
   */
  showSelectAll?: boolean;
  /**
   * Label for the "Select All" option. Defaults to "Select All".
   */
  selectAllLabel?: ReactNode;
  /**
   * Props to apply to the "Select All" option.
   */
  allValueProps?: Partial<CubeCollectionItemProps<T>>;
  /**
   * Filter function to apply to the collection nodes.
   * Takes an iterable of nodes and returns a filtered iterable.
   * Useful for implementing search/filter functionality.
   */
  filter?: (nodes: Iterable<any>) => Iterable<any>;
  /**
   * Label to display when the list is empty (no items available).
   * Defaults to "No items".
   */
  emptyLabel?: ReactNode;
  /**
   * Visual shape of the ListBox styling.
   * - `card` (default): Standard card styling with border and margin
   * - `plain`: No border, no margin, no radius - suitable for embedded use
   * - `popover`: No border, but keeps margin and radius - suitable for overlay use
   * Defaults to 'card'.
   */
  shape?: 'card' | 'plain' | 'popover';
}
declare const ListBox: (<T>(props: CubeListBoxProps<T> & {
  ref?: ForwardedRef<HTMLDivElement>;
}) => ReactElement) & {
  Item: typeof _CollectionItem;
  Section: typeof Section;
};
//#endregion
export { CubeListBoxProps, ListBox };
//# sourceMappingURL=ListBox.d.ts.map