import { ReactNode } from 'react'; import { useFocusNavigation } from '../../hooks/useFocusNavigation'; import { ElementDensity } from '../../utils'; import { BoxBaseProps } from '../base/boxBase'; /** @category List */ export type ListVariant = 'list' | 'listbox'; /** @category List */ export interface ListConfig { density?: ElementDensity; itemRole: 'listitem' | 'option'; /** Keyboard focus controller shared with the child items. */ nav?: ReturnType; variant: ListVariant; } /** * Props for the {@link List} component. * * @category List */ export interface ListProps extends Omit { children: ReactNode; /** Uncontrolled initial selected value(s). */ defaultValue?: string | string[]; /** Density preset propagated to all child items. */ density?: ElementDensity; /** Change handler called with the new selected values array. */ onChange?: (values: string[]) => void; /** Selection type for listbox variant. */ type?: 'single' | 'multiple'; /** Controlled selected value(s). */ value?: string | string[]; /** Switches between display list and selectable listbox. */ variant?: ListVariant; } /** * **List** — vertical container for {@link Item} elements. * * When `variant="listbox"` is set, enables keyboard navigation and * selection via {@link SelectionContext}. Supports both controlled * (`value` + `onChange`) and uncontrolled (`defaultValue`) modes. * * @example * ```tsx * * * * * ``` * * @category List */ export declare const List: ({ children, className, variant, type, value, defaultValue, onChange, density, ...props }: ListProps) => import("react/jsx-runtime").JSX.Element;