import { type RowLineProps } from "./row"; import "./card_grid.css"; import type * as React from "react"; import type { ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type Picture } from "./avatar"; import { type StackedMark } from "./mark_stack"; import { type Reading } from "./reading"; import { type StyleProps } from "./style_props"; /** A row's subject as a mark — a person, a group or a thing — where it leads with no picture of its own. */ export type IdentityMark = Pick; export interface CardGridRun { key: string; label: string; rows: readonly T[]; } export interface CardGridFact { label: string; /** The register's own cell, so a figure reads as it does in the column. */ cell: ReactNode; /** * The raw reading (`ShapeColumn.value`). Unstated, empty or zero draws nothing, label included, * since a card has no heading for a zero to answer. Absent, the fact is judged by what it draws. */ value?: Reading; } /** * `card`: read — mark or picture, name, caption, its state, then its figure and two or three facts at its * foot. `tile`: the picture is the card, recognised not read; no facts, no figure. */ export type CardGridVariant = "card" | "tile"; export interface CardGridProps extends StyleProps { rows: readonly T[]; rowKey: (row: T) => string; /** Absent, the grid is flat. */ runs?: readonly CardGridRun[] | null; title: (row: T) => string; /** The line under the title: what tells the row from its neighbours. */ caption?: (row: T) => RowLineProps["children"] | null; /** * A photograph URL, or the file itself where rows are papers; one prop because an `` at a * PDF draws an empty square. */ picture?: (row: T) => Picture | null; /** Where the rows are parties rather than things. */ mark?: (row: T) => IdentityMark | null; /** * Most telling first; three at most. The caller draws each value and states its reading so no * label sits over nothing. Never on a `tile`. */ facts?: (row: T) => readonly CardGridFact[]; /** The row's one figure, first at the card's foot and the foot's width, so a meter reads whole. */ figure?: (row: T) => CardGridFact | null; /** Where the row stands (its status), first in the card's middle. */ badge?: (row: T) => ReactNode; /** What needs the reader now — a deadline close or past, a check standing — under the badge. */ notes?: (row: T) => ReactNode; open?: (row: T) => void; /** A card's door handed back, as `TableRow`'s: the row a reader returns from takes focus there. */ doorRef?: (row: T) => React.Ref | undefined; /** Where the title does not read as one. */ identity?: (row: T) => string; /** Outside the press target. */ acts?: (row: T) => ReactNode; tick?: (row: T) => { checked: boolean; onChange: (on: boolean) => void; }; variant?: CardGridVariant; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * THE SAME ROWS AS A GRID OF CARDS, for rows the reader recognises before reading and only opens. * Comparing figures across rows is `Table`; moving rows between places is `Board`. The card is not * a button: it holds a tick and verbs, so the door is a `RowFocusEntry` beside them. * * Every card stacks one anatomy: picture, title, caption, a middle that takes what it holds (the badge, * the notes), then its figure and facts pinned to its foot. Cards in a grid row stand one height, so their * feet share a line whichever optional line a card lacks. */ export declare function CardGrid(props: CardGridProps): React.ReactElement>;