@sondalab/ui-kit 0.2.0 → 0.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.
@@ -0,0 +1,33 @@
1
+ # Workflow — Author a new Sondalab surface
2
+
3
+ > **What this file is:** the ordered procedure an agent follows to author a *new* interface or element that is Sondalab-compliant from the first line, using the component catalog. Companion to `migrate.md` (which brings an *existing* surface into compliance).
4
+ > **Reads:** `catalog.md` + `catalog.json` (components), `../design-language.md` (grammar), the token CSS (`../../tokens.css` + `../../themes/*.css`, the values), `substrate-matrix.json` (what's Required for the substrate), `sl-audit` (verdict).
5
+ > **Invariant:** authoring is greenfield, so the audit should pass on the *first* run — compliance is built in, not retrofitted. If your first audit is dirty, you bound a colour to a literal instead of a role-var.
6
+
7
+ ## Steps
8
+
9
+ ### 0 — Classify substrate
10
+ Decide the substrate (**IDE** / **App** / **Page** / **Term**) and the product (for its accent). The substrate's Required column in `substrate-matrix.json` is your checklist of what this surface must have.
11
+
12
+ ### 1 — Choose components from the catalog
13
+ For each part of the screen, pick the matching entry from `catalog.md`. Prefer the ready primitives (`sl-*` classes) over hand-rolled markup; reach for the signature patterns (sticky header, inversion band, hairline grid, section index, oversized anchor) to carry the family look. `catalog.json` is the machine index if you need to list what exists.
14
+
15
+ ### 2 — Compose (spend the surprise here)
16
+ Assemble the components into a layout. Family resemblance comes from the shared materials (the catalog); distinctiveness comes from composition — every screen needs **≥1 unexpected, intentional layout decision** (an asymmetric split, an oversized anchor, a full-bleed inversion). A generic centred card grid fails the house rule; a second accent or a new type scale fails the grammar. Spend boldness on layout, keep materials shared.
17
+
18
+ ### 3 — Bind role-vars per tier
19
+ - **Tier A** (greenfield is the common case): consume `@sondalab/ui-kit` `components.css` + a theme (`themes/*.css`) under `data-sl-theme`. Components resolve their `--slc-*` role-vars automatically.
20
+ - **Tier B** (you have an existing colour layer): map each `--slc-*` role-var to a value that resolves to a Sondalab token or your registered accent. Never bind a component to a literal.
21
+
22
+ ### 4 — Audit + judgement pass
23
+ Run the audit (must be clean on greenfield):
24
+ ```sh
25
+ npx sl-audit --surface "<glob>" --product <name>
26
+ ```
27
+ Then the judgement pass the script can't do (delegate to `sl-ds-auditor` or do it yourself against `design-language.md`, scoped to the substrate's Required rules): are the structural mono labels present (eyebrow, section index)? Is there real content, not filler? Is the editorial voice precise/active (L5)? See `HANDOFF.md` for what is judgement vs mechanical.
28
+
29
+ ### 5 — Visual check
30
+ Render across the applicable themes (light / dark / high-contrast); verify reduced-motion and that active/pressed states show the accent, not a neutral.
31
+
32
+ ## Output
33
+ A new surface that passes `sl-audit` clean, satisfies its substrate's Required rules, and reads as Sondalab through the shared components — with its one intentional composition surprise.
@@ -0,0 +1,45 @@
1
+ # Workflow — Migrate a surface onto the Sondalab DS
2
+
3
+ > **What this file is:** the ordered, harness-agnostic procedure an agent follows to migrate an existing app's UI onto the Sondalab design system. It is the portable core; the Claude Code `sl-migrate` skill loads and executes it. Any other harness can follow it directly.
4
+ > **Reads:** `../design-language.md` (grammar), the token CSS (`../../tokens.css` + `../../themes/*.css`, the values), the agent core (`accent-registry.json`, `substrate-matrix.json`, `blessed/<product>.json`), `sl-audit` (verdict engine).
5
+ > **Invariant:** migrating a live surface is semi-irreversible. Work on a branch; do not edit before the human approves the mapping plan (Step 3 gate).
6
+
7
+ ## Division of labour (do not blur)
8
+
9
+ - **`sl-audit.mjs`** — the mechanical verdict: colour value-equality and tier consistency, decidable from CSS text. Trust it for those; never re-derive them by eye.
10
+ - **You (the agent)** — the judgement: is a structural label *missing*, is the editorial voice off, is an inversion band warranted, does the composition earn its "one unexpected decision". The audit cannot see these; you read `design-language.md` and decide.
11
+ - **The human** — approves the blessed list (Step 2) and the mapping plan (Step 3). Applies nothing without that yes.
12
+
13
+ ## Steps
14
+
15
+ ### 0 — Classify substrate
16
+ Determine the product name and its substrate: **IDE** (fixed-chrome host), **App** (data-grid web app), **Page** (marketing/landing), **Term** (terminal). Read it from `substrate-matrix.json` `products` if listed, else infer. The substrate selects which rules are Required vs Adapt vs N/A — skip this and you will, e.g., propose a sticky translucent header for a Theia panel the matrix marks N/A.
17
+
18
+ ### 1 — Baseline audit
19
+ Create a branch. Run the audit, no edits:
20
+ ```sh
21
+ npx sl-audit --surface "<glob>" --product <name> --substrate <IDE|App|Page|Term>
22
+ ```
23
+ Record the grouped baseline (R-violation / A-deviation / N/A counts). This is the before-picture the final report is measured against.
24
+
25
+ ### 2 — Separate blessed deviations from defects · GATE
26
+ `design-language.md` authorizes colours that fail literal value-equality: accent-derived hover/active/subtle tints, locally-derived on-ink status pairs, alpha-on-canvas hairlines. For each finding decide:
27
+ - **Blessed** → add an entry to `blessed/<product>.json` with a `why` that cites the authorizing `design-language.md` rule. It silences the finding *and* records the intentional deviation.
28
+ - **Defect** → keep it on the list to fix in Step 3.
29
+
30
+ An accent-derivation swamp (many tints off the product's single accent) is the common case for Tier-B products; bless the derivations as a group rather than mapping each to a token. **Present the blessed list and wait for the human's confirmation before continuing.**
31
+
32
+ ### 3 — Propose the mapping plan · GATE
33
+ For each remaining R-violation, map the free-floating value to an `--sl-*` role or the product's accent-registry value. Add your judgement-level findings (missing mono labels, hairline structure, section index, editorial voice) scoped to the substrate's Required rules. Present the plan **in chat**: the value→token mapping plus the concrete edits. **Stop. Apply nothing until the human says yes.**
34
+
35
+ ### 4 — Apply
36
+ After approval, edit per the product's tier (A: consume the theme layer; B: keep the local colour layer but pin every value to a Sondalab value). Small, rollback-friendly chunks.
37
+
38
+ ### 5 — Re-audit and diff
39
+ Re-run the audit. R-violations must reach 0 or be blessed. Produce a before/after report (baseline counts vs current).
40
+
41
+ ### 6 — Visual check
42
+ Render the surface across the applicable themes (light / dark / high-contrast). Verify reduced-motion. Check the dark-invert hairline regression explicitly: alpha-on-canvas rules (`--rule` style) can go invisible inside an inverted block — confirm they remain visible.
43
+
44
+ ## Output
45
+ A compliant surface + the before/after compliance report + a populated `blessed/<product>.json` + the CSS diff, all on the branch for review.
package/components.css CHANGED
@@ -24,9 +24,12 @@
24
24
  :root {
25
25
  /* accent */
26
26
  --slc-accent: var(--sl-accent-default, #B56A0C);
27
- --slc-accent-hover: var(--sl-accent-hover, #A05F0A);
28
- --slc-accent-active: var(--sl-accent-active, #8A5109);
29
- --slc-accent-subtle: var(--sl-accent-subtle, rgba(197,122,22,0.12));
27
+ /* Steps derive from --slc-accent so a bare --sl-accent-default override
28
+ (or a Tier-B product that maps only --slc-accent) re-derives the whole
29
+ family — no amber leak. The theme layer still wins when it sets the step. */
30
+ --slc-accent-hover: var(--sl-accent-hover, color-mix(in srgb, var(--slc-accent) 89%, black));
31
+ --slc-accent-active: var(--sl-accent-active, color-mix(in srgb, var(--slc-accent) 76%, black));
32
+ --slc-accent-subtle: var(--sl-accent-subtle, color-mix(in srgb, var(--slc-accent) 12%, transparent));
30
33
  --slc-on-accent: var(--sl-text-on-accent, #FFFFFF);
31
34
  /* surfaces + text */
32
35
  --slc-surface: var(--sl-bg-surface, #F6F1E6);
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@sondalab/ui-kit",
3
- "version": "0.2.0",
4
- "description": "Sondalab design tokens as CSS custom properties: shared grammar + per-product accent, with light / dark / high-contrast themes.",
3
+ "version": "0.4.0",
4
+ "description": "Sondalab design tokens as CSS custom properties + the agentic core: component catalog, compliance audit (sl-audit), and author/migrate/adopt workflows.",
5
5
  "license": "MIT",
6
6
  "author": "marcellobarile",
7
7
  "publishConfig": { "access": "public" },
8
8
  "type": "module",
9
+ "bin": {
10
+ "sl-audit": "./agent/sl-audit.mjs"
11
+ },
9
12
  "exports": {
10
13
  "./tokens.css": "./tokens.css",
11
14
  "./components.css": "./components.css",
@@ -15,7 +18,12 @@
15
18
  "./assets/wordmark.svg": "./assets/sondalab-wordmark.svg",
16
19
  "./assets/lockup.svg": "./assets/sondalab-lockup.svg",
17
20
  "./assets/favicon.svg": "./assets/favicon.svg",
18
- "./assets/app-icon.svg": "./assets/app-icon.svg"
21
+ "./assets/app-icon.svg": "./assets/app-icon.svg",
22
+ "./agent/sl-audit.mjs": "./agent/sl-audit.mjs",
23
+ "./agent/catalog.json": "./agent/catalog.json",
24
+ "./agent/accent-registry.json": "./agent/accent-registry.json",
25
+ "./agent/substrate-matrix.json": "./agent/substrate-matrix.json",
26
+ "./agent/*": "./agent/*"
19
27
  },
20
28
  "files": [
21
29
  "tokens.css",
@@ -28,6 +36,7 @@
28
36
  "assets/favicon.svg",
29
37
  "assets/app-icon.svg",
30
38
  "assets/README.md",
31
- "README.md"
39
+ "README.md",
40
+ "agent/"
32
41
  ]
33
42
  }
package/themes/dark.css CHANGED
@@ -16,9 +16,9 @@
16
16
  --sl-status-danger: #f87171;
17
17
  --sl-status-info: #38bdf8;
18
18
  --sl-accent-default: #F5A83C;
19
- --sl-accent-hover: #F7B863;
19
+ --sl-accent-hover: color-mix(in srgb, var(--sl-accent-default) 80%, white);
20
20
  --sl-accent-active: #E0942A;
21
- --sl-accent-subtle: rgba(245,168,60,0.16);
21
+ --sl-accent-subtle: color-mix(in srgb, var(--sl-accent-default) 16%, transparent);
22
22
  --sl-accent-depth: #35A0B4;
23
23
  --sl-focus-ring: #F5A83C;
24
24
  }
@@ -16,8 +16,8 @@
16
16
  --sl-status-danger: #ff5555;
17
17
  --sl-status-info: #00ffff;
18
18
  --sl-accent-default: #ffff00;
19
- --sl-accent-hover: #ffffa0;
20
- --sl-accent-active: #cccc00;
19
+ --sl-accent-hover: color-mix(in srgb, var(--sl-accent-default) 37%, white);
20
+ --sl-accent-active: color-mix(in srgb, var(--sl-accent-default) 80%, black);
21
21
  --sl-accent-subtle: #1a1a00;
22
22
  --sl-accent-depth: #00ffff;
23
23
  --sl-focus-ring: #ffff00;
package/themes/light.css CHANGED
@@ -16,8 +16,8 @@
16
16
  --sl-status-danger: #dc2626;
17
17
  --sl-status-info: #0284c7;
18
18
  --sl-accent-default: #B56A0C;
19
- --sl-accent-hover: #A05F0A;
20
- --sl-accent-active: #8A5109;
19
+ --sl-accent-hover: color-mix(in srgb, var(--sl-accent-default) 89%, black);
20
+ --sl-accent-active: color-mix(in srgb, var(--sl-accent-default) 76%, black);
21
21
  --sl-accent-subtle: rgba(197,122,22,0.12);
22
22
  --sl-accent-depth: #14606C;
23
23
  --sl-focus-ring: #B56A0C;