Tokens primeiro, cada componente documentado, testes de regressão visual a cada mudança.
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Composable building blocks. Components forward refs, accept
classNameand are built on headless primitives. No component adds outer margins that fight the layout around it. -
Small and tree-shakable. The package ships ESM with
sideEffectsdeclared, so unused components drop out. size-limit checks the size of each component in CI and fails above its budget.