@brignano/design 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/DECISIONS.md +175 -0
  2. package/DESIGN.md +345 -29
  3. package/README.md +15 -10
  4. package/components.css +175 -61
  5. package/icons/LICENSE +43 -0
  6. package/icons/arrow-down.svg +15 -0
  7. package/icons/arrow-left.svg +15 -0
  8. package/icons/arrow-right.svg +15 -0
  9. package/icons/arrow-up-down.svg +17 -0
  10. package/icons/arrow-up.svg +15 -0
  11. package/icons/bell.svg +15 -0
  12. package/icons/calendar.svg +17 -0
  13. package/icons/check.svg +14 -0
  14. package/icons/chevron-down.svg +14 -0
  15. package/icons/chevron-left.svg +14 -0
  16. package/icons/chevron-right.svg +14 -0
  17. package/icons/chevron-up.svg +14 -0
  18. package/icons/circle-check.svg +15 -0
  19. package/icons/circle-help.svg +16 -0
  20. package/icons/circle-x.svg +16 -0
  21. package/icons/clock.svg +15 -0
  22. package/icons/copy.svg +15 -0
  23. package/icons/download.svg +16 -0
  24. package/icons/ellipsis-vertical.svg +16 -0
  25. package/icons/ellipsis.svg +16 -0
  26. package/icons/external-link.svg +16 -0
  27. package/icons/eye-off.svg +17 -0
  28. package/icons/eye.svg +15 -0
  29. package/icons/funnel.svg +14 -0
  30. package/icons/house.svg +15 -0
  31. package/icons/info.svg +16 -0
  32. package/icons/link.svg +15 -0
  33. package/icons/lock.svg +15 -0
  34. package/icons/log-out.svg +16 -0
  35. package/icons/map-pin.svg +15 -0
  36. package/icons/menu.svg +16 -0
  37. package/icons/minus.svg +14 -0
  38. package/icons/monitor.svg +16 -0
  39. package/icons/moon.svg +14 -0
  40. package/icons/pencil.svg +15 -0
  41. package/icons/plus.svg +15 -0
  42. package/icons/refresh-cw.svg +17 -0
  43. package/icons/search.svg +15 -0
  44. package/icons/settings.svg +15 -0
  45. package/icons/sun.svg +22 -0
  46. package/icons/trash-2.svg +18 -0
  47. package/icons/triangle-alert.svg +16 -0
  48. package/icons/undo-2.svg +15 -0
  49. package/icons/upload.svg +16 -0
  50. package/icons/user.svg +15 -0
  51. package/icons/x.svg +15 -0
  52. package/package.json +3 -1
  53. package/product-page.css +119 -55
  54. package/tailwind.css +26 -0
  55. package/templates/app-shell.css +346 -0
  56. package/templates/article.css +7 -7
  57. package/templates/changelog.css +2 -2
  58. package/templates/error.css +81 -0
  59. package/templates/legal.css +3 -3
  60. package/templates/settings.css +95 -0
  61. package/tokens.css +180 -16
package/tokens.css CHANGED
@@ -28,7 +28,7 @@
28
28
  2. IDENTITY IS NOT A FILL. Amber used to be the brand colour AND the
29
29
  warning colour, managed by a rule about scale. Rules enforced by
30
30
  remembering get forgotten. So identity moved to the thing that was
31
- always carrying it — the trail, the monogram, the type — and --mark
31
+ always carrying it — the monogram, the type, restraint — and --mark
32
32
  exists only to ink a graphic. It is never a button, chip, wash, or
33
33
  border. The naming is the enforcement.
34
34
 
@@ -154,23 +154,48 @@
154
154
  chroma. It is deliberately NOT Tailwind's blue-600 (263°, a touch
155
155
  violet and electric): same affordance, our own colour (ADR-0008).
156
156
 
157
- --i fill 5.18:1 / 7.07:1 (label 5.18 / 7.46)
157
+ --i fill 5.18:1 / 3.78:1 (label 5.18 / 4.73)
158
158
  --i-ink link/icon/focus 6.78:1 / 7.07:1
159
- --i-hover hover fill 8.65:1 / 10.50:1 (label)
160
- --i-pressed pressed fill 10.44:1 / 13.32:1 (label)
161
-
162
- In dark, fill and ink converge, and hover/pressed get LIGHTER.
159
+ --i-hover hover fill label 8.65:1 / 5.88:1
160
+ --i-ink-hover hovered link 8.65:1 / 9.95:1 on --card
161
+ --i-pressed pressed fill label 10.44:1 / 7.52:1
162
+
163
+ The fill is a saturated mid-cobalt with a WHITE label in both themes,
164
+ and hover and pressed step darker in both. Dark used to lift the fill
165
+ to the ink's pale blue with a dark label, which read as washed out on
166
+ the most important control on the screen. So in dark the fill and the
167
+ ink are now different steps: --i fills, --i-ink is what you read
168
+ (links, icons, the focus ring). The dark fill is as light as a white
169
+ label allows (4.5:1), which is what keeps it 3:1 as a mark on --card,
170
+ --bg and its own wash.
163
171
 
164
172
  DISABLED IS NEUTRAL, NEVER HUED — a greyed-out control must stop
165
173
  signalling "click me". */
166
- --i: light-dark(#076bd3, #6ba5f3);
174
+ --i: light-dark(#076bd3, #0371e0);
167
175
  --i-ink: light-dark(#0159b5, #6ba5f3);
168
- --i-hover: light-dark(#014a97, #98c4ff);
169
- --i-pressed: light-dark(#003e82, #c0dbff);
170
- --i-surface: light-dark(color-mix(in srgb, #076bd3 12%, transparent), color-mix(in srgb, #6ba5f3 20%, transparent));
171
- --i-line: light-dark(color-mix(in srgb, #076bd3 32%, transparent), color-mix(in srgb, #6ba5f3 44%, transparent));
172
- --i-selection: light-dark(color-mix(in srgb, #076bd3 26%, transparent), color-mix(in srgb, #6ba5f3 30%, transparent));
173
- --on-i: light-dark(#ffffff, #111111);
176
+ --i-hover: light-dark(#014a97, #0062c7);
177
+ /* A hovered link is TEXT, so it follows the ink, not the fill: in dark the
178
+ fill's hover is too deep to read on a dark page (about 3.3:1). */
179
+ --i-ink-hover: light-dark(#014a97, #98c4ff);
180
+ --i-pressed: light-dark(#003e82, #0553a6);
181
+ --i-surface: light-dark(color-mix(in srgb, #076bd3 12%, transparent), color-mix(in srgb, #0371e0 20%, transparent));
182
+ --i-line: light-dark(color-mix(in srgb, #076bd3 32%, transparent), color-mix(in srgb, #0371e0 44%, transparent));
183
+ --i-selection: light-dark(color-mix(in srgb, #076bd3 26%, transparent), color-mix(in srgb, #0371e0 30%, transparent));
184
+ --on-i: light-dark(#ffffff, #ffffff);
185
+ /* A button filled with danger (.btn-danger), and its label. Its own
186
+ tokens so the state hue --danger can stay a pale, readable rust in dark
187
+ (messages, pills, field errors) while the button is as deep as the
188
+ primary beside it: as light as a white label allows, stepping darker on
189
+ hover and press (ADR-0015). In light the fills ARE --danger and
190
+ --danger-ink; `npm run check` holds them to those.
191
+
192
+ --danger-fill label 6.10:1 / 4.58:1 on --card 3.91:1 in dark
193
+ --danger-fill-hover label 7.92:1 / 5.65:1
194
+ --danger-fill-pressed label 7.92:1 / 6.96:1 */
195
+ --danger-fill: light-dark(#a4442c, #be563c);
196
+ --danger-fill-hover: light-dark(#8a3722, #ad472e);
197
+ --danger-fill-pressed: light-dark(#8a3722, #9d381e);
198
+ --on-danger: light-dark(#ffffff, #ffffff);
174
199
  --i-disabled-bg: var(--n-200);
175
200
  --i-disabled-ink: var(--n-400);
176
201
 
@@ -244,7 +269,7 @@
244
269
  --code-highlight: var(--i-surface);
245
270
 
246
271
  /* ── Mark — identity ──────────────────────────────────────────────────
247
- Inks a GRAPHIC: the trail line, the A|B monogram, a hero rule. That is
272
+ Inks a GRAPHIC: a product's glyph, the A|B monogram, a hero rule. That is
248
273
  the entire permitted use.
249
274
 
250
275
  It is NOT a button, chip, badge, wash, border, or link. If you are
@@ -262,14 +287,62 @@
262
287
  Each product's marketing page picks one, so Driftwood, Guidebook and
263
288
  Sites don't read as the same page with the words swapped (ADR-0011).
264
289
  Same contract as --mark: it inks the product's graphics (its glyph,
265
- the hero rule, the proof's stage, step numerals), never a button,
266
- link, text or state. Hues sit away from cobalt (act), forest
290
+ the hero rule, the proof's stage, step numerals), never a link, text
291
+ or state. On a product page only, it may also fill the primary button
292
+ and wash the ground, through the -fill and -surface steps below
293
+ (ADR-0017). Hues sit away from cobalt (act), forest
267
294
  (success), amber (attention) and rust (danger). All ≥ 3:1 on --bg and
268
295
  --card in both themes. product-page.css maps one onto --pp-mark via
269
296
  data-mark on .pp. */
270
297
  --mark-teal: light-dark(#0e7c86, #4cc0cb);
271
298
  --mark-violet: light-dark(#7148c9, #a990f2);
272
299
  --mark-magenta: light-dark(#b1366f, #ea7fb0);
300
+ /* ── A mark as a fill and a ground — product pages only (ADR-0017) ────
301
+ On a product's marketing page, and nowhere else, the mark may fill the
302
+ one primary button and wash the page ground. Never in an app, never a
303
+ link, text or a state. The mark tokens above don't move: like --i beside
304
+ --i-ink and --danger-fill beside --danger, the fill is its own step.
305
+
306
+ -fill the button, under a white --on-mark label in both themes.
307
+ In light it IS the mark (amber is deepened to carry the
308
+ label); in dark it sits at the mark's hue, as light as a
309
+ white label allows (4.5:1), the method ADR-0015 used
310
+ for cobalt.
311
+ -fill-hover, -fill-pressed step darker in both themes.
312
+ -surface the page ground: a faint, opaque tint at the mark's hue
313
+ that --ink, --ink-soft and --i-ink all read on.
314
+
315
+ Labels, light / dark: fill hover pressed
316
+ amber (the family) 4.60 / 4.61 6.09 / 5.65 7.63 / 6.92
317
+ teal 4.95 / 4.56 6.70 / 5.60 8.31 / 6.90
318
+ violet 6.05 / 4.57 8.23 / 5.68 10.24 / 6.94
319
+ magenta 5.79 / 4.57 7.83 / 5.61 9.71 / 6.91
320
+
321
+ Use the unprefixed four: `data-mark` points them at a product's, as it
322
+ does --mark-current. With no attribute they are the family amber. */
323
+ --mark-fill: light-dark(#a66707, #a06a05);
324
+ --mark-fill-hover: light-dark(#8c5602, #8e5d03);
325
+ --mark-fill-pressed: light-dark(#784903, #7c5102);
326
+ --mark-surface: light-dark(#fce7d3, #241807);
327
+ --mark-teal-fill: light-dark(#0e7c86, #19828a);
328
+ --mark-teal-fill-hover: light-dark(#03666f, #07737b);
329
+ --mark-teal-fill-pressed: light-dark(#01575e, #05646b);
330
+ --mark-teal-surface: light-dark(#d1f3f6, #021f22);
331
+ --mark-violet-fill: light-dark(#7148c9, #855cdf);
332
+ --mark-violet-fill-hover: light-dark(#5e31b1, #774ccd);
333
+ --mark-violet-fill-pressed: light-dark(#511ea1, #6a3dbe);
334
+ --mark-violet-surface: light-dark(#ebe8ff, #1c1729);
335
+ --mark-magenta-fill: light-dark(#b1366f, #c24986);
336
+ --mark-magenta-fill-hover: light-dark(#991d5b, #b23977);
337
+ --mark-magenta-fill-pressed: light-dark(#88024d, #a1296a);
338
+ --mark-magenta-surface: light-dark(#ffe3ec, #27141c);
339
+ --on-mark: light-dark(#ffffff, #ffffff);
340
+ /* The mark in force here (ADR-0014): the family amber until `data-mark`
341
+ on an ancestor, usually <html>, names a product's. A brand glyph and
342
+ .rule draw in this, so a product's colour follows it from its marketing
343
+ page into its app and onto its error pages. The [data-mark] rules below
344
+ only point it at a token above; they declare no colour of their own. */
345
+ --mark-current: var(--mark);
273
346
 
274
347
  /* ── Legacy aliases ───────────────────────────────────────────────────
275
348
  Kept so existing `life` components keep compiling. Do not use in new
@@ -299,6 +372,45 @@
299
372
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
300
373
  --display: var(--sans);
301
374
 
375
+ /* Weight, leading and tracking. Sizes are per tier (below); these are
376
+ not. Three weights, and nothing lighter or bolder.
377
+ (--weight-heavy is the one exception: the display treatment, .display
378
+ and .stamp, ADR-0014.) Leading is unitless
379
+ so it scales with the text: display for large headings, title for
380
+ titles, ui for interface text, body for paragraphs. Tracking
381
+ only ever tightens a heading or opens an uppercase mono eyebrow
382
+ (and the .stamp monogram, whose bar closes up otherwise).
383
+
384
+ Named by role, not tight/snug/normal: Tailwind owns those names
385
+ (--leading-tight, --tracking-tight) and an unlayered token here would
386
+ silently change what its utilities do in every consumer. */
387
+ --weight-regular: 400;
388
+ --weight-medium: 500;
389
+ --weight-semibold: 600;
390
+ --weight-heavy: 800;
391
+ --leading-display: 1.15;
392
+ --leading-title: 1.3;
393
+ --leading-ui: 1.4;
394
+ --leading-body: 1.6;
395
+ --tracking-title: -0.01em;
396
+ --tracking-display: -0.025em;
397
+ --tracking-caps: 0.08em;
398
+
399
+ /* ── Stacking ─────────────────────────────────────────────────────────
400
+ Named by what sits above what. Dialogs, popovers and sheets use the
401
+ browser's top layer and need none of these.
402
+
403
+ --z-raised a control above its card's stretched link, a sticky th
404
+ --z-sticky a header content scrolls under
405
+ --z-float a label floating over the page (the rail's tooltip)
406
+ --z-skip the skip link, above the header it skips
407
+ --z-toast toasts, above everything not in the top layer */
408
+ --z-raised: 1;
409
+ --z-sticky: 10;
410
+ --z-float: 20;
411
+ --z-skip: 30;
412
+ --z-toast: 40;
413
+
302
414
  /* ── Space ── 4px base. Tiers differ by which steps they reach for. */
303
415
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
304
416
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
@@ -311,6 +423,7 @@
311
423
  differs. So shadows 2 and 3 carry one layer per theme, with the other
312
424
  theme's layer transparent — it draws nothing. */
313
425
  --radius-sm: 6px;
426
+ --radius-control: 8px; /* buttons, inputs, selects, the segmented control, menu items */
314
427
  --radius: 12px;
315
428
  --radius-lg: 18px;
316
429
  --shadow-1: 0 1px 2px light-dark(rgba(17, 17, 17, 0.04), rgba(0, 0, 0, 0.45));
@@ -351,6 +464,15 @@
351
464
  --measure: 780px;
352
465
  }
353
466
 
467
+ /* On a phone the tool tier's smallest step rises from 11px to 12px: fine
468
+ beside a mouse, too small at arm's length. The marketing tier's is
469
+ already 12px. */
470
+ @media (pointer: coarse) {
471
+ :root:not(.tier-marketing) {
472
+ --text-xs: 0.75rem;
473
+ }
474
+ }
475
+
354
476
  /* ── Marketing tier ─────────────────────────────────────────────────────
355
477
  `class="tier-marketing"` on <html> (brignano.io). Unlocks the display
356
478
  face and opens the type scale. COLOUR IS IDENTICAL ACROSS TIERS — that
@@ -369,6 +491,32 @@
369
491
  --measure: 68ch;
370
492
  }
371
493
 
494
+ /* ── A product's mark, wherever the product is ──────────────────────────
495
+ One attribute per product: <html data-mark="teal">. Works on any element,
496
+ so a page that shows two products can mark each one's section. It also
497
+ points the product-page fill and ground (ADR-0017) at the product's. */
498
+ [data-mark='teal'] {
499
+ --mark-current: var(--mark-teal);
500
+ --mark-fill: var(--mark-teal-fill);
501
+ --mark-fill-hover: var(--mark-teal-fill-hover);
502
+ --mark-fill-pressed: var(--mark-teal-fill-pressed);
503
+ --mark-surface: var(--mark-teal-surface);
504
+ }
505
+ [data-mark='violet'] {
506
+ --mark-current: var(--mark-violet);
507
+ --mark-fill: var(--mark-violet-fill);
508
+ --mark-fill-hover: var(--mark-violet-fill-hover);
509
+ --mark-fill-pressed: var(--mark-violet-fill-pressed);
510
+ --mark-surface: var(--mark-violet-surface);
511
+ }
512
+ [data-mark='magenta'] {
513
+ --mark-current: var(--mark-magenta);
514
+ --mark-fill: var(--mark-magenta-fill);
515
+ --mark-fill-hover: var(--mark-magenta-fill-hover);
516
+ --mark-fill-pressed: var(--mark-magenta-fill-pressed);
517
+ --mark-surface: var(--mark-magenta-surface);
518
+ }
519
+
372
520
  ::selection {
373
521
  background: var(--i-selection);
374
522
  }
@@ -379,6 +527,16 @@
379
527
  accent-color: var(--i);
380
528
  }
381
529
 
530
+ /* Paper is light. Printing a dark page spends ink on the background and
531
+ most browsers drop backgrounds anyway, leaving pale text on white. After
532
+ the [data-theme] rules above so it wins over an in-app dark choice. */
533
+ @media print {
534
+ :root,
535
+ [data-theme] {
536
+ color-scheme: light;
537
+ }
538
+ }
539
+
382
540
  /* Ships here so no surface can forget it. */
383
541
  @media (prefers-reduced-motion: reduce) {
384
542
  *,
@@ -389,4 +547,10 @@
389
547
  transition-duration: 0.01ms !important;
390
548
  scroll-behavior: auto !important;
391
549
  }
550
+ /* View transitions live on pseudo-elements the rule above can't reach. */
551
+ ::view-transition-group(*),
552
+ ::view-transition-old(*),
553
+ ::view-transition-new(*) {
554
+ animation: none !important;
555
+ }
392
556
  }