@reqvire-org/ads 0.3.49 → 0.3.50

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 (93) hide show
  1. package/README.md +36 -6
  2. package/dist/active-clock.mjs +34 -0
  3. package/dist/assets.mjs +20 -2
  4. package/dist/boundaries.mjs +2 -0
  5. package/dist/browser-audit/layout-overflow.mjs +57 -0
  6. package/dist/browser-audit/layout-shift.mjs +32 -0
  7. package/dist/browser-audit/non-text-contrast.mjs +87 -0
  8. package/dist/browser-audit/worker.mjs +36 -7
  9. package/dist/browser-audit.mjs +198 -22
  10. package/dist/check.mjs +14 -1
  11. package/dist/cli.mjs +7 -4
  12. package/dist/component-contrast.mjs +138 -0
  13. package/dist/config.mjs +12 -6
  14. package/dist/finding-rules.mjs +11 -1
  15. package/dist/fonts-generated.mjs +85 -0
  16. package/dist/image-attributes.mjs +110 -0
  17. package/dist/init.mjs +2 -0
  18. package/dist/layout-widths.mjs +184 -0
  19. package/dist/mcp/context.mjs +1 -1
  20. package/dist/mcp/mutations.mjs +7 -5
  21. package/dist/mcp/preview-watch.mjs +9 -8
  22. package/dist/mcp/server.mjs +6 -4
  23. package/dist/preview-files.mjs +3 -0
  24. package/dist/project-boundary.mjs +23 -0
  25. package/dist/project-documents.mjs +2 -1
  26. package/dist/scenarios-compiler.mjs +23 -3
  27. package/dist/showcase/client.bundle.js +11 -11
  28. package/dist/showcase/icons.js +5 -5
  29. package/dist/showcase/style.css +1 -1
  30. package/dist/skills/ads-break-ui/SKILL.md +8 -0
  31. package/dist/skills/ads-break-ui/references/atomic-styles.md +2 -0
  32. package/dist/skills/ads-break-ui/references/design-data.md +39 -0
  33. package/dist/skills/ads-break-ui/references/drafts.md +1 -1
  34. package/dist/skills/ads-break-ui/references/guarded-editing.md +1 -1
  35. package/dist/skills/ads-break-ui/references/validation.md +9 -5
  36. package/dist/skills/ads-designer/SKILL.md +24 -4
  37. package/dist/skills/ads-designer/references/accessibility.md +30 -13
  38. package/dist/skills/ads-designer/references/atomic-styles.md +2 -0
  39. package/dist/skills/ads-designer/references/branding.md +10 -5
  40. package/dist/skills/ads-designer/references/cli.md +2 -1
  41. package/dist/skills/ads-designer/references/design-data.md +39 -0
  42. package/dist/skills/ads-designer/references/drafts.md +1 -1
  43. package/dist/skills/ads-designer/references/guarded-editing.md +1 -1
  44. package/dist/skills/ads-designer/references/mobile.md +3 -0
  45. package/dist/skills/ads-designer/references/performance.md +89 -0
  46. package/dist/skills/ads-designer/references/validation.md +9 -5
  47. package/dist/skills/ads-import/references/atomic-styles.md +2 -0
  48. package/dist/skills/ads-import/references/cli.md +2 -1
  49. package/dist/skills/ads-import/references/design-data.md +39 -0
  50. package/dist/skills/ads-import/references/drafts.md +1 -1
  51. package/dist/skills/ads-import/references/guarded-editing.md +1 -1
  52. package/dist/skills/ads-import/references/validation.md +9 -5
  53. package/dist/skills/ads-motion/references/atomic-styles.md +2 -0
  54. package/dist/skills/ads-motion/references/design-data.md +39 -0
  55. package/dist/skills/ads-motion/references/drafts.md +1 -1
  56. package/dist/skills/ads-motion/references/guarded-editing.md +1 -1
  57. package/dist/skills/ads-motion/references/validation.md +9 -5
  58. package/dist/skills/ads-port/references/atomic-styles.md +2 -0
  59. package/dist/skills/ads-port/references/cli.md +2 -1
  60. package/dist/skills/ads-port/references/design-data.md +39 -0
  61. package/dist/skills/ads-port/references/drafts.md +1 -1
  62. package/dist/skills/ads-port/references/guarded-editing.md +1 -1
  63. package/dist/skills/ads-port/references/validation.md +9 -5
  64. package/dist/starters/preact/ds.config.json +1 -0
  65. package/dist/starters/preact/package.json +1 -0
  66. package/dist/starters/react/ADS.md +1 -1
  67. package/dist/starters/react/README.md +14 -2
  68. package/dist/starters/react/design-system/components/Actions/Button/Button.tsx +1 -1
  69. package/dist/starters/react/design-system/components/Content/Image/Image.ads.fixture.ts +2 -0
  70. package/dist/starters/react/design-system/components/Content/Image/Image.ads.scenario.tsx +13 -0
  71. package/dist/starters/react/design-system/components/Content/Image/Image.tsx +48 -0
  72. package/dist/starters/react/design-system/components/Content/Image/README.md +20 -0
  73. package/dist/starters/react/design-system/components/Content/Logo/Logo.tsx +2 -2
  74. package/dist/starters/react/design-system/index.ts +1 -0
  75. package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +16 -0
  76. package/dist/starters/react/design-system/tokens/spacing.css +18 -0
  77. package/dist/starters/react/ds.config.json +1 -0
  78. package/dist/starters/react/package-lock.json +47 -0
  79. package/dist/starters/react/package.json +2 -1
  80. package/dist/test-boundaries.mjs +30 -1
  81. package/dist/themes-generated.mjs +15 -4
  82. package/dist/token-quality.mjs +27 -17
  83. package/dist/units.mjs +2 -1
  84. package/dist/validation-checks.mjs +5 -4
  85. package/dist/validation.mjs +1 -1
  86. package/dist/verification/browser.mjs +28 -2
  87. package/dist/verification.mjs +5 -4
  88. package/docs/ADS.md +4 -1
  89. package/docs/ARCHITECTURE.md +13 -3
  90. package/docs/CHANGELOG.md +92 -12
  91. package/docs/GUIDE.md +208 -14
  92. package/docs/MCP.md +14 -10
  93. package/package.json +1 -1
@@ -41,12 +41,16 @@ implicitly requiring them at acceptance.
41
41
  all registered behavior checks. Use before a release, after ownership/test/config
42
42
  migrations and for an explicit complete audit. Changed scope narrows registered
43
43
  owners while project scripts and core gates retain full scope.
44
- - `browserAudit: true` in either policy adds the axe-core audit of every rendered
45
- UI scenario in every brand and theme (`browser-accessibility-audit`). Its `a11y-axe`
46
- findings are errors that fail the policy. With `acceptance.browserAudit`, draft
44
+ - Both policies run the axe-core audit of every rendered UI scenario in every brand
45
+ and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
46
+ that policy. Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
47
+ that cannot run (no project Playwright or browser) fails it with a `browser-audit`
48
+ error naming what to install. Under the acceptance policy, draft
47
49
  acceptance and guarded patches/transactions audit the candidate's affected UI
48
50
  scenarios (all after configuration, foundation, token or asset changes) and reject
49
- the change on any `a11y-axe` error or a `browser-audit` failure to run. Declare
51
+ the change on any of those errors or a `browser-audit` failure. A render that fails is
52
+ retried on its own, up to 3 attempts; retried passes are listed under `retries`, and a scenario
53
+ that still fails is a `browser-audit` error naming it and the last cause. Declare
50
54
  `"sideEffects": ["**/*.css"]` in the project's `package.json`, as the starters do, so a
51
55
  component change audits only the scenarios that import it. See
52
56
  ads://guides/accessibility.
@@ -58,7 +62,7 @@ implicitly requiring them at acceptance.
58
62
  disable tests or weaken configuration to make a failing change pass.
59
63
 
60
64
  Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
61
- validation `behaviorChecks:true`, both `browserAudit:false`. No lint/test/build script names are inferred.
65
+ validation `behaviorChecks:true`, both `browserAudit:true`. No lint/test/build script names are inferred.
62
66
  Every listed script must exist; commands are trusted project configuration, not
63
67
  MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
64
68
  `acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
@@ -30,6 +30,8 @@ horizontal writing mode. In the inspected Linaria implementation, `padding` and
30
30
  it can override the intended size. Shared atom reuse and CSS splitting can make
31
31
  this visible in a larger build even when an isolated view appears correct.
32
32
  The order of class names in HTML does not decide equal-specificity rule order.
33
+ Queries on one property therefore use exclusive ranges, such as
34
+ `(min-width: 768px) and (max-width: 1023.98px)` beside `(min-width: 1024px)`.
33
35
  Valid tokens, successful extraction and a passing source check do not establish
34
36
  the intended computed value.
35
37
 
@@ -134,6 +134,45 @@ container width (768 and 1024 px) with container queries, since CSS variables ca
134
134
  breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
135
135
  widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
136
136
 
137
+ ### Widths are fluid on the grid; never a fixed cap
138
+
139
+ `--grid-span-1` to `--grid-span-16` are widths of N of 16 columns, fluid in their container.
140
+ Set one inside a container query, under a `Grid` or another `container-type: inline-size`
141
+ ancestor, and leave narrow containers at full width:
142
+
143
+ ```css
144
+ inline-size: 100%;
145
+ @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
146
+ ```
147
+
148
+ Atomic CSS does not keep rule order, so two queries on one property need exclusive ranges:
149
+
150
+ ```css
151
+ @container (min-width: 768px) and (max-width: 1023.98px) { max-inline-size: var(--grid-span-12); }
152
+ @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
153
+ ```
154
+
155
+ Use `%` or `fr` for a share of the parent and a `ch` measure for running text
156
+ (`max-inline-size: 65ch`).
157
+
158
+ `layout-fixed-width` is an error for `width`, `min-width`, `max-width`, the logical inline
159
+ sizes, `flex-basis`, `flex`'s basis and `grid-template-columns` tracks with a fixed length
160
+ above 48 px, the top of the control and icon range: `var(--space-32)`,
161
+ `calc(var(--space-32) * 10)`.
162
+
163
+ These pass: `flex: 1 1 <basis>`; `min()`, `max()`, `clamp()` and `calc()` with a fluid part; `minmax()` with a fluid
164
+ maximum; the part sizes `--icon-*`, `--control-*`, `--avatar-*`, `--border-*`, `--focus-*`,
165
+ `--ring-*`, `--radius-*`, `--side-pane-*`, `--toast-*`, `--navigation-rail-width`,
166
+ `--app-header-height`, `--row-height-compact`, `--compact-column-min`; and tokens named by
167
+ `layout.widthTokens` in `ds.config.json`, which must be defined with `%` or container units.
168
+ A fixed `--container-*` or `--content-max` token named there is a cap, valid only as a maximum.
169
+ `layout.fixedWidthUnits` lists owners that may use fixed widths, by unit id or file glob: list
170
+ overlays (dialogs, menus, popovers, tooltips) there. There is no per-declaration exception.
171
+
172
+ `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
173
+ horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
174
+ scrollers and `text-overflow: ellipsis` are exempt.
175
+
137
176
  ## Color roles and states
138
177
 
139
178
  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:
@@ -152,7 +152,7 @@ current rendered revision and complete acceptance before finishing the change.
152
152
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
153
153
  revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
154
  `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
155
- their normal paths. When `acceptance.browserAudit` is enabled it also runs the axe-core
155
+ their normal paths. Unless `acceptance.browserAudit` is false it also runs the axe-core
156
156
  audit on the candidate's affected UI scenarios; an `a11y-axe` error rejects the draft.
157
157
  Fix it in the component and accept the new revision. Changes during checking or baseline conflicts prevent
158
158
  application. Successful acceptance removes the proposal and records an event.
@@ -23,7 +23,7 @@ ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>",
23
23
  The dry run validates the candidate in an isolated project copy using mandatory
24
24
  ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
25
  affected registered behavior checks. Registration alone does not require a test
26
- at acceptance. With `acceptance.browserAudit`, axe-core also audits the candidate's
26
+ at acceptance. Unless `acceptance.browserAudit` is false, axe-core also audits the candidate's
27
27
  affected UI scenarios; `a11y-axe` errors reject the patch. See [validation policies](validation.md).
28
28
  Configured browser checks use that candidate's managed preview, not the live showcase. Read the summary, then page failing
29
29
  `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
@@ -41,12 +41,16 @@ implicitly requiring them at acceptance.
41
41
  all registered behavior checks. Use before a release, after ownership/test/config
42
42
  migrations and for an explicit complete audit. Changed scope narrows registered
43
43
  owners while project scripts and core gates retain full scope.
44
- - `browserAudit: true` in either policy adds the axe-core audit of every rendered
45
- UI scenario in every brand and theme (`browser-accessibility-audit`). Its `a11y-axe`
46
- findings are errors that fail the policy. With `acceptance.browserAudit`, draft
44
+ - Both policies run the axe-core audit of every rendered UI scenario in every brand
45
+ and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
46
+ that policy. Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
47
+ that cannot run (no project Playwright or browser) fails it with a `browser-audit`
48
+ error naming what to install. Under the acceptance policy, draft
47
49
  acceptance and guarded patches/transactions audit the candidate's affected UI
48
50
  scenarios (all after configuration, foundation, token or asset changes) and reject
49
- the change on any `a11y-axe` error or a `browser-audit` failure to run. Declare
51
+ the change on any of those errors or a `browser-audit` failure. A render that fails is
52
+ retried on its own, up to 3 attempts; retried passes are listed under `retries`, and a scenario
53
+ that still fails is a `browser-audit` error naming it and the last cause. Declare
50
54
  `"sideEffects": ["**/*.css"]` in the project's `package.json`, as the starters do, so a
51
55
  component change audits only the scenarios that import it. See
52
56
  ads://guides/accessibility.
@@ -58,7 +62,7 @@ implicitly requiring them at acceptance.
58
62
  disable tests or weaken configuration to make a failing change pass.
59
63
 
60
64
  Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
61
- validation `behaviorChecks:true`, both `browserAudit:false`. No lint/test/build script names are inferred.
65
+ validation `behaviorChecks:true`, both `browserAudit:true`. No lint/test/build script names are inferred.
62
66
  Every listed script must exist; commands are trusted project configuration, not
63
67
  MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
64
68
  `acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
@@ -30,6 +30,8 @@ horizontal writing mode. In the inspected Linaria implementation, `padding` and
30
30
  it can override the intended size. Shared atom reuse and CSS splitting can make
31
31
  this visible in a larger build even when an isolated view appears correct.
32
32
  The order of class names in HTML does not decide equal-specificity rule order.
33
+ Queries on one property therefore use exclusive ranges, such as
34
+ `(min-width: 768px) and (max-width: 1023.98px)` beside `(min-width: 1024px)`.
33
35
  Valid tokens, successful extraction and a passing source check do not establish
34
36
  the intended computed value.
35
37
 
@@ -103,7 +103,8 @@ generated `tokens/themes.generated.css` and `tokens/themes.generated.ts`. Run `a
103
103
  assets` after editing tokens or `ds.config.json` themes and brands without a running
104
104
  showcase or MCP server (`themes-generated` fails while they are stale). `ads audit`
105
105
  runs axe-core in every rendered UI scenario (`a11y-axe` errors; see
106
- ads://guides/accessibility). Set `assets.iconSource` to an SVG inside the ADS's
106
+ ads://guides/accessibility), the non-text contrast check (`a11y-non-text-contrast`) and the
107
+ overflow check at 390, 768 and 1280 px (`layout-overflow`; see ads://guides/tokens). Set `assets.iconSource` to an SVG inside the ADS's
107
108
  `assets/brand/`, relative to the ADS folder; no source means generation is a no-op.
108
109
  Integrate that directory through the app's existing asset mount. Fixed token
109
110
  names and prefixes are required; project values and artwork remain project-owned.
@@ -134,6 +134,45 @@ container width (768 and 1024 px) with container queries, since CSS variables ca
134
134
  breakpoints. The showcase's grid overlay draws these tokens over every preview at the same
135
135
  widths; a project without them shows no overlay. Align text to a cell's edge, not its gutter.
136
136
 
137
+ ### Widths are fluid on the grid; never a fixed cap
138
+
139
+ `--grid-span-1` to `--grid-span-16` are widths of N of 16 columns, fluid in their container.
140
+ Set one inside a container query, under a `Grid` or another `container-type: inline-size`
141
+ ancestor, and leave narrow containers at full width:
142
+
143
+ ```css
144
+ inline-size: 100%;
145
+ @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
146
+ ```
147
+
148
+ Atomic CSS does not keep rule order, so two queries on one property need exclusive ranges:
149
+
150
+ ```css
151
+ @container (min-width: 768px) and (max-width: 1023.98px) { max-inline-size: var(--grid-span-12); }
152
+ @container (min-width: 1024px) { max-inline-size: var(--grid-span-10); }
153
+ ```
154
+
155
+ Use `%` or `fr` for a share of the parent and a `ch` measure for running text
156
+ (`max-inline-size: 65ch`).
157
+
158
+ `layout-fixed-width` is an error for `width`, `min-width`, `max-width`, the logical inline
159
+ sizes, `flex-basis`, `flex`'s basis and `grid-template-columns` tracks with a fixed length
160
+ above 48 px, the top of the control and icon range: `var(--space-32)`,
161
+ `calc(var(--space-32) * 10)`.
162
+
163
+ These pass: `flex: 1 1 <basis>`; `min()`, `max()`, `clamp()` and `calc()` with a fluid part; `minmax()` with a fluid
164
+ maximum; the part sizes `--icon-*`, `--control-*`, `--avatar-*`, `--border-*`, `--focus-*`,
165
+ `--ring-*`, `--radius-*`, `--side-pane-*`, `--toast-*`, `--navigation-rail-width`,
166
+ `--app-header-height`, `--row-height-compact`, `--compact-column-min`; and tokens named by
167
+ `layout.widthTokens` in `ds.config.json`, which must be defined with `%` or container units.
168
+ A fixed `--container-*` or `--content-max` token named there is a cap, valid only as a maximum.
169
+ `layout.fixedWidthUnits` lists owners that may use fixed widths, by unit id or file glob: list
170
+ overlays (dialogs, menus, popovers, tooltips) there. There is no per-declaration exception.
171
+
172
+ `layout-overflow` (`ads audit`) renders every UI scenario at 390, 768 and 1280 px and fails on
173
+ horizontal page overflow, elements past the viewport and clipped content. `overflow-x: auto`
174
+ scrollers and `text-overflow: ellipsis` are exempt.
175
+
137
176
  ## Color roles and states
138
177
 
139
178
  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:
@@ -152,7 +152,7 @@ current rendered revision and complete acceptance before finishing the change.
152
152
  After rendered review, call `ads_accept({id,revision})` once. It checks that exact
153
153
  revision, runs mandatory ADS guards plus `acceptance.checks` and, when
154
154
  `acceptance.behaviorChecks` is enabled, affected registered behavior checks against an isolated candidate, and applies passing changes at
155
- their normal paths. When `acceptance.browserAudit` is enabled it also runs the axe-core
155
+ their normal paths. Unless `acceptance.browserAudit` is false it also runs the axe-core
156
156
  audit on the candidate's affected UI scenarios; an `a11y-axe` error rejects the draft.
157
157
  Fix it in the component and accept the new revision. Changes during checking or baseline conflicts prevent
158
158
  application. Successful acceptance removes the proposal and records an event.
@@ -23,7 +23,7 @@ ads_apply_patch({"unit":"components/Example","patchFile":"<returned patchFile>",
23
23
  The dry run validates the candidate in an isolated project copy using mandatory
24
24
  ADS guards, `acceptance.checks` and, when `acceptance.behaviorChecks` is enabled,
25
25
  affected registered behavior checks. Registration alone does not require a test
26
- at acceptance. With `acceptance.browserAudit`, axe-core also audits the candidate's
26
+ at acceptance. Unless `acceptance.browserAudit` is false, axe-core also audits the candidate's
27
27
  affected UI scenarios; `a11y-axe` errors reject the patch. See [validation policies](validation.md).
28
28
  Configured browser checks use that candidate's managed preview, not the live showcase. Read the summary, then page failing
29
29
  `outcomes`, `diagnostics` or pipeline `checks` through `ads_results` with its
@@ -41,12 +41,16 @@ implicitly requiring them at acceptance.
41
41
  all registered behavior checks. Use before a release, after ownership/test/config
42
42
  migrations and for an explicit complete audit. Changed scope narrows registered
43
43
  owners while project scripts and core gates retain full scope.
44
- - `browserAudit: true` in either policy adds the axe-core audit of every rendered
45
- UI scenario in every brand and theme (`browser-accessibility-audit`). Its `a11y-axe`
46
- findings are errors that fail the policy. With `acceptance.browserAudit`, draft
44
+ - Both policies run the axe-core audit of every rendered UI scenario in every brand
45
+ and theme (`browser-accessibility-audit`); `browserAudit: false` turns it off for
46
+ that policy. Its `a11y-axe`, `a11y-non-text-contrast` and `layout-overflow` findings are errors that fail the policy, and an audit
47
+ that cannot run (no project Playwright or browser) fails it with a `browser-audit`
48
+ error naming what to install. Under the acceptance policy, draft
47
49
  acceptance and guarded patches/transactions audit the candidate's affected UI
48
50
  scenarios (all after configuration, foundation, token or asset changes) and reject
49
- the change on any `a11y-axe` error or a `browser-audit` failure to run. Declare
51
+ the change on any of those errors or a `browser-audit` failure. A render that fails is
52
+ retried on its own, up to 3 attempts; retried passes are listed under `retries`, and a scenario
53
+ that still fails is a `browser-audit` error naming it and the last cause. Declare
50
54
  `"sideEffects": ["**/*.css"]` in the project's `package.json`, as the starters do, so a
51
55
  component change audits only the scenarios that import it. See
52
56
  ads://guides/accessibility.
@@ -58,7 +62,7 @@ implicitly requiring them at acceptance.
58
62
  disable tests or weaken configuration to make a failing change pass.
59
63
 
60
64
  Defaults: both script lists are empty, acceptance `behaviorChecks:false`,
61
- validation `behaviorChecks:true`, both `browserAudit:false`. No lint/test/build script names are inferred.
65
+ validation `behaviorChecks:true`, both `browserAudit:true`. No lint/test/build script names are inferred.
62
66
  Every listed script must exist; commands are trusted project configuration, not
63
67
  MCP arguments. `mcp.mutationChecks` is a configuration error: list those scripts in
64
68
  `acceptance.checks` and set `acceptance.behaviorChecks`. `mcp.mutationCheckTimeoutMs`
@@ -7,6 +7,7 @@
7
7
  "mcp": {
8
8
  "previewManifest": ".ds/preview/manifest.json"
9
9
  },
10
+ "layout": { "widthTokens": ["--grid-span-*", "--container-*"] },
10
11
  "boundaries": {
11
12
  "styleWrites": [
12
13
  {
@@ -28,6 +28,7 @@
28
28
  "@babel/preset-typescript": "7.29.7",
29
29
  "@biomejs/biome": "2.5.15",
30
30
  "@linaria/atomic": "8.0.0",
31
+ "@playwright/test": "1.64.1",
31
32
  "@types/node": "25.9.4",
32
33
  "@wyw-in-js/vite": "2.1.3",
33
34
  "oxlint": "1.72.0",
@@ -245,7 +245,7 @@ Keep original artwork, variants, usage, credits, and licenses in
245
245
  `logo.dark.svg`, `app-icon.svg`) with its README; replace it with the product's own.
246
246
  Other products' logos are not brand artwork or glyphs: keep them, in their own
247
247
  colors and under their owners' trademark and usage terms, in `assets/logos/` and
248
- show them as images (a CSS mask over `currentColor` for a muted use); ADS generates
248
+ show them as images, never muted, tinted or recolored; ADS generates
249
249
  and checks nothing there.
250
250
  Font assets belong in `assets/fonts/`; add optional `tokens/fonts.css` first in
251
251
  the import-only foundation entry. The fixed import order is fonts (when
@@ -29,6 +29,7 @@ previews. The application can keep its Node/npm build pipeline.
29
29
  npx @reqvire-org/ads create my-design-system --framework react # or preact
30
30
  cd my-design-system
31
31
  npm install
32
+ npx playwright install chromium # browser for the accessibility audit in ads validate
32
33
  npm run build
33
34
  npm run dev:showcase
34
35
  ```
@@ -41,7 +42,7 @@ npx --yes --package "$ads_tool_package" ads create my-design-system --framework
41
42
  ```
42
43
 
43
44
  For Bun, add `--package-manager bun`: scripts use `bun run` and no npm lockfile is
44
- kept. Use `bun install` and `bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
45
+ kept. Use `bun install`, `bunx playwright install chromium` and `bun --bun run build`/`bun --bun run dev:showcase`. Node is unnecessary with Bun
45
46
  1.4.1+. ADS supplies its Bun preview compiler independently of the project build.
46
47
 
47
48
  For an existing application, merge only the ADS source and required extraction,
@@ -109,8 +110,19 @@ The foundation meets WCAG 2.2 AA:
109
110
  so it fits any pane. The showcase's grid button draws the project's grid over every
110
111
  preview to check alignment.
111
112
 
113
+ `components/Content/Image` loads lazily and reserves its space; give `priority` to the view's main
114
+ visible image only. If you add fonts in `tokens/fonts.css`, `ads assets` writes
115
+ `tokens/fonts.preload.generated.ts`: call its `preloadFonts()` in the app entry.
116
+
117
+ Widths are fluid on the grid: set a `--grid-span-N` token (N of 16 columns) in a container
118
+ query, or use `%`, `fr` or a `ch` measure. `layout.widthTokens` in `ds.config.json` names the
119
+ allowed width tokens, and `layout.fixedWidthUnits` the owners that may use fixed widths, such
120
+ as overlays.
121
+
112
122
  `ads check` fails when a text or control pair falls below WCAG AA in any theme or brand
113
- (`token-contrast`) and when a spacing step leaves the 2 px rhythm (`token-rhythm`).
123
+ (`token-contrast`, `component-contrast`), when a spacing step leaves the 2 px rhythm
124
+ (`token-rhythm`) and on fixed widths (`layout-fixed-width`). `ads audit` fails horizontal
125
+ overflow at 390, 768 and 1280 px (`layout-overflow`).
114
126
  `ads tokens --format dtcg` exports the tokens as W3C Design Tokens JSON for design tools.
115
127
 
116
128
  The six token scenarios (`tokens/Color`, `Type`, `Space`, `Shape`, `Motion`, `Layout`)
@@ -40,7 +40,7 @@ const variants = {
40
40
  `,
41
41
  secondary: css`
42
42
  background: var(--bg-surface);
43
- border-color: var(--border-default);
43
+ border-color: var(--border-strong);
44
44
  color: var(--text-body);
45
45
  &:hover:not(:disabled) { border-color: var(--accent); }
46
46
  `,
@@ -0,0 +1,2 @@
1
+ const picture = "data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' fill='%23888'/%3E%3C/svg%3E";
2
+ export const fixture = { title: "Image", src: picture, alt: "A grey placeholder" } as const;
@@ -0,0 +1,13 @@
1
+ import { Image } from "@ds";
2
+ import { DemoFrame } from "@ds/review";
3
+ import { fixture } from "./Image.ads.fixture";
4
+ export const scenario = { title: fixture.title, covers: ["Image"] };
5
+ export default function Scenario() {
6
+ return (
7
+ <DemoFrame>
8
+ <Image src={fixture.src} alt={fixture.alt} width={160} height={90} priority />
9
+ <Image src={fixture.src} alt={fixture.alt} width={160} height={90} />
10
+ <Image src={fixture.src} alt={fixture.alt} aspectRatio="16 / 9" />
11
+ </DemoFrame>
12
+ );
13
+ }
@@ -0,0 +1,48 @@
1
+ import { css, cx } from "@linaria/atomic";
2
+
3
+ export type ImageProps = {
4
+ src: string;
5
+ /** Candidate files with width descriptors; list `sizes` with them. For large content images. */
6
+ srcset?: string;
7
+ /** How wide the image displays: `"(min-width: 1024px) 50vw, 100vw"`. */
8
+ sizes?: string;
9
+ /** What the image shows; `""` when it is decorative. */
10
+ alt: string;
11
+ /** The page's main visible image: loads first, never lazily. Use it once per view. */
12
+ priority?: boolean;
13
+ } & (
14
+ /** The file's size, which reserves the space before it loads. */
15
+ | { width: number; height: number; aspectRatio?: undefined }
16
+ /** A fluid image: `"16 / 9"`, filling its container's width. */
17
+ | { aspectRatio: "1 / 1" | "4 / 3" | "16 / 9"; width?: undefined; height?: undefined }
18
+ );
19
+
20
+ const base = css`
21
+ display: block;
22
+ max-inline-size: 100%;
23
+ block-size: auto;
24
+ `;
25
+ const ratios = {
26
+ "1 / 1": css`inline-size: 100%; aspect-ratio: 1 / 1; object-fit: cover;`,
27
+ "4 / 3": css`inline-size: 100%; aspect-ratio: 4 / 3; object-fit: cover;`,
28
+ "16 / 9": css`inline-size: 100%; aspect-ratio: 16 / 9; object-fit: cover;`,
29
+ };
30
+
31
+ /** An image that reserves its space and loads lazily, unless it is the view's main visible one. */
32
+ export function Image({ src, srcset, sizes, alt, priority = false, width, height, aspectRatio }: ImageProps) {
33
+ // loading comes before src, so the browser reads it before it starts the download.
34
+ return (
35
+ <img
36
+ className={cx("ds-image", base, aspectRatio && ratios[aspectRatio])}
37
+ loading={priority ? "eager" : "lazy"}
38
+ decoding="async"
39
+ fetchPriority={priority ? "high" : undefined}
40
+ width={width}
41
+ height={height}
42
+ sizes={sizes}
43
+ srcSet={srcset}
44
+ src={src}
45
+ alt={alt}
46
+ />
47
+ );
48
+ }
@@ -0,0 +1,20 @@
1
+ # Image
2
+
3
+ An image that reserves its space and chooses how it loads. By default it uses `loading="lazy"`
4
+ and `decoding="async"`. Give it `width` and `height` (the file's size) or an `aspectRatio`.
5
+
6
+ Use `priority` for the view's main visible image, usually a hero: it loads eagerly with
7
+ `fetchpriority="high"`. Lazy loading above the fold delays what the reader sees first, so one
8
+ image per view takes `priority`. Everything below the fold stays lazy.
9
+
10
+ Use `srcset` with width descriptors and `sizes` for large content images, not icons or logos.
11
+ Generate the widths in the project's build or CDN.
12
+
13
+ | Prop | Type | Default |
14
+ |---|---|---|
15
+ | `src` | `string` | — |
16
+ | `srcset`, `sizes` | `string` | — |
17
+ | `alt` | `string` | — |
18
+ | `width`, `height` | `number` | — |
19
+ | `aspectRatio` | `"1 / 1" \| "4 / 3" \| "16 / 9"` | — |
20
+ | `priority` | `boolean` | `false` |
@@ -28,8 +28,8 @@ const dark = css`display: var(--display-dark, block);`;
28
28
  export function Logo({ label, size = "small" }: LogoProps) {
29
29
  return (
30
30
  <span className={cx("ds-logo", base, sizes[size])} role="img" aria-label={label}>
31
- <img className={cx(image, light)} src={logo} alt="" />
32
- <img className={cx(image, dark)} src={logoDark} alt="" />
31
+ <img className={cx(image, light)} loading="eager" width={160} height={40} src={logo} alt="" />
32
+ <img className={cx(image, dark)} loading="eager" width={160} height={40} src={logoDark} alt="" />
33
33
  </span>
34
34
  );
35
35
  }
@@ -6,6 +6,7 @@ export { Button, type ButtonProps } from "./components/Actions/Button/Button";
6
6
  export { IconButton, type IconButtonProps } from "./components/Actions/IconButton/IconButton";
7
7
  export { Icon, iconNames, type IconName, type IconProps } from "./components/Content/Icon/Icon";
8
8
  export { Logo, type LogoProps } from "./components/Content/Logo/Logo";
9
+ export { Image, type ImageProps } from "./components/Content/Image/Image";
9
10
  export { TextField, type TextFieldProps } from "./components/Forms/TextField/TextField";
10
11
  export { Grid, GridItem, type GridProps, type GridItemProps } from "./components/Layout/Grid/Grid";
11
12
  export { SearchBar, type SearchBarProps } from "./patterns/Search/SearchBar/SearchBar";
@@ -11,6 +11,22 @@ export const fixture = {
11
11
  {"token": "--grid-margin-sm", "property": "width", "probe": "13.375px"},
12
12
  {"token": "--grid-margin-md", "property": "width", "probe": "13.375px"},
13
13
  {"token": "--grid-margin-lg", "property": "width", "probe": "13.375px"},
14
+ {"token": "--grid-span-1", "property": "width", "probe": "13.375px"},
15
+ {"token": "--grid-span-2", "property": "width", "probe": "13.375px"},
16
+ {"token": "--grid-span-3", "property": "width", "probe": "13.375px"},
17
+ {"token": "--grid-span-4", "property": "width", "probe": "13.375px"},
18
+ {"token": "--grid-span-5", "property": "width", "probe": "13.375px"},
19
+ {"token": "--grid-span-6", "property": "width", "probe": "13.375px"},
20
+ {"token": "--grid-span-7", "property": "width", "probe": "13.375px"},
21
+ {"token": "--grid-span-8", "property": "width", "probe": "13.375px"},
22
+ {"token": "--grid-span-9", "property": "width", "probe": "13.375px"},
23
+ {"token": "--grid-span-10", "property": "width", "probe": "13.375px"},
24
+ {"token": "--grid-span-11", "property": "width", "probe": "13.375px"},
25
+ {"token": "--grid-span-12", "property": "width", "probe": "13.375px"},
26
+ {"token": "--grid-span-13", "property": "width", "probe": "13.375px"},
27
+ {"token": "--grid-span-14", "property": "width", "probe": "13.375px"},
28
+ {"token": "--grid-span-15", "property": "width", "probe": "13.375px"},
29
+ {"token": "--grid-span-16", "property": "width", "probe": "13.375px"},
14
30
  {"token": "--content-max", "property": "width", "probe": "13.375px"},
15
31
  {"token": "--container-sm", "property": "width", "probe": "13.375px"},
16
32
  {"token": "--container-md", "property": "width", "probe": "13.375px"},
@@ -67,6 +67,24 @@
67
67
  --grid-margin-sm: var(--space-0);
68
68
  --grid-margin-md: var(--space-8);
69
69
  --grid-margin-lg: var(--space-12);
70
+ /* A width of N of 16 columns, fluid in its container: set it inside a container query.
71
+ --container-* are fixed caps, for max-inline-size only. */
72
+ --grid-span-1: calc((100% + var(--grid-gutter)) * 1 / 16 - var(--grid-gutter));
73
+ --grid-span-2: calc((100% + var(--grid-gutter)) * 2 / 16 - var(--grid-gutter));
74
+ --grid-span-3: calc((100% + var(--grid-gutter)) * 3 / 16 - var(--grid-gutter));
75
+ --grid-span-4: calc((100% + var(--grid-gutter)) * 4 / 16 - var(--grid-gutter));
76
+ --grid-span-5: calc((100% + var(--grid-gutter)) * 5 / 16 - var(--grid-gutter));
77
+ --grid-span-6: calc((100% + var(--grid-gutter)) * 6 / 16 - var(--grid-gutter));
78
+ --grid-span-7: calc((100% + var(--grid-gutter)) * 7 / 16 - var(--grid-gutter));
79
+ --grid-span-8: calc((100% + var(--grid-gutter)) * 8 / 16 - var(--grid-gutter));
80
+ --grid-span-9: calc((100% + var(--grid-gutter)) * 9 / 16 - var(--grid-gutter));
81
+ --grid-span-10: calc((100% + var(--grid-gutter)) * 10 / 16 - var(--grid-gutter));
82
+ --grid-span-11: calc((100% + var(--grid-gutter)) * 11 / 16 - var(--grid-gutter));
83
+ --grid-span-12: calc((100% + var(--grid-gutter)) * 12 / 16 - var(--grid-gutter));
84
+ --grid-span-13: calc((100% + var(--grid-gutter)) * 13 / 16 - var(--grid-gutter));
85
+ --grid-span-14: calc((100% + var(--grid-gutter)) * 14 / 16 - var(--grid-gutter));
86
+ --grid-span-15: calc((100% + var(--grid-gutter)) * 15 / 16 - var(--grid-gutter));
87
+ --grid-span-16: calc((100% + var(--grid-gutter)) * 16 / 16 - var(--grid-gutter));
70
88
 
71
89
  --content-max: 72ch;
72
90
  --container-sm: 40rem;
@@ -7,6 +7,7 @@
7
7
  "mcp": {
8
8
  "previewManifest": ".ds/preview/manifest.json"
9
9
  },
10
+ "layout": { "widthTokens": ["--grid-span-*", "--container-*"] },
10
11
  "boundaries": {
11
12
  "styleWrites": [
12
13
  {
@@ -12,6 +12,7 @@
12
12
  "@babel/preset-typescript": "7.29.7",
13
13
  "@biomejs/biome": "2.5.15",
14
14
  "@linaria/atomic": "8.0.0",
15
+ "@playwright/test": "1.64.1",
15
16
  "@types/node": "25.9.4",
16
17
  "@types/react": "19.2.17",
17
18
  "@types/react-dom": "19.2.3",
@@ -24,6 +25,7 @@
24
25
  "vite": "6.4.3"
25
26
  },
26
27
  "engines": {
28
+ "bun": ">=1.4.1",
27
29
  "node": ">=22.12.0"
28
30
  }
29
31
  },
@@ -2768,6 +2770,22 @@
2768
2770
  "node": "^20.19.0 || >=22.12.0"
2769
2771
  }
2770
2772
  },
2773
+ "node_modules/@playwright/test": {
2774
+ "version": "1.64.1",
2775
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.64.1.tgz",
2776
+ "integrity": "sha512-IaYGml/nSOiZWROfPtuIL7neuu9qDOZ3TNvNljUIrhDMxiGTgPjzj/g9p9RxpS2tSepPDRY+UwAaEeiKtUvIAg==",
2777
+ "dev": true,
2778
+ "license": "Apache-2.0",
2779
+ "dependencies": {
2780
+ "playwright": "1.64.1"
2781
+ },
2782
+ "bin": {
2783
+ "playwright": "cli.js"
2784
+ },
2785
+ "engines": {
2786
+ "node": ">=20"
2787
+ }
2788
+ },
2771
2789
  "node_modules/@rolldown/pluginutils": {
2772
2790
  "version": "1.0.0-beta.27",
2773
2791
  "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
@@ -4171,6 +4189,35 @@
4171
4189
  "dev": true,
4172
4190
  "license": "ISC"
4173
4191
  },
4192
+ "node_modules/playwright": {
4193
+ "version": "1.64.1",
4194
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz",
4195
+ "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==",
4196
+ "dev": true,
4197
+ "license": "Apache-2.0",
4198
+ "dependencies": {
4199
+ "playwright-core": "1.64.1"
4200
+ },
4201
+ "bin": {
4202
+ "playwright": "cli.js"
4203
+ },
4204
+ "engines": {
4205
+ "node": ">=20"
4206
+ }
4207
+ },
4208
+ "node_modules/playwright-core": {
4209
+ "version": "1.64.1",
4210
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz",
4211
+ "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==",
4212
+ "dev": true,
4213
+ "license": "Apache-2.0",
4214
+ "bin": {
4215
+ "playwright-core": "cli.js"
4216
+ },
4217
+ "engines": {
4218
+ "node": ">=20"
4219
+ }
4220
+ },
4174
4221
  "node_modules/postcss": {
4175
4222
  "version": "8.5.29",
4176
4223
  "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz",
@@ -24,10 +24,11 @@
24
24
  "build:mcp-previews": "ads compile ."
25
25
  },
26
26
  "devDependencies": {
27
- "@biomejs/biome": "2.5.15",
28
27
  "@babel/preset-react": "7.29.7",
29
28
  "@babel/preset-typescript": "7.29.7",
29
+ "@biomejs/biome": "2.5.15",
30
30
  "@linaria/atomic": "8.0.0",
31
+ "@playwright/test": "1.64.1",
31
32
  "@types/node": "25.9.4",
32
33
  "@types/react": "19.2.17",
33
34
  "@types/react-dom": "19.2.3",