@reqvire-org/ads 0.3.45 → 0.3.46

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.
Files changed (98) hide show
  1. package/README.md +3 -1
  2. package/dist/a11y.mjs +100 -0
  3. package/dist/assets.mjs +25 -1
  4. package/dist/capture/worker.mjs +1 -1
  5. package/dist/capture-store.mjs +2 -1
  6. package/dist/capture.mjs +5 -2
  7. package/dist/check.mjs +2 -1
  8. package/dist/cli.mjs +12 -0
  9. package/dist/config.mjs +3 -0
  10. package/dist/contracts/tokens.json +1 -1
  11. package/dist/design-values.mjs +8 -2
  12. package/dist/foundation.mjs +3 -0
  13. package/dist/mcp/apps.mjs +1 -1
  14. package/dist/mcp/preview-widget.bundle.js +19 -13
  15. package/dist/mcp/project-widget.bundle.js +25 -25
  16. package/dist/mcp/server.mjs +3 -1
  17. package/dist/mcp/widget.bundle.js +15 -15
  18. package/dist/preview-resources.mjs +1 -1
  19. package/dist/showcase/client.bundle.js +25 -25
  20. package/dist/showcase/index.html +1 -1
  21. package/dist/skills/ads-break-ui/references/captures.md +3 -2
  22. package/dist/skills/ads-break-ui/references/design-data.md +89 -0
  23. package/dist/skills/ads-designer/SKILL.md +13 -3
  24. package/dist/skills/ads-designer/references/accessibility.md +43 -0
  25. package/dist/skills/ads-designer/references/branding.md +28 -0
  26. package/dist/skills/ads-designer/references/captures.md +3 -2
  27. package/dist/skills/ads-designer/references/design-data.md +89 -0
  28. package/dist/skills/ads-import/references/captures.md +3 -2
  29. package/dist/skills/ads-import/references/design-data.md +89 -0
  30. package/dist/skills/ads-motion/references/build.md +33 -0
  31. package/dist/skills/ads-motion/references/captures.md +3 -2
  32. package/dist/skills/ads-motion/references/design-data.md +89 -0
  33. package/dist/skills/ads-motion/references/motion-review.md +2 -2
  34. package/dist/skills/ads-port/references/captures.md +3 -2
  35. package/dist/skills/ads-port/references/design-data.md +89 -0
  36. package/dist/starters/preact/design-system/components/Layout/Grid/Grid.tsx +76 -0
  37. package/dist/starters/preact/design-system/review/token-preview/TokenPreview.tsx +10 -1
  38. package/dist/starters/preact/ds.config.json +13 -1
  39. package/dist/starters/react/README.md +54 -7
  40. package/dist/starters/react/design-system/assets/glyphs/README.md +12 -0
  41. package/dist/starters/react/design-system/assets/glyphs/aliases.json +1 -0
  42. package/dist/starters/react/design-system/assets/glyphs/check.svg +1 -0
  43. package/dist/starters/react/design-system/assets/glyphs/chevron-down.svg +1 -0
  44. package/dist/starters/react/design-system/assets/glyphs/chevron-right.svg +1 -0
  45. package/dist/starters/react/design-system/assets/glyphs/close.svg +1 -0
  46. package/dist/starters/react/design-system/assets/glyphs/external-link.svg +1 -0
  47. package/dist/starters/react/design-system/assets/glyphs/info.svg +1 -0
  48. package/dist/starters/react/design-system/assets/glyphs/menu.svg +1 -0
  49. package/dist/starters/react/design-system/assets/glyphs/plus.svg +1 -0
  50. package/dist/starters/react/design-system/assets/glyphs/search.svg +1 -0
  51. package/dist/starters/react/design-system/assets/glyphs/warning.svg +1 -0
  52. package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +11 -4
  53. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.fixture.ts +9 -0
  54. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.scenario.tsx +16 -0
  55. package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +44 -0
  56. package/dist/starters/react/design-system/components/Actions/IconButton/README.md +14 -0
  57. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.fixture.ts +1 -0
  58. package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.scenario.tsx +15 -0
  59. package/dist/starters/react/design-system/components/Content/Icon/Icon.tsx +42 -0
  60. package/dist/starters/react/design-system/components/Content/Icon/README.md +16 -0
  61. package/dist/starters/react/design-system/components/Content/Icon/glyphs.ts +17 -0
  62. package/dist/starters/react/design-system/components/Forms/TextField/TextField.tsx +9 -5
  63. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.fixture.ts +12 -0
  64. package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.scenario.tsx +17 -0
  65. package/dist/starters/react/design-system/components/Layout/Grid/Grid.tsx +75 -0
  66. package/dist/starters/react/design-system/components/Layout/Grid/README.md +21 -0
  67. package/dist/starters/react/design-system/index.ts +3 -0
  68. package/dist/starters/react/design-system/review/grid-cell/GridCell.tsx +18 -0
  69. package/dist/starters/react/design-system/review/index.ts +1 -0
  70. package/dist/starters/react/design-system/review/token-preview/TokenPreview.tsx +10 -1
  71. package/dist/starters/react/design-system/tokens/Color.ads.fixture.ts +114 -8
  72. package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +23 -0
  73. package/dist/starters/react/design-system/tokens/{SpaceTypeMotion.ads.scenario.tsx → Layout.ads.scenario.tsx} +1 -1
  74. package/dist/starters/react/design-system/tokens/Motion.ads.fixture.ts +18 -0
  75. package/dist/starters/react/design-system/tokens/Motion.ads.scenario.tsx +4 -0
  76. package/dist/starters/react/design-system/tokens/Shape.ads.fixture.ts +30 -0
  77. package/dist/starters/react/design-system/tokens/Shape.ads.scenario.tsx +4 -0
  78. package/dist/starters/react/design-system/tokens/Space.ads.fixture.ts +37 -0
  79. package/dist/starters/react/design-system/tokens/Space.ads.scenario.tsx +4 -0
  80. package/dist/starters/react/design-system/tokens/Type.ads.fixture.ts +29 -0
  81. package/dist/starters/react/design-system/tokens/Type.ads.scenario.tsx +4 -0
  82. package/dist/starters/react/design-system/tokens/base.css +6 -3
  83. package/dist/starters/react/design-system/tokens/colors.css +220 -26
  84. package/dist/starters/react/design-system/tokens/elevation.css +51 -6
  85. package/dist/starters/react/design-system/tokens/spacing.css +67 -3
  86. package/dist/starters/react/design-system/tokens/typography.css +25 -7
  87. package/dist/starters/react/ds.config.json +13 -1
  88. package/dist/themes.mjs +106 -0
  89. package/dist/token-export.mjs +58 -0
  90. package/dist/token-quality.mjs +109 -0
  91. package/dist/tokens.mjs +9 -2
  92. package/docs/ADS.md +34 -5
  93. package/docs/ARCHITECTURE.md +49 -4
  94. package/docs/CHANGELOG.md +64 -12
  95. package/docs/GUIDE.md +31 -3
  96. package/docs/MCP.md +13 -4
  97. package/package.json +1 -1
  98. package/dist/starters/react/design-system/tokens/SpaceTypeMotion.ads.fixture.ts +0 -36
@@ -11,7 +11,7 @@
11
11
  <button data-section="patterns"><svg viewBox="0 0 16 16"><rect x="2" y="2" width="5" height="5"/><rect x="10" y="2" width="4" height="5"/><rect x="2" y="10" width="5" height="4"/><rect x="10" y="10" width="4" height="4"/></svg>Patterns</button>
12
12
  <button data-section="composition"><svg viewBox="0 0 16 16"><path d="M2 2h4v4H2zM10 2h4v4h-4zM2 10h4v4H2zM10 10h4v4h-4z"/></svg>Composition</button>
13
13
  </nav>
14
- <div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p><p id="warmup-status" hidden></p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
14
+ <div class="actions"><button id="preview-status" data-phase="opening" aria-label="Preview status: Connecting to ADS MCP…" title="Connecting to ADS MCP…" popovertarget="status-details"><span class="status-dot" aria-hidden="true"></span></button><div id="status-details" popover><p id="status" role="status">Connecting to ADS MCP…</p><p id="warmup-status" hidden></p></div><button id="viewport" aria-label="Phone viewport" aria-pressed="false" aria-controls="frame-slot" title="Preview at phone width (390 px)"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="4" y="1" width="8" height="14" rx="1.5"/><path d="M7 12.5h2"/></svg></button><button id="grid-overlay" aria-label="Show grid overlay" title="Show grid overlay" aria-pressed="false"><svg viewBox="0 0 16 16"><path d="M3 2v12M6.5 2v12M9.5 2v12M13 2v12"/></svg></button><button id="theme" aria-label="Use dark theme" title="Use dark theme"><svg viewBox="0 0 16 16"><path d="M13.5 9a5.5 5.5 0 0 1-6.5-6.5A5.5 5.5 0 1 0 13.5 9Z"/></svg></button><button id="minimize" aria-label="Minimize showcase menu" title="Minimize showcase menu (refresh to restore)"><svg viewBox="0 0 16 16"><path d="m4 10 4-4 4 4"/></svg></button></div>
15
15
  </header>
16
16
  <main>
17
17
  <aside id="sidebar"><nav id="entries" aria-label="Tokens"></nav></aside>
@@ -23,8 +23,9 @@ ads_capture({
23
23
  })
24
24
  ```
25
25
 
26
- The ID above is illustrative; use one returned by discovery. The default is light
27
- theme at 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
26
+ The ID above is illustrative; use one returned by discovery. `theme` names one of the
27
+ project's declared themes (`ads_status.themes`); the default is the first declared theme at
28
+ 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
28
29
  requested viewport and excludes showcase navigation. The default image records
29
30
  the complete widget viewport, including its current scroll/state; it does not
30
31
  automatically stitch every scroll position into one image.
@@ -89,3 +89,92 @@ sample coverage in the shared directory. Preserve themes, units, public APIs and
89
89
  behavior unless changing the visual policy was explicitly intended. Review a Git
90
90
  diff and run core, project and browser checks. There is no compatibility mode that
91
91
  keeps independent component token definitions valid.
92
+
93
+ ## Accessibility and rhythm reviews
94
+
95
+ `ads check` reviews token values, in every theme (each `:root[data-theme=…]` scope,
96
+ resolving `var()` aliases there):
97
+
98
+ - `token-contrast` warns when the roles that meet on screen fall below WCAG 2.2 AA:
99
+ `--text-strong`, `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on
100
+ `--bg-canvas`, `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and
101
+ `--accent-hover`; each status's `-fg` on its solid and `-text` on its `-bg` (4.5:1);
102
+ `--border-focus` and `--border-strong` on the canvas and surface (3:1). Pairs whose
103
+ tokens a project does not define are not reviewed; colors outside hex, rgb() and hsl()
104
+ are skipped.
105
+ - `token-rhythm` warns when a numbered spacing step leaves the scale `--space-N` = N × 2 px.
106
+ - `token-overlap-review` compares values only within a token family (`--radius-*` with
107
+ `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
108
+
109
+ Fix a contrast warning by choosing a different ramp step for the role, in the theme the
110
+ message names, rather than adding a one-off color.
111
+
112
+ ## Exchange format
113
+
114
+ `ads tokens --format dtcg` prints the tokens as W3C Design Tokens (Community Group draft)
115
+ JSON: groups by family, typed `$value`s, `{group.token}` references for `var()` aliases.
116
+ Values the format cannot express (fluid `clamp()` sizes, layered shadows) keep their CSS in
117
+ `$extensions["org.reqvire.ads"].css`; other themes' values are in
118
+ `$extensions["org.reqvire.ads"].scopes`.
119
+
120
+ ## Grid
121
+
122
+ The `--grid-*` tokens describe a column grid: `--grid-columns-sm/md/lg` (the starter's 4, 8
123
+ and 16), `--grid-gutter`, `--grid-gutter-narrow`, `--grid-gutter-condensed` and
124
+ `--grid-margin-sm/md/lg`, aliasing spacing steps. The starter's `Grid` switches columns by
125
+ container width (768 and 1024 px) with container queries, since CSS variables cannot be
126
+ breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
127
+ widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
128
+
129
+ ## Color roles and states
130
+
131
+ Name roles by element and purpose, the same in every theme; only their values change. Point roles at ramp steps rather than raw colors, so a theme is a ramp swap:
132
+
133
+ - Layers: `--bg-canvas` → `--bg-surface` → `--bg-raised` (menus, popovers), with `--bg-field`
134
+ for inputs. In dark themes each layer up is one step lighter; in light themes surfaces stay
135
+ near white.
136
+ - States move along the ramp: hover one step, pressed or active two, selected a subtle accent
137
+ step (`--bg-selected`). Solid fills hover one step darker (`--accent-hover`).
138
+ - Disabled is always neutral (`--bg-disabled`, `--text-disabled`, `--border-disabled`) with no
139
+ hover or focus response; WCAG exempts it from contrast, so `token-contrast` skips it.
140
+ - `--bg-overlay` is the translucent scrim behind modals; `--bg-skeleton` fills loading
141
+ placeholders.
142
+ - Never signal state or status by color alone: pair it with text, an icon or a shape.
143
+
144
+ ## Themes
145
+
146
+ Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default).
147
+ A theme changes values, never names: give the default theme's values on `:root`, override
148
+ them under `[data-theme="<name>"]`, and keep roles aliasing ramp steps on
149
+ `:root, [data-theme]` so they re-resolve wherever a theme applies. Override a whole ramp in a
150
+ theme, not a few steps.
151
+
152
+ - `data-theme` on `<html>` themes the page; on any element it themes one section (a dark
153
+ hero in a light page). A themed section paints its own canvas and text (`base.css`).
154
+ - `scheme` sets `color-scheme`, so native controls and scrollbars match the theme.
155
+ - Add a theme for a real need: high contrast, a dimmed reading mode, a brand. Check it in the
156
+ showcase (the theme button steps through declared themes) and capture it by name.
157
+ - Runtime switching (user choice, `prefers-color-scheme`, remembering it) is application code.
158
+
159
+ ## Spacing
160
+
161
+ `--space-N` is N × 2 px, from 2 to 160 px; the same values hold at every screen size, and a
162
+ layout steps down one or two sizes at narrow widths instead of scaling. Use the scale for
163
+ padding inside components and for gaps between them; a value off the scale needs a reason.
164
+
165
+ - Distance says how related things are: closer means more related. Group with space before
166
+ reaching for dividers, borders or cards.
167
+ - More space around an element gives it more importance. Sections can be dense, but leave the
168
+ page as a whole room to breathe.
169
+ - Parents own the space between their children (`gap`, stack tokens); a component carries no
170
+ outer margin, so it fits wherever it is placed.
171
+ - Horizontal layout follows the column grid; percentages are fine for splitting a region and
172
+ for minimum and maximum widths.
173
+
174
+ ## Motion tokens
175
+
176
+ Six durations (`--dur-instant` 70 ms, `--dur-fast` 110, `--dur-moderate` 150, `--dur-normal`
177
+ 240, `--dur-slow` 400, `--dur-slower` 700) and three curve pairs (standard, enter and exit, each everyday and
178
+ `-strong`). Every duration is 0 under `prefers-reduced-motion`. Pick by purpose, not by
179
+ number: the ads-motion skill's build guide maps each token to its use and gives the easing
180
+ rules.
@@ -208,11 +208,14 @@ or empty. Use the latest published version unless the user names one; read
208
208
  Never copy starter files by hand or port React files to Preact.
209
209
 
210
210
  The created project's `README.md` and `ADS.md` explain it. It has semantic token
211
- defaults in two groups (Color; Space, type & motion), React or Preact
211
+ foundation in six groups (Color ramps and AA-checked roles, Type, Space & sizing, Shape &
212
+ elevation, Motion, Layout) with light and dark themes declared in `ds.config.json`
213
+ (`[data-theme]` themes the page or one section; see `ads://guides/tokens`), React or Preact
212
214
  TypeScript/Linaria configuration, general lint, a public barrel, project-owned
213
215
  review renderers (token tiles, brand preview, demo and screen frames), placeholder
214
- brand artwork with an app icon, and one example of each layer: `Button`,
215
- `TextField` and `Logo` in three component groups, the `SearchBar` pattern and the
216
+ brand artwork with an app icon, a `Grid` (`GridItem`) on the grid tokens, an icon set with
217
+ `Icon` and `IconButton`, and one example of each layer: `Button`, `IconButton`, `Icon`,
218
+ `Logo`, `TextField` and `Grid` in four component groups, the `SearchBar` pattern and the
216
219
  `SearchPage` composition. Treat them as the project's own: adapt or replace them
217
220
  for the requested product. The browser shell is supplied by ADS tooling.
218
221
 
@@ -317,6 +320,13 @@ image. Read
317
320
  [branding.md](references/branding.md) (`ads://guides/branding`) before changing
318
321
  brand artwork, icon outputs or glyphs.
319
322
 
323
+ ## Accessibility
324
+
325
+ Target WCAG 2.2 AA. `ads check` warns about contrast in every theme, target size, focus,
326
+ text resize, reduced motion, text spacing, image alternatives and keyboard reach (`a11y-*`
327
+ and `token-contrast`). Read [accessibility.md](references/accessibility.md)
328
+ (`ads://guides/accessibility`) for the rules and the practice no tool can check.
329
+
320
330
  ## Design craft and mobile behavior
321
331
 
322
332
  For design direction, content/layout decisions, interface wording, component
@@ -0,0 +1,43 @@
1
+ # Accessibility
2
+
3
+ Target WCAG 2.2 AA. ADS checks what it can from
4
+ tokens and source; the rest is design and testing practice.
5
+
6
+ ## What `ads check` reviews
7
+
8
+ All are warnings with the WCAG criterion in the message.
9
+
10
+ | Rule | What it reviews | WCAG |
11
+ |---|---|---|
12
+ | `token-contrast` | Text, link, accent and status text on their backgrounds (4.5:1); focus and control borders on canvas and surface (3:1); in every theme | 1.4.3, 1.4.11 |
13
+ | `a11y-target-size` | `--control-height-*` of at least 24 px (44 px where touch is common) | 2.5.8 |
14
+ | `a11y-focus` | `--focus-w` of at least 2 px, and a `:focus-visible` indicator in `base.css` | 2.4.7, 2.4.13 |
15
+ | `a11y-text-resize` | Font-size tokens in `rem`, so text follows the reader's browser font size | 1.4.4 |
16
+ | `a11y-reduced-motion` | Every non-zero `--dur-*` set to 0 under `prefers-reduced-motion`; infinite animations in components stopped there | 2.3.3, 2.2.2 |
17
+ | `a11y-text-spacing` | `--leading-normal` of at least 1.5; `--content-max` under 80 characters | 1.4.8, 1.4.12 |
18
+ | `a11y-image-alt` | `<img>` in components with `alt` (`alt=""` when decorative) | 1.1.1 |
19
+ | `a11y-keyboard` | No `onClick` on `div`, `span` and other non-interactive elements without `role`, `tabIndex` and a key handler; prefer `<button>` | 2.1.1 |
20
+
21
+ Fix a warning in its owner: choose a different ramp step or size token, add the missing
22
+ attribute, or move the interaction to a native control. Do not silence it with a one-off
23
+ value.
24
+
25
+ ## What only design and testing establish
26
+
27
+ - **Color is never the only signal.** Pair status color with text or an icon; underline links
28
+ in running text.
29
+ - **Keyboard.** Every action is reachable and usable with the keyboard, in a logical reading
30
+ order; focus never gets trapped and is always visible.
31
+ - **Screen readers.** Visual meaning has a text equivalent: labels on inputs and icon-only
32
+ buttons (`aria-label`), live regions for status messages, headings in order.
33
+ - **Zoom and reflow.** Layouts still make sense at 200% zoom and on a 320 px wide viewport;
34
+ related content stays together when magnified.
35
+ - **Motion.** Nothing autoplays or flashes more than three times a second; long motion can be
36
+ paused.
37
+ - **Media.** Video and animation with meaningful audio have captions and transcripts.
38
+ - **Cognitive load.** Plain language, one task per view where possible, information kept
39
+ visible while the task needs it.
40
+
41
+ Test by using each new view with the keyboard only, with a screen reader (VoiceOver, NVDA or
42
+ Orca), at 200% zoom, and in both themes. Browser checks run against real previews (`ads
43
+ verify`) can assert focus order and accessible names for important flows.
@@ -43,6 +43,24 @@ app icon of 1024 px); ADS never enlarges it. A finished icon file is only copied
43
43
  Prefer SVG masters when they exist; take finished images as delivered when that
44
44
  is what the brand provides.
45
45
 
46
+ ## Pictograms and illustrations
47
+
48
+ Pictograms are illustrations for empty states, onboarding and marketing surfaces, not UI
49
+ icons: never use one as an icon, a logo or a header lockup, and never use a UI glyph as an
50
+ illustration. Keep them as brand artwork in `assets/brand/pictograms/`, so the brand
51
+ checks (README, license, preview, use) cover them, and preview them in a `brand/Pictograms`
52
+ group.
53
+
54
+ - Show them at 48 px or larger, at their original proportions; never crop or stretch them.
55
+ - Keep clear space of at least a quarter of their size on every side, with or without a
56
+ container. Containers are a circle or a square only, with the pictogram optically
57
+ centered.
58
+ - Pair light and dark versions as `<name>.svg` and `<name>.dark.svg`, and show the one that
59
+ matches the background: light artwork on light surfaces, dark on dark. Avoid mid-tone
60
+ backgrounds and gradients behind them.
61
+ - A pictogram that carries meaning needs a text alternative; one that repeats nearby text is
62
+ decorative (`alt=""`).
63
+
46
64
  ## Web icons
47
65
 
48
66
  Set one square master as `assets.iconSource`: an SVG, or a square PNG, JPEG or WebP
@@ -102,3 +120,13 @@ set them. `aliases.json` in the folder maps extra names to existing glyphs
102
120
  (`glyphAliases`); a file named like an alias is skipped. `ads assets` writes the
103
121
  module; `ads check` fails (`brand-output-stale`) when it is out of date. The icon
104
122
  component and its catalogue scenario read `glyphs` and `glyphAliases`.
123
+
124
+ Keep every glyph on one `viewBox` (the starter uses 24 × 24) and draw in `currentColor`:
125
+ `ads check` warns about a different or missing viewBox (`glyph-viewbox`) and fixed fill or
126
+ stroke colors (`glyph-color`). Other products' logos keep their own colors: keep them as
127
+ brand artwork in `assets/brand/` and show them as images, not glyphs. The starter's `Icon` sizes glyphs with `--icon-sm/md/lg/xl`
128
+ (16/20/24/32 px; 16 beside body text), centers them beside text and hides decorative ones
129
+ from assistive technology; `label` names a meaningful one. Icons have no states of their
130
+ own: interactive icons go in `IconButton`, whose required `label` is its accessible name
131
+ and tooltip and whose background carries hover, pressed and disabled. `a11y-icon-label`
132
+ warns about icon-only buttons and links without a name.
@@ -23,8 +23,9 @@ ads_capture({
23
23
  })
24
24
  ```
25
25
 
26
- The ID above is illustrative; use one returned by discovery. The default is light
27
- theme at 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
26
+ The ID above is illustrative; use one returned by discovery. `theme` names one of the
27
+ project's declared themes (`ads_status.themes`); the default is the first declared theme at
28
+ 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
28
29
  requested viewport and excludes showcase navigation. The default image records
29
30
  the complete widget viewport, including its current scroll/state; it does not
30
31
  automatically stitch every scroll position into one image.
@@ -89,3 +89,92 @@ sample coverage in the shared directory. Preserve themes, units, public APIs and
89
89
  behavior unless changing the visual policy was explicitly intended. Review a Git
90
90
  diff and run core, project and browser checks. There is no compatibility mode that
91
91
  keeps independent component token definitions valid.
92
+
93
+ ## Accessibility and rhythm reviews
94
+
95
+ `ads check` reviews token values, in every theme (each `:root[data-theme=…]` scope,
96
+ resolving `var()` aliases there):
97
+
98
+ - `token-contrast` warns when the roles that meet on screen fall below WCAG 2.2 AA:
99
+ `--text-strong`, `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on
100
+ `--bg-canvas`, `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and
101
+ `--accent-hover`; each status's `-fg` on its solid and `-text` on its `-bg` (4.5:1);
102
+ `--border-focus` and `--border-strong` on the canvas and surface (3:1). Pairs whose
103
+ tokens a project does not define are not reviewed; colors outside hex, rgb() and hsl()
104
+ are skipped.
105
+ - `token-rhythm` warns when a numbered spacing step leaves the scale `--space-N` = N × 2 px.
106
+ - `token-overlap-review` compares values only within a token family (`--radius-*` with
107
+ `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
108
+
109
+ Fix a contrast warning by choosing a different ramp step for the role, in the theme the
110
+ message names, rather than adding a one-off color.
111
+
112
+ ## Exchange format
113
+
114
+ `ads tokens --format dtcg` prints the tokens as W3C Design Tokens (Community Group draft)
115
+ JSON: groups by family, typed `$value`s, `{group.token}` references for `var()` aliases.
116
+ Values the format cannot express (fluid `clamp()` sizes, layered shadows) keep their CSS in
117
+ `$extensions["org.reqvire.ads"].css`; other themes' values are in
118
+ `$extensions["org.reqvire.ads"].scopes`.
119
+
120
+ ## Grid
121
+
122
+ The `--grid-*` tokens describe a column grid: `--grid-columns-sm/md/lg` (the starter's 4, 8
123
+ and 16), `--grid-gutter`, `--grid-gutter-narrow`, `--grid-gutter-condensed` and
124
+ `--grid-margin-sm/md/lg`, aliasing spacing steps. The starter's `Grid` switches columns by
125
+ container width (768 and 1024 px) with container queries, since CSS variables cannot be
126
+ breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
127
+ widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
128
+
129
+ ## Color roles and states
130
+
131
+ Name roles by element and purpose, the same in every theme; only their values change. Point roles at ramp steps rather than raw colors, so a theme is a ramp swap:
132
+
133
+ - Layers: `--bg-canvas` → `--bg-surface` → `--bg-raised` (menus, popovers), with `--bg-field`
134
+ for inputs. In dark themes each layer up is one step lighter; in light themes surfaces stay
135
+ near white.
136
+ - States move along the ramp: hover one step, pressed or active two, selected a subtle accent
137
+ step (`--bg-selected`). Solid fills hover one step darker (`--accent-hover`).
138
+ - Disabled is always neutral (`--bg-disabled`, `--text-disabled`, `--border-disabled`) with no
139
+ hover or focus response; WCAG exempts it from contrast, so `token-contrast` skips it.
140
+ - `--bg-overlay` is the translucent scrim behind modals; `--bg-skeleton` fills loading
141
+ placeholders.
142
+ - Never signal state or status by color alone: pair it with text, an icon or a shape.
143
+
144
+ ## Themes
145
+
146
+ Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default).
147
+ A theme changes values, never names: give the default theme's values on `:root`, override
148
+ them under `[data-theme="<name>"]`, and keep roles aliasing ramp steps on
149
+ `:root, [data-theme]` so they re-resolve wherever a theme applies. Override a whole ramp in a
150
+ theme, not a few steps.
151
+
152
+ - `data-theme` on `<html>` themes the page; on any element it themes one section (a dark
153
+ hero in a light page). A themed section paints its own canvas and text (`base.css`).
154
+ - `scheme` sets `color-scheme`, so native controls and scrollbars match the theme.
155
+ - Add a theme for a real need: high contrast, a dimmed reading mode, a brand. Check it in the
156
+ showcase (the theme button steps through declared themes) and capture it by name.
157
+ - Runtime switching (user choice, `prefers-color-scheme`, remembering it) is application code.
158
+
159
+ ## Spacing
160
+
161
+ `--space-N` is N × 2 px, from 2 to 160 px; the same values hold at every screen size, and a
162
+ layout steps down one or two sizes at narrow widths instead of scaling. Use the scale for
163
+ padding inside components and for gaps between them; a value off the scale needs a reason.
164
+
165
+ - Distance says how related things are: closer means more related. Group with space before
166
+ reaching for dividers, borders or cards.
167
+ - More space around an element gives it more importance. Sections can be dense, but leave the
168
+ page as a whole room to breathe.
169
+ - Parents own the space between their children (`gap`, stack tokens); a component carries no
170
+ outer margin, so it fits wherever it is placed.
171
+ - Horizontal layout follows the column grid; percentages are fine for splitting a region and
172
+ for minimum and maximum widths.
173
+
174
+ ## Motion tokens
175
+
176
+ Six durations (`--dur-instant` 70 ms, `--dur-fast` 110, `--dur-moderate` 150, `--dur-normal`
177
+ 240, `--dur-slow` 400, `--dur-slower` 700) and three curve pairs (standard, enter and exit, each everyday and
178
+ `-strong`). Every duration is 0 under `prefers-reduced-motion`. Pick by purpose, not by
179
+ number: the ads-motion skill's build guide maps each token to its use and gives the easing
180
+ rules.
@@ -23,8 +23,9 @@ ads_capture({
23
23
  })
24
24
  ```
25
25
 
26
- The ID above is illustrative; use one returned by discovery. The default is light
27
- theme at 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
26
+ The ID above is illustrative; use one returned by discovery. `theme` names one of the
27
+ project's declared themes (`ads_status.themes`); the default is the first declared theme at
28
+ 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
28
29
  requested viewport and excludes showcase navigation. The default image records
29
30
  the complete widget viewport, including its current scroll/state; it does not
30
31
  automatically stitch every scroll position into one image.
@@ -89,3 +89,92 @@ sample coverage in the shared directory. Preserve themes, units, public APIs and
89
89
  behavior unless changing the visual policy was explicitly intended. Review a Git
90
90
  diff and run core, project and browser checks. There is no compatibility mode that
91
91
  keeps independent component token definitions valid.
92
+
93
+ ## Accessibility and rhythm reviews
94
+
95
+ `ads check` reviews token values, in every theme (each `:root[data-theme=…]` scope,
96
+ resolving `var()` aliases there):
97
+
98
+ - `token-contrast` warns when the roles that meet on screen fall below WCAG 2.2 AA:
99
+ `--text-strong`, `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on
100
+ `--bg-canvas`, `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and
101
+ `--accent-hover`; each status's `-fg` on its solid and `-text` on its `-bg` (4.5:1);
102
+ `--border-focus` and `--border-strong` on the canvas and surface (3:1). Pairs whose
103
+ tokens a project does not define are not reviewed; colors outside hex, rgb() and hsl()
104
+ are skipped.
105
+ - `token-rhythm` warns when a numbered spacing step leaves the scale `--space-N` = N × 2 px.
106
+ - `token-overlap-review` compares values only within a token family (`--radius-*` with
107
+ `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
108
+
109
+ Fix a contrast warning by choosing a different ramp step for the role, in the theme the
110
+ message names, rather than adding a one-off color.
111
+
112
+ ## Exchange format
113
+
114
+ `ads tokens --format dtcg` prints the tokens as W3C Design Tokens (Community Group draft)
115
+ JSON: groups by family, typed `$value`s, `{group.token}` references for `var()` aliases.
116
+ Values the format cannot express (fluid `clamp()` sizes, layered shadows) keep their CSS in
117
+ `$extensions["org.reqvire.ads"].css`; other themes' values are in
118
+ `$extensions["org.reqvire.ads"].scopes`.
119
+
120
+ ## Grid
121
+
122
+ The `--grid-*` tokens describe a column grid: `--grid-columns-sm/md/lg` (the starter's 4, 8
123
+ and 16), `--grid-gutter`, `--grid-gutter-narrow`, `--grid-gutter-condensed` and
124
+ `--grid-margin-sm/md/lg`, aliasing spacing steps. The starter's `Grid` switches columns by
125
+ container width (768 and 1024 px) with container queries, since CSS variables cannot be
126
+ breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
127
+ widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
128
+
129
+ ## Color roles and states
130
+
131
+ Name roles by element and purpose, the same in every theme; only their values change. Point roles at ramp steps rather than raw colors, so a theme is a ramp swap:
132
+
133
+ - Layers: `--bg-canvas` → `--bg-surface` → `--bg-raised` (menus, popovers), with `--bg-field`
134
+ for inputs. In dark themes each layer up is one step lighter; in light themes surfaces stay
135
+ near white.
136
+ - States move along the ramp: hover one step, pressed or active two, selected a subtle accent
137
+ step (`--bg-selected`). Solid fills hover one step darker (`--accent-hover`).
138
+ - Disabled is always neutral (`--bg-disabled`, `--text-disabled`, `--border-disabled`) with no
139
+ hover or focus response; WCAG exempts it from contrast, so `token-contrast` skips it.
140
+ - `--bg-overlay` is the translucent scrim behind modals; `--bg-skeleton` fills loading
141
+ placeholders.
142
+ - Never signal state or status by color alone: pair it with text, an icon or a shape.
143
+
144
+ ## Themes
145
+
146
+ Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default).
147
+ A theme changes values, never names: give the default theme's values on `:root`, override
148
+ them under `[data-theme="<name>"]`, and keep roles aliasing ramp steps on
149
+ `:root, [data-theme]` so they re-resolve wherever a theme applies. Override a whole ramp in a
150
+ theme, not a few steps.
151
+
152
+ - `data-theme` on `<html>` themes the page; on any element it themes one section (a dark
153
+ hero in a light page). A themed section paints its own canvas and text (`base.css`).
154
+ - `scheme` sets `color-scheme`, so native controls and scrollbars match the theme.
155
+ - Add a theme for a real need: high contrast, a dimmed reading mode, a brand. Check it in the
156
+ showcase (the theme button steps through declared themes) and capture it by name.
157
+ - Runtime switching (user choice, `prefers-color-scheme`, remembering it) is application code.
158
+
159
+ ## Spacing
160
+
161
+ `--space-N` is N × 2 px, from 2 to 160 px; the same values hold at every screen size, and a
162
+ layout steps down one or two sizes at narrow widths instead of scaling. Use the scale for
163
+ padding inside components and for gaps between them; a value off the scale needs a reason.
164
+
165
+ - Distance says how related things are: closer means more related. Group with space before
166
+ reaching for dividers, borders or cards.
167
+ - More space around an element gives it more importance. Sections can be dense, but leave the
168
+ page as a whole room to breathe.
169
+ - Parents own the space between their children (`gap`, stack tokens); a component carries no
170
+ outer margin, so it fits wherever it is placed.
171
+ - Horizontal layout follows the column grid; percentages are fine for splitting a region and
172
+ for minimum and maximum widths.
173
+
174
+ ## Motion tokens
175
+
176
+ Six durations (`--dur-instant` 70 ms, `--dur-fast` 110, `--dur-moderate` 150, `--dur-normal`
177
+ 240, `--dur-slow` 400, `--dur-slower` 700) and three curve pairs (standard, enter and exit, each everyday and
178
+ `-strong`). Every duration is 0 under `prefers-reduced-motion`. Pick by purpose, not by
179
+ number: the ads-motion skill's build guide maps each token to its use and gives the easing
180
+ rules.
@@ -49,6 +49,39 @@ If needed, define raw duration, easing, distance, or scale in the token layer an
49
49
  consume it through the owner's styles. Preserve theme values unless the request
50
50
  is explicitly a token-values/theme change.
51
51
 
52
+ ### Everyday and strong motion
53
+
54
+ Most motion is everyday motion: fast and subtle, for task UI (control states, menus, tables,
55
+ side panels). Strong motion is more visible and is kept for occasional important moments
56
+ (opening a page, a primary action, a system alert).
57
+
58
+ | Token | Value | Use |
59
+ |---|---|---|
60
+ | `--dur-instant` | 70 ms | Control states: press, toggle, hover |
61
+ | `--dur-fast` | 110 ms | Fades and other quick feedback |
62
+ | `--dur-moderate` | 150 ms | Small expansions, short moves |
63
+ | `--dur-normal` | 240 ms | Expansions, toasts, system messages |
64
+ | `--dur-slow` | 400 ms | Large expansions, important notifications |
65
+ | `--dur-slower` | 700 ms | Background dimming behind a modal |
66
+
67
+ | Curve | Everyday | Strong | Use |
68
+ |---|---|---|---|
69
+ | Standard | `--ease-standard` | `--ease-strong` | Moves between visible places: expanding, sorting, a side panel that stays nearby |
70
+ | Enter | `--ease-enter` | `--ease-enter-strong` | Something appearing; it decelerates into place |
71
+ | Exit | `--ease-exit` | `--ease-exit-strong` | Something leaving for good (modal, toast); it accelerates away |
72
+
73
+ - Duration follows distance and size: longer travel or a bigger scale change takes longer.
74
+ Everyday motion stays well under strong motion; control feedback sits around 70–150 ms.
75
+ - Respond to user input immediately with a decelerating curve (`--ease-enter`); the
76
+ feedback must be seen as the input happens.
77
+ - Never move things linearly: real objects accelerate and decelerate. Linear is for
78
+ elapsed-time indicators and continuous spinners only.
79
+ - Related elements moving together share one duration and curve, or a deliberate sequence;
80
+ large or full-screen transitions keep a continuous element that guides the eye.
81
+ - Check motion on small screens too, where subtle motion is easy to miss. If people notice
82
+ a transition often, make it shorter or remove it.
83
+ - Never carry a message by motion alone: the end state, text or icon must say it as well.
84
+
52
85
  Use deceleration for a newly appearing surface and an origin tied to its source.
53
86
  Use balanced easing for a continuous move between visible positions, and linear
54
87
  motion for an elapsed-time indicator. Springs can suit direct manipulation
@@ -23,8 +23,9 @@ ads_capture({
23
23
  })
24
24
  ```
25
25
 
26
- The ID above is illustrative; use one returned by discovery. The default is light
27
- theme at 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
26
+ The ID above is illustrative; use one returned by discovery. `theme` names one of the
27
+ project's declared themes (`ads_status.themes`); the default is the first declared theme at
28
+ 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
28
29
  requested viewport and excludes showcase navigation. The default image records
29
30
  the complete widget viewport, including its current scroll/state; it does not
30
31
  automatically stitch every scroll position into one image.
@@ -89,3 +89,92 @@ sample coverage in the shared directory. Preserve themes, units, public APIs and
89
89
  behavior unless changing the visual policy was explicitly intended. Review a Git
90
90
  diff and run core, project and browser checks. There is no compatibility mode that
91
91
  keeps independent component token definitions valid.
92
+
93
+ ## Accessibility and rhythm reviews
94
+
95
+ `ads check` reviews token values, in every theme (each `:root[data-theme=…]` scope,
96
+ resolving `var()` aliases there):
97
+
98
+ - `token-contrast` warns when the roles that meet on screen fall below WCAG 2.2 AA:
99
+ `--text-strong`, `--text-body`, `--text-muted`, `--text-link` and `--accent-text` on
100
+ `--bg-canvas`, `--bg-surface` and `--bg-hover`; `--accent-fg` on `--accent` and
101
+ `--accent-hover`; each status's `-fg` on its solid and `-text` on its `-bg` (4.5:1);
102
+ `--border-focus` and `--border-strong` on the canvas and surface (3:1). Pairs whose
103
+ tokens a project does not define are not reviewed; colors outside hex, rgb() and hsl()
104
+ are skipped.
105
+ - `token-rhythm` warns when a numbered spacing step leaves the scale `--space-N` = N × 2 px.
106
+ - `token-overlap-review` compares values only within a token family (`--radius-*` with
107
+ `--radius-*`): a radius equal to a spacing step is two scales meeting, not a duplicate.
108
+
109
+ Fix a contrast warning by choosing a different ramp step for the role, in the theme the
110
+ message names, rather than adding a one-off color.
111
+
112
+ ## Exchange format
113
+
114
+ `ads tokens --format dtcg` prints the tokens as W3C Design Tokens (Community Group draft)
115
+ JSON: groups by family, typed `$value`s, `{group.token}` references for `var()` aliases.
116
+ Values the format cannot express (fluid `clamp()` sizes, layered shadows) keep their CSS in
117
+ `$extensions["org.reqvire.ads"].css`; other themes' values are in
118
+ `$extensions["org.reqvire.ads"].scopes`.
119
+
120
+ ## Grid
121
+
122
+ The `--grid-*` tokens describe a column grid: `--grid-columns-sm/md/lg` (the starter's 4, 8
123
+ and 16), `--grid-gutter`, `--grid-gutter-narrow`, `--grid-gutter-condensed` and
124
+ `--grid-margin-sm/md/lg`, aliasing spacing steps. The starter's `Grid` switches columns by
125
+ container width (768 and 1024 px) with container queries, since CSS variables cannot be
126
+ breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
127
+ widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
128
+
129
+ ## Color roles and states
130
+
131
+ Name roles by element and purpose, the same in every theme; only their values change. Point roles at ramp steps rather than raw colors, so a theme is a ramp swap:
132
+
133
+ - Layers: `--bg-canvas` → `--bg-surface` → `--bg-raised` (menus, popovers), with `--bg-field`
134
+ for inputs. In dark themes each layer up is one step lighter; in light themes surfaces stay
135
+ near white.
136
+ - States move along the ramp: hover one step, pressed or active two, selected a subtle accent
137
+ step (`--bg-selected`). Solid fills hover one step darker (`--accent-hover`).
138
+ - Disabled is always neutral (`--bg-disabled`, `--text-disabled`, `--border-disabled`) with no
139
+ hover or focus response; WCAG exempts it from contrast, so `token-contrast` skips it.
140
+ - `--bg-overlay` is the translucent scrim behind modals; `--bg-skeleton` fills loading
141
+ placeholders.
142
+ - Never signal state or status by color alone: pair it with text, an icon or a shape.
143
+
144
+ ## Themes
145
+
146
+ Declare themes in `ds.config.json` (`themes: [{ name, scheme }]`, the first is the default).
147
+ A theme changes values, never names: give the default theme's values on `:root`, override
148
+ them under `[data-theme="<name>"]`, and keep roles aliasing ramp steps on
149
+ `:root, [data-theme]` so they re-resolve wherever a theme applies. Override a whole ramp in a
150
+ theme, not a few steps.
151
+
152
+ - `data-theme` on `<html>` themes the page; on any element it themes one section (a dark
153
+ hero in a light page). A themed section paints its own canvas and text (`base.css`).
154
+ - `scheme` sets `color-scheme`, so native controls and scrollbars match the theme.
155
+ - Add a theme for a real need: high contrast, a dimmed reading mode, a brand. Check it in the
156
+ showcase (the theme button steps through declared themes) and capture it by name.
157
+ - Runtime switching (user choice, `prefers-color-scheme`, remembering it) is application code.
158
+
159
+ ## Spacing
160
+
161
+ `--space-N` is N × 2 px, from 2 to 160 px; the same values hold at every screen size, and a
162
+ layout steps down one or two sizes at narrow widths instead of scaling. Use the scale for
163
+ padding inside components and for gaps between them; a value off the scale needs a reason.
164
+
165
+ - Distance says how related things are: closer means more related. Group with space before
166
+ reaching for dividers, borders or cards.
167
+ - More space around an element gives it more importance. Sections can be dense, but leave the
168
+ page as a whole room to breathe.
169
+ - Parents own the space between their children (`gap`, stack tokens); a component carries no
170
+ outer margin, so it fits wherever it is placed.
171
+ - Horizontal layout follows the column grid; percentages are fine for splitting a region and
172
+ for minimum and maximum widths.
173
+
174
+ ## Motion tokens
175
+
176
+ Six durations (`--dur-instant` 70 ms, `--dur-fast` 110, `--dur-moderate` 150, `--dur-normal`
177
+ 240, `--dur-slow` 400, `--dur-slower` 700) and three curve pairs (standard, enter and exit, each everyday and
178
+ `-strong`). Every duration is 0 under `prefers-reduced-motion`. Pick by purpose, not by
179
+ number: the ads-motion skill's build guide maps each token to its use and gives the easing
180
+ rules.
@@ -9,8 +9,8 @@ Assess the following where applicable:
9
9
  | Area | Look for |
10
10
  |------|----------|
11
11
  | Purpose/frequency | A clear relationship to the action; repeated work is not slowed |
12
- | Easing | Entry decelerates naturally; continuous movement and elapsed-time motion use suitable curves |
13
- | Timing | Feedback starts promptly; total choreography fits its distance and task |
12
+ | Easing | Entry decelerates (`--ease-enter`), exits accelerate (`--ease-exit`), moves between visible places use `--ease-standard`; no linear movement except elapsed time and spinners; strong curves only for rare important moments |
13
+ | Timing | Feedback starts promptly; duration grows with distance and size (control feedback 70–150 ms, expansions and toasts 240 ms, large changes 400 ms, dimming 700 ms) |
14
14
  | Origin/distance | Placement and scale point to the real trigger without excessive travel |
15
15
  | Continuity | Reversal and repeated updates retarget without snapping or restarting |
16
16
  | Lifecycle | Exit, cancellation, unmount, and zero-duration states clean up correctly |
@@ -23,8 +23,9 @@ ads_capture({
23
23
  })
24
24
  ```
25
25
 
26
- The ID above is illustrative; use one returned by discovery. The default is light
27
- theme at 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
26
+ The ID above is illustrative; use one returned by discovery. `theme` names one of the
27
+ project's declared themes (`ads_status.themes`); the default is the first declared theme at
28
+ 1280 × 800 CSS pixels. Capture uses the real sandboxed MCP App with the
28
29
  requested viewport and excludes showcase navigation. The default image records
29
30
  the complete widget viewport, including its current scroll/state; it does not
30
31
  automatically stitch every scroll position into one image.