import "./list_item.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; import type { TextColor } from "./text_ink"; /** * WHAT THE ROW'S TRAILING SLOT HOLDS, which decides everything else about it. * * - `settings` (the default): a 64px row of a settings or detail list. Its * `right` holds a CONTROL, so the press target is the region BESIDE it and * the slot keeps its own tab stop. * - `option`: a row you PICK — a menu item, a listbox option, a pointer to * another record. It sizes to its content and the WHOLE row is the button, * because an option's trailing slot is a tick or a shortcut and never a * control. */ export type ListItemVariant = "settings" | "option"; export interface ListItemProps extends StyleProps { left?: React.ReactNode; /** A quiet line ABOVE the title, naming what the subject IS — the table a * linked record lives in, the group a value belongs to. It names the title, * so the two read as one label. */ overline?: React.ReactNode; /** A plain string gets the row's own title type; a node renders as-is — a * subject whose label is richer than one line of text (a code and its full * official name, a run with the search match bolded). Pass * `accessibilityLabel` when the title is a node. */ title?: React.ReactNode; /** Title ink. Default, except where the row is an ACTION rather than a * subject — a leading "Browse all" tinted to match its glyph. */ titleColor?: TextColor; description?: React.ReactNode; right?: React.ReactNode; onPress?: () => void; /** Pointing at the row, for a list that opens a preview beside it. */ onHoverIn?: () => void; /** Persistent selection — the current value in a listbox, the open app. */ selected?: boolean; /** The ROVING keyboard highlight, driven by a controlling input through * `aria-activedescendant`. Distinct from `selected`: one says where the * keyboard is, the other says what the list holds. */ focused?: boolean; /** DOM id, referenced by a combobox input's `aria-activedescendant`. */ id?: string; /** The row's ARIA role inside a composite widget. The element is already a * `