/** LineChart — recharts internals, data props only, the screen's own text (W2 §The Kit). */ import { Line } from "recharts"; import type { ComponentProps, ReactNode } from "react"; import { type KitStyled, type KitEngine, type KitRendered } from "../tokens.js"; import { type ChartFormat } from "./sanitize.js"; /** A series key, or a descriptor: `label` (or `name`, the same thing) renames it, * `color` paints it, and any other engine prop paints THAT series alone — over * the chart-level one it collides with. * * `color` is the KIT's word for a series' paint, because the engine's own name * for it is a different one per chart (`stroke` on a line, `fill` on a bar) and * a passthrough that only spoke the engine's name left the obvious word landing * on the SVG as an inert attribute: a chart that took seven hex colors and drew * all seven from the theme. The engine's own name still wins where both are * written. * * `name` is that same lesson from the other side. It is the ENGINE's word for a * series' label, so it is Omit-ed here and the component sets it from `label` — * which left the most obvious word for the thing landing nowhere at all: a * series written `{ key: "spend", name: "Spend" }` charted as "spend" and said * nothing about why. So the KIT reads the word as an alias for `label`, and * still owns what reaches the engine under it. */ export type SeriesInput> = string | ({ key: string; label?: string; name?: string; color?: string; } & Omit); /** Plus `format`: a line's value is PRINTED in the tooltip, so it is the one place * a series' figure is written out — and the formatter lives on the SERIES rather * than on the chart, because two lines in different units (an amount and a count) * have no one text a chart-level formatter could write for both. * * It is Omit-ed from the engine before ours is added, the same move `dataKey` and * `name` take: React's SVG attribute list carries a legacy `format?: string`, and * an un-omitted one INTERSECTS with the Kit's into a type no function satisfies. */ type LineSeriesInput = SeriesInput, "format"> & { format?: ChartFormat; }>; interface LineChartOwnProps extends KitStyled { /** Rows from a tool call. */ data: Array>; /** Category (x) axis field. */ xKey: string; /** One or more value series. */ series: LineSeriesInput[]; /** The x tick and the hovered point's heading, as a function of the row — * `(row) => day(row.month)`. Without it the axis prints the raw "2026-07-30" * the host stored under every tick. */ xFormat?: ChartFormat; height?: number; emptyState?: string; /** Kit elements shown in place of `emptyState` when there is nothing to plot. */ empty?: ReactNode; /** Kit value components composed for the hovered point, in place of the * default tooltip. Written as a function of the point, it arrives as ONE * element per point in `data` order. */ tooltip?: ReactNode | readonly ReactNode[]; /** A series key drawn under the chart. */ legend?: ReactNode; } /** Plus any recharts `` prop, handed to EVERY line. It arrives AFTER the * Kit's own defaults, so `stroke` wins, and BEFORE `dataKey`/`name`, which the * component owns — an overridden one would plot a field that is not there. */ export type LineChartProps = LineChartOwnProps & KitEngine, LineChartOwnProps, "dataKey" | "name">; export declare function LineChart({ data, xKey, series, xFormat, height, emptyState, empty, tooltip, legend, style, children, pending, ...engine }: LineChartProps & KitRendered): import("react").JSX.Element; export {};