@reqvire-org/ads 0.5.4 → 0.5.5

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 (95) hide show
  1. package/dist/ads-errors.mjs +105 -8
  2. package/dist/analysis/client-directive.mjs +26 -0
  3. package/dist/analysis/externals.mjs +47 -0
  4. package/dist/analysis/module-graph.mjs +6 -0
  5. package/dist/analysis/owner-analysis-key.mjs +1 -1
  6. package/dist/analysis/owner-choices.mjs +12 -2
  7. package/dist/analysis/owner-composition.mjs +19 -4
  8. package/dist/analysis/owner-source.mjs +112 -15
  9. package/dist/border-paint.mjs +34 -0
  10. package/dist/check.mjs +2 -0
  11. package/dist/composed-contrast.mjs +10 -7
  12. package/dist/construction-output.mjs +52 -27
  13. package/dist/construction-spec.d.mts +40 -10
  14. package/dist/construction-spec.mjs +41 -17
  15. package/dist/corner-overpaint.mjs +3 -1
  16. package/dist/design-foundation.mjs +14 -0
  17. package/dist/emit/owner-emission-cache.mjs +1 -1
  18. package/dist/end-alignment.mjs +69 -0
  19. package/dist/external-macro.d.mts +20 -0
  20. package/dist/external-macro.mjs +12 -0
  21. package/dist/finding-rules.mjs +3 -0
  22. package/dist/forced-colors.mjs +81 -0
  23. package/dist/frame-regions.mjs +2 -2
  24. package/dist/guard/externals.mjs +64 -0
  25. package/dist/guard/run.mjs +9 -5
  26. package/dist/inventories.mjs +1 -1
  27. package/dist/lowering-layer.mjs +38 -4
  28. package/dist/lowering-overlaps.mjs +7 -0
  29. package/dist/lowering-properties.mjs +1 -0
  30. package/dist/lowering-region-layout.mjs +22 -3
  31. package/dist/lowering-session.mjs +1 -1
  32. package/dist/mcp/preview-http.bundle.js +2 -2
  33. package/dist/mcp/preview-widget.bundle.js +12 -12
  34. package/dist/measured-geometry.mjs +8 -2
  35. package/dist/owner-analysis-check.mjs +190 -11
  36. package/dist/owner-errors.mjs +3 -0
  37. package/dist/owner-lowering.mjs +3 -2
  38. package/dist/ownership-model.mjs +6 -3
  39. package/dist/platform-features.mjs +1 -0
  40. package/dist/preview-bun.mjs +15 -2
  41. package/dist/profile-macro.d.mts +18 -0
  42. package/dist/recipe-macro.d.mts +49 -6
  43. package/dist/recipe-model.mjs +13 -5
  44. package/dist/region-lowering.mjs +115 -22
  45. package/dist/render-audit/axe-run.page.mjs +40 -1
  46. package/dist/render-audit/forced-states.page.mjs +37 -0
  47. package/dist/render-audit/layout-overflow.page.mjs +52 -2
  48. package/dist/render-audit/non-text-contrast.page.mjs +14 -10
  49. package/dist/render-audit/worker.mjs +38 -0
  50. package/dist/render-audit.mjs +42 -5
  51. package/dist/role-vocabulary.d.mts +2 -2
  52. package/dist/role-vocabulary.mjs +3 -3
  53. package/dist/scenario-kit.d.mts +2 -2
  54. package/dist/showcase/assets-view.mjs +12 -47
  55. package/dist/showcase/client.bundle.js +54 -54
  56. package/dist/showcase/http-client.bundle.js +18 -18
  57. package/dist/showcase/token-sample.mjs +2 -2
  58. package/dist/showcase/ui/ui.css +1 -1
  59. package/dist/showcase/ui/ui.js +13 -13
  60. package/dist/skills/ads-designer/references/accessibility.md +21 -1
  61. package/dist/skills/ads-designer/references/branding.md +4 -0
  62. package/dist/skills/ads-designer/references/design-data.md +6 -0
  63. package/dist/skills/ads-designer/references/layers.md +5 -0
  64. package/dist/skills/ads-designer/references/layout.md +8 -1
  65. package/dist/skills/ads-designer/references/recipes.md +36 -0
  66. package/dist/skills/ads-designer/references/runtimes.md +4 -0
  67. package/dist/skills/ads-designer/references/scenarios.md +2 -0
  68. package/dist/skills/ads-import/references/design-data.md +6 -0
  69. package/dist/skills/ads-import/references/layers.md +5 -0
  70. package/dist/skills/ads-import/references/layout.md +8 -1
  71. package/dist/skills/ads-import/references/recipes.md +36 -0
  72. package/dist/skills/ads-import/references/runtimes.md +4 -0
  73. package/dist/skills/ads-import/references/scenarios.md +2 -0
  74. package/dist/skills/ads-migrate/SKILL.md +1 -0
  75. package/dist/skills/ads-migrate/references/0.5.4-to-0.5.5.md +61 -0
  76. package/dist/skills/ads-port/references/design-data.md +6 -0
  77. package/dist/skills/ads-port/references/layers.md +5 -0
  78. package/dist/skills/ads-port/references/layout.md +8 -1
  79. package/dist/skills/ads-port/references/recipes.md +36 -0
  80. package/dist/skills/ads-port/references/runtimes.md +4 -0
  81. package/dist/skills/ads-port/references/scenarios.md +2 -0
  82. package/dist/spatial-model.mjs +37 -10
  83. package/dist/system-colors.d.mts +9 -0
  84. package/dist/system-colors.mjs +1 -0
  85. package/dist/target-size.mjs +14 -1
  86. package/dist/tsconfig.declarations.json +1 -0
  87. package/docs/ADS.md +23 -1
  88. package/docs/ASSETS.md +21 -0
  89. package/docs/CACHING.md +1 -1
  90. package/docs/CHANGELOG.md +167 -21
  91. package/docs/GUIDE.md +31 -20
  92. package/docs/LANGUAGE.md +118 -6
  93. package/docs/PROFILE-KINDS.md +50 -4
  94. package/docs/RULES.md +21 -8
  95. package/package.json +5 -1
@@ -32,7 +32,8 @@ The `a11y-*` rules check tokens, profiles and constructions (WCAG 2.2 AA):
32
32
 
33
33
  | Rule | What it requires | WCAG |
34
34
  |---|---|---|
35
- | `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; a smaller part of a stack or inline arrangement passes by the spacing exception when 24px circles centred on it and its neighbouring targets keep clear; neighbouring hit areas never overlap | 2.5.8 |
35
+ | `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; a smaller part of a stack or inline arrangement passes by the spacing exception when 24px circles centred on it and its neighbouring targets keep clear, as does a private control component the design system places only as a component part of such arrangements; neighbouring hit areas never overlap | 2.5.8 |
36
+ | `a11y-forced-colors` | A control keeps an edge in forced colours (Windows contrast themes): its frame draws a border in every context (`borderStyle: "forced-only"` keeps it transparent otherwise); a surface's `forcedColors` names CSS system colours. `a11y-forced-colors-review` lists a selected, pressed, checked or current state shown only by fill without `forcedColors` | 1.4.11 |
36
37
  | `a11y-focus` | Every focus profile's width is at least 2px; the default indicator `foundation({ focus })` has 3:1 on the document surface | 2.4.7, 1.4.11 |
37
38
  | `surface-contrast` | A surface profile setting `color` and `background` reaches 4.5:1 in every context, or 3:1 where every use of it is large text or artwork (a visual part, a text-less control), and has no minimum where every use is an `aria-hidden` visual part, or where its `color` is fully transparent (a glyph shown only on hover: it draws nothing at rest, and the states that show it keep their minimum); a surface for disabled controls declares `state: "inactive"` (no minimum) and is selected only under `:disabled` or `[aria-disabled="true"]` (`construction/inactive-surface-active`) | 1.4.3 |
38
39
  | `a11y-text-resize` | `font-size` and length `line-height` tokens in `rem` or `em` | 1.4.4 |
@@ -119,6 +120,16 @@ the candidates with their ratios and let them choose.
119
120
  color carries normal-size text, so the system has one passing variant, not several.
120
121
 
121
122
  <a id="declared-boundary"></a>
123
+
124
+ - **Decorative text.** Text inside `aria-hidden="true"` (a breadcrumb's "/") has no contrast minimum, as decorative
125
+ artwork has none. Never hide information that way.
126
+ - **Forced colours.** A surface's `forcedColors` (`background`, `color`, `border`, from CSS system colours) is
127
+ written under `@media (forced-colors: active)`; a control's frame draws a border, or `borderStyle: "forced-only"`
128
+ (`a11y-forced-colors`); a selected, pressed, checked or current state shown only by fill is reviewed.
129
+ - **Icons in provided colours** are proven at 3:1 through every placement, as text is.
130
+ - **Small controls placed by another owner** pass 2.5.8's spacing exception when private and placed only between
131
+ spaced neighbours in the design system's arrangements.
132
+
122
133
  ## A declared boundary: rare, and only with a person's approval
123
134
 
124
135
  `a11y-non-text-contrast` stays an error at WCAG 2.2 AA. When a text field's design
@@ -200,6 +211,15 @@ tests, Lighthouse) and report what ran.
200
211
  A clean audit is not a pass: automated rules find only part of the WCAG failures. Keep the
201
212
  manual checks below.
202
213
 
214
+ - **Environment passes.** Each scenario is also audited in forced colours and with a coarse pointer; axe findings new
215
+ there name the environment, and in forced colours a selected, pressed, checked or current element that renders
216
+ like its sibling without that state fails (`a11y-forced-colors-render`).
217
+ - **What the layout pass reports.** Words broken across lines by a squeezed box (`broken-word`); a scroll area
218
+ collapsed to nothing while it holds content (`collapsed-scroller`); a box whose painted edge a clip cuts (a card's
219
+ border and corners); text, controls and overflow as before. An inert pane of no size is skipped.
220
+ - **What it no longer reports.** A target whose owned hit area is 24 × 24px; `aria-hidden` text (avatar initials)
221
+ as a control's visible label; a multi-colour mark judged by its first outline instead of its strongest paint.
222
+
203
223
  ## What only design and testing establish
204
224
 
205
225
  - **Color is never the only signal.** Pair status color with text or an icon; underline links
@@ -164,3 +164,7 @@ own (`assets/logos/`), with a drawing per colour scheme, a `minDrawnHeight` belo
164
164
  which it is not legible, and its owner's license terms in `license`. An owner
165
165
  binds it by name with one visual profile and takes the theme it sits in; the
166
166
  example design system's `PartnerLogo` shows the form.
167
+
168
+ A logo with a light and a dark file follows the page's scheme without a `theme` prop: two visual parts with
169
+ `scheme: "light"` and `scheme: "dark"`, each bound for a theme of that scheme (docs/ASSETS.md, "Declared artwork
170
+ that follows the page's scheme").
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
109
109
  Nowhere-declared references keep one `token-css/token-missing` error per authored
110
110
  site, including with a fallback and when unused; provenance does not duplicate it.
111
111
 
112
+ - A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
113
+ - The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
114
+ fallback (`foundation/document-text-incomplete`).
115
+ - A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
116
+ colour (`review/border-paint-missing`).
117
+
112
118
  ## Units
113
119
 
114
120
  `ads check` restricts the unit in three places: `font-size`, and `line-height`
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
94
94
  effects through props and callbacks. Re-exporting an application store, router
95
95
  or service from a helper does not make it part of the design system.
96
96
 
97
+ A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
98
+ in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
99
+ re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
100
+ the class and no style of its own.
101
+
97
102
  ## Styling rules (blocking)
98
103
 
99
104
  Components own their control states and appearance. Patterns own arrangement,
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
55
55
  media queries and track lists, so a context cannot change them
56
56
  (`spatial-context-unsupported`): declare another spatial profile instead.
57
57
 
58
+ - **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
59
+ `column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
60
+ Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
61
+
58
62
  ## Choose the behaviour first
59
63
 
60
64
  | The user wants… | Choose |
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
105
109
  "end-end"] } } }`. A named condition holds below its bound.
106
110
 
107
111
  Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
108
- (one positive number per local column). Never write `grid-template-columns`.
112
+ (one positive number per local column). Columns as wide as their content, a
113
+ space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
114
+ that tier the columns share the width, so place the cells for the narrower
115
+ tiers. Never write `grid-template-columns`.
109
116
 
110
117
  The field exposes its label, control and help rows; `alignRows` binds them through
111
118
  subgrid. The cell must span exactly those rows, in the order the component exposes
@@ -175,6 +175,9 @@ a recipe never creates a state machine.
175
175
  reset }` on the container, `counter: { increment }` on each item, and
176
176
  `content: { counters | counter, separator, suffix }` on its `marker` or
177
177
  `before`. Check marks are a visual part in the item, not a marker.
178
+ - A code block either keeps each line whole and scrolls (`overflow: "scroll-inline"`, focusable) or keeps the text's
179
+ spaces and line breaks and wraps long lines so all of it is visible (`wrap: "preserve"` on its code text). Choose
180
+ by what matters more: lines that read exactly as written, or nothing hidden.
178
181
  - A rule between children (table rows, settings rows) is `between: { surface,
179
182
  frame }` on their parent, never borders on each child with a last-child
180
183
  exception. Text only assistive technology reads (a table caption) is a part
@@ -276,6 +279,21 @@ fragment or a native frame-only element.
276
279
  `mandatory` or `proximity`), aligning the children it places. Snap without
277
280
  scrolling, or a child's own snap, is rejected.
278
281
 
282
+ - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
283
+ stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
284
+ `inline` row, `gap` spaces the items and `rowGap` the lines.
285
+ - **Loose flow.** `carry: true` on a list and on its item: an item that ends in a paragraph, code block or figure is
286
+ followed at the larger of the list's gap and that block's space after; after the last item the list's own space
287
+ after applies.
288
+ - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
289
+ scrolling body never collapses in a stack sized by its content.
290
+ - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
291
+ edge, an unpainted one where its content ends. Put a header on the same grid and gutter as the sections below it.
292
+ - **Tables.** `align: "start"` on a cell (`vertical-align: top` for rows whose cells wrap to different heights);
293
+ `extent: "container"` on a table root makes it as wide as its container.
294
+ - **The document.** One pattern may render the page's `<html>`: `recipe({ element: "document" })`, with `lang`
295
+ from a required prop, `<body>` inside, and the framework's `head` and `end` slots.
296
+
279
297
  <a id="layers"></a>
280
298
  ## Layers
281
299
 
@@ -300,6 +318,10 @@ A region recipe's root can live in the browser's top layer through a closed
300
318
  no authored `open` on a sheet, an accessible name, and no layer root as a grid
301
319
  cell. Focus, Escape and dismissal are behaviour guarantees for browser tests.
302
320
 
321
+ - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
322
+ profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
323
+ `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
324
+
303
325
  <a id="measured"></a>
304
326
  ## Measured values and runtime paints
305
327
 
@@ -375,6 +397,14 @@ text part breaks one way, set by one `wrap` field:
375
397
  its alignment, on a control's label too. Balanced, pretty and trimmed text degrade to plain wrapping and
376
398
  spacing in a browser without them.
377
399
 
400
+ - **Code that wraps.** `wrap: "preserve"` keeps spaces and line breaks and wraps long lines, so the whole block is
401
+ visible; `overflow: "scroll-inline"` keeps lines whole instead.
402
+ - **Truncation.** One-line `wrap: "truncate"` clips only sideways, so descenders stay whole with a trimmed line box.
403
+ - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
404
+ browser's font, centred text, border, fill and margin wherever the construction states none.
405
+ - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
406
+ frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
407
+
378
408
  <a id="assets"></a>
379
409
  ## Assets in recipes
380
410
 
@@ -388,6 +418,12 @@ glyph reference, never a name string. Brand artwork and multicolour drawings
388
418
  are declared under `assets/`: see `ads://guides/branding` and
389
419
  `ads://guides/pictograms`.
390
420
 
421
+ - **A logo per colour scheme.** Two visual parts, `scheme: "light"` and `scheme: "dark"`, each bound for a theme of
422
+ that scheme, follow the page's scheme with no `theme` prop.
423
+ - **Content media.** An `<img>` or a `<video>` without a binding is application media; `sizeAxis: "inline"` on its
424
+ visual profile caps its width (logo strips) instead of its height.
425
+ - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
426
+
391
427
  <a id="rejected"></a>
392
428
  ## What is rejected, and why
393
429
 
@@ -43,6 +43,10 @@ ADS's `lint:ds` script runs `ads check .` and `emit:ds` runs `ads emit`. ADS gat
43
43
  do not require Oxlint. Projects can run their chosen linter through their own
44
44
  explicitly configured check scripts. Init preserves application scripts.
45
45
 
46
+ **`"use client"`** is ADS's to write: an emitted owner that calls a hook or handles an event starts with it, a
47
+ presentational one does not and renders in a React Server Component. Don't write it by hand; one written where
48
+ nothing needs it is a review item.
49
+
46
50
  ## MCP connection
47
51
 
48
52
  Choose [direct code editing or MCP-only editing](workflows.md) independently of
@@ -112,6 +112,8 @@ import { Container, EventLog, Placeholder, useEvents, type Scenario } from "@req
112
112
  Token, icon and brand preview pages are not scenarios: the generated Tokens,
113
113
  Profiles and Artwork views show them.
114
114
 
115
+ `Container inline: "phone"` is 390px, the phone-viewport tool's width: use it, not the 360px column, for a phone.
116
+
115
117
  ## Files and identities
116
118
 
117
119
  A scenario's id is the design-system-relative path without `.ads.scenario.*`; a canonical
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
109
109
  Nowhere-declared references keep one `token-css/token-missing` error per authored
110
110
  site, including with a fallback and when unused; provenance does not duplicate it.
111
111
 
112
+ - A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
113
+ - The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
114
+ fallback (`foundation/document-text-incomplete`).
115
+ - A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
116
+ colour (`review/border-paint-missing`).
117
+
112
118
  ## Units
113
119
 
114
120
  `ads check` restricts the unit in three places: `font-size`, and `line-height`
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
94
94
  effects through props and callbacks. Re-exporting an application store, router
95
95
  or service from a helper does not make it part of the design system.
96
96
 
97
+ A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
98
+ in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
99
+ re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
100
+ the class and no style of its own.
101
+
97
102
  ## Styling rules (blocking)
98
103
 
99
104
  Components own their control states and appearance. Patterns own arrangement,
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
55
55
  media queries and track lists, so a context cannot change them
56
56
  (`spatial-context-unsupported`): declare another spatial profile instead.
57
57
 
58
+ - **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
59
+ `column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
60
+ Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
61
+
58
62
  ## Choose the behaviour first
59
63
 
60
64
  | The user wants… | Choose |
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
105
109
  "end-end"] } } }`. A named condition holds below its bound.
106
110
 
107
111
  Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
108
- (one positive number per local column). Never write `grid-template-columns`.
112
+ (one positive number per local column). Columns as wide as their content, a
113
+ space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
114
+ that tier the columns share the width, so place the cells for the narrower
115
+ tiers. Never write `grid-template-columns`.
109
116
 
110
117
  The field exposes its label, control and help rows; `alignRows` binds them through
111
118
  subgrid. The cell must span exactly those rows, in the order the component exposes
@@ -175,6 +175,9 @@ a recipe never creates a state machine.
175
175
  reset }` on the container, `counter: { increment }` on each item, and
176
176
  `content: { counters | counter, separator, suffix }` on its `marker` or
177
177
  `before`. Check marks are a visual part in the item, not a marker.
178
+ - A code block either keeps each line whole and scrolls (`overflow: "scroll-inline"`, focusable) or keeps the text's
179
+ spaces and line breaks and wraps long lines so all of it is visible (`wrap: "preserve"` on its code text). Choose
180
+ by what matters more: lines that read exactly as written, or nothing hidden.
178
181
  - A rule between children (table rows, settings rows) is `between: { surface,
179
182
  frame }` on their parent, never borders on each child with a last-child
180
183
  exception. Text only assistive technology reads (a table caption) is a part
@@ -276,6 +279,21 @@ fragment or a native frame-only element.
276
279
  `mandatory` or `proximity`), aligning the children it places. Snap without
277
280
  scrolling, or a child's own snap, is rejected.
278
281
 
282
+ - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
283
+ stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
284
+ `inline` row, `gap` spaces the items and `rowGap` the lines.
285
+ - **Loose flow.** `carry: true` on a list and on its item: an item that ends in a paragraph, code block or figure is
286
+ followed at the larger of the list's gap and that block's space after; after the last item the list's own space
287
+ after applies.
288
+ - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
289
+ scrolling body never collapses in a stack sized by its content.
290
+ - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
291
+ edge, an unpainted one where its content ends. Put a header on the same grid and gutter as the sections below it.
292
+ - **Tables.** `align: "start"` on a cell (`vertical-align: top` for rows whose cells wrap to different heights);
293
+ `extent: "container"` on a table root makes it as wide as its container.
294
+ - **The document.** One pattern may render the page's `<html>`: `recipe({ element: "document" })`, with `lang`
295
+ from a required prop, `<body>` inside, and the framework's `head` and `end` slots.
296
+
279
297
  <a id="layers"></a>
280
298
  ## Layers
281
299
 
@@ -300,6 +318,10 @@ A region recipe's root can live in the browser's top layer through a closed
300
318
  no authored `open` on a sheet, an accessible name, and no layer root as a grid
301
319
  cell. Focus, Escape and dismissal are behaviour guarantees for browser tests.
302
320
 
321
+ - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
322
+ profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
323
+ `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
324
+
303
325
  <a id="measured"></a>
304
326
  ## Measured values and runtime paints
305
327
 
@@ -375,6 +397,14 @@ text part breaks one way, set by one `wrap` field:
375
397
  its alignment, on a control's label too. Balanced, pretty and trimmed text degrade to plain wrapping and
376
398
  spacing in a browser without them.
377
399
 
400
+ - **Code that wraps.** `wrap: "preserve"` keeps spaces and line breaks and wraps long lines, so the whole block is
401
+ visible; `overflow: "scroll-inline"` keeps lines whole instead.
402
+ - **Truncation.** One-line `wrap: "truncate"` clips only sideways, so descenders stay whole with a trimmed line box.
403
+ - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
404
+ browser's font, centred text, border, fill and margin wherever the construction states none.
405
+ - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
406
+ frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
407
+
378
408
  <a id="assets"></a>
379
409
  ## Assets in recipes
380
410
 
@@ -388,6 +418,12 @@ glyph reference, never a name string. Brand artwork and multicolour drawings
388
418
  are declared under `assets/`: see `ads://guides/branding` and
389
419
  `ads://guides/pictograms`.
390
420
 
421
+ - **A logo per colour scheme.** Two visual parts, `scheme: "light"` and `scheme: "dark"`, each bound for a theme of
422
+ that scheme, follow the page's scheme with no `theme` prop.
423
+ - **Content media.** An `<img>` or a `<video>` without a binding is application media; `sizeAxis: "inline"` on its
424
+ visual profile caps its width (logo strips) instead of its height.
425
+ - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
426
+
391
427
  <a id="rejected"></a>
392
428
  ## What is rejected, and why
393
429
 
@@ -43,6 +43,10 @@ ADS's `lint:ds` script runs `ads check .` and `emit:ds` runs `ads emit`. ADS gat
43
43
  do not require Oxlint. Projects can run their chosen linter through their own
44
44
  explicitly configured check scripts. Init preserves application scripts.
45
45
 
46
+ **`"use client"`** is ADS's to write: an emitted owner that calls a hook or handles an event starts with it, a
47
+ presentational one does not and renders in a React Server Component. Don't write it by hand; one written where
48
+ nothing needs it is a review item.
49
+
46
50
  ## MCP connection
47
51
 
48
52
  Choose [direct code editing or MCP-only editing](workflows.md) independently of
@@ -112,6 +112,8 @@ import { Container, EventLog, Placeholder, useEvents, type Scenario } from "@req
112
112
  Token, icon and brand preview pages are not scenarios: the generated Tokens,
113
113
  Profiles and Artwork views show them.
114
114
 
115
+ `Container inline: "phone"` is 390px, the phone-viewport tool's width: use it, not the 360px column, for a phone.
116
+
115
117
  ## Files and identities
116
118
 
117
119
  A scenario's id is the design-system-relative path without `.ads.scenario.*`; a canonical
@@ -75,3 +75,4 @@ Load only the guide(s) for the requested transition.
75
75
  | 0.5.1 | 0.5.2 | [Two emitted-CSS fixes, checks that now accept what they refused, a TypeScript configuration error that is now reported, the render audit measuring owner states by itself (and which audit-only scenario states can go), and new state, geometry, surface, outset, focus, control and prose language](references/0.5.1-to-0.5.2.md) |
76
76
  | 0.5.2 | 0.5.3 | [Prose becomes content components, contextual roles (`provides`), fixed-size frames keep their size, workarounds that can go (design state, heading levels, drawn inputs, repeated parts and cells, optional cells, corner radii, inline entrances, the target spacing exception, hidden glyphs), and composed contrast through plain modules](references/0.5.2-to-0.5.3.md) |
77
77
  | 0.5.3 | 0.5.4 | [A part's browser margin is reset, five 0.5.3 gaps fixed, list markers, CSS counters, part spacing profiles, rules between children, visually hidden text and underline states](references/0.5.3-to-0.5.4.md) |
78
+ | 0.5.4 | 0.5.5 | [Stricter checks (document text, forced-colours edges, border corners, end alignment), native control resets, layout, media, layer and forced-colours language, and render-audit environment passes](references/0.5.4-to-0.5.5.md) |
@@ -0,0 +1,61 @@
1
+ # ADS 0.5.4 → 0.5.5
2
+
3
+ Several checks are stricter and some emitted CSS changes: run `ads check`, fix what it reports, then `ads emit` and
4
+ review the rendered owners. Owner analysis moves to schema `ads-owner-analysis/14` and owner emission to
5
+ `ads-owner-emission/2`, so the first check and emit after the upgrade redo every owner.
6
+
7
+ ## Checks that can newly fail
8
+
9
+ | Code | What fails | Repair |
10
+ | --- | --- | --- |
11
+ | `foundation/document-text-incomplete` | The foundation's document text profile states no `fontSize` or `lineHeight` (text without its own profile showed the browser's 16px) | Give it `fontFamily`, `fontSize` and `lineHeight` |
12
+ | `construction/forced-boundary-missing` (`a11y-forced-colors`) | A control (a control construction, a `frame: "control"` part) whose frame declares no `borderWidth`: it has no edge in Windows contrast themes | Give the frame a `borderWidth`; `borderStyle: "forced-only"` keeps it transparent in normal mode |
13
+ | `construction/corner-overpaint` | A part with its own border reaching a rounded corner of an unclipped, uninset root (a field inside a rounded composer) | Clip the root, inset it, or round the part |
14
+ | `source/end-misaligned` | Blocks a stack holds end their content on different lines (a header's actions one gutter past the sections) | Put the block on the same grid and gutter, or give its frame the matching end padding |
15
+ | `construction/progress-contrast-insufficient` | A range slider's thumb under 3:1 against its track | Choose a thumb surface that contrasts with the track |
16
+
17
+ New review items, which never block: `review/forced-state-fill-only`, `review/border-paint-missing`,
18
+ `review/counter-unreset`, `review/client-directive-unneeded`.
19
+
20
+ ## Emitted CSS that changes
21
+
22
+ - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` a construction draws resets the
23
+ browser's font (inherited), centred text, border, fill and margin wherever the construction states none. A
24
+ button's label now starts at the start unless the recipe aligns it.
25
+ - **Filling parts in a stack** start at their content (`flex-basis: auto`) instead of a zero basis.
26
+ - **One-line truncation** clips only the inline axis (`overflow: clip visible`).
27
+ - **A control part** writes its frame's inline minimum and its text slot's line, as its target-size proof did.
28
+ - **Owner modules** that call a hook or handle an event start with `"use client"`. Remove hand-written directives.
29
+
30
+ ## Fixed: workarounds that can go
31
+
32
+ | Before | Now |
33
+ | --- | --- |
34
+ | A token only a script read (`getPropertyValue("--toast-duration")`) was never emitted; it worked only if a construction used it | Emitted with the owner's token CSS |
35
+ | `const glyph = open ? a : b` was a glyph read; a fold bound two chevron assets | Pick the reference by state |
36
+ | A logo with light and dark files needed a `theme` prop | Two visual parts with `scheme: "light"` / `"dark"`, each bound for a theme of that scheme |
37
+ | `gap` and `rowGap` were one value on a wrapping row; insets stood in | `gap` between items, `rowGap` between lines |
38
+ | A video poster could not fill its frame | A `<video>` is content media; a cover profile fills the frame |
39
+ | Text inside `aria-hidden` (a breadcrumb's "/") was held to 4.5:1 | Decoration: no minimum |
40
+ | Window controls under 24px placed by a bar needed 24px | A private control placed only between spaced neighbours passes 2.5.8's spacing exception |
41
+
42
+ ## New language
43
+
44
+ - Layout: `justify: "space-between" | "space-around" | "space-evenly"`; gap gutters
45
+ (`gutters: { cards: { gap } }`); `carry: true` for loose lists; cell `align`; table `extent: "container"`.
46
+ - Text: `wrap: "preserve"`; range sliders (`pseudo: { sliderTrack, sliderThumb }`).
47
+ - Media: `sizeAxis: "inline"` on a visual profile; `<video>` content media; scheme-paired declared artwork.
48
+ - Layers: modal cards (`edge: "center" | "block-start"`, `motion: "fade"`), `backdropBlur`, a measured `scale`.
49
+ - Forced colours: a surface's `forcedColors`; a frame's `borderStyle: "forced-only"`.
50
+ - The document pattern: `element: "document"`.
51
+ - Content-sized grid columns: `contentFrom: "<tier>"` on a fluid grid, for columns that were
52
+ `grid-template-columns: repeat(n, auto)` with `justify-content: space-between`.
53
+ - External components: `external<Props>({ from, renders })` in `externals/*.ads.ts`, used as an owner's element;
54
+ a framework's link no longer needs a component prop or a wrapper.
55
+ - Scenarios: `Container inline: "phone"` (390px).
56
+
57
+ ## Render audit
58
+
59
+ Each scenario is also audited in forced colours and with a coarse pointer. The layout pass reports words broken by a
60
+ squeezed box, collapsed scroll areas and boxes whose painted edge a clip cuts; it no longer reports owned 24px hit
61
+ areas, `aria-hidden` initials as a visible label, inert panes of no size, or a multi-colour mark by its outline.
@@ -109,6 +109,12 @@ value to disguise it. Shared literals in the proper role sheet remain valid.
109
109
  Nowhere-declared references keep one `token-css/token-missing` error per authored
110
110
  site, including with a fallback and when unused; provenance does not duplicate it.
111
111
 
112
+ - A token a script reads by name (`getPropertyValue("--toast-duration")`) is emitted with the owner's token CSS.
113
+ - The foundation's document text profile states `fontFamily`, `fontSize` and `lineHeight`: it is every text's
114
+ fallback (`foundation/document-text-incomplete`).
115
+ - A frame that draws a border needs a border paint on its element's surface; without one the border takes the text
116
+ colour (`review/border-paint-missing`).
117
+
112
118
  ## Units
113
119
 
114
120
  `ads check` restricts the unit in three places: `font-size`, and `line-height`
@@ -94,6 +94,11 @@ demonstration. See [review.md](review.md).
94
94
  effects through props and callbacks. Re-exporting an application store, router
95
95
  or service from a helper does not make it part of the design system.
96
96
 
97
+ A component another library supplies (a framework's link) is declared as an external, `external({ from, renders })`
98
+ in `externals/*.ads.ts`, and used as one of an owner's elements: ADS checks it as the element it renders, emits a
99
+ re-export of the real component, previews a stand-in, and `ads-guard` verifies the library renders that element with
100
+ the class and no style of its own.
101
+
97
102
  ## Styling rules (blocking)
98
103
 
99
104
  Components own their control states and appearance. Patterns own arrangement,
@@ -55,6 +55,10 @@ context). Breakpoint widths, column counts and condition bounds are compiled int
55
55
  media queries and track lists, so a context cannot change them
56
56
  (`spatial-context-unsupported`): declare another spatial profile instead.
57
57
 
58
+ - **Gap gutters.** A gutter may be a gap (`gutters: { cards: { gap: "--card-gap" } }`): the grid writes
59
+ `column-gap`, the outer cells sit flush with the region's edges, and tracks share the width left after the gaps.
60
+ Use it for card grids; an edge gutter (`start`, `end`) insets each cell.
61
+
58
62
  ## Choose the behaviour first
59
63
 
60
64
  | The user wants… | Choose |
@@ -105,7 +109,10 @@ corners, then the other set under a named condition of the spatial profile:
105
109
  "end-end"] } } }`. A named condition holds below its bound.
106
110
 
107
111
  Columns of unequal width: `columns: 2, weights: [0.85, 1.15]` on a fluid grid
108
- (one positive number per local column). Never write `grid-template-columns`.
112
+ (one positive number per local column). Columns as wide as their content, a
113
+ space apart (link columns of a footer): `columns: 6, contentFrom: "lg"`; below
114
+ that tier the columns share the width, so place the cells for the narrower
115
+ tiers. Never write `grid-template-columns`.
109
116
 
110
117
  The field exposes its label, control and help rows; `alignRows` binds them through
111
118
  subgrid. The cell must span exactly those rows, in the order the component exposes
@@ -175,6 +175,9 @@ a recipe never creates a state machine.
175
175
  reset }` on the container, `counter: { increment }` on each item, and
176
176
  `content: { counters | counter, separator, suffix }` on its `marker` or
177
177
  `before`. Check marks are a visual part in the item, not a marker.
178
+ - A code block either keeps each line whole and scrolls (`overflow: "scroll-inline"`, focusable) or keeps the text's
179
+ spaces and line breaks and wraps long lines so all of it is visible (`wrap: "preserve"` on its code text). Choose
180
+ by what matters more: lines that read exactly as written, or nothing hidden.
178
181
  - A rule between children (table rows, settings rows) is `between: { surface,
179
182
  frame }` on their parent, never borders on each child with a last-child
180
183
  exception. Text only assistive technology reads (a table caption) is a part
@@ -276,6 +279,21 @@ fragment or a native frame-only element.
276
279
  `mandatory` or `proximity`), aligning the children it places. Snap without
277
280
  scrolling, or a child's own snap, is rejected.
278
281
 
282
+ - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
283
+ stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
284
+ `inline` row, `gap` spaces the items and `rowGap` the lines.
285
+ - **Loose flow.** `carry: true` on a list and on its item: an item that ends in a paragraph, code block or figure is
286
+ followed at the larger of the list's gap and that block's space after; after the last item the list's own space
287
+ after applies.
288
+ - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
289
+ scrolling body never collapses in a stack sized by its content.
290
+ - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
291
+ edge, an unpainted one where its content ends. Put a header on the same grid and gutter as the sections below it.
292
+ - **Tables.** `align: "start"` on a cell (`vertical-align: top` for rows whose cells wrap to different heights);
293
+ `extent: "container"` on a table root makes it as wide as its container.
294
+ - **The document.** One pattern may render the page's `<html>`: `recipe({ element: "document" })`, with `lang`
295
+ from a required prop, `<body>` inside, and the framework's `head` and `end` slots.
296
+
279
297
  <a id="layers"></a>
280
298
  ## Layers
281
299
 
@@ -300,6 +318,10 @@ A region recipe's root can live in the browser's top layer through a closed
300
318
  no authored `open` on a sheet, an accessible name, and no layer root as a grid
301
319
  cell. Focus, Escape and dismissal are behaviour guarantees for browser tests.
302
320
 
321
+ - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
322
+ profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
323
+ `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
324
+
303
325
  <a id="measured"></a>
304
326
  ## Measured values and runtime paints
305
327
 
@@ -375,6 +397,14 @@ text part breaks one way, set by one `wrap` field:
375
397
  its alignment, on a control's label too. Balanced, pretty and trimmed text degrade to plain wrapping and
376
398
  spacing in a browser without them.
377
399
 
400
+ - **Code that wraps.** `wrap: "preserve"` keeps spaces and line breaks and wraps long lines, so the whole block is
401
+ visible; `overflow: "scroll-inline"` keeps lines whole instead.
402
+ - **Truncation.** One-line `wrap: "truncate"` clips only sideways, so descenders stay whole with a trimmed line box.
403
+ - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
404
+ browser's font, centred text, border, fill and margin wherever the construction states none.
405
+ - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
406
+ frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
407
+
378
408
  <a id="assets"></a>
379
409
  ## Assets in recipes
380
410
 
@@ -388,6 +418,12 @@ glyph reference, never a name string. Brand artwork and multicolour drawings
388
418
  are declared under `assets/`: see `ads://guides/branding` and
389
419
  `ads://guides/pictograms`.
390
420
 
421
+ - **A logo per colour scheme.** Two visual parts, `scheme: "light"` and `scheme: "dark"`, each bound for a theme of
422
+ that scheme, follow the page's scheme with no `theme` prop.
423
+ - **Content media.** An `<img>` or a `<video>` without a binding is application media; `sizeAxis: "inline"` on its
424
+ visual profile caps its width (logo strips) instead of its height.
425
+ - **A drawing picked by state.** `const glyph = open ? closeGlyph : arrowGlyph`, drawn with `glyph.source`, is fine.
426
+
391
427
  <a id="rejected"></a>
392
428
  ## What is rejected, and why
393
429
 
@@ -43,6 +43,10 @@ ADS's `lint:ds` script runs `ads check .` and `emit:ds` runs `ads emit`. ADS gat
43
43
  do not require Oxlint. Projects can run their chosen linter through their own
44
44
  explicitly configured check scripts. Init preserves application scripts.
45
45
 
46
+ **`"use client"`** is ADS's to write: an emitted owner that calls a hook or handles an event starts with it, a
47
+ presentational one does not and renders in a React Server Component. Don't write it by hand; one written where
48
+ nothing needs it is a review item.
49
+
46
50
  ## MCP connection
47
51
 
48
52
  Choose [direct code editing or MCP-only editing](workflows.md) independently of
@@ -112,6 +112,8 @@ import { Container, EventLog, Placeholder, useEvents, type Scenario } from "@req
112
112
  Token, icon and brand preview pages are not scenarios: the generated Tokens,
113
113
  Profiles and Artwork views show them.
114
114
 
115
+ `Container inline: "phone"` is 390px, the phone-viewport tool's width: use it, not the 360px column, for a phone.
116
+
115
117
  ## Files and identities
116
118
 
117
119
  A scenario's id is the design-system-relative path without `.ads.scenario.*`; a canonical