@reqvire-org/ads 0.5.8 → 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.
- package/dist/ads-errors.mjs +68 -1
- package/dist/analysis/owner-source.mjs +16 -2
- package/dist/asset-declaration.d.mts +5 -0
- package/dist/asset-declaration.mjs +8 -2
- package/dist/asset-model.mjs +3 -0
- package/dist/construction-output.mjs +28 -6
- package/dist/construction-spec.d.mts +115 -10
- package/dist/construction-spec.mjs +183 -45
- package/dist/end-alignment.mjs +17 -2
- package/dist/form-states.mjs +2 -2
- package/dist/grid-lowering.mjs +24 -1
- package/dist/lowering-layer.mjs +11 -10
- package/dist/lowering-overlaps.mjs +5 -3
- package/dist/lowering-properties.mjs +11 -1
- package/dist/lowering-region-layout.mjs +4 -4
- package/dist/lowering-sequence.mjs +6 -2
- package/dist/mcp/preview-http.bundle.js +3 -3
- package/dist/mcp/preview-widget.bundle.js +40 -40
- package/dist/measured-geometry.mjs +15 -3
- package/dist/owner-analysis-check.mjs +36 -0
- package/dist/owner-errors.mjs +6 -0
- package/dist/ownership-model.mjs +35 -9
- package/dist/platform-features.mjs +11 -0
- package/dist/press-scale.mjs +3 -1
- package/dist/profile-macro.d.mts +5 -0
- package/dist/profile-view-facts.mjs +1 -1
- package/dist/recipe-macro.d.mts +61 -6
- package/dist/recipe-model.mjs +11 -6
- package/dist/region-lowering.mjs +417 -36
- package/dist/role-vocabulary.d.mts +7 -0
- package/dist/role-vocabulary.mjs +13 -1
- package/dist/showcase/client.bundle.js +39 -39
- package/dist/showcase/http-client.bundle.js +17 -17
- package/dist/showcase/scenario-page.mjs +37 -12
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +2 -2
- package/dist/skills/ads-designer/references/motion.md +4 -1
- package/dist/skills/ads-designer/references/recipes.md +35 -1
- package/dist/skills/ads-import/references/recipes.md +35 -1
- package/dist/skills/ads-port/references/recipes.md +35 -1
- package/dist/spatial-model.mjs +11 -2
- package/dist/surface-effects.mjs +11 -6
- package/docs/ARCHITECTURE.md +16 -0
- package/docs/ASSETS.md +7 -1
- package/docs/CHANGELOG.md +160 -18
- package/docs/GUIDE.md +20 -1
- package/docs/LANGUAGE.md +137 -16
- package/docs/MOTION.md +45 -0
- package/docs/PROFILE-KINDS.md +15 -4
- package/docs/RULES.md +12 -3
- package/docs/TOKEN-ROLES.md +8 -2
- package/package.json +1 -1
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,195 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.5.
|
|
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: **
|
|
8
|
-
Tested commit: `
|
|
9
|
-
Completed 2026-11-
|
|
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.
|
|
15
|
-
"commit": "
|
|
16
|
-
"sourceSha256": "
|
|
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":
|
|
21
|
-
"pass":
|
|
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":
|
|
28
|
-
"pass":
|
|
27
|
+
"tests": 846,
|
|
28
|
+
"pass": 846,
|
|
29
29
|
"fail": 0,
|
|
30
30
|
"skipped": 0,
|
|
31
|
-
"reportSha256": "
|
|
31
|
+
"reportSha256": "09ee5055c17233a42fb6d4338a6a0450a63e6ec47ab9ef8fd89abca1aa039ec5"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
"name": "integration",
|
|
35
|
-
"tests":
|
|
36
|
-
"pass":
|
|
35
|
+
"tests": 1043,
|
|
36
|
+
"pass": 1043,
|
|
37
37
|
"fail": 0,
|
|
38
38
|
"skipped": 0,
|
|
39
|
-
"reportSha256": "
|
|
39
|
+
"reportSha256": "06279ab2f36dc240a06149cb1204a06e76e322ccd9bbd53384013e6d8cc9e253"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
"testOverrides": {},
|
|
43
43
|
"bun": "1.4.4",
|
|
44
|
-
"completedAt": "2026-11-
|
|
45
|
-
"durationMs":
|
|
46
|
-
"logSha256": "
|
|
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
|
+
|
|
166
|
+
- *The state switch and live controls moved into the showcase header.* A
|
|
167
|
+
scenario's states and controls stand in a second header row over the preview
|
|
168
|
+
column only, in the showcase's own chrome, and hide with the header. The
|
|
169
|
+
"Showcase settings" panel no longer stands over the design in the preview; a
|
|
170
|
+
capture shows the design only, so a state now differs in a capture only where
|
|
171
|
+
it changes the design. Other MCP Apps hosts keep the in-page panel.
|
|
172
|
+
- *Block flow spaces placed components and trims its edges.* A placed public
|
|
173
|
+
component (`kind: "component"`, such as Content's Paragraph, Heading, List or
|
|
174
|
+
CodeBlock) in block flow takes its `spaceBefore`/`spaceAfter` as its margins,
|
|
175
|
+
as a plain part does; 0.5.8 wrote none. A block flow inside its own block
|
|
176
|
+
padding or border starts and ends flush: a callout's or quote's last
|
|
177
|
+
paragraph adds no space below it. A frameless block-flow root that should
|
|
178
|
+
start flush (a page that opens with a heading) declares
|
|
179
|
+
`flow: { edges: "trim" }`; without it, its edge spaces still pass out, so
|
|
180
|
+
loose list items keep their space.
|
|
181
|
+
- *A disabled control looks disabled* (`review/disabled-unshown`, a review
|
|
182
|
+
note). An owner whose rules under `&:disabled` or `&[aria-disabled="true"]`
|
|
183
|
+
change only the cursor, pointer handling or timing is noted: disabled, it
|
|
184
|
+
looks the same as enabled. The tests' example and reference design systems'
|
|
185
|
+
Button (and the example's IconButton) had exactly this; they now select an
|
|
186
|
+
`inactive-control-surface` (new `--inactive-fill` and `--inactive-text`
|
|
187
|
+
paints) when disabled.
|
|
188
|
+
- The analysis benchmark was not run for this hot patch; `review/disabled-unshown`
|
|
189
|
+
reads lowered CSS the owner analysis already holds.
|
|
190
|
+
|
|
191
|
+
## 0.5.8
|
|
192
|
+
|
|
51
193
|
- **Block flow spaces with collapsing margins.** In a parent without an arrangement, a part's `spaceBefore` and
|
|
52
194
|
`spaceAfter` are its own margins, which the browser collapses: the larger applies where two meet, and a last block's
|
|
53
195
|
space passes out through a list item and a component's root to the next item, as in v2. Loose list items whose
|
package/docs/GUIDE.md
CHANGED
|
@@ -1180,6 +1180,21 @@ known.
|
|
|
1180
1180
|
- A surface that paints a disabled control declares `state: "inactive"` among
|
|
1181
1181
|
its fields and is not checked. A construction can select it only under an
|
|
1182
1182
|
inactive owner state; anywhere else is `construction/inactive-surface-active`.
|
|
1183
|
+
- A control that declares a disabled state looks disabled
|
|
1184
|
+
(`review/disabled-unshown`). When the rules an owner writes under `&:disabled`
|
|
1185
|
+
or `&[aria-disabled="true"]` change only its cursor, pointer handling or
|
|
1186
|
+
timing, a disabled control looks enabled: select an inactive surface there,
|
|
1187
|
+
or lower its opacity. A hover held off with `:not(:disabled)` alone declares
|
|
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`).
|
|
1183
1198
|
|
|
1184
1199
|
**State contrast** (owner analysis): an owner's `when` states pair the colour of
|
|
1185
1200
|
one profile with the background of another, such as a colour-only error state
|
|
@@ -1802,7 +1817,11 @@ export const scenario = {
|
|
|
1802
1817
|
file declares. It renders owners, text and the scenario kit.
|
|
1803
1818
|
|
|
1804
1819
|
**States.** `states` names sets of props. ADS draws one switch for the scenario
|
|
1805
|
-
and passes the chosen set to every `render`.
|
|
1820
|
+
and passes the chosen set to every `render`. In the ADS showcase the switch and
|
|
1821
|
+
the live controls stand in a second header row over the preview column, in the
|
|
1822
|
+
showcase's own chrome: the preview shows only the design, and the row hides
|
|
1823
|
+
with the header (Minimize showcase menu). Another MCP Apps host gets them as a
|
|
1824
|
+
"Showcase settings" panel above the specimens. A new choice starts each specimen
|
|
1806
1825
|
again. Use local state for what a person changes by using the owner. The
|
|
1807
1826
|
showcase address names the chosen state (`&state=<name>`), so a state can be
|
|
1808
1827
|
linked, and `ads_capture` takes the same name to capture it.
|
package/docs/LANGUAGE.md
CHANGED
|
@@ -246,12 +246,18 @@ them all.
|
|
|
246
246
|
| `drawnBy: "<sibling part>"` | region part holding a native control | the native control (a checkbox's `<input>`) is drawn by the named part: `position: absolute`, the drawing part's frame `inlineSize` and `blockSize`, no margin, `opacity: 0`, laid over that part, so it takes no room in the row and pointer and keyboard still reach the real control. Its states still reach the drawing part (`:has(> .input:checked)`) | the named part is not declared right after it, does not show its focus (`focus: { of }`) (`spec/value-invalid`), or its frame states no `inlineSize` or `blockSize` (`profile-field-missing`) |
|
|
247
247
|
| `repeat: true` | region part (not a vector) | nothing of its own: the part's element renders once per item of a list (`tabs.map(…)`), any number of times (at least once when `required`), each instance taking the part's construction (`extent: "fill"` shares the row among them); a repeated `frame: "control"` part neighbours its own next instance, so their hit areas and spacing are checked across the gap | with `drawnBy` or `focus`, or named by another part's (`spec/value-invalid`); without it, a mapped part (`part-missing-or-repeated`) |
|
|
248
248
|
| `kind: "component"` | region part | a public component placed with the part's marker (`<Heading className="ds-content-heading" …/>`), as a grid cell is: its interior is its owner's, so the part states placement only (`required`, `repeat`, `extent`, `at`, `spaceBefore`, `spaceAfter`) | any other field (`spec/field-unsupported`); a forwarded `className` that carries a recipe (`source/foreign-interior`) |
|
|
249
|
-
| `spaceBefore` / `spaceAfter: { slot: "spacing", field }` | part of a `stack`, or of a parent without an arrangement (block flow: a list item that keeps its marker) | the part's own space before it and after it. In a stack, in place of the gap (`margin-block-start: calc(space - gap)` on the part, or on what follows it), the larger where two meet, the first part flush. In block flow, the part's own `margin-block-start` and `margin-block-end`, which the browser collapses: the larger where two meet, and a last block's space passes out through containers without padding or border (a list item, a component's root) to what follows them, so loose list items whose content is another component keep their space | another parent layout (`space-parent-unsupported`) |
|
|
249
|
+
| `spaceBefore` / `spaceAfter: { slot: "spacing", field }` | part of a `stack`, or of a parent without an arrangement (block flow: a list item that keeps its marker) | the part's own space before it and after it. In a stack, in place of the gap (`margin-block-start: calc(space - gap)` on the part, or on what follows it), the larger where two meet, the first part flush. In block flow, the part's own `margin-block-start` and `margin-block-end`, which the browser collapses: the larger where two meet, and a last block's space passes out through containers without padding or border (a list item, a component's root) to what follows them, so loose list items whose content is another component keep their space. A placed component (`kind: "component"`) takes its space the same way. A part laid out as an `inline` row that states its own space (`spaceBefore`, `spaceAfter`, `spacing`) is a block in block flow (`display: flex; inline-size: fit-content`, or its full width with `extent: "fill"`), so its space collapses with the blocks around it; a row without space of its own stays inline-level (`inline-flex`) and keeps its line beside inline text. Inside its own block padding or border, a block flow starts and ends flush (`> :first-child` loses its space before, `> :last-child` its space after): there the space could not pass out and would only add to the padding | another parent layout (`space-parent-unsupported`) |
|
|
250
250
|
| `spacing: "<spacing profile>"` | part of a `stack` or block flow | the part's space before and after it from that profile's `spaceBefore` and `spaceAfter` fields, where a flow needs more distances than one spacing profile holds (a heading 44 px above and 14 px below, 24 px after a quote); the same "larger of the two" rule | a profile that states neither field (`profile-field-missing`) |
|
|
251
251
|
| (a `stack` of blocks) | root, part recipe | the blocks a stack holds end on one line: a painted block by its outer edge, an unpainted one where its content ends (frame end padding, a grid's gutter end); one off by more than 1px and at most 64px fails (`source/end-misaligned`); text is not compared | n/a |
|
|
252
|
+
| `flow: { edges: "trim" }` | block-flow root (no `layout`) | its first child's space before and its last child's space after become nothing, as a stack starts and ends flush: a page that opens with a heading starts at its top. Without it, a frameless block-flow root passes those spaces out, as CSS margins do (the loose list's item content). The automatic flush applies only to padding or a border on the flow's own element: a flow that is a component's root placed inside another component's padding (Content inside a Callout) is frameless, so it declares this to end flush | `recipe.flow` on a root with a `layout` (`spec/value-invalid`) |
|
|
253
|
+
| `frame: { …, safeArea: ["block-end", …] }` (a root's frame; a part's `frame: { profile, safeArea }`) | root, part | each named side's padding plus `env(safe-area-inset-<side>, 0px)`: a phone's bottom bar above the home indicator; an inline side is written for left-to-right and mirrored under `:dir(rtl)` | a side outside `block-start`, `block-end`, `inline-start`, `inline-end` (`spec/value-invalid`) |
|
|
254
|
+
| `groups: { "<name>": { play?, when?: { "<owner state>": { play } } } }` | visual or decoration part | sequences played by named groups of the part's drawing (`<part> > svg [data-group]`), each around its own box; `play.paused` holds one at its first step under a state ([MOTION.md](MOTION.md#groups-inside-a-drawing)) | a group the drawing does not declare, or a drawing not shown as inline SVG (`artwork-group-unknown`); a drawn group without `pathLength="1"` (`artwork-group-draw-length`) |
|
|
255
|
+
| `anchor: { artwork, x, y, inline?, block? }` | text part | the text placed on a sibling decoration's drawing at `x`, `y` in the drawing's coordinates (its viewBox), aligned by its start, centre or end on each axis (`position: absolute`, a share of the parent's box): real, checked text over a diagram. The parent is sized to the drawing (`aspect-ratio` of its viewBox), so the drawing fills it exactly | an artwork that is not a sibling decoration with a drawing, labels on two drawings in one parent, or a parent that states its own block size or ratio (`text-anchor-unsupported`) |
|
|
256
|
+
| `origin: "center" \| "inline-start" \| "inline-end" \| "block-start" \| "block-end"` | root, part | where its scales and `rotate` grow from, in states, entrances and sequences alike (`transform-origin`; an inline edge also writes its mirror under `:dir(rtl)`); `"center"`, the default, writes nothing | another value (`spec/value-invalid`) |
|
|
252
257
|
| `carry: true` | `stack` root | loose flow (a list whose items hold paragraphs, code, figures): the stack gives its gap to its children (`--ads-flow-gap`), and its last part's own space after carries out of it between items (`margin-block-end: max(0px, space - gap)`), so on a list and its item the next item starts at the larger of the list's gap and the item's last block's space after; after the last item the list's own space after applies | a root that is not a stack (`space-parent-unsupported`) |
|
|
253
258
|
| a part rendered as `p`, `h1`–`h6`, `ul`, `ol`, `dl`, `dd`, `blockquote`, `figure`, `pre`, `hr`, `menu` | region part | `margin: 0`: the arrangement owns the space around a part, so the browser's margin is reset; a part that states its own margin (`normalize: { margin: 0 }`, now allowed on parts too) keeps it | n/a |
|
|
254
259
|
| `between: { surface, frame }` | root, part | a rule between consecutive children: the frame profile's `borderWidth` and `borderStyle`, painted by the surface's `borderColor`, on `& > * + *` (`border-block-start`, or `border-inline-start` in a row): a hairline between table rows or settings rows, none after the last | a frame without `borderWidth` or a surface without `borderColor` (`profile-field-missing`) |
|
|
260
|
+
| `between: { surface, frame, axes: ["inline", "block"] }` | root, part, fluid grid | rules between the arranged items on the named axes, wherever the arrangement puts them: a stack's (or block flow's) on the block axis, a single-line row's on the inline axis, a wrapping row's or a grid's on either or both, at every width (a logo band's hairlines at 2, 3 and 6 columns, a partial last row included). Each item draws, in its `::before`, the rules on its start sides, centred in the gap (just before the item where the gap is narrower than the rule); a stack's or row's only after an earlier item, a wrapping row's and a grid's always, the host clipping the outermost (`overflow: clip`). Decorations are not items. A focus outline an edge clips is reported by the render audit (`focus-clipped`) | an axis the arrangement does not separate on, a layered parent, or an item whose `::before` is taken (`construction/between-axes-unsupported`); a grid's `between` without `axes` (`spec/value-invalid`) |
|
|
255
261
|
| `presence: "assistive"` | part | hidden on screen and still read by assistive technology (a table caption, a skip link's text): a one-pixel clipped box out of the flow | n/a |
|
|
256
262
|
| `pseudo: { marker: { surface?, text?, content?, when? } }` | root or part rendered as `li` or `summary` | `::marker`: a colour-only surface (and its states), a text profile of weight and numerals (`fontWeight`, `fontFeatureSettings`), generated content; its contrast is proven where the item is placed (3:1 for a bullet, the text minimum for a number) | another host (`pseudo-host-unsupported`); a surface or text profile that states more (`pseudo-surface-unsupported`) |
|
|
257
263
|
| `pseudo: { before: { content, surface?, text?, when? } }` | root or part that is not a replaced element | `::before` with generated content (a section number), in its colour and weight; proven as text | an `img`, `input`, `select`, `textarea`, `video`, `iframe`, `br`, `hr` or `svg` host (`pseudo-host-unsupported`) |
|
|
@@ -259,7 +265,7 @@ them all.
|
|
|
259
265
|
| `counter: { reset?, increment? }` | root, part | `counter-reset` where a count starts, `counter-increment` on what it counts; names are shared across components (a `List` resets, a `ListItem` increments); `list-item` is the browser's own list counter | a CSS keyword as a name (`spec/value-invalid`) |
|
|
260
266
|
| `markers: [<style per depth>]` | a list root | `list-style-type` on the list and on the same list nested at each depth (`& li &`), outermost first; deeper lists keep the last: bullets (`disc`, `circle`, `square`, `none`) or a number system | more than three, or an unknown style (`spec/value-invalid`) |
|
|
261
267
|
| `anchorClear: { slot: "layer", field: "clearBlockStart" }` or `{ slot: "spacing", field: "anchorGap" }` | root (not a top-layer root), part | `scroll-margin-block-start`: where a jump to the element (a fragment link, `scrollIntoView`) lands below the top of its scroll container. The layer profile's `clearBlockStart` puts it right under the region sticky elements clear; the spacing profile's `anchorGap` is the element's own distance, for a target that lines up with something beside it (a heading level with a sticky side column). Layout is unchanged. ADS does not check that the distance clears what is stuck on the page the owner ends up in | another slot or field (`spec/value-invalid`); on a top-layer root (`spec/field-unsupported`) |
|
|
262
|
-
| `overflow: "clip" \| "scroll-block" \| "scroll-inline" \| "scroll-both"` | root, part | `overflow` (physical x/y pair of the horizontal writing mode) and a released axis minimum | on a top-layer root (`profile-provider-conflict`); with truncation |
|
|
268
|
+
| `overflow: "clip" \| "scroll-block" \| "scroll-inline" \| "scroll-both"` | root, part | `overflow` (physical x/y pair of the horizontal writing mode) and a released axis minimum. With `overscroll: "contain"` beside a scrolling value, `overscroll-behavior: contain`: reaching its end does not scroll the dialog or page behind it | on a top-layer root (`profile-provider-conflict`); with truncation |
|
|
263
269
|
| `justify: "space-between" \| "space-around" \| "space-evenly"` | inline or stack root, part | `justify-content`: the free space between the items (a logo at the start, actions at the end); a wrapping row distributes each line | `field-unsupported` on a layered element (its layers share one area) |
|
|
264
270
|
| `align` / `justify` on an element that scrolls | root, part | `safe center` / `safe end` on the axis the element itself scrolls: content stays aligned while it fits and starts at the scroll origin when it overflows, so its start is never unreachable | n/a (automatic) |
|
|
265
271
|
| a rounded frame (`radius`) with visible overflow | region root | n/a | a first or last part of a stack, or a layer, that paints a background over a corner with no inset there (`construction/corner-overpaint`): clip the root, inset it, or round the part |
|
|
@@ -272,10 +278,12 @@ them all.
|
|
|
272
278
|
| control `layout: "stack"` | control | visual above label; the control box centres visual + gap + line | `justify` |
|
|
273
279
|
| `at: { "<condition>": { visible } }` | part | `display: none` inside the condition's range, the part's own display inside its complement | unknown condition (`condition-unknown`); a required part hidden (`condition-hides-required`); more than one condition |
|
|
274
280
|
| `at: { "<condition>": { visual: "<visual profile>" } }` | visual part (`kind: "visual"`) | the part's geometry at that profile's size, inside the condition's range; may stand beside `visible` | a part that is not a visual, cropped or inspected media, or a size that selects another drawing of the asset (`construction/condition-visual-unsupported`) |
|
|
281
|
+
| `frame: { profile, rules?, corners? }`; `at: { "<condition>": { frame: { rules?, corners? } } }` | part with its own box | the box's one-sided rules and rounded corners as a root frame's, and under the condition only what the condition changes: a tinted side with a hairline on top and rounded bottom corners while stacked, on its start side and end corners beside | a frame change on a part without its own box; condition `rules` on a box without `rules` (`spec/value-invalid`) |
|
|
282
|
+
| `at: { "<condition>": { align?, justify?, textAlign? } }` | region root, part | the element's arrangement alignment (`align-items`, `justify-content`) and `text-align` inside the condition's range, its own outside it: a banner centred on phones and start-aligned from a width; a root's alignment needs no `frame` | unknown condition (`condition-unknown`); an entry that changes nothing (`spec/value-invalid`) |
|
|
275
283
|
| `recipe.conditionQuery["<condition>"]` | owner code | the literal media range the CSS writes (`(width < 47.5rem)`), for `matchMedia` | the recipe's spatial profile lacks it (`choice/recipe-access-unsupported`) |
|
|
276
284
|
| `element: "iframe" \| "select" \| "search-input" \| "text-input" \| "table" \| "header-cell" \| "cell" \| "list" \| "summary" \| "document"`, `marker: "none"` | root, part (`document`: a pattern's root only) | the element's closed UA normalization (no iframe border, list markers or summary marker; collapsed table; start-aligned, middle cells) | another tag (`source/part-element-mismatch`); a summary outside `<details>` (`source/summary-outside-details`) |
|
|
277
285
|
| `align: "start" \| "center" \| "end"` on a cell (`element: "cell" \| "header-cell"`); `extent: "container"` on a table root | cell; table root | `vertical-align: top \| middle \| bottom` (rows whose cells wrap to different line counts start together at the top); `inline-size: 100%` (a table as wide as its container instead of its content) | `align` on any other part (`field-unsupported`); a table frame that fixes its width as well (`extent-conflict`) |
|
|
278
|
-
| `normalize: { textDecoration: "none", pointerEvents: "none", borderStyle: "none" }` | root, `normalize.when` | `text-decoration-line`, `pointer-events`, `border-style` | pointer transparency on focusable or interactive, non-`aria-hidden` markup (`source/pointer-transparent-interactive`) |
|
|
286
|
+
| `normalize: { textDecoration: "none", pointerEvents: "none", borderStyle: "none" }` | root, `normalize.when`; `textDecoration` and `pointerEvents` also on a part (a link card's link, a decorative layer at any depth) | `text-decoration-line`, `pointer-events`, `border-style` | pointer transparency on focusable or interactive, non-`aria-hidden` markup (`source/pointer-transparent-interactive`) |
|
|
279
287
|
| `normalize: { cursor, touchAction, userSelect }`, `snap` | root, part, `normalize.when`; scrolling arrangement | see [interaction properties](#interaction-properties) | a value outside its set (`spec/value-invalid`); snap without scrolling (`snap-without-scroll`) |
|
|
280
288
|
| `wrap: "anywhere" \| "never" \| "truncate" \| "balance" \| "pretty" \| "preserve"` (`true` = anywhere), `textAlign`, `reserveLines: 1–3` | text part | `overflow-wrap`, `white-space`, one-line ellipsis truncation, `text-wrap: balance \| pretty` (without support: normal wrapping); `"preserve"`: `white-space: pre-wrap` with `overflow-wrap: anywhere`, so code keeps its spaces and line breaks and a long line continues on the next visual line (all of it visible at the column's width; `overflow: "scroll-inline"` on its block keeps lines whole instead); `text-align`; `min-block-size: Nlh` | reserved lines without a text profile (`reserve-without-text`) |
|
|
281
289
|
| `wrap: "truncate", lines: 2 \| 3` | text part | a clamp: at most N lines, the last ending in "…" (`line-clamp` beside `display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp`, `overflow: hidden`) | `lines: 1` or another value (one line is plain `truncate`); `reserveLines` above `lines` (`spec/value-invalid` at `reserveLines`, naming both); `lines` with another `wrap`; on a declared `element`; an arrangement's display (`extent-conflict`); on, or inside, a control or form label (`source/clamp-on-control`) |
|
|
@@ -453,15 +461,55 @@ range: { selector: ".price-range", required: true,
|
|
|
453
461
|
pseudo: { sliderTrack: { surface: "slider-track", frame: "slider-track-frame" }, sliderThumb: { surface: "slider-thumb", frame: "slider-thumb-frame" } } },
|
|
454
462
|
```
|
|
455
463
|
|
|
456
|
-
|
|
457
|
-
(`
|
|
458
|
-
|
|
459
|
-
|
|
464
|
+
<a id="range-sliders"></a>
|
|
465
|
+
Each takes a surface (`background`, `borderColor`, `boxShadow`) and a frame
|
|
466
|
+
profile (`inlineSize`, `blockSize`, `radius`, `borderWidth`), with `when`
|
|
467
|
+
surfaces for states. ADS turns off the engine's drawing and writes each once per
|
|
468
|
+
engine (`::-webkit-slider-runnable-track`, `::-moz-range-track`,
|
|
460
469
|
`::-webkit-slider-thumb`, `::-moz-range-thumb`), and centres the WebKit thumb on
|
|
461
|
-
the track by half their difference in height.
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
470
|
+
the track by half their difference in height. The thumb's boundary needs 3:1
|
|
471
|
+
against the track in every theme, brand and state, as a progress fill against
|
|
472
|
+
its track (`construction/progress-contrast-insufficient`): its background, or
|
|
473
|
+
the ring its frame's border draws (a white handle with a coloured ring).
|
|
474
|
+
Disabled states are exempt.
|
|
475
|
+
|
|
476
|
+
A pricing calculator's slider fills up to its handle, grows the handle under
|
|
477
|
+
the pointer and writes its steps under it:
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
input: { selector: ".price-range", required: true,
|
|
481
|
+
measured: { fill: { type: "share", property: "slider-fill" } },
|
|
482
|
+
pseudo: {
|
|
483
|
+
sliderTrack: { surface: "slider-track", frame: "slider-track-frame" },
|
|
484
|
+
sliderFill: { surface: "slider-fill", when: { "&:has(> .price-range:disabled)": { surface: "slider-track" } } },
|
|
485
|
+
sliderThumb: { surface: "slider-thumb", frame: "slider-thumb-frame", grow: { slot: "motion", field: "scale" } },
|
|
486
|
+
} },
|
|
487
|
+
steps: { selector: ".price-steps", required: true, along: "input",
|
|
488
|
+
measured: { step: { type: "share", property: "slider-step" } },
|
|
489
|
+
parts: { step: { selector: ".price-step", required: true, repeat: true, kind: "text" } } },
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
- **The fill** (`sliderFill`, a surface with `when` states) is drawn on the
|
|
493
|
+
track up to the thumb. Firefox draws it itself (`::-moz-range-progress`, at
|
|
494
|
+
the track's size and radius); WebKit and Blink paint the track in the fill's
|
|
495
|
+
colour up to the measured share, from the side the slider starts on
|
|
496
|
+
(mirrored under right-to-left). The owner writes the share at render,
|
|
497
|
+
`measured.props({ fill: (value - min) / (max - min) })`, so the first paint
|
|
498
|
+
is right. The fill needs 3:1 against the track, as a progress bar. A fill
|
|
499
|
+
needs the track and a share (`construction/slider-fill-unsupported`); a
|
|
500
|
+
`slider-fill` share needs a fill (`construction/measured-property-unsupported`).
|
|
501
|
+
- **The thumb** takes its surface's `boxShadow`; `grow` scales it by a motion
|
|
502
|
+
field while it is pointed at or dragged and enabled, over the motion profile's
|
|
503
|
+
timing, at once under reduced motion. With a focus profile in the recipe's
|
|
504
|
+
focus slot, the focus indicator is drawn on the thumb, where the value is, in
|
|
505
|
+
place of one around the whole control.
|
|
506
|
+
- **Step labels** are a row `along` a sibling slider part, with no layout of its
|
|
507
|
+
own: it is inset by half the thumb frame's `inlineSize`, so each end's thumb
|
|
508
|
+
centre is a label's centre, and each label is centred at its own
|
|
509
|
+
`slider-step` share (`measured.props({ step: … })` on the label), whether or
|
|
510
|
+
not the steps are evenly spaced. A row that names no sibling with a sized
|
|
511
|
+
thumb, declares no share or has a layout is
|
|
512
|
+
`construction/slider-steps-unsupported`.
|
|
465
513
|
|
|
466
514
|
**Contrast**, in every theme, brand and token condition:
|
|
467
515
|
|
|
@@ -672,7 +720,64 @@ const page = recipe({
|
|
|
672
720
|
- The layer profile's `stickyLayer` (role `layer`) stacks the element above
|
|
673
721
|
positioned content that scrolls under it. Without it the element keeps its
|
|
674
722
|
place in document order.
|
|
675
|
-
-
|
|
723
|
+
- Inline edges stick too: `edge: "inline-start"` keeps a table's row names in
|
|
724
|
+
place while its frame scrolls sideways (`overflow: "scroll-inline"` on an
|
|
725
|
+
ancestor). They follow the writing direction (`inset-inline-start`). A
|
|
726
|
+
sticky column covers the content scrolling under it only when it paints a
|
|
727
|
+
background: give it, or its row, a surface. `clear` is for the block-start
|
|
728
|
+
edge only. A top-layer root takes no `sticky`.
|
|
729
|
+
|
|
730
|
+
## Decorations
|
|
731
|
+
|
|
732
|
+
A decoration is artwork or a pattern that means nothing: a graph behind a
|
|
733
|
+
panel, a dot grid behind a banner, a glow behind a hero, a page's backdrop. It
|
|
734
|
+
is a part of `kind: "decoration"`, on a region root or any part, and lies behind
|
|
735
|
+
that element's content.
|
|
736
|
+
|
|
737
|
+
```ts
|
|
738
|
+
const panel = recipe({ layout: "stack", parts: {
|
|
739
|
+
graph: { selector: ".ux-panel-graph", required: true, kind: "decoration", surface: "graph-fade" },
|
|
740
|
+
title: { selector: ".ux-panel-title", required: true, kind: "text" },
|
|
741
|
+
} }).root;
|
|
742
|
+
const graph = recipe({ parts: { visual: { kind: "visual", asset: "panel-graph" } } });
|
|
743
|
+
// <section className={panel}>
|
|
744
|
+
// <span className={`ux-panel-graph ${graph.parts.visual}`} aria-hidden="true"
|
|
745
|
+
// dangerouslySetInnerHTML={{ __html: graph.assets.visual.source }} />
|
|
746
|
+
// <h2 className="ux-panel-title">…</h2>
|
|
747
|
+
// </section>
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
- **Behind the content.** The decoration fills its parent's box
|
|
751
|
+
(`position: absolute; inset: 0; z-index: -1`), and the parent becomes its
|
|
752
|
+
containing block and its own stacking context (`position: relative`, unless
|
|
753
|
+
it is already positioned, and `isolation: isolate`), so the decoration never
|
|
754
|
+
slips behind the page or over another owner. The parent's content stays in
|
|
755
|
+
its flow; nothing is restructured into layers. Several decorations stack in
|
|
756
|
+
declaration order.
|
|
757
|
+
- **Painted by its surface, its artwork or both.** A surface paints a
|
|
758
|
+
gradient (`backgroundImage`), a pattern (`backgroundTile`), a fade (`mask`),
|
|
759
|
+
blur or opacity. Artwork is bound as a visual part's is, in any paint mode: a
|
|
760
|
+
themed (paint-slot) drawing stays inline SVG, so its theme's paints reach it.
|
|
761
|
+
- **Cropped against its own box.** The decoration is a size container, and its
|
|
762
|
+
drawing covers it (`fit: "cover"`, the default without a visual profile) or
|
|
763
|
+
is contained in it (`fit: "contain"`) by container query units, around the
|
|
764
|
+
drawing's optical centre. No ratio box is needed: the parent's box is its
|
|
765
|
+
shape, whatever its width and height.
|
|
766
|
+
- **Past the edge.** `outset` (spacing fields) lets a glow spill past the
|
|
767
|
+
parent's box; a parent that clips (`overflow: "clip"`, a card's corners) clips
|
|
768
|
+
it.
|
|
769
|
+
- **Attached.** `attachment: "scroll"` (the default) moves with the parent;
|
|
770
|
+
`attachment: "fixed"` keeps a page's backdrop in place while the page scrolls.
|
|
771
|
+
- **Responsive and animated.** `at` shows, hides or resizes it under a named
|
|
772
|
+
condition; `play` and `when` animate it, and reduced motion stops the motion.
|
|
773
|
+
- **Meaningless by construction.** Its element is `aria-hidden="true"` and
|
|
774
|
+
holds nothing a person can use (`source/decoration-exposed`); ADS writes
|
|
775
|
+
`pointer-events: none`, so it never takes a click or focus.
|
|
776
|
+
- **Text over it is measured.** Text in the same owner is drawn over the
|
|
777
|
+
decoration, whose pixels the static contrast check cannot see: the review
|
|
778
|
+
note `review/decoration-under-text` asks for a scenario, and the render audit
|
|
779
|
+
measures the text in every theme. Fade the decoration under text with a
|
|
780
|
+
surface `mask`.
|
|
676
781
|
|
|
677
782
|
## Top-layer roots
|
|
678
783
|
|
|
@@ -739,7 +844,12 @@ recipe({
|
|
|
739
844
|
while open. Its root declares at least one measured inset or `translate`
|
|
740
845
|
(`construction/measured-placement-missing`); `corner` and `clear` do not
|
|
741
846
|
apply. CSS anchor positioning is not used: it cannot follow a pointer or a
|
|
742
|
-
selection.
|
|
847
|
+
selection. The panel's distance from the anchor is design, not the script's:
|
|
848
|
+
the layer profile's `anchorGap`/`anchorOverlap` and
|
|
849
|
+
`anchorOutdent`/`anchorIndent` move it from the measured position
|
|
850
|
+
([PROFILE-KINDS.md](PROFILE-KINDS.md#layer)). A menu under a sticky header
|
|
851
|
+
stays under its trigger while the page scrolls; under a trigger that scrolls,
|
|
852
|
+
the owner measures again while it is open.
|
|
743
853
|
|
|
744
854
|
The compiler normalizes the UA box (inset, margin, padding, border, size
|
|
745
855
|
limits) and writes the arrangement's `display` only under the native open state
|
|
@@ -751,7 +861,11 @@ transition cannot share the root's transition set
|
|
|
751
861
|
(`construction/profile-provider-conflict`).
|
|
752
862
|
|
|
753
863
|
Motion uses the recipe's motion slot with the `static` reduced policy: a sheet
|
|
754
|
-
slides its own extent from its edge (`"slide"`), a popover fades (`"fade"`)
|
|
864
|
+
slides its own extent from its edge (`"slide"`), a popover fades (`"fade"`)
|
|
865
|
+
or drops (`"drop"`: it fades while coming down the motion profile's `distance`
|
|
866
|
+
from its `scale`, growing from its top edge, and goes back up as it closes: a
|
|
867
|
+
site header's menu). Reduced motion leaves a drop with neither travel nor
|
|
868
|
+
animation.
|
|
755
869
|
Opening starts from `@starting-style` in every browser. Closing keeps
|
|
756
870
|
`display` and `overlay` through `transition-behavior: allow-discrete`: a
|
|
757
871
|
browser that can transition `overlay` animates the exit, any other closes at
|
|
@@ -823,6 +937,10 @@ Each `type` (setter value; place) has a closed property list:
|
|
|
823
937
|
width and height from its centre, right and down positive, within ±0.5):
|
|
824
938
|
`object-position` of a cropped application image, a top-level visual part
|
|
825
939
|
whose visual profile declares `fit: "cover"`.
|
|
940
|
+
- `share` (a number from 0 to 1, how far along its range a value is):
|
|
941
|
+
`slider-fill`, the fill of a range slider with a `sliderFill` treatment, or
|
|
942
|
+
`slider-step`, the place of each step label in a row `along` a slider
|
|
943
|
+
([range sliders](#range-sliders)). Written with `measured.props` at render.
|
|
826
944
|
|
|
827
945
|
Rules:
|
|
828
946
|
|
|
@@ -915,8 +1033,11 @@ The fields occur in a root's or a part's `normalize` and in its `when`:
|
|
|
915
1033
|
|
|
916
1034
|
Rules:
|
|
917
1035
|
|
|
918
|
-
- A part's `normalize` takes
|
|
919
|
-
|
|
1036
|
+
- A part's `normalize` takes these three fields, `resize` (a `<textarea>`),
|
|
1037
|
+
`margin`, `textDecoration` (a link part whose underline is not its look) and
|
|
1038
|
+
`pointerEvents: "none"` (a decorative layer over interactive content, at any
|
|
1039
|
+
depth: it must be `aria-hidden` or free of interactive content, and never
|
|
1040
|
+
focusable). A root's (region or control) also takes the native operations in
|
|
920
1041
|
[the authoring invariant](#the-authoring-invariant). A vector part takes none.
|
|
921
1042
|
- A part `when` key is an owner state in the closed
|
|
922
1043
|
[`when` grammar](#state-focus-and-motion). The rule is written under the
|
package/docs/MOTION.md
CHANGED
|
@@ -206,6 +206,11 @@ const card = recipe({
|
|
|
206
206
|
root rests at `scale: 1` and keeps it under reduced motion.
|
|
207
207
|
- A `transition` channel needs its endpoint, an entry a `surface` or a `scale`,
|
|
208
208
|
and the motion profile the `static` policy.
|
|
209
|
+
- A root may also travel under a state: `translateBlock` or `translateInline`
|
|
210
|
+
from its motion slot's `distance` (a link card that lifts as a whole on
|
|
211
|
+
hover), with `translate` in its `transition`. It rests at no travel, keeps
|
|
212
|
+
none under reduced motion, and inline travel is mirrored under right-to-left,
|
|
213
|
+
as a part's travel is.
|
|
209
214
|
- A [top-layer root](LANGUAGE.md#top-layer-roots) takes no press
|
|
210
215
|
(`spec/field-unsupported`).
|
|
211
216
|
- A `frame: "container"` root that presses below 0.98 in some token context, or
|
|
@@ -309,6 +314,13 @@ recipe({
|
|
|
309
314
|
three scales read the profile's `scale` and are one channel, so a state takes
|
|
310
315
|
one of them. `rotate` turns the part in place by the profile's `angle`. A
|
|
311
316
|
control's visual part takes the same scales and `rotate`.
|
|
317
|
+
- `origin` on a root or part sets where its scales and `rotate` grow from, in a
|
|
318
|
+
state, an entrance or a sequence alike: `"center"` (the default),
|
|
319
|
+
`"inline-start"`, `"inline-end"`, `"block-start"` or `"block-end"`. An
|
|
320
|
+
underline that stretches in from its start is `origin: "inline-start"` with a
|
|
321
|
+
`scaleInline` from 0. Inline edges are mirrored under right-to-left
|
|
322
|
+
(`transform-origin` has no logical keywords, so ADS writes the `:dir(rtl)`
|
|
323
|
+
rule).
|
|
312
324
|
- `transition` lists the channels that animate: `translate`, `scale`, `rotate`. An effect
|
|
313
325
|
whose channel is not listed applies at once. A listed channel without an
|
|
314
326
|
effect is refused.
|
|
@@ -456,6 +468,39 @@ recipe({
|
|
|
456
468
|
it. An indicator rendered only while work is in progress needs nothing more.
|
|
457
469
|
- The older continuous rotation (`repeat: "continuous"` with `rotate` on a
|
|
458
470
|
standalone artwork part) is unchanged.
|
|
471
|
+
- **Held, then played.** `play: { sequence, paused: true }` under one owner
|
|
472
|
+
state holds the element at its first step (`animation-play-state: paused`),
|
|
473
|
+
and the same sequence under another state plays it: a diagram armed before it
|
|
474
|
+
scrolls into view, played when it does. The owner switches the state.
|
|
475
|
+
|
|
476
|
+
### Groups inside a drawing
|
|
477
|
+
|
|
478
|
+
A drawing's named groups play sequences of their own: a wordmark's letters
|
|
479
|
+
dropping in turn, a diagram's dots appearing and its edges drawing themselves.
|
|
480
|
+
The asset declares its groups (`groups: ["n", "e", "z"]`) and its SVG marks each
|
|
481
|
+
(`data-group="n"`, see [ASSETS.md](ASSETS.md)); a visual or decoration part
|
|
482
|
+
plays them:
|
|
483
|
+
|
|
484
|
+
```ts
|
|
485
|
+
mark: { selector: ".ux-word", kind: "decoration", groups: {
|
|
486
|
+
z: { play: { sequence: "letter-drop" } }, // the last letter first
|
|
487
|
+
e: { play: { sequence: "letter-drop", order: 1 } },
|
|
488
|
+
n: { play: { sequence: "letter-drop", order: 2 } },
|
|
489
|
+
} },
|
|
490
|
+
edges: { when: { '&[data-play="armed"]': { play: { sequence: "edge-draw", paused: true } },
|
|
491
|
+
'&[data-play="true"]': { play: { sequence: "edge-draw", order: 3 } } } },
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
- A group is `<part> > svg [data-group="<name>"]`: only a drawing shown as
|
|
495
|
+
inline SVG (paint slots or foreground) exposes its groups; an image document
|
|
496
|
+
(intrinsic paint) cannot be reached inside.
|
|
497
|
+
- Each group moves and scales around its own box (`transform-box: fill-box`,
|
|
498
|
+
`transform-origin: center`).
|
|
499
|
+
- A `draw` step reveals a line along its length: the group's shapes state
|
|
500
|
+
`pathLength="1"` in the SVG (`construction/artwork-group-draw-length`), and
|
|
501
|
+
ADS draws them as one dash of that length. At rest, and under reduced motion,
|
|
502
|
+
the line is drawn: the finished picture.
|
|
503
|
+
- A group the drawing does not declare is `construction/artwork-group-unknown`.
|
|
459
504
|
|
|
460
505
|
## Animating a measured value
|
|
461
506
|
|
package/docs/PROFILE-KINDS.md
CHANGED
|
@@ -104,7 +104,9 @@ The example design system's detailed text specimen is `profiles/Typography/detai
|
|
|
104
104
|
Fields: `background`, `color`, `borderColor` and `textDecorationColor` (an
|
|
105
105
|
underline's paint, which a state and a paint transition change like any paint)
|
|
106
106
|
(`paint`), `boxShadow`
|
|
107
|
-
(`shadow`), `backgroundImage` (`gradient`), `
|
|
107
|
+
(`shadow`), `backgroundImage` (`gradient`), `backgroundTile` (`spacing` or
|
|
108
|
+
`frame-size`: the image repeated at that square size over the box, a dot grid),
|
|
109
|
+
`opacity` (`opacity`), the effects
|
|
108
110
|
`blur` and `backdropBlur` (`blur`), `backdropSaturate` (`saturation`),
|
|
109
111
|
`shapeShadow` and `groupShadow` (`shadow`), `mask` (`gradient`), a paint per
|
|
110
112
|
border side, and the policy field `state`.
|
|
@@ -238,6 +240,7 @@ effect fields into them in a fixed order, whatever order the profile states:
|
|
|
238
240
|
| `backdropBlur` | `blur` | Blurs what is behind the element | `backdrop-filter: blur()` |
|
|
239
241
|
| `backdropSaturate` | `saturation` | Makes what is behind the element more or less vivid | `backdrop-filter: saturate()` |
|
|
240
242
|
| `brightness` | `brightness` | Dims or brightens a drawing: a picture with no dark version, dimmed in the dark theme (the token is `100%` in light and lower in dark). A visual part's only: text under it could not be proven readable (`construction/surface-effect-misplaced`) | `filter: brightness()`, first in the list |
|
|
243
|
+
| `grayscale`, `invert` | `grayscale`, `invert` | Tone a drawing: a grey logo made for a light page shown as light marks on a dark one (`0%` in light, `100%` in dark, with `brightness` above `100%`). A visual part's only, like `brightness`. The three compose in one order, `grayscale`, `invert`, `brightness`, whatever the surface lists | `filter: grayscale() invert() brightness()` |
|
|
241
244
|
|
|
242
245
|
The element is blurred before its shadow is cast (`filter: blur() drop-shadow()`),
|
|
243
246
|
and the backdrop is blurred before it is saturated
|
|
@@ -455,8 +458,10 @@ profile({
|
|
|
455
458
|
- A step states what the part looks like there: `opacity` (`opacity`),
|
|
456
459
|
`translateInline` and `translateBlock` (`motion-distance`), one scale
|
|
457
460
|
(`scale`, or `scaleInline` / `scaleBlock` for one axis; `motion-scale`) and
|
|
458
|
-
`rotate` (`motion-angle`)
|
|
459
|
-
|
|
461
|
+
`rotate` (`motion-angle`), and `draw: "hidden" | "drawn"` (a keyword, not a
|
|
462
|
+
token: a line revealed along its length, for shapes that state
|
|
463
|
+
`pathLength="1"`). A property a step leaves out is interpolated between the
|
|
464
|
+
steps that state it.
|
|
460
465
|
- The steps run from `0` to `100`, at distinct whole percentages
|
|
461
466
|
(`construction/sequence-steps-invalid`).
|
|
462
467
|
- `repeat` is `"loop"` (the default), `"alternate"` or `"once"`. A loop ends
|
|
@@ -551,7 +556,13 @@ Places a top-layer root, such as an anchored popover, against the viewport
|
|
|
551
556
|
([top-layer roots](LANGUAGE.md#top-layer-roots)). Fields: `edgeGap` (`spacing`)
|
|
552
557
|
from the block edge, `viewportMargin` (`spacing`) from the inline edge, and
|
|
553
558
|
`clearBlockStart` (`layout-size`) for a fixed region it keeps clear of, such as
|
|
554
|
-
a toolbar band. The clearance must resolve to a fixed length. A
|
|
559
|
+
a toolbar band. The clearance must resolve to a fixed length. A measured
|
|
560
|
+
popover also takes its distance from what the owner anchors it to: `anchorGap`
|
|
561
|
+
(`spacing`) past the anchor's edge or `anchorOverlap` (`overlap`) into it on
|
|
562
|
+
the block axis, and `anchorOutdent` (`spacing`) before the anchor's start or
|
|
563
|
+
`anchorIndent` (`spacing`) after it on the inline axis; each pair is one or the
|
|
564
|
+
other (`construction/profile-provider-conflict`). ADS adds them to the measured
|
|
565
|
+
position, so the owner's script reports only where the trigger is. A composite's
|
|
555
566
|
`layer-profile` slot selects the profile. A modal sheet is full height and
|
|
556
567
|
attached to its edge, so it needs no layer profile.
|
|
557
568
|
|