diff --git a/scratch/design-kit/README.md b/scratch/design-kit/README.md new file mode 100644 index 0000000..7dd8d18 --- /dev/null +++ b/scratch/design-kit/README.md @@ -0,0 +1,55 @@ +# Design kit + +Preview cards for the Codex design system, built for syncing into a Claude +Design (claude.ai/design) design-system project so design sessions work from +the real system instead of a description. + +Each `*.html` file is one card: a self-contained page that renders a +canonical primitive in all three themes (dark, light, warm) side by side, +using the real CSS. The first line of each file is a `@dsCard` marker with +the card's group; the Design System pane uses it to build its index. + +## Ground rules + +- `styles/` is a symlink to `src/lib/styles/`. The kit has no CSS of its + own beyond per-card scaffolding; the shipped stylesheets are the single + source of truth, and the cards always render whatever is currently + shipped. +- Cards show only the canonical primitives named in + `scratch/system-design/design-system.md`. Legacy skins (the extra button + and menu systems listed in that sheet's drift section) stay out, so + design sessions never learn them. +- Markup in the cards mirrors real call sites in `src/lib/components/` and + `src/routes/`. When a primitive's markup changes in the app, update its + card. +- Fonts: the app loads Hanken Grotesk, Spectral, and JetBrains Mono via + fontsource. The kit does not, so previews fall back to the system stacks + declared in the tokens. Shapes and colours are accurate; letterforms are + approximate. + +## Viewing locally + +Open any card straight from this directory in a browser; the symlink makes +the shipped CSS resolve. No build step. + +## Syncing to Claude Design + +Use the DesignSync tool from a Claude Code session (it needs the user +present to approve the plan): + +1. `list_projects`, or `create_project` the first time. +2. `finalize_plan` with writes for `styles/*.css`, `*.html`, `kit.css`, + and `kit.js`, with this directory as `localDir`. +3. `write_files` uploading the stylesheets into the project's `styles/` + and the cards plus the two kit scaffold files at the project root. The + symlink means `localPath: styles/tokens.css` resolves to the shipped + file. + +Re-run the sync whenever a primitive or token changes. The sync is one-way, +repo to project; never edit the system inside the project. + +## Cards + +Foundations: `colors.html`, `type.html`, `spacing.html`. +Components: `buttons.html`, `forms.html`, `menus.html`, `badges.html`, +`seg.html`, `cards.html`, `empty-states.html`. diff --git a/scratch/design-kit/badges.html b/scratch/design-kit/badges.html new file mode 100644 index 0000000..a74802c --- /dev/null +++ b/scratch/design-kit/badges.html @@ -0,0 +1,49 @@ + + + + + + Badges, chips, pills + + + + + + +
+ + + + diff --git a/scratch/design-kit/buttons.html b/scratch/design-kit/buttons.html new file mode 100644 index 0000000..f12f3ab --- /dev/null +++ b/scratch/design-kit/buttons.html @@ -0,0 +1,61 @@ + + + + + + Buttons + + + + + + +
+ + + + diff --git a/scratch/design-kit/cards.html b/scratch/design-kit/cards.html new file mode 100644 index 0000000..2d12a27 --- /dev/null +++ b/scratch/design-kit/cards.html @@ -0,0 +1,68 @@ + + + + + + Cards + + + + + + + + +
+ + + + diff --git a/scratch/design-kit/colors.html b/scratch/design-kit/colors.html new file mode 100644 index 0000000..021cb00 --- /dev/null +++ b/scratch/design-kit/colors.html @@ -0,0 +1,98 @@ + + + + + + Colors + + + + + +
+ + + + diff --git a/scratch/design-kit/empty-states.html b/scratch/design-kit/empty-states.html new file mode 100644 index 0000000..512ad17 --- /dev/null +++ b/scratch/design-kit/empty-states.html @@ -0,0 +1,35 @@ + + + + + + Empty states + + + + + + +
+ + + + diff --git a/scratch/design-kit/forms.html b/scratch/design-kit/forms.html new file mode 100644 index 0000000..f3cdd80 --- /dev/null +++ b/scratch/design-kit/forms.html @@ -0,0 +1,57 @@ + + + + + + Forms + + + + + + +
+ + + + diff --git a/scratch/design-kit/kit.css b/scratch/design-kit/kit.css new file mode 100644 index 0000000..c84342f --- /dev/null +++ b/scratch/design-kit/kit.css @@ -0,0 +1,46 @@ +/* Card scaffold shared by every preview. The system CSS comes from + styles/; this file only lays out the three theme panes. */ +body { + margin: 0; +} +.themes { + display: grid; + grid-template-columns: repeat(3, 1fr); + min-height: 100vh; +} +.pane { + background: var(--bg); + color: var(--text); + padding: 24px; + font-family: var(--font-ui); +} +.pane-label { + font-size: 11px; + letter-spacing: 0.08em; + text-transform: uppercase; + color: var(--text-faint); + margin-bottom: 18px; +} +.row { + display: flex; + gap: 10px; + align-items: center; + flex-wrap: wrap; + margin-bottom: 14px; +} +.note { + font-size: 12px; + color: var(--text-muted); + margin-top: 16px; + max-width: 34em; +} +.kit-h { + font-size: 11px; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--text-faint); + margin: 18px 0 8px; +} +.kit-h:first-child { + margin-top: 0; +} diff --git a/scratch/design-kit/kit.js b/scratch/design-kit/kit.js new file mode 100644 index 0000000..28d62e5 --- /dev/null +++ b/scratch/design-kit/kit.js @@ -0,0 +1,13 @@ +// Clones the card's sample template into one pane per theme. +const tpl = document.getElementById('sample'); +const themes = document.getElementById('themes'); +for (const theme of ['dark', 'light', 'warm']) { + const pane = document.createElement('div'); + pane.className = 'pane'; + pane.dataset.theme = theme; + const label = document.createElement('div'); + label.className = 'pane-label'; + label.textContent = theme; + pane.append(label, tpl.content.cloneNode(true)); + themes.append(pane); +} diff --git a/scratch/design-kit/menus.html b/scratch/design-kit/menus.html new file mode 100644 index 0000000..91f9631 --- /dev/null +++ b/scratch/design-kit/menus.html @@ -0,0 +1,36 @@ + + + + + + Menus + + + + + + + +
+ + + + diff --git a/scratch/design-kit/seg.html b/scratch/design-kit/seg.html new file mode 100644 index 0000000..2c58f8d --- /dev/null +++ b/scratch/design-kit/seg.html @@ -0,0 +1,39 @@ + + + + + + Segmented strip + + + + + + +
+ + + + diff --git a/scratch/design-kit/spacing.html b/scratch/design-kit/spacing.html new file mode 100644 index 0000000..fd56e7c --- /dev/null +++ b/scratch/design-kit/spacing.html @@ -0,0 +1,63 @@ + + + + + + Spacing and radii + + + + + +
+ + + + diff --git a/scratch/design-kit/styles b/scratch/design-kit/styles new file mode 120000 index 0000000..5a65bf7 --- /dev/null +++ b/scratch/design-kit/styles @@ -0,0 +1 @@ +../../src/lib/styles \ No newline at end of file diff --git a/scratch/design-kit/type.html b/scratch/design-kit/type.html new file mode 100644 index 0000000..6017fcb --- /dev/null +++ b/scratch/design-kit/type.html @@ -0,0 +1,57 @@ + + + + + + Type + + + + + +
+ + + +