import { ComponentPropsWithoutRef, ReactNode, Ref } from 'react'; import { LayoutUtilProps } from '../../types'; /** * Represents an item in the listview with a label and optional disabled state. * @template T - The type of additional properties for the item */ type ItemType = T & { /** The display label for the item */ label: string; /** Whether the item is disabled and cannot be selected */ disabled?: boolean; }; /** * Props for the ListView component * @template T - The type of additional properties for items * @extends LayoutUtilProps */ type ListViewWithItems = Omit, "children"> & { /** Array of items to render */ items: ItemType[]; /** Default selected items (uncontrolled) */ defaultSelected?: ItemType[]; /** Optional render function for items */ children?: ({ items }: { items: ItemType[]; }) => ReactNode; }; /** * Props for the ListView component without items array * @extends ComponentPropsWithoutRef<"div"> */ type ListViewWithOutItems = ComponentPropsWithoutRef<"div"> & { /** Default selected items (uncontrolled) */ defaultSelected?: string[]; }; /** * Option object for internal focus and selection management */ export type Option = { /** The DOM node for the option */ node: Element; /** Focusable elements within the option */ focusables: NodeListOf; }; /** * Represents the focused item in the listview */ export type FocusedItem = { /** Row index of the focused item */ row: number; /** Column index of the focused item */ col: number; }; /** * Props for the ListView component * @template T - The type of additional properties for items * @extends LayoutUtilProps */ export type ListViewProps = LayoutUtilProps & { /** Currently indeterminate items (controlled) */ indeterminate?: unknown[]; /** Callback when selection changes */ onSelectionChange?: (value: unknown[]) => void; /** Currently selected items (controlled) */ selected?: ItemType[]; } & (ListViewWithItems | ListViewWithOutItems); declare const ListViewElement: { (props: ListViewProps, ref: Ref): import("react/jsx-runtime").JSX.Element; displayName: string; }; /** * ListView component for displaying a list of selectable items in a grid layout. * * Features: * - Supports single and multiple selection modes * - Keyboard navigation with arrow keys * - Customizable item rendering * - Controlled and uncontrolled modes * - Accessible with proper ARIA attributes * - Focus management for interactive elements * - Layout utilities for positioning and spacing * * @template T - The type of additional properties for items * @example * * {({ items }) => items.map(item => ( * * ))} * */ export declare const ListView: ((props: ListViewProps & { ref?: React.ForwardedRef; }) => ReturnType) & { /** * ListViewOption component for individual selectable items within a listview. * * Features: * - Displays selectable options with proper ARIA attributes * - Supports disabled state for non-selectable options * - Keyboard navigation support * - Accessible with screen reader support * * @example * */ Option: import('react').ForwardRefExoticComponent>; /** * ListViewOptionCell component for rendering a cell within a listview option. * * Features: * - Renders a grid cell for option content * - Supports custom content and layout * - Accessible with proper ARIA attributes * * @example * Custom cell content */ OptionCell: import('react').ForwardRefExoticComponent, HTMLDivElement>, "ref"> & import('react').RefAttributes>; }; export {};