import * as React from 'react'; import * as echarts from 'echarts'; import { EChartsOption } from 'echarts'; export { EChartsOption } from 'echarts'; /** The live ECharts instance type (whatever `echarts.init` returns). */ type EChartsInstance = ReturnType; interface ChartProps extends Omit, "onClick"> { /** The ECharts option (series, axes, tooltip, legend, …) — full ECharts API. */ option: EChartsOption; /** Replace the whole option instead of merging on update. Default `true`. */ notMerge?: boolean; /** Toggle ECharts' built-in loading spinner. */ loading?: boolean; /** Renderer backend. Default `"canvas"`. */ renderer?: "canvas" | "svg"; /** Called with the instance right after it's created (and after each re-init). */ onInit?: (chart: EChartsInstance) => void; } /** * A thin, fully-featured wrapper over Apache ECharts that auto-themes to the * active Silica tokens. * * ECharts owns all rendering; Silica supplies the palette. The chart re-reads * the tokens (and re-inits, since ECharts themes are fixed at `init`) whenever * the ambient theme changes — a `data-theme` flip on `` or an OS * light/dark switch — so charts track the rest of the UI automatically. It also * resizes with its container via a `ResizeObserver`. * * Give the container a height (defaults to 20rem); ECharts cannot measure a * zero-height box. */ declare const Chart: React.ForwardRefExoticComponent>; interface SparklineProps extends Omit { /** The series values. */ data: number[]; /** `"line"` (default) or `"bar"`. */ type?: "line" | "bar"; /** Fill under a line sparkline. */ area?: boolean; /** Series color. Defaults to the Silica primary via the theme palette. */ color?: string; /** Show a tooltip on hover. Default `false` — sparklines are glanceable. */ tooltip?: boolean; /** Optional category labels (used only in the tooltip). */ labels?: (string | number)[]; } /** * A compact, axis-less trend line/bar for inline metrics (KPI cards, table * cells). It builds the ECharts option for you and renders through {@link Chart}, * so it inherits Silica theming and container-resize behavior. */ declare const Sparkline: React.ForwardRefExoticComponent>; /** * Builds an Apache ECharts theme from the live Silica design tokens. * * ECharts bakes its theme in at `init()` time and reads plain color strings, not * CSS variables — so we resolve the current `--color-*` custom properties off a * live element with `getComputedStyle` and hand ECharts concrete values. Because * we read from a real element, a prefixed / nested-theme subtree (a client site * embedded in the platform shell) yields that subtree's palette, and the * `` wrapper re-runs this whenever the ambient theme flips light↔dark. * * The resolved values may be `oklch(…)` / `color-mix(…)` strings; modern canvas * and SVG renderers accept those directly. */ /** * @param el - element to read tokens from; defaults to `document.documentElement`. * @returns an ECharts theme object (safe to pass to `echarts.registerTheme`). */ declare function buildSilicaEChartsTheme(el?: HTMLElement | null): Record; export { Chart, type ChartProps, type EChartsInstance, Sparkline, type SparklineProps, buildSilicaEChartsTheme };