import { list } from "@/components/ui/list-primitive"import { containerClassNames, List, useListContext, useListItemPosition } from "@/components/ui/list"import { IconTile, ListItem, ListItemActions, ListItemMeta, ListItemTitle, List, ListGroup,} from "@/components/ui/list-item"import { useHandleEntry, useListItemRegistration, useTruncated } from "@/components/ui/use-list-item"import { ListSortableRows } from "@/components/ui/list-sortable"import { containerClassNames, ListContext, PositionContext, useListContext, useListItemPosition,} from "@/components/ui/list-context"import { childId, childRowsOf, childText, defaultId, defaultText, listboxKeyDown, renderChild,} from "@/components/ui/list-rows"import { ListGroup } from "@/components/ui/list-group"import { cellKey, listGrid } from "@/components/ui/list-grid-primitive"import { ListGridCell, ListGridProvider, ListGridRoot, ListGridRow, useListGrid, useListGridInstance,} from "@/components/ui/list-grid"import { listRowAction } from "@/components/ui/list-row-action-primitive"import { collectRowActions, ListRowActionCells, listRowActionLabels, ListRowActionRoots, RowActionsContext, useRowActions,} from "@/components/ui/list-row-actions"import { useListRowActions } from "@/components/ui/use-list-row-actions"
List aria-label holds ListItems, optionally inside ListGroup label count. The name goes on the list itself: a ul (role="list"), or the listbox when rows are selectable, with no group around it. A row selects through a stretched link (href, aria-current="page" when selected) or a stretched UI SDK Button (onSelect), and its actions, chips and status stay their own targets. Give List a value, defaultValue or onValueChange and the rows become options of a UI SDK Listbox (arrow keys, one tab stop); options can't hold controls, so actions are ignored there (use rowActions). variant="card" lays rows out as cards in a responsive grid. Titles wrap to two lines, then show the full title in a tooltip; a status pill wraps below a narrow title, and trailing content and actions drop to their own line on a narrow row. List onSelect(id, details) runs before a row is chosen, for people and agents, and details.cancel() stops it. Agents see the list by its label with select(id); a selectable list also shows its listbox under the same name with setValue, and each action resolves to one of them. Rows of a non-selectable list are one tab stop: arrows or j/k move, Home/End and PageUp/PageDown jump, Enter opens the row through its link or button, and the moved-to row scrolls into view with the least scrolling; a selectable list takes j/k and the page keys as its own arrows. Pass items with renderItem (and getItemId, itemText) to render rows from data, or give a row list ListItem id children directly (each child an element with a string id; title is its text), which the list reads as the same data: past 200 rows (virtualize="auto", estimateSize) only the rows in view render, with aria-setsize/aria-posinset, every row reachable by keyboard and by agents' select, and find in page through hidden stubs. checkedIds with onCheckedIdsChange checks rows for a bulk action: Space or x toggles the focused row, each row shows a checkbox outside the tab order (checkLabel names it). emphasis="strong" sets a row in a medium weight and emphasis="muted" fades it, like unread and read messages. sortable with onReorder(ids, details) reorders the rows of a non-selectable list from data: each row gets a drag handle named after its title (sortableLabels), the row's link or button keeps its own tab stop, checked rows move together, and agents get move and reorder on a sortable named like the list. A sortable list renders every row instead of virtualizing. rowActions={(id) => ListRowAction[]} gives rows actions that run without choosing the row, also in a selectable list or a MasterDetail: the list becomes an APG layout grid (role="grid", rows with a primary cell, the row's link or button, and one gridcell per action), still one tab stop. Up/Down and j/k move between rows in the same column (clamped to a row's last cell), Left/Right (following the text direction) between a row's cells, Home/End to a row's ends and with Ctrl/⌘ to the grid's corners, Page Up/Down by a screen; Enter or Space presses the focused cell. Selectable, rows carry aria-selected and only the primary column selects (an arrow onto it or a press), never an action. A ListRowAction is { id, label, icon, onAction(details), href, newTab, disabled, confirm, tone }: id is shared by the rows that offer it, an icon makes an icon button with the label in a tooltip, onAction runs for a press and an agent and details.cancel() refuses it, href makes it a link, disabled (true or why) keeps it focusable with the reason in its tooltip, confirm is its data-agent-confirm sentence and tone: "destructive" colours it. On a fine pointer the actions show while the row is hovered, focused or selected (rowActionsVisibility="always" keeps them), always on touch, each with a 44px hit area. Agents see one component per action, named by its label (rowActionLabels.group), whose run(id) takes a row's id, rendered or not; the rows' own buttons stay out of the snapshot. A row that doesn't offer it, a disabled one or a cancelled run fails the step with why. ListGroup becomes a rowgroup named by its label. With sortable, row actions are plain buttons. MasterDetail's followFocus ignores focus on a row's actions.