@reqvire-org/ads 0.5.12 → 0.5.13
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 +24 -3
- package/dist/analysis/owner-source.mjs +18 -0
- package/dist/construction-output.mjs +11 -2
- package/dist/construction-spec.d.mts +43 -6
- package/dist/construction-spec.mjs +21 -11
- package/dist/end-alignment.mjs +4 -4
- package/dist/lowering-layer.mjs +50 -15
- package/dist/lowering-paint.mjs +1 -1
- package/dist/lowering-region-layout.mjs +5 -0
- package/dist/lowering-sequence.mjs +4 -3
- package/dist/measured-geometry.mjs +8 -2
- package/dist/owner-errors.mjs +1 -0
- package/dist/ownership-model.mjs +5 -5
- package/dist/recipe-macro.d.mts +12 -5
- package/dist/recipe-model.mjs +2 -2
- package/dist/region-lowering.mjs +42 -17
- package/dist/showcase/client.bundle.js +1 -1
- package/dist/showcase/http-client.bundle.js +1 -1
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +1 -1
- package/dist/skills/ads-designer/references/recipes.md +2 -1
- package/dist/skills/ads-import/references/recipes.md +2 -1
- package/dist/skills/ads-port/references/recipes.md +2 -1
- package/dist/token-shapes.mjs +42 -1
- package/docs/ADS.md +3 -2
- package/docs/CHANGELOG.md +59 -18
- package/docs/LANGUAGE.md +27 -9
- package/docs/MOTION.md +5 -0
- package/docs/PROFILE-KINDS.md +8 -5
- package/docs/RULES.md +6 -3
- package/docs/TOKEN-ROLES.md +1 -1
- package/package.json +1 -1
package/docs/LANGUAGE.md
CHANGED
|
@@ -248,11 +248,11 @@ them all.
|
|
|
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
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
|
-
| (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 |
|
|
251
|
+
| (a `stack` of blocks) | root, part recipe | the blocks a stack holds end on one line: a painted block (a colour or gradient fill, a border at its end, or a part that crops what it holds at its edge, such as a stage whose screenshot runs off) 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
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
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
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`) |
|
|
255
|
+
| `anchor: { artwork, x, y, inline?, block?, size? }` | 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 (and on the block axis by its `baseline`, as SVG text sits: the label is trimmed to end at its first baseline, which falls back to its line box where `text-box-trim` is not supported). `size` (drawing units) sizes the label with the drawing (`max(<text size>, 100cqi × size / viewBox width)`, the parent its inline-size container), never below its text profile's size, which it needs (`text-anchor-unsupported`) 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
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`) |
|
|
257
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`) |
|
|
258
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 |
|
|
@@ -270,7 +270,7 @@ them all.
|
|
|
270
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) |
|
|
271
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
272
|
| `sticky: { edge: "block-start" \| "block-end", clear?: "block-start" }` | root (not a top-layer root), part | `position: sticky` at that edge of the nearest scrolling container (`inset-block-start: 0`); with `clear`, below the region the layer profile's `clearBlockStart` names; `z-index` from the layer profile's `stickyLayer` when it has one | `clear` with the end edge; `clear` without a layer profile that states `clearBlockStart` |
|
|
273
|
-
| `extent: "fill" \| "fill-both"` | part | `flex: 1 1 0`, the main-axis minimum released, so the part's content is confined to it; in a `stack` whose frame states only a minimum height (`minBlockSize`, with no `blockSize`, `maxBlockSize`, ratio or `overflow`) the part keeps its content's height and the stack grows with it; `align-self: stretch` with `fill-both`. In block flow (a parent without an arrangement), `fill` on a part with its own `recipe` makes it a block as wide as its container: a heading row whose switch sits at the column's end (a row is `display: flex` there, without `fit-content`) | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
|
|
273
|
+
| `extent: "fill" \| "fill-both" \| "grow"` | part | `grow`: `flex: 1 1 auto`, the part grows from its own size, so in a wrapping row items sit side by side at their own widths where they fit and each fills its line where they wrap (a pricing hero's two buttons). `fill`: `flex: 1 1 0`, the main-axis minimum released, so the part's content is confined to it; in a `stack` whose frame states only a minimum height (`minBlockSize`, with no `blockSize`, `maxBlockSize`, ratio or `overflow`) the part keeps its content's height and the stack grows with it; `align-self: stretch` with `fill-both`. In block flow (a parent without an arrangement), `fill` on a part with its own `recipe` makes it a block as wide as its container: a heading row whose switch sits at the column's end (a row is `display: flex` there, without `fit-content`) | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
|
|
274
274
|
| `extent: "content" \| "container"` | root of an `inline` row, or of a control | `"content"` (the default): as wide as its content, never wider than its container (`display: inline-flex; max-inline-size: 100%`, or `min(100%, <cap>)` under its frame's own cap); `"container"`: the width available in any parent, a block one, a column that aligns its children, or a row beside siblings (`display: flex; inline-size: 100%`), so a filling part has the rest of the row | on a `stack`, `flow`, `layered` or top-layer root, which never hug (`spec/field-unsupported`); `"container"` with a frame that fixes the row's width (`construction/extent-conflict`); a part with `extent: "fill"` in a `"content"` row whose frame does not fix its width (`construction/extent-row-hugs`) |
|
|
275
275
|
| `layout: "layered"` | root, part recipe | one `minmax(0,1fr)` grid area; every declared child part at `1 / 1`; paint order is DOM order, no `z-index` | fewer than two parts (`layered-parts-missing`); `gap` or `wrap` |
|
|
276
276
|
| `outset: { block?, inline? }` (spacing fields) | a childless, non-text part of a `layered` parent | `margin-block` / `margin-inline: calc(-1 * <spacing>)`: the backdrop is drawn past its parent's box (a glow behind a card); the grid area and the layout around it are unchanged. A field bound to a `box-share` token (the spacing profile's `outsetBlock` / `outsetInline`) is a share of the box on that axis and grows with it: the same margin on the inline axis, and on the block axis `block-size: calc(100% + 2 * <share>)` centred over the area (`align-self: center`) | any other part (`construction/outset-unsupported`) |
|
|
@@ -281,7 +281,7 @@ them all.
|
|
|
281
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
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`) |
|
|
283
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`) |
|
|
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 (`text-input`: an `<input>` of type `text`, `email`, `tel`, `url`, `password` or `number`, or without a type; `search-input`: `type="search"`) (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`) |
|
|
284
|
+
| `element: "iframe" \| "select" \| "search-input" \| "text-input" \| "textarea" \| "table" \| "header-cell" \| "cell" \| "list" \| "summary" \| "document"`, `marker: "none"` | root, part (`document`: a pattern's root only) | the element's closed UA normalization (`text-input`: an `<input>` of type `text`, `email`, `tel`, `url`, `password` or `number`, or without a type; `search-input`: `type="search"`; `textarea`: a `<textarea>`, whose control frame keeps its stated insets around its lines instead of centring one; a `<textarea>` with a control frame declares it, `source/textarea-element-missing`) (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`) |
|
|
285
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`) |
|
|
286
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`) |
|
|
287
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`) |
|
|
@@ -826,16 +826,28 @@ recipe({
|
|
|
826
826
|
page must not move behind a modal keeps the room at all times with the
|
|
827
827
|
foundation's `scrollbarGutter: "stable"`; where scrollbars overlay the page it
|
|
828
828
|
reserves nothing.
|
|
829
|
+
- **Whole-viewport modal** (`element: "dialog"`; `edge: "fill"`): a `<dialog>`
|
|
830
|
+
over the entire viewport, no margin and no layer profile (a phone menu, a
|
|
831
|
+
zoom view); its content is placed inside it (a close control is a layer in
|
|
832
|
+
its corner, the viewport's corner). It takes a card's motions.
|
|
829
833
|
- **Modal card** (`element: "dialog"`; `edge: "center" | "block-start"`): the
|
|
830
834
|
same `<dialog>`, a card centred in the viewport, or centred inline below the
|
|
831
835
|
top. A centred card keeps the layer profile's `viewport-margin` from every
|
|
832
836
|
viewport edge; a block-start card keeps its `edge-gap` from the top and the
|
|
833
837
|
bottom (the margin when it declares none) and the margin at the sides
|
|
834
|
-
(`max-inline-size`, `max-block-size: calc(100dvh -
|
|
835
|
-
frame's size within it
|
|
838
|
+
(`max-inline-size: calc(100% - 2 × margin)`, `max-block-size: calc(100dvh -
|
|
839
|
+
2 × gap)`), with its frame's size within it: the frame's `inlineSize` is the
|
|
840
|
+
size it prefers, and on a narrower screen the room wins (a 540px card on a
|
|
841
|
+
phone). The room is measured from the card's containing block, the viewport
|
|
842
|
+
without its scrollbar's room. A card taller than the screen scrolls inside;
|
|
843
|
+
`overscroll: "contain"` on its root (with no `overflow`, the layer makes it
|
|
844
|
+
scroll) keeps that scroll from reaching the page. The scroll lock hides the page's scrollbar; a page
|
|
836
845
|
that should not shift then keeps the scrollbar's room at all times with the
|
|
837
846
|
foundation's `scrollbarGutter: "stable"`. `motion: "fade"`
|
|
838
|
-
fades the card and its backdrop in
|
|
847
|
+
fades the card and its backdrop in; `"drop"` fades it while it comes down
|
|
848
|
+
its motion profile's `distance` from its `scale`; `"veil"` fades only the
|
|
849
|
+
backdrop and keeps the dialog shown until it has (a zoom view, whose image
|
|
850
|
+
grows from its place by its own measured motion). A close control in its corner is a layer of a layered part.
|
|
839
851
|
A zoom view that grows an image from its place sets a measured `translate`
|
|
840
852
|
and a measured `scale` (`{ type: "scale", property: "scale" }`, unitless
|
|
841
853
|
factors per axis) on the image and animates them with their `motion`.
|
|
@@ -843,12 +855,14 @@ recipe({
|
|
|
843
855
|
non-modal panel pinned to a viewport `corner` by logical insets, with light
|
|
844
856
|
dismiss and Escape from `popover="auto"`. A `layer` profile (`edge-gap`,
|
|
845
857
|
`viewport-margin` and, for `clear: "block-start"`, `clear-block-start`)
|
|
846
|
-
places it; `100dvh` bounds its height
|
|
858
|
+
places it; `100dvh` bounds its height, and the frame's own `maxBlockSize`
|
|
859
|
+
when it is smaller (a list that scrolls past 320px). The clearance must resolve to a fixed
|
|
847
860
|
length (`construction/layer-clearance-unbounded`).
|
|
848
861
|
- **Measured popover** (`placement: "measured"`): the same panel, anchored by
|
|
849
862
|
the owner to an element (its trigger, a pointer, a text selection). The
|
|
850
863
|
compiler fixes it in the top layer with every inset released and its size
|
|
851
|
-
within the viewport less the layer profile's `viewport-margin
|
|
864
|
+
within the viewport less the layer profile's `viewport-margin`, and within
|
|
865
|
+
the frame's own caps when they are smaller. The owner
|
|
852
866
|
writes the position through the recipe's
|
|
853
867
|
[measured values](#measured-runtime-geometry), which the panel reads only
|
|
854
868
|
while open. Its root declares at least one measured inset or `translate`
|
|
@@ -951,6 +965,10 @@ Each `type` (setter value; place) has a closed property list:
|
|
|
951
965
|
`slider-fill`, the fill of a range slider with a `sliderFill` treatment, or
|
|
952
966
|
`slider-step`, the place of each step label in a row `along` a slider
|
|
953
967
|
([range sliders](#range-sliders)). Written with `measured.props` at render.
|
|
968
|
+
- `index` (0, 1, 2…, an instance's place among its siblings):
|
|
969
|
+
`sequence-order`, read by a sequence staggered by it
|
|
970
|
+
(`play: { sequence, orderBy: "<name>" }`, [MOTION.md](MOTION.md#sequences)).
|
|
971
|
+
Written on each instance with `measured.props` at render.
|
|
954
972
|
|
|
955
973
|
Rules:
|
|
956
974
|
|
package/docs/MOTION.md
CHANGED
|
@@ -468,6 +468,11 @@ recipe({
|
|
|
468
468
|
it. An indicator rendered only while work is in progress needs nothing more.
|
|
469
469
|
- The older continuous rotation (`repeat: "continuous"` with `rotate` on a
|
|
470
470
|
standalone artwork part) is unchanged.
|
|
471
|
+
- **In turn, however many.** `play: { sequence, orderBy: "word" }` on a
|
|
472
|
+
repeated part starts each instance as many staggers late as its measured
|
|
473
|
+
`index` (`measured: { word: { type: "index", property: "sequence-order" } }`,
|
|
474
|
+
written on each instance with `measured.props({ word: i })`): a title from
|
|
475
|
+
props whose words rise one after another.
|
|
471
476
|
- **Held, then played.** `play: { sequence, paused: true }` under one owner
|
|
472
477
|
state holds the element at its first step (`animation-play-state: paused`),
|
|
473
478
|
and the same sequence under another state plays it: a diagram armed before it
|
package/docs/PROFILE-KINDS.md
CHANGED
|
@@ -480,15 +480,18 @@ profile({
|
|
|
480
480
|
steps that state it.
|
|
481
481
|
- The steps run from `0` to `100`, at distinct whole percentages
|
|
482
482
|
(`construction/sequence-steps-invalid`).
|
|
483
|
-
- `repeat` is `"loop"` (the default), `"alternate"` or `"once"`.
|
|
484
|
-
where it starts: its step at 100 states the values of its step
|
|
485
|
-
has no jump (`construction/sequence-not-seamless`). `"
|
|
486
|
-
|
|
483
|
+
- `repeat` is `"loop"` (the default), `"restart"`, `"alternate"` or `"once"`.
|
|
484
|
+
A loop ends where it starts: its step at 100 states the values of its step
|
|
485
|
+
at 0, so it has no jump (`construction/sequence-not-seamless`). `"restart"`
|
|
486
|
+
starts over from its first step, for a pulse whose end differs from its start
|
|
487
|
+
by design (a ring that grows and fades out). `"alternate"` plays forward then
|
|
488
|
+
backward, forever. `"once"` plays one time and holds its last
|
|
487
489
|
step.
|
|
488
490
|
- `reduced: "static"` is required: under reduced motion nothing plays and the
|
|
489
491
|
part keeps its own look.
|
|
490
492
|
- `stagger` is the time between parts that share the sequence
|
|
491
|
-
([Sequences](MOTION.md#sequences))
|
|
493
|
+
([Sequences](MOTION.md#sequences)): `order` fixes how many staggers a part
|
|
494
|
+
starts late, and `orderBy` reads it per instance from a measured `index`.
|
|
492
495
|
|
|
493
496
|
## Focus
|
|
494
497
|
|
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: 462 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,7 +19,7 @@ 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) |
|
|
22
|
+
| 5 | [structure-mismatch](#structure-mismatch) | 56 | 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
23
|
| 6 | [accessibility-semantics](#accessibility-semantics) | 47 | 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. |
|
|
@@ -194,6 +194,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
194
194
|
| `construction/outset-unsupported` | error | `outset` draws a decorative backdrop past its parent's box (a glow behind a card): it belongs on a part of a `layered` parent that holds no parts and no text. The parent's box and the layout around it do not change. | Make the parent `layout: "layered"` (root or a part's `recipe`) with the backdrop as its first part, and keep content in the other layers. | `ads://guides/recipes` |
|
|
195
195
|
| `construction/reserve-without-text` | error | `reserveLines` reserves lines of the part's own text profile, so the part has one. | Make the part a text part (with a text slot or `text` profile), or remove `reserveLines`. | `ads://guides/recipes` |
|
|
196
196
|
| `construction/scheme-unsupported` | error | `scheme` marks one file of a content image's light and dark pair: it belongs on a visual part rendered as an `<img>` without an artwork binding. Declared artwork selects its drawing by theme through its own variants. | Render the part as an `<img>` whose `src` the application supplies, or remove `scheme` and give the declared asset a variant for the other theme. | `ads://guides/recipes`, `ads://guides/branding` |
|
|
197
|
+
| `construction/sequence-order-unmeasured` | error | A sequence staggered by a measured index (`play: { sequence, orderBy: "<name>" }`, a title's words rising in turn) reads a measured value of the recipe of type `index` (`{ type: "index", property: "sequence-order" }`), which the owner writes on each instance at render: 0, 1, 2… | Declare `measured: { <name>: { type: "index", property: "sequence-order" } }` on the recipe and write each instance's index with `measured.props({ <name>: i })`. | `ads://guides/recipes` |
|
|
197
198
|
| `construction/slider-fill-unsupported` | error | A slider's fill (`pseudo.sliderFill`) is drawn on its track up to the thumb: the element draws its track (`sliderTrack`), whose size and radius the fill takes, and declares a measured share (`{ type: "share", property: "slider-fill" }`) the owner writes as the value's place in its range, 0 to 1. Firefox draws the fill natively; other engines paint the track up to the share. | Give the slider a `sliderTrack` treatment and declare `measured: { fill: { type: "share", property: "slider-fill" } }` on it; the owner writes `(value - min) / (max - min)`, at render with `measured.props`. | `ads://guides/recipes` |
|
|
198
199
|
| `construction/slider-steps-unsupported` | error | A row of step labels (`along: "<slider part>"`) lies under a sibling slider: it is inset by half the thumb's width, so the thumb's centre at each end is a label's centre, and each label is centred at its own measured share (`{ type: "share", property: "slider-step" }`). The row arranges its labels itself: it declares no layout. | Name a sibling part whose `sliderThumb` frame states `inlineSize`, declare `measured: { step: { type: "share", property: "slider-step" } }` on the row and write each label's share with `measured.props`; drop the row's layout. | `ads://guides/recipes` |
|
|
199
200
|
| `construction/snap-without-scroll` | error | Scroll snap is declared by the arrangement of the element that scrolls on the snap axis (`overflow: "scroll-inline"` for inline, `"scroll-block"` for block, `"scroll-both"` for both); its children, which it places, snap. Elsewhere it has no effect. | Make the element scroll on the snap axis with `overflow` (`scroll-inline`, `scroll-block` or `scroll-both`), or move `snap` to the arrangement of the element that scrolls. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
@@ -205,6 +206,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
205
206
|
| `source/artwork-source-undeclared` | error | Inline artwork renders its bound drawing's SVG through a single `dangerouslySetInnerHTML.__html`. | Render the bound drawing's SVG text with a single `__html` property on the visual part. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
206
207
|
| `source/cell-missing-or-repeated` | error | Each declared grid cell renders exactly once; a cell declared `required: false` may be absent, and one declared `repeat: true` (or auto-placed at every tier) renders any number of times. | Render the cell exactly once, declare it `required: false` when it may be absent, or `repeat: true` when it renders once per item of a list. | `ads://guides/layout` |
|
|
207
208
|
| `source/data-theme-mismatch` | error | An element's data-theme matches the theme its construction declares. | Set data-theme to the theme the construction declares. | `ads://guides/tokens` |
|
|
209
|
+
| `source/drawing-read-unbound` | error | A recipe's drawing (`recipe.assets.<part>.source`) is read in the markup of the owner's element that is the part, where ADS inlines the drawing's source. Elsewhere (a helper function that renders markup ADS does not match to the owner) it cannot be inlined, and the emitted owner would read an emptied recipe. | Render the element that shows the drawing in the owner's own markup (the function whose markup holds the recipe's root), or give the helper's markup its own recipe root. | `ads://guides/recipes` |
|
|
208
210
|
| `source/glyph-source-form` | error | A set-bound part renders `dangerouslySetInnerHTML={{ __html: recipe.assets.<part>.source[name] }}`; a reference-bound part renders `{{ __html: glyph.source }}` of the glyph reference it receives. | Render the bound drawing in that exact form; select nothing else with the name or the reference. | `ads://guides/pictograms` |
|
|
209
211
|
| `source/grid-container-missing` | error | A grid in container context (`context: "container"`) responds to the nearest `ads-region` size container, so an owned ancestor in the same owner starts one: a region framed `container: "region"` (a container is element-owned, never a cell's). Without one its tier rules never match and only the smallest tier applies, wherever the component is placed. | Frame an owned ancestor of the grid with `frame: { container: "region" }` (a wrapper whose width is the region the grid should follow), or use `context: "viewport"`. A container a consumer renders around the component, or one inside a public component it is passed to, does not count. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
210
212
|
| `source/intrinsic-alt-missing` | error | Every image states its text alternative; decorative images state it as empty. | Set `alt` to the text alternative, or `alt=""` when the image is decorative. | `ads://guides/branding`, `ads://guides/accessibility` |
|
|
@@ -224,6 +226,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
224
226
|
| `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` |
|
|
225
227
|
| `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` |
|
|
226
228
|
| `source/summary-outside-details` | error | A declared summary is the first child of a `<details>` element: elsewhere it has no disclosure semantics. | Render the summary inside the owner's `<details>`, or declare another element. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
229
|
+
| `source/textarea-element-missing` | error | A control frame centres a single line in its minimum height. A multi-line field declares `element: "textarea"`, so its frame keeps the stated insets around its lines instead. | Declare `element: "textarea"` on the part. | `ads://guides/recipes` |
|
|
227
230
|
| `source/visual-binding-count` | error | A visual part binds exactly one declared asset. A control and standalone artwork have one visual part; a region may have several, each with its own binding. | Bind exactly one declared asset to each visual part; in a control or standalone artwork, declare one visual part. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
228
231
|
|
|
229
232
|
## accessibility-semantics
|
|
@@ -334,7 +337,7 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
|
|
|
334
337
|
| `construction/profile-field-unsupported` | error | A profile field holds a value the construction can lower. | Use a value this construction can lower. | `ads://guides/recipes` |
|
|
335
338
|
| `construction/profile-kind` | error | A construction references a profile of the kind its field requires. | Reference a profile of the required kind. | `ads://guides/recipes` |
|
|
336
339
|
| `construction/pseudo-surface-unsupported` | error | A pseudo-element surface sets exactly one field: a placeholder's text colour (`color`), or a progress bar's fill (`background`). Other paints, borders and effects of a pseudo-element are not supported. | Treat the pseudo-element with a surface profile that sets only that field: `color` for a placeholder, `background` for a progress fill. | `ads://guides/recipes` |
|
|
337
|
-
| `construction/sequence-not-seamless` | error | A looping sequence ends where it starts: its step at 100 states the same values as its step at 0, so the loop has no jump. A sequence that should run forward then backward declares `repeat: "alternate"`; one that plays one time declares `repeat: "once"`. | Make the step at 100 state the values of the step at 0, or declare `repeat: "alternate"` or `repeat: "once"` in the profile. | `ads://guides/recipes` |
|
|
340
|
+
| `construction/sequence-not-seamless` | error | A looping sequence ends where it starts: its step at 100 states the same values as its step at 0, so the loop has no jump. A sequence that should run forward then backward declares `repeat: "alternate"`; one that starts over from its first step by design (a pulse that grows and fades out) declares `repeat: "restart"`; one that plays one time declares `repeat: "once"`. | Make the step at 100 state the values of the step at 0, or declare `repeat: "restart"` (a pulse that starts over), `repeat: "alternate"` or `repeat: "once"` in the profile. | `ads://guides/recipes` |
|
|
338
341
|
| `construction/sequence-stagger-missing` | error | A part's `order` starts it that many staggers after the first, so parts that share a sequence run in turn. The stagger is the sequence profile's `stagger` (role `duration`). | Give the sequence profile a `stagger` token, or remove `order` from the part. | `ads://guides/recipes` |
|
|
339
342
|
| `construction/sequence-step-field` | error | A step of a sequence states what the part looks like there: `opacity`, travel (`translateInline`, `translateBlock`), one scale (`scale`, or `scaleInline` or `scaleBlock` for one axis) and `rotate`, each from a token of its role. A step states at least one, and one scale. | State one of the step fields with a token of its role (opacity, motion-distance, motion-scale, motion-angle), and at most one scale per step. | `ads://guides/recipes` |
|
|
340
343
|
| `construction/sequence-steps-invalid` | error | A sequence profile has at least two steps, each at a distinct whole percentage of the run, from 0 to 100. | Give the sequence a step at 0 and a step at 100, and distinct whole percentages between them. | `ads://guides/recipes` |
|
package/docs/TOKEN-ROLES.md
CHANGED
|
@@ -113,7 +113,7 @@ construction and owner code supplies behavior: these are different contracts.
|
|
|
113
113
|
| Exact filename | Value contract | Permitted purpose / consumer | Specimen |
|
|
114
114
|
| --- | --- | --- | --- |
|
|
115
115
|
| `font-family.ads.css` | Ordered named/generic family list | Text font selection and fallback | `--font-ui` |
|
|
116
|
-
| `font-size.ads.css` | Positive length in `rem` or `em` (or an expression containing them) | Text size with user scaling preserved; a px value is `a11y-text-resize` | `--label-size-md` |
|
|
116
|
+
| `font-size.ads.css` | Positive length in `rem` or `em` (or an expression containing them), or a fluid size `clamp(<rem>, <rem> + <vw>, <rem>)` whose largest bound is at most 2.5 times its smallest | Text size with user scaling preserved; a px value, or a viewport share without such bounds, is `a11y-text-resize` | `--label-size-md`, `--hero-title: clamp(1.75rem, 9vw, 3rem)` |
|
|
117
117
|
| `line-height.ads.css` | Positive length in `rem` or `em`, or unitless multiplier | Line envelope; a multiplier uses the selected font size; a px length is `a11y-text-resize` | `--label-line-md` |
|
|
118
118
|
| `font-weight.ads.css` | Number in [1, 1000] | Text weight, subject to actual font support | `--weight-emphasis` |
|
|
119
119
|
| `font-stretch.ads.css` | Positive percentage | Text font width, subject to actual font support | `--font-width-ui` |
|