import "./money_band.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import type { FactSave } from "./record_facts"; import type { RecordSummaryTone } from "./record_summary"; import { type StyleProps } from "./style_props"; /** What the figures are COUNTED IN. `currency` makes the cell money — the * reading the kit groups and signs as money — and `unit` names anything else * it is counted in. Stated on both readings of one quantity, because a total * and the level read against it are the same quantity twice. */ interface MoneyBandQuantity { currency?: string; unit?: string; } interface MoneyBandCellBase { /** What this figure IS, over it — the band's only words. */ label: string; /** The figure's valence, and the band's one accent. A countdown takes the * KIT's (below) whenever the date has something to say. */ tone?: RecordSummaryTone; } /** ONE CELL OF THE BAND — a figure, a level read against its bound, or a date's * countdown. A union rather than three optional fields, because a cell stating * all three would be three readings with nothing to pick between them. */ export type MoneyBandCell = MoneyBandCellBase & (({ kind: "amount"; /** `null` is a figure NOBODY STATED, and draws the record's absent mark * — never the band's zero, which claims somebody set it to nothing. */ value: number | null; } & MoneyBandQuantity) | ({ kind: "meter"; value: number | null; /** What the level is READ AGAINST. `null` is no bound at all, which is a * figure rather than a reading, and the cell draws it as one. */ limit: number | null; /** Which side of the bound needs attention — a collection is short * (`under`), a spend is over. */ alert: "over" | "under"; } & MoneyBandQuantity) | { kind: "countdown"; /** The date the record is working to. `null` is a deadline nobody * recorded, which is not a deadline that is fine. */ due: string | null; /** WHETHER THE RECORD IS STILL WORKING TO THAT DATE (default `true`). * `false` draws the plain day — `DateCell`'s own rule on the register * row — because a record that LEFT the flow has no act to be late for. */ counting?: boolean; /** HOW TO SAVE THAT DATE, and with it the cell carries the same ruled * inline editor the record's own date fact does (`record_facts.tsx`). * The countdown stays the cell's READING; the DATE under it is edited. */ onSave?: FactSave; }); export interface MoneyBandProps extends StyleProps { /** TWO TO FOUR, and the type is the enforcement. One figure is the header's * (`RecordSummary`'s `metric`); past four the cells fall under the measure a * money figure is read at. */ cells: readonly [MoneyBandCell, MoneyBandCell] | readonly [MoneyBandCell, MoneyBandCell, MoneyBandCell] | readonly [MoneyBandCell, MoneyBandCell, MoneyBandCell, MoneyBandCell]; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * THE RECORD'S MONEY, AS A BAND — two to four readings of one story, under the * header and above the work. `templates.md` rule 7 keeps the header to identity * and ONE figure, so this is where the rest go. * * Its FIGURES are readings and nothing types into them. The one thing edited * here is the DEADLINE, because a date is stated by a person rather than worked * out from the rows below (`onSave` on a countdown). * * The cells fit as many across as the BAND affords and reflow on their own * (`money_band.css`), with no width named anywhere. A cell asks for what its own * reading needs, so a level read against a MONEY bound takes the row it cannot * share. */ export declare function MoneyBand({ cells, testID, render, ref, ...props }: MoneyBandProps): React.JSX.Element; export {};