import "./record_expected_set.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import type { DisplayFile } from "./file_thumbnail"; import { type RecordLabels } from "./locale"; import { type Stage } from "./shape_frame"; import { type StyleProps } from "./style_props"; /** ONE ITEM THE RECORD HAS, against the set it was required from. `key` is * matched against a required option's `key` — an item naming no required option * is an EXTRA, listed under its own heading rather than dropped, and several * items may name one option and hang under its row together. */ export interface PresentItem { key: string; /** What this item is CALLED. REQUIRED, because the key is matched and never * read: a set filed against an option the field has since retired would * otherwise put `opt_9fK2` on the screen. */ label: string; /** What was filed for it — the first one IS the row's face. */ files?: readonly DisplayFile[]; /** One line about this item, in the app's words — never mechanics. */ note?: string; /** The record this item IS — the child row it was read from. */ onOpen?: () => void; } export interface RecordExpectedSetProps extends StyleProps { /** The select's options — what the record is required to hold, in the field's order. */ required: readonly Stage[]; /** What the record has, by option key. */ present: readonly PresentItem[]; /** * WHAT THE REQUIRED THINGS ARE, which decides what a missing one looks like. * * `files`: every required item is a DOCUMENT, so the set is a column of file * rows and a gap is a GHOST row, which a dropped file files against. * * `items`: a required set of THINGS — services sold, checks carried out — * which have no face to show, so they stay a checklist and the gap's act is * the row's own verb. */ kind: "files" | "items"; /** Fills a gap: press the ghost, or drop a file on it. The drop hands over the * FILES it delivered and the press hands over none — one channel, because * they are the same act with and without bytes. */ onAdd?: (option: Stage, files: readonly File[]) => void; /** Opens one filed file with the whole pile it belongs to, so the surface can * put it in its own viewer. ABSENT, the section opens its own * `FileGalleryDialog` at that file. */ onOpenFile?: (file: DisplayFile, files: readonly DisplayFile[]) => void; /** UN-FILES one item. Removing the LAST item under an option returns that row * to its GHOST: the option belongs to the FIELD. */ onRemove?: (item: PresentItem) => void; labels?: Partial; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * A REQUIRED SET AGAINST WHAT IS PRESENT — the documents a shipment owes, the * services an order was sold, the forms an application needs. **Absence is the * information**, so every required option holds a row whether or not the record * has it: a list of what was filed cannot be read for what is missing, and a * count on its own ("3 documents") names none of them. * * A DOCUMENTS DESK (`kind="files"`) is drawn as the files it is: each required * option is a `FileRow` carrying the filed document's own face, and each gap is * that row with nothing in it. * * The count IS the register's own cell (`ExpectedSetCell`), so a row and the * record behind it cannot drift apart in ring, tone or words. The meter says the * set is SHORT; the GHOSTS say by what, slot by slot. */ export declare function RecordExpectedSet(props: RecordExpectedSetProps): React.ReactElement>;