ui-style-kit-css 2.2.0 → 2.4.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 (122) hide show
  1. package/CHANGELOG.md +77 -1
  2. package/CONTRIBUTING.md +8 -1
  3. package/README.md +171 -53
  4. package/STYLE-MAP.md +28 -5
  5. package/dist/assets/bauhaus-barlow-OFL.txt +93 -0
  6. package/dist/assets/bauhaus-barlow-semibold.ttf +0 -0
  7. package/dist/assets/bauhaus-barlow.ttf +0 -0
  8. package/dist/assets/bauhaus-condensed-OFL.txt +93 -0
  9. package/dist/assets/bauhaus-condensed-bold.ttf +0 -0
  10. package/dist/assets/bauhaus-condensed-extrabold.ttf +0 -0
  11. package/dist/assets/bento-manrope-OFL.txt +93 -0
  12. package/dist/assets/bento-manrope.ttf +0 -0
  13. package/dist/assets/clay-grain.png +0 -0
  14. package/dist/assets/clay-rounded-OFL.txt +93 -0
  15. package/dist/assets/clay-rounded.ttf +0 -0
  16. package/dist/assets/neo-noir-corner-dark.png +0 -0
  17. package/dist/assets/neo-noir-corner-light.png +0 -0
  18. package/dist/assets/neo-noir-texture-dark.png +0 -0
  19. package/dist/assets/neo-noir-texture-light.png +0 -0
  20. package/dist/assets/organic-display-OFL.txt +93 -0
  21. package/dist/assets/organic-display.ttf +0 -0
  22. package/dist/assets/organic-icons-LICENSE.txt +21 -0
  23. package/dist/assets/organic-sans-OFL.txt +93 -0
  24. package/dist/assets/organic-sans.ttf +0 -0
  25. package/dist/ui-style-kit.css +55604 -6525
  26. package/dist/ui-style-kit.min.css +2 -2
  27. package/dist/ui-style-kit.visual.css +55443 -6942
  28. package/dist/ui-style-kit.visual.min.css +2 -2
  29. package/dist/ui-style-kit.with-bridge.css +55646 -6551
  30. package/dist/ui-style-kit.with-bridge.min.css +2 -2
  31. package/dist/visual/art-deco.css +7318 -0
  32. package/dist/visual/bauhaus.css +2 -2961
  33. package/dist/visual/bento.css +2 -2980
  34. package/dist/visual/brutalism.css +2679 -352
  35. package/dist/visual/clay.css +5 -0
  36. package/dist/visual/cyberpunk.css +4482 -781
  37. package/dist/visual/data-terminal.css +6182 -0
  38. package/dist/visual/editorial-luxe.css +6450 -0
  39. package/dist/visual/industrial-utility.css +7259 -0
  40. package/dist/visual/maximalist.css +4080 -1025
  41. package/dist/visual/minimal-saas.css +3305 -888
  42. package/dist/visual/neo-noir.css +5 -0
  43. package/dist/visual/neumorphism.css +3582 -975
  44. package/dist/visual/organic-modern.css +5 -0
  45. package/dist/visual/paper-editorial.css +7074 -0
  46. package/dist/visual/retro-glass.css +4426 -760
  47. package/dist/visual/retrofuturism.css +3676 -875
  48. package/dist/visual/tactile.css +4568 -1036
  49. package/dist/visual/technical-blueprint.css +6713 -0
  50. package/dist/visual/y2k.css +3672 -753
  51. package/docs/ART-DECO.md +80 -0
  52. package/docs/BAUHAUS.md +152 -0
  53. package/docs/BENTO.md +121 -0
  54. package/docs/CLAY.md +127 -0
  55. package/docs/DEMO-SHOWCASE.md +65 -0
  56. package/docs/ECOSYSTEM.md +9 -5
  57. package/docs/EDITORIAL-LUX.md +75 -0
  58. package/docs/INDUSTRIAL-UTILITY.md +131 -0
  59. package/docs/NATIVE-ELEMENTS.md +23 -17
  60. package/docs/NEO-NOIR.md +94 -0
  61. package/docs/ORGANIC-MODERN.md +91 -0
  62. package/docs/PAPER-EDITORIAL.md +63 -0
  63. package/docs/PUBLISHING.md +36 -11
  64. package/docs/RELEASE-2.4.0.md +88 -0
  65. package/docs/RETRO-GLASS.md +105 -0
  66. package/docs/STYLE-GUIDE.md +68 -13
  67. package/docs/TACTILE.md +38 -0
  68. package/docs/TECHNICAL-BLUEPRINT.md +60 -0
  69. package/docs/TOKENS.md +90 -4
  70. package/docs/superpowers/plans/2026-08-29-preset-identity-system-refinement.md +649 -0
  71. package/docs/superpowers/plans/2026-09-04-library-wide-theme-fallback-and-fidelity.md +331 -0
  72. package/docs/superpowers/specs/2026-08-29-preset-identity-system-refinement-design.md +212 -0
  73. package/docs/superpowers/specs/2026-09-04-library-wide-theme-fallback-and-fidelity-design.md +113 -0
  74. package/manifest.json +769 -20
  75. package/package.json +79 -14
  76. package/styles/art-deco.css +2068 -0
  77. package/styles/assets/bauhaus-barlow-OFL.txt +93 -0
  78. package/styles/assets/bauhaus-barlow-semibold.ttf +0 -0
  79. package/styles/assets/bauhaus-barlow.ttf +0 -0
  80. package/styles/assets/bauhaus-condensed-OFL.txt +93 -0
  81. package/styles/assets/bauhaus-condensed-bold.ttf +0 -0
  82. package/styles/assets/bauhaus-condensed-extrabold.ttf +0 -0
  83. package/styles/assets/bento-manrope-OFL.txt +93 -0
  84. package/styles/assets/bento-manrope.ttf +0 -0
  85. package/styles/assets/clay-grain.png +0 -0
  86. package/styles/assets/clay-rounded-OFL.txt +93 -0
  87. package/styles/assets/clay-rounded.ttf +0 -0
  88. package/styles/assets/neo-noir-corner-dark.png +0 -0
  89. package/styles/assets/neo-noir-corner-light.png +0 -0
  90. package/styles/assets/neo-noir-texture-dark.png +0 -0
  91. package/styles/assets/neo-noir-texture-light.png +0 -0
  92. package/styles/assets/organic-display-OFL.txt +93 -0
  93. package/styles/assets/organic-display.ttf +0 -0
  94. package/styles/assets/organic-icons-LICENSE.txt +21 -0
  95. package/styles/assets/organic-sans-OFL.txt +93 -0
  96. package/styles/assets/organic-sans.ttf +0 -0
  97. package/styles/bauhaus.css +1092 -87
  98. package/styles/bento.css +1413 -86
  99. package/styles/brutalism.css +493 -10
  100. package/styles/clay.css +1927 -0
  101. package/styles/compat-layout.css +1 -2
  102. package/styles/components.css +698 -33
  103. package/styles/content-overflow.css +434 -9
  104. package/styles/cyberpunk.css +2082 -46
  105. package/styles/data-terminal.css +1795 -0
  106. package/styles/editorial-luxe.css +1251 -0
  107. package/styles/industrial-utility.css +2449 -0
  108. package/styles/interactive-surface-bridge.css +40 -24
  109. package/styles/interactive-surface-theme.css +31 -13
  110. package/styles/maximalist.css +1410 -94
  111. package/styles/minimal-saas.css +675 -73
  112. package/styles/native-elements.css +396 -168
  113. package/styles/neo-noir.css +1332 -0
  114. package/styles/neumorphism.css +1155 -52
  115. package/styles/organic-modern.css +1353 -0
  116. package/styles/paper-editorial.css +1724 -0
  117. package/styles/retro-glass.css +870 -42
  118. package/styles/retrofuturism.css +1173 -55
  119. package/styles/tactile.css +2018 -84
  120. package/styles/technical-blueprint.css +1337 -0
  121. package/styles/theme-colors.css +796 -5
  122. package/styles/y2k.css +1182 -40
@@ -0,0 +1,331 @@
1
+ # Library-wide Theme Fallback and Fidelity Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Make all 20 presets use design-reference fallback colors only when no color theme is selected while preserving theme ownership, accessibility, and reference-specific light, dark, and contrast identities.
6
+
7
+ **Architecture:** Each preset publishes mode-specific fallback RGB channels and resolves its public color roles with `var(--usk-*-rgb, var(--<prefix>-fallback-*-rgb))`. Shared native, semantic, and overflow layers activate for `[data-ui][data-mode]`; explicit themes continue to define the `--usk-*` producer channels and therefore override every preset fallback without changing preset geometry or material recipes.
8
+
9
+ **Tech Stack:** CSS custom properties and cascade layers, Node.js test runner, css-tree, Stylelint, Lightning CSS, Playwright, axe-core.
10
+
11
+ **Spec:** `docs/superpowers/specs/2026-09-04-library-wide-theme-fallback-and-fidelity-design.md`
12
+
13
+ ## Global Constraints
14
+
15
+ - Preserve all public preset IDs, prefixes, class names, entrypoints, manifest schema, and cascade layer order.
16
+ - Preserve unrelated dirty working-tree changes.
17
+ - `data-ui` and `data-mode` remain required; `data-theme` becomes optional.
18
+ - Explicit themes own every visible paint role; no-theme fallbacks match the retained design references.
19
+ - Run focused tests during implementation and the full verification chain only after all implementation tasks are complete.
20
+ - Write production JavaScript comments as professional JSDoc parseable by jsdoc2md.
21
+ - Update generated CSS only with `npm.cmd run build`.
22
+ - Do not deploy, publish, push, or rewrite the branch.
23
+
24
+ ---
25
+
26
+ ### Task 1: Lock the optional-theme semantic contract
27
+
28
+ **Files:**
29
+ - Create: `tests/theme-fallbacks.test.js`
30
+ - Modify: `tests/theme-colors.test.js`
31
+ - Modify: `scripts/check-contrast.mjs`
32
+
33
+ **Interfaces:**
34
+ - Consumes: `manifest.presets`, `manifest.modes`, and the existing 23-role semantic color list.
35
+ - Produces: static assertions for fallback resolution and exported `validateFallbackContrast(cssByPreset)` coverage used by the contrast CLI.
36
+
37
+ - [ ] **Step 1: Write the failing static contract test**
38
+
39
+ Create a manifest-driven test that requires every preset/mode to expose all 23 `--<prefix>-fallback-*-rgb` channels, requires each resolved public role to use the corresponding `--usk-*` channel with the preset fallback as the second argument, and requires themed direct aliases to remain present for build-time extraction.
40
+
41
+ ```js
42
+ test('every preset resolves explicit themes before its mode fallback palette', () => {
43
+ for (const { id, prefix } of manifest.presets) {
44
+ const css = read(`styles/${id}.css`);
45
+ for (const mode of manifest.modes) {
46
+ const block = exactBlock(css, `[data-ui="${id}"][data-mode="${mode}"]`);
47
+ for (const role of colorRoles) {
48
+ assert.match(block, new RegExp(`--${prefix}-fallback-${role}-rgb:\\s*\\d+ \\d+ \\d+;`));
49
+ }
50
+ }
51
+ const resolver = exactBlock(css, `[data-ui="${id}"][data-mode]`);
52
+ for (const role of colorRoles) {
53
+ assert.match(
54
+ resolver,
55
+ new RegExp(`--${prefix}-${role}-rgb:\\s*var\\(--usk-${role}-rgb,\\s*var\\(--${prefix}-fallback-${role}-rgb\\)\\);`)
56
+ );
57
+ }
58
+ }
59
+ });
60
+ ```
61
+
62
+ - [ ] **Step 2: Run only the new test and verify RED**
63
+
64
+ Run: `node --test tests/theme-fallbacks.test.js`
65
+
66
+ Expected: FAIL because most presets do not expose fallback role blocks or a fallback-aware resolver.
67
+
68
+ - [ ] **Step 3: Extend the contrast checker test seam**
69
+
70
+ Add a failing unit assertion in `tests/contrast-contract.test.js` for an exported fallback validator that rejects a no-theme palette whose text/background ratio is below the existing threshold.
71
+
72
+ - [ ] **Step 4: Run the single contrast contract test and verify RED**
73
+
74
+ Run: `node --test tests/contrast-contract.test.js`
75
+
76
+ Expected: FAIL because `validateFallbackContrast` is not exported.
77
+
78
+ - [ ] **Step 5: Implement the minimal fallback contrast validator**
79
+
80
+ Reuse the existing RGB parser and contrast functions. Validate the same text/surface, action/foreground, status/foreground, border, and control-edge pairs for the 60 preset/mode fallback states. Document the exported function with JSDoc.
81
+
82
+ - [ ] **Step 6: Run the contrast contract test and verify GREEN**
83
+
84
+ Run: `node --test tests/contrast-contract.test.js`
85
+
86
+ Expected: PASS.
87
+
88
+ ### Task 2: Make shared accessibility layers independent of `data-theme`
89
+
90
+ **Files:**
91
+ - Modify: `styles/native-elements.css`
92
+ - Modify: `styles/components.css`
93
+ - Modify: `styles/content-overflow.css`
94
+ - Modify: `tests/native-elements-contract.test.js`
95
+ - Modify: `tests/semantic-component-contract.test.js`
96
+
97
+ **Interfaces:**
98
+ - Consumes: resolved `--usk-native-*` and preset-prefixed roles from Task 1.
99
+ - Produces: shared native and semantic behavior under `[data-ui][data-mode]` for themed and no-theme roots.
100
+
101
+ - [ ] **Step 1: Write the failing shared-selector test**
102
+
103
+ Require native foundations, focus-visible rules, reduced-motion rules, contrast reinforcement, forced-colors rules, component containment, and overflow guards to activate through `[data-ui][data-mode]` without a `data-theme` dependency.
104
+
105
+ - [ ] **Step 2: Run the native contract test and verify RED**
106
+
107
+ Run: `node --test tests/native-elements-contract.test.js`
108
+
109
+ Expected: FAIL on the current `[data-ui][data-theme][data-mode]` selectors.
110
+
111
+ - [ ] **Step 3: Broaden only shared activation selectors**
112
+
113
+ Replace theme-required shared roots with `[data-ui][data-mode]`. Keep theme producer selectors in `styles/theme-colors.css` unchanged so no fallback leaks into explicit schemes.
114
+
115
+ - [ ] **Step 4: Run the native contract test and verify GREEN**
116
+
117
+ Run: `node --test tests/native-elements-contract.test.js`
118
+
119
+ Expected: PASS.
120
+
121
+ - [ ] **Step 5: Run the semantic component contract test once**
122
+
123
+ Run: `node --test tests/semantic-component-contract.test.js`
124
+
125
+ Expected: PASS after selector fingerprints are regenerated at the final build; if the only failure is the known generated artifact fingerprint, defer that fingerprint update to Task 6.
126
+
127
+ ### Task 3: Add reference-derived fallbacks and resolvers to the first ten presets
128
+
129
+ **Files:**
130
+ - Modify: `styles/minimal-saas.css`
131
+ - Modify: `styles/bento.css`
132
+ - Modify: `styles/maximalist.css`
133
+ - Modify: `styles/bauhaus.css`
134
+ - Modify: `styles/tactile.css`
135
+ - Modify: `styles/neumorphism.css`
136
+ - Modify: `styles/retrofuturism.css`
137
+ - Modify: `styles/brutalism.css`
138
+ - Modify: `styles/cyberpunk.css`
139
+ - Modify: `styles/y2k.css`
140
+
141
+ **Interfaces:**
142
+ - Consumes: the Task 1 resolver contract and the retained template references.
143
+ - Produces: complete light/dark/contrast fallback palettes and theme-derived material paint for presets 1–10.
144
+
145
+ - [ ] **Step 1: Add one failing preset assertion at a time**
146
+
147
+ For each preset, add its three fallback blocks to the shared test fixture expectations before editing production CSS. Each role must use explicit RGB integers and include paired foreground roles.
148
+
149
+ - [ ] **Step 2: Run only that preset's test case and verify RED**
150
+
151
+ Run these exact commands in order, stopping at the first failure:
152
+
153
+ ```powershell
154
+ node --test --test-name-pattern="minimal-saas" tests/theme-fallbacks.test.js
155
+ node --test --test-name-pattern="bento" tests/theme-fallbacks.test.js
156
+ node --test --test-name-pattern="maximalist" tests/theme-fallbacks.test.js
157
+ node --test --test-name-pattern="bauhaus" tests/theme-fallbacks.test.js
158
+ node --test --test-name-pattern="tactile" tests/theme-fallbacks.test.js
159
+ node --test --test-name-pattern="neumorphism" tests/theme-fallbacks.test.js
160
+ node --test --test-name-pattern="retrofuturism" tests/theme-fallbacks.test.js
161
+ node --test --test-name-pattern="brutalism" tests/theme-fallbacks.test.js
162
+ node --test --test-name-pattern="cyberpunk" tests/theme-fallbacks.test.js
163
+ node --test --test-name-pattern="y2k" tests/theme-fallbacks.test.js
164
+ ```
165
+
166
+ Expected: FAIL because the selected preset is missing the new contract.
167
+
168
+ - [ ] **Step 3: Implement that preset's fallback and resolver**
169
+
170
+ Add mode-specific fallback channels, move runtime aliases/native mappings to `[data-ui="<preset>"][data-mode]`, retain a small direct themed alias seam, and derive material paint from resolved prefixed roles.
171
+
172
+ - [ ] **Step 4: Run only that preset's test case and verify GREEN**
173
+
174
+ Rerun only the exact preset command from Step 2.
175
+
176
+ Expected: PASS.
177
+
178
+ - [ ] **Step 5: Repeat Steps 1–4 sequentially for all ten listed presets**
179
+
180
+ Do not rerun a green preset case unless a later shared resolver refactor can affect it.
181
+
182
+ ### Task 4: Add reference-derived fallbacks and resolvers to the remaining ten presets
183
+
184
+ **Files:**
185
+ - Modify: `styles/retro-glass.css`
186
+ - Modify: `styles/editorial-luxe.css`
187
+ - Modify: `styles/organic-modern.css`
188
+ - Modify: `styles/industrial-utility.css`
189
+ - Modify: `styles/technical-blueprint.css`
190
+ - Modify: `styles/art-deco.css`
191
+ - Modify: `styles/clay.css`
192
+ - Modify: `styles/data-terminal.css`
193
+ - Modify: `styles/paper-editorial.css`
194
+ - Modify: `styles/neo-noir.css`
195
+
196
+ **Interfaces:**
197
+ - Consumes: the Task 1 resolver contract and the retained paired or combined template references.
198
+ - Produces: complete light/dark/contrast fallback palettes and theme-derived material paint for presets 11–20.
199
+
200
+ - [ ] **Step 1: Add one failing preset assertion at a time**
201
+
202
+ Use the same executable contract as Task 3. Preserve existing in-progress fidelity work in these dirty files and add only the missing fallback/theme boundary.
203
+
204
+ - [ ] **Step 2: Run only that preset's test case and verify RED**
205
+
206
+ Run these exact commands in order, stopping at the first failure:
207
+
208
+ ```powershell
209
+ node --test --test-name-pattern="retro-glass" tests/theme-fallbacks.test.js
210
+ node --test --test-name-pattern="editorial-luxe" tests/theme-fallbacks.test.js
211
+ node --test --test-name-pattern="organic-modern" tests/theme-fallbacks.test.js
212
+ node --test --test-name-pattern="industrial-utility" tests/theme-fallbacks.test.js
213
+ node --test --test-name-pattern="technical-blueprint" tests/theme-fallbacks.test.js
214
+ node --test --test-name-pattern="art-deco" tests/theme-fallbacks.test.js
215
+ node --test --test-name-pattern="clay" tests/theme-fallbacks.test.js
216
+ node --test --test-name-pattern="data-terminal" tests/theme-fallbacks.test.js
217
+ node --test --test-name-pattern="paper-editorial" tests/theme-fallbacks.test.js
218
+ node --test --test-name-pattern="neo-noir" tests/theme-fallbacks.test.js
219
+ ```
220
+
221
+ Expected: FAIL on the missing or incomplete fallback resolver.
222
+
223
+ - [ ] **Step 3: Implement that preset's fallback and resolver**
224
+
225
+ Where Technical Blueprint or Data Terminal already contain no-theme work, reconcile it into the shared contract without deleting reference-fidelity declarations or weakening direct alias extraction.
226
+
227
+ - [ ] **Step 4: Run only that preset's test case and verify GREEN**
228
+
229
+ Rerun only the exact preset command from Step 2.
230
+
231
+ Expected: PASS.
232
+
233
+ - [ ] **Step 5: Repeat Steps 1–4 sequentially for all ten listed presets**
234
+
235
+ Do not rerun green cases unnecessarily.
236
+
237
+ ### Task 5: Prove runtime theme ownership and accessibility states
238
+
239
+ **Files:**
240
+ - Modify: `tests/e2e/demo.spec.js`
241
+ - Modify: `tests/e2e/accessibility.spec.js`
242
+ - Modify: `tests/demo-visual.spec.mjs`
243
+ - Modify: `scripts/preset-identities.mjs`
244
+ - Modify: `design-qa.md`
245
+
246
+ **Interfaces:**
247
+ - Consumes: all 20 fallback-aware preset styles and the existing component/native demo specimens.
248
+ - Produces: computed-style and visual evidence for themed, fallback, light, dark, contrast, focus, disabled, reduced-motion, and forced-colors states.
249
+
250
+ - [ ] **Step 1: Write a failing computed-style matrix case**
251
+
252
+ For each preset and mode, capture representative prefixed card/button/input/range/progress paint, semantic `.ui-*` paint, and native element paint without `data-theme`; then apply two materially different themes and assert that semantic paint changes while geometry remains stable.
253
+
254
+ - [ ] **Step 2: Run only the new Chromium matrix case and verify RED**
255
+
256
+ Run: `npm.cmd exec playwright test -- --config playwright.config.js tests/e2e/demo.spec.js --project=chromium --grep "fallback and explicit theme ownership"`
257
+
258
+ Expected: FAIL for presets whose shared or authored selectors still require `data-theme` or whose material paint is fixed.
259
+
260
+ - [ ] **Step 3: Repair only reported cascade leaks**
261
+
262
+ Change fixed visible paint to resolved semantic channels, preserve neutral optical overlays, and add later preset-specific native overrides only where shared selector order wins unexpectedly.
263
+
264
+ - [ ] **Step 4: Rerun the single Chromium matrix case and verify GREEN**
265
+
266
+ Run the exact command from Step 2.
267
+
268
+ Expected: PASS.
269
+
270
+ - [ ] **Step 5: Add and run the focused accessibility case**
271
+
272
+ Verify focus visibility, labels, disabled states, and axe results for one fallback and one explicit theme in each mode. Run only the new named accessibility case until it passes.
273
+
274
+ - [ ] **Step 6: Update executable identity traits and the QA ledger**
275
+
276
+ Record each template's typography, density, geometry, material, feedback, and data evidence. Keep paint traits semantic so theme switching cannot erase identity.
277
+
278
+ ### Task 6: Regenerate artifacts and run the final verification chain
279
+
280
+ **Files:**
281
+ - Generated: `dist/ui-style-kit.css`
282
+ - Generated: `dist/ui-style-kit.min.css`
283
+ - Generated: `dist/ui-style-kit.visual.css`
284
+ - Generated: `dist/ui-style-kit.visual.min.css`
285
+ - Generated: `dist/ui-style-kit.with-bridge.css`
286
+ - Generated: `dist/ui-style-kit.with-bridge.min.css`
287
+ - Generated: `dist/visual/*.css`
288
+ - Modify if generated fingerprint changes: `tests/semantic-component-contract.test.js`
289
+ - Modify if bundle sizes change: `README.md`
290
+
291
+ **Interfaces:**
292
+ - Consumes: all authored source and tests from Tasks 1–5.
293
+ - Produces: publishable generated bundles and final local verification evidence.
294
+
295
+ - [ ] **Step 1: Build once**
296
+
297
+ Run: `npm.cmd run build`
298
+
299
+ Expected: all default, visual-only, focused visual, and compatibility entrypoints regenerate successfully.
300
+
301
+ - [ ] **Step 2: Update generated artifact fingerprints if required**
302
+
303
+ Use the build output as the only source of truth. Update the exact declaration count and SHA-256 expectations, then run only `tests/semantic-component-contract.test.js`.
304
+
305
+ - [ ] **Step 3: Run the final static chain sequentially**
306
+
307
+ Run, in order, stopping at the first failure:
308
+
309
+ ```powershell
310
+ npm.cmd run lint
311
+ npm.cmd run test:unit
312
+ npm.cmd run check:contrast
313
+ npm.cmd run check:compat
314
+ npm.cmd run check:ownership
315
+ npm.cmd run check:package
316
+ git diff --check
317
+ ```
318
+
319
+ - [ ] **Step 4: Run focused browser and accessibility verification**
320
+
321
+ Run the new theme-ownership case, reference-fidelity cases, and axe case. Do not claim cross-browser success for an engine that was not freshly exercised.
322
+
323
+ - [ ] **Step 5: Run the visual suite once at the end**
324
+
325
+ Run: `npm.cmd run test:visual`
326
+
327
+ Expected: approved snapshots pass or are updated only after direct reference/prototype comparison confirms the intended differences.
328
+
329
+ - [ ] **Step 6: Review the integrated diff**
330
+
331
+ Confirm that only approved source, tests, documentation, generated bundles, and reviewed snapshots changed. Report unrelated pre-existing dirty files separately and do not stage, revert, or overwrite them.
@@ -0,0 +1,212 @@
1
+ # Preset Identity System Refinement Design
2
+
3
+ Date: 2026-08-29
4
+ Status: Approved and implemented for the 2.3.0 release candidate
5
+ Target release: `ui-style-kit-css@2.3.0`
6
+
7
+ ## Purpose
8
+
9
+ Refine all 20 UI presets so their public components and native-element fallbacks read as coherent design systems rather than a shared component library with isolated `clip-path` changes. The work corrects the demo regressions shown in the August 29 screenshots while preserving the existing public class API, theme names, modes, token roles, and companion-library compatibility.
10
+
11
+ ## Problem Statement
12
+
13
+ The current 2.3.0 candidate gives many presets a distinct cut-button polygon, spinner, or card decoration, but the identity is not carried consistently across the rest of the component vocabulary.
14
+
15
+ The most visible mechanisms are:
16
+
17
+ - The demo combines `button-outline-heavy` and `button-cut` on every `View Usage` action. This makes the outlined action inherit the same polygon-first treatment as the filled service-card action.
18
+ - Most `button-outline-heavy` rules share the same transparent background, two-pixel primary border, and hover fill. Only a few presets add meaningful material or depth differences.
19
+ - Native buttons and dialogs are driven by one shared geometry recipe. Preset variables alter radius and color, but do not establish a complete preset-specific control or surface identity.
20
+ - Most metrics use one generic card recipe. Bento's six-column tile helper can become too narrow inside the demo container, causing labels to wrap into unreadable columns.
21
+ - Several service-card actions stretch across the card because grid items stretch by default. A different polygon on the same full-width bar does not create a meaningfully different component.
22
+ - The existing tests require a clipped CTA and distinct composite signatures, but do not prove that the same identity vocabulary appears across filled actions, outlined actions, surfaces, metrics, and native fallbacks.
23
+
24
+ ## Goals
25
+
26
+ 1. Give every preset a recognizable and internally consistent component identity.
27
+ 2. Keep filled and outlined CTAs visibly related without making them identical.
28
+ 3. Make CTA width and alignment intentional for each preset family.
29
+ 4. Carry the identity into service cards, media scrims, metrics or tiles, feature strips, callout bars, dialogs, and native buttons.
30
+ 5. Correct Bento metric wrapping and other demo containment problems without changing consumer heading scales.
31
+ 6. Preserve all public classes, modes, themes, focused exports, deprecated structural helpers, bridge exports, and companion ownership order.
32
+ 7. Prevent future drift with a manifest-complete identity registry and focused contracts.
33
+
34
+ ## Non-Goals
35
+
36
+ - No new public class names.
37
+ - No removed or renamed classes, tokens, themes, modes, or exports.
38
+ - No color-theme redesign. Components continue to consume the active theme tokens.
39
+ - No changes to companion-library ownership or bridge activation.
40
+ - No commit, push, tag, GitHub release, or npm publication.
41
+ - No broad demo redesign outside the affected component specimens.
42
+
43
+ ## Design Principles
44
+
45
+ Each preset is defined across four connected axes:
46
+
47
+ 1. **Silhouette:** corner logic, contour, framing, and control proportion.
48
+ 2. **Border rhythm:** weight, doubling, offset, technical marks, or restrained hairlines.
49
+ 3. **Material and depth:** flat, raised, inset, frosted, glossy, printed, metallic, or luminous treatment.
50
+ 4. **Composition:** content alignment, action width, density, and placement.
51
+
52
+ Color remains independent. The active color scheme supplies semantic tokens; the UI preset supplies the geometry and material treatment.
53
+
54
+ ## Architecture
55
+
56
+ ### Manifest-driven identity registry
57
+
58
+ Add a JavaScript identity registry keyed by the 20 `manifest.json` preset IDs. Each entry records:
59
+
60
+ - preset ID and prefix;
61
+ - human-readable identity description;
62
+ - CTA composition family;
63
+ - required component selectors;
64
+ - stable identity markers for silhouette, border, depth, and alignment;
65
+ - expected native-element treatment markers.
66
+
67
+ The registry is an internal build and test source of truth, not a new public API. JavaScript exports and helpers will use JSDoc-compatible comments.
68
+
69
+ The registry will be validated against `manifest.json` in both directions: every manifest preset must have exactly one identity entry, and no identity entry may reference a removed preset. Tests will compute a normalized identity signature from the authored CSS and reject duplicate signatures.
70
+
71
+ Authored CSS remains in `styles/`. The registry will not hide arbitrary CSS declaration strings inside JavaScript. Instead, it describes the required design vocabulary and lets focused contracts validate the explicit rules in each preset stylesheet. Generated `dist/` files continue to come only from the existing build pipeline.
72
+
73
+ ### CTA role separation
74
+
75
+ The commercial demo will use:
76
+
77
+ - `button-primary button-cut` for the filled `Explore` service action;
78
+ - `button-outline-heavy` for the outlined `View Usage` callout action.
79
+
80
+ The outlined action will no longer stack `button-cut`. Each preset's `button-outline-heavy` rule will receive its own related geometry, border, material, and alignment treatment. The filled and outlined actions will share a motif, not an identical silhouette.
81
+
82
+ The public modifiers remain independently composable. Existing consumer markup that intentionally combines them will continue to work.
83
+
84
+ ### CTA composition families
85
+
86
+ CTA size and placement will follow the component identity rather than default grid stretching:
87
+
88
+ - **Precise and compact:** Minimal SaaS, Editorial Luxe, Industrial Utility, Technical Blueprint, Data Terminal, and Paper Editorial use content-sized actions aligned to the reading edge.
89
+ - **Tile and block:** Bento, Bauhaus, and Brutalism use deliberate block treatments with bounded widths, hard alignment, and stronger structural weight.
90
+ - **Soft and sculpted:** Neumorphism, Organic Modern, Clay, and Y2K use compact centered actions with raised, inset, pebble, inflated, or glossy material cues.
91
+ - **Elongated and atmospheric:** Retrofuturism, Cyberpunk, Retro Glass, and Neo Noir use controlled console or cinematic proportions without defaulting to the full card width.
92
+ - **Expressive and physical:** Maximalist and Tactile use offset poster-like or keycap-like actions with deliberate depth.
93
+
94
+ Mobile layouts may stretch actions only when the available width requires it. The action height, label flow, and focus indicator must remain intact.
95
+
96
+ ## Preset Identity Matrix
97
+
98
+ | Preset | Connected component identity |
99
+ | --- | --- |
100
+ | Minimal SaaS | Restrained single-corner fold, fine outline, low elevation, compact left-aligned controls. |
101
+ | Bento | Stepped tile corners, compact block proportions, nested tile borders, bounded block actions. |
102
+ | Maximalist | Skewed poster silhouette, layered fill, offset decoration, pronounced playful shadow. |
103
+ | Bauhaus | Asymmetric primary geometry, hard edges, opposing cuts, high-contrast structural blocks. |
104
+ | Tactile | Shallow chamfered keycap, bevel highlight, pressed depth, physical control spacing. |
105
+ | Neumorphism | Soft clipped surface, raised and inset paired shadows, quiet borders, centered controls. |
106
+ | Retrofuturism | Elongated console geometry, metallic rim, instrument-like framing, compact display labels. |
107
+ | Brutalism | Blunt cut, thick border, hard offset shadow, dense block alignment. |
108
+ | Cyberpunk | Multi-notch technical polygon, neon edge, console framing, luminous action emphasis. |
109
+ | Y2K | Glossy hexagonal capsule, reflective highlight, playful centered composition. |
110
+ | Retro Glass | Frosted angular tab, inner highlight, translucent framing, restrained glass depth. |
111
+ | Editorial Luxe | Slim bookplate, hairline or double framing, serif-led hierarchy, compact reading-edge action. |
112
+ | Organic Modern | Asymmetric pebble or leaf contour, soft layered depth, relaxed centered composition. |
113
+ | Industrial Utility | Octagonal hazard-control geometry, equipment border, compact operational density. |
114
+ | Technical Blueprint | Drafting-corner outline, technical ticks or inset rules, precise left alignment. |
115
+ | Art Deco | Symmetric chevron ends, double-rule framing, centered ornamental composition. |
116
+ | Clay | Inflated clipped pill, chunky soft shadow, compact centered action, sculpted surfaces. |
117
+ | Data Terminal | Terminal-bracket silhouette, luminous outline, monospace density, reading-edge command action. |
118
+ | Paper Editorial | Ticket or tab notch, inked offset edge, print rules, compact editorial action. |
119
+ | Neo Noir | Cinematic slant, high-contrast edge light, atmospheric framing, controlled elongated action. |
120
+
121
+ ## Component Treatment
122
+
123
+ ### Service cards and media scrims
124
+
125
+ Service cards will use the preset's silhouette, border rhythm, and depth treatment. The action will be explicitly sized and aligned. Media scrims will share the card contour and border treatment while retaining the proven high-contrast caption gradient and inherited caption foreground.
126
+
127
+ ### Metrics and Bento tiles
128
+
129
+ Metrics will preserve semantic value and label elements while applying preset-specific alignment and framing. Labels must remain readable without character-by-character wrapping.
130
+
131
+ Bento keeps its large/small tile hierarchy, but the six-column layout will activate only where its container can support it. At smaller container widths it will collapse to a balanced two-column layout, then one column. Tile minimum sizes and text wrapping rules will prevent the narrow cards shown in the screenshot.
132
+
133
+ ### Feature strips and callout bars
134
+
135
+ Feature strips and callout bars will use the same border and surface language as their preset's service card. The callout action remains visually subordinate to the filled service action but must still be a recognizable member of the same preset.
136
+
137
+ ### Native buttons and dialogs
138
+
139
+ Preset-scoped native overrides will extend the shared native foundation rather than replace it. They will adjust safe geometry, border, depth, typography, and alignment for unclassed buttons and dialogs.
140
+
141
+ Aggressive clipping will not be applied to text inputs or to dialog containers when it could cut content or focus indicators. Native controls retain minimum target size, visible focus, contrast roles, disabled behavior, busy-spinner containment, and bridge ownership rules.
142
+
143
+ ## Demo Changes
144
+
145
+ - Remove `button-cut` from the `View Usage` action.
146
+ - Add demo-only test hooks for primary and secondary commercial actions where needed.
147
+ - Preserve the two-column commercial grid at desktop and one-column layout on mobile.
148
+ - Make style-specific metric specimens container-aware.
149
+ - Keep native markup semantic and unclassed so the fallback selectors remain visible.
150
+ - Preserve the active color-scheme token artwork and media-scrim contrast fix.
151
+
152
+ ## Compatibility
153
+
154
+ - Existing class names and combined modifier markup remain valid.
155
+ - Preset styles continue to live in the `ui-style-kit.presets` cascade layer and override shared native foundations through scoped selectors.
156
+ - Interactive Surface remains responsible for state-core behavior when the bridge is attached.
157
+ - Layout Style remains responsible for layout composition outside component-owned internals.
158
+ - Focused preset exports and bridge bundles are regenerated from authored styles.
159
+ - No theme token role changes are expected.
160
+
161
+ ## Verification Strategy
162
+
163
+ ### Focused static and unit contracts
164
+
165
+ 1. Registry coverage exactly matches all 20 manifest presets and prefixes.
166
+ 2. Each preset exposes a complete identity signature across:
167
+ - `button-cut`;
168
+ - `button-outline-heavy`;
169
+ - service card or media surface;
170
+ - metric or preset-specific tile;
171
+ - callout bar;
172
+ - native button and dialog treatment.
173
+ 3. No two presets have the same normalized composite signature.
174
+ 4. The demo does not stack `button-cut` on `View Usage`.
175
+ 5. CTA composition declares an intentional width and alignment strategy.
176
+ 6. Bento contains container-aware large/small tile fallbacks.
177
+ 7. Public API, containment inventory, contrast, package, and generated-bundle contracts remain green.
178
+
179
+ ### Rendered geometry and accessibility
180
+
181
+ When the approved browser surface is available, verify all 20 presets at 1440px, 1024px, and 390px:
182
+
183
+ - filled and outlined actions are visibly related but distinct;
184
+ - action labels do not become vertical or overflow;
185
+ - metrics and Bento tiles do not collapse into narrow columns;
186
+ - dialogs and native buttons remain contained;
187
+ - focus indicators remain visible around clipped or framed controls;
188
+ - light, dark, contrast, reduced-motion, disabled, busy, and keyboard states remain usable;
189
+ - no page-level horizontal overflow is introduced.
190
+
191
+ If browser access remains blocked by the active browser policy, static and build evidence will be reported separately and rendered acceptance will remain explicitly unverified.
192
+
193
+ ### Final release gate
194
+
195
+ After focused checks and distribution regeneration, run the complete release gate only once at the end:
196
+
197
+ 1. `npm.cmd run release:verify`
198
+ 2. `git diff --check`
199
+ 3. package tarball inspection
200
+ 4. version-surface and generated-size synchronization checks
201
+ 5. final working-tree report
202
+
203
+ ## Acceptance Criteria
204
+
205
+ - All 20 presets have intentional, recognizable, and internally consistent component identities.
206
+ - The `Explore` and `View Usage` actions no longer look like the same generic clipped CTA.
207
+ - The five screenshot regressions are addressed at their underlying library or demo mechanism.
208
+ - Bento metrics remain readable at desktop, tablet, and mobile container widths.
209
+ - Native buttons and dialogs visibly inherit preset identity without losing accessibility.
210
+ - No public API is removed or renamed.
211
+ - Focused tests and the final local release gate pass, with rendered-browser limitations reported honestly.
212
+ - The final handoff remains an uncommitted local 2.3.0 release candidate.
@@ -0,0 +1,113 @@
1
+ # Library-wide Theme Fallback and Fidelity Design
2
+
3
+ ## Status
4
+
5
+ Approved on 2026-09-04. The user selected the shared semantic resolver with preset-owned no-theme fallback palettes.
6
+
7
+ ## Objective
8
+
9
+ Make all 20 public UI presets satisfy one predictable color contract while preserving their reference-specific visual identities:
10
+
11
+ - An explicit `data-theme` owns every visible paint role.
12
+ - Without `data-theme`, each preset supplies an accessible light, dark, or contrast fallback palette derived from its retained design reference.
13
+ - Typography, geometry, density, texture, elevation, and interaction behavior remain preset-owned in every color scheme.
14
+ - Shared native-element, semantic-component, overflow, accessibility, reduced-motion, high-contrast, and forced-colors behavior works with or without `data-theme`.
15
+
16
+ ## Public Contract
17
+
18
+ The supported root states are:
19
+
20
+ ```html
21
+ <body data-ui="minimal-saas" data-mode="light">
22
+ <body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="light">
23
+ <body data-ui="minimal-saas" data-mode="dark">
24
+ <body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="dark">
25
+ <body data-ui="minimal-saas" data-mode="contrast">
26
+ <body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="contrast">
27
+ ```
28
+
29
+ `data-ui` and `data-mode` remain required. `data-theme` becomes optional.
30
+
31
+ ## Color Ownership
32
+
33
+ Each preset resolves its public RGB roles through the same fallback-aware expression:
34
+
35
+ ```css
36
+ --<prefix>-primary-rgb: var(--usk-primary-rgb, var(--<prefix>-fallback-primary-rgb));
37
+ ```
38
+
39
+ The shared theme registry defines `--usk-*` only for explicit theme/mode combinations. Therefore:
40
+
41
+ 1. An explicit theme always wins.
42
+ 2. A missing theme activates the preset fallback.
43
+ 3. Preset component rules consume only resolved prefixed roles or material recipes derived from those roles.
44
+ 4. Direct compatibility aliases remain available where the build and contrast tooling require literal `var(--usk-*-rgb)` declarations.
45
+
46
+ Opaque surfaces, highlights, shadows, grids, ornaments, glass, enamel, paper, clay, metal, terminal cells, and other material paint must derive from resolved semantic channels. Fixed neutral overlays are permitted only for optical lighting or forced-colors interoperability and must not prevent a theme change from visibly recoloring the element.
47
+
48
+ ## Reference Fidelity
49
+
50
+ The retained artifact-template references are authoritative for no-theme fallback identity and for non-color visual construction.
51
+
52
+ | Preset | Reference identity to preserve |
53
+ | --- | --- |
54
+ | Minimal SaaS | restrained indigo actions, thin cool borders, compact radii, calm low-shadow panels |
55
+ | Bento UI | soft mosaic tiles, rounded modular cards, friendly blue actions, pastel feedback |
56
+ | Maximalist | loud collage geometry, heavy display type, layered cut-paper controls, multi-accent feedback |
57
+ | Bauhaus | rigid workshop grid, black rules, primary geometric accents, condensed typography |
58
+ | Tactile | warm paper, dark sidebar, copper action, olive gauges, shallow bevels and recessed tracks |
59
+ | Neumorphism | soft continuous canvas, paired raised/inset shadows, blue controls, rounded molded geometry |
60
+ | Retrofuturism | enamel shells, metallic double keylines, coral actions, teal bays, ringed controls |
61
+ | Brutalism | hard black rules, square controls, blue/yellow/red utility accents, dense condensed type |
62
+ | Cyberpunk | clipped technical frames, cyan/magenta signals, black or pale command surfaces |
63
+ | Y2K | dense window chrome, classic blue selection, square native controls, pixel-era hierarchy |
64
+ | Retro Glass | brushed application chrome, glossy navigation, inset glass panes, striped gauges, dark dock |
65
+ | Editorial Luxe | double rules, Didone display type, forest actions, antique gold, oxblood danger |
66
+ | Organic Modern | warm natural surfaces, olive hairlines, rust alerts, restrained rounded geometry |
67
+ | Industrial Utility | squared metal panels, recessed instruments, amber controls, calibrated safety states |
68
+ | Technical Blueprint | graph-paper grid, cyan or technical-blue linework, square measured controls |
69
+ | Art Deco | symmetrical stepped frames, metallic keylines, teal/gold/oxblood jewel controls |
70
+ | Clay | continuous sculpted slab, shallow seams, mineral pigments, hand-pressed components |
71
+ | Data Terminal | one-pixel cells, monospaced type, strict semantic command colors, bracketed actions |
72
+ | Paper Editorial | physical manual sheet, ruled print grid, cream or ink stock, limited spot colors |
73
+ | Neo Noir | cinematic rules, skewed trapezoids, amber/teal/red/violet signals, film-grain material |
74
+
75
+ For templates containing both light and dark reference panels, both panels define the paired fallback modes. For single-mode references, the dark or light counterpart must preserve the same geometry and semantic hierarchy while using an accessible inverse material treatment. Contrast mode intensifies the same identity rather than becoming a third unrelated design.
76
+
77
+ ## Shared Accessibility Behavior
78
+
79
+ The shared selectors in `native-elements.css`, generated components, and content-overflow coverage must target `[data-ui][data-mode]`, not require `[data-theme]`.
80
+
81
+ Every supported state must retain:
82
+
83
+ - visible `:focus-visible` indicators;
84
+ - readable disabled, read-only, valid, invalid, loading, selected, and indeterminate states;
85
+ - reduced-motion behavior;
86
+ - `prefers-contrast: more` reinforcement;
87
+ - `forced-colors: active` interoperability;
88
+ - native controls that inherit the active preset geometry and resolved semantic paint;
89
+ - semantic `.ui-*` components that match their prefixed counterparts.
90
+
91
+ WCAG contrast gates remain at the repository's existing thresholds. The contrast matrix must cover explicit themes and every no-theme fallback state.
92
+
93
+ ## Implementation Boundaries
94
+
95
+ - Preserve all public preset IDs, prefixes, class names, entrypoints, manifest schema, and cascade layer order.
96
+ - Preserve unrelated dirty working-tree changes.
97
+ - Do not introduce a new runtime dependency or JavaScript theming requirement.
98
+ - Do not create new artwork; retained references and existing real assets remain the visual source.
99
+ - Generated distribution files are updated only through `npm.cmd run build`.
100
+ - No deployment, publication, push, or branch rewrite is part of this work.
101
+
102
+ ## Verification Evidence
103
+
104
+ Completion requires fresh evidence for:
105
+
106
+ 1. Static fallback/theme ownership contracts for all 20 presets and 23 semantic color roles.
107
+ 2. Shared native and semantic coverage with and without `data-theme`.
108
+ 3. WCAG contrast for 1,200 explicit theme states plus 60 fallback states.
109
+ 4. Focus, reduced-motion, `prefers-contrast`, and forced-colors behavior.
110
+ 5. Per-preset computed-style theme switching across representative prefixed, semantic, and native elements.
111
+ 6. Reference-fidelity traits across typography, density, geometry, material, feedback, and data surfaces.
112
+ 7. Regenerated default, visual-only, focused visual, and compatibility bundles.
113
+ 8. Final lint, unit, contrast, compatibility, ownership, package, focused browser, axe, and visual checks.