@reqvire-org/ads 0.5.2 → 0.5.3

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 (68) hide show
  1. package/dist/ads-errors.mjs +33 -26
  2. package/dist/analysis/design-usage.mjs +4 -20
  3. package/dist/analysis/mock-check.mjs +4 -5
  4. package/dist/analysis/owner-accessibility.mjs +4 -4
  5. package/dist/analysis/owner-analysis-key.mjs +1 -1
  6. package/dist/analysis/owner-choices.mjs +33 -3
  7. package/dist/analysis/owner-composition.mjs +61 -12
  8. package/dist/analysis/owner-source.mjs +52 -35
  9. package/dist/composed-contrast.mjs +143 -62
  10. package/dist/construction-output.mjs +6 -1
  11. package/dist/construction-spec.d.mts +53 -44
  12. package/dist/construction-spec.mjs +64 -76
  13. package/dist/corner-overpaint.mjs +5 -4
  14. package/dist/design-foundation.mjs +16 -0
  15. package/dist/design-usage.mjs +2 -8
  16. package/dist/emit/emission.mjs +0 -5
  17. package/dist/grid-lowering.mjs +3 -1
  18. package/dist/lowering-enter.mjs +6 -6
  19. package/dist/lowering-session.mjs +10 -0
  20. package/dist/mcp/server-observation.mjs +6 -4
  21. package/dist/mcp/server-project.mjs +4 -1
  22. package/dist/owner-analysis-check.mjs +4 -1
  23. package/dist/owner-errors.mjs +2 -1
  24. package/dist/owner-lowering.mjs +10 -4
  25. package/dist/owner-scenarios.mjs +2 -22
  26. package/dist/ownership-model.mjs +7 -5
  27. package/dist/paint-contrast.mjs +6 -0
  28. package/dist/profile-macro.d.mts +7 -0
  29. package/dist/recipe-macro.d.mts +46 -42
  30. package/dist/recipe-model.mjs +12 -11
  31. package/dist/region-lowering.mjs +54 -109
  32. package/dist/role-vocabulary.d.mts +4 -0
  33. package/dist/role-vocabulary.mjs +4 -0
  34. package/dist/runtime-paint-contrast.mjs +5 -2
  35. package/dist/showcase/client.bundle.js +48 -48
  36. package/dist/showcase/http-client.bundle.js +13 -13
  37. package/dist/showcase/ui/ui.css +1 -1
  38. package/dist/showcase/ui/ui.js +5 -5
  39. package/dist/skills/ads-designer/references/accessibility.md +3 -4
  40. package/dist/skills/ads-designer/references/design-data.md +12 -6
  41. package/dist/skills/ads-designer/references/layout.md +7 -3
  42. package/dist/skills/ads-designer/references/motion.md +2 -1
  43. package/dist/skills/ads-designer/references/recipes.md +28 -18
  44. package/dist/skills/ads-import/references/design-data.md +12 -6
  45. package/dist/skills/ads-import/references/layout.md +7 -3
  46. package/dist/skills/ads-import/references/recipes.md +28 -18
  47. package/dist/skills/ads-migrate/SKILL.md +1 -0
  48. package/dist/skills/ads-migrate/references/0.5.2-to-0.5.3.md +71 -0
  49. package/dist/skills/ads-port/references/design-data.md +12 -6
  50. package/dist/skills/ads-port/references/layout.md +7 -3
  51. package/dist/skills/ads-port/references/recipes.md +28 -18
  52. package/dist/spatial-model.mjs +2 -2
  53. package/dist/surface-contrast.mjs +6 -2
  54. package/dist/target-size.mjs +21 -3
  55. package/docs/ADS.md +9 -3
  56. package/docs/ARCHITECTURE.md +33 -23
  57. package/docs/CACHING.md +1 -1
  58. package/docs/CHANGELOG.md +128 -21
  59. package/docs/GUIDE.md +64 -19
  60. package/docs/LANGUAGE.md +141 -134
  61. package/docs/MCP.md +5 -1
  62. package/docs/MOTION.md +5 -2
  63. package/docs/PROFILE-KINDS.md +46 -4
  64. package/docs/RULES.md +16 -15
  65. package/package.json +1 -1
  66. package/dist/analysis/prose-owners.mjs +0 -57
  67. package/dist/prose-model.d.mts +0 -81
  68. package/dist/prose-model.mjs +0 -101
package/docs/ADS.md CHANGED
@@ -255,6 +255,11 @@ owners (`component-contrast`, error; [guide](GUIDE.md#design-system-source)).
255
255
  - Every component the barrel exports is also checked on the document surface
256
256
  that `foundation({ surface })` declares. Applications place those components;
257
257
  their own coloured containers are outside the design system.
258
+ - A placement is checked with what its arguments select: a prop it leaves out
259
+ takes its default (or its absence), and an owner state that tests an attribute
260
+ the markup writes holds only where the placement can render that value. A row
261
+ placed with no `state` is not paired with its selected tints there; every
262
+ value stays checked on the document surface for applications.
258
263
  - The minimum is 4.5:1, or 3:1 over provably large text inherited across owners.
259
264
  Hidden, absent or inactive text has none.
260
265
  - A component of the placing owner's own file is expanded only when it passes
@@ -262,8 +267,9 @@ owners (`component-contrast`, error; [guide](GUIDE.md#design-system-source)).
262
267
  of is the user agent's own pair and adds nothing.
263
268
  - What the check cannot prove is `component-contrast-unresolved` (review) at the
264
269
  placement or element concerned, never passed. Examples are an unanalyzed
265
- wrapper, an owner placed in a plain module's markup, a user-agent paint, an
266
- out-of-flow element, opacity, an unknown image and a limit.
270
+ wrapper, a user-agent paint, an out-of-flow element, opacity, an unknown image
271
+ and a limit. A plain module that places components (a sheet arranging rows)
272
+ is followed like an owner.
267
273
 
268
274
  #### Grids, spatial profiles and text layout
269
275
 
@@ -588,7 +594,7 @@ accessibility, interaction, responsive layout, themes and motion.
588
594
  - The package ships no design system. `ads init` sets up configuration,
589
595
  dependencies and an empty design-system folder; the project authors what goes
590
596
  in it. The example design system the documents quote is ADS's own test
591
- project (`tests/fixtures/starter-project/` in the repository), which the
597
+ project (`tests/fixtures/example-project/` in the repository), which the
592
598
  package does not contain.
593
599
  - The tool does not require any design system's names or styles and ships no
594
600
  product UI catalogue.
@@ -125,12 +125,12 @@ author in. It never replaces a project file, edits `.gitignore` or writes a
125
125
  lockfile.
126
126
 
127
127
  ADS tests itself with one example design system, written for React
128
- (`tests/fixtures/starter-project/`). The build writes its declared file set
128
+ (`tests/fixtures/example-project/`). The build writes its declared file set
129
129
  and, through an overlay (`tests/helpers/starter/starter-overlay.mts`), a native
130
130
  Preact copy of the same source to `.ds/test-starters/`, outside the package;
131
131
  the overlay stops the build on a React API without a declared Preact
132
132
  counterpart. The tests install it after `ads init`
133
- (`tests/helpers/starter-project.mjs`).
133
+ (`tests/helpers/example-project.mjs`).
134
134
 
135
135
  ### No production runtime
136
136
 
@@ -204,10 +204,10 @@ section, not a parallel set of "on dark" tokens or component variants.
204
204
  A theme is the unit for sections because it is the unit the checks prove. Every
205
205
  token sheet value is evaluated, and the contrast of every surface pair is
206
206
  proven, in each theme, brand and brand × theme context. A section can therefore
207
- only select a context whose whole colour mode already passes. ADS has no finer
208
- construct, such as a surface that sets the colours its descendants read
209
- (selected rows, tinted banners): it would need its own context in those proofs.
210
- Explicit choices on the child cover those cases.
207
+ only select a context whose whole colour mode already passes. The finer construct,
208
+ a surface that sets the colours its descendants read (selected rows, tinted
209
+ banners), is a contextual role (`provides`, below): it re-binds paint tokens only,
210
+ and composed contrast proves what sits inside it with the provided values.
211
211
 
212
212
  Sections are opt-in because of their cost: the section rules add CSS to every
213
213
  owner sheet, and a design system that switches only `<html>` gains nothing from
@@ -332,19 +332,27 @@ them through `writeKeyframes`. Script-defined animation is refused by
332
332
  through the checker so that a project function of the same name is not
333
333
  reported.
334
334
 
335
- **Prose.** `src/prose-model.mts` is the closed set: element names, their tags,
336
- the browser defaults replaced, and which element can contain which. A prose
337
- root is a region whose `RegionSpec.prose` holds the declared elements;
338
- `lowerProse` (`src/region-lowering.mts`) writes one rule per tag with the
339
- selector `& <tag>:not([class])`, a descendant selector the overlap check
340
- already reasons about by element type, and proves contrast with
341
- `paintContrast` over the token contexts, so a prose owner that declares a
342
- colour is token-dependent. The markup checks need to know prose owners without
343
- the owner analysis: `src/analysis/prose-owners.mts` reads them syntactically
344
- from the barrel's re-exports and each file's own `recipe({ layout: "prose" })`
345
- literal, in the captured revision. Emission writes that map as
346
- `ads-prose.json`; the design-use library reads it beside the entry file,
347
- because an emitted owner carries no recipe.
335
+ **Contextual roles.** A surface profile's `provides` entries are profile fields
336
+ named by the token they re-bind (`--link-ink`), checked in
337
+ `src/design-foundation.mts` (paint to paint; a surface that reads a token it
338
+ provides is `provided-role-self`). Every lowering path that applies a surface
339
+ passes its fields to the rule writer (`src/construction-output.mts`), which sends
340
+ custom-property keys through `LoweringSession.writeProvidedRoles`: the only
341
+ operation that admits custom properties, never `--ads-*` or asset channels.
342
+ Composed contrast (`src/composed-contrast.mts` `providedVariants`) resolves each
343
+ token the text's colour or a backdrop layer reads to the nearest provider at or
344
+ above the element that reads it; a provider under an owner state contributes its
345
+ condition to the pair's requirements, so it pairs only with that state's
346
+ backdrop. Chains are keyed by what their evaluation reads (`evaluationKey`), and
347
+ a component that places itself is followed through each recursive placement once
348
+ per chain, so nested inline content renderers stay within the chain bound.
349
+
350
+ **Content flows.** A region part may be a placed public component
351
+ (`PartContent.kind: "component"`), matched by its marker among the element's
352
+ component facts (`src/analysis/owner-source.mts`); lowering writes its placement
353
+ only. `writePartSpace` (`src/region-lowering.mts`) lowers part `spaceBefore` /
354
+ `spaceAfter` as start margins relative to the stack's gap, ranked by specificity
355
+ (before < after < pair) so the overlap check needs no order.
348
356
 
349
357
  **Entrances.** `enter` on a region root, a region part or a control root is
350
358
  parsed into an `EnterSpec` (`src/construction-spec.mts`) that carries its
@@ -430,10 +438,12 @@ reaches it is `component-contrast-unresolved` at the placement.
430
438
  show it passes its children through: it renders `children` in place, passes
431
439
  it on, or spreads its props into a placement. Any other same-file component
432
440
  ends the chain at its placement.
433
- - Plain modules record no composition facts, only the design-system components
434
- their markup places. These are read from the revision's program beside the
435
- other plain-module checks, each revision, so no owner outcome changes. The
436
- join ends those components' chains at each such placement.
441
+ - A plain module whose markup places design-system components (a sheet that
442
+ arranges rows and avatars) records composition facts as an owner does, read
443
+ from the revision's program beside the other plain-module checks, each
444
+ revision, so no owner outcome changes; the join follows its placements like an
445
+ owner's. Only where its facts cannot be read do its placements end the chain,
446
+ as unknown above.
437
447
 
438
448
  A native control's pair is the user agent's, and skipped, only when neither its
439
449
  colour nor any background between the text and its fill comes from the design
package/docs/CACHING.md CHANGED
@@ -173,7 +173,7 @@ the profile declarations already in its key. The composed contrast join over
173
173
  every owner's facts belongs to the revision's memoized check, not to an owner's
174
174
  entry: a token edit reuses every owner analysis and reruns only the join (stage
175
175
  `composed-contrast`), and an owner edit changes that owner's facts alone. The
176
- outcome schema is `ads-owner-analysis/11` (it carries each owner's closed props for the showcase's live controls, and the assets it draws with the size of each); it includes the composition facts and
176
+ outcome schema is `ads-owner-analysis/12` (it carries each owner's closed props for the showcase's live controls, the assets it draws with the size of each, and which value of each prop a placement that leaves the prop out selects); it includes the composition facts and
177
177
  the profile/choice inventory `design`.
178
178
 
179
179
  - Settled outcomes (facts or a deterministic analysis failure) are reused;
package/docs/CHANGELOG.md CHANGED
@@ -1,59 +1,166 @@
1
1
  # Changelog
2
2
 
3
- ## 0.5.2
3
+ ## 0.5.3
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
- Local verification: **2057/2057 passed** with `bun run test`.
7
- Tested commit: `78b12682fd713a89b7e6568e8ceff8253dde2164`; Bun 1.4.4.
8
- Completed 2026-11-22T19:17:44.135Z (1218 seconds).
6
+ Local verification: **2084/2084 passed** with `bun run test`.
7
+ Tested commit: `711c30248604d51ecdc97d29646e5ecdd5678882`; Bun 1.4.4.
8
+ Completed 2026-11-23T09:25:04.569Z (1184 seconds).
9
9
 
10
10
  <!-- ads-local-test-proof
11
11
  {
12
12
  "schema": 3,
13
- "version": "0.5.2",
14
- "commit": "78b12682fd713a89b7e6568e8ceff8253dde2164",
15
- "sourceSha256": "5a604aaed2bda2c6992be54e566251b3a3f3286085fab6845c2006356dc78f55",
13
+ "version": "0.5.3",
14
+ "commit": "711c30248604d51ecdc97d29646e5ecdd5678882",
15
+ "sourceSha256": "502077186e3c070c9d51fabe16bab71fb7a6562aa892f65f686e7f749cd64afc",
16
16
  "command": "bun run test",
17
17
  "result": "pass",
18
- "tests": 2057,
19
- "pass": 2057,
18
+ "tests": 2084,
19
+ "pass": 2084,
20
20
  "fail": 0,
21
21
  "skipped": 0,
22
22
  "groups": [
23
23
  {
24
24
  "name": "unit",
25
- "tests": 794,
26
- "pass": 794,
25
+ "tests": 803,
26
+ "pass": 803,
27
27
  "fail": 0,
28
28
  "skipped": 0,
29
- "reportSha256": "4ac02df92738ab8b238858afcaf74b67e3fc685a8e6e36fdbd661235ac06e7b3"
29
+ "reportSha256": "c8f17e0c1eeec0163f2c1f18855627a3058daa01440ed90226a56bd36c1ceb09"
30
30
  },
31
31
  {
32
32
  "name": "integration",
33
- "tests": 959,
34
- "pass": 959,
33
+ "tests": 974,
34
+ "pass": 974,
35
35
  "fail": 0,
36
36
  "skipped": 0,
37
- "reportSha256": "d7680d3c352321f6cc0865b431331b61b102b0c127a85d9b8ec01938ed401453"
37
+ "reportSha256": "2c14c1c8fb8b405bab9b1809a3890e6f5fdf34e95944dc7382b64dc2ff3781a8"
38
38
  },
39
39
  {
40
40
  "name": "browser",
41
- "tests": 304,
42
- "pass": 304,
41
+ "tests": 307,
42
+ "pass": 307,
43
43
  "fail": 0,
44
44
  "skipped": 0,
45
- "reportSha256": "54a837df140c284b108816016a7273364b79fd2ccb25d57ae5a285b51336fef4"
45
+ "reportSha256": "6e0fe63a3fec9b2dffa14e48769f22f9c4bb8c040e45398cb08a6e5835e45a68"
46
46
  }
47
47
  ],
48
48
  "testOverrides": {},
49
49
  "bun": "1.4.4",
50
- "completedAt": "2026-11-22T19:17:44.135Z",
51
- "durationMs": 1218204,
52
- "logSha256": "b7e7eada9bb2797ce9b085514c9d0c5dc46e9d499fcc646e9077e082dca9e345"
50
+ "completedAt": "2026-11-23T09:25:04.569Z",
51
+ "durationMs": 1184094,
52
+ "logSha256": "bdd920145024bad87c373ad0751b99cb20731f28efd76ea4b68b8fe65f50aec2"
53
53
  }
54
54
  -->
55
55
  <!-- ads-local-tests:end -->
56
56
 
57
+ ### Removed
58
+
59
+ - **Prose (`layout: "prose"`) is retired.** Long-form content is assembled from the design system's own components,
60
+ checked as any component is (see Added). `rhythm`, `elements`, the `ads-prose.json` manifest, the guard's
61
+ `design-usage/prose-element-undeclared` and `construction/prose-contrast-insufficient` are gone; a recipe with
62
+ `layout: "prose"` fails as an unknown layout. The migration guide maps every Prose element to its component.
63
+
64
+ ### Added
65
+
66
+ - **Long-form content as components.** A `stack` may place public components as parts (`kind: "component"`, matched
67
+ by the marker the placement passes, as a grid cell is), each repeated and optional, in any order; a part's
68
+ `spaceBefore` and `spaceAfter` replace the gap on its side (a heading one section gap from what precedes it; the
69
+ larger applies where two meet), also in the block flow of a parent without an arrangement (a list item that keeps
70
+ its marker). A content tree typed as a union is rendered with a finite choice over `node.type`; composed contrast
71
+ follows a renderer that places itself (nested inline content) through each recursive placement. The example
72
+ design system's `Content` pattern shows the set: headings, paragraphs, links, lists with nested lists, quotes,
73
+ code blocks, dividers and tables.
74
+ - **Contextual roles (`provides`).** A surface profile may re-bind paint tokens for the subtree of every element that
75
+ takes it: `provides: { "--link-ink": "--heading-ink" }` on a heading's surface makes a link inside it take the
76
+ heading's ink, with no prop and no rule on the link. A state's surface provides while the state holds (a selected
77
+ row's cells). Composed contrast proves the text inside with the provided values on the container's background; a
78
+ surface that provides a token it reads itself is refused (`foundation/provided-role-self`). This settles the
79
+ surface-context gap the guide listed (selected rows, tinted banners).
80
+
81
+ - **Design state derived from data.** A `const` with an explicit finite type (`const overflow: "fits" | "overflows" =
82
+ members.length > 3 ? …`) or an optional value (`const fourth: Member | undefined = members[3]`, a `find` result) is a
83
+ choice over its declared type when its initializer reads data the analysis does not evaluate. Every value is
84
+ checked; the derivation stays the component's own logic. Before, a count, an element or a lookup selecting markup
85
+ was "not from a finite set", and a component needed an inner owner taking the result as an optional prop.
86
+ - **A heading level the caller chooses.** A capitalised JSX tag that names a variable holding an element name is
87
+ that element: a constant (`const Heading = "h3"`), or a prop typed as a union of heading levels
88
+ (`level?: "h2" | "h3" | "h4"`, `const Heading = level`). The levels are checked as one heading. Before, such a tag
89
+ was read as an unknown component, so an Accordion could not take its heading level from its place in the page.
90
+ - **Standalone artwork binds its asset in its own recipe.** A standalone logo's one visual part may state
91
+ `asset`, `set`, `glyph`, `state` and `visual` itself, as a region's visual part may; before, those fields were
92
+ refused on an artwork recipe and the binding needed a separate fragment.
93
+ - **A drawn checkbox's native input takes no room.** `drawnBy: "<part>"` on the part holding a native control
94
+ (a checkbox's, radio's or switch's `<input>`) makes it invisible and out of the flow, laid over the named part
95
+ at that part's frame size: pointer and keyboard still reach the real control, its states still reach the
96
+ drawing part, and the label starts one gap after the box. The drawing part follows it and shows its focus
97
+ (`focus: { of }`). Before, a direct input part took its native size, the browser's margins and the row's gap.
98
+ - **Parts and grid cells rendered once per list item.** `repeat: true` on a region part lets `tabs.map(…)` render
99
+ it any number of times, each instance taking the part's construction (`extent: "fill"` shares the row among
100
+ them); a repeated control part is checked for hit-area overlap and spacing against its next instance. On a grid
101
+ cell, `repeat: true` lets mapped elements flow one after another (`start: "auto"` implied) over a numeric span or
102
+ `"full"`. Before, a mapped part was "rendered zero or several times", and a mapped cell had to repeat the column
103
+ count by hand (`span: 14, start: "auto"`), since `span: "full"` was refused with auto placement; it is now accepted
104
+ there too.
105
+ - **An optional grid cell.** `required: false` lets a cell be absent (a page's notice rendered only when given). A
106
+ cell that may be absent and is pinned to a `row` is listed for review (`review/optional-cell-row`): absent, it
107
+ leaves that row empty with its gaps. Before, a cell had to render exactly once.
108
+ - **A radius per corner.** A frame profile's `startStartRadius`, `startEndRadius`, `endStartRadius` and
109
+ `endEndRadius` replace its `radius` on that corner, so a chat bubble keeps its small tail corner. Before,
110
+ `frame: { corners }` could only round a corner by the one radius or square it.
111
+ - **A pushed screen can slide in from the side.** `enter.from.translateInline` moves an entrance on the inline axis
112
+ by the motion profile's `distance`, mirrored right to left. Before, an entrance moved on the block axis only.
113
+ - **WCAG 2.5.8's spacing exception.** A `frame: "control"` part smaller than 24 px passes when it sits between
114
+ targets of a stack or inline arrangement and a 24 px circle centred on it reaches neither a neighbouring target
115
+ nor a smaller neighbour's circle, at every gap (window controls 20 px wide and 28 px apart). A root, or a part
116
+ with no neighbouring target, keeps the 24 px minimum.
117
+ - **A glyph shown only on hover.** A fully transparent text or glyph colour draws nothing, so it has no contrast
118
+ minimum where it is transparent; the states that show it keep theirs. Before, a control whose glyph was
119
+ transparent at rest on a faint fill was checked at 1:1. Focus indicators and boundaries stay checked.
120
+ - **A control's label can fill the row.** `extent: "fill"` on the text part of an `inline` control makes the
121
+ label take the room the control's other content leaves, so a visual after it stands at the far end: a
122
+ full-width disclosure or FAQ trigger with its sign at the edge, a select trigger with its chevron.
123
+
124
+ ### Fixed
125
+
126
+ - **`showcase-ui`'s Popover opens at its control.** `placement: "trigger"` opens the panel in the top layer at the
127
+ control that opens it, measured from that control (as the example design system's Popover does); the default
128
+ keeps it pinned under the header's end. It was built on 2026-11-20 and withdrawn because the showcase server ran
129
+ out of memory warming it; that no longer happens (peak about 1 GiB while warming, under the 2 GiB limit).
130
+ - **The showcase sidebar fills in after the first preview.** A showcase opened before any revision was previewed
131
+ (right after the server started) showed the Tokens, Profiles and Artwork sections without their pages, and kept
132
+ them empty until a reload: the explorer was announced only when discovery or drafts changed. It is now also
133
+ announced when an emitted revision changes what the views offer. The Tokens view's Problems page has browser
134
+ coverage.
135
+ - **A release re-run finishes a half-published release.** When ADS was published and the guard package was not,
136
+ re-running the release workflow refused because one package already had the version. It now publishes only the
137
+ missing package and keeps an existing GitHub release.
138
+ - **Composed contrast follows plain modules.** A module with no recipe that arranges components (a sheet placing
139
+ rows and avatars) ended every chain at its placements with a `component-contrast-unresolved` review item. It now
140
+ records composition facts as an owner does, so those pairs are proven or reported as failures. Only a module
141
+ whose facts cannot be read keeps the review item.
142
+ - **Composed contrast checks a placement with what it selects.** A placement that leaves a prop out was paired
143
+ with every value of that prop, and an owner state was paired wherever its construction appeared: a shared
144
+ Avatar was held against a Row's selected tints in every colour where the Row was given no `state` and no
145
+ `color`. A prop left out now takes its default (or its absence), and a state that tests an attribute the
146
+ markup writes (`&[data-state="selected"]` with `data-state={state}`) holds only where that value is rendered.
147
+ Every value is still checked on the document surface, where applications place a public component. Owner
148
+ analysis schema `ads-owner-analysis/12`.
149
+ - **An optional glyph in a region.** A region whose optional visual part draws a received glyph only when one is
150
+ given (`icon && <span …/>`, alone or in a ternary's branch) failed with `construction/artwork-binding-missing`:
151
+ the combination without the glyph had nothing to bind, and lowering asked for a binding anyway. A combination
152
+ that does not render an optional visual part now writes no drawing for it.
153
+ - **A glyph's presence test anywhere in a chain of tests.** `lead === undefined && icon && <span …/>` reported
154
+ `glyph-reference-read`, while `icon && lead === undefined && …` passed. The glyph is tested in either position.
155
+ - **`construction/artwork-binding-missing` names what is missing.** A binding that names its asset but no visual
156
+ profile now says so (the drawing has no size), and the repair shows the binding's `visual` field.
157
+ - **A fixed-size box keeps its size in a row.** A frame that states `inlineSize` or `blockSize` now also states
158
+ that size as its minimum on the axis, unless the frame states its own minimum or a maximum there. Before, a
159
+ fixed box in an `inline` row shrank beside long wrapping text: a 22 px disc came out at 9 px. Emitted CSS changes
160
+ for every such frame (`min-inline-size` and `min-block-size`).
161
+
162
+ ## 0.5.2
163
+
57
164
  ### Fixed
58
165
 
59
166
  - Accepting a draft while its preview was still building could log a background compiler
package/docs/GUIDE.md CHANGED
@@ -1163,7 +1163,7 @@ when it is enough for every place the design system uses the profile (the
1163
1163
  table above). A quiet icon colour at 3:1 is its own surface profile, selected
1164
1164
  only by visual parts or text-less controls. These keep 4.5:1: a profile
1165
1165
  nothing uses, one a composite slot supplies, the document surface, and one the
1166
- recipe also names for a pseudo-element, a prose element, a backdrop or an
1166
+ recipe also names for a pseudo-element, a backdrop or an
1167
1167
  entrance. Nothing is released while an owner fails, because its uses are not
1168
1168
  known.
1169
1169
 
@@ -1947,7 +1947,11 @@ follows:
1947
1947
  and the finding names it (for example `:root under @media (pointer: coarse)`).
1948
1948
  - `ads emit` writes the overrides into the emitted sheets unchanged. Nothing
1949
1949
  runs at runtime.
1950
- - ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. Larger touch
1950
+ - ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. A smaller part
1951
+ between targets of one arrangement passes by the spacing exception: a 24 px
1952
+ circle centred on it reaches neither a neighbouring target nor a smaller
1953
+ neighbour's circle, at every gap (window controls 20 px wide, 28 px apart).
1954
+ A root or a part with no neighbouring target keeps the minimum. Larger touch
1951
1955
  targets (44 px is a common platform guideline) are a design choice that the
1952
1956
  tokens express, not a rule that ADS enforces. An owned hit area
1953
1957
  (`minTargetBlockSize`, `minTargetInlineSize` on a frame profile) can enlarge
@@ -1979,7 +1983,60 @@ translucent surface and a lifted drawing.
1979
1983
  Some UI must change its colours with what it sits on. Examples are a dark footer
1980
1984
  or dark card on a light page, a button over a photo or a strongly coloured
1981
1985
  banner, the cells and icons of a selected table row, and the links inside a
1982
- warning banner. ADS has two checked patterns for this.
1986
+ warning banner. ADS has three checked patterns for this; pick one by where the
1987
+ difference comes from:
1988
+
1989
+ | The colour follows | Pattern |
1990
+ | --- | --- |
1991
+ | The container it sits in: links in a heading or a banner, the cells of a selected row, actions on a dark card | [Contextual roles](#contextual-roles) (`provides` on the container's surface) |
1992
+ | A whole theme or brand for a section of the page: a dark footer | [Nested theme and brand sections](#nested-theme-and-brand-sections) |
1993
+ | A look the caller chooses for a background the design system does not know: a button over a photo | [Explicit choices](#explicit-choices) |
1994
+
1995
+ #### Contextual roles
1996
+
1997
+ A container's surface profile re-binds the paint roles its subtree reads
1998
+ ([`provides`](PROFILE-KINDS.md#contextual-roles-provides)). The children keep
1999
+ one design each and read their own roles; inside the container those roles take
2000
+ the container's values. Nothing is passed through props, and the container never
2001
+ styles a child's elements.
2002
+
2003
+ ```css
2004
+ /* tokens/Surfaces/paint.ads.css: the roles children read. */
2005
+ :root {
2006
+ --link-ink: var(--action-fill);
2007
+ --icon-ink: var(--text-secondary);
2008
+ }
2009
+ ```
2010
+
2011
+ ```ts
2012
+ // A warning banner: links and icons inside it take its on-warning ink.
2013
+ profile({ name: "banner-warning", kind: "surface", fields: { background: "--warning-fill", color: "--on-warning" }, provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" } });
2014
+ // A selected row: while the row is selected, its cells' inks follow it.
2015
+ profile({ name: "row-selected", kind: "surface", fields: { background: "--selected-fill", color: "--on-selected" }, provides: { "--link-ink": "--on-selected", "--icon-ink": "--on-selected" } });
2016
+ ```
2017
+
2018
+ ```ts
2019
+ // The row's recipe selects the providing surface under its state; the cells need no prop.
2020
+ recipe({ layout: "inline", surface: "row", when: { '&[aria-selected="true"]': { surface: "row-selected" } } });
2021
+ ```
2022
+
2023
+ **Guarantees.**
2024
+
2025
+ - Lowering writes the provided roles as custom properties on the element that
2026
+ takes the surface (`.row[aria-selected="true"] { --link-ink: var(--on-selected) }`);
2027
+ CSS inheritance carries them to every descendant, components included.
2028
+ - Composed contrast proves the text of everything that can sit inside the
2029
+ container with the provided values on the container's background, in every
2030
+ theme and brand. A provider under a state holds only with that state, so the
2031
+ on-selected ink is paired with the selected background, never the resting one.
2032
+ The nearest provider wins.
2033
+ - Only paint roles are provided, each to another paint token. A surface that
2034
+ provides a token its own fields read is refused
2035
+ (`foundation/provided-role-self`): the element would repaint itself.
2036
+
2037
+ **Limits.** Composed contrast covers text. An icon or a boundary that reads a
2038
+ provided role is checked with its own default value where it is defined; check
2039
+ such non-text paints in the rendered container (the render audit).
1983
2040
 
1984
2041
  #### Nested theme and brand sections
1985
2042
 
@@ -2113,21 +2170,6 @@ static paints do not change between contexts. The on-dark treatment is thus
2113
2170
  readable whatever theme the page uses. Whether the photo needs the treatment is
2114
2171
  the caller's decision, which the type makes explicit.
2115
2172
 
2116
- #### What neither pattern covers
2117
-
2118
- Two cases are not covered:
2119
-
2120
- - state that cascades to children: a selected table row whose cells, icons and
2121
- checkbox switch to "on selected" colours;
2122
- - tinted containers: a success or warning banner whose links and icons must stay
2123
- readable on its tint.
2124
-
2125
- These cases need a prop passed through each child (an explicit choice at every
2126
- level), or a construct that lets a surface set the context that its descendants
2127
- read. ADS has no such surface-context construct. Do not emulate one with a theme
2128
- per state: a theme is a whole colour mode, and the checks would prove every
2129
- token of it.
2130
-
2131
2173
  ### Emitting the design system
2132
2174
 
2133
2175
  `ads emit [directory] [--json] [--force] [--watch]` compiles the design system
@@ -2655,7 +2697,10 @@ tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publ
2655
2697
  the release notes. It does not repeat the local browser and package suite.
2656
2698
  Stable tags publish as `latest`; prerelease tags publish as `next`.
2657
2699
  4. Check the workflow result and the npm version before you update consumer
2658
- dependencies.
2700
+ dependencies. If the second publish failed, re-run the workflow for the same
2701
+ tag: it publishes only the package that does not have the version yet, and
2702
+ leaves an existing GitHub release as it is. A version both packages already
2703
+ have needs a new tag.
2659
2704
 
2660
2705
  The manual workflow moves a label to an existing published version. It does not
2661
2706
  publish new source.