import * as react from 'react'; import { ReactNode, HTMLAttributes } from 'react'; interface ChartPadding { top: number; right: number; bottom: number; left: number; } /** * Multi-series color cycle — the `--chart-1…5` tokens from globals-layers.css * with their literal values as fallbacks. `Donut` cycles these for segments * without an explicit `color`; consumers can reuse the cycle for their own * series (badges, custom charts, DataTable cell accents). */ declare const CHART_SERIES_COLORS: readonly ["var(--chart-1, #FFFF00)", "var(--chart-2, #FFB800)", "var(--chart-3, #22C55E)", "var(--chart-4, #3B82F6)", "var(--chart-5, #EF4444)"]; /** * Yellow-on-noir intensity scale for `SegmentBarChart` — brightest segment first, * then warm yellow, then progressively muted golds. Cycles when there are more * segments than colors. */ declare const SEGMENT_BAR_COLORS: readonly ["var(--tollerud-yellow, #FFFF00)", "var(--tollerud-yellow-warm, #E8D500)", "color-mix(in srgb, var(--tollerud-yellow-warm, #E8D500) 65%, var(--tollerud-noir-700, #222222))", "color-mix(in srgb, var(--tollerud-yellow-warm, #E8D500) 38%, var(--tollerud-noir-700, #222222))", "var(--tollerud-noir-600, #333333)"]; declare function formatChartNumber(value: number, locale?: string): string; interface ChartDecimalFormatOptions { minimumFractionDigits?: number; maximumFractionDigits?: number; /** Appended as-is, e.g. ` kr/l` or ` ,-` */ suffix?: string; } /** Decimal formatter for rates and units — pair with `formatValue` on `TimeSeriesChart`. */ declare function formatChartDecimal(value: number, locale?: string, options?: ChartDecimalFormatOptions): string; declare function formatChartDateShort(date: Date, locale?: string): string; declare function formatChartDateLong(date: Date, locale?: string): string; interface TimeSeriesPoint { date: Date | string | number; value: number; /** Tooltip title — store name, series label, etc. */ label?: string; /** Extra tooltip lines — product name, notes */ meta?: string[]; } interface TimeSeriesSeries { /** Series name — shown in the legend, tooltip rows, and SR table header. */ label: string; points: TimeSeriesPoint[]; /** Line color; defaults to the `--chart-1…5` palette cycled by position. */ color?: string; } interface TimeSeriesRange { value: string; label: ReactNode; /** Omit for "all time". Milliseconds back from the latest point. */ durationMs?: number; disabled?: boolean; } interface TimeSeriesChartProps extends Omit, 'children'> { /** Single series. Ignored when `series` is provided. */ data?: TimeSeriesPoint[]; /** * Multiple index-aligned series (same dates by position). Takes precedence * over `data`. Each series gets a line + crosshair dot; the tooltip and SR * table stack all series at the active point. Area fill and the latest-value * badge are single-series only. */ series?: TimeSeriesSeries[]; height?: number; curve?: 'linear' | 'step'; yAxis?: 'left' | 'right' | 'none'; padding?: Partial; /** Formats Y-axis ticks, latest-value badge, and default tooltip values. Independent of `locale` date formatting. When set, `valuePrefix` / `valueSuffix` are ignored. */ formatValue?: (value: number) => string; /** Prepended to the locale-formatted number (tooltip, Y-axis, latest badge). Ignored when `formatValue` is set. */ valuePrefix?: string; /** Appended to the locale-formatted number (tooltip, Y-axis, latest badge). Ignored when `formatValue` is set. */ valueSuffix?: string; formatDate?: (date: Date) => string; formatAxisDate?: (date: Date) => string; /** Pin the latest value on the Y axis (single series only). */ showLatestValue?: boolean; ranges?: TimeSeriesRange[]; range?: string; onRangeChange?: (value: string) => void; toolbarLeft?: ReactNode; /** Single-series only — for multi-series the stacked tooltip is used. */ renderTooltip?: (point: TimeSeriesPoint, index: number, formattedValue: string) => ReactNode; /** Show a swatch legend above the chart (multi-series; default on). */ showLegend?: boolean; emptyMessage?: string; locale?: string; ariaLabel?: string; /** Visually-hidden data table exposing every point to screen readers (default on). Set `false` to opt out. */ srTable?: boolean; } declare const TIME_SERIES_PRESETS: TimeSeriesRange[]; declare const TimeSeriesChart: react.ForwardRefExoticComponent>; export { CHART_SERIES_COLORS as C, SEGMENT_BAR_COLORS as S, TIME_SERIES_PRESETS as T, type ChartDecimalFormatOptions as a, TimeSeriesChart as b, type TimeSeriesChartProps as c, type TimeSeriesPoint as d, type TimeSeriesRange as e, type TimeSeriesSeries as f, formatChartDateLong as g, formatChartDateShort as h, formatChartDecimal as i, formatChartNumber as j };