ui-style-kit-css 2.1.0 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to **UI Style Kit CSS** will be documented here.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ ## [2.2.0] - 2026-08-09
8
+
9
+ ### Added
10
+
11
+ - Added the public 12-token shared semantic producer contract and its machine-readable manifest inventory for companion and third-party consumers.
12
+ - Implemented the manifest-backed semantic component API with 29 exact `.ui-*` selectors, context-constrained `data-ui-variant` values, and unchanged-markup runtime switching across all 11 presets.
13
+ - Added a persistent semantic component demo whose DOM nodes and classes remain stable through every preset switch.
14
+ - Documented native `<dialog>` as the neutral modal/dialog fallback without inventing `.ui-modal` or `.ui-dialog` selectors.
15
+
16
+ ### Changed
17
+
18
+ - Clarified that generated default, visual, with-bridge, and focused entrypoints provide semantic aliases, while raw preset sources, partial extras, and deprecated structural aliases remain prefixed compatibility or advanced APIs.
19
+ - Preserved `.ui-spinner` and `.ui-tooltip` as retained hooks while generating the other 27 selectors from existing preset declarations.
20
+
5
21
  ## [2.1.0] - 2026-07-20
6
22
 
7
23
  ### Added
package/README.md CHANGED
@@ -9,13 +9,13 @@ It is separate from, but complementary to, **Interactive Surface CSS**. Use **UI
9
9
 
10
10
  ## Current Release
11
11
 
12
- `v2.1.0` introduces a visual-only public API, a machine-readable capability manifest, a five-layer build architecture, and a canonical token-only Interactive Surface theme bridge. Existing default and focused entrypoints remain compatible, including their deprecated structural helpers, and parser-based minification remains exactly pinned.
12
+ `v2.2.0` adds the shared 12-token semantic producer contract and a manifest-backed 29-selector `.ui-*` component API across all 11 presets. Existing default and focused entrypoints remain compatible, including their deprecated structural helpers, and parser-based minification remains exactly pinned.
13
13
 
14
14
  [Showcase website](https://foscat.github.io/ui-style-kit-css/)
15
15
 
16
16
  ## How the library fits together
17
17
 
18
- UI Style Kit CSS owns visual identity: themes, component paint, native HTML styling, and the prefixed class API. It can be used alone, or paired with the sibling libraries when a project needs structural layout primitives or richer interaction-state behavior.
18
+ UI Style Kit CSS owns visual identity: themes, semantic `.ui-*` component paint, native HTML styling, and the advanced prefixed class API. It can be used alone, or paired with the sibling libraries when a project needs structural layout primitives or richer interaction-state behavior.
19
19
 
20
20
  ```mermaid
21
21
  flowchart LR
@@ -50,14 +50,18 @@ These libraries stay standalone, but the current aligned set is:
50
50
 
51
51
  | Library | Aligned version | Owns |
52
52
  |---|---:|---|
53
- | `ui-style-kit-css@2.1.0` | staged source target | visual identity, color themes, UI paint, native HTML styling, content wrapping, and bridge tokens |
54
- | `interactive-surface-css@1.5.0` | published release | interaction-state primitives, surface behavior, state layers, and input affordances |
55
- | `layout-style-css@2.1.0` | staged source target | structural wrappers, grids, sections, app shells, and layout recipes |
53
+ | `ui-style-kit-css@2.2.0` | current package version | visual identity, color themes, UI paint, native HTML styling, content wrapping, and bridge tokens |
54
+ | `interactive-surface-css@1.6.0` | published release | interaction-state primitives, surface behavior, state layers, and input affordances |
55
+ | `layout-style-css@3.0.1` | published release | structural wrappers, grids, sections, app shells, and layout recipes |
56
56
 
57
- UI Style Kit `2.1.0` and Layout Style `2.1.0` remain staged source targets until their release approvals complete. Interactive Surface `1.5.0` is the released companion state engine for this upgrade path.
57
+ The current combination is `ui-style-kit-css@2.2.0`, `interactive-surface-css@1.6.0`, and `layout-style-css@3.0.1`. UI Style Kit `2.2.0` is the current package version, and the release pipeline treats it as the active candidate only while that exact npm version is absent. Interactive Surface `1.6.0` and Layout Style `3.0.1` are published releases. The validated minimum remains `ui-style-kit-css@2.1.0`, `interactive-surface-css@1.5.0`, and `layout-style-css@3.0.0`.
58
58
 
59
59
  Use one, two, or all three depending on the project. UI Style Kit does not require the sibling libraries, and the optional bridge only maps shared `--usk-*` roles into Interactive Surface tokens when consumers import it.
60
60
 
61
+ Every UI Style Kit visual or preset entrypoint also publishes a small, fully typed `--ui-*` semantic handshake. These tokens let companion libraries and third-party themes share paint, control geometry, focus, and default motion without depending on preset-specific names. They are optional fallbacks for consumers: package-specific tokens still take precedence, and standalone packages keep their existing legacy and literal defaults when the handshake is absent. See the [token contract](docs/TOKENS.md#shared-semantic-token-handshake) for the exact 12-token inventory.
62
+
63
+ A third-party producer can load its semantic token stylesheet before `interactive-surface-css/standalone-preset.css`. UI Style Kit's visual entrypoints support the same portable composition; keep the canonical theme bridge with `state-core.css` when specialized variant, level, and icon-role mappings are required.
64
+
61
65
  For import order, ownership boundaries, and adoption paths, see the [Ecosystem guide](docs/ECOSYSTEM.md).
62
66
 
63
67
  ## Features
@@ -77,7 +81,7 @@ For import order, ownership boundaries, and adoption paths, see the [Ecosystem g
77
81
  - Visible tooltip classes and native `[role="tooltip"]` styling inside each UI scope
78
82
  - Font-family override variables for body, headings, controls, and mono text
79
83
  - Canonical token-and-paint-only theme bridge for `interactive-surface-css/state-core.css`
80
- - Deprecated stateful bridge exports retained unchanged for backward compatibility
84
+ - Deprecated stateful bridge exports retained for backward compatibility
81
85
  - Reduced-motion, high-contrast, forced-colors, and print support
82
86
  - Cascade-layered CSS for easier consumer overrides
83
87
  - No runtime dependencies
@@ -88,64 +92,67 @@ For import order, ownership boundaries, and adoption paths, see the [Ecosystem g
88
92
  npm install ui-style-kit-css
89
93
  ```
90
94
 
95
+ ### v2 distribution defaults
96
+
97
+ The default bundle remains unchanged for all v2 releases. The root package and canonical `.` export resolve to the readable `dist/ui-style-kit.css`; the canonical `./min.css` export resolves to the minified `dist/ui-style-kit.min.css`. The focused `visual/<preset>.css` entrypoints remain available for applications fixed to one visual system.
98
+
99
+ `ui-style-kit-css/visual.css` is the recommended entrypoint when consumers own layout. Making `visual.css` the package default remains only a v3 proposal; no v2 export is redirected as part of that proposal.
100
+
101
+ The `./css`, `./css.css`, and `./min` exports are redundant deprecated compatibility aliases. They remain available throughout v2 with their existing targets: `./css` and `./css.css` match `.`, while `./min` matches `./min.css`. New integrations should use the canonical exports.
102
+
91
103
  ## Import
92
104
 
93
- Use a single style import for production apps that use one visual system:
105
+ Use the generated default bundle for semantic components that can switch across every preset at runtime:
94
106
 
95
107
  ```js
96
- import "ui-style-kit-css/minimal-saas.css";
108
+ import "ui-style-kit-css";
97
109
  ```
98
110
 
99
- The existing focused entrypoints retain the v2 structural helpers. New integrations that already own layout should use a focused visual-only entrypoint:
111
+ Use `ui-style-kit-css/visual.css` for the same 29-selector semantic runtime API without the deprecated prefixed layout selectors. The generated default, visual, and with-bridge bundles all support all 11 `data-ui` values.
112
+
113
+ Applications fixed to one preset can use a generated focused visual entrypoint. It includes semantic aliases scoped to that preset only:
100
114
 
101
115
  ```js
102
116
  import "ui-style-kit-css/visual/minimal-saas.css";
103
117
  ```
104
118
 
105
- Use `ui-style-kit-css/visual.css` for runtime preset switching without the deprecated prefixed layout selectors. The exact preset, theme, mode, class, and native-part capability matrix is available from `ui-style-kit-css/manifest.json`.
119
+ The exact preset, theme, mode, class, and native-part capability matrix is available from `ui-style-kit-css/manifest.json`.
106
120
 
107
- In `v2.1.0`, legacy standalone style files continue to import the shared color-scheme, native-element fallback, and content-overflow layers. Bundlers that understand CSS `@import` resolve them automatically. If your build pipeline does not resolve CSS imports, import the shared dependencies before the style file:
121
+ ### Advanced prefixed and raw imports
122
+
123
+ The standalone preset exports and longer `styles/*` paths remain advanced compatibility entrypoints. They preserve the prefixed API and do not promise multi-preset semantic switching:
108
124
 
109
125
  ```js
110
- import "ui-style-kit-css/theme-colors.css";
111
- import "ui-style-kit-css/native-elements.css";
112
- import "ui-style-kit-css/content-overflow.css";
113
126
  import "ui-style-kit-css/minimal-saas.css";
127
+ // Equivalent raw source export:
128
+ import "ui-style-kit-css/styles/minimal-saas.css";
114
129
  ```
115
130
 
116
- The longer `styles/*` paths are also exported:
131
+ In `v2.1.0`, legacy standalone style files continue to import the shared color-scheme, native-element fallback, and content-overflow layers. Bundlers that understand CSS `@import` resolve them automatically. If your build pipeline does not resolve CSS imports, import the shared dependencies before the style file:
117
132
 
118
133
  ```js
119
- import "ui-style-kit-css/styles/minimal-saas.css";
120
- import "ui-style-kit-css/styles/cyberpunk.css";
134
+ import "ui-style-kit-css/theme-colors.css";
135
+ import "ui-style-kit-css/native-elements.css";
136
+ import "ui-style-kit-css/content-overflow.css";
137
+ import "ui-style-kit-css/minimal-saas.css";
121
138
  ```
122
139
 
123
- Use the full bundle when users need to switch `data-ui` systems at runtime:
140
+ The explicit distribution path is also available for runtime switching:
124
141
 
125
142
  ```js
126
143
  import "ui-style-kit-css/dist/ui-style-kit.css";
127
144
  ```
128
145
 
129
- For the canonical state-only integration, import visual paint, the token-only theme bridge, and Interactive Surface state mechanics as separate ownership layers:
146
+ For the canonical all-three integration, import visual paint, the token-only theme bridge, Interactive Surface state mechanics, and Layout structure in this order:
130
147
 
131
148
  ```js
132
- import "ui-style-kit-css/visual/minimal-saas.css";
149
+ import "ui-style-kit-css/visual.css";
133
150
  import "ui-style-kit-css/interactive-surface-theme.css";
134
151
  import "interactive-surface-css/state-core.css";
152
+ import "layout-style-css";
135
153
  ```
136
154
 
137
- The older stateful bridge and combined bundle remain available for compatibility, but they are deprecated and have not been redirected to the token-only behavior:
138
-
139
- ```js
140
- import "ui-style-kit-css/with-bridge.css";
141
- ```
142
-
143
- Or import the bridge by itself when you are using a single style file:
144
-
145
- ```js
146
- import "ui-style-kit-css/minimal-saas.css";
147
- import "ui-style-kit-css/interactive-surface-bridge";
148
- ```
155
+ The older stateful bridge and combined bundle remain public, deprecated compatibility paths. See the [bridge migration guide](docs/BRIDGE-MIGRATION.md) when upgrading an existing v2 integration.
149
156
 
150
157
  The default and visual-only bundles do **not** include either bridge. That keeps UI paint independent and prevents accidental duplicate bridge imports.
151
158
 
@@ -155,11 +162,11 @@ When the bridge is attached, add `.interactive-surface` to interactable elements
155
162
 
156
163
  | Import | Raw | Gzip | Best for |
157
164
  |---|---:|---:|---|
158
- | `ui-style-kit-css/dist/ui-style-kit.min.css` | ~299 KB | ~39 KB | Compatible runtime UI-system switchers and demos |
159
- | `ui-style-kit-css/visual.min.css` | ~290 KB | ~38 KB | Runtime visual switching with consumer-owned layout |
160
- | `ui-style-kit-css/with-bridge.css` | ~369 KB | ~44 KB | Deprecated runtime switcher plus stateful bridge |
165
+ | `ui-style-kit-css/dist/ui-style-kit.min.css` | ~357 KB | ~44 KB | Compatible runtime UI-system switchers and demos |
166
+ | `ui-style-kit-css/visual.min.css` | ~348 KB | ~43 KB | Runtime visual switching with consumer-owned layout |
167
+ | `ui-style-kit-css/with-bridge.css` | ~431 KB | ~52 KB | Deprecated runtime switcher plus stateful bridge |
161
168
  | `ui-style-kit-css/theme-colors.css` | ~25 KB | ~3 KB | Shared color schemes for standalone style imports |
162
- | `ui-style-kit-css/native-elements.css` | ~21 KB | ~3 KB | Shared native HTML fallback styling |
169
+ | `ui-style-kit-css/native-elements.css` | ~22 KB | ~4 KB | Shared native HTML fallback styling |
163
170
  | `ui-style-kit-css/content-overflow.css` | ~7 KB | ~1 KB | Shared long-text containment for standalone style imports |
164
171
  | `ui-style-kit-css/interactive-surface-theme.css` | ~8 KB | ~1 KB | Canonical token-and-paint bridge for Interactive Surface state core |
165
172
  | Single style imports | ~26-28 KB | ~5-6 KB | Production apps with one visual system |
@@ -175,22 +182,20 @@ Use the latest published NPM package:
175
182
  For production, pin the exact approved release rather than relying on `latest`:
176
183
 
177
184
  ```html
178
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui-style-kit-css@2.1.0/dist/ui-style-kit.min.css" />
185
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ui-style-kit-css@2.2.0/dist/ui-style-kit.min.css" />
179
186
  ```
180
187
 
181
188
  ## Basic usage
182
189
 
183
190
  ```html
184
191
  <body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="light">
185
- <main class="saas-page">
186
- <section class="saas-container saas-stack">
187
- <article class="saas-card">
188
- <h1 class="saas-title">UI Style Kit CSS</h1>
189
- <p class="saas-subtitle">Switch UI systems, themes, and modes with attributes.</p>
190
- <button class="saas-button saas-button-primary">Primary Action</button>
191
- <span class="saas-spinner" aria-label="Loading"></span>
192
- </article>
193
- </section>
192
+ <main>
193
+ <article class="ui-card">
194
+ <h1>UI Style Kit CSS</h1>
195
+ <p>Switch UI systems, themes, and modes without changing component classes.</p>
196
+ <button class="ui-button" data-ui-variant="primary">Primary Action</button>
197
+ <span class="ui-spinner" role="status" aria-label="Loading"></span>
198
+ </article>
194
199
  </main>
195
200
  </body>
196
201
  ```
@@ -203,6 +208,47 @@ document.body.dataset.theme = "midnight-gold";
203
208
  document.body.dataset.mode = "dark";
204
209
  ```
205
210
 
211
+ This changes the semantic components' visual preset without replacing their DOM nodes or rewriting their `.ui-*` classes.
212
+
213
+ ## Semantic component API
214
+
215
+ `manifest.json#semanticComponentApi` is the authoritative specification for the implemented generic component API. Its 29 selectors keep the same class names while `data-ui` changes across all 11 presets. `implementationStatus` records the two retained `.ui-spinner` and `.ui-tooltip` hooks, the 27 generated semantic aliases, and an empty pending set.
216
+
217
+ | Role | Generic selectors | Switching coverage |
218
+ |---|---|---|
219
+ | Buttons | `.ui-button`, `.ui-icon-button` | all 11 presets |
220
+ | Card | `.ui-card` | all 11 presets |
221
+ | Forms | `.ui-field`, `.ui-label`, `.ui-help-text`, `.ui-input`, `.ui-select`, `.ui-textarea` | all 11 presets |
222
+ | Choice controls | `.ui-check`, `.ui-check-control`, `.ui-radio`, `.ui-radio-control`, `.ui-switch`, `.ui-switch-track`, `.ui-switch-thumb` | all 11 presets |
223
+ | Badge | `.ui-badge` | all 11 presets |
224
+ | Alert | `.ui-alert`, `.ui-alert-title`, `.ui-alert-body` | all 11 presets |
225
+ | Navigation | `.ui-nav`, `.ui-nav-link` | all 11 presets |
226
+ | Table | `.ui-table`, `.ui-table-wrap` | all 11 presets |
227
+ | Progress | `.ui-progress`, `.ui-progress-bar` | all 11 presets |
228
+ | Toolbar | `.ui-toolbar` | all 11 presets |
229
+ | Existing generic hooks | `.ui-spinner`, `.ui-tooltip` | all 11 presets |
230
+
231
+ The only new attribute is context-constrained `data-ui-variant`. Omit it for the neutral treatment.
232
+
233
+ | Selector | `data-ui-variant` values |
234
+ |---|---|
235
+ | `.ui-button` | `primary`, `secondary`, `danger`, `ghost` |
236
+ | `.ui-badge` | `primary`, `secondary`, `success`, `warning`, `danger` |
237
+ | `.ui-alert` | `success`, `warning`, `danger` |
238
+
239
+ ```html
240
+ <body data-ui="minimal-saas" data-theme="arctic-indigo" data-mode="light">
241
+ <button class="ui-button" data-ui-variant="primary">Save</button>
242
+ <article class="ui-card">...</article>
243
+ </body>
244
+ ```
245
+
246
+ Modal and dialog roles deliberately use a neutral native `<dialog>` fallback. There is no `.ui-modal` or `.ui-dialog` selector. The semantic API also does not define `data-ui-state`, `data-ui-size`, or `data-ui-placement`; continue to use native and ARIA state hooks, `.is-active`, and `[data-ui-tooltip-anchor]` where supported.
247
+
248
+ Preset-prefixed classes remain supported compatibility and advanced APIs. Partial preset extras, typography and paint utilities, surface/size/placement helpers, shape and accessibility utilities, and the deprecated `page`, `container`, `section`, `grid`, `stack`, `cluster`, and `split` structural aliases remain prefix-bound rather than entering the generic contract.
249
+
250
+ For example, a fixed Minimal SaaS integration may continue to use `<button class="saas-button saas-button-primary">`. Prefer `.ui-button` plus `data-ui-variant="primary"` when markup must survive runtime preset changes.
251
+
206
252
  ## UI systems
207
253
 
208
254
  | UI style | `data-ui` | Class prefix | Best for |
package/STYLE-MAP.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # UI Style Kit CSS Style Map
2
2
 
3
+ ## Recommended runtime API
4
+
5
+ Lead with stable semantic classes when an interface can switch visual presets:
6
+
7
+ ```html
8
+ <article class="ui-card">
9
+ <button class="ui-button" data-ui-variant="primary">Continue</button>
10
+ <span class="ui-badge" data-ui-variant="success">Ready</span>
11
+ </article>
12
+ ```
13
+
14
+ Changing only the ancestor `data-ui` value restyles that markup across all 11 presets in the generated default, visual, and with-bridge bundles. A generated `visual/<preset>.css` focused entrypoint supplies the same semantic aliases for its selected preset only. Raw `styles/*` and standalone preset exports remain advanced prefixed APIs and do not promise multi-preset semantic switching.
15
+
3
16
  ## UI systems
4
17
 
5
18
  Color schemes are defined once in `styles/theme-colors.css`. Native HTML fallback selectors are defined once in `styles/native-elements.css`. Long-text containment rules are defined once in `styles/content-overflow.css`. Each UI system file imports all shared layers, aliases `--usk-*` RGB roles back to its prefix, and maps `--usk-native-*` tokens into the preset's visual identity.
@@ -66,3 +79,26 @@ The bridge inherits from shared `--usk-*` color roles, then applies `.interactiv
66
79
  - `light`
67
80
  - `dark`
68
81
  - `contrast`
82
+
83
+ ## Semantic component contract
84
+
85
+ The machine-readable source of truth is `manifest.json#semanticComponentApi`. Its 29 implemented generic selectors map only to source suffixes with 11-of-11 composed preset coverage. The `implementationStatus` section records `.ui-spinner` and `.ui-tooltip` as retained hooks, the other 27 selectors as generated aliases, and no pending selectors.
86
+
87
+ | Role | Generic selector -> current source suffix |
88
+ |---|---|
89
+ | Button | `.ui-button` -> `button`; `.ui-icon-button` -> `icon-button` |
90
+ | Card | `.ui-card` -> `card` |
91
+ | Form | `.ui-field` -> `field`; `.ui-label` -> `label`; `.ui-help-text` -> `help-text`; `.ui-input` -> `input`; `.ui-select` -> `select`; `.ui-textarea` -> `textarea` |
92
+ | Choice control | `.ui-check` -> `check`; `.ui-check-control` -> `check-control`; `.ui-radio` -> `radio`; `.ui-radio-control` -> `radio-control`; `.ui-switch` -> `switch`; `.ui-switch-track` -> `switch-track`; `.ui-switch-thumb` -> `switch-thumb` |
93
+ | Badge | `.ui-badge` -> `badge` |
94
+ | Alert | `.ui-alert` -> `alert`; `.ui-alert-title` -> `alert-title`; `.ui-alert-body` -> `alert-body` |
95
+ | Navigation | `.ui-nav` -> `nav`; `.ui-nav-link` -> `nav-link` |
96
+ | Table | `.ui-table` -> `table`; `.ui-table-wrap` -> `table-wrap` |
97
+ | Progress | `.ui-progress` -> `progress`; `.ui-progress-bar` -> `progress-bar` |
98
+ | Toolbar | `.ui-toolbar` -> `toolbar` |
99
+ | Loading | `.ui-spinner` -> `spinner` |
100
+ | Tooltip | `.ui-tooltip` -> `tooltip` |
101
+
102
+ `data-ui-variant` is the only new attribute. Omission means neutral. `.ui-button` accepts `primary`, `secondary`, `danger`, and `ghost`; `.ui-badge` accepts `primary`, `secondary`, `success`, `warning`, and `danger`; `.ui-alert` accepts `success`, `warning`, and `danger`.
103
+
104
+ Modal and dialog roles retain native `<dialog>` as their one neutral fallback; `.ui-modal` and `.ui-dialog` are not defined. Preset-prefixed classes remain supported for compatibility and advanced use. Partial preset extras and the seven deprecated structural suffixes stay out of the semantic contract.