import "./record_frame.css"; import type * as React from "react"; import { type ReactNode } from "react"; import { useRender } from "@base-ui/react/use-render"; import { type FactGroupField } from "./fact_groups"; import { type IconName } from "./icon"; import { type SectionNavLabels, type SectionNavStep } from "./section_nav"; import { type StyleProps } from "./style_props"; /** What a section holds besides its fields: child rows, files, text, a reading, a component. */ export interface RecordFrameBlock { key: string; title: string; /** Rows the block holds, beside its title. */ count?: number; /** The block's one add, at its heading's right. */ action?: ReactNode; /** The body carries its own title (a reading's card): no heading is drawn over it. */ namesItself?: boolean; /** The file an act of the section makes: it stands right under the acts that make it. */ paper?: boolean; body: ReactNode; } /** Where a staged section stands in the work: behind, the one being worked, ahead. */ export type RecordFrameStep = SectionNavStep; /** One part of the record, in the order the work runs: its fields, its acts under them, then what it holds. */ export interface RecordFrameSection { /** Stable: the navigation item's key and its tab's value. */ key: string; title: string; /** One muted paragraph under the title: what the section is for, or what its act does. */ description?: string; /** A staged section's place in the work, marked on its navigation item. */ step?: RecordFrameStep; /** An end the work takes instead of its path — a cancellation, a refusal: never a step, its item led by its * glyph and set apart after the path's. Pass the exits last. */ exit?: boolean; /** What the section holds, as the glyph its navigation item leads with where it is no step. */ icon?: IconName; /** Label beside control on a wide column, label above on a narrow one — every field alike, so the labels * read down one column. */ fields?: readonly FactGroupField[]; /** Under the fields and acts, each under its heading; one titled as the section, or the one a heading would * name under no field (a card naming itself beside it), is headed by the section's own title. */ blocks?: readonly RecordFrameBlock[]; /** Under the fields, in their column: what the acts ask, what they lack, then an `ActGroup`. */ acts?: ReactNode; /** The acts read what a block holds (a paper they need, the rows their paper prints): they stand at the * section's foot, under its blocks, rather than under its fields. */ actsLast?: boolean; /** One muted line where the section holds nothing yet: what it waits on. */ note?: string; /** An `ActionMenu` at the right of its heading: what destroys or withdraws the section's work, never a * button of its foot. */ menu?: ReactNode; /** Page: the section is a page of its own, which this opens — a workspace of its own (a long related list, a * document library) rather than part of reading the record. Nothing of it is drawn here: the rail lists it * after the scroll's items, a chevron at its end; with no rail it stands at its place as one link row. */ onOpen?: () => void; } /** One thing read beside the record — its comment thread, its history. */ export interface RecordFrameCompanion { /** Stable among the companions: the tab's value. */ key: string; title: string; /** The glyph its item leads with where it is one of the sections' (a rail's, a drawer's tabs). */ icon?: IconName; body: ReactNode; } export interface RecordFrameProps extends StyleProps { /** `page` for work read at length; `drawer` for rows worked one after another from the register. */ door: "page" | "drawer"; /** A `RecordHeader`. Absent on a page, the frame is its one section's own page: the section's heading is the * page's title, under the way back to the record. */ header?: ReactNode; /** A `ChecksCallout`, only while a check stands. */ checks?: ReactNode; /** In the order of the work, stacked. Three or more are navigated: a page's rail (a phone's strip), a * drawer's tabs. */ sections: readonly RecordFrameSection[]; /** Page: sticky beside the sections on a desk, the last section elsewhere, one under its title, two or more * as tabs of one column. Drawer: the last section, or with tabs the last tabs, one each. */ companions?: readonly RecordFrameCompanion[]; /** Page: the way back, atop the rail. */ back?: { label: string; onPress: () => void; }; /** Drawer: ◀ ▶ through the register's rows; an absent end is disabled. */ step?: { onPrev?: () => void; onNext?: () => void; }; /** Drawer: whether it stands open; absent, open. */ open?: boolean; /** Drawer: the close, the scrim and Escape. */ onClose?: () => void; /** Drawer: the record has a page of its own — "Open page" beside the close leaves for it. */ onOpenPage?: () => void; /** The first read has not settled: the same frame, in skeleton. */ loading?: boolean; labels?: Partial; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * ONE RECORD, WHOLE — the header, the checks that stand, then its sections stacked in the order of the work: * each its title, what it is for, its fields, its acts under them and what it holds. The companion (the * comments) stands sticky at a desk's right from 1056px, and is the last section elsewhere. Three sections or * more are navigated: on a page a rail at the left — the way back, each section by its name, the one in view * highlighted, a step carrying its mark, then the sections that are pages of their own, each ending on a * chevron — which under 768px is a strip pinned over the sections that scrolls sideways; in a drawer, tabs * under its header and checks, the companions the last ones. Fewer just stack, a page of its own as one link * row at its place. The frame decides the layout off its own box; nothing an app states moves it. */ export declare function RecordFrame(props: RecordFrameProps): React.JSX.Element;