/*! Strand UI | MIT License | dillingerstaffing.com */ import type { JSX } from "preact"; import { forwardRef } from "preact/compat"; import { cx } from "../../internal/index.js"; export interface StatStripItem { /** Overline label. */ label: string; /** Pre-formatted value. */ value: string; } export interface StatStripProps extends JSX.HTMLAttributes { items: StatStripItem[]; /** `bordered` pads each cell and rules between them. */ variant?: "plain" | "bordered"; className?: string; } /** * A row of labelled values compared across, as a description list. * * @example * */ export const StatStrip = forwardRef(({ items, variant = "plain", className = "", ...rest }, ref) => (
{items.map((item) => (
{item.label}
{item.value}
))}
)); StatStrip.displayName = "StatStrip";