import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import type { ActionMenuItem } from "./action_menu"; import { type ShapeColumn, type ShapeGroup, type ShapeGroupOption, type ShapeLabels, type ShapeRecord } from "./shape_frame"; import type { StyleProps } from "./style_props"; export interface RecordChildrenProps extends StyleProps { rows: readonly T[]; rowKey: (row: T) => string; /** The child's columns in role order — the same slots the register shapes draw. * What a column adds up to is that column's own `total`, which lands in it. */ columns: readonly ShapeColumn[]; /** The row's name — the drawer's title and the row's accessible name. */ identity: (row: T) => string; /** * THE ROWS BELONG TO A WHEN — an itinerary's days, a history's years — so they * are drawn as RUNS under a subhead per key instead of as one flat list. A key * the reader can already read in a COLUMN is a sort, not a run: group by it * and that column goes. * * ONE FRAME, never a register per run: the columns, the fit and a column's own * total stay the section's, and the rows keep their place in the SET. */ group?: ShapeGroup; /** The groupings the band offers — `ShapeFrame.groups`. */ groups?: readonly ShapeGroupOption[]; /** The door onto ONE row — a drawer stepping ◀ ▶ over the set, or a route. */ record?: ShapeRecord; /** THE ROW'S OWN ACTS — its ⋯ menu, in the trailing gutter, and the only place * a child line's delete may live (`composition.md` § Row actions). A * destructive item carries `danger: true` and raises `Alert.confirm`. */ rowActions?: (row: T) => readonly ActionMenuItem[]; /** The rows are being read; the register is a placeholder until they land. */ loading?: boolean; /** HOW MANY ROWS THIS SECTION IS OWED — a count the record knows before any of * them exists. With none in yet, the section draws that many GHOST rows * instead of "nothing here". A count nobody stated, or a count of NONE, leaves * the empty line; a count past what a placeholder can say draws what it can * (`waitingRows`). Ignored once a row has landed. */ expected?: number; /** The read failed — a failed read is not an empty set. */ error?: { message: string; onRetry?: () => void; }; labels?: Partial; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * THE RECORD'S OWN ROWS — an order's lines, a shipment's charges, a unit's * movements. The register frame with **no strip and no toolbar**: under one * record the rows are few and known, so a search over them is a control that * answers a question nobody has, and a band strip would partition a set the * reader can already see whole. * * These are CHILDREN, never siblings — "a detail surface never contains a * register of its own siblings" (`composition.md` §Master-detail), which is the * list the reader arrived from, printed twice. * * The ADD act is not a prop: it rides the section's heading row, where it does * not move once the first row lands (`RecordSection.action`, the add-placement * law). Empty is ONE LINE under that heading — not a band, and not a region's * state. * * Neither is the TOTAL: a column states its own (`ShapeColumn.total`), drawn in * that column as the register's last row, never the ledger's book-wide band a * register's width away from the column it came from. */ export declare function RecordChildren(props: RecordChildrenProps): React.JSX.Element;