@reqvire-org/ads 0.5.9 → 0.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/ads-errors.mjs +68 -4
  2. package/dist/analysis/owner-source.mjs +16 -2
  3. package/dist/asset-declaration.d.mts +5 -0
  4. package/dist/asset-declaration.mjs +8 -2
  5. package/dist/asset-model.mjs +3 -0
  6. package/dist/construction-output.mjs +36 -7
  7. package/dist/construction-spec.d.mts +109 -10
  8. package/dist/construction-spec.mjs +173 -45
  9. package/dist/end-alignment.mjs +17 -2
  10. package/dist/form-states.mjs +2 -2
  11. package/dist/grid-lowering.mjs +24 -1
  12. package/dist/lowering-layer.mjs +11 -10
  13. package/dist/lowering-overlaps.mjs +5 -3
  14. package/dist/lowering-properties.mjs +13 -1
  15. package/dist/lowering-region-layout.mjs +4 -4
  16. package/dist/lowering-sequence.mjs +6 -2
  17. package/dist/measured-geometry.mjs +15 -3
  18. package/dist/owner-analysis-check.mjs +3 -0
  19. package/dist/owner-errors.mjs +6 -0
  20. package/dist/ownership-model.mjs +34 -9
  21. package/dist/platform-features.mjs +12 -0
  22. package/dist/press-scale.mjs +3 -1
  23. package/dist/profile-macro.d.mts +5 -0
  24. package/dist/profile-view-facts.mjs +1 -1
  25. package/dist/recipe-macro.d.mts +53 -6
  26. package/dist/recipe-model.mjs +8 -5
  27. package/dist/region-lowering.mjs +398 -30
  28. package/dist/role-vocabulary.d.mts +12 -1
  29. package/dist/role-vocabulary.mjs +21 -3
  30. package/dist/skills/ads-designer/references/motion.md +4 -1
  31. package/dist/skills/ads-designer/references/recipes.md +36 -3
  32. package/dist/skills/ads-import/references/recipes.md +36 -3
  33. package/dist/skills/ads-port/references/recipes.md +36 -3
  34. package/dist/spatial-model.mjs +11 -2
  35. package/dist/surface-effects.mjs +25 -6
  36. package/dist/token-dtcg.mjs +2 -1
  37. package/docs/ARCHITECTURE.md +8 -0
  38. package/docs/ASSETS.md +7 -1
  39. package/docs/CHANGELOG.md +143 -18
  40. package/docs/GUIDE.md +9 -0
  41. package/docs/LANGUAGE.md +137 -17
  42. package/docs/MOTION.md +45 -0
  43. package/docs/PROFILE-KINDS.md +32 -5
  44. package/docs/RULES.md +13 -5
  45. package/docs/TOKEN-ROLES.md +9 -2
  46. package/package.json +1 -1
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: 451 rules in 18 groups. A finding names its rule as a code,
5
+ Every rule ADS reports, under its rule group: 459 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) | 47 | 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) | 45 | 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. |
22
+ | 5 | [structure-mismatch](#structure-mismatch) | 53 | 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) | 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. |
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. |
@@ -183,6 +183,9 @@ Rendered markup does not match what its declaration promises. Make the markup ma
183
183
  | `check/token-sheet-property` | error | Token sheets declare tokens only: custom properties (--name). A declaration of an ordinary CSS property (`:root { color: red }`) is no token, belongs to no role and styles outside every recipe; ADS does not read it as a token. | Remove the declaration. Style an element through its recipe, and the document through foundation({ text, surface }); a value meant to be shared is a token (--name) of its role. | `ads://guides/tokens` |
184
184
  | `choice/no-reachable-choice` | error | Every styled selection renders in at least one reachable state. | Check the conditions guarding the element; remove dead branches or the unreachable styling. | `ads://guides/recipes` |
185
185
  | `construction/artwork-binding-missing` | error | An artwork construction binds its visual part to a declared asset. | Bind the visual part to a declared asset and name its visual profile in the binding: recipe({ parts: { visual: { kind: "visual", asset: "<asset>", visual: "<visual profile>" } } }). | `ads://guides/branding`, `ads://guides/pictograms` |
186
+ | `construction/artwork-group-draw-length` | error | A line drawn along its length (a sequence's `draw` step) is measured on a length of 1: each shape of the group states `pathLength="1"` in the SVG, so the dash covers the whole line whatever its real length. | Add `pathLength="1"` to each path, line, polyline, polygon, circle, ellipse or rect of the group in the SVG. | `ads://guides/recipes` |
187
+ | `construction/artwork-group-unknown` | error | A part animates the named groups its drawing declares (`groups` in the asset, `data-group` in its SVG): a wordmark's letters, a diagram's edges. The drawing is shown as inline SVG (paint slots or foreground); an image document (intrinsic paint) is drawn as an <img>, where nothing inside can be reached. | Name a group the asset declares, or declare it: `groups: ["<name>"]` in the asset and `data-group="<name>"` on its element in the SVG. | `ads://guides/recipes`, `ads://guides/branding` |
188
+ | `construction/between-axes-unsupported` | error | `between: { axes }` draws rules between arranged items on the axes it names: a stack's (or a 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. Layers overlap and have nothing between them, and each item's `::before` draws its rules, so no item may already use it. | Name the axis the arrangement separates its items on (block for a stack, inline for a row), wrap the row or use a grid for both, or move the item's own ::before treatment to another element. | `ads://guides/recipes` |
186
189
  | `construction/content-missing` | error | A control renders text or artwork in every reachable choice, so it is never empty. | Give every choice a text part or an artwork part. | `ads://guides/recipes`, `ads://guides/accessibility` |
187
190
  | `construction/cover-box-missing` | error | A cropped image (a visual part whose visual profile declares `fit: "cover"`) fills a box of its own: it is a top-level part of a region whose frame declares a `ratio` or whose frame profile fixes its `blockSize`. The frame has the shape; the image is cropped inside it. | Declare `frame: { ratio: "16 / 9" }` (a ratio the spatial profile permits) on the recipe whose top-level visual part crops, or use a visual profile with `fit: "contain"`. | `ads://guides/recipes`, `ads://guides/layout` |
188
191
  | `construction/extent-row-hugs` | error | An inline row is as wide as its content unless its recipe declares `extent: "container"`; a part can fill only a row that takes its container's width. | Declare `extent: "container"` on the row's recipe so it takes its container's width, or remove the part's `extent`. | `ads://guides/recipes`, `ads://guides/layout` |
@@ -191,7 +194,10 @@ Rendered markup does not match what its declaration promises. Make the markup ma
191
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` |
192
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` |
193
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/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
+ | `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` |
194
199
  | `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` |
200
+ | `construction/text-anchor-unsupported` | error | A text part placed on a drawing (`anchor: { artwork, x, y }`) names a sibling decoration whose artwork is the drawing: their parent is sized to the drawing (its viewBox ratio), so the drawing fills it and a point of the drawing is a share of the parent's box. One parent places labels on one drawing, and states no block size or ratio of its own. | Anchor labels to a `kind: "decoration"` sibling that binds the drawing, all to the same one, and leave the parent's height to the drawing. | `ads://guides/recipes` |
195
201
  | `review/measured-unused` | review | A measured value the recipe declares is written by the owner (`recipe.measured.set`): an unused declaration is a stale permission. | Set it with `recipe.measured.set(element, { … })` where the owner measures it, or remove the declaration. | `ads://guides/recipes` |
196
202
  | `review/paint-unused` | review | A runtime paint the recipe declares is written by the owner (`recipe.paints.set`): an unused declaration is a stale permission. | Set it with `recipe.paints.set(element, { … })` where the owner reads its data, or remove the declaration. | `ads://guides/recipes` |
197
203
  | `source/align-rows-mismatch` | error | A grid aligns only the rows a public component exposes, in the order it exposes them. | Align only the rows the component exposes, in its order, or expose the rows from the component. | `ads://guides/layout` |
@@ -242,7 +248,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
242
248
  | `construction/non-text-contrast-insufficient` | error | A control part inside a known surface keeps its boundary and focus visible (WCAG 2.2 1.4.11): where its own background does not reach 3:1 against the enclosing background, its border colour (base and each owner state) does; its focus outline colour reaches 3:1 against what it sits on (the enclosing background outside the box, its own inside), in every theme, brand and condition. | Choose a border or focus colour token that reaches 3:1 against the surrounding background in that context, or give the control a background that does. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
243
249
  | `construction/paint-contrast-insufficient` | error | Every declared value of a runtime paint keeps its contrast against the background the construction knows, in every theme, brand and owner state: a `color` paint 4.5:1 (3:1 for provably large text, WCAG 2.2 1.4.3); a `fill`, `stroke` or `border-color` paint, and a `background-color` paint against its enclosing background, 3:1 (1.4.11); text on a painted background its text minimum. The set is finite, so one failing value fails whichever value data selects. | Adjust that token's value in the failing context, remove it from the paint's values, or place the element on a background it contrasts with. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
244
250
  | `construction/placeholder-contrast-insufficient` | error | Placeholder text has at least 4.5:1 contrast against its part's background in every theme, brand and state (WCAG 1.4.3). | Choose a placeholder surface whose colour token contrasts enough with the part's background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
245
- | `construction/progress-contrast-insufficient` | error | A progress bar's fill, and a range slider's thumb, has at least 3:1 contrast against its track in every theme, brand and state (WCAG 1.4.11): the progress part's own background, the slider track's surface. | Choose a fill surface whose background token contrasts enough with the part's own background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
251
+ | `construction/progress-contrast-insufficient` | error | A progress bar's fill, a range slider's thumb and a scrollbar's thumb have at least 3:1 contrast against their track in every theme, brand and state (WCAG 1.4.11): the progress part's own background, the slider track's surface. | Choose a fill surface whose background token contrasts enough with the part's own background in that context, or adjust the token's value there. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
246
252
  | `construction/state-contrast-insufficient` | error | An element's owner states keep it readable (text 4.5:1 or 3:1 when large; a visual part's or a text-less control's artwork 3:1; artwork hidden from assistive technology has no minimum, nor has a fully transparent colour, which draws nothing): where a state's colour meets a background from another surface profile (a colour-only state over the base fill, a state fill under the base colour), the pair has at least 4.5:1 contrast in every theme, brand and condition, or 3:1 where the element's text profile makes its text large there (at least 24px, or 18.66px at weight 700); a state that holds only while the element is inactive (:disabled, [aria-disabled="true"]) has no minimum (WCAG 2.2 1.4.3). Two states that cannot hold on one root together (two values of one attribute, a state and its :not(), :disabled and :enabled) are not paired. | Treat the state with a surface that sets both its colour and background, or choose colour and background tokens that contrast in that context. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
247
253
  | `construction/target-area-overlap` | error | The enlarged hit areas of neighbouring targets in a stack or inline arrangement do not overlap across their gap in any context: a press there would reach two targets (WCAG 2.2 2.5.8). | Widen the arrangement's gap to at least the hit areas' reach beyond the two boxes, or reduce the min-target sizes. | `ads://guides/recipes`, `ads://guides/accessibility` |
248
254
  | `construction/target-size-below-minimum` | error | Every control construction and `frame: "control"` part is a pointer target of at least 24 × 24 CSS px in every theme, brand and condition (WCAG 2.2 2.5.8), computed from its lowered box: min block = max(min-block-size, content + 2 (inset + border)), inline = 2 (padding-inline + border) + content; an enlarged hit area (min-target-inline-size, min-target-block-size) counts. Relative lengths are evaluated at the 16px reference root. The spacing exception holds for a smaller part of a stack or inline arrangement: a 24px circle centred on it reaches neither a neighbouring target's box nor, for a smaller neighbour, that neighbour's circle, at every gap the arrangement takes; a root or a part with no neighbouring target keeps the minimum. | Raise the frame profile's min-block-size, padding-inline or the visual size in that context, give the frame a min-target-inline-size / min-target-block-size hit area of at least 24px, or (for a part between targets) widen the arrangement's gap until 24px circles centred on the targets keep clear of each other. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
@@ -250,6 +256,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
250
256
  | `review/autocomplete-missing` | review | A text control whose name, id or type says what it collects states its autofill token (`autoComplete`, WCAG 1.3.5), so autofill and password managers fill it correctly; `autoComplete="off"` states that it must not be filled. ADS suggests the token from the literal attribute values, a heuristic. | Set `autoComplete` to the field's HTML autofill token (the message suggests one), or `"off"` when it must not be filled; on a public component, pass it through its `autoComplete` prop. Ignore this note when the suggestion is wrong. | `ads://guides/forms`, `ads://guides/accessibility` |
251
257
  | `review/boundary-identified-otherwise` | review | A text-entry control whose boundary is below 3:1 (WCAG 1.4.11) passes only with a human-approved `accessibility` declaration saying how it is identified otherwise; every such control is listed on every run, never silently. | Keep it only if a person approved it and the design still matches the reason. Otherwise make the control pass (a 3:1 fill, or one 3:1 border side such as a soft field's underline) and remove the declaration. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/forms` |
252
258
  | `review/click-without-keyboard` | review | An `onClick` on a non-interactive element (div, span, li, img and similar) without a 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. Items of composite widgets (option, menuitem, tab, row, gridcell, …) and backdrops whose handler reads `currentTarget` are exempt. | Use a <button> for the action, or give the element a role, tabIndex and a key handler; when a wrapping control already handles it, leave it. | `ads://guides/accessibility` |
259
+ | `review/decoration-under-text` | review | Text over a decoration is readable in every theme: the decoration lies under the construction's text, so its contrast depends on the artwork or pattern, which the static check cannot see through. A scenario that renders the owner lets the render audit measure it. | Cover the owner with a scenario so the render audit measures the text over the decoration in every theme; fade the decoration (a surface `mask`) where text lies. | `ads://guides/recipes`, `ads://guides/accessibility` |
253
260
  | `review/disabled-unshown` | review | A control that can be disabled looks disabled: an owner that declares a disabled state (`&:disabled` or `&[aria-disabled="true"]` in a `when`) paints it differently, through its surface (an `inactive` surface profile), its opacity or its artwork. A cursor or pointer change alone shows only under a pointer, after the person reached for the control. WCAG 2.2 exempts inactive controls from contrast minimums, not from being told apart. | Under `&:disabled`, select an `inactive` surface profile (or lower the opacity) so the disabled control is seen as unavailable. | `ads://guides/recipes`, `ads://guides/accessibility` |
254
261
  | `review/forced-state-fill-only` | review | A state the page means stays visible in forced colours, where backgrounds become Canvas and shadows are removed: a state surface that differs from the base only by fill declares `forcedColors`. | Declare `forcedColors` on that surface (a selection: `{ background: "Highlight", color: "HighlightText" }`), or show the state by a border, a mark or text as well. | `ads://guides/accessibility` |
255
262
  | `review/marker-none-unlabelled` | review | A summary without its disclosure marker shows its open state another way: artwork that changes with the owner's open state. | Render a chevron (a visual part or a public Icon) chosen by the controlled open state, or keep the native marker. | `ads://guides/recipes`, `ads://guides/accessibility` |
@@ -263,6 +270,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
263
270
  | `review/user-select-text` | review | `userSelect: "none"` belongs on handles and grips, which show no text: on an element that shows text (a text part or treatment, or text parts inside it) users cannot select or copy that text. | Move `userSelect: "none"` to the handle or grip part that starts the drag, or remove it; ignore this note when the text is a label of the handle itself. | `ads://guides/recipes`, `ads://guides/accessibility` |
264
271
  | `source/clamp-on-control` | error | A clamp (`lines`) cuts text off for sighted readers: never on a control or a form label (a button, label, legend, summary, select, option or text field) or on text inside one, whose text says what the control does. | Let the control's text wrap (remove `lines` and `wrap: "truncate"`), shorten the text, or clamp a description outside the control. | `ads://guides/recipes`, `ads://guides/accessibility` |
265
272
  | `source/control-name-missing` | error | A control without a text part in some reachable choice is named on its root by a non-empty `aria-label`, `aria-labelledby` or `title` in that choice (WCAG 2.2 4.1.2). Application text counts as a name, as it counts as content in a text part. | Set `aria-label` (or `aria-labelledby`) on the control's root to its name in every choice that renders only artwork, for example from the label prop the visible text would show. | `ads://guides/recipes`, `ads://guides/accessibility` |
273
+ | `source/decoration-exposed` | error | A decoration (`kind: "decoration"`) carries no meaning: its element is `aria-hidden="true"` and holds nothing a person can use. ADS writes it behind its parent's content and lets the pointer through. | Add `aria-hidden="true"` to the decoration's element; content that means something is a visual or text part, not a decoration. | `ads://guides/recipes`, `ads://guides/accessibility` |
266
274
  | `source/document-lang-missing` | error | The document pattern (`element: "document"`) renders `<html>` with its language (`lang`, WCAG 3.1.1), from a required prop. | Give the pattern a required `language` prop and render `<html lang={language}>`. | `ads://guides/recipes`, `ads://guides/accessibility` |
267
275
  | `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` |
268
276
  | `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` |
@@ -333,7 +341,7 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
333
341
  | `construction/spatial-bound-unit` | error | A breakpoint or named condition bound is a media or container query bound and is authored in rem or em, which follow the reader's text size; ADS writes it as authored and never converts px. | Write the token in rem (divide the px value by 16). | `ads://guides/layout`, `ads://guides/tokens` |
334
342
  | `construction/state-geometry-unsupported` | error | An owner state may select an element's geometry: another frame profile, another spacing profile, and whether a part is collapsed. The state's frame states every field the element's own frame writes; a listed geometry channel changes under some state; a `:hover` state has a focus or attribute state of the same geometry, so it is not for pointer users only; a collapsed part has no frame or arrangement of its own and sits in a stack or a row; a state's frame keeps the element's hit area; neighbouring targets do not overlap. | Give the element a frame before a state changes it; state every field in the state's frame profile; list only channels that change; repeat a hover state's geometry under `:focus-visible`, `:focus-within` or an attribute state; put a collapsible part's box on the one element it holds. | `ads://guides/recipes`, `ads://guides/layout` |
335
343
  | `construction/state-text-field` | error | A text profile selected under an owner state (`when: { state: { text } }`) changes the weight and the tracking only (`font-weight`, `letter-spacing`): the family, the size, the line height and every other text property stay the element's own, so the state moves neither the line nor the box's height. | Derive the state's text profile from the element's own (`extends`) and change only `weight` or `letterSpacing`; a different size or family is a different element or a recipe choice, not a state. | `ads://guides/recipes` |
336
- | `construction/surface-effect-misplaced` | error | A shadow that follows an element's shape is declared where it belongs. `shapeShadow` is a visual part's (an image, artwork, a glyph), which has nothing inside it. `groupShadow` is a container's choice: everything inside it casts one shadow. A surface declares at most one of them. `boxShadow` remains the shadow of an element's box and suits any rectangular or rounded element. A `mask` fades a drawing (a visual part) or the edge of an element that scrolls; on any other container its text would fade where it stands, and that cannot be proven readable. | On a visual part use `shapeShadow`; on a container use `boxShadow` for the shadow of its box, or `groupShadow` when one shadow for everything inside it is what you want. Put a `mask` on a visual part, or on an element whose `overflow` scrolls. Put `brightness` on a visual part (the picture itself). Give each element its own surface profile where they differ. | `ads://guides/recipes`, `ads://guides/tokens` |
344
+ | `construction/surface-effect-misplaced` | error | A shadow that follows an element's shape is declared where it belongs. `shapeShadow` is a visual part's (an image, artwork, a glyph), which has nothing inside it. `groupShadow` is a container's choice: everything inside it casts one shadow. A surface declares at most one of them. `boxShadow` remains the shadow of an element's box and suits any rectangular or rounded element. A `mask` fades a drawing (a visual part) or the edge of an element that scrolls; on any other container its text would fade where it stands, and that cannot be proven readable. | On a visual part use `shapeShadow`; on a container use `boxShadow` for the shadow of its box, or `groupShadow` when one shadow for everything inside it is what you want. Put a `mask` on a visual part, or on an element whose `overflow` scrolls. Put scrollbar colours and width on an element whose `overflow` scrolls, with the thumb and track together. Put `brightness` on a visual part (the picture itself). Give each element its own surface profile where they differ. | `ads://guides/recipes`, `ads://guides/tokens` |
337
345
  | `construction/surface-shadow-layer` | error | A `shapeShadow` or `groupShadow` token is one shadow layer in every theme and brand: two offsets, an optional blur and a colour. `filter: drop-shadow()` takes no second layer, no spread and no `inset`, and `none` is not a shadow to cast; a shadow token with those is for `boxShadow`. | Give the field its own shadow token with one layer and no spread, in every theme and brand, or use `boxShadow` for this shadow. | `ads://guides/tokens`, `ads://guides/recipes` |
338
346
  | `construction/vector-surface-unsupported` | error | A vector part's surface sets exactly one field, its stroke `color`. | Give the vector part a colour-only surface profile. | `ads://guides/recipes`, `ads://guides/pictograms` |
339
347
  | `contexts/declaration-rejected` | error | foundation.ads.ts is one literal foundation() declaration the design language accepts. | Correct the foundation declaration as the message describes. | `ads://guides/tokens`, `ads://guides/recipes` |
@@ -27,7 +27,7 @@ construction and owner code supplies behavior: these are different contracts.
27
27
  - Primitive and semantic describe a token's purpose, not role kinds. A folder
28
28
  name does not prove primitive status. The example design system uses
29
29
  `Foundation/spacing.ads.css` for primitive scale steps and functional groups
30
- (`Surfaces/` for paints, gradients, shadows, opacity, blur, saturation and brightness) for semantic
30
+ (`Surfaces/` for paints, gradients, shadows, opacity, blur, saturation, brightness, grayscale, invert and scrollbar widths) for semantic
31
31
  decisions.
32
32
  - A primitive must not depend on a semantic consumer. Semantic tokens compose
33
33
  primitives and other semantic tokens through the
@@ -71,7 +71,10 @@ construction and owner code supplies behavior: these are different contracts.
71
71
  `min-target-inline-size` / `min-target-block-size` lower to. `ads check`
72
72
  computes every control's target from its lowered box and hit region
73
73
  (24 × 24px) and rejects overlapping neighbouring hit regions
74
- (`a11y-target-size`; [the guide](GUIDE.md) has the details).
74
+ (`a11y-target-size`; [the guide](GUIDE.md) has the details). A region
75
+ part's own box (`frame: { profile }`) takes the same fields: its hit region
76
+ reaches past its box without moving layout (a menu trigger whose pointer
77
+ area spans the gap to the panel below it).
75
78
 
76
79
  ## Paint and effects: 5 roles
77
80
 
@@ -84,6 +87,9 @@ construction and owner code supplies behavior: these are different contracts.
84
87
  | `blur.ads.css` | Nonnegative length | Surface filter/backdrop blur radius | `--surface-backdrop-blur` |
85
88
  | `saturation.ads.css` | Nonnegative percentage; `100%` leaves colours unchanged, `0%` is greyscale | A surface's `backdropSaturate`: how vivid what is behind it appears | `--surface-backdrop-saturation` |
86
89
  | `brightness.ads.css` | Nonnegative percentage; `100%` leaves the drawing unchanged, lower dims it, `0%` is black | A surface's `brightness` on a visual part: a picture with no dark version, dimmed in the dark theme | `--image-brightness` |
90
+ | `grayscale.ads.css` | Nonnegative percentage; `0%` leaves the drawing's colours, `100%` is fully grey | A surface's `grayscale` on a visual part: colour artwork made quiet, or a logo prepared for inverting on a dark page | `--logo-grey` |
91
+ | `scrollbar-width.ads.css` | `auto`, `thin` or `none` | A surface's `scrollbarWidth` on an element that scrolls: how wide its scrollbar is drawn (`none` hides it; the element still scrolls) |
92
+ | `invert.ads.css` | Nonnegative percentage; `0%` leaves the drawing, `100%` inverts its tones | A surface's `invert` on a visual part: dark marks made for a light page shown light on a dark one | `--logo-invert` |
87
93
  | `overlap.ads.css` | Nonnegative length | A spacing profile's `overlap`: how far the neighbours of an `inline` or `stack` arrangement overlap, in place of a gap | `--facepile-overlap` |
88
94
  | `box-share.ads.css` | Nonnegative percentage of an element's own box on one axis | A spacing profile's `outsetBlock` / `outsetInline`: how far a layered backdrop is drawn past its box, growing with it | `--glow-outset-block` |
89
95
 
@@ -190,6 +196,7 @@ zoom and 320 px reflow).
190
196
  | `border-width`, `focus-offset`, `blur` | `px` | A hairline should stay a hairline |
191
197
  | `saturation` | `%` (`100%` unchanged, `0%` greyscale, above `100%` more vivid) | It scales colour, not length |
192
198
  | `brightness` | `%` (`100%` unchanged, below dims) | It scales light, not length |
199
+ | `grayscale`, `invert` | `%` (`0%` unchanged, `100%` fully grey or inverted) | They scale tone, not length |
193
200
  | `overlap` | `px` or `rem` | It is a share of a neighbour, sized like the neighbour |
194
201
  | `box-share` | `%` of the box on that axis | It grows with the box it is a share of |
195
202
  | `radius` | `px`, or `%` for a pill or circle | A corner belongs to the box, not to its text |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.5.9",
3
+ "version": "0.5.11",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {