import "./waterfall_chart.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; /** `basis` and `total` are levels standing on zero (absolute `value`); `delta` is a step floating between * levels (signed `value`). */ export type WaterfallKind = "basis" | "delta" | "total"; export interface WaterfallItem { key: string; label: string; value: number; kind?: WaterfallKind; /** A neutral qualifier (a count, a period, a basis) — never a problem or state, or the row reads * inconsistent. */ meta?: string; /** Overrides the derived colour (adds `emerald`, subtracts `red`, basis neutral, a total by its sign); * only when the domain colours a step against its arithmetic. */ color?: string; } export interface WaterfallBar { key: string; label: string; meta?: string; kind: WaterfallKind; value: number; color: string; from: number; to: number; offset: number; size: number; /** The running level this bar leaves, where its connector sits. */ level: number; levelFraction: number; } export interface WaterfallLayout { bars: WaterfallBar[]; /** Always includes zero. */ min: number; max: number; /** Where the baseline is drawn. */ zeroFraction: number; } /** Exported and tested because floating bars landing on the arithmetic's levels is what no screenshot can * confirm. */ export declare function waterfallLayout(items: WaterfallItem[]): WaterfallLayout; export interface WaterfallChartProps extends StyleProps { items: WaterfallItem[]; /** `vertical` is the classic bridge; `horizontal` rows suit a narrow container or long names, which a * 70px column cannot hold and rotated labels do not solve. */ orientation?: "vertical" | "horizontal"; /** Pass the surface's own money formatter. */ formatNumber?: (n: number) => string; height?: number; emptyLabel?: string; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** The bridge: an opening level, the signed steps moving it, and the closing level (revenue to net, budget * to actual); floating steps and connectors show which way the money went. Over `Ledger` when scanning * for shape, over `BarChart` when bars are steps of one arithmetic rather than independent quantities; * `Ledger` stays for exact reconciliation. Derive steps and close from one computation so the bridge * closes on its total. */ export declare function WaterfallChart(props: WaterfallChartProps): React.ReactElement>;