/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What a state's card draws of its details (#1510, `Flowchart Records * Spec.md` R22, R25–R30, R33, R34), the legend's marks for the reads (R31), * a tag in its look, and the probe that measures a card's words as it draws * them — in the `flowchart` recipe's slots, which own every colour, size and * type: these set data attributes and geometry alone. * * - **The card**: its head — its label, its ×n and ↻ n, over its key — then * each read the details show on the canvas, in their order, each in the * block its model gives it: a figure's line, its value in the app's locale * with its unit; a tag list beside its label, its lines, the last ending in * +n, its title naming the rest; a title over bars — each a bin, 2 short of * the next, or on a linear axis, too thin for that, flush with it and a pixel * at least; as tall as its count over the card's tallest — and the axis's * ticks; a title over a list's top lines, each its name, a track filled to * its share, and the share. *No data* for a row there is none of or a value * it lacks, *none* for a list with no items; while a row lands, the shared * placeholder shapes where its values go, its labels drawn. * - **A tag** (R30), the card's, the legend's and the inspector's: a wash or * the neutral look in the recipe's own slot, or the design system's Tag in * its definition's variant and palette, the slot giving it its size. * - **The probe** (#1510): the tag lists' labels and their tags, drawn out of * sight in the slots a card draws them with, measured after each render and * again once the fonts land — so a card's tags wrap, and its height is * known, before the layout places it; where nothing measures (a test's DOM), * the estimate stands. * * @packageDocumentation */ import { type ReactNode } from "react"; import { type SystemStyleObject } from "@chakra-ui/react"; import { type FlowchartBar, type FlowchartBins, type FlowchartCard, type FlowchartKindDetails, type FlowchartReadValue, type FlowchartTextMeasure } from "./details.js"; import { type FlowchartLegendMark, type FlowchartProbeTexts, type FlowchartTagLook } from "./details-draw.js"; import { type FlowchartTickAt } from "./details-words.js"; import type { FlowchartWords } from "./messages.js"; type Styles = Record; /** Where a bar draws across its axis, as CSS. */ export interface FlowchartBarAcross { /** Where it starts, a share of the axis. */ readonly left: string; /** Its width: its span 2 short of the next, or its span alone where it draws flush. */ readonly width: string; /** Where it draws flush, a pixel; else none. */ readonly minWidth: string | undefined; /** Whether it draws flush with its neighbours: too thin for the room between them. */ readonly flush: boolean; } /** * Where a bar draws across an axis `width` px wide (R26): from its start, 2 * short of its span, the room to the next — or, on a linear axis, where its * span leaves under a pixel past that room, its span alone, flush with its * neighbours and a pixel at least, so a thin bin still shows what it counts. * * @param bins - The flowchart's bins * @param bar - The bar * @param width - The axis's width, in px * @returns Its start, its width and its least, and whether it draws flush */ export declare function barAcross(bins: FlowchartBins, bar: FlowchartBar, width: number): FlowchartBarAcross; /** * A bar's height on a card: as tall as its count over the card's tallest, a * pixel at least where it counts anything. * * @param bar - The bar * @returns Its height, in px */ export declare function cardBarHeight(bar: FlowchartBar): number; /** Props of {@link FlowchartTag}. */ export interface FlowchartTagProps { /** Its size: the card's slot, or the inspector's. */ readonly css: SystemStyleObject | undefined; /** Its words. */ readonly text: string; /** Its look. */ readonly look: FlowchartTagLook; /** What it names where its words do not: a +n's, the tags past it. */ readonly title?: string | undefined; /** A +n's mark: the tags it stands for. */ readonly more?: boolean | undefined; } /** * A tag in its look (R30): a wash or the neutral look in the slot it is given, * or the design system's Tag in its definition's variant and palette — the * Tag's `colored`, so it draws in the palette — the slot giving it its size * alone, its words in the Tag itself, at the slot's type: the Tag's label * takes its own size's type, 12px on 16. * * @param props - Its size, words, look, and title * @returns The tag */ export declare function FlowchartTag({ css, text, look, title, more }: FlowchartTagProps): import("react/jsx-runtime").JSX.Element; /** Props of {@link FlowchartCardContent}. */ export interface FlowchartCardContentProps { /** The `flowchart` recipe's slots. */ readonly styles: Styles; /** The states' details. */ readonly kind: FlowchartKindDetails; /** The card: its reads, each in its block. */ readonly card: FlowchartCard; /** The flowchart's words. */ readonly words: FlowchartWords; /** What the head names it: its label, else its key. */ readonly name: string; /** Its key under its name; `undefined` where the name is the key. */ readonly code: string | undefined; /** Its ×n and ↻ n, beside its name. */ readonly badges: ReactNode; } /** * A state's card where its details draw (R22; see the module docs): its head, * then its reads. * * @param props - The recipe's slots, the details, the card, the words, its name and key, and its badges * @returns The card's contents */ export declare function FlowchartCardContent({ styles, kind, card, words, name, code, badges }: FlowchartCardContentProps): import("react/jsx-runtime").JSX.Element; /** * The ticks a histogram read lists (R28): each where it is, and its own words * where it gives them; `undefined` where it lists none, and the axis names * round durations. * * @param ticks - The read's ticks * @returns The ticks */ export declare function ticksOf(ticks: Extract["value"]["ticks"]): FlowchartTickAt[] | undefined; /** * A read's mark in the legend (R31): a figure's `123`; four bars on a base; a * list's two lines and their shares; a label's badge and its two lines — the * recipe's colours, by each part's `data-mark`. * * @param props - The mark * @returns The mark */ export declare function FlowchartLegendMarkView({ styles, mark }: { styles: Styles; mark: FlowchartLegendMark; }): import("react/jsx-runtime").JSX.Element; /** * How wide a card's words draw (#1510; see the module docs): the probe that * measures them, and the measure the cards are worked out with — measured * where the probe measures, estimated where it does not. * * @param styles - The `flowchart` recipe's slots * @param texts - The words to measure * @returns The measure, and the probe to draw out of sight */ export declare function useFlowchartTextMeasure(styles: Styles, texts: FlowchartProbeTexts): { measure: FlowchartTextMeasure; probe: ReactNode; }; export {}; //# sourceMappingURL=details-card.d.ts.map