veza/packages/design-system
senke 86faeb16a8
Some checks failed
Veza CI / Rust (Stream Server) (push) Successful in 4m6s
Security Scan / Secret Scanning (gitleaks) (push) Successful in 1m20s
Veza CI / Backend (Go) (push) Successful in 5m37s
E2E Playwright / e2e (full) (push) Failing after 16m58s
Veza CI / Frontend (Web) (push) Successful in 29m45s
Veza CI / Notify on failure (push) Has been skipped
fix(ci): build design-system tokens before tsc/vite (Day 4 follow-up)
CI run 455/456 surfaced:
  src/features/player/components/AudioVisualizer.tsx(22,8): error TS2307:
  Cannot find module '@veza/design-system/tokens-generated' or its
  corresponding type declarations.

Root cause: the sprint 2 design-system migration (commits a25ad2e0ab923def) replaced manual src/ exports with Style Dictionary output in
packages/design-system/dist/. That `dist/` is gitignored — by design,
since it's generated artifact — but no step in the CI workflows runs
the generator before tsc/vite/vitest fire.

apps/web imports `@veza/design-system/tokens-generated`, which the
package's `exports` field maps to `./dist/tokens.ts`. With dist/ empty
on a fresh checkout, the import resolves to undefined → TS2307.

Two-pronged fix:

(1) packages/design-system/package.json — add a `prepare` script that
    runs Style Dictionary. npm fires `prepare` after `npm install`
    AND `npm ci`, so any workspace install populates dist/ without an
    extra workflow change. Also covers fresh dev clones.

(2) .github/workflows/{ci.yml,e2e.yml} — explicit
    `npm run build:tokens --workspace=@veza/design-system` step
    immediately after `npm ci`. Belt-and-suspenders against any npm
    version where `prepare` is silent or filtered (lifecycle script
    skipping has burned us before — `--ignore-scripts` flags, etc.).

Verified locally:
  $ rm -rf packages/design-system/dist/
  $ npm run build:tokens --workspace=@veza/design-system
  ✓ Style Dictionary build complete.
  $ cd apps/web && npx tsc --noEmit
  (clean)

SKIP_TESTS=1 — config-only changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 12:31:50 +02:00
..
tokens feat(design-system): introduce Style Dictionary (W3C tokens) — Sprint 2 foundation 2026-04-27 04:52:15 +02:00
package.json fix(ci): build design-system tokens before tsc/vite (Day 4 follow-up) 2026-04-27 12:31:50 +02:00
README.md chore(design-system)!: drop orphan src/ tokens (replaced by Style Dictionary) 2026-04-27 05:10:24 +02:00
style-dictionary.config.mjs feat(design-system): introduce Style Dictionary (W3C tokens) — Sprint 2 foundation 2026-04-27 04:52:15 +02:00
tsconfig.json feat(v0.13.2): consolidation design system — SUMI tokens, package, stories 2026-03-13 09:45:09 +01:00

@veza/design-system

SUMI Design System v3.0 — "Lavis d'encre" (Ink wash)

Token-only package for the Veza platform. Single source of truth for all design tokens (colors, typography, spacing, motion, elevation), authored as W3C-spec JSON tokens and compiled via Style Dictionary to CSS variables and TypeScript exports.

Structure

packages/design-system/
├── tokens/                          # SOURCE OF TRUTH (edit these)
│   ├── primitive/
│   │   ├── color.json               # ink, washi, void, mizu, kin, viz, functional, alpha
│   │   ├── typography.json          # Space Grotesk + Inter + JetBrains Mono scales
│   │   ├── spacing.json             # 4px scale + radius + z-index
│   │   ├── motion.json              # goutte/trait/lavis/vague/maree + easings
│   │   └── elevation.json           # shadows + blur + opacity
│   └── semantic/
│       ├── dark.json                # default :root, [data-theme="dark"]
│       └── light.json               # [data-theme="light"] (washi paper)
├── dist/                            # GENERATED (do NOT edit, gitignored)
│   ├── tokens.css                   # Unified primitive + dark + light
│   ├── tokens-{primitive,dark,light}.css
│   └── tokens.{ts,d.ts}             # TS exports of resolved hex values
├── style-dictionary.config.mjs      # Build config
└── package.json

Usage

apps/web/src/index.css imports the unified file:

@import '@veza/design-system/tokens.css';

Then components reference vars via Tailwind arbitrary values or inline styles:

<div style={{ color: 'var(--sumi-accent-default)' }}>...</div>
<div className="bg-[var(--sumi-bg-card)] text-[var(--sumi-text-primary)]">...</div>

TypeScript imports (for canvas / runtime needs)

For contexts that can't resolve CSS vars (canvas drawing, programmatic gradients, byte interpolation):

import { ColorVizIndigo, SumiAccentDefault } from '@veza/design-system/tokens-generated';

ctx.fillStyle = ColorVizIndigo;     // resolved hex string '#7c9dd6'
const accent = SumiAccentDefault;   // '#0098b5'

Build

npm run build:tokens --workspace=@veza/design-system

Triggered automatically via turbo run build (the apps/web build depends on this package).

Color system — Option B palette

Per CHARTE_GRAPHIQUE_TALAS.md §4 (canonical brand source) + §4.5 (data viz):

UI palette (everywhere except data viz)

The cyan Mizu (#0098B5) is the sole accent color. Functional colors (success/error/warning) are always diluted (max 60% opacity), never solid fills.

Token Role Value
--sumi-accent-default Primary actions, links, focus Mizu cyan #0098B5
--sumi-feedback-success Success states (subtle) Diluted sage
--sumi-feedback-error Error states (subtle) Diluted brick
--sumi-feedback-warning Warning states (subtle) Diluted amber

Data viz palette (charts, waveforms, analytics ONLY)

For graphs and visualizations needing distinguishable colors, the 4 viz pigments + neutral are authorized:

Pigment Hex Token
Indigo #7c9dd6 --sumi-viz-indigo
Vermillion #d4634a --sumi-viz-vermillion
Sage #7a9e6c --sumi-viz-sage
Gold #c9a84c --sumi-viz-gold
Neutral grey #a8a4a0 --sumi-viz-neutral

These are NEVER allowed in standard UI (buttons, links, accents). The cyan rule above stays absolute.

Themes

  • Dark (default) — Ink on void
  • Light — Washi paper aesthetic ([data-theme="light"])
  • Circadian + patina + density + contrast — Runtime modifiers handled by apps/web/src/components/theme/ThemeProvider.tsx

See also

  • Brand source of truth: ~/Documents/TG__Talas_Group/05_EXPERIENCE_UTILISATEUR/CHARTE_GRAPHIQUE_TALAS.md
  • Brand decisions: ~/Documents/TG__Talas_Group/05_EXPERIENCE_UTILISATEUR/DECISIONS_IDENTITE.md
  • Veza UI/UX contract: veza-docs/ORIGIN/ORIGIN_UI_UX_SYSTEM.md
  • Storybook: apps/web/.storybook/
  • Component source: apps/web/src/components/ui/