@reqvire-org/ads 0.5.1 → 0.5.3
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 +143 -51
- package/dist/analysis/composition-axes.mjs +48 -0
- package/dist/analysis/construction-memo.mjs +38 -0
- package/dist/analysis/context.mjs +19 -0
- package/dist/analysis/design-reads.mjs +177 -0
- package/dist/analysis/design-usage.mjs +4 -20
- package/dist/analysis/factored-classes.mjs +90 -0
- package/dist/analysis/helpers.mjs +5 -7
- package/dist/analysis/mock-check.mjs +4 -5
- package/dist/analysis/native-project.mjs +12 -0
- package/dist/analysis/owner-accessibility.mjs +4 -4
- package/dist/analysis/owner-analysis-cache.mjs +86 -23
- package/dist/analysis/owner-analysis-key.mjs +42 -10
- package/dist/analysis/owner-choices.mjs +56 -7
- package/dist/analysis/owner-composition.mjs +179 -45
- package/dist/analysis/owner-reuse.mjs +8 -6
- package/dist/analysis/owner-source.mjs +304 -110
- package/dist/analysis/scenario-keys.mjs +10 -7
- package/dist/analysis/service.mjs +50 -3
- package/dist/analysis/standalone.mjs +7 -4
- package/dist/analysis/syntax.mjs +59 -1
- package/dist/analysis/worker-protocol.mjs +14 -2
- package/dist/analysis/worker.mjs +32 -10
- package/dist/architecture-report.mjs +26 -0
- package/dist/asset-view-facts.mjs +16 -2
- package/dist/boundaries.mjs +26 -10
- package/dist/bun-compiler.mjs +2 -2
- package/dist/check-service.mjs +29 -17
- package/dist/check.mjs +13 -6
- package/dist/cli.mjs +1 -1
- package/dist/composed-contrast.mjs +143 -62
- package/dist/composed-keyline.mjs +2 -2
- package/dist/config.mjs +2 -1
- package/dist/construction-output.mjs +9 -3
- package/dist/construction-spec.d.mts +145 -31
- package/dist/construction-spec.mjs +204 -74
- package/dist/corner-overpaint.mjs +20 -7
- package/dist/derived-states.mjs +182 -0
- package/dist/design-foundation.mjs +16 -0
- package/dist/design-inputs.mjs +18 -3
- package/dist/design-system-closure.mjs +12 -7
- package/dist/design-usage.mjs +2 -8
- package/dist/emit/contract.mjs +24 -5
- package/dist/emit/emission.mjs +6 -9
- package/dist/emit/integrity.mjs +8 -2
- package/dist/emit/output-watch.mjs +120 -0
- package/dist/emit/owner-emission-cache.mjs +4 -4
- package/dist/emit/preview-emitter.mjs +4 -2
- package/dist/emit/preview-tree.mjs +1 -1
- package/dist/emit/service.mjs +8 -2
- package/dist/finding-rules.mjs +3 -0
- package/dist/form-states.mjs +8 -0
- package/dist/frame-regions.mjs +29 -9
- package/dist/grid-lowering.mjs +3 -1
- package/dist/hover-geometry.mjs +15 -0
- package/dist/input-digests.mjs +17 -10
- package/dist/linaria/delivery.mjs +2 -0
- package/dist/lowering-enter.mjs +6 -6
- package/dist/lowering-properties.mjs +5 -0
- package/dist/lowering-region-layout.mjs +7 -2
- package/dist/lowering-session.mjs +10 -0
- package/dist/mcp/build-status.mjs +9 -1
- package/dist/mcp/compiler-channel.mjs +11 -4
- package/dist/mcp/mutations.mjs +1 -0
- package/dist/mcp/preview-http.bundle.js +1 -1
- package/dist/mcp/preview-watch.mjs +2 -1
- package/dist/mcp/preview-widget.bundle.js +1 -1
- package/dist/mcp/server-observation.mjs +6 -4
- package/dist/mcp/server-project.mjs +4 -1
- package/dist/motion-model.mjs +1 -1
- package/dist/owner-analysis-check.mjs +23 -6
- package/dist/owner-errors.mjs +6 -3
- package/dist/owner-lowering.mjs +78 -13
- package/dist/owner-scenarios.mjs +6 -23
- package/dist/ownership-model.mjs +24 -8
- package/dist/paint-contrast.mjs +6 -0
- package/dist/placeholder-contrast.mjs +17 -1
- package/dist/platform-features.mjs +10 -1
- package/dist/profile-macro.d.mts +7 -0
- package/dist/profile-view-facts.mjs +1 -1
- package/dist/recipe-macro.d.mts +103 -40
- package/dist/recipe-model.mjs +18 -13
- package/dist/region-lowering.mjs +266 -123
- package/dist/render-audit/layout-shift.page.mjs +24 -0
- package/dist/render-audit/render-states.mjs +122 -1
- package/dist/render-audit/render-states.page.mjs +140 -0
- package/dist/render-audit/worker.mjs +18 -3
- package/dist/render-audit.mjs +114 -1
- package/dist/role-vocabulary.d.mts +9 -0
- package/dist/role-vocabulary.mjs +16 -1
- package/dist/runtime-paint-contrast.mjs +5 -2
- package/dist/scenarios-compiler.mjs +20 -6
- package/dist/showcase/assets-view.mjs +29 -13
- package/dist/showcase/client.bundle.js +50 -50
- package/dist/showcase/http-client.bundle.js +15 -15
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +5 -5
- package/dist/skills/ads-designer/references/accessibility.md +10 -4
- package/dist/skills/ads-designer/references/branding.md +13 -3
- package/dist/skills/ads-designer/references/contracts.md +5 -2
- package/dist/skills/ads-designer/references/design-data.md +13 -7
- package/dist/skills/ads-designer/references/layout.md +12 -4
- package/dist/skills/ads-designer/references/motion.md +11 -2
- package/dist/skills/ads-designer/references/recipes.md +49 -15
- package/dist/skills/ads-import/references/contracts.md +5 -2
- package/dist/skills/ads-import/references/design-data.md +13 -7
- package/dist/skills/ads-import/references/layout.md +12 -4
- package/dist/skills/ads-import/references/recipes.md +49 -15
- package/dist/skills/ads-migrate/SKILL.md +2 -0
- package/dist/skills/ads-migrate/references/0.5.1-to-0.5.2.md +185 -0
- package/dist/skills/ads-migrate/references/0.5.2-to-0.5.3.md +71 -0
- package/dist/skills/ads-port/references/contracts.md +5 -2
- package/dist/skills/ads-port/references/design-data.md +13 -7
- package/dist/skills/ads-port/references/layout.md +12 -4
- package/dist/skills/ads-port/references/recipes.md +49 -15
- package/dist/spatial-model.mjs +2 -2
- package/dist/surface-contrast.mjs +7 -2
- package/dist/surface-effects.mjs +5 -3
- package/dist/target-size.mjs +21 -3
- package/dist/task-cache.mjs +8 -18
- package/dist/validation-checks.mjs +1 -1
- package/docs/ADS.md +9 -3
- package/docs/ARCHITECTURE.md +96 -30
- package/docs/CACHING.md +152 -24
- package/docs/CHANGELOG.md +307 -23
- package/docs/GUIDE.md +109 -20
- package/docs/LANGUAGE.md +262 -117
- package/docs/MCP.md +5 -1
- package/docs/MOTION.md +15 -4
- package/docs/PROFILE-KINDS.md +54 -4
- package/docs/RULES.md +34 -25
- package/docs/TOKEN-ROLES.md +7 -1
- package/package.json +1 -1
- package/dist/analysis/prose-owners.mjs +0 -57
- package/dist/prose-model.d.mts +0 -81
- package/dist/prose-model.mjs +0 -101
package/docs/PROFILE-KINDS.md
CHANGED
|
@@ -71,6 +71,7 @@ The example design system's detailed text specimen is `profiles/Typography/detai
|
|
|
71
71
|
| Field | Token role |
|
|
72
72
|
| --- | --- |
|
|
73
73
|
| `borderWidth`, `radius` | `border-width`, `radius` |
|
|
74
|
+
| `startStartRadius`, `startEndRadius`, `endStartRadius`, `endEndRadius` (region frames: one corner's radius in place of `radius`, such as a chat bubble's tail corner; a corner with neither is square) | `radius` |
|
|
74
75
|
| `padding`, `paddingInline`, `paddingBlock`, `minimumBlockInset` | `frame-inset` |
|
|
75
76
|
| `paddingInlineStart`, `paddingInlineEnd`, `paddingBlockStart`, `paddingBlockEnd` (container and control frames: one side's inset where the two sides of an axis differ; a side has one source, and on a control frame `minimumBlockInset` is the block axis's) | `frame-inset` |
|
|
76
77
|
| `inlineSize`, `blockSize`, `maxInlineSize`, `maxBlockSize` | `frame-size` |
|
|
@@ -85,6 +86,11 @@ The example design system's detailed text specimen is `profiles/Typography/detai
|
|
|
85
86
|
validated construction choices.
|
|
86
87
|
- Structural zero and relative sizing are valid. Shared design lengths come from
|
|
87
88
|
the appropriate roles.
|
|
89
|
+
- A stated `inlineSize` or `blockSize` is also the box's minimum on that axis,
|
|
90
|
+
so a fixed box keeps its size in a row or column beside content that could
|
|
91
|
+
push it (a disc beside long wrapping text). A stated `minInlineSize` or
|
|
92
|
+
`minBlockSize` replaces that minimum, and a stated `maxInlineSize` or
|
|
93
|
+
`maxBlockSize` leaves the box free to narrow on its axis.
|
|
88
94
|
- Frame geometry supplies target sizes; the interaction contract verifies the
|
|
89
95
|
actual hit region, which must not overlap another action or escape its
|
|
90
96
|
target's supported bounds.
|
|
@@ -107,6 +113,42 @@ the example design system (`tokens/Surfaces/shadow.ads.css`,
|
|
|
107
113
|
`profiles/Surfaces/surfaces.ads.ts`), `quiet-surface` binds the no-shadow token
|
|
108
114
|
and `emphasized-surface` a shared shadow.
|
|
109
115
|
|
|
116
|
+
### Contextual roles: `provides`
|
|
117
|
+
|
|
118
|
+
A surface may re-bind paint tokens for the subtree of every element that takes
|
|
119
|
+
it, its base or a state: `provides: { "<paint token>": "<paint token>" }`. A
|
|
120
|
+
child reads its own role as always and gets the container's value there; the
|
|
121
|
+
container never styles the child's elements. Use it for a colour that depends on
|
|
122
|
+
where an element sits:
|
|
123
|
+
|
|
124
|
+
| Container | Provides | So that |
|
|
125
|
+
| --- | --- | --- |
|
|
126
|
+
| A heading | `--link-ink` → its own ink | a link in a heading reads as the heading |
|
|
127
|
+
| A warning banner | `--link-ink`, `--icon-ink` → its on-warning ink | links and icons are readable on the tint |
|
|
128
|
+
| A selected row (its `when` state's surface) | text, icon and checkbox inks → its on-selected inks | the cells follow the selection with no prop |
|
|
129
|
+
| A dark card | `--action-fill`, `--focus-ring` → its on-dark values | its actions and their focus ring stay visible |
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
profile({ name: "banner-warning", kind: "surface", fields: { background: "--warning-fill", color: "--on-warning" }, provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" } });
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- Key and value are tokens of the `paint` role (`foundation/token-role`).
|
|
136
|
+
Sizes and spacing are not provided: density is a theme, brand or condition.
|
|
137
|
+
- Lowering writes them as custom properties on the element
|
|
138
|
+
(`.banner { --link-ink: var(--on-warning) }`), so CSS inheritance carries them.
|
|
139
|
+
- A provider under a state holds only with that state: the selected row's
|
|
140
|
+
on-selected ink is paired with its selected background, never the rest one.
|
|
141
|
+
- Composed contrast proves the text of everything placed inside with the
|
|
142
|
+
provided values on the provider's background, in every theme and brand; the
|
|
143
|
+
nearest provider wins.
|
|
144
|
+
- A surface that provides a token its own fields read would repaint itself:
|
|
145
|
+
`foundation/provided-role-self`.
|
|
146
|
+
|
|
147
|
+
Pick the pattern by where the difference comes from: a whole theme or brand
|
|
148
|
+
for a section of the page (`data-theme`/`data-brand` sections), a look the
|
|
149
|
+
caller chooses (a `tone` prop), a colour that follows the container
|
|
150
|
+
(`provides`).
|
|
151
|
+
|
|
110
152
|
### The border's line
|
|
111
153
|
|
|
112
154
|
`borderStyle` is a fixed choice, not a token: `"solid"` (the default),
|
|
@@ -154,6 +196,7 @@ effect fields into them in a fixed order, whatever order the profile states:
|
|
|
154
196
|
| `groupShadow` | `shadow` | One shadow cast by a container and everything in it | `filter: drop-shadow()` |
|
|
155
197
|
| `backdropBlur` | `blur` | Blurs what is behind the element | `backdrop-filter: blur()` |
|
|
156
198
|
| `backdropSaturate` | `saturation` | Makes what is behind the element more or less vivid | `backdrop-filter: saturate()` |
|
|
199
|
+
| `brightness` | `brightness` | Dims or brightens a drawing: a picture with no dark version, dimmed in the dark theme (the token is `100%` in light and lower in dark). A visual part's only: text under it could not be proven readable (`construction/surface-effect-misplaced`) | `filter: brightness()`, first in the list |
|
|
157
200
|
|
|
158
201
|
The element is blurred before its shadow is cast (`filter: blur() drop-shadow()`),
|
|
159
202
|
and the backdrop is blurred before it is saturated
|
|
@@ -292,10 +335,17 @@ its optical center.
|
|
|
292
335
|
|
|
293
336
|
## Spacing
|
|
294
337
|
|
|
295
|
-
Fields: `contentGap`, `labelGap`, `detailsGap`, `metaGap`,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
or `spacing`.
|
|
338
|
+
Fields: `contentGap`, `labelGap`, `detailsGap`, `metaGap`, `sectionGap` (the
|
|
339
|
+
space before a section's heading, a part's `spaceBefore` in a
|
|
340
|
+
[content flow](LANGUAGE.md#long-form-content-components-in-a-flow)) and `indent`,
|
|
341
|
+
each `content-gap` or `spacing`. `anchorGap` (`layout-size`, `content-gap` or `spacing`) is where a
|
|
342
|
+
jump to an element lands below the top of its scroll container
|
|
343
|
+
([`anchorClear`](LANGUAGE.md)). `overlap` (`overlap`, `content-gap` or
|
|
344
|
+
`spacing`) is how far the neighbours of an arrangement overlap in place of a
|
|
345
|
+
gap ([geometry by state](LANGUAGE.md#geometry-by-state)); a state selects
|
|
346
|
+
another spacing profile to change it. `outsetBlock` and `outsetInline` are how far a layered backdrop is
|
|
347
|
+
drawn past its box ([`outset`](LANGUAGE.md)): a `content-gap` or `spacing`
|
|
348
|
+
length, or a `box-share` percentage, which grows with the box.
|
|
299
349
|
|
|
300
350
|
- Gaps have a purpose: content to visual, label to control, name to detail,
|
|
301
351
|
between metadata runs, list items or sections. Inline and block axes can be
|
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: 434 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
|
|
|
@@ -16,19 +16,19 @@ Fix findings in group order: earlier groups are often the cause of later ones. T
|
|
|
16
16
|
| Order | Group | Rules | Kind | What it means | How to fix |
|
|
17
17
|
| --- | --- | --- | --- | --- | --- |
|
|
18
18
|
| 1 | [syntax](#syntax) | 11 | violated | The source does not parse or type-check. | Fix these first and accept again: analysis needs a valid program, and later errors may be consequences. |
|
|
19
|
-
| 2 | [unresolved-reference](#unresolved-reference) |
|
|
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
|
-
| 4 | [design-bypass](#design-bypass) |
|
|
22
|
-
| 5 | [structure-mismatch](#structure-mismatch) |
|
|
23
|
-
| 6 | [accessibility-semantics](#accessibility-semantics) |
|
|
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) | 37 | 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) | 72 | 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
|
-
| 9 | [conflict](#conflict) |
|
|
27
|
-
| 10 | [unanalyzable](#unanalyzable) |
|
|
28
|
-
| 11 | [unsupported](#unsupported) |
|
|
26
|
+
| 9 | [conflict](#conflict) | 40 | 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. |
|
|
27
|
+
| 10 | [unanalyzable](#unanalyzable) | 45 | unprovable | ADS cannot prove the rule holds; the design itself may be fine. | Rewrite into a form ADS can follow (literal unions, const records, typed props, JSX) without changing rendered behavior. |
|
|
28
|
+
| 11 | [unsupported](#unsupported) | 17 | unprovable | The construct is valid design that ADS does not support yet. | Use a supported alternative. If none fits, report the gap rather than working around the checks. |
|
|
29
29
|
| 12 | [rendered-check](#rendered-check) | 13 | violated | The rendered result breaks an accessibility, layout, contrast or performance requirement. | Inspect the failing scenario in its audit result or capture, then fix the owning style or markup; do not change the scenario to hide it. |
|
|
30
30
|
| 13 | [behavior-failed](#behavior-failed) | 4 | violated | A registered behavior guarantee failed or could not run. | Read the failing run with ads_results and ads_investigate, then fix the owner's behavior; keep the guarantee unless it is wrong. |
|
|
31
|
-
| 14 | [evidence-missing](#evidence-missing) |
|
|
31
|
+
| 14 | [evidence-missing](#evidence-missing) | 12 | rerun | Required evidence is absent or belongs to another revision. | Run the named check (ads_validate, ads_accept dryRun or the preview build) for the current revision; do not edit source to satisfy it. |
|
|
32
32
|
| 15 | [run-interrupted](#run-interrupted) | 12 | rerun | The run did not complete: it was cancelled, busy, or its inputs changed while it ran. | Wait for the other run or the edits to finish, then run again with the current revision. |
|
|
33
33
|
| 16 | [after-apply](#after-apply) | 7 | rerun | Source was published, but a follow-up step after it failed. | Do not accept the change again. Perform the named follow-up (rebuild the preview, regenerate assets, clean up the draft) and check the result. |
|
|
34
34
|
| 17 | [ads-defect](#ads-defect) | 16 | ads-defect | ADS produced inconsistent output; the project source is not at fault. | Stop. Do not rewrite source to avoid it; report it with the owner and the failing revision. |
|
|
@@ -71,7 +71,9 @@ The source names something that does not exist in this revision. Correct the nam
|
|
|
71
71
|
| `check/scenario-covers` | error | A scenario's covers is a nonempty static array, and every entry names a public UI export of the design system. | List the public UI exports the scenario renders in covers, by their exported names. | `ads://guides/scenarios` |
|
|
72
72
|
| `check/scenario-exercise-api` | error | Each exercises entry names a public behavioral API: a hook, controller, context provider or other callable or constructible export of the public barrel. | Name a public behavioral export in exercises (check the barrel's exports first), or remove the entry; rendered UI belongs in covers. | `ads://guides/scenarios`, `ads://guides/behaviors` |
|
|
73
73
|
| `check/source-unavailable` | error | Checked modules import only analysis inputs of this project, not files in assets.generatedPaths, nested projects, drafts or project metadata. | Import the source module instead, or remove the folder from assets.generatedPaths if it is source. | |
|
|
74
|
+
| `check/typescript-config-invalid` | error | ADS analyses the design system with the compiler options of the project's tsconfig.json and every configuration it extends, read from the checked revision; each of them parses, and every extends target it names by path is part of that revision. | Fix the reported configuration: correct its syntax or option, or point extends at a configuration file of this project (or an installed package). | |
|
|
74
75
|
| `choice/absent-property` | error | A design record is read only at properties it defines for every choice. | Add the property to the record for every choice, or read it with optional chaining where absence is intended. | `ads://guides/recipes` |
|
|
76
|
+
| `choice/part-ambiguous` | error | A part inside another part is read by its name, so the name belongs to one nested part of the recipe. | Give each nested part the owner reads its own name. | `ads://guides/recipes` |
|
|
75
77
|
| `choice/part-unknown` | error | A part is used only if the recipe spec declares it. | Declare the part in the recipe spec, or use one of the parts it already declares. | `ads://guides/recipes` |
|
|
76
78
|
| `choice/recipe-access-unsupported` | error | Recipe output is selected only through the variants and parts its spec declares. | Select recipe output only through the variants and parts its spec declares. | `ads://guides/recipes` |
|
|
77
79
|
| `construction/condition-unknown` | error | A part's `at` names a condition of the spatial profile its nearest recipe selects. | Select a spatial profile (a composite's `spatialProfile`) that declares the condition, or name one it declares. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
@@ -149,7 +151,6 @@ Styling or design values are supplied outside the design language. Take the valu
|
|
|
149
151
|
| `mock/hidden-definition` | error | A mock hides no design definitions in strings: no recipe or profile directives and no custom-property references. | Remove the definition; design belongs in owners, profiles and token sheets. | `ads://guides/scenarios`, `ads://guides/tokens` |
|
|
150
152
|
| `mock/imperative-design` | error | A mock writes no styles and creates no DOM imperatively. | Remove the imperative write; render owners with props. | `ads://guides/scenarios` |
|
|
151
153
|
| `mock/local-markup` | error | A mock's JSX renders what it imports from the design system (`@ds`), components and patterns alike: no native elements or local components laying out or wrapping them. | Render public owners directly; an arrangement the screen needs belongs in a pattern. | `ads://guides/scenarios`, `ads://guides/layout` |
|
|
152
|
-
| `mock/prose-element-undeclared` | error | Plain flow markup inside a prose owner (a component whose recipe has `layout: "prose"`) is that owner's content. Each element used there is one the recipe declares in `elements`; an element it does not declare would be drawn without a design. | Declare the element in the owner's prose recipe (`elements`), or write the content with the elements it declares. | `ads://guides/scenarios`, `ads://guides/recipes` |
|
|
153
154
|
| `rejection/profile-value-required` | error | Owner design comes from a profile, not from literals or tokens written in place. | Take the value from a profile field. | `ads://guides/recipes`, `ads://guides/tokens` |
|
|
154
155
|
| `source/class-expression-incomplete` | error | A className is built only from recipe outputs, at most one placement and declared asset bindings. | Remove free class strings and conditions; express the styling in the recipe. | `ads://guides/recipes`, `ads://guides/atomic-styles` |
|
|
155
156
|
| `source/css-in-js-import` | error | Styling exists only in owners, and owners style only through their recipes: no design-system file imports a CSS-in-JS package. | Remove the import and move the styling into a recipe in an owner. | `ads://guides/recipes`, `ads://guides/layers` |
|
|
@@ -181,14 +182,13 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
181
182
|
| `check/token-selector-invalid` | error | Token sheets declare tokens only in token contexts: :root, :root[data-theme="<name>"], :root[data-brand="<name>"] or both, directly or inside @media, @supports or @layer. A rule under any other selector forms no context: its values would be left out of every check and emitted as written. | Move the declaration into a :root, theme or brand rule (under @media or @supports for a condition); style a selector in a recipe instead. | `ads://guides/tokens` |
|
|
182
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` |
|
|
183
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` |
|
|
184
|
-
| `construction/artwork-binding-missing` | error | An artwork construction binds its visual part to a declared asset. | Bind the visual part to a declared asset. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
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` |
|
|
185
186
|
| `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` |
|
|
186
187
|
| `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` |
|
|
187
188
|
| `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` |
|
|
188
189
|
| `construction/layered-parts-missing` | error | A layered arrangement stacks at least two declared parts in one area. | Declare each layer as a part of the layered element, or use another layout. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
189
190
|
| `construction/measured-placement-missing` | error | A popover with `placement: "measured"` is anchored by the owner: its root declares at least one measured inset or `translate`. | Declare the measured position on the recipe root (`measured: { x: { type: "length", property: "inset-inline-start" }, y: { … "inset-block-start" } }`), or pin the popover to a viewport `corner`. | `ads://guides/recipes` |
|
|
190
191
|
| `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` |
|
|
191
|
-
| `construction/parts-visual-repeated` | error | A construction declares at most one visual part. | Declare a single visual part. | `ads://guides/recipes` |
|
|
192
192
|
| `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
193
|
| `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` |
|
|
194
194
|
| `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` |
|
|
@@ -197,7 +197,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
197
197
|
| `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` |
|
|
198
198
|
| `source/artwork-mismatch` | error | A visual part renders the drawing its binding selects. | Render the drawing selected by the binding; do not swap in another asset or literal markup. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
199
199
|
| `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` |
|
|
200
|
-
| `source/cell-missing-or-repeated` | error | Each declared grid cell renders exactly once. | Render
|
|
200
|
+
| `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` |
|
|
201
201
|
| `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` |
|
|
202
202
|
| `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` |
|
|
203
203
|
| `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` |
|
|
@@ -208,7 +208,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
208
208
|
| `source/layer-in-grid-cell` | error | A top-layer root is not a grid cell: whenever it is open it leaves the grid for the top layer. | Render the layer root as an uncelled child (or outside the grid), and keep an in-track alternative as its own cell. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
209
209
|
| `source/markers-shared` | error | One element carries one part or cell marker; distinct markers are lowered as distinct elements. | Use one element per declared part or cell; wrap to separate them. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
210
210
|
| `source/part-element-mismatch` | error | A region or part that declares a native element renders that element (an input of the declared type), and a vector part is an SVG shape directly under an owned `<svg>`. | Render the declared element for this part, or declare the element it actually renders. | `ads://guides/recipes` |
|
|
211
|
-
| `source/part-missing-or-repeated` | error | Each declared part renders exactly once per choice; optional parts are declared as not required. | Render the part exactly once per choice,
|
|
211
|
+
| `source/part-missing-or-repeated` | error | Each declared part renders exactly once per choice; optional parts are declared as not required, and a part rendered once per item of a list (`items.map(…)`) is declared `repeat: true`. | Render the part exactly once per choice, mark it as not required in the spec, or declare it `repeat: true` when it renders once per item of a list. | `ads://guides/recipes` |
|
|
212
212
|
| `source/part-selector-unresolved` | error | Every declared part is rendered by an element carrying the part's marker. | Mark the element that renders the part with the part's declared selector. | `ads://guides/recipes`, `ads://guides/contracts` |
|
|
213
213
|
| `source/placement-repeated` | error | An element has at most one placement. | Give each element exactly one placement; combine positions into one placement value. | `ads://guides/layout` |
|
|
214
214
|
| `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` |
|
|
@@ -218,7 +218,7 @@ Rendered markup does not match what its declaration promises. Make the markup ma
|
|
|
218
218
|
| `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` |
|
|
219
219
|
| `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` |
|
|
220
220
|
| `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` |
|
|
221
|
-
| `source/visual-binding-count` | error | A
|
|
221
|
+
| `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` |
|
|
222
222
|
|
|
223
223
|
## accessibility-semantics
|
|
224
224
|
|
|
@@ -231,16 +231,17 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
|
|
|
231
231
|
| `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` |
|
|
232
232
|
| `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` |
|
|
233
233
|
| `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` |
|
|
234
|
-
| `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 profile nothing uses, one a slot supplies, the document surface, and one the recipe also names for a pseudo-element, a
|
|
234
|
+
| `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` |
|
|
235
235
|
| `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` |
|
|
236
|
+
| `construction/artwork-paint-contrast-insufficient` | error | A control's artwork with paint slots stays recognizable on the control: in every theme, brand and state, at least one of its paints reaches 3:1 against the control's own background (WCAG 1.4.11). A drawing with its own colours (`paint: "intrinsic"`, a product's logo) is not checked. | Give the drawing one paint that reaches 3:1 on that background in that context (an outline or a darker fill), or adjust the token's value there. | `ads://guides/pictograms`, `ads://guides/accessibility`, `ads://guides/tokens` |
|
|
236
237
|
| `construction/inactive-surface-active` | error | A surface profile declaring `state: "inactive"` paints a disabled control: it has no contrast minimum (WCAG 2.2 1.4.3 exempts inactive components), so a construction selects it only under an inactive owner state (`:disabled`, `[aria-disabled="true"]`), never at rest or under another state. | Select it under `&:disabled` or `&[aria-disabled="true"]`, or use a surface without `state: "inactive"` (which is held to the contrast minimum). | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
237
238
|
| `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` |
|
|
238
239
|
| `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` |
|
|
239
240
|
| `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` |
|
|
240
|
-
| `construction/
|
|
241
|
-
| `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): 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` |
|
|
241
|
+
| `construction/progress-contrast-insufficient` | error | A progress bar's fill has at least 3:1 contrast against its track, the part's own background, in every theme, brand and state (WCAG 1.4.11). | 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` |
|
|
242
|
+
| `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` |
|
|
242
243
|
| `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` |
|
|
243
|
-
| `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. | Raise the frame profile's min-block-size, padding-inline or the visual size in that context,
|
|
244
|
+
| `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` |
|
|
244
245
|
| `review/accessibility-declaration-unnecessary` | review | An `accessibility` declaration covers a control that cannot pass 3:1; on a control whose boundary or fill already passes it is stale. | Remove the declaration. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
245
246
|
| `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` |
|
|
246
247
|
| `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` |
|
|
@@ -284,7 +285,7 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
|
|
|
284
285
|
| --- | --- | --- | --- | --- |
|
|
285
286
|
| `assets/set-member-paint` | error | Glyph set members are foreground artwork (paint "foreground"): the owner's text colour paints every member alike. | Bind slot or intrinsic artwork by name in its own recipe; keep the set to foreground glyphs. | `ads://guides/pictograms` |
|
|
286
287
|
| `check/a11y-focus` | error | Focus stays visible (WCAG 2.2 2.4.7, 1.4.11). Every focus profile's width resolves to at least 2 CSS px in every context (theme, brand, brand under theme and condition; relative widths at the 16px reference root), and the document's default indicator (foundation({ focus }), which foundation.css paints on every :focus-visible element a construction does not style) has 3:1 contrast with the document surface's background in every context. | Raise the focus profile's width token to 2px or more, or choose a focus colour token that reaches 3:1 on the document surface in the named context. | `ads://guides/accessibility` |
|
|
287
|
-
| `check/a11y-target-size` | error | Pointer targets are at least 24 × 24 CSS px (WCAG 2.2 2.5.8): every control construction and every frame: "control" part, computed from its lowered box in every theme, brand and condition (relative lengths at the 16px reference root), its enlarged hit area included; neighbouring hit areas in a stack or inline arrangement do not overlap. | Raise the frame profile's min-block-size, padding-inline or visual size in that context, or declare a min-target-inline-size / min-target-block-size hit area of at least 24px; widen the gap between overlapping hit areas. | `ads://guides/accessibility` |
|
|
288
|
+
| `check/a11y-target-size` | error | Pointer targets are at least 24 × 24 CSS px (WCAG 2.2 2.5.8): every control construction and every frame: "control" part, computed from its lowered box in every theme, brand and condition (relative lengths at the 16px reference root), its enlarged hit area included, or a smaller part spaced from its neighbouring targets so that 24px circles centred on them keep clear (the spacing exception); neighbouring hit areas in a stack or inline arrangement do not overlap. | Raise the frame profile's min-block-size, padding-inline or visual size in that context, or declare a min-target-inline-size / min-target-block-size hit area of at least 24px; widen the gap between overlapping hit areas. | `ads://guides/accessibility` |
|
|
288
289
|
| `check/a11y-text-resize` | error | Text follows the reader's font size (WCAG 2.2 1.4.4): every font-size token, and every line-height token that is a length, resolves in every context to rem or em (or a calc(), min(), max() or clamp() containing them); a unitless line-height multiplier already scales. | Rewrite the named token in rem (px / 16) or em; for a line height, a unitless multiplier also works. | `ads://guides/accessibility` |
|
|
289
290
|
| `check/app-icon-asset` | error | The asset foundation({ appIcon }) names is declared, has paint "intrinsic" (browsers, launchers and app stores cannot read CSS variables), is one scalable drawing and has a square viewBox; appIcon.background is a paint-role token that resolves to an opaque colour in the default theme and brand. | Name a declared intrinsic asset with a square viewBox (centre the artwork in it), and give background an opaque paint token. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
290
291
|
| `check/app-icon-export` | error | Each appIcon export writes an .svg copy, a .png (size, or width and height), an .ico (sizes up to 256) or an .icns (sizes 16, 32, 64, 128, 256, 512, 1024) of a declared intrinsic asset, at a path inside the output folder that ADS does not write itself and no other export writes; sizes are 16–2048 px, and a background is an opaque paint-role token. | Fix the entry's file, sizing, asset or background as the message says. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
@@ -313,18 +314,18 @@ A value has the wrong kind, role or range for where it is used. Choose one of th
|
|
|
313
314
|
| `construction/grid-context-invalid` | error | A grid's algebra holds in every theme, brand and condition context, like contrast and target size: a context that changes a margin, gutter, maximum width or fixed track the grid reads must still leave content width, fluid space and cells wider than their gutter insets at every breakpoint. | Change the named context's token value so the grid fits there too, or the grid's columns, bound or placement. | `ads://guides/layout`, `ads://guides/tokens` |
|
|
314
315
|
| `construction/layer-clearance-unbounded` | error | A layer clears a block-start region by a fixed length: `clear-block-start` resolves to a px, rem or em layout size. | Give the cleared region a fixed block size token and clear by it, or declare `clear: "none"` and let the panel cover that region. | `ads://guides/recipes`, `ads://guides/tokens` |
|
|
315
316
|
| `construction/paint-transition-redundant` | error | A paint transition names only channels that change: each differs between the element's base surface and at least one of its state surfaces. | Remove the channel from `paintTransition.channels`, or give a state surface a different value for it. | `ads://guides/recipes` |
|
|
316
|
-
| `construction/paint-unsupported` | error | Artwork is painted only through channels its asset declares. | Use a paint channel the asset declares, or declare the channel on the asset. | `ads://guides/pictograms`, `ads://guides/contracts` |
|
|
317
317
|
| `construction/paint-value-role` | error | A runtime paint's values (and its fallback) are paint-role tokens: never a raw colour, a URL or a token of another role. | Declare the colour as a token in a `paint.ads.css` sheet (with its theme and brand values) and list that token. | `ads://guides/recipes`, `ads://guides/tokens` |
|
|
318
318
|
| `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` |
|
|
319
319
|
| `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` |
|
|
320
|
-
| `construction/pseudo-surface-unsupported` | error | A pseudo-element surface sets exactly one field
|
|
320
|
+
| `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` |
|
|
321
321
|
| `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` |
|
|
322
322
|
| `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` |
|
|
323
323
|
| `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` |
|
|
324
324
|
| `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` |
|
|
325
325
|
| `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` |
|
|
326
|
+
| `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` |
|
|
326
327
|
| `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` |
|
|
327
|
-
| `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. Give each element its own surface profile where they differ. | `ads://guides/recipes`, `ads://guides/tokens` |
|
|
328
|
+
| `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` |
|
|
328
329
|
| `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` |
|
|
329
330
|
| `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` |
|
|
330
331
|
| `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` |
|
|
@@ -387,12 +388,15 @@ Two definitions claim the same thing, or a definition depends on itself. Keep ex
|
|
|
387
388
|
| `fonts/family-duplicate` | error | Each font family is declared once in the design system, by one font() declaration; family names compare as CSS compares them (ASCII case-insensitively), and two families never share an emitted folder (fonts/<slug>). | Declare every face of the family in one font() declaration, or rename one family. | `ads://guides/performance` |
|
|
388
389
|
| `foundation/profile-argument-default` | error | A profile's slot reference selects only choices that differ from the referenced profile's defaults: the plain name already selects every default. | Remove the redundant selection (reference the profile by its plain name when no other choice remains). | `ads://guides/recipes` |
|
|
389
390
|
| `foundation/profile-duplicate` | error | Profile names are unique across the foundation. | Give each profile a unique name, or merge the declarations. | `ads://guides/recipes` |
|
|
391
|
+
| `foundation/provided-role-self` | error | A surface profile's `provides` re-binds tokens for the subtree of the element that takes it, the element itself included: a surface that provides a token its own fields read would repaint itself with the provided value. | Read another token in the surface's own fields, or provide a role the surface itself does not read (a link ink, an icon ink). | `ads://guides/tokens`, `ads://guides/recipes` |
|
|
390
392
|
| `registration/alias-definition` | error | A registered token is defined by a concrete value, not as an alias of another token. | Define it with a concrete value, or remove the registration. | `ads://guides/tokens` |
|
|
391
393
|
| `registration/anonymous-layer` | error | Token CSS uses named layers; each anonymous layer is a distinct layer. | Name the @layer, or remove it. | `ads://guides/tokens`, `ads://guides/atomic-styles` |
|
|
392
394
|
| `registration/definition-mismatch` | error | A registered token's :root definition equals its registered initial value. | Make the :root definition and the @property initial-value equal. | `ads://guides/tokens` |
|
|
393
395
|
| `registration/duplicate` | error | A token is registered once. | Keep one registration. | `ads://guides/tokens` |
|
|
394
396
|
| `registration/not-beside-token` | error | A token is registered in the file that defines it, so the definition and its registration change together. | Move the registration into the file that defines the token. | `ads://guides/tokens` |
|
|
395
397
|
| `rejection/redundant-design-declaration` | error | A declaration states only what its default or input does not already provide. | Remove the declaration. | `ads://guides/recipes` |
|
|
398
|
+
| `review/hover-geometry-shift` | review | Geometry an element in flow takes under `:hover` (another frame or spacing profile, a part that opens) moves what follows it whenever the pointer passes over it. ADS accepts it as the designer's choice and lists it for review; a layer of a layered parent draws over its neighbours instead and is not listed. | Keep it when the movement is wanted (a pile that spreads and pushes what follows). Otherwise draw the change over its neighbours: a layer of a layered parent, an outset backdrop, or a translate or scale effect, which move nothing else. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
399
|
+
| `review/optional-cell-row` | review | A grid cell that may be absent (`required: false`) and is pinned to a row (`row`) leaves that row empty whenever it is absent: the row's track and the gaps around it stay. ADS accepts it as the designer's choice and lists it for review. | Keep it when the empty row is wanted. Otherwise place the cell in auto rows (omit `row`), so the cells after it move up when it is absent. | `ads://guides/recipes` |
|
|
396
400
|
| `source/glyph-grid-mixed` | error | Every asset a reference binding can receive shares one grid (viewBox, optical center and minimum drawn height), so one construction draws them all. | Draw the glyphs on one viewBox with one optical center, or accept them through separate props or owners. | `ads://guides/pictograms` |
|
|
397
401
|
| `source/layer-modal-context` | error | A modal sheet's `modalQuery` is a viewport media query, so the owner's layout swaps at viewport tiers too: no grid of the same owner responds to a container. | Use `context: "viewport"` for the owner's grids, or keep the sheet modal at every size (no `modalBelow`). | `ads://guides/recipes`, `ads://guides/layout` |
|
|
398
402
|
| `source/local-name-collision` | error | Names of the form compiledClassN are reserved for ADS's emitted output. | Rename the local identifier. | `ads://guides/recipes` |
|
|
@@ -418,9 +422,9 @@ ADS cannot prove the rule holds; the design itself may be fine. Rewrite into a f
|
|
|
418
422
|
| `check/token-type-unresolved` | review | A token's value shape is proven statically in every context; a value ADS cannot read (calc() mixing units for a bounded role, an unknown function, currentColor, a context-only token unavailable here) is reviewed, never treated as checked. A nowhere-declared reference instead has the primary token-css/token-missing error. | Prefer a literal of the role's shape or an alias of one; when the expression is deliberate, check its value by hand in the named context. | `ads://guides/tokens` |
|
|
419
423
|
| `choice/binding-not-immutable` | error | Design is selected from const bindings, component props or the element of a `.map` over a literal array. | Use a const declaration initialized in place, a component prop, or the element of a `.map` over a literal array. | `ads://guides/recipes` |
|
|
420
424
|
| `choice/binding-written` | error | Values that select design are immutable after declaration, so one declaration describes every use. | Declare it with const and derive new values into new bindings instead of reassigning. | `ads://guides/recipes` |
|
|
421
|
-
| `choice/branch-limit` | error | Choice analysis is bounded; a selection must stay small enough to be checked completely. |
|
|
425
|
+
| `choice/branch-limit` | error | Choice analysis is bounded; a selection must stay small enough to be checked completely. | Every listed value multiplies the combinations checked. Make fewer of them select styling or markup together: replace conditional chains with one lookup over a const record keyed by the selecting value, merge props that always change together, or move a part with its own props into its own owner. | `ads://guides/recipes` |
|
|
422
426
|
| `choice/construction-limit` | error | An owner lowers a bounded number of distinct constructions. | Collapse equivalent combinations, or move independent variation into separate parts so constructions do not multiply. | `ads://guides/recipes`, `ads://guides/performance` |
|
|
423
|
-
| `choice/domain-not-finite` | error | Design is selected from a finite set of choices ADS can enumerate, so every rendered combination can be checked. | Type the selecting prop or variable as a literal union (or a const record key) so every choice can be enumerated. An optional object, callback or node prop selects by whether it is given: test a node (or any type that admits text, a number or a boolean) with `!== undefined`, never by truthiness. | `ads://guides/recipes`, `ads://guides/atomic-styles` |
|
|
427
|
+
| `choice/domain-not-finite` | error | Design is selected from a finite set of choices ADS can enumerate, so every rendered combination can be checked. | Type the selecting prop or variable as a literal union (or a const record key) so every choice can be enumerated. A decision made from data (a count, an element, a lookup) is named as design state: `const overflow: "fits" \| "overflows" = members.length > 3 ? …`, or `const fourth: Member \| undefined = members[3]`. An optional object, callback or node prop selects by whether it is given: test a node (or any type that admits text, a number or a boolean) with `!== undefined`, never by truthiness. | `ads://guides/recipes`, `ads://guides/atomic-styles` |
|
|
424
428
|
| `choice/evidence-not-local` | error | Design evidence comes from the owner's source or the design system's own modules. | Bring the value into the owner's source as a const or prop, or import it from the design system's own modules. | `ads://guides/recipes`, `ads://guides/layers` |
|
|
425
429
|
| `choice/key-not-literal` | error | Design records are indexed by literal or finite union-typed keys. | Index design records with a literal union-typed value (for example a variant prop), not an arbitrary string. | `ads://guides/recipes` |
|
|
426
430
|
| `choice/property-unresolved` | error | Design values resolve to literals or const references inside the design system. | Make the property a literal or a const reference ADS can follow within the design system. | `ads://guides/recipes` |
|
|
@@ -430,6 +434,7 @@ ADS cannot prove the rule holds; the design itself may be fine. Rewrite into a f
|
|
|
430
434
|
| `choice/work-limit` | error | Choice analysis is bounded; a selection must stay small enough to be checked completely. | Reduce how many independent axes combine in one class expression; split the selection into smaller recipes or parts. | `ads://guides/recipes` |
|
|
431
435
|
| `construction/drawn-height-unevaluable` | error | Artwork size resolves to a fixed length at the reference root, so its minimum drawn height can be checked. | Size the artwork with tokens that resolve to fixed lengths at the reference root. | `ads://guides/branding`, `ads://guides/pictograms` |
|
|
432
436
|
| `construction/placeholder-contrast-unresolved` | error | Placeholder contrast is proven from tokens: the placeholder colour and the part's own background resolve to opaque colours in every theme, brand and state. | Give the part a surface with an opaque background colour token, and a placeholder colour that resolves to a colour token in every context. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
|
|
437
|
+
| `construction/progress-contrast-unresolved` | error | A progress bar's contrast is proven from tokens: the fill and the track resolve to opaque colours in every theme, brand and state. | Give the part a surface with an opaque background colour token for its track, and the fill a surface whose background resolves to a colour token in every context. | `ads://guides/recipes`, `ads://guides/accessibility`, `ads://guides/tokens` |
|
|
433
438
|
| `discovery/export-star` | error | The public barrel names each public owner; `export *` hides which owners are public. | Replace `export *` with named re-exports of each public owner. | `ads://guides/contracts` |
|
|
434
439
|
| `mock/dynamic-dependency` | error | A mock's code is static: no `import()`, `require`, `eval`, `Function` or tagged templates. | Import statically and pass plain values as props. | `ads://guides/scenarios` |
|
|
435
440
|
| `mock/spread-props` | error | A mock passes explicit props: a spread could carry design ADS cannot see. | Pass each prop explicitly. | `ads://guides/scenarios` |
|
|
@@ -465,6 +470,7 @@ The construct is valid design that ADS does not support yet. Use a supported alt
|
|
|
465
470
|
| `construction/measured-property-unsupported` | error | A measured value sets one geometry property of its type's closed list: a `length` a logical inset or box size (inline/block size and their min/max) on a region root or top-level part, a `transform` `translate`, a `size-track` one track of a grid's own `grid-template-columns`/`-rows`. An `intrinsic-size` sets `inline-size` on a contained application image (`fit: "contain"`). A `position` sets `object-position` on a cropped application image (a visual part whose visual profile declares `fit: "cover"`). Padding, margin, gap, typography, borders, radius and paint are design values; a top-layer root is positioned by measured values only with `placement: "measured"`. | Measure a property of the closed list (`inset-*`, `inline-size`, `block-size` and their min/max, `translate`, a grid track that exists in every tier); declare `placement: "measured"` for an element-anchored popover; move design values to profiles. | `ads://guides/recipes`, `ads://guides/layout` |
|
|
466
471
|
| `construction/paint-property-unsupported` | error | A runtime paint sets one property of the closed paint list (`fill`, `stroke`, `color`, `background-color`, `border-color`), once per element: backgrounds as images, gradients, outlines and shadows are design values. | Paint `fill`, `stroke`, `color`, `background-color` or `border-color`, one paint per property and element; keep other paint values in surface profiles. | `ads://guides/recipes`, `ads://guides/tokens` |
|
|
467
472
|
| `construction/paint-transition-effect-unsupported` | error | What changes between a transitioned element's surfaces interpolates. A gradient image never does, so such an element has none. A surface effect does through its own channel: `filter` for `blur`, `shapeShadow` and `groupShadow`, `backdrop-filter` for `backdropBlur` and `backdropSaturate`. An effect that changes between the surfaces without its channel listed would snap while the paints transition. | Add `filter` or `backdrop-filter` to the transition's `channels` for an effect that changes, use surfaces without a gradient image on a transitioned element, or remove its paint transition. | `ads://guides/recipes` |
|
|
473
|
+
| `construction/space-parent-unsupported` | error | A part states its own space before or after (`spaceBefore`, `spaceAfter`) only in a `stack`, where it replaces the stack's gap on that side, or in the block flow of a parent without an arrangement (a list item); the larger of one part's space after and the next part's space before applies. | Arrange the parent as a stack, or remove `spaceBefore` / `spaceAfter` (an inline row or a grid spaces its children evenly). | `ads://guides/recipes`, `ads://guides/layout` |
|
|
468
474
|
| `construction/spatial-clause-unsupported` | error | Layouts are expressed with the supported spatial clauses. | Express the layout with the supported spatial clauses. | `ads://guides/layout` |
|
|
469
475
|
| `lowering/tree-unsupported` | error | Owner styling uses CSS constructs ADS can lower. | Rewrite the construct with supported styling, or report the missing support. | `ads://guides/atomic-styles` |
|
|
470
476
|
| `registration/wrapper-unsupported` | error | @property registrations sit at the top level or inside @media, @supports or @layer. | Move the registration to the top level. | `ads://guides/tokens`, `ads://guides/atomic-styles` |
|
|
@@ -514,8 +520,11 @@ Required evidence is absent or belongs to another revision. Run the named check
|
|
|
514
520
|
| `check/generated-stale` | info | The emitted output folder's ads-contract.json records the source revision it was emitted from; while that is not the design system's current revision, the output is out of date. Never blocking: with compile.emitOnAccept false it is intended until the next emit. | Run `ads emit` to refresh the output folder from the current source. | `ads://guides/layers` |
|
|
515
521
|
| `check/owner-analysis-blocked` | info | An owner whose analysis needs another owner's public rows (a grid's alignRows on that owner's component) is analyzed only after that owner analyzes: rows of a failed owner are unknown, so ADS does not guess them. | Fix the owner-analysis error of the owner the finding names in blockedBy and check again; the blocked owner is then analyzed. Do not change the blocked owner for this note. | `ads://guides/validation` |
|
|
516
522
|
| `check/palette-generated` | error | foundation.ads.ts declares the generated palette module (`palette: true`) exactly when the design system keeps palette.generated.ts, and a declared module matches what ADS derives from the token sheets' paint tokens and the declared themes and brands; it is never edited by hand. | Run `ads sync` to create or regenerate a declared module (editing directly), or accept the change through a draft, which does it in the candidate; for a module present without the declaration, add `palette: true` to the foundation or delete the file. Change the token sheets or foundation.ads.ts, never the module. | `ads://guides/tokens` |
|
|
523
|
+
| `check/render-audit-construction-unrendered` | review | The audit measures every owner state a construction declares on the elements the scenarios render (`derived` in the audit's coverage). A construction with states that no audited scenario renders is listed by owner and classes: what its states do once laid out is unmeasured. | Render that variant in a scenario of its owner (or of a pattern that holds it), with the props that select it; its states are then measured without anything more. | `ads://guides/accessibility`, `ads://guides/validation` |
|
|
517
524
|
| `check/render-audit-nothing-measured` | review | A render assigned overlay or control targets measures at least one of them; when every attempt to open or hover failed (gone, timeout, detached, failed), that render's interactive states are unverified. | Make the scenario's controls stable while it renders (no unmounting, covering or re-rendering of triggers) and run the audit again. | `ads://guides/accessibility` |
|
|
518
525
|
| `check/render-audit-skipped` | info | The audit opens overlays and hovers/focuses controls to measure their states; targets it could not reach are listed by reason, and their states are unmeasured rather than passed. | Usually none; if a target matters, make it reachable in the scenario (an aria-haspopup trigger that opens a dialog/menu/listbox and closes on Escape, a page that settles within 5 s) or split a scenario that exceeds the 3-overlay/6-control limit. | `ads://guides/accessibility` |
|
|
526
|
+
| `check/render-audit-state-derivable` | info | A scenario state that only shows an attribute state of an owner rendered elsewhere is measured by the audit without it: the audit derives the state from the recipe. | Usually none. Remove the scenario state when it exists only for the audit and nobody needs to see it in the showcase; keep it when the component renders other content in that state. | `ads://guides/validation` |
|
|
527
|
+
| `check/render-audit-state-forced` | review | The audit measures an attribute state by setting the attribute. Where owner analysis proves that the prop which sets that attribute also changes the owner's markup, the audit measured the state's CSS over the content at rest: what the component really shows in that state is unmeasured until a scenario renders it. | Add a scenario specimen or state that renders the owner with that prop set; the item clears when a render shows the state for real. | `ads://guides/accessibility`, `ads://guides/validation` |
|
|
519
528
|
| `check/test-registration` | error | A behaviour spec (a `*.behavior.spec.*` file, or a test file tagging a case `@ads:<case>`) is named by its owner's behaviour registration: ADS runs a spec's cases only as registered checks. | Register the spec's cases as checks in the owner's <Owner>.ads.behavior.ts, or remove the spec (or its @ads: tags). | `ads://guides/behaviors` |
|
|
520
529
|
| `check/validation-inputs` | error | A validation result is current only when ADS can re-read its inputs after the run and match the captured revision; failing to read them leaves the result unestablished. | Fix the error the message names (usually configuration or a declared validation.inputs path), then validate again. | `ads://guides/validation` |
|
|
521
530
|
| `check/validation-previews` | error | Validation requires a current verified production preview for every registered scenario; a successful build command alone is not enough. | Wait for the named scenario's preview to become current (ads_status.build), then validate again. | `ads://guides/validation`, `ads://guides/runtimes` |
|
package/docs/TOKEN-ROLES.md
CHANGED
|
@@ -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 and
|
|
30
|
+
(`Surfaces/` for paints, gradients, shadows, opacity, blur, saturation and brightness) 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
|
|
@@ -83,6 +83,9 @@ construction and owner code supplies behavior: these are different contracts.
|
|
|
83
83
|
| `opacity.ads.css` | Number in [0, 1] | Surface/effect opacity and declared motion endpoints | `--surface-translucency` |
|
|
84
84
|
| `blur.ads.css` | Nonnegative length | Surface filter/backdrop blur radius | `--surface-backdrop-blur` |
|
|
85
85
|
| `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
|
+
| `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` |
|
|
87
|
+
| `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
|
+
| `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` |
|
|
86
89
|
|
|
87
90
|
- A gradient is not an arbitrary CSS image: asset URLs belong to asset
|
|
88
91
|
declarations.
|
|
@@ -186,6 +189,9 @@ zoom and 320 px reflow).
|
|
|
186
189
|
| `visual-size` | `rem` for icons beside text; `px` for pictures | An icon belongs to its label's size; a picture must still fit a narrow region when text is enlarged |
|
|
187
190
|
| `border-width`, `focus-offset`, `blur` | `px` | A hairline should stay a hairline |
|
|
188
191
|
| `saturation` | `%` (`100%` unchanged, `0%` greyscale, above `100%` more vivid) | It scales colour, not length |
|
|
192
|
+
| `brightness` | `%` (`100%` unchanged, below dims) | It scales light, not length |
|
|
193
|
+
| `overlap` | `px` or `rem` | It is a share of a neighbour, sized like the neighbour |
|
|
194
|
+
| `box-share` | `%` of the box on that axis | It grows with the box it is a share of |
|
|
189
195
|
| `radius` | `px`, or `%` for a pill or circle | A corner belongs to the box, not to its text |
|
|
190
196
|
| `frame-size` | `rem`, `%`, or a viewport unit for a full-height frame | It depends on what the frame must fit |
|
|
191
197
|
| `layout-size` | `rem` for breakpoints and named condition bounds (enforced); `px` or `rem` for fixed tracks and maximum widths | A breakpoint is a media or container query bound, written as authored: in `rem` it follows the reader's text size, so larger text gets the narrower layout sooner. A `px` bound is an error (`spatial-profile-invalid` for a breakpoint, `construction/spatial-bound-unit` for a condition), never converted |
|
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { isCallExpression, isExportDeclaration, isIdentifier, isNamedExports, isObjectLiteralExpression, isPropertyAssignment, isStringLiteral } from "typescript/ast";
|
|
3
|
-
import { PROSE_ELEMENT_NAMES, proseContentTags } from "../prose-model.mjs";
|
|
4
|
-
import { inRevision, sourceAst } from "./helpers.mjs";
|
|
5
|
-
import { PUBLIC_BARREL } from "./owner-source.mjs";
|
|
6
|
-
export const NO_PROSE = new Map;
|
|
7
|
-
const walk = (node, visit) => {
|
|
8
|
-
visit(node);
|
|
9
|
-
node.forEachChild((child) => walk(child, visit));
|
|
10
|
-
}, propertyName = (node) => isPropertyAssignment(node) ? isIdentifier(node.name) || isStringLiteral(node.name) ? node.name.text : null : null;
|
|
11
|
-
export function proseTags(source) {
|
|
12
|
-
let names = null;
|
|
13
|
-
walk(source, (node) => {
|
|
14
|
-
if (!isCallExpression(node) || !isIdentifier(node.expression) || node.expression.text !== "recipe")
|
|
15
|
-
return;
|
|
16
|
-
const [spec] = node.arguments;
|
|
17
|
-
if (spec === void 0 || !isObjectLiteralExpression(spec))
|
|
18
|
-
return;
|
|
19
|
-
const property = (name) => spec.properties.find((item) => propertyName(item) === name), layout = property("layout");
|
|
20
|
-
if (layout === void 0 || !isPropertyAssignment(layout) || !isStringLiteral(layout.initializer) || layout.initializer.text !== "prose")
|
|
21
|
-
return;
|
|
22
|
-
names ??= new Set;
|
|
23
|
-
const elements = property("elements");
|
|
24
|
-
if (elements === void 0 || !isPropertyAssignment(elements) || !isObjectLiteralExpression(elements.initializer))
|
|
25
|
-
return;
|
|
26
|
-
for (const element of elements.initializer.properties) {
|
|
27
|
-
const name = propertyName(element);
|
|
28
|
-
if (name !== null && PROSE_ELEMENT_NAMES.includes(name))
|
|
29
|
-
names.add(name);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return names === null ? null : proseContentTags(names);
|
|
33
|
-
}
|
|
34
|
-
const resolved = (from, specifier) => {
|
|
35
|
-
const target = path.resolve(path.dirname(from), specifier);
|
|
36
|
-
return [`${target}.tsx`, `${target}.ts`, path.join(target, "index.tsx"), path.join(target, "index.ts"), target].find((candidate) => /\.tsx?$/.test(candidate) && inRevision(candidate)) ?? null;
|
|
37
|
-
};
|
|
38
|
-
export async function publicProse(dsRoot) {
|
|
39
|
-
const barrel = path.join(dsRoot, PUBLIC_BARREL);
|
|
40
|
-
if (!inRevision(barrel))
|
|
41
|
-
return NO_PROSE;
|
|
42
|
-
const owners = new Map;
|
|
43
|
-
for (const statement of (await sourceAst(barrel)).statements) {
|
|
44
|
-
if (!isExportDeclaration(statement) || statement.isTypeOnly || statement.moduleSpecifier === void 0 || !isStringLiteral(statement.moduleSpecifier))
|
|
45
|
-
continue;
|
|
46
|
-
const clause = statement.exportClause;
|
|
47
|
-
if (clause === void 0 || !isNamedExports(clause) || !statement.moduleSpecifier.text.startsWith("."))
|
|
48
|
-
continue;
|
|
49
|
-
const file = resolved(barrel, statement.moduleSpecifier.text), tags = file === null ? null : proseTags(await sourceAst(file));
|
|
50
|
-
if (tags === null)
|
|
51
|
-
continue;
|
|
52
|
-
for (const element of clause.elements)
|
|
53
|
-
if (!element.isTypeOnly && /^[A-Z]/.test(element.name.text))
|
|
54
|
-
owners.set(element.name.text, tags);
|
|
55
|
-
}
|
|
56
|
-
return owners;
|
|
57
|
-
}
|
package/dist/prose-model.d.mts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/** A prose element's name in a recipe, with the tags it selects. */
|
|
2
|
-
export declare const PROSE_ELEMENTS: {
|
|
3
|
-
readonly paragraph: readonly ["p"];
|
|
4
|
-
readonly heading1: readonly ["h1"];
|
|
5
|
-
readonly heading2: readonly ["h2"];
|
|
6
|
-
readonly heading3: readonly ["h3"];
|
|
7
|
-
readonly heading4: readonly ["h4"];
|
|
8
|
-
readonly heading5: readonly ["h5"];
|
|
9
|
-
readonly heading6: readonly ["h6"];
|
|
10
|
-
readonly list: readonly ["ul", "ol"];
|
|
11
|
-
readonly item: readonly ["li"];
|
|
12
|
-
readonly quote: readonly ["blockquote"];
|
|
13
|
-
readonly rule: readonly ["hr"];
|
|
14
|
-
readonly pre: readonly ["pre"];
|
|
15
|
-
readonly table: readonly ["table"];
|
|
16
|
-
readonly headerCell: readonly ["th"];
|
|
17
|
-
readonly cell: readonly ["td"];
|
|
18
|
-
readonly figure: readonly ["figure"];
|
|
19
|
-
readonly caption: readonly ["figcaption"];
|
|
20
|
-
readonly media: readonly ["img", "video", "iframe"];
|
|
21
|
-
readonly descriptions: readonly ["dl"];
|
|
22
|
-
readonly term: readonly ["dt"];
|
|
23
|
-
readonly definition: readonly ["dd"];
|
|
24
|
-
readonly link: readonly ["a"];
|
|
25
|
-
readonly strong: readonly ["strong", "b"];
|
|
26
|
-
readonly emphasis: readonly ["em", "i"];
|
|
27
|
-
readonly deleted: readonly ["del", "s"];
|
|
28
|
-
readonly code: readonly ["code"];
|
|
29
|
-
readonly sub: readonly ["sub"];
|
|
30
|
-
readonly sup: readonly ["sup"];
|
|
31
|
-
readonly kbd: readonly ["kbd"];
|
|
32
|
-
readonly mark: readonly ["mark"];
|
|
33
|
-
};
|
|
34
|
-
export type ProseElementName = keyof typeof PROSE_ELEMENTS;
|
|
35
|
-
export declare const PROSE_ELEMENT_NAMES: readonly ProseElementName[];
|
|
36
|
-
/** Every tag prose styles, with the element it belongs to. */
|
|
37
|
-
export declare const PROSE_TAGS: ReadonlyMap<string, ProseElementName>;
|
|
38
|
-
/**
|
|
39
|
-
* Tags that carry no design of their own but are part of content: a table's row groups and rows belong
|
|
40
|
-
* to its `table` element, and a line break belongs to any prose. The markup checks accept them as
|
|
41
|
-
* content; no rule is written for them.
|
|
42
|
-
*/
|
|
43
|
-
export declare const PROSE_STRUCTURE: ReadonlyMap<string, ProseElementName | null>;
|
|
44
|
-
/** Whether a tag can be content of a prose owner: a styled tag or a structural one. */
|
|
45
|
-
export declare const isProseTag: (tag: string) => boolean;
|
|
46
|
-
/** The content tags a recipe that declares `names` accepts: their own tags, and the structure that comes with them. */
|
|
47
|
-
export declare function proseContentTags(names: Iterable<ProseElementName>): ReadonlySet<string>;
|
|
48
|
-
/** Elements that stand as blocks in the flow: they take the rhythm before them. */
|
|
49
|
-
export declare const PROSE_BLOCKS: readonly ProseElementName[];
|
|
50
|
-
/** The elements whose text can sit directly inside `container`: what its background must carry. */
|
|
51
|
-
export declare function proseContents(container: ProseElementName): readonly ProseElementName[];
|
|
52
|
-
/** The selector of one tag inside the prose root: plain markup only. */
|
|
53
|
-
export declare const proseSelector: (tag: string) => string;
|
|
54
|
-
/** `&:hover` on an element's selector: the state is the element's own. */
|
|
55
|
-
export declare const proseState: (selector: string, condition: string) => string;
|
|
56
|
-
/** The first plain element of the root and of a plain container: its start margin is cancelled. */
|
|
57
|
-
export declare const PROSE_FIRST: readonly string[];
|
|
58
|
-
/**
|
|
59
|
-
* A component placed directly in the prose root (it has a class) is a block of the flow like any
|
|
60
|
-
* other: it takes the rhythm before it, unless it comes first. Space between siblings is the
|
|
61
|
-
* container's to give; the component's own design is untouched. A component inside a paragraph or
|
|
62
|
-
* another plain element is inline content and is left alone.
|
|
63
|
-
*/
|
|
64
|
-
export declare const PROSE_COMPONENT = "& > :not(:first-child)[class]";
|
|
65
|
-
type Values = Readonly<Record<string, string>>;
|
|
66
|
-
/**
|
|
67
|
-
* The browser defaults ADS replaces on an element, whatever the recipe declares for it: margins
|
|
68
|
-
* (the rhythm owns the space between blocks), a quote's and a figure's indent, a rule's inset border,
|
|
69
|
-
* media wider than its column, a table's doubled borders.
|
|
70
|
-
*/
|
|
71
|
-
export declare function proseDefaults(name: ProseElementName): Values;
|
|
72
|
-
/**
|
|
73
|
-
* The emitted record of a design system's prose owners, beside its public entry: exported name → the
|
|
74
|
-
* plain tags its recipe declares. The design-use check of application source reads it, because an
|
|
75
|
-
* emitted owner no longer carries its recipe.
|
|
76
|
-
*/
|
|
77
|
-
export declare const PROSE_MANIFEST = "ads-prose.json";
|
|
78
|
-
export declare const proseManifestText: (owners: ReadonlyMap<string, ReadonlySet<string>>) => string;
|
|
79
|
-
/** The owners a manifest text records; entries that are not a list of prose tags are dropped. */
|
|
80
|
-
export declare function parseProseManifest(text: string): ReadonlyMap<string, ReadonlySet<string>>;
|
|
81
|
-
export {};
|