import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraFrame,LyraVariant}from'../../../internal/variants.js';import type{LyraOrientation}from'../../../internal/shared-unions.js';export type StatGoodDirection='up'|'down';export type StatOrientation=LyraOrientation;export interface StatRow{readonly label:string;readonly value:string; /** Exact value shown as a hover/focus tooltip on this row's `row-value` (mirrors the headline * `exactValue`/`exact-value` behavior). Also makes this row's `[part='row-value']` * keyboard-focusable so the tooltip is reachable without a pointer. */ readonly exactValue?:string;} /** * `` — a KPI/stat card. First-party invention consolidating the * "metric row" / "KPI card" pattern common to dashboard UIs. * * @customElement lr-stat * @slot start - Leading icon. Takes precedence over the legacy default slot when both are filled. * @slot - Legacy leading-icon alias, retained as the fallback for `start`. * @slot caption - Rich caption content (overrides the `caption` attribute). * @slot spark - A sparkline (e.g. ``) or other compact trend * visual. `lr-stat` only reserves the slot; it doesn't render one itself. * @slot sub - Rich sub-line content (overrides the `sub` attribute). * When linked, every consumer slot remains a sibling of the stretched anchor so an interactive * slotted descendant is never nested inside the whole-card link. Passive slotted content forwards * pointer modifiers; the platform primary modifier and Shift preserve new-context activation. * @csspart base - The component's root wrapper (`
`, or a stretched real `` when `href` is safe). * @csspart icon - Container for the leading icon slot. * @csspart label - The label text. Hidden (and collapsed) whenever `label` is empty, so a * label-less stat doesn't leave a blank line above the value. * @csspart value-row - Wrapper around the value and unit. * @csspart value - The value text. Accessibly labelled by the `label` part (via * `aria-labelledby`) whenever `label` is set, so tabbing directly to this * (focusable when `exactValue` is set) control still announces which metric and visible unit it is. * @csspart unit - The unit text. * @csspart trend - The trend pill. * @csspart sub - Container for the `sub` attribute/slot. * @csspart spark - Container for the `spark` slot. * @csspart caption - Container for the caption attribute/slot. * @csspart rows - Container for the `rows` breakdown list. * @csspart row - A single breakdown row (one per `rows` entry). * @csspart row-label - The label text of a breakdown row. * @csspart row-value - The value text of a breakdown row. Shows the row's `exactValue` (if any) as * a hover/focus tooltip, same as the headline `value`, and is accessibly labelled by its * `row-label` (via `aria-labelledby`) the same way the headline `value` is. * @cssprop [--lr-stat-bg=var(--lr-color-surface)] - Resting background of the card. The pressed * fill of a linked card mixes from this value too, so one override retints both. `frame="plain"` * still paints transparent. * @cssprop [--lr-stat-padding=var(--lr-space-m)] - Padding of the card, read by both `[part="base"]` * and the linked-card content wrapper so a linked and unlinked stat never drift. The `compact` * and `frame="plain"` variants read the same property with their own current default as its * fallback (`var(--lr-space-s)` and `0` respectively), so one override reaches every rendering * path. * @cssprop [--lr-stat-gap=var(--lr-space-xs)] - Gap between the card's stacked parts, read by both * `[part="base"]` and the linked-card content wrapper. The `compact` variant reads the same * property with its own current default (`var(--lr-size-0-125rem)`) as its fallback. * @cssprop [--lr-stat-trend-good-color=var(--lr-color-success)] - Text color of the trend pill * when its polarity is "good". Independent of the headline value's `variant="success"` tint, * which reads the shared `--lr-color-success` token directly. * @cssprop [--lr-stat-trend-good-bg=color-mix(in srgb, var(--lr-color-success) 8%, transparent)] - * Background of the trend pill when its polarity is "good". * @cssprop [--lr-stat-trend-bad-color=var(--lr-color-danger)] - Text color of the trend pill when * its polarity is "bad". Independent of the headline value's `variant="danger"` tint, which * reads the shared `--lr-color-danger` token directly. * @cssprop [--lr-stat-trend-bad-bg=color-mix(in srgb, var(--lr-color-danger) 8%, transparent)] - * Background of the trend pill when its polarity is "bad". * @cssprop [--lr-stat-value-brand-color=var(--lr-color-brand)] - Headline value color for the * `brand` variant. * @cssprop [--lr-stat-value-success-color=var(--lr-color-success)] - Headline value color for the * `success` variant. * @cssprop [--lr-stat-value-warning-color=var(--lr-color-warning)] - Headline value color for the * `warning` variant. * @cssprop [--lr-stat-value-danger-color=var(--lr-color-danger)] - Headline value color for the * `danger` variant. * @cssprop [--lr-stat-emphasis-border-color=var(--lr-color-brand)] - Accent-edge color when * `emphasis` is set. Independent of the headline's emphasis tint and `brand` variant. * @cssprop [--lr-stat-emphasis-value-color=var(--lr-color-brand)] - Headline value color when * `emphasis` is set on a neutral stat. Independent of the accent edge and `brand` variant. * @cssprop [--lr-stat-link-hover-border-color=var(--lr-color-brand)] - Linked-card border on hover. * @cssprop [--lr-stat-link-hover-shadow=var(--lr-shadow-s)] - Linked-card shadow on hover. * @cssprop [--lr-stat-link-active-border-color=var(--lr-stat-link-hover-border-color,var(--lr-color-brand))] - Linked-card border while pressed. * @cssprop [--lr-stat-link-active-shadow=var(--lr-stat-link-hover-shadow,var(--lr-shadow-s))] - Linked-card shadow while pressed. * @cssprop [--lr-stat-link-active-bg=color-mix(...)] - Linked-card background while pressed. * @status stable * @since 4.0.0 */ export declare class LyraStat extends LyraElement{static styles:import("lit").CSSResultGroup[];label:string; /** Host accessible-name override forwarded to the linked anchor when `href` is safe. */ accessibleLabel:string|null;value:string;unit:string;variant:LyraVariant; /** When set to a safe URL, renders the whole stat as a real anchor instead of a static div. */ href?:string; /** Native anchor target, used only while `href` resolves to a link. Setting this to `'_blank'` * (or any other target) automatically derives `rel="noopener noreferrer"` on the rendered * anchor -- there is no separately-settable `rel` property, so a consumer can't forget it and * leave the opened page holding a `window.opener` back-reference (reverse-tabnabbing). Matches * `app-rail-item.class.ts`'s pattern. */ target?:string;private _deltaPercent; /** Percentage delta for the trend pill. Null (the JSON-safe default) hides the pill; * non-finite input normalizes to null and finite numbers remain unclamped. */ get deltaPercent():number|null;set deltaPercent(value:number|null); /** Caption fallback. Removing the attribute omits it without hiding assigned caption content. */ caption:string; /** Which trend direction counts as "good" — inverts arrow/color polarity for * cost/latency/error-rate-style metrics where a decrease is the win. */ goodDirection:StatGoodDirection;private _rows; /** Breakdown rows rendered as a simple label/value list beneath the caption. The first 10,000 * rows are snapshotted and frozen so caller mutation cannot bypass the reactive boundary; * reassign the collection to update. */ get rows():readonly StatRow[];set rows(value:readonly StatRow[]); /** Visual emphasis (e.g. for a "headline" stat in a group) — orthogonal to * the status `variant`; see the `[part='value']` selector below for how * the two combine. */ emphasis:boolean; /** Exact value shown as a hover/focus tooltip on the headline `value` (e.g. `value="$1.2K" * exact-value="$1,204.37"`). Also makes `[part='value']` keyboard-focusable so the tooltip is * reachable without a pointer. */ exactValue:string; /** A secondary line distinct from `caption` (e.g. a comparison-period label), rendered between the * trend pill and the caption. */ /** Sub-line fallback. Removing the attribute omits it without hiding assigned sub content. */ sub:string; /** Renders `value` as smaller/lighter prose (e.g. a loading/status message) instead of the bold * numeric headline style, and hides `unit`. */ prose:boolean; /** Tighter padding for constrained spaces — same convention as `lr-empty`'s `compact`. */ compact:boolean; /** Container treatment — the shared `frame` vocabulary, not a fill. `'card'` (the default) keeps * the bordered, filled, padded box that stretches to fill its parent; `'plain'` removes the * border, background, padding, corner radius and the `block-size: 100%` stretch so the stat can * sit inline in prose, a toolbar or a table cell. `plain` wins over `compact` when both are set * (nothing left to tighten), and it also drops `emphasis`'s accent edge — that edge is card * chrome — while `emphasis`'s brand value tint still applies. A `plain` stat with a safe `href` * swaps the card's border-color/lift hover affordance (invisible with no border) for an * underline on `[part='value']`; the `:focus-visible` ring is unchanged. * * This was `appearance` before 8.0.0, where `appearance` meant two unrelated things across the * library; it now means "how a control fills itself" everywhere, and the container treatment it * used to double as is `frame`. A clean rename with no alias: `appearance` on `` is * simply an unknown attribute now. */ frame:LyraFrame; /** Layout axis. `'vertical'` (the default) stacks label, value, trend, sub and caption. * `'horizontal'` lays label, value+unit, trend, sub and caption out on a single wrapping * baseline row; `[part='spark']` and `[part='rows']` have no sensible place on a text baseline * and stay stacked on their own full-width line beneath that row. */ orientation:StatOrientation;private hasIcon;private hasCaptionSlot;private hasSparkSlot;private hasSubSlot;private readonly labelId;private readonly valueId;private readonly unitId;private rowLabelIds;protected willUpdate(changed:PropertyValues):void;private onIconSlotChange;private onCaptionSlotChange;private onSparkSlotChange;private onSubSlotChange;private onLinkedContentClick; /** Activates the real whole-card anchor when this stat is linked. */ click():void;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-stat':LyraStat;}}