/** * The severity ladder's visual encoding — see UI_REDESIGN.md §2.3. * * Colour is never the only channel: severity is triple-encoded so it * survives both grayscale and colour-blindness. * major — filled triangle, colour, 5px spine * moderate — outline triangle, colour, 5px spine (thinner fill) * minor — outline circle, neutral ink, 3px spine * routine — faint outline circle, neutral ink, 2px spine */ import type { Severity } from "@/lib/severity"; import { SEVERITY_COLORS, SEVERITY_LABEL } from "@/lib/severity"; const SPINE_WIDTH: Record = { major: 5, moderate: 5, minor: 3, routine: 2 }; const GLYPH_SIZE: Record<"sm" | "md", number> = { sm: 12, md: 16 }; function Glyph({ severity, size }: { severity: Severity; size: number }) { const color = SEVERITY_COLORS[severity]; if (severity === "major") { // filled triangle return ( ); } if (severity === "moderate") { // outline triangle return ( ); } if (severity === "minor") { // outline circle, neutral return ( ); } // routine — faint outline circle return ( ); } export function SeverityMark({ severity, showLabel = false, spine = false, size = "sm", className, }: { severity: Severity; showLabel?: boolean; spine?: boolean; size?: "sm" | "md"; className?: string; }) { const color = SEVERITY_COLORS[severity]; return ( {spine && ( )} {showLabel && ( {SEVERITY_LABEL[severity]} )} ); } /** Standalone spine bar — for list rows that render the mark and spine in separate flex slots. */ export function SeveritySpine({ severity, className }: { severity: Severity; className?: string }) { return ( ); }