@reqvire-org/ads 0.5.9 → 0.5.10

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 (45) hide show
  1. package/dist/ads-errors.mjs +61 -1
  2. package/dist/analysis/owner-source.mjs +16 -2
  3. package/dist/asset-declaration.d.mts +5 -0
  4. package/dist/asset-declaration.mjs +8 -2
  5. package/dist/asset-model.mjs +3 -0
  6. package/dist/construction-output.mjs +28 -6
  7. package/dist/construction-spec.d.mts +109 -10
  8. package/dist/construction-spec.mjs +173 -45
  9. package/dist/end-alignment.mjs +17 -2
  10. package/dist/form-states.mjs +2 -2
  11. package/dist/grid-lowering.mjs +24 -1
  12. package/dist/lowering-layer.mjs +11 -10
  13. package/dist/lowering-overlaps.mjs +5 -3
  14. package/dist/lowering-properties.mjs +11 -1
  15. package/dist/lowering-region-layout.mjs +4 -4
  16. package/dist/lowering-sequence.mjs +6 -2
  17. package/dist/measured-geometry.mjs +15 -3
  18. package/dist/owner-analysis-check.mjs +3 -0
  19. package/dist/owner-errors.mjs +6 -0
  20. package/dist/ownership-model.mjs +34 -9
  21. package/dist/platform-features.mjs +11 -0
  22. package/dist/press-scale.mjs +3 -1
  23. package/dist/profile-macro.d.mts +5 -0
  24. package/dist/profile-view-facts.mjs +1 -1
  25. package/dist/recipe-macro.d.mts +53 -6
  26. package/dist/recipe-model.mjs +8 -5
  27. package/dist/region-lowering.mjs +398 -30
  28. package/dist/role-vocabulary.d.mts +7 -0
  29. package/dist/role-vocabulary.mjs +13 -1
  30. package/dist/skills/ads-designer/references/motion.md +4 -1
  31. package/dist/skills/ads-designer/references/recipes.md +33 -2
  32. package/dist/skills/ads-import/references/recipes.md +33 -2
  33. package/dist/skills/ads-port/references/recipes.md +33 -2
  34. package/dist/spatial-model.mjs +11 -2
  35. package/dist/surface-effects.mjs +11 -6
  36. package/docs/ARCHITECTURE.md +8 -0
  37. package/docs/ASSETS.md +7 -1
  38. package/docs/CHANGELOG.md +133 -18
  39. package/docs/GUIDE.md +9 -0
  40. package/docs/LANGUAGE.md +137 -17
  41. package/docs/MOTION.md +45 -0
  42. package/docs/PROFILE-KINDS.md +15 -4
  43. package/docs/RULES.md +11 -3
  44. package/docs/TOKEN-ROLES.md +8 -2
  45. package/package.json +1 -1
@@ -144,11 +144,14 @@ declare const tokenRolesByKind: {
144
144
  "text-decoration-color": string[];
145
145
  "box-shadow": string[];
146
146
  "background-image": string[];
147
+ "background-tile": string[];
147
148
  opacity: string[];
148
149
  blur: string[];
149
150
  "backdrop-blur": string[];
150
151
  "backdrop-saturate": string[];
151
152
  brightness: string[];
153
+ grayscale: string[];
154
+ invert: string[];
152
155
  mask: string[];
153
156
  "border-inline-start-color": string[];
154
157
  "border-inline-end-color": string[];
@@ -197,6 +200,10 @@ declare const tokenRolesByKind: {
197
200
  "clear-block-start": string[];
198
201
  "edge-gap": string[];
199
202
  "viewport-margin": string[];
203
+ "anchor-gap": string[];
204
+ "anchor-overlap": string[];
205
+ "anchor-outdent": string[];
206
+ "anchor-indent": string[];
200
207
  "sticky-layer": string[];
201
208
  };
202
209
  spatial: {
@@ -46,6 +46,8 @@ export const tokenShapeGrammars = {
46
46
  blur: "nonnegative-length",
47
47
  saturation: "nonnegative-percentage",
48
48
  brightness: "nonnegative-percentage",
49
+ grayscale: "nonnegative-percentage",
50
+ invert: "nonnegative-percentage",
49
51
  "box-share": "nonnegative-percentage",
50
52
  overlap: "nonnegative-length",
51
53
  "font-family": "font-family-list",
@@ -86,6 +88,8 @@ export const tokenRoleGuides = Object.freeze({
86
88
  blur: { purpose: "A blur radius: a filter, a backdrop, a shadow's blur.", write: "px" },
87
89
  saturation: { purpose: "How vivid colours are, as a filter: of what is behind a surface.", write: "a percentage: 100% leaves colours as they are, 0% is greyscale" },
88
90
  brightness: { purpose: "How bright a drawing is shown, as a filter: a picture with no dark version, dimmed in the dark theme.", write: "a percentage: 100% leaves it as it is, below 100% dims it, 0% is black" },
91
+ grayscale: { purpose: "How grey a drawing is shown, as a filter: colour artwork made quiet, or prepared for inverting on a dark page.", write: "a percentage: 0% leaves its colours, 100% is fully grey" },
92
+ invert: { purpose: "How far a drawing's tones are inverted, as a filter: dark marks made for a light page shown light on a dark one.", write: "a percentage: 0% leaves it as it is, 100% inverts it fully" },
89
93
  "box-share": { purpose: "A share of an element's own box: how far a backdrop is drawn past it on an axis, growing with the box.", write: "a percentage of the box's size on that axis" },
90
94
  overlap: { purpose: "How far neighbours of an arrangement overlap, in place of a gap between them.", write: "px or rem" },
91
95
  "font-family": { purpose: "The text font and its fallbacks.", write: null },
@@ -167,11 +171,14 @@ const tokenRolesByKind = {
167
171
  "text-decoration-color": ["paint"],
168
172
  "box-shadow": ["shadow"],
169
173
  "background-image": ["gradient"],
174
+ "background-tile": ["spacing", "frame-size"],
170
175
  opacity: ["opacity"],
171
176
  blur: ["blur"],
172
177
  "backdrop-blur": ["blur"],
173
178
  "backdrop-saturate": ["saturation"],
174
179
  brightness: ["brightness"],
180
+ grayscale: ["grayscale"],
181
+ invert: ["invert"],
175
182
  mask: ["gradient"],
176
183
  "border-inline-start-color": ["paint"],
177
184
  "border-inline-end-color": ["paint"],
@@ -209,6 +216,10 @@ const tokenRolesByKind = {
209
216
  "clear-block-start": ["layout-size"],
210
217
  "edge-gap": ["spacing"],
211
218
  "viewport-margin": ["spacing"],
219
+ "anchor-gap": ["spacing"],
220
+ "anchor-overlap": ["overlap"],
221
+ "anchor-outdent": ["spacing"],
222
+ "anchor-indent": ["spacing"],
212
223
  "sticky-layer": ["layer"]
213
224
  },
214
225
  spatial: {
@@ -268,7 +279,8 @@ export const sequenceStepTokenRoles = {
268
279
  scale: ["motion-scale"],
269
280
  "scale-inline": ["motion-scale"],
270
281
  "scale-block": ["motion-scale"],
271
- rotate: ["motion-angle"]
282
+ rotate: ["motion-angle"],
283
+ draw: []
272
284
  };
273
285
  export function spatialClauseFieldNames(clause) {
274
286
  const roles = Object.hasOwn(spatialClauseTokenRoles, clause) ? spatialClauseTokenRoles[clause] : void 0;
@@ -92,7 +92,10 @@ Define motion in the recipe, control it in script. A component never calls
92
92
  what the recipe declared, and uses `element.getAnimations()` (`finished`,
93
93
  `cancel()`, `pause()`, `currentTime`) or the animation events to wait for,
94
94
  cancel or seek it. A fade between states is the `opacity` channel of
95
- `paintTransition`; a one-axis scale is `scaleInline` or `scaleBlock`; a turn in
95
+ `paintTransition`; a one-axis scale is `scaleInline` or `scaleBlock`, growing from the element's `origin` (its
96
+ centre, or an edge: an underline that stretches from its start is `origin: "inline-start"`); a drawing's named
97
+ groups (a wordmark's letters, a diagram's edges) play sequences through the part's `groups`, a line draws itself with
98
+ a `draw` step, and `play: { paused: true }` holds a sequence until the owner's state plays it; a turn in
96
99
  place under a state (a plus that becomes a cross while its panel is open) is
97
100
  `rotate`, from the motion profile's `angle`, kept under reduced motion without
98
101
  its animation.
@@ -285,13 +285,37 @@ fragment or a native frame-only element.
285
285
  - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
286
286
  stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
287
287
  `inline` row, `gap` spaces the items and `rowGap` the lines.
288
+ - **Fields for common layouts.** Prefer these to workarounds:
289
+ - a phone bar above the home indicator: `safeArea: ["block-end"]` on the frame;
290
+ - a menu trigger whose pointer area reaches its panel: `minTargetBlockSize` on the part's frame profile;
291
+ - a table's row names fixed while it scrolls sideways: `sticky: { edge: "inline-start" }`;
292
+ - centred on phones, start-aligned wider: `at: { "<condition>": { align, justify, textAlign } }`;
293
+ - a part's divider and corners that move per width: `frame: { profile, rules, corners }` with `at: { frame }`;
294
+ - a scroller that keeps its scroll: `overscroll: "contain"`;
295
+ - a decorative layer over interactive content: `normalize: { pointerEvents: "none" }` on the part;
296
+ - a link card without an underline: `normalize: { textDecoration: "none" }`; a card that lifts as a whole:
297
+ `translateBlock` in the root's `when` with `transition: ["translate"]`;
298
+ - a dot grid: a surface's `backgroundTile`; a grey logo shown light in the dark theme: `grayscale` and `invert`
299
+ with `brightness` on the image's surface;
300
+ - an illustration that animates (a diagram, a wordmark): an asset with named `groups`, shown in a decoration, its
301
+ groups played by the part's `groups`, and its labels as text parts with `anchor: { artwork, x, y }`. Never draw it
302
+ as markup in the owner.
303
+ - **Rules between items.** Hairlines between rows, between items in a row or between a grid's cells are
304
+ `between: { surface, frame, axes }` on the arrangement: ADS places them at every width, centred in the gap, partial
305
+ rows included. Never hand-write `:nth-child` borders per breakpoint.
306
+ - **Decorations.** Artwork or a pattern that means nothing (a graph behind a panel, a dot grid, a glow, a page
307
+ backdrop) is a `kind: "decoration"` part: ADS lays it behind its parent's content, fills the parent's box (or the
308
+ viewport with `attachment: "fixed"`), crops its artwork in any paint mode, and keeps it `aria-hidden` and inert.
309
+ Never draw a backdrop as application markup or a `layered` arrangement of your own.
288
310
  - **Loose flow.** Write loose content in block flow (no `layout`) with `spaceBefore`/`spaceAfter` on its blocks: each
289
311
  is the block's own margin and the browser collapses them, so an item that ends in a paragraph is followed at the
290
312
  larger of the list's and the paragraph's space, also when the item's content is another component. `carry: true`
291
313
  does the same within one stack-based list and item, but not through a nested component.
292
314
  A placed component part spaces the same way. Inside its own padding or border a block flow starts and ends flush
293
315
  (a callout's last paragraph adds no space); a frameless root that must start flush, such as a page opening with a
294
- heading, declares `flow: { edges: "trim" }`.
316
+ heading, declares `flow: { edges: "trim" }`. So does a flow that is a component's root inside another component's
317
+ padding (Content inside a Callout): the padding is not the flow's own. An `inline` row in block flow that states its own
318
+ space is a block, so its space collapses with the paragraph's above it; a row without space stays inline.
295
319
  - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
296
320
  scrolling body never collapses in a stack sized by its content.
297
321
  - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
@@ -328,6 +352,10 @@ A region recipe's root can live in the browser's top layer through a closed
328
352
  - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
329
353
  profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
330
354
  `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
355
+ - **A header's menu.** A `popover: "manual"` measured popover the owner opens on hover and focus (closing after a
356
+ short grace), placed from the trigger's measured corner with the layer profile's `anchorOverlap`/`anchorGap` and
357
+ `anchorOutdent`/`anchorIndent`, and `motion: "drop"`: it fades, comes down its motion profile's `distance` and grows
358
+ from its `scale`. Never add the offsets in the script.
331
359
 
332
360
  <a id="measured"></a>
333
361
  ## Measured values and runtime paints
@@ -410,7 +438,10 @@ text part breaks one way, set by one `wrap` field:
410
438
  - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
411
439
  browser's font, centred text, border, fill and margin wherever the construction states none.
412
440
  - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
413
- frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
441
+ frame profile; the thumb's background or ring needs 3:1 against the track. A fill up to the handle is `sliderFill`
442
+ with a measured `share` (`slider-fill`) the owner writes at render; the thumb grows with `grow` and shows the focus
443
+ indicator. Step labels are a row `along` the slider, each label at its measured `slider-step` share. Never paint the
444
+ fill or place the labels in the owner.
414
445
 
415
446
  <a id="assets"></a>
416
447
  ## Assets in recipes
@@ -285,13 +285,37 @@ fragment or a native frame-only element.
285
285
  - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
286
286
  stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
287
287
  `inline` row, `gap` spaces the items and `rowGap` the lines.
288
+ - **Fields for common layouts.** Prefer these to workarounds:
289
+ - a phone bar above the home indicator: `safeArea: ["block-end"]` on the frame;
290
+ - a menu trigger whose pointer area reaches its panel: `minTargetBlockSize` on the part's frame profile;
291
+ - a table's row names fixed while it scrolls sideways: `sticky: { edge: "inline-start" }`;
292
+ - centred on phones, start-aligned wider: `at: { "<condition>": { align, justify, textAlign } }`;
293
+ - a part's divider and corners that move per width: `frame: { profile, rules, corners }` with `at: { frame }`;
294
+ - a scroller that keeps its scroll: `overscroll: "contain"`;
295
+ - a decorative layer over interactive content: `normalize: { pointerEvents: "none" }` on the part;
296
+ - a link card without an underline: `normalize: { textDecoration: "none" }`; a card that lifts as a whole:
297
+ `translateBlock` in the root's `when` with `transition: ["translate"]`;
298
+ - a dot grid: a surface's `backgroundTile`; a grey logo shown light in the dark theme: `grayscale` and `invert`
299
+ with `brightness` on the image's surface;
300
+ - an illustration that animates (a diagram, a wordmark): an asset with named `groups`, shown in a decoration, its
301
+ groups played by the part's `groups`, and its labels as text parts with `anchor: { artwork, x, y }`. Never draw it
302
+ as markup in the owner.
303
+ - **Rules between items.** Hairlines between rows, between items in a row or between a grid's cells are
304
+ `between: { surface, frame, axes }` on the arrangement: ADS places them at every width, centred in the gap, partial
305
+ rows included. Never hand-write `:nth-child` borders per breakpoint.
306
+ - **Decorations.** Artwork or a pattern that means nothing (a graph behind a panel, a dot grid, a glow, a page
307
+ backdrop) is a `kind: "decoration"` part: ADS lays it behind its parent's content, fills the parent's box (or the
308
+ viewport with `attachment: "fixed"`), crops its artwork in any paint mode, and keeps it `aria-hidden` and inert.
309
+ Never draw a backdrop as application markup or a `layered` arrangement of your own.
288
310
  - **Loose flow.** Write loose content in block flow (no `layout`) with `spaceBefore`/`spaceAfter` on its blocks: each
289
311
  is the block's own margin and the browser collapses them, so an item that ends in a paragraph is followed at the
290
312
  larger of the list's and the paragraph's space, also when the item's content is another component. `carry: true`
291
313
  does the same within one stack-based list and item, but not through a nested component.
292
314
  A placed component part spaces the same way. Inside its own padding or border a block flow starts and ends flush
293
315
  (a callout's last paragraph adds no space); a frameless root that must start flush, such as a page opening with a
294
- heading, declares `flow: { edges: "trim" }`.
316
+ heading, declares `flow: { edges: "trim" }`. So does a flow that is a component's root inside another component's
317
+ padding (Content inside a Callout): the padding is not the flow's own. An `inline` row in block flow that states its own
318
+ space is a block, so its space collapses with the paragraph's above it; a row without space stays inline.
295
319
  - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
296
320
  scrolling body never collapses in a stack sized by its content.
297
321
  - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
@@ -328,6 +352,10 @@ A region recipe's root can live in the browser's top layer through a closed
328
352
  - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
329
353
  profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
330
354
  `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
355
+ - **A header's menu.** A `popover: "manual"` measured popover the owner opens on hover and focus (closing after a
356
+ short grace), placed from the trigger's measured corner with the layer profile's `anchorOverlap`/`anchorGap` and
357
+ `anchorOutdent`/`anchorIndent`, and `motion: "drop"`: it fades, comes down its motion profile's `distance` and grows
358
+ from its `scale`. Never add the offsets in the script.
331
359
 
332
360
  <a id="measured"></a>
333
361
  ## Measured values and runtime paints
@@ -410,7 +438,10 @@ text part breaks one way, set by one `wrap` field:
410
438
  - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
411
439
  browser's font, centred text, border, fill and margin wherever the construction states none.
412
440
  - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
413
- frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
441
+ frame profile; the thumb's background or ring needs 3:1 against the track. A fill up to the handle is `sliderFill`
442
+ with a measured `share` (`slider-fill`) the owner writes at render; the thumb grows with `grow` and shows the focus
443
+ indicator. Step labels are a row `along` the slider, each label at its measured `slider-step` share. Never paint the
444
+ fill or place the labels in the owner.
414
445
 
415
446
  <a id="assets"></a>
416
447
  ## Assets in recipes
@@ -285,13 +285,37 @@ fragment or a native frame-only element.
285
285
  - **Distribution and gaps.** `justify: "space-between"` (or `"space-around"`, `"space-evenly"`) puts a row's or
286
286
  stack's free space between its items: a logo at the start of a header and its actions at the end. On a wrapping
287
287
  `inline` row, `gap` spaces the items and `rowGap` the lines.
288
+ - **Fields for common layouts.** Prefer these to workarounds:
289
+ - a phone bar above the home indicator: `safeArea: ["block-end"]` on the frame;
290
+ - a menu trigger whose pointer area reaches its panel: `minTargetBlockSize` on the part's frame profile;
291
+ - a table's row names fixed while it scrolls sideways: `sticky: { edge: "inline-start" }`;
292
+ - centred on phones, start-aligned wider: `at: { "<condition>": { align, justify, textAlign } }`;
293
+ - a part's divider and corners that move per width: `frame: { profile, rules, corners }` with `at: { frame }`;
294
+ - a scroller that keeps its scroll: `overscroll: "contain"`;
295
+ - a decorative layer over interactive content: `normalize: { pointerEvents: "none" }` on the part;
296
+ - a link card without an underline: `normalize: { textDecoration: "none" }`; a card that lifts as a whole:
297
+ `translateBlock` in the root's `when` with `transition: ["translate"]`;
298
+ - a dot grid: a surface's `backgroundTile`; a grey logo shown light in the dark theme: `grayscale` and `invert`
299
+ with `brightness` on the image's surface;
300
+ - an illustration that animates (a diagram, a wordmark): an asset with named `groups`, shown in a decoration, its
301
+ groups played by the part's `groups`, and its labels as text parts with `anchor: { artwork, x, y }`. Never draw it
302
+ as markup in the owner.
303
+ - **Rules between items.** Hairlines between rows, between items in a row or between a grid's cells are
304
+ `between: { surface, frame, axes }` on the arrangement: ADS places them at every width, centred in the gap, partial
305
+ rows included. Never hand-write `:nth-child` borders per breakpoint.
306
+ - **Decorations.** Artwork or a pattern that means nothing (a graph behind a panel, a dot grid, a glow, a page
307
+ backdrop) is a `kind: "decoration"` part: ADS lays it behind its parent's content, fills the parent's box (or the
308
+ viewport with `attachment: "fixed"`), crops its artwork in any paint mode, and keeps it `aria-hidden` and inert.
309
+ Never draw a backdrop as application markup or a `layered` arrangement of your own.
288
310
  - **Loose flow.** Write loose content in block flow (no `layout`) with `spaceBefore`/`spaceAfter` on its blocks: each
289
311
  is the block's own margin and the browser collapses them, so an item that ends in a paragraph is followed at the
290
312
  larger of the list's and the paragraph's space, also when the item's content is another component. `carry: true`
291
313
  does the same within one stack-based list and item, but not through a nested component.
292
314
  A placed component part spaces the same way. Inside its own padding or border a block flow starts and ends flush
293
315
  (a callout's last paragraph adds no space); a frameless root that must start flush, such as a page opening with a
294
- heading, declares `flow: { edges: "trim" }`.
316
+ heading, declares `flow: { edges: "trim" }`. So does a flow that is a component's root inside another component's
317
+ padding (Content inside a Callout): the padding is not the flow's own. An `inline` row in block flow that states its own
318
+ space is a block, so its space collapses with the paragraph's above it; a row without space stays inline.
295
319
  - **Filling parts.** `extent: "fill"` in a stack starts at the part's content and grows into free space, so a
296
320
  scrolling body never collapses in a stack sized by its content.
297
321
  - **End alignment.** Blocks a stack holds end on one line (`source/end-misaligned`): a painted block by its outer
@@ -328,6 +352,10 @@ A region recipe's root can live in the browser's top layer through a closed
328
352
  - **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
329
353
  profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
330
354
  `backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
355
+ - **A header's menu.** A `popover: "manual"` measured popover the owner opens on hover and focus (closing after a
356
+ short grace), placed from the trigger's measured corner with the layer profile's `anchorOverlap`/`anchorGap` and
357
+ `anchorOutdent`/`anchorIndent`, and `motion: "drop"`: it fades, comes down its motion profile's `distance` and grows
358
+ from its `scale`. Never add the offsets in the script.
331
359
 
332
360
  <a id="measured"></a>
333
361
  ## Measured values and runtime paints
@@ -410,7 +438,10 @@ text part breaks one way, set by one `wrap` field:
410
438
  - **Native controls.** A `<button>`, `<input>`, `<textarea>` or `<select>` that a construction draws loses the
411
439
  browser's font, centred text, border, fill and margin wherever the construction states none.
412
440
  - **Range sliders.** `pseudo: { sliderTrack, sliderThumb }` on an `<input type="range">` part, each a surface and a
413
- frame profile; the thumb needs 3:1 against the track. Tick labels are a `space-between` row.
441
+ frame profile; the thumb's background or ring needs 3:1 against the track. A fill up to the handle is `sliderFill`
442
+ with a measured `share` (`slider-fill`) the owner writes at render; the thumb grows with `grow` and shows the focus
443
+ indicator. Step labels are a row `along` the slider, each label at its measured `slider-step` share. Never paint the
444
+ fill or place the labels in the owner.
414
445
 
415
446
  <a id="assets"></a>
416
447
  ## Assets in recipes
@@ -79,7 +79,7 @@ export function spatialModel(input, values) {
79
79
  fail(`${mode} is a gap gutter or an edge gutter, not both.`);
80
80
  const gap = token(edges.gap), gapPx = length(gap);
81
81
  for (const point of breakpoints)
82
- if (point.fromPx - point.marginPx * 2 <= gapPx * (point.count - 1))
82
+ if (point.fromPx - point.marginPx * 2 <= gapPx)
83
83
  fail(`${mode} gaps leave no track width at ${point.name}.`);
84
84
  gutters[mode] = { start: "0", end: "0", gap };
85
85
  continue;
@@ -233,7 +233,16 @@ function expand(css, model) {
233
233
  const gutter = props.gutter ?? "wide", declaredGutter = gutter === "none" ? null : system.gutters[gutter];
234
234
  if (gutter !== "none" && !declaredGutter)
235
235
  fail(`Unknown gutter ${gutter}.`);
236
- const trackGap = declaredGutter?.gap ?? null, edges = trackGap === null ? declaredGutter : null, spacing = (value) => {
236
+ const trackGap = declaredGutter?.gap ?? null, edges = trackGap === null ? declaredGutter : null;
237
+ if (trackGap !== null) {
238
+ const gapPx = system.length(trackGap), local = props.columns === void 0 ? null : Number(props.columns);
239
+ for (const point of system.breakpoints) {
240
+ const count = local ?? point.count;
241
+ if (point.fromPx - point.marginPx * 2 <= gapPx * (count - 1))
242
+ fail(`${gutter} gaps leave no track width at ${point.name} for ${count} columns.`);
243
+ }
244
+ }
245
+ const spacing = (value) => {
237
246
  if (value !== "0")
238
247
  system.length(value);
239
248
  return cssToken(value);
@@ -1,9 +1,9 @@
1
1
  import { resolveTokenValue } from "./token-resolution.mjs";
2
- export const SHAPE_SHADOW = "shape-shadow", GROUP_SHADOW = "group-shadow", BRIGHTNESS = "brightness";
3
- const FILTER_FIELDS = [BRIGHTNESS, "blur", SHAPE_SHADOW, GROUP_SHADOW], BACKDROP_FIELDS = ["backdrop-blur", "backdrop-saturate"];
4
- export const MASK = "mask", EFFECT_FIELDS = [...FILTER_FIELDS, ...BACKDROP_FIELDS], EFFECT_PROPERTY_FIELDS = { filter: FILTER_FIELDS, "backdrop-filter": BACKDROP_FIELDS };
2
+ export const SHAPE_SHADOW = "shape-shadow", GROUP_SHADOW = "group-shadow", BRIGHTNESS = "brightness", GRAYSCALE = "grayscale", INVERT = "invert";
3
+ const TONE_FIELDS = [GRAYSCALE, INVERT, BRIGHTNESS], FILTER_FIELDS = [...TONE_FIELDS, "blur", SHAPE_SHADOW, GROUP_SHADOW], BACKDROP_FIELDS = ["backdrop-blur", "backdrop-saturate"];
4
+ export const MASK = "mask", BACKGROUND_TILE = "background-tile", EFFECT_FIELDS = [...FILTER_FIELDS, ...BACKDROP_FIELDS], EFFECT_PROPERTY_FIELDS = { filter: FILTER_FIELDS, "backdrop-filter": BACKDROP_FIELDS };
5
5
  export function filterValue(fields) {
6
- const shadow = fields[SHAPE_SHADOW] ?? fields[GROUP_SHADOW], parts = [...fields[BRIGHTNESS] === void 0 ? [] : [`brightness(${fields[BRIGHTNESS]})`], ...fields.blur === void 0 ? [] : [`blur(${fields.blur})`], ...shadow === void 0 ? [] : [`drop-shadow(${shadow})`]];
6
+ const shadow = fields[SHAPE_SHADOW] ?? fields[GROUP_SHADOW], parts = [...TONE_FIELDS.flatMap((field) => fields[field] === void 0 ? [] : [`${field}(${fields[field]})`]), ...fields.blur === void 0 ? [] : [`blur(${fields.blur})`], ...shadow === void 0 ? [] : [`drop-shadow(${shadow})`]];
7
7
  return parts.length === 0 ? null : parts.join(" ");
8
8
  }
9
9
  export function backdropFilterValue(fields) {
@@ -17,6 +17,10 @@ export function effectDeclarations(values) {
17
17
  const declarations = [];
18
18
  let composed = !1;
19
19
  for (const [property, value] of Object.entries(values)) {
20
+ if (property === BACKGROUND_TILE) {
21
+ declarations.push(["background-size", `${value} ${value}`], ["background-repeat", "repeat"]);
22
+ continue;
23
+ }
20
24
  if (property === MASK) {
21
25
  declarations.push(["-webkit-mask-image", value], ["mask-image", value]);
22
26
  continue;
@@ -42,8 +46,9 @@ export function effectMisplaced(fields, place) {
42
46
  return { reason: "both", field: GROUP_SHADOW };
43
47
  if (fields[MASK] !== void 0 && place === "container")
44
48
  return { reason: "mask-on-container", field: MASK };
45
- if (fields[BRIGHTNESS] !== void 0 && place !== "visual")
46
- return { reason: "brightness-off-visual", field: BRIGHTNESS };
49
+ const tone = TONE_FIELDS.find((field) => fields[field] !== void 0);
50
+ if (tone !== void 0 && place !== "visual")
51
+ return { reason: "brightness-off-visual", field: tone };
47
52
  if (shape && place !== "visual")
48
53
  return { reason: "shape-on-container", field: SHAPE_SHADOW };
49
54
  if (group && place === "visual")
@@ -614,6 +614,14 @@ The emitted example design system and fixtures are held to the inventory in both
614
614
  The registry states facts, never browser versions. ADS has no declared browser
615
615
  targets: the application checks the recorded features against its own targets.
616
616
 
617
+ A lowering may also wait for a platform feature. Rules between arranged items
618
+ (`between: { axes }`) are drawn by each item's `::before` and the host's clip
619
+ (`src/region-lowering.mts` `betweenItemRules`), which every engine renders the
620
+ same. CSS gap decorations (`row-rule`, `column-rule` on grid and flex) draw the
621
+ same rules natively; they shipped in Chromium 149 (June 2026) and are not yet in
622
+ WebKit or Gecko. Once they are Baseline, the lowering switches to them, the clip
623
+ and the `::before` are no longer needed, and recipes do not change.
624
+
617
625
  ### Why compile at build time
618
626
 
619
627
  The choice serves performance as well as ownership:
package/docs/ASSETS.md CHANGED
@@ -134,7 +134,13 @@ assets/
134
134
  override the asset's center. The recipe reserves the corrected extent and
135
135
  applies the opposite translation; owners cannot add pixel nudges. Where
136
136
  intrinsic artwork is cropped (`fit: "cover"`), the same point is the crop's
137
- focal point.
137
+ focal point. A [decoration](LANGUAGE.md#decorations) crops artwork of any
138
+ paint mode, a themed (paint-slot) drawing included, around the same point.
139
+ - `groups: ["<name>", …]` names groups of the drawing a recipe may animate
140
+ (a wordmark's letters, a diagram's edges, [MOTION.md](MOTION.md#groups-inside-a-drawing)).
141
+ Every drawing of the asset marks exactly those groups, each once, with
142
+ `data-group="<name>"` on the group's element. Only a drawing shown as inline
143
+ SVG has them: paint slots or foreground, not intrinsic.
138
144
  - `minDrawnHeight: 48` is an optional positive CSS-pixel legibility limit for
139
145
  the fitted SVG viewport, excluding contain letterboxing. It is asset metadata,
140
146
  not a sizing token, and each drawing keeps its own geometry: Journey's 144×96
package/docs/CHANGELOG.md CHANGED
@@ -1,53 +1,168 @@
1
1
  # Changelog
2
2
 
3
- ## 0.5.9
3
+ ## 0.5.10
4
4
 
5
5
  <!-- ads-local-tests:start -->
6
6
  Hot patch: the unit and integration groups; the browser group was not run.
7
- Local verification: **1850/1850 passed** with `bun run test:hotpatch`.
8
- Tested commit: `d5d38781ec97f5a8027b2813b631f3a2cc28fcba`; Bun 1.4.4.
9
- Completed 2026-11-24T14:53:56.818Z (1267 seconds).
7
+ Local verification: **1889/1889 passed** with `bun run test:hotpatch`.
8
+ Tested commit: `5e8607a7a836bd22e9c90192b57afba99761f0f0`; Bun 1.4.4.
9
+ Completed 2026-11-25T19:01:28.346Z (1550 seconds).
10
10
 
11
11
  <!-- ads-local-test-proof
12
12
  {
13
13
  "schema": 3,
14
- "version": "0.5.9",
15
- "commit": "d5d38781ec97f5a8027b2813b631f3a2cc28fcba",
16
- "sourceSha256": "bc5fc627cf6a4509b875df54976999f27420a146b7f0f6230466f1d5815cd6c7",
14
+ "version": "0.5.10",
15
+ "commit": "5e8607a7a836bd22e9c90192b57afba99761f0f0",
16
+ "sourceSha256": "01ea140189ee874134a6e221695045e07bea540794ba99b2f69a79f715977e1e",
17
17
  "command": "bun run test:hotpatch",
18
18
  "scope": "hotpatch",
19
19
  "result": "pass",
20
- "tests": 1850,
21
- "pass": 1850,
20
+ "tests": 1889,
21
+ "pass": 1889,
22
22
  "fail": 0,
23
23
  "skipped": 0,
24
24
  "groups": [
25
25
  {
26
26
  "name": "unit",
27
- "tests": 842,
28
- "pass": 842,
27
+ "tests": 846,
28
+ "pass": 846,
29
29
  "fail": 0,
30
30
  "skipped": 0,
31
- "reportSha256": "3e3484b5d9645fa102b872cefa7ca4b851dee3e24288df9ca7e45999f340e502"
31
+ "reportSha256": "09ee5055c17233a42fb6d4338a6a0450a63e6ec47ab9ef8fd89abca1aa039ec5"
32
32
  },
33
33
  {
34
34
  "name": "integration",
35
- "tests": 1008,
36
- "pass": 1008,
35
+ "tests": 1043,
36
+ "pass": 1043,
37
37
  "fail": 0,
38
38
  "skipped": 0,
39
- "reportSha256": "1c137683cc4a84a32e13a0e46386c7ec5c960b227d9732d4b9b5bb821c5f3b83"
39
+ "reportSha256": "06279ab2f36dc240a06149cb1204a06e76e322ccd9bbd53384013e6d8cc9e253"
40
40
  }
41
41
  ],
42
42
  "testOverrides": {},
43
43
  "bun": "1.4.4",
44
- "completedAt": "2026-11-24T14:53:56.818Z",
45
- "durationMs": 1266621,
46
- "logSha256": "ab072db4f97918a409c96d780ae4014855e2953f8a312230a4b850dd97b3ff96"
44
+ "completedAt": "2026-11-25T19:01:28.346Z",
45
+ "durationMs": 1549866,
46
+ "logSha256": "154782a5ad2a3298b1199543ac692d8c1c3a62baca7c76ab1633c018b0788b40"
47
47
  }
48
48
  -->
49
49
  <!-- ads-local-tests:end -->
50
50
 
51
+ Changes an existing design may notice: an `inline` row directly in block flow
52
+ that states its own space (`spaceBefore`, `spaceAfter`, `spacing`) now starts its
53
+ own line and collapses its space with its neighbours' (#46); a row beside inline
54
+ text without space of its own is unchanged. Everything else below is new
55
+ vocabulary or a check that refused valid designs and no longer does.
56
+
57
+ - *A scale can grow from an edge* (`origin`, on a root or part; reported as
58
+ #97). `"inline-start"`, `"inline-end"`, `"block-start"` or `"block-end"` set
59
+ where the element's scales and rotation grow from, in states, entrances and
60
+ sequences alike; inline edges are mirrored under right-to-left. An underline
61
+ can now stretch in from its start instead of sliding in. `"center"` stays the
62
+ default.
63
+ - *Fixed: a gap gutter is checked against the grid that uses it* (#41). A gap
64
+ gutter's width was checked as if it sat between every page-grid column, so a
65
+ two-column FAQ with a 72 px gap "left no track width" on phones. The check
66
+ now counts the gaps of the grid that uses the gutter (its local `columns`, or
67
+ the page grid's), at every tier.
68
+ - *Fixed: false `ambiguous-overlap` on a stack part's space* (#44). A part's
69
+ space after (`head + :not(:first-child)`) and a margin reset two levels inside
70
+ that part were taken as possibly one element. Selectors of children and
71
+ adjacent siblings from the root fix their target's depth: different depths
72
+ are different elements.
73
+ - *Fixed: a light/dark image pair rendered under a condition* (#31) is a content
74
+ image. The combination that leaves the pair out no longer reports "not a
75
+ content image" or an unmeasurable intrinsic size.
76
+ - *Fixed: end alignment of a tinted band across a card* (#45). In a card that
77
+ paints its own box with no inline padding, a painted part's edge is the
78
+ card's edge, not a line the other blocks' content ends on.
79
+ - *A slider that fills up to its handle, with its steps under it* (#32). A
80
+ range slider's `sliderFill` is drawn up to the thumb: Firefox's own progress
81
+ part, and elsewhere the track painted up to a measured `share` the owner
82
+ writes at render. A row of step labels `along` the slider centres each label
83
+ under the thumb's place for its step. The thumb takes its surface's shadow,
84
+ grows by a motion field while pointed at or dragged (`grow`), and shows the
85
+ focus indicator. Its 3:1 against the track may come from its ring. New codes:
86
+ `construction/slider-fill-unsupported`, `construction/slider-steps-unsupported`.
87
+ Fixed: a slider treatment's `when` takes `{ surface }` in its type, as the
88
+ parser always required.
89
+ - *A header's menu drops from under its trigger* (#24). A popover's layer
90
+ `motion: "drop"` fades it while it comes down its motion profile's `distance`
91
+ from its `scale`, growing from its top edge, and sends it back up as it
92
+ closes; reduced motion shows it at once. A measured popover's layer profile
93
+ takes `anchorGap` or `anchorOverlap` and `anchorOutdent` or `anchorIndent`,
94
+ added to the measured position, so the owner reports only where the trigger
95
+ is and the distance stays design.
96
+ - *Groups inside a drawing, drawn lines and labels on a drawing* (#30, #98).
97
+ An asset declares named `groups` its SVG marks (`data-group`); a visual or
98
+ decoration part's `groups` plays sequences on them, so a wordmark's letters
99
+ drop in turn and a diagram's dots appear. A sequence step `draw: "hidden" |
100
+ "drawn"` reveals a line along its `pathLength="1"`; `play: { paused: true }`
101
+ holds a sequence at its first step under one owner state until another plays
102
+ it. A text part's `anchor: { artwork, x, y }` places real, checked text on a
103
+ sibling decoration's drawing in its own coordinates. New codes:
104
+ `construction/artwork-group-unknown`, `construction/artwork-group-draw-length`,
105
+ `construction/text-anchor-unsupported`. Also fixed: two rules whose target
106
+ states exclude each other (`[data-group="edges"]`, `[data-group="nodes"]`) are
107
+ no longer an ambiguous overlap, whatever their paths.
108
+ - *Tone filters for content images*: a surface's `grayscale` and `invert`
109
+ (new token roles, nonnegative percentages) beside `brightness`, composed in
110
+ one order, so a grey logo made for a light page shows as light marks in the
111
+ dark theme (v2's `grayscale(1) invert(1) brightness(1.8)`). A visual part's
112
+ only, as `brightness` is (`construction/surface-effect-misplaced`).
113
+ - *Rules between arranged items* (`between: { surface, frame, axes }`, #25):
114
+ hairlines between rows, between items in a row, or between a fluid grid's
115
+ columns and rows, wherever the arrangement puts its items at every width (a
116
+ logo band at 2, 3 and 6 columns, partial rows included), centred in the gap.
117
+ Each item draws the rules on its start sides and the host clips the
118
+ outermost, in plain CSS every engine renders the same; CSS gap decorations
119
+ replace it once they are Baseline. `construction/between-axes-unsupported`
120
+ refuses an axis the arrangement does not separate on.
121
+ - *Decorations* (`kind: "decoration"`, #29). Artwork or a pattern that means
122
+ nothing (a graph behind a panel, a dot grid, a glow, a page backdrop) is a
123
+ part ADS lays behind its parent's content: it fills the parent's box (or the
124
+ viewport, `attachment: "fixed"`), may spill past it by `outset`, and its
125
+ artwork is cropped or contained against its own size in any paint mode, a
126
+ themed drawing included, with no ratio box. It is `aria-hidden` and inert by
127
+ construction (`source/decoration-exposed`); text over it is the review note
128
+ `review/decoration-under-text`, measured by the render audit.
129
+ - *A tiled background* (#28): a surface's `backgroundTile` repeats its
130
+ `backgroundImage` gradient at that square size (`background-size`,
131
+ `background-repeat`), so a banner can carry a dot grid.
132
+ - *A part's box takes `rules` and `corners`, and changes them under a named
133
+ condition* (#34), as a root frame does: a split card's tinted side moves its
134
+ hairline and rounded corners when the card goes side by side.
135
+ - *Alignment under a named condition* (#27): `at: { "<condition>": { align,
136
+ justify, textAlign } }` on a root or a part, so a banner is centred on phones
137
+ and start-aligned from a width.
138
+ - *Sticky on an inline edge* (#43): `sticky: { edge: "inline-start" }` (or
139
+ `"inline-end"`) keeps a table's row-name column in place while its frame
140
+ scrolls sideways, following the writing direction.
141
+ - *A part's enlarged hit area* (#23): a part's frame profile with
142
+ `minTargetBlockSize` / `minTargetInlineSize` gets the same invisible hit
143
+ region a control's does, so a menu trigger's pointer area can span the gap
144
+ to its panel without moving layout.
145
+ - *Safe-area insets* (#26): `safeArea: ["block-end", …]` on a root's frame or
146
+ a part's `frame: { profile }` adds `env(safe-area-inset-*)` to those sides'
147
+ padding (a phone menu's bottom row above the home indicator).
148
+ - *A root travels under its states* (#40): `translateBlock` / `translateInline`
149
+ from the motion slot in a root `when` entry and `translate` in its
150
+ `transition`, so a link card lifts as a whole on hover.
151
+ - *A part's `normalize` takes `pointerEvents: "none"` and `textDecoration`*
152
+ (#22, #40): a decorative layer over interactive content at any depth (checked
153
+ to be decorative), and a link card's link without its underline.
154
+ - *`overscroll: "contain"`* beside a scrolling `overflow` (#33): a dialog's
155
+ results list keeps its scroll to itself.
156
+ - *A row in block flow that states its own space is a block* (#46): its space
157
+ collapses with the previous block's (a buttons row after an article's last
158
+ paragraph), keeping its content's width. A row without space of its own
159
+ stays inline-level beside inline text.
160
+ - The block-flow docs say when the automatic flush does not apply: a flow that
161
+ is a component's root inside another component's padding (Content inside a
162
+ Callout) declares `flow: { edges: "trim" }`.
163
+
164
+ ## 0.5.9
165
+
51
166
  - *The state switch and live controls moved into the showcase header.* A
52
167
  scenario's states and controls stand in a second header row over the preview
53
168
  column only, in the showcase's own chrome, and hide with the header. The
package/docs/GUIDE.md CHANGED
@@ -1186,6 +1186,15 @@ known.
1186
1186
  timing, a disabled control looks enabled: select an inactive surface there,
1187
1187
  or lower its opacity. A hover held off with `:not(:disabled)` alone declares
1188
1188
  no disabled state; it does not prove the control can be disabled.
1189
+ - A decoration (`kind: "decoration"`, [LANGUAGE.md](LANGUAGE.md#decorations))
1190
+ means nothing: its element is `aria-hidden="true"` and holds nothing a person
1191
+ can use (`source/decoration-exposed`). Text in the same owner is drawn over
1192
+ it, so its contrast depends on the decoration's pixels: the review note
1193
+ `review/decoration-under-text` asks for a scenario, and the render audit
1194
+ measures the text in every theme.
1195
+ - A surface's tone filters (`grayscale`, `invert`, `brightness`) belong to a
1196
+ visual part: on a container they would change the colour of the text inside
1197
+ it without a contrast check (`construction/surface-effect-misplaced`).
1189
1198
 
1190
1199
  **State contrast** (owner analysis): an owner's `when` states pair the colour of
1191
1200
  one profile with the background of another, such as a colour-only error state