← Tous les modèles

Tokens d’abord, chaque composant documenté, tests de régression visuelle à chaque changement.

Constitution — Design system library

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Tokens first. Colors, spacing, type, radius and motion are design tokens generated from one source into CSS custom properties. A hard-coded hex color or pixel value in a component fails the lint.

  2. Every component documented. Each component has Storybook stories for every variant and state, with autodocs and usage notes. A component is not exported until it has its stories.

  3. Visual regression on each change. Every story is captured in a Chromatic-style visual test on every pull request. A visual diff that nobody approved blocks the merge.

  4. Accessible components. Interactive components follow the WAI-ARIA Authoring Practices for keyboard and roles. The Storybook a11y addon reports zero violations in the light and dark themes.

  5. Stable public API. Releases follow semver with a changeset. A breaking prop change is a major version with a migration note, and a deprecated prop warns for at least one minor version before it is removed.

  6. Composable building blocks. Components forward refs, accept className and are built on headless primitives. No component adds outer margins that fight the layout around it.

  7. Small and tree-shakable. The package ships ESM with sideEffects declared, so unused components drop out. size-limit checks the size of each component in CI and fails above its budget.