import React from 'react'; export interface ListItem { /** Unique within the list. Selection is held by id. */ id: string; /** The row's text — a task, a file name, a person. */ label: React.ReactNode; /** Typeahead and the row's name when `label` is not a string. */ textValue?: string; /** A second line, quieter: an agent and a time, a path, a preview. */ description?: React.ReactNode; /** Before the text: an Avatar, or a 16px Icon. Decorative. */ leading?: React.ReactNode; /** After the text, not interactive: a Badge, a time, a size. */ meta?: React.ReactNode; /** The row opens this — a record's page. Takes the place of `onAction`. */ href?: string; isDisabled?: boolean; } export type ListSelectionMode = 'none' | 'single' | 'multiple'; /** Table's vocabulary. A list has no `relaxed`: its default is already 48px. */ export type ListDensity = 'compact' | 'default'; export interface ListProps { items: readonly ListItem[]; /** Names the list. Required unless `aria-labelledby` is given. */ 'aria-label'?: string; 'aria-labelledby'?: string; /** * `none` (default): a press opens the row — `href` or `onAction`. * `single`: a press selects one; Enter or a double click opens it. * `multiple`: each row has a checkbox. A press opens the row while nothing * is selected, and toggles it once something is. */ selectionMode?: ListSelectionMode; selectedKeys?: Iterable; defaultSelectedKeys?: Iterable; onSelectionChange?: (keys: Set) => void; /** A row was opened — "show this run". Rows with an `href` follow it instead. */ onAction?: (key: string) => void; /** * Buttons at the end of a row — archive, a Menu of more. Reached with → from * the row, and each needs a name that says which row it acts on. */ renderActions?: (item: ListItem) => React.ReactNode; /** Shown, in a row of its own, when `items` is empty. */ renderEmptyState?: () => React.ReactNode; /** * `default`: 48px rows, room for a description and an Avatar. `compact`: * 32px, a TreeView row — for a long list scanned by label, such as a log or * an activity feed. An Icon keeps a compact row at 32; a `mini` Avatar makes * it 36; `sm` and larger belong in default rows. */ density?: ListDensity; id?: string; className?: string; } /** * List — rows of records to open, pick or act on: an approval inbox, a list * of files, "choose one of these" that is not a form field. * * NOT A TABLE, NOT A LISTBOX, NOT A
    * * - A Table is for columns that are compared down. A List row is one thing * read across — a label, a line under it, a badge — with no header. * - A listbox (Select, Combobox) holds values for a form and nothing * inside its options can be focused. A List row can hold buttons. * - A `
      ` of links is right for a short static list. It is a tab stop * per row, and it has no selection; past a handful of rows, or once rows * are picked, it wants this. * * HOW IT IS BUILT * * - React Aria's `useGridList` and `useGridListItem` over `useListState`: a * `grid` of `row`s, each one `gridcell`. One tab stop; ↑ ↓ move between * rows, Home and End go to the ends, typing jumps to a label. → moves into * a row's own buttons and ← back out, so a row's actions are reachable * without a tab stop each. * - `href` rows are links: a press follows them, and a modified click opens * a new tab, through React Aria's router. * - `multiple` gives each row a real Checkbox, named "Select" and the row's * label. Not drawn, as TreeView's is: here a press opens the row, so the * box is the only way a pointer can select one without opening it. * - An empty list keeps its name and says why it is empty, in a row, so a * screen reader landing on it hears more than "grid, 0 rows". */ export declare function List({ items, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, onAction, renderActions, renderEmptyState, density, id, className, }: ListProps): React.JSX.Element; export declare namespace List { var displayName: string; } //# sourceMappingURL=List.d.ts.map