import { CheckIcon, InfoIcon, SirenIcon, WarningIcon } from "@chopin/icons"; import { Badge, IconLabel, MiniBars, ProgressBar, Sparkline, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@chopin/visuals"; import { AuditPlate } from "./frame"; import { IconCatalogue } from "./icons"; const COLOURS = [ ["Page", "--color-page"], ["Ground", "--color-ground"], ["Inset", "--color-inset"], ["Selected", "--color-selected"], ["Primary text", "--color-text-primary"], ["Secondary text", "--color-text-secondary"], ["Tertiary text", "--color-text-tertiary"], ["Quaternary text", "--color-text-quaternary"], ["Default icon", "--color-icon"], ["Brand", "--color-brand"], ["Brand hover", "--color-brand-hover"], ["Brand wash", "--color-brand-wash"], ["Success", "--color-success"], ["Success wash", "--color-success-wash"], ["Warning", "--color-warning"], ["Warning wash", "--color-warning-wash"], ["Destructive", "--color-destructive"], ["Destructive wash", "--color-destructive-wash"], ] as const; const TYPE = [ ["Small metadata", "11.3–11.5px · step −2.5", "--text-2xs", "--text-2xs--line-height"], ["Compact controls", "12–12.3px · step −2", "--text-xs", "--text-xs--line-height"], ["Interface and chat", "13.4–14px · step −1", "--text-sm", "--text-sm--line-height"], ["Document prose", "15–16px · step 0", "--text-base", "--text-base--line-height"], ["Subheading", "18.8–20.8px · step +2", "--text-lg", "--text-lg--line-height"], ["Section heading", "21.1–23.7px · step +3", "--text-xl", "--text-xl--line-height"], ["Document title", "26.4–30.8px · step +5", "--text-2xl", "--text-2xl--line-height"], ] as const; const SPACING = [2, 4, 6, 8, 12, 16, 24, 32] as const; const RADII = [ ["Small", "--radius-sm"], ["Medium", "--radius-md"], ["Large", "--radius-lg"], ["Extra large", "--radius-xl"], ] as const; const SHADOWS = [ ["Subtle resting", "--shadow-resting"], ["Strong resting", "--shadow-resting-strong"], ["Raised", "--shadow-raised"], ["Overlay", "--shadow-overlay"], ] as const; const ICON_LABELS = [ ["neutral", InfoIcon, "Neutral"], ["success", CheckIcon, "Success"], ["warning", WarningIcon, "Warning"], ["danger", SirenIcon, "Danger"], ] as const; const SPARKLINES = [ ["neutral", "Neutral activity", [8, 6, 7, 4]], ["success", "Successful activity", [3, 5, 4, 8]], ["warning", "Steady warning", [5, 5, 5]], ["danger", "Danger sample", [4]], ] as const; const MINI_BARS = [ ["neutral", "neutral volume", [8, 4, 6, 3, 7, 5]], ["success", "success volume", [1, 3, 2, 4, 6, 5]], ["warning", "warning volume", [6, 5, 4, 5, 3, 4]], ["danger", "danger volume", [1, 2, 4, 3, 5, 7]], ] as const; const PROGRESS_BARS = [ ["Not started", 0], ["In progress", 62.5], ["Complete", 100], ] as const; const TABLE_ROWS = [ ["Production", "Healthy", "2 minutes ago"], ["Preview", "Building", "12 minutes ago"], ] as const; const OVERFLOW_TABLE_ROWS = [ ["Production Europe West with an intentionally long name", "Healthy", "2 minutes ago"], ["Preview for the static presentation table branch", "Building", "12 minutes ago"], ] as const; function TableExample({ rows, variant = "plain", }: { rows: readonly (readonly [string, string, string])[]; variant?: "plain" | "contained"; }) { return (
{token}
{measurement}
{value}px
--button-edge-width