@ponchia/ui 0.7.0 → 0.8.1

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 (54) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/README.md +3 -3
  3. package/classes/classes.json +79 -7
  4. package/classes/index.d.ts +53 -1
  5. package/classes/index.js +60 -0
  6. package/classes/vscode.css-custom-data.json +24 -0
  7. package/css/app.css +14 -3
  8. package/css/disclosure.css +7 -7
  9. package/css/feedback.css +11 -8
  10. package/css/forms.css +3 -3
  11. package/css/navigation.css +1 -1
  12. package/css/overlay.css +19 -5
  13. package/css/primitives.css +101 -6
  14. package/css/site.css +11 -5
  15. package/css/skins.css +97 -3
  16. package/css/state.css +161 -0
  17. package/css/table.css +1 -1
  18. package/css/tokens.css +6 -0
  19. package/css/workbench.css +151 -0
  20. package/dist/bronto.css +1 -1
  21. package/dist/css/app.css +1 -1
  22. package/dist/css/disclosure.css +1 -1
  23. package/dist/css/feedback.css +1 -1
  24. package/dist/css/forms.css +1 -1
  25. package/dist/css/navigation.css +1 -1
  26. package/dist/css/overlay.css +1 -1
  27. package/dist/css/primitives.css +1 -1
  28. package/dist/css/report-kit.css +1 -1
  29. package/dist/css/site.css +1 -1
  30. package/dist/css/skins.css +1 -1
  31. package/dist/css/state.css +1 -1
  32. package/dist/css/table.css +1 -1
  33. package/dist/css/tokens.css +1 -1
  34. package/dist/css/workbench.css +1 -1
  35. package/docs/adr/0001-color-system.md +32 -3
  36. package/docs/contrast.md +102 -18
  37. package/docs/migrations/0.7-to-0.8.md +216 -0
  38. package/docs/package-contract.md +1 -0
  39. package/docs/reference.md +52 -1
  40. package/docs/reporting.md +8 -8
  41. package/docs/stability.md +31 -2
  42. package/docs/state.md +51 -1
  43. package/docs/theming.md +18 -0
  44. package/docs/usage.md +62 -2
  45. package/docs/workbench.md +83 -4
  46. package/llms.txt +1 -1
  47. package/package.json +13 -12
  48. package/tokens/figma.variables.json +84 -0
  49. package/tokens/index.d.ts +2 -2
  50. package/tokens/index.js +23 -0
  51. package/tokens/index.json +12 -0
  52. package/tokens/resolved.json +6 -0
  53. package/tokens/skins.js +117 -7
  54. package/tokens/tokens.dtcg.json +7 -1
package/tokens/skins.js CHANGED
@@ -5,8 +5,26 @@
5
5
  * A skin is NOT a second brand colour — it *re-points the one accent* (and the
6
6
  * Tier-3 dot-matrix display knobs) to a different single hue, so the
7
7
  * one-accent-per-scope discipline holds while the palette gains creative range
8
- * *across* skins. The neutral canvas, status palette, and every component stay
9
- * exactly as they are.
8
+ * *across* skins. The status palette and every component stay exactly as they
9
+ * are.
10
+ *
11
+ * Since 0.8.0 a skin ALSO re-points the neutral canvas (ADR-0001 step 4,
12
+ * amended). Accent-only colorways were the original rule, and a downstream
13
+ * consumer proved it surprising in the worst way: a workspace offering these
14
+ * three as pickable looks found that "Amber CRT" left the surface grey, so it
15
+ * hand-wrote a full amber canvas in raw hex — dark theme only, outside OKLCH,
16
+ * outside the contrast gate, and with e-ink left un-tinted because nobody
17
+ * noticed it was missing. Shipping the canvas here makes it governed instead.
18
+ *
19
+ * THE NEUTRALS ARE DERIVED, NOT PICKED. Each one keeps the core token's OKLCH
20
+ * *lightness* exactly, adopts the skin accent's *hue*, and takes a small
21
+ * role-scaled chroma — surfaces least, lines most, text near-neutral so it
22
+ * never competes with the accent. Because WCAG contrast is a function of
23
+ * relative luminance, which OKLCH L tracks closely, holding L fixed means every
24
+ * gated pairing keeps essentially its core ratio: the colorway gains a canvas,
25
+ * not a contrast problem. `check-contrast.mjs` audits the FULL pairing table
26
+ * for any skin that moves the canvas — not just the accent subset — so that
27
+ * claim is proven on every run rather than asserted here.
10
28
  *
11
29
  * Accents are authored in **OKLCH** (ADR-0001 step 5 — "OKLCH for new work
12
30
  * first"): perceptually-uniform lightness makes the light/dark pair easy to
@@ -41,22 +59,68 @@ export const skins = {
41
59
  // bright with a warm bloom in dark theme (the classic CRT glow). The glow
42
60
  // and a deeper --pulse breath (`--dotmatrix-pulse-min`) are the Tier-3
43
61
  // "display expression" knobs the colorway is allowed to re-point.
44
- light: { '--accent': 'oklch(52% 0.11 67deg)', '--dotmatrix-pulse-min': '0.35' },
62
+ light: {
63
+ '--accent': 'oklch(52% 0.11 67deg)',
64
+ '--dotmatrix-pulse-min': '0.35',
65
+ '--bg': 'oklch(96.66% 0.02 67deg)',
66
+ '--bg-elevated': 'oklch(98.781% 0.022 67deg)',
67
+ '--panel': 'oklch(100% 0.024 67deg)',
68
+ '--panel-strong': 'oklch(100% 0.026 67deg)',
69
+ '--panel-soft': 'oklch(94.253% 0.026 67deg)',
70
+ '--line': 'oklch(88.11% 0.035 67deg)',
71
+ '--line-strong': 'oklch(72.983% 0.04 67deg)',
72
+ '--text': 'oklch(14.479% 0.03 67deg)',
73
+ '--text-soft': 'oklch(32.825% 0.03 67deg)',
74
+ '--text-dim': 'oklch(51.571% 0.028 67deg)',
75
+ },
45
76
  dark: {
46
77
  '--accent': 'oklch(82% 0.15 82deg)',
47
78
  '--dotmatrix-glow': '0.4em',
48
79
  '--dotmatrix-pulse-min': '0.3',
80
+ '--bg': 'oklch(18.22% 0.02 82deg)',
81
+ '--bg-elevated': 'oklch(20.904% 0.022 82deg)',
82
+ '--panel': 'oklch(22.645% 0.024 82deg)',
83
+ '--panel-strong': 'oklch(25.196% 0.026 82deg)',
84
+ '--panel-soft': 'oklch(26.032% 0.026 82deg)',
85
+ '--line': 'oklch(34.07% 0.035 82deg)',
86
+ '--line-strong': 'oklch(44.953% 0.04 82deg)',
87
+ '--text': 'oklch(92.494% 0.03 82deg)',
88
+ '--text-soft': 'oklch(83.279% 0.03 82deg)',
89
+ '--text-dim': 'oklch(70.576% 0.028 82deg)',
49
90
  },
50
91
  },
51
92
  'phosphor-green': {
52
93
  label: 'Phosphor Green',
53
94
  // P1-phosphor green. Same light=dark-ink / dark=bright-glow split, with the
54
95
  // same deeper phosphor breath as Amber CRT.
55
- light: { '--accent': 'oklch(52% 0.13 150deg)', '--dotmatrix-pulse-min': '0.35' },
96
+ light: {
97
+ '--accent': 'oklch(52% 0.13 150deg)',
98
+ '--dotmatrix-pulse-min': '0.35',
99
+ '--bg': 'oklch(96.66% 0.02 150deg)',
100
+ '--bg-elevated': 'oklch(98.781% 0.022 150deg)',
101
+ '--panel': 'oklch(100% 0.024 150deg)',
102
+ '--panel-strong': 'oklch(100% 0.026 150deg)',
103
+ '--panel-soft': 'oklch(94.253% 0.026 150deg)',
104
+ '--line': 'oklch(88.11% 0.035 150deg)',
105
+ '--line-strong': 'oklch(72.983% 0.04 150deg)',
106
+ '--text': 'oklch(14.479% 0.03 150deg)',
107
+ '--text-soft': 'oklch(32.825% 0.03 150deg)',
108
+ '--text-dim': 'oklch(51.571% 0.028 150deg)',
109
+ },
56
110
  dark: {
57
111
  '--accent': 'oklch(84% 0.19 150deg)',
58
112
  '--dotmatrix-glow': '0.4em',
59
113
  '--dotmatrix-pulse-min': '0.3',
114
+ '--bg': 'oklch(18.22% 0.02 150deg)',
115
+ '--bg-elevated': 'oklch(20.904% 0.022 150deg)',
116
+ '--panel': 'oklch(22.645% 0.024 150deg)',
117
+ '--panel-strong': 'oklch(25.196% 0.026 150deg)',
118
+ '--panel-soft': 'oklch(26.032% 0.026 150deg)',
119
+ '--line': 'oklch(34.07% 0.035 150deg)',
120
+ '--line-strong': 'oklch(44.953% 0.04 150deg)',
121
+ '--text': 'oklch(92.494% 0.03 150deg)',
122
+ '--text-soft': 'oklch(83.279% 0.03 150deg)',
123
+ '--text-dim': 'oklch(70.576% 0.028 150deg)',
60
124
  },
61
125
  },
62
126
  'e-ink': {
@@ -64,12 +128,58 @@ export const skins = {
64
128
  // The opposite move: drop the hue almost entirely → a near-monochrome
65
129
  // ink/paper accent, no glow. The most restrained look in the set — and the
66
130
  // --reveal scan snaps on instantly (`--dotmatrix-reveal-step: 0ms`), since
67
- // e-ink panels don't sweep, they flip.
68
- light: { '--accent': 'oklch(34% 0.012 250deg)', '--dotmatrix-reveal-step': '0ms' },
69
- dark: { '--accent': 'oklch(84% 0.008 250deg)', '--dotmatrix-reveal-step': '0ms' },
131
+ // e-ink panels don't sweep, they flip. Its canvas takes a QUARTER of the
132
+ // chroma the other two do, for the same reason: near-monochrome is the
133
+ // whole point, so the tint should be felt rather than seen.
134
+ light: {
135
+ '--accent': 'oklch(34% 0.012 250deg)',
136
+ '--dotmatrix-reveal-step': '0ms',
137
+ '--bg': 'oklch(96.66% 0.005 250deg)',
138
+ '--bg-elevated': 'oklch(98.781% 0.006 250deg)',
139
+ '--panel': 'oklch(100% 0.006 250deg)',
140
+ '--panel-strong': 'oklch(100% 0.007 250deg)',
141
+ '--panel-soft': 'oklch(94.253% 0.007 250deg)',
142
+ '--line': 'oklch(88.11% 0.009 250deg)',
143
+ '--line-strong': 'oklch(72.983% 0.01 250deg)',
144
+ '--text': 'oklch(14.479% 0.008 250deg)',
145
+ '--text-soft': 'oklch(32.825% 0.008 250deg)',
146
+ '--text-dim': 'oklch(51.571% 0.007 250deg)',
147
+ },
148
+ dark: {
149
+ '--accent': 'oklch(84% 0.008 250deg)',
150
+ '--dotmatrix-reveal-step': '0ms',
151
+ '--bg': 'oklch(18.22% 0.005 250deg)',
152
+ '--bg-elevated': 'oklch(20.904% 0.006 250deg)',
153
+ '--panel': 'oklch(22.645% 0.006 250deg)',
154
+ '--panel-strong': 'oklch(25.196% 0.007 250deg)',
155
+ '--panel-soft': 'oklch(26.032% 0.007 250deg)',
156
+ '--line': 'oklch(34.07% 0.009 250deg)',
157
+ '--line-strong': 'oklch(44.953% 0.01 250deg)',
158
+ '--text': 'oklch(92.494% 0.008 250deg)',
159
+ '--text-soft': 'oklch(83.279% 0.008 250deg)',
160
+ '--text-dim': 'oklch(70.576% 0.007 250deg)',
161
+ },
70
162
  },
71
163
  };
72
164
 
165
+ /** The canvas tokens a colorway may re-point (ADR-0001 step 4, amended). Status
166
+ * colours are deliberately NOT here: a warning must look like a warning in
167
+ * every skin. The gates read this — check-skins allows these keys, and
168
+ * gen-contrast widens a skin's audit to the full pairing table when any of
169
+ * them is set. */
170
+ export const SKIN_CANVAS_TOKENS = Object.freeze([
171
+ '--bg',
172
+ '--bg-elevated',
173
+ '--panel',
174
+ '--panel-strong',
175
+ '--panel-soft',
176
+ '--line',
177
+ '--line-strong',
178
+ '--text',
179
+ '--text-soft',
180
+ '--text-dim',
181
+ ]);
182
+
73
183
  /** Skin names, frozen + sorted. */
74
184
  export const SKIN_NAMES = Object.freeze(Object.keys(skins).sort());
75
185
 
@@ -10,7 +10,13 @@
10
10
  "--tracking-wide",
11
11
  "--tracking-wider",
12
12
  "--shadow",
13
- "--shadow-raised"
13
+ "--shadow-raised",
14
+ "--tap-target",
15
+ "--tap-target-min",
16
+ "--safe-area-top",
17
+ "--safe-area-right",
18
+ "--safe-area-bottom",
19
+ "--safe-area-left"
14
20
  ]
15
21
  }
16
22
  },