import * as react_jsx_runtime from 'react/jsx-runtime'; export { KeyMetricsContextValue, KeyMetricsProvider, useKeyMetricsContext } from './key-metrics-context.js'; import 'react'; type KeyMetricsSize = "sm" | "md" | "lg"; /** * Whether an **up** arrow should read as “good news” for tinting and assistive text. * - **`higher_is_better`** (default) — revenue, pass rate, approved count: up = favorable. * - **`lower_is_better`** — defects, overdue, **low PBI / quality flags**: more flags + up arrow = unfavorable. * - **`informational`** — volume or mix only; keep arrows **muted** (direction without value judgment). */ type MetricTrendPolarity = "higher_is_better" | "lower_is_better" | "informational"; type MetricTrendTone = "positive" | "negative" | "muted"; /** Maps `trend` + polarity to semantic tone for colours (arrow direction still follows `trend`). */ declare function metricTrendTone(trend: "up" | "down" | "neutral", polarity?: MetricTrendPolarity): MetricTrendTone; /** Short clause for `aria-label` on the trend chip (paired with the delta string). */ declare function metricTrendAriaQualifier(trend: "up" | "down" | "neutral", polarity?: MetricTrendPolarity): string; interface MetricItem { /** Unique identifier for React keying */ id: string; /** Short label shown above the value */ label: string; /** Displayed value — e.g. "23", "98%", "1,250" */ value: string | number; /** * Change **count** for the trend chip — e.g. `"+5"`, `"-3"`, `"+12%"`. * * Pass an **empty string** (or `0`) when there is no comparison delta to show. * In that case the **trend chip is hidden entirely** (the previous `—` placeholder * is dropped) — see `MetricCell`. Put contextual prose like * `"left + right"` / `"vs last week"` in `description`, **never** here. */ delta: string | number; /** * Visual trend direction (arrow follows the signed change in the underlying metric). * `"neutral"` paired with an empty `delta` suppresses the chip — use `description` * for any caption you want to show below the value instead. */ trend: "up" | "down" | "neutral"; /** * Optional short caption rendered **below** the value + trend row (muted, small). * Use for **what** the number means or **how** it breaks down * (e.g. `"left + right"`, `"vs last week"`, `"across 4 sites"`) — NOT for delta counts. */ description?: string; /** * How to **tint** the trend chip. Omit = **`higher_is_better`** (legacy behaviour). * Arrows always match `trend`; sentiment colours flip for **`lower_is_better`**. */ trendPolarity?: MetricTrendPolarity; /** Makes the cell a link */ href?: string; /** Makes the cell a button */ onClick?: () => void; /** * "hero" — primary KPI (e.g. total count): larger value, same structure as siblings. * "default" — standard KPI strip cell. */ metricVariant?: "default" | "hero"; /** * Mini bar fill (`cards` / `flat`). When `progressMax` is set, * treated as a raw count against that max; otherwise 0–100 percent. * Ignored when `chart` is set at `md` / `lg` (one visual per tile). */ progress?: number; progressMax?: number; /** Mini bar colour. Default `brand` for KPI cards (non-judgmental quota). */ progressTone?: MetricProgressTone; /** * Optional mini chart (`cards` or `flat`). `sm`: compact plot on the right of the value; * `md` / `lg`: taller plot below. Limited kinds: `sparkline` | `bars`. * Mutually exclusive with `progress` when shown. */ chart?: MetricChart; /** * Surfaces an attention state on the tile (something wrong / needs action). * Use with `trendPolarity: "lower_is_better"` when the count rising is bad. * `warning` = needs review; `danger` = blocking / critical. */ alert?: MetricAlert; } /** Attention tone for a KPI tile — not the same as trend arrow colour. */ type MetricAlert = "warning" | "danger"; type MetricProgressTone = "auto" | "success" | "warning" | "danger" | "info" | "brand"; /** One point in a KPI mini chart (`label` shown in the hover tooltip). */ type MetricChartPoint = { value: number; label?: string; }; /** Closed set of embeddable KPI graphs — full plots stay in ChartCard. */ type MetricChartKind = "sparkline" | "bars"; type MetricChart = { kind: MetricChartKind; /** 4–12 points recommended. Numbers or `{ value, label }` for hover copy. */ series: Array; /** Stroke / fill tone. Default `brand`. */ tone?: MetricProgressTone; }; declare function normalizeMetricChartSeries(series: MetricChart["series"]): MetricChartPoint[]; /** Resolve 0–100 fill for card-tile mini bars. */ declare function metricProgressPercent(progress: number | undefined, progressMax?: number): number | null; interface MetricInsight { /** Optional single line for custom copy; rail prefers `title` + `description` when both are set */ statement?: string; /** Card headline */ title: string; /** Supporting body copy */ description?: string; /** Optional deep-link for the ↗ button */ href?: string; /** CTA label — defaults to "Ask Leo" */ actionLabel?: string; /** Font Awesome class for the CTA icon — defaults to fa-wand-magic-sparkles */ actionIcon?: string; /** Callback for the CTA button */ onAction?: () => void; /** Severity determines the badge colour (default: warning) */ severity?: "warning" | "info" | "error"; } interface PeriodOption { value: string; label: string; } interface KeyMetricsProps { /** * "card" — one Card wraps the whole strip (dashboard tile) * "cards" — each KPI in its own Card (hubs / overview grids) — preferred for list hubs * "flat" — grouped KPI strip (hairline cells); same features as cards, no per-tile Card * "compact" — Card shell, metrics only */ variant?: "card" | "cards" | "flat" | "compact"; /** * Typography + padding scale. Hub strips: `sm`. Dashboard card tile: `md` (default). * Catalog / hero demos: `lg`. */ size?: KeyMetricsSize; /** Panel title */ title?: string; /** Subtitle / description below title */ description?: string; /** Array of KPI items — by default split into rows of 3 */ metrics: MetricItem[]; /** When true, all metrics share one horizontal row (md+ and compact mobile grid) */ metricsSingleRow?: boolean; /** * When true with `metricsSingleRow`, use a 2-column KPI grid so half-width dashboard cards * fit 1–4 KPIs without horizontal overflow (pair rows on md+; 2-col grid on small screens). * The insight rail (if any) stacks below the KPI grid instead of sitting beside it on md+. */ metricsHalfWidthLayout?: boolean; /** * Force the horizontal scroll KPI strip on desktop (e.g. token index with many category * shortcuts). Default: scroll only on compact viewports / reflow zoom. */ metricsStripScroll?: boolean; /** Optional insight card — see `insightFullWidth` */ insight?: MetricInsight; /** * When true, the insight sits on its own full-width row under the metrics (not a narrow side rail). */ insightFullWidth?: boolean; /** Comparison-period options for the Select */ periods?: PeriodOption[]; /** Initially-selected period value */ defaultPeriod?: string; /** Called with the new period value when the Select changes */ onPeriodChange?: (period: string) => void; /** When false, hides the title/description/period-selector header row (default: true) */ showHeader?: boolean; /** * Tighter insight card: one short title + line of body, no vertical filler; * aligns visually with a single-row KPI band. */ insightCompact?: boolean; className?: string; } declare function KeyMetrics(props: KeyMetricsProps): react_jsx_runtime.JSX.Element; /** * KeyMetricsContent — renders just the metrics grid + optional insight panel. * No card wrapper, no header, no period selector. * Designed for embedding inside a ChartCard with tabOptions period tabs. */ declare function KeyMetricsContent({ metrics, insight, insightCompact, insightFullWidth, }: Pick): react_jsx_runtime.JSX.Element; export { KeyMetrics, KeyMetricsContent, type KeyMetricsProps, type KeyMetricsSize, type MetricAlert, type MetricChart, type MetricChartKind, type MetricChartPoint, type MetricInsight, type MetricItem, type MetricProgressTone, type MetricTrendPolarity, type MetricTrendTone, type PeriodOption, metricProgressPercent, metricTrendAriaQualifier, metricTrendTone, normalizeMetricChartSeries };