@reqvire-org/ads 0.5.13 → 0.5.15
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 +23 -0
- package/dist/analysis/content-model.mjs +156 -0
- package/dist/analysis/owner-source.mjs +8 -1
- package/dist/check.mjs +1 -0
- package/dist/construction-spec.d.mts +4 -2
- package/dist/construction-spec.mjs +5 -3
- package/dist/end-alignment.mjs +5 -0
- package/dist/owner-analysis-check.mjs +1 -0
- package/dist/recipe-macro.d.mts +1 -1
- package/dist/region-lowering.mjs +15 -4
- package/dist/render-audit/layout-overflow.page.mjs +26 -1
- package/dist/render-audit.mjs +5 -1
- package/dist/showcase/client.bundle.js +46 -46
- package/dist/showcase/http-client.bundle.js +13 -13
- package/dist/showcase/ui/ui.js +3 -3
- package/dist/skills/ads-designer/references/behaviors.md +31 -0
- package/dist/skills/ads-designer/references/recipes.md +5 -4
- package/dist/skills/ads-import/references/behaviors.md +31 -0
- package/dist/skills/ads-import/references/recipes.md +5 -4
- package/dist/skills/ads-port/references/behaviors.md +31 -0
- package/dist/skills/ads-port/references/recipes.md +5 -4
- package/docs/CHANGELOG.md +136 -0
- package/docs/GUIDE.md +16 -1
- package/docs/LANGUAGE.md +2 -2
- package/docs/RULES.md +6 -3
- package/package.json +1 -1
|
@@ -22,6 +22,37 @@ the emitted modules require are recorded in the output's `ads-dependencies.json`
|
|
|
22
22
|
Keep business data in application adapters. External package internals and
|
|
23
23
|
delegated DOM behavior still require source, build and browser review.
|
|
24
24
|
|
|
25
|
+
<a id="owner-code"></a>
|
|
26
|
+
## Owner behaviour code
|
|
27
|
+
|
|
28
|
+
An owner's script switches state; its recipes draw what each state looks like. These rules keep the two apart and
|
|
29
|
+
the markup readable by browsers and assistive technology. They hold for any design system.
|
|
30
|
+
|
|
31
|
+
- **Your own elements by reference.** Reach an element the owner renders through a ref (one per element, or a map of
|
|
32
|
+
refs by key for a list), never by querying its own markup with classes, `data-*` lookups or `parentElement`
|
|
33
|
+
walks. A class is styling the recipe owns; a query couples behaviour to it and breaks when the markup moves.
|
|
34
|
+
- **State on the element, look from the recipe.** A trigger that opens something carries `aria-expanded` and
|
|
35
|
+
`aria-controls` (the id of what it opens, on that element's root); its open look is the recipe's
|
|
36
|
+
`when: { '&[aria-expanded="true"]': … }`, never a class the script toggles. The same holds for `aria-pressed`,
|
|
37
|
+
`aria-selected`, `aria-current`, `data-*` states and native states (`:checked`, `:disabled`, `[open]`).
|
|
38
|
+
- **One element per popup, shown and hidden.** Keep a popover or dialog rendered and switch it with
|
|
39
|
+
`showPopover()`/`hidePopover()` or `showModal()`/`close()`. Re-mounting it on open skips its layer motion, which
|
|
40
|
+
runs from `@starting-style` on an element that exists. Render it inside the element whose pointer events should
|
|
41
|
+
include it: a top-layer element stays a DOM child, so `pointerleave` on its parent does not fire while the
|
|
42
|
+
pointer crosses into it.
|
|
43
|
+
- **Opening and dismissal.** Hover opening is for a mouse (`event.pointerType === "mouse"`) and closes after a
|
|
44
|
+
short grace, so the pointer can cross into the popup; keyboard and touch toggle on activation. Escape and a press
|
|
45
|
+
outside close it; a non-modal popup that opened from a trigger returns focus there when it closes by keyboard.
|
|
46
|
+
- **Placement by measurement only.** For a measured popover the script reports where the anchor is
|
|
47
|
+
(`recipe.measured.set(element, { x, y })` from `getBoundingClientRect()`); its distance from the anchor is the
|
|
48
|
+
layer profile's (`anchorGap`/`anchorOverlap`, `anchorOutdent`/`anchorIndent`), never a number in the script.
|
|
49
|
+
Measure again when what it depends on moves: on resize, and on scroll when the anchor scrolls.
|
|
50
|
+
- **Valid nesting.** An owner's markup follows HTML's content model (`source/invalid-nesting`): no `div`, list,
|
|
51
|
+
paragraph or heading inside a `span`, `p`, `button`, `label` or heading (a link takes its parent's rule); no
|
|
52
|
+
button, link or form control inside a link or a button; list items in a list, rows in a table, cells in a row.
|
|
53
|
+
A box that holds a popup and a trigger is a `div` (or a list item), not a `span`.
|
|
54
|
+
- **Release what you start.** Listeners, timers, observers and animation frames are removed in the effect's cleanup.
|
|
55
|
+
|
|
25
56
|
## Development boundary
|
|
26
57
|
|
|
27
58
|
Production includes real components, patterns, controllers and their compiled
|
|
@@ -358,10 +358,11 @@ A region recipe's root can live in the browser's top layer through a closed
|
|
|
358
358
|
- **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
|
|
359
359
|
profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
|
|
360
360
|
`backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
|
|
361
|
-
- **A
|
|
362
|
-
|
|
363
|
-
`anchorOutdent`/`anchorIndent`,
|
|
364
|
-
|
|
361
|
+
- **A popup that opens from a trigger** (a menu, a picker's list): a `popover: "manual"` measured popover placed
|
|
362
|
+
from the trigger's measured corner with the layer profile's `anchorOverlap`/`anchorGap` and
|
|
363
|
+
`anchorOutdent`/`anchorIndent`, with `motion: "fade"` or `"drop"`. Its script follows
|
|
364
|
+
[owner behaviour code](behaviors.md#owner-code): refs, `aria-expanded`, one element shown and hidden, dismissal,
|
|
365
|
+
placement by measurement only.
|
|
365
366
|
|
|
366
367
|
<a id="measured"></a>
|
|
367
368
|
## Measured values and runtime paints
|
|
@@ -22,6 +22,37 @@ the emitted modules require are recorded in the output's `ads-dependencies.json`
|
|
|
22
22
|
Keep business data in application adapters. External package internals and
|
|
23
23
|
delegated DOM behavior still require source, build and browser review.
|
|
24
24
|
|
|
25
|
+
<a id="owner-code"></a>
|
|
26
|
+
## Owner behaviour code
|
|
27
|
+
|
|
28
|
+
An owner's script switches state; its recipes draw what each state looks like. These rules keep the two apart and
|
|
29
|
+
the markup readable by browsers and assistive technology. They hold for any design system.
|
|
30
|
+
|
|
31
|
+
- **Your own elements by reference.** Reach an element the owner renders through a ref (one per element, or a map of
|
|
32
|
+
refs by key for a list), never by querying its own markup with classes, `data-*` lookups or `parentElement`
|
|
33
|
+
walks. A class is styling the recipe owns; a query couples behaviour to it and breaks when the markup moves.
|
|
34
|
+
- **State on the element, look from the recipe.** A trigger that opens something carries `aria-expanded` and
|
|
35
|
+
`aria-controls` (the id of what it opens, on that element's root); its open look is the recipe's
|
|
36
|
+
`when: { '&[aria-expanded="true"]': … }`, never a class the script toggles. The same holds for `aria-pressed`,
|
|
37
|
+
`aria-selected`, `aria-current`, `data-*` states and native states (`:checked`, `:disabled`, `[open]`).
|
|
38
|
+
- **One element per popup, shown and hidden.** Keep a popover or dialog rendered and switch it with
|
|
39
|
+
`showPopover()`/`hidePopover()` or `showModal()`/`close()`. Re-mounting it on open skips its layer motion, which
|
|
40
|
+
runs from `@starting-style` on an element that exists. Render it inside the element whose pointer events should
|
|
41
|
+
include it: a top-layer element stays a DOM child, so `pointerleave` on its parent does not fire while the
|
|
42
|
+
pointer crosses into it.
|
|
43
|
+
- **Opening and dismissal.** Hover opening is for a mouse (`event.pointerType === "mouse"`) and closes after a
|
|
44
|
+
short grace, so the pointer can cross into the popup; keyboard and touch toggle on activation. Escape and a press
|
|
45
|
+
outside close it; a non-modal popup that opened from a trigger returns focus there when it closes by keyboard.
|
|
46
|
+
- **Placement by measurement only.** For a measured popover the script reports where the anchor is
|
|
47
|
+
(`recipe.measured.set(element, { x, y })` from `getBoundingClientRect()`); its distance from the anchor is the
|
|
48
|
+
layer profile's (`anchorGap`/`anchorOverlap`, `anchorOutdent`/`anchorIndent`), never a number in the script.
|
|
49
|
+
Measure again when what it depends on moves: on resize, and on scroll when the anchor scrolls.
|
|
50
|
+
- **Valid nesting.** An owner's markup follows HTML's content model (`source/invalid-nesting`): no `div`, list,
|
|
51
|
+
paragraph or heading inside a `span`, `p`, `button`, `label` or heading (a link takes its parent's rule); no
|
|
52
|
+
button, link or form control inside a link or a button; list items in a list, rows in a table, cells in a row.
|
|
53
|
+
A box that holds a popup and a trigger is a `div` (or a list item), not a `span`.
|
|
54
|
+
- **Release what you start.** Listeners, timers, observers and animation frames are removed in the effect's cleanup.
|
|
55
|
+
|
|
25
56
|
## Development boundary
|
|
26
57
|
|
|
27
58
|
Production includes real components, patterns, controllers and their compiled
|
|
@@ -358,10 +358,11 @@ A region recipe's root can live in the browser's top layer through a closed
|
|
|
358
358
|
- **Modal cards.** A dialog with `edge: "center"` or `"block-start"` is a card in the viewport, kept the layer
|
|
359
359
|
profile's `viewportMargin` from its edges, fading in with `motion: "fade"`. The backdrop surface may set
|
|
360
360
|
`backdropBlur`. A zoom view grows an image from its place with a measured `translate` and a measured `scale`.
|
|
361
|
-
- **A
|
|
362
|
-
|
|
363
|
-
`anchorOutdent`/`anchorIndent`,
|
|
364
|
-
|
|
361
|
+
- **A popup that opens from a trigger** (a menu, a picker's list): a `popover: "manual"` measured popover placed
|
|
362
|
+
from the trigger's measured corner with the layer profile's `anchorOverlap`/`anchorGap` and
|
|
363
|
+
`anchorOutdent`/`anchorIndent`, with `motion: "fade"` or `"drop"`. Its script follows
|
|
364
|
+
[owner behaviour code](behaviors.md#owner-code): refs, `aria-expanded`, one element shown and hidden, dismissal,
|
|
365
|
+
placement by measurement only.
|
|
365
366
|
|
|
366
367
|
<a id="measured"></a>
|
|
367
368
|
## Measured values and runtime paints
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,141 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.15
|
|
4
|
+
|
|
5
|
+
<!-- ads-local-tests:start -->
|
|
6
|
+
Hot patch: the unit and integration groups; the browser group was not run.
|
|
7
|
+
Quick hot patch (urgent, on the owner's instruction): the unit group and 11 integration files related to the fixes (ratio-parts.test.mjs, end-alignment.test.mjs, block-flow-space.test.mjs, starter-check.test.ts, design-system-rejections.test.ts, lowering-parity.test.ts, measured-geometry.test.ts, modal-card.test.mjs, invalid-nesting.test.mjs, local-alias-emission.test.mjs, owner-emission.test.ts), not the whole integration group.
|
|
8
|
+
Local verification: **963/963 passed** (unit 851, integration 112).
|
|
9
|
+
Tested commit: `54c9ff208ea8dfe18fb0442ede8d23aa57213a06`; Bun 1.4.4.
|
|
10
|
+
Completed 2026-11-26T11:27:50.737Z (268 seconds).
|
|
11
|
+
|
|
12
|
+
<!-- ads-local-test-proof
|
|
13
|
+
{
|
|
14
|
+
"schema": 3,
|
|
15
|
+
"version": "0.5.15",
|
|
16
|
+
"commit": "54c9ff208ea8dfe18fb0442ede8d23aa57213a06",
|
|
17
|
+
"sourceSha256": "aa763ec745a61124d65d80deac969f309dea614e98fd9174f954ff462bbde254",
|
|
18
|
+
"command": "bun run test:hotpatch",
|
|
19
|
+
"scope": "hotpatch",
|
|
20
|
+
"result": "pass",
|
|
21
|
+
"tests": 963,
|
|
22
|
+
"pass": 963,
|
|
23
|
+
"fail": 0,
|
|
24
|
+
"skipped": 0,
|
|
25
|
+
"groups": [
|
|
26
|
+
{
|
|
27
|
+
"name": "unit",
|
|
28
|
+
"tests": 851,
|
|
29
|
+
"pass": 851,
|
|
30
|
+
"fail": 0,
|
|
31
|
+
"skipped": 0,
|
|
32
|
+
"reportSha256": "60d9a70350e6799ee8b902524b32e3c8d20e104c8ded1cbabba8c60c4d918ae2"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "integration",
|
|
36
|
+
"tests": 112,
|
|
37
|
+
"pass": 112,
|
|
38
|
+
"fail": 0,
|
|
39
|
+
"skipped": 0,
|
|
40
|
+
"reportSha256": "c0ccbf18492cb9c47992b2341a638480ffdd8f69356d5f8f9c28be16eded3559"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"testOverrides": {},
|
|
44
|
+
"bun": "1.4.4",
|
|
45
|
+
"completedAt": "2026-11-26T11:27:50.737Z",
|
|
46
|
+
"durationMs": 267877,
|
|
47
|
+
"logSha256": "e56e29cada96e54bf3ccc533a607b8effa8994f615c120d730a97d6cec26fde3"
|
|
48
|
+
}
|
|
49
|
+
-->
|
|
50
|
+
<!-- ads-local-tests:end -->
|
|
51
|
+
|
|
52
|
+
- *Fixed: a row of buttons spilled out of its card* (neezler's attachment): a
|
|
53
|
+
part with its own arrangement shrinks to nothing only when something in it
|
|
54
|
+
gives way (text, a filling or growing part, a wrapping row, a clip or scroll);
|
|
55
|
+
a row of buttons keeps its natural minimum, so a long name beside it
|
|
56
|
+
truncates instead.
|
|
57
|
+
- *Render audit: content escaping its box*: a `layout-overflow` finding of kind
|
|
58
|
+
`escaped` for a control or text reaching past the edge of the painted box
|
|
59
|
+
around it; a review for now.
|
|
60
|
+
- *A part's ratio* (#74): `frame: { profile, ratio }` on a part, so a card's
|
|
61
|
+
picture folds into the card.
|
|
62
|
+
- *Fixed: a cropping ratio box grew with a taller image* (#72): a ratio box that
|
|
63
|
+
clips or scrolls keeps its ratio (`min-block-size: 0`).
|
|
64
|
+
- *A root's browser margin* (#73): `source/root-margin-unreset` for a recipe
|
|
65
|
+
root rendered as a `figure`, `p`, list, heading, `blockquote`, `pre` or
|
|
66
|
+
`fieldset` that states no margin of its own.
|
|
67
|
+
|
|
68
|
+
## 0.5.14
|
|
69
|
+
|
|
70
|
+
<!-- ads-local-tests:start -->
|
|
71
|
+
Hot patch: the unit and integration groups; the browser group was not run.
|
|
72
|
+
Local verification: **1907/1907 passed** with `bun run test:hotpatch`.
|
|
73
|
+
Tested commit: `02ada39029cebaddd1eb23ab327cb65820dda686`; released with the E1 fix in `64e09b15` (see the note below); Bun 1.4.4.
|
|
74
|
+
Completed 2026-11-26T10:34:03.758Z (1386 seconds).
|
|
75
|
+
|
|
76
|
+
<!-- ads-local-test-proof
|
|
77
|
+
{
|
|
78
|
+
"schema": 3,
|
|
79
|
+
"version": "0.5.14",
|
|
80
|
+
"commit": "64e09b15d660c6eda00d12549dc50c5a9e862b2d",
|
|
81
|
+
"sourceSha256": "7a22940de4c3387c7fdf971e9e352c353c70f5a78d6bd0a1ee7f3d0043b31056",
|
|
82
|
+
"command": "bun run test:hotpatch",
|
|
83
|
+
"scope": "hotpatch",
|
|
84
|
+
"result": "pass",
|
|
85
|
+
"tests": 1907,
|
|
86
|
+
"pass": 1907,
|
|
87
|
+
"fail": 0,
|
|
88
|
+
"skipped": 0,
|
|
89
|
+
"groups": [
|
|
90
|
+
{
|
|
91
|
+
"name": "unit",
|
|
92
|
+
"tests": 851,
|
|
93
|
+
"pass": 851,
|
|
94
|
+
"fail": 0,
|
|
95
|
+
"skipped": 0,
|
|
96
|
+
"reportSha256": "93ea0e08769137adacfbed8d6fa950b14725050be4cd59ff6bb314e256c00efe"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "integration",
|
|
100
|
+
"tests": 1056,
|
|
101
|
+
"pass": 1056,
|
|
102
|
+
"fail": 0,
|
|
103
|
+
"skipped": 0,
|
|
104
|
+
"reportSha256": "cb0d564d9c42519d45e6510048305748855d84cfa04685ddedb0c044cc8ec9ac"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"testOverrides": {},
|
|
108
|
+
"bun": "1.4.4",
|
|
109
|
+
"completedAt": "2026-11-26T10:34:03.758Z",
|
|
110
|
+
"durationMs": 1385934,
|
|
111
|
+
"logSha256": "2b5c7f6cee57f7f2839ba9fcc2edd9673a08cf78d6aa8091cdd45eeaffd40cc9"
|
|
112
|
+
}
|
|
113
|
+
-->
|
|
114
|
+
<!-- ads-local-tests:end -->
|
|
115
|
+
|
|
116
|
+
- *Fixed: a picture stage set the end-alignment line for the text under it*
|
|
117
|
+
(#66): a painted or cropping part that holds no text (a stage with a
|
|
118
|
+
screenshot) is a picture, not a line the text beside it ends on.
|
|
119
|
+
- *Zoom cursors* (#69): `normalize.cursor` takes `zoom-in` and `zoom-out`.
|
|
120
|
+
- *Fixed: an emitted owner kept unused local aliases* (reqvire E1): a constant
|
|
121
|
+
inside a component that only aliases an authoring value (`const drawn =
|
|
122
|
+
sizes[size]`) is removed with the recipe table only it read, so a consumer
|
|
123
|
+
that type-checks with `noUnusedLocals` accepts the output.
|
|
124
|
+
|
|
125
|
+
Verification note: the hot-patch run below covered commit 02ada390. The E1 fix
|
|
126
|
+
was added after it on the owner's instruction and verified only by its related
|
|
127
|
+
tests (the new emission test, owner emission, lowering parity, the example
|
|
128
|
+
project, helper drawings, measured geometry and the unit group, all passing);
|
|
129
|
+
the stamp below names the released source.
|
|
130
|
+
- *Valid nesting in an owner's markup*: a new error, `source/invalid-nesting`,
|
|
131
|
+
for flow content inside phrasing-only elements (a `div` in a `span`, a list in
|
|
132
|
+
a `p`), a link, button or form control inside a link or a button, and list
|
|
133
|
+
items, table rows and cells outside their list, table and row.
|
|
134
|
+
- Skills: *owner behaviour code* in the behaviors guide: elements by ref,
|
|
135
|
+
`aria-expanded` with the recipe's state for the open look, one popup element
|
|
136
|
+
shown and hidden, opening and dismissal, placement by measurement only, valid
|
|
137
|
+
nesting, cleanup.
|
|
138
|
+
|
|
3
139
|
## 0.5.13
|
|
4
140
|
|
|
5
141
|
<!-- ads-local-tests:start -->
|
package/docs/GUIDE.md
CHANGED
|
@@ -631,7 +631,10 @@ capture shows the page as the showcase does.
|
|
|
631
631
|
|
|
632
632
|
- Each `a11y-axe`, `a11y-non-text-contrast`, `a11y-text-scale`,
|
|
633
633
|
`a11y-text-spacing-override`, `a11y-reflow`, `layout-overflow`, `layout-shift`
|
|
634
|
-
and `img-shape` finding is an error that fails the gate
|
|
634
|
+
and `img-shape` finding is an error that fails the gate, except a
|
|
635
|
+
`layout-overflow` finding of kind `escaped` (a control or text reaching past
|
|
636
|
+
the edge of the painted box around it, such as a button spilling over a
|
|
637
|
+
card's border), which is a review while designs are read with it.
|
|
635
638
|
- Each `a11y-incomplete` finding is an info item that fails nothing: axe could
|
|
636
639
|
not decide that rule on those elements, so check it by hand.
|
|
637
640
|
- An audit that cannot run fails the gate with a `render-audit-unavailable`
|
|
@@ -1281,6 +1284,18 @@ an owner-analysis finding with its fine-grained code, reported under its
|
|
|
1281
1284
|
- `a11y-image-alt` (error, at the image): every `<img>` that an owner renders
|
|
1282
1285
|
has `alt`: artwork (`source/intrinsic-alt-missing`), content media and any
|
|
1283
1286
|
other image (`source/image-alt-missing`). `alt=""` marks a decorative one.
|
|
1287
|
+
- `root-margin-unreset` (error, at the root): a recipe root rendered as an
|
|
1288
|
+
element the browser gives a margin (`figure`, `p`, a list, a heading,
|
|
1289
|
+
`blockquote`, `pre`, `fieldset`) states its own (`normalize: { margin: 0 }`);
|
|
1290
|
+
parts are reset by their construction, a root is not.
|
|
1291
|
+
- `a11y-nesting` (error, at the element): an owner's markup follows HTML's
|
|
1292
|
+
content model (`source/invalid-nesting`): no flow content (a `div`, a list, a
|
|
1293
|
+
paragraph, a heading) inside an element that takes phrasing content only (a
|
|
1294
|
+
`span`, `p`, `button`, `label`, heading; a link takes its parent's rule), no
|
|
1295
|
+
link, button or form control inside a link or a button, and list items, table
|
|
1296
|
+
rows and cells in their list, table and row. The parent is known through
|
|
1297
|
+
expressions and the callbacks of a list the markup renders; a component or a
|
|
1298
|
+
function boundary reports nothing.
|
|
1284
1299
|
- `a11y-keyboard` (review, at the element): `onClick` on a non-interactive
|
|
1285
1300
|
element (div, span, li, img, …) without a role and `tabIndex`
|
|
1286
1301
|
(`review/click-without-keyboard`). Composite-widget items (option, tab,
|
package/docs/LANGUAGE.md
CHANGED
|
@@ -234,7 +234,7 @@ them all.
|
|
|
234
234
|
| --- | --- | --- | --- |
|
|
235
235
|
| frame profile `paddingInline` / `paddingBlock` | frame | logical insets per axis | the profile also sets `padding` (`construction/frame-field-conflict`) |
|
|
236
236
|
| frame profile `paddingInlineStart` / `paddingInlineEnd` / `paddingBlockStart` / `paddingBlockEnd` | container frame, control frame | one side's inset, where the two sides of an axis differ (a tag padded more before its remove button). On a control frame a block side's inset is its least inset, and `minimumBlockInset` is the block axis's field | the profile also sets that side's axis or `padding`; on a control frame, a block inset beside `minimumBlockInset` (`construction/frame-field-conflict`) |
|
|
237
|
-
| `frame: { profile: "<frame profile>" }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (`box-sizing: border-box`); on a visual part bound to artwork the profile's `inlineSize`/`blockSize` are the box (a disc behind a mark) and the drawing keeps its visual profile's size, centred in it | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
237
|
+
| `frame: { profile: "<frame profile>", ratio? }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (with `ratio`, a ratio its spatial profile permits, as a root frame's; a ratio box that clips or scrolls keeps its ratio whatever it holds) (`box-sizing: border-box`); on a visual part bound to artwork the profile's `inlineSize`/`blockSize` are the box (a disc behind a mark) and the drawing keeps its visual profile's size, centred in it | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
238
238
|
| `frame: { rules: ["block-end", …] }` (root), `frame: { kind: "control", rules: [...] }` (control part) | region root, control part | the profile's `border-width`, solid, on the named logical sides only, painted by the element's surface `border-color` (mirrors in RTL); on a control part an unruled side keeps the border's space as inset, so the box and its text do not move (a soft field's underline) | empty or repeated sides; no profile width (`rule-width-missing`); no surface border colour (`rule-paint-missing`); on a grid |
|
|
239
239
|
| `frame: { corners: ["end-start", "end-end"] }` | region root | the frame profile's `radius` (or the corner's own, below) on the named corners (block edge, then inline edge), `0` on the others, as `border-<corner>-radius`; every corner without it | a named corner with no radius in the frame profile (`profile-field-missing`) |
|
|
240
240
|
| frame profile `startStartRadius` / `startEndRadius` / `endStartRadius` / `endEndRadius` | region root, part box | that corner's radius in place of the profile's `radius` (a chat bubble's small tail corner), all four as `border-<corner>-radius`; a corner with neither is square | a control frame (`profile-field-unsupported`) |
|
|
@@ -1053,7 +1053,7 @@ resize a multi-line text field. It belongs on a part rendered as `<textarea>`
|
|
|
1053
1053
|
The fields occur in a root's or a part's `normalize` and in its `when`:
|
|
1054
1054
|
|
|
1055
1055
|
- `cursor`: `pointer`, `default`, `grab`, `grabbing`, `col-resize`,
|
|
1056
|
-
`row-resize`, `move`, `text` or `
|
|
1056
|
+
`row-resize`, `move`, `text`, `not-allowed`, `zoom-in` or `zoom-out`.
|
|
1057
1057
|
- `touchAction` (lowers to `touch-action`): `none`, `pan-x` or `pan-y`.
|
|
1058
1058
|
- `userSelect`: `none`. It lowers to `user-select` with its prefixed companion
|
|
1059
1059
|
`-webkit-user-select` (some engines read only the prefixed property; the
|
package/docs/RULES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- Generated by scripts/sync-rule-reference.mjs from src/ads-errors.mts and src/finding-rules.mts. Do not edit: run `bun run sync:rule-reference`. -->
|
|
4
4
|
|
|
5
|
-
Every rule ADS reports, under its rule group:
|
|
5
|
+
Every rule ADS reports, under its rule group: 465 rules in 18 groups. A finding names its rule as a code,
|
|
6
6
|
`<domain>/<kind>`; the `check/<rule>` codes are the rules `ads check`, `ads validate`, the render audit and acceptance
|
|
7
7
|
report by their plain name (`check/a11y-reflow` is the finding `a11y-reflow`).
|
|
8
8
|
|
|
@@ -19,8 +19,8 @@ Fix findings in group order: earlier groups are often the cause of later ones. T
|
|
|
19
19
|
| 2 | [unresolved-reference](#unresolved-reference) | 39 | violated | The source names something that does not exist in this revision. | Correct the name from the existing candidates. Declare a new one only when it is genuinely new design. |
|
|
20
20
|
| 3 | [boundary](#boundary) | 30 | violated | Code reaches across an ownership or production/development boundary. | Move the code to its owner or pass the value through public props. Do not add an exception or widen the boundary. |
|
|
21
21
|
| 4 | [design-bypass](#design-bypass) | 20 | violated | Styling or design values are supplied outside the design language. | Take the value from a profile, token or recipe instead of writing it in place. |
|
|
22
|
-
| 5 | [structure-mismatch](#structure-mismatch) |
|
|
23
|
-
| 6 | [accessibility-semantics](#accessibility-semantics) |
|
|
22
|
+
| 5 | [structure-mismatch](#structure-mismatch) | 57 | violated | Rendered markup does not match what its declaration promises. | Make the markup match the declaration: each declared part, cell and binding exactly once, in the declared order. Change the declaration only if it is wrong. |
|
|
23
|
+
| 6 | [accessibility-semantics](#accessibility-semantics) | 49 | violated | Owned markup or motion lacks required accessible semantics: a text alternative, an accessible name, keyboard access or reduced motion. | Add the missing semantics in the owning component (alt, aria-label, a native control, a reduced-motion value); do not suppress the check. |
|
|
24
24
|
| 7 | [project-files](#project-files) | 6 | violated | A required project file or declaration is missing, empty, undocumented or unused. | Add or complete the file the rule names (README, license, theme or brand values), or remove what nothing uses. |
|
|
25
25
|
| 8 | [wrong-value](#wrong-value) | 74 | violated | A value has the wrong kind, role or range for where it is used. | Choose one of the allowed values the error lists. |
|
|
26
26
|
| 9 | [conflict](#conflict) | 47 | violated | Two definitions claim the same thing, or a definition depends on itself. | Keep exactly one source of truth and remove or derive the other. |
|
|
@@ -222,6 +222,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
222
222
|
| `source/placement-without-root` | error | A placement positions a styled root; an element with a placement also carries its own recipe styling. | Add the element's recipe output beside its placement, or move the placement to the styled root. | `ads://guides/layout` |
|
|
223
223
|
| `source/pseudo-host-unsupported` | error | A part treats only pseudo-elements its element has: `::placeholder` belongs to `<input>` and `<textarea>`. | Move the pseudo treatment to the part that renders the input or textarea, or render that element for this part. | `ads://guides/recipes` |
|
|
224
224
|
| `source/resize-not-textarea` | error | `normalize.resize` states how the user may resize a multi-line text field: it belongs on a part rendered as `<textarea>`. No other element has a resize handle in this language; a region's size comes from its recipe. | Declare `resize` on the part rendered as `<textarea>`, or remove it. | `ads://guides/recipes` |
|
|
225
|
+
| `source/root-margin-unreset` | error | A recipe root rendered as an element the browser gives a margin (`figure`, `p`, a list, a heading, `blockquote`, `pre`, `fieldset`) states its margin: its parts are reset by their construction, but a root keeps the browser's (a figure's 40 px sides make it 80 px narrower than its column). | Add `normalize: { margin: 0 }` to the recipe (its parent's space still applies), or render the root as a <div>. | `ads://guides/recipes` |
|
|
225
226
|
| `source/scheme-image-element` | error | A part that declares `scheme` is one drawing of a light and dark pair: a content `<img>` without an artwork binding, or declared artwork bound for a theme of that scheme (a logo black on light, white on dark). | Render a content pair as plain `<img>` elements whose `src` the application supplies; bind declared artwork for a theme of the part's scheme (`recipe({ theme: "dark", … })` on the dark part); or remove `scheme`. | `ads://guides/recipes`, `ads://guides/branding` |
|
|
226
227
|
| `source/scheme-image-not-lazy` | error | In a light and dark image pair, the image of the scheme the default theme (the first declared) does not have is `loading="lazy"` in every choice: a hidden lazy image is not downloaded, an eager one is. Only the default scheme's image may load eagerly. | Write `loading="lazy"` on that image as a literal and apply any priority (eager loading, `fetchPriority`) to the default scheme's image only. | `ads://guides/recipes` |
|
|
227
228
|
| `source/scheme-image-size-missing` | error | Both images of a light and dark pair state `width` and `height`: each file's own pixel size, so the box is reserved before either loads and the page does not move when the theme changes. | Set `width` and `height` on both images from each file's own pixel size. | `ads://guides/recipes` |
|
|
@@ -242,6 +243,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
|
|
|
242
243
|
| `check/a11y-image-alt` | error | Every <img> an owner renders has an alt attribute: meaningful text, or alt="" when decorative (WCAG 2.2 1.1.1). | Add alt text to the <img>, or alt="" if it is purely decorative. | `ads://guides/accessibility` |
|
|
243
244
|
| `check/a11y-keyboard` | review | An onClick on a non-interactive element (div, span, li, img and similar) without role and tabIndex cannot be reached or used from the keyboard (WCAG 2.2 2.1.1), unless a delegated or wrapping control handles it. Composite-widget items and backdrops whose handler reads currentTarget are exempt. | Use a <button> for the action, or add role, tabIndex and a key handler to the element. | `ads://guides/accessibility` |
|
|
244
245
|
| `check/a11y-motion-endless` | info | A recipe root, a part or an artwork that plays a repeating sequence whenever it is rendered is noted: motion that starts by itself, runs longer than five seconds and is shown beside other content must be pausable, stoppable or hideable (WCAG 2.2 2.2.2), and the owner has no state to stop this one by. Reduced motion stops it only for users who set that preference. | Play the sequence under an owner state the user can end, or render the part only while the work it stands for is in progress. | `ads://guides/accessibility` |
|
|
246
|
+
| `check/a11y-nesting` | error | An owner's markup follows HTML's content model: no flow content inside phrasing-only elements, no press target inside another, and list items, table rows and cells in their list, table and row. | Use an element whose content model fits (a <div> or a list item for a box of blocks), move the inner control beside the outer one, and put items in their list, rows in their table. | `ads://guides/accessibility` |
|
|
245
247
|
| `check/component-contrast` | error | Text meets WCAG 2.2 AA (4.5:1, or 3:1 where its text profile is provably large) against the backdrop it is rendered on: the nearest opaque background of the elements and owners around it, across files, with translucent backgrounds and known gradients composited, in every theme, brand and condition context. A public component is also placed by applications on the document surface foundation.ads.ts declares. | Choose a surface for the text whose colour contrasts with the surface it is rendered on, render the component on another surface, use large text where 3:1 suffices, or adjust the token in the named context. | `ads://guides/accessibility`, `ads://guides/tokens` |
|
|
246
248
|
| `check/surface-contrast` | error | A surface profile that sets both color and background meets WCAG 2.2 AA for text, 4.5:1, in every context (theme, brand, brand under theme and condition); its background-image gradient stops count as backgrounds. The minimum follows what the colour paints where the profile is used: a pair below 4.5:1 is accepted when every use of the profile in the design system is artwork (a visual part, or a control that renders no text: 3:1, WCAG 1.4.11), large text (at least 24px, or 18.66px at weight 700: 3:1) or artwork hidden from assistive technology (decoration: no minimum). A fully transparent colour draws nothing and has no minimum in the contexts where it is transparent (a glyph a control shows only on hover); the states that show it keep theirs. A profile nothing uses, one a slot supplies, the document surface, and one the recipe also names for a pseudo-element, a backdrop or an entrance keep 4.5:1. | Adjust the colour or background token's value in the named context (or point the profile at a pair that contrasts), keeping the pair at 4.5:1 or more; a colour meant for artwork at 3:1 belongs to a surface profile that only visual parts or text-less controls select. A surface that paints a disabled element declares `state: "inactive"` among its fields: it has no minimum (WCAG 1.4.3 exempts inactive components) and may then be selected only under `:disabled` or `[aria-disabled="true"]`. | `ads://guides/accessibility`, `ads://guides/tokens` |
|
|
247
249
|
| `construction/accessibility-declaration-unmet` | error | An `accessibility` declaration is verified where ADS can: `"boundary-on-interaction"` needs a hover treatment of the control part whose border, drawn at the frame's width, reaches 3:1 against the surroundings in every context (the focus outline is held to 3:1 as always); `"visible-label"` needs a programmatically associated, rendered label (checked by the render audit). | Make the declared identification real (a hover border at 3:1, a visible associated label), or remove the declaration and give the control a 3:1 boundary or fill. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
@@ -278,6 +280,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
|
|
|
278
280
|
| `source/focus-unshown` | error | Focus stays visible (WCAG 2.2 2.4.7). A field that shows no outline of its own (`focus: { shownBy: "container" }`) is shown by a container in the same component whose root names it: `focus: { within: ".field" }` draws the focus profile's outline around the whole field while it has keyboard focus. | Give the box around the field `focus: { within: "<the field's class>" }`, or remove `shownBy` so the field draws its own outline. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
279
281
|
| `source/form-state-colour-only` | error | A field's error state (`[data-user-invalid]`, `[data-invalid]`, `[aria-invalid="true"]`) and its autofill state (`[data-autofill]`) are not shown by colour alone (WCAG 1.4.1): some element's treatment under the state adds a cue that is not a hue: an edge or ring (`boxShadow`), a pattern (`backgroundImage`) or a border that appears (`borderStyle: "solid"`). | Give the state's surface a ring or edge (`boxShadow` with an inset ring token, such as `--shadow-invalid`) on the control, or another non-hue cue; colour changes may stay beside it. | `ads://guides/forms`, `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
280
282
|
| `source/image-alt-missing` | error | Every `<img>` an owner renders states its text alternative (WCAG 2.2 1.1.1): content media and any other image, as artwork images do; decorative images state it as empty. | Set `alt` to the text alternative (for content media, a prop the caller fills), or `alt=""` when the image is decorative. | `ads://guides/accessibility` |
|
|
283
|
+
| `source/invalid-nesting` | error | An owner's markup follows HTML's content model: an element that takes phrasing content only (a span, a paragraph, a button, a label, a heading) holds no flow content (a div, a list, a paragraph, a heading); a link or a button holds no other link, button or form control; a list item sits in a list, a table row in a table, a cell in a row. A transparent element (a link) takes its parent's model. Browsers repair such markup differently, and assistive technology reads what they repaired. | Use an element whose content model fits: a <div> (or a list item) for a box that holds blocks, a <span> inside phrasing content; move the second control out of the link or button beside it; put list items in a list and cells in a row. | `ads://guides/accessibility` |
|
|
281
284
|
| `source/layer-name-missing` | error | A dialog, and a popover with `role="dialog"`, has an accessible name from `aria-label` or `aria-labelledby`. | Label the layer root with `aria-labelledby` (its visible title's id) or `aria-label`. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
282
285
|
| `source/layer-open-attribute` | error | A modal sheet is opened with `showModal()`, never rendered with `open`: an `open` attribute gives a non-modal dialog and a server render the client cannot make modal. | Render the dialog closed and open it with `showModal()` from an effect or handler; mirror the native state in owner state. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
283
286
|
| `source/pointer-transparent-interactive` | error | `pointerEvents: "none"` is for decorative overlays: never on a focusable element, and only on markup hidden from assistive technology (`aria-hidden`) or free of interactive content. | Remove `pointerEvents` from the interactive element, or move it to a decorative `aria-hidden` overlay. | `ads://guides/recipes`, `ads://guides/accessibility` |
|