No hand-written SVG: visx charts, lucide icons, Mermaid journey diagram

- desktop: Growth chart, Health and portfolio sparklines and the rollout bar drawn with visx (responsive width,
  crosshair tooltip with real values, arrow keys, theme tokens, no animation); icons from lucide-react behind the
  existing Icon names; empty states are lucide icons on token tiles; store marks are generic lucide icons; stars are
  lucide; the brand mark moves to ui/brand.tsx as the one allowed inline SVG
- fixtures: app icons and store art stand-ins are PNGs rendered by tools/fixture-art.ts (lucide on gradients)
- site: icons are lucide's own files in site/img/icons (tools/site-icons.ts, with the ISC licence) shown as CSS masks;
  the journey diagram is rendered from docs/diagrams/journey.mmd by tools/diagrams.ts (Mermaid CLI), with a tall
  variant for phones
- tests/no-handmade-svg.test.ts fails on new inline SVG drawing in apps/desktop/src and site/*.html
- desktop bundle: 598.7 -> 695.5 kB minified, 174.6 -> 206.0 kB gzip
This commit is contained in:
CRTkafa 2026-10-11 00:49:30 +00:00
parent c2b0a0d8a3
commit 82066de5ed
62 changed files with 840 additions and 661 deletions

View file

@ -346,7 +346,7 @@ svg { flex: none; }
.tl-cap { position: absolute; top: calc(50% + 4px); font-size: var(--t-micro); color: var(--muted); white-space: nowrap; font-weight: 550; }
.tl-step.cur .tl-cap { color: var(--ink); font-weight: 650; }
.tl-roll { width: 76%; display: grid; gap: 4px; position: absolute; top: calc(50% + 2px); }
.tl-roll .bar { height: 6px; }
.tl-roll .rbar { height: 6px; }
.tl-roll .pct { font-size: var(--t-micro); text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.tl-none { grid-column: 2 / -1; color: var(--muted); font-size: var(--t-meta); text-align: center; border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px; }
.train-head { display: flex; align-items: center; gap: 10px; }
@ -358,16 +358,34 @@ svg { flex: none; }
.bar.thin { height: 4px; }
/* ---------- charts ---------- */
.spark { width: 100%; height: 72px; display: block; overflow: visible; }
.spark .area { opacity: 1; }
.spark .stop-a { stop-color: var(--spark, var(--accent-solid)); stop-opacity: .28; }
.spark .stop-b { stop-color: var(--spark, var(--accent-solid)); stop-opacity: 0; }
.spark .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark .thr { stroke: var(--bad-solid); stroke-width: 1.25; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.spark.ok { --spark: var(--ok-solid); } .spark.ok .line { stroke: var(--ok-solid); }
.spark.warn { --spark: var(--warn-solid); } .spark.warn .line { stroke: var(--warn-solid); }
.spark.bad { --spark: var(--bad-solid); } .spark.bad .line { stroke: var(--bad-solid); }
.spark.neutral .line, .spark.accent .line, .spark.info .line { stroke: var(--accent-solid); }
.spark { width: 100%; height: 72px; display: block; position: relative; --spark: var(--accent-solid); }
.spark > svg { display: block; overflow: visible; outline: none; border-radius: 4px; }
.spark > svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.spark linearGradient stop { stop-color: var(--spark); }
.spark .line { fill: none; stroke: var(--spark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark.compact .line { stroke-width: 1.5; }
.spark .thr { stroke: var(--bad-solid); stroke-width: 1.25; stroke-dasharray: 4 4; }
.spark .hov line { stroke: var(--line-2); stroke-width: 1; }
.spark .hov circle { fill: var(--spark); stroke: var(--surface); stroke-width: 2; }
.spark.ok { --spark: var(--ok-solid); } .spark.warn { --spark: var(--warn-solid); } .spark.bad { --spark: var(--bad-solid); }
/* chart tooltip (visx TooltipWithBounds, unstyled; charts.tsx ChartTip) */
.vx-tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 4px; min-width: 150px; padding: 8px 10px; white-space: nowrap;
background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); font-size: var(--t-meta); }
.vx-tip > b { font-weight: 650; }
.vx-row { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.vx-row.muted { color: var(--muted); }
.vx-row b { margin-left: auto; padding-left: 14px; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.vx-tip .sw { width: 10px; height: 3px; border-radius: 2px; flex: none; background: var(--accent-solid); }
.vx-tip .sw.ok, .vx-tip .sw.l2 { background: var(--ok-solid); } .vx-tip .sw.warn { background: var(--warn-solid); } .vx-tip .sw.bad { background: var(--bad-solid); }
.vx-tip .sw.l3 { background: repeating-linear-gradient(90deg, var(--warn-solid) 0 4px, transparent 4px 6px); }
.vx-tip .sw.thr { background: repeating-linear-gradient(90deg, var(--bad-solid) 0 3px, transparent 3px 5px); }
.vx-tip .sw.ev { width: 8px; height: 8px; border-radius: 50%; background: var(--info-solid); }
/* rollout / phased release share (visx bar, charts.tsx RolloutBar) */
.rbar { width: 100%; height: 8px; }
.rbar > svg { display: block; }
.rbar .track { fill: var(--neutral-bg); stroke: var(--line); stroke-width: 1; }
.rbar .fill { fill: var(--accent-solid); }
.rbar.ok .fill { fill: var(--ok-solid); } .rbar.warn .fill { fill: var(--warn-solid); } .rbar.bad .fill { fill: var(--bad-solid); } .rbar.info .fill { fill: var(--info-solid); }
.metric { display: grid; gap: 10px; }
.metric-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metric-val { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@ -475,14 +493,21 @@ button.li:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px;
/* ---------- empty states ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 24px 44px; }
.empty svg.illo { width: 168px; height: 112px; margin-bottom: 6px; }
.empty .illo { margin-bottom: 6px; }
.empty h3 { font-size: var(--t-section); font-weight: 650; }
.empty p { color: var(--muted); max-width: 52ch; }
.empty .actions { margin-top: 10px; justify-content: center; }
.empty.compact { padding: 24px 16px; }
.empty.compact svg.illo { width: 120px; height: 80px; }
.illo .f1 { fill: var(--illo-1); } .illo .f2 { fill: var(--illo-2); } .illo .s1 { stroke: var(--illo-line); fill: none; } .illo .s2 { stroke: var(--illo-soft); fill: none; }
.illo .fl { fill: var(--illo-line); } .illo .fs { fill: var(--surface); } .illo .fsoft { fill: var(--illo-soft); }
.empty.compact .illo { --illo-size: 80px; }
/* empty state art (ui/illustrations.tsx): a lucide icon on a soft tile with rings behind it and an optional badge */
.illo { --illo-size: 112px; width: calc(var(--illo-size) * 1.5); height: var(--illo-size); display: grid; place-items: center; position: relative;
background: radial-gradient(circle at 50% 50%, var(--illo-1) 0 30%, transparent 30.5%), radial-gradient(circle at 50% 50%, transparent 0 41%, var(--illo-2) 41.5% 42.5%, transparent 43%); }
.illo-tile { width: calc(var(--illo-size) * .54); height: calc(var(--illo-size) * .54); border-radius: 28%; display: grid; place-items: center; position: relative;
background: var(--surface); border: 1px solid var(--illo-2); box-shadow: var(--shadow-2); color: var(--illo-line); }
.illo-tile > svg { width: 46%; height: 46%; }
.illo-badge { position: absolute; right: -10%; bottom: -10%; width: 40%; height: 40%; border-radius: 50%; display: grid; place-items: center;
background: var(--illo-line); color: var(--surface); box-shadow: 0 0 0 3px var(--surface); }
.illo-badge > svg { width: 58%; height: 58%; }
/* ---------- skeletons ---------- */
.sk { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--neutral-bg) 0%, color-mix(in srgb, var(--neutral-bg) 55%, var(--surface)) 50%, var(--neutral-bg) 100%); background-size: 200% 100%; animation: sk 1.3s ease-in-out infinite; }
@ -620,7 +645,7 @@ select.input { padding-right: 8px; }
.fix svg { width: 13px; height: 13px; margin-top: 2px; color: var(--accent-solid); flex: none; }
.fix code { font-size: 11.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.field > .seg { justify-self: start; }
.wz-body svg.illo { width: 168px; height: 112px; margin-bottom: -6px; }
.wz-body .illo { margin-bottom: -6px; }
h2[tabindex="-1"]:focus, h2[tabindex="-1"]:focus-visible { outline: none; }
.acc-pick { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 8px; }
.acc-pick svg { width: 15px; height: 15px; color: var(--muted); }
@ -852,17 +877,18 @@ textarea.input { height: auto; padding: 8px 10px; line-height: 1.45; resize: ver
/* growth chart */
.lchart { display: grid; gap: 8px; }
.lchart svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; border-radius: 8px; }
.lchart svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.lchart-plot { position: relative; width: 100%; }
.lchart-plot > svg { display: block; overflow: visible; outline: none; border-radius: 8px; }
.lchart-plot > svg:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.lchart .grid-l line { stroke: var(--line); stroke-width: 1; }
.lchart line.base { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.lchart text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lchart .stop-a { stop-color: var(--accent-solid); stop-opacity: .18; }
.lchart .stop-b { stop-color: var(--accent-solid); stop-opacity: 0; }
.lchart linearGradient stop { stop-color: var(--accent-solid); }
.lchart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lchart .ln.l1 { stroke: var(--accent-solid); }
.lchart .ln.l2 { stroke: var(--ok-solid); }
.lchart .ln.l3 { stroke: var(--warn-solid); stroke-dasharray: 5 4; }
.lchart .hov circle { stroke: var(--surface); stroke-width: 2; }
.lchart circle.l1 { fill: var(--accent-solid); } .lchart circle.l2 { fill: var(--ok-solid); } .lchart circle.l3 { fill: var(--warn-solid); }
.lchart .ev line { stroke: var(--info-solid); stroke-width: 1.25; stroke-dasharray: 3 4; }
.lchart .ev circle { fill: var(--info-solid); stroke: var(--surface); stroke-width: 2; cursor: help; }