@reqvire-org/ads 0.5.1 → 0.5.2
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 +110 -25
- 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/factored-classes.mjs +90 -0
- package/dist/analysis/helpers.mjs +5 -7
- package/dist/analysis/native-project.mjs +12 -0
- package/dist/analysis/owner-analysis-cache.mjs +86 -23
- package/dist/analysis/owner-analysis-key.mjs +42 -10
- package/dist/analysis/owner-choices.mjs +23 -4
- package/dist/analysis/owner-composition.mjs +118 -33
- package/dist/analysis/owner-reuse.mjs +8 -6
- package/dist/analysis/owner-source.mjs +253 -76
- 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-keyline.mjs +2 -2
- package/dist/config.mjs +2 -1
- package/dist/construction-output.mjs +3 -2
- package/dist/construction-spec.d.mts +111 -6
- package/dist/construction-spec.mjs +172 -30
- package/dist/corner-overpaint.mjs +16 -4
- package/dist/derived-states.mjs +182 -0
- package/dist/design-inputs.mjs +18 -3
- package/dist/design-system-closure.mjs +12 -7
- package/dist/emit/contract.mjs +24 -5
- package/dist/emit/emission.mjs +6 -4
- 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/hover-geometry.mjs +15 -0
- package/dist/input-digests.mjs +17 -10
- package/dist/linaria/delivery.mjs +2 -0
- package/dist/lowering-properties.mjs +5 -0
- package/dist/lowering-region-layout.mjs +7 -2
- 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/motion-model.mjs +1 -1
- package/dist/owner-analysis-check.mjs +19 -5
- package/dist/owner-errors.mjs +4 -2
- package/dist/owner-lowering.mjs +71 -12
- package/dist/owner-scenarios.mjs +4 -1
- package/dist/ownership-model.mjs +18 -4
- package/dist/placeholder-contrast.mjs +17 -1
- package/dist/platform-features.mjs +10 -1
- package/dist/profile-view-facts.mjs +1 -1
- package/dist/recipe-macro.d.mts +72 -13
- package/dist/recipe-model.mjs +9 -5
- package/dist/region-lowering.mjs +238 -40
- 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 +5 -0
- package/dist/role-vocabulary.mjs +12 -1
- package/dist/scenarios-compiler.mjs +20 -6
- package/dist/showcase/assets-view.mjs +29 -13
- package/dist/showcase/client.bundle.js +32 -32
- package/dist/showcase/http-client.bundle.js +15 -15
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +4 -4
- package/dist/skills/ads-designer/references/accessibility.md +7 -0
- 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 +1 -1
- package/dist/skills/ads-designer/references/layout.md +5 -1
- package/dist/skills/ads-designer/references/motion.md +9 -1
- package/dist/skills/ads-designer/references/recipes.md +27 -3
- package/dist/skills/ads-import/references/contracts.md +5 -2
- package/dist/skills/ads-import/references/design-data.md +1 -1
- package/dist/skills/ads-import/references/layout.md +5 -1
- package/dist/skills/ads-import/references/recipes.md +27 -3
- package/dist/skills/ads-migrate/SKILL.md +1 -0
- package/dist/skills/ads-migrate/references/0.5.1-to-0.5.2.md +185 -0
- package/dist/skills/ads-port/references/contracts.md +5 -2
- package/dist/skills/ads-port/references/design-data.md +1 -1
- package/dist/skills/ads-port/references/layout.md +5 -1
- package/dist/skills/ads-port/references/recipes.md +27 -3
- package/dist/surface-contrast.mjs +1 -0
- package/dist/surface-effects.mjs +5 -3
- package/dist/task-cache.mjs +8 -18
- package/dist/validation-checks.mjs +1 -1
- package/docs/ARCHITECTURE.md +63 -7
- package/docs/CACHING.md +152 -24
- package/docs/CHANGELOG.md +200 -23
- package/docs/GUIDE.md +45 -1
- package/docs/LANGUAGE.md +146 -8
- package/docs/MOTION.md +10 -2
- package/docs/PROFILE-KINDS.md +9 -1
- package/docs/RULES.md +22 -14
- package/docs/TOKEN-ROLES.md +7 -1
- package/package.json +1 -1
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,61 +1,238 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
## 0.5.1
|
|
3
|
+
## 0.5.2
|
|
6
4
|
|
|
7
5
|
<!-- ads-local-tests:start -->
|
|
8
|
-
Local verification: **
|
|
9
|
-
Tested commit: `
|
|
10
|
-
Completed 2026-11-
|
|
6
|
+
Local verification: **2057/2057 passed** with `bun run test`.
|
|
7
|
+
Tested commit: `78b12682fd713a89b7e6568e8ceff8253dde2164`; Bun 1.4.4.
|
|
8
|
+
Completed 2026-11-22T19:17:44.135Z (1218 seconds).
|
|
11
9
|
|
|
12
10
|
<!-- ads-local-test-proof
|
|
13
11
|
{
|
|
14
12
|
"schema": 3,
|
|
15
|
-
"version": "0.5.
|
|
16
|
-
"commit": "
|
|
17
|
-
"sourceSha256": "
|
|
13
|
+
"version": "0.5.2",
|
|
14
|
+
"commit": "78b12682fd713a89b7e6568e8ceff8253dde2164",
|
|
15
|
+
"sourceSha256": "5a604aaed2bda2c6992be54e566251b3a3f3286085fab6845c2006356dc78f55",
|
|
18
16
|
"command": "bun run test",
|
|
19
17
|
"result": "pass",
|
|
20
|
-
"tests":
|
|
21
|
-
"pass":
|
|
18
|
+
"tests": 2057,
|
|
19
|
+
"pass": 2057,
|
|
22
20
|
"fail": 0,
|
|
23
21
|
"skipped": 0,
|
|
24
22
|
"groups": [
|
|
25
23
|
{
|
|
26
24
|
"name": "unit",
|
|
27
|
-
"tests":
|
|
28
|
-
"pass":
|
|
25
|
+
"tests": 794,
|
|
26
|
+
"pass": 794,
|
|
29
27
|
"fail": 0,
|
|
30
28
|
"skipped": 0,
|
|
31
|
-
"reportSha256": "
|
|
29
|
+
"reportSha256": "4ac02df92738ab8b238858afcaf74b67e3fc685a8e6e36fdbd661235ac06e7b3"
|
|
32
30
|
},
|
|
33
31
|
{
|
|
34
32
|
"name": "integration",
|
|
35
|
-
"tests":
|
|
36
|
-
"pass":
|
|
33
|
+
"tests": 959,
|
|
34
|
+
"pass": 959,
|
|
37
35
|
"fail": 0,
|
|
38
36
|
"skipped": 0,
|
|
39
|
-
"reportSha256": "
|
|
37
|
+
"reportSha256": "d7680d3c352321f6cc0865b431331b61b102b0c127a85d9b8ec01938ed401453"
|
|
40
38
|
},
|
|
41
39
|
{
|
|
42
40
|
"name": "browser",
|
|
43
|
-
"tests":
|
|
44
|
-
"pass":
|
|
41
|
+
"tests": 304,
|
|
42
|
+
"pass": 304,
|
|
45
43
|
"fail": 0,
|
|
46
44
|
"skipped": 0,
|
|
47
|
-
"reportSha256": "
|
|
45
|
+
"reportSha256": "54a837df140c284b108816016a7273364b79fd2ccb25d57ae5a285b51336fef4"
|
|
48
46
|
}
|
|
49
47
|
],
|
|
50
48
|
"testOverrides": {},
|
|
51
49
|
"bun": "1.4.4",
|
|
52
|
-
"completedAt": "2026-11-
|
|
53
|
-
"durationMs":
|
|
54
|
-
"logSha256": "
|
|
50
|
+
"completedAt": "2026-11-22T19:17:44.135Z",
|
|
51
|
+
"durationMs": 1218204,
|
|
52
|
+
"logSha256": "b7e7eada9bb2797ce9b085514c9d0c5dc46e9d499fcc646e9077e082dca9e345"
|
|
55
53
|
}
|
|
56
54
|
-->
|
|
57
55
|
<!-- ads-local-tests:end -->
|
|
58
56
|
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- Accepting a draft while its preview was still building could log a background compiler
|
|
60
|
+
error (`ENOENT` on the draft preview's page): the build finished after the draft's preview
|
|
61
|
+
output had been removed. Such a build is no longer reported as ready, and nothing is logged.
|
|
62
|
+
- The MCP server keeps watching emitted files after `ads emit` replaces the output
|
|
63
|
+
tree. Watch handles are reopened for replaced directories at the same paths, so
|
|
64
|
+
a later edit still fails a reused check with `generated-modified`.
|
|
65
|
+
- **MCP previews reuse the emitter's check.** The server's emitter and preview
|
|
66
|
+
compiler checked each revision separately. The emitter now sends its passing
|
|
67
|
+
report over their private IPC channel, kept in memory for the MCP process's
|
|
68
|
+
lifetime. The compiler reuses it when all task inputs match, refreshing output
|
|
69
|
+
integrity and retaining the publication fence. Missing or stale evidence checks
|
|
70
|
+
normally, as does standalone compilation. Emission also prepares the server's
|
|
71
|
+
saved report, so its first ordinary check can be a direct hit; acceptance
|
|
72
|
+
candidates do not eagerly occupy that live-project shortcut.
|
|
73
|
+
- A part with `extent: "fill"` no longer collapses in a stack whose height is only a minimum. Such a stack (its
|
|
74
|
+
frame states `minBlockSize` and nothing fixes, caps, clips or scrolls its height) grows with its content, but the
|
|
75
|
+
filling part gave up its minimum height, so tall content ran past it and under the next part: a page's main area
|
|
76
|
+
came out as tall as the free space while its content continued beneath the footer. The part now keeps its
|
|
77
|
+
content's height there. Stacks with a fixed height, a cap, a ratio or `overflow` are unchanged: the part's content
|
|
78
|
+
stays confined to it. Emitted CSS changes only for a filling part in such a minimum-height stack (it loses
|
|
79
|
+
`min-block-size: 0`).
|
|
80
|
+
- Testing whether an optional glyph was given (`icon !== undefined && …`, `icon && …`, `icon ? a : b`, `!icon`) is
|
|
81
|
+
accepted, as the language reference says. It was reported as `source/glyph-reference-read`.
|
|
82
|
+
- A recipe's setters for values declared on a part are typed correctly under TypeScript 5: `measured.props({
|
|
83
|
+
focus: [x, y] })` and `({ intrinsic: [width, height] })` were typed as a number there, so a project's own
|
|
84
|
+
type check failed on an owner that `ads check` accepted. Verified under TypeScript 5.5 and ADS's own compiler.
|
|
85
|
+
- `choice/branch-limit` names the limit and every value the selection branched on, with how many values each
|
|
86
|
+
takes, so the props to merge or move are in the message.
|
|
87
|
+
- An optional slot no longer multiplies its parent's class analysis. A child rendered under `condition && …` whose
|
|
88
|
+
presence changes nothing the parent is checked for (an element that is no declared part, such as an indent
|
|
89
|
+
spacer with its own recipe, or an optional part that is neither artwork nor a control's text) is analysed as
|
|
90
|
+
present without branching on its condition. An ordinary list row with an optional lead, line, end and indent
|
|
91
|
+
spacer went from 8064 branches, past the limit, to well under it. Its parts are still checked whenever they
|
|
92
|
+
render.
|
|
93
|
+
- **Large variant matrices are checked in full and emitted as groups.** Every reachable combination of a class
|
|
94
|
+
expression is still lowered and checked; the limits now follow the measured cost (about 2 ms per construction):
|
|
95
|
+
4096 constructions per owner and 16384 branches per selection. A selection of 32 combinations or more whose class
|
|
96
|
+
strings are the classes they all share plus, per group of inputs, classes that depend on that group alone is
|
|
97
|
+
emitted as one lookup per group, joined, verified against every combination; otherwise as before. An owner with
|
|
98
|
+
seven colours and four two-way props went from a 2.7 MB emitted module to 8 KB.
|
|
99
|
+
- **Draft acceptance reuses the owners a draft leaves unchanged.** Each acceptance checks a candidate copy of the
|
|
100
|
+
project, and owner analyses and emitted modules were keyed by the folder they were analysed in, so every
|
|
101
|
+
acceptance re-analysed every owner. Keys are now root-relative and a reused outcome's paths are moved to the
|
|
102
|
+
requesting copy: an acceptance, an MCP check or the emit after it analyzes only the owners the change reaches.
|
|
103
|
+
Within an edited owner, each construction's lowering and checks are reused when the construction is unchanged,
|
|
104
|
+
and each distinct list of recipe fragments is combined once per analysis. Measured on the reference project
|
|
105
|
+
with a 1792-combination owner: a later acceptance that edits another owner went from 3.1 s to 0.85 s, and one
|
|
106
|
+
that edits the large owner itself from 3.2 s to 2.45 s.
|
|
107
|
+
- **Large variant matrices get their cross-owner contrast proven.** A text position recorded every prop of its
|
|
108
|
+
component with each chain above it, so an owner with 1792 combinations kept 1792 distinct leaves per position,
|
|
109
|
+
passed the 512 limit and reported `component-contrast-unresolved` for review. Only the props that change the
|
|
110
|
+
chain are recorded now (exactly), and the chains are proven. Positions on the same path share one enumeration and
|
|
111
|
+
element reads are reused across choices; an edit to such an owner is about 10 % faster.
|
|
112
|
+
- **Analysis reads the captured configuration.** Inside an analysis, `ds.config.json` and the TypeScript
|
|
113
|
+
configuration (with its `extends` chain) were read from disk, so an edit after the capture could mix revisions.
|
|
114
|
+
Both are now read through the capture, including `extends` targets named by absolute path.
|
|
115
|
+
- **A TypeScript configuration that does not parse is an error.** A `tsconfig.json`, or a configuration it extends,
|
|
116
|
+
with a syntax error, a rejected option or an `extends` target that does not exist left ADS analysing with other
|
|
117
|
+
compiler options than the project's, silently. Check reports `typescript-config-invalid` at the file. A circular
|
|
118
|
+
`extends` chain, or one longer than 64 levels, is reported the same way; neither is finished from disk.
|
|
119
|
+
- **Fewer output-folder reads per check.** The emitted files were read and digested for every report-cache key
|
|
120
|
+
(two to three times per check); a returned report now reads them once. A returned report whose output folder
|
|
121
|
+
was edited since it was cached is the evidence a fresh check gives: failed, with acceptance not established.
|
|
122
|
+
The MCP server keeps its project's output folder event-fed: a reused report reads no emitted file unless one was
|
|
123
|
+
edited.
|
|
124
|
+
- **Drafts reuse scenario results, closure checks and design inputs.** Their keys named the analysed root, so a
|
|
125
|
+
draft or acceptance candidate recomputed every scenario's facts and styling, every file's import closure and the
|
|
126
|
+
design inputs. They are now root-relative and relocated, as owner analyses are.
|
|
127
|
+
- **A profile or asset edit re-analyzes only what read it.** Owner analyses and construction lowerings record the
|
|
128
|
+
profiles and assets they read and are reused while those read the same; a comment-only profile edit, or an edit
|
|
129
|
+
to a profile an owner does not use, no longer re-analyzes every owner.
|
|
130
|
+
- **Cancelling an analysis stops it.** A canceled request was still computed to the end in the analysis worker,
|
|
131
|
+
holding the requests behind it. The worker now stops it at its next owner, choice, scenario or file, and skips
|
|
132
|
+
it if it had not started.
|
|
133
|
+
- **Library calls keep their compiler session between calls.** Direct library clients closed their session one
|
|
134
|
+
second after each call, losing programs and ASTs. Sessions now stay for 60 seconds without keeping a finished
|
|
135
|
+
process alive.
|
|
136
|
+
- **Analysis requests send only changed files.** An unregistered request sent the worker the whole project
|
|
137
|
+
inventory each time; it now sends the files changed since the last request, and the complete inventory only
|
|
138
|
+
when the worker does not hold that base.
|
|
139
|
+
- A visual part with `frame: { profile }` keeps the frame profile's size. The profile's `inlineSize` and
|
|
140
|
+
`blockSize` were written and then replaced by the drawing's own size, so a 22 px disc behind an 11 px mark came
|
|
141
|
+
out 11 px, with no error. The frame now sizes the box and the drawing keeps its visual profile's size, centred.
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
|
|
145
|
+
- **The render audit measures owner states by itself.** Every state a recipe declares is switched on, on each
|
|
146
|
+
scenario that renders the owner, and measured for colour contrast, non-text contrast and layout overflow; findings
|
|
147
|
+
name the state. Nothing is written for it: ADS derives the states from the compiled constructions into a
|
|
148
|
+
preview-only file (`ads-preview-audit.json`), which `ads emit` never writes, and the page finds each construction
|
|
149
|
+
by the preview's owner marker and its classes. Over a full audit, constructions with states that no scenario
|
|
150
|
+
renders are a new review item, `render-audit-construction-unrendered`. The `Covered:` line counts the derived
|
|
151
|
+
states measured; states the audit cannot set are `render-audit-skipped` info items. In each state the audit
|
|
152
|
+
also re-measures image shape, corner overpaint and layout that keeps moving once the state has settled. Each
|
|
153
|
+
runtime paint value and each glyph set member is drawn in turn and measured. A state measured by setting its
|
|
154
|
+
attribute where the owner's markup also depends on that prop is `render-audit-state-forced` (review); a scenario
|
|
155
|
+
state that only shows what the audit derives is `render-audit-state-derivable` (info).
|
|
156
|
+
- **The audit renders at the widths a condition flips at.** Besides 390, 768 and 1280 px, layout overflow, image
|
|
157
|
+
shape and corner overpaint are measured just inside and just outside each viewport width the design system's
|
|
158
|
+
compiled CSS changes at (named conditions and breakpoints), up to eight widths.
|
|
159
|
+
- **Hover geometry is reviewed.** A state that changes an in-flow element's geometry under `:hover` is
|
|
160
|
+
`review/hover-geometry-shift`: what follows it moves as the pointer passes.
|
|
161
|
+
|
|
162
|
+
- **A turn under a state.** `rotate` joins the state effects of a control's visual part and of a region part
|
|
163
|
+
(`when: { '&[aria-expanded="true"]': { rotate: { slot: "motion", field: "angle" } } }`, with `"rotate"` in
|
|
164
|
+
`transition` to animate it): a plus that becomes a cross while its panel is open. Reduced motion keeps the turned
|
|
165
|
+
shape and drops only its animation. A control's artwork effects are also accepted under
|
|
166
|
+
`&[aria-expanded="true"]` and `&[aria-pressed="true"]`.
|
|
167
|
+
- **Brightness.** A surface profile's `brightness` field reads a token of the new `brightness` role
|
|
168
|
+
(`brightness.ads.css`, a percentage) and lowers to `filter: brightness()`: a picture with no dark version takes a
|
|
169
|
+
token that is `100%` in the light theme and lower in the dark one. It belongs to a visual part; anywhere else it
|
|
170
|
+
is `construction/surface-effect-misplaced`, because text under it could not be proven readable.
|
|
171
|
+
- **An outset as a share of the box.** The new `box-share` role (`box-share.ads.css`, a percentage) is accepted by
|
|
172
|
+
two new spacing profile fields, `outsetBlock` and `outsetInline`, which `outset` binds like any spacing field. A
|
|
173
|
+
backdrop then extends by that share of its own box on each axis and grows with it.
|
|
174
|
+
- **Focus on a stand-in.** `focus: { of: "<sibling part>" }` on a region part draws the focus profile's outline on
|
|
175
|
+
that part while the named part of the same parent has keyboard focus: the drawn box of a checkbox, radio or
|
|
176
|
+
switch whose native `<input>` is visually hidden.
|
|
177
|
+
- **Where a jump lands.** `anchorClear` on a region root, a part or a prose block element lowers to
|
|
178
|
+
`scroll-margin-block-start`. It reads the layer profile's `clearBlockStart` (right under the region sticky
|
|
179
|
+
elements clear) or the spacing profile's new `anchorGap` (the element's own distance, for a target that lines
|
|
180
|
+
up with a sticky column beside it).
|
|
181
|
+
- **Geometry by state.** A `when` entry on a region root or a part selects another frame profile
|
|
182
|
+
(`frame: { profile }`) and another spacing profile (`spacing`), each lowered and checked whole; a part is
|
|
183
|
+
`collapsed` at rest or under a state (no room, transparent, out of the accessibility tree and focus; open, its
|
|
184
|
+
content's size). `overlap` on an `inline` or `stack` arrangement makes neighbours overlap by a spacing value
|
|
185
|
+
from the new `overlap` token role, in real layout. `geometryTransition: { channels, motion }` animates the
|
|
186
|
+
channels `size`, `inset`, `gap`, `radius`, `border-width` and `overlap`. A `:hover` geometry state needs a focus
|
|
187
|
+
or attribute state of the same geometry; geometry under the autofill state is refused. Not on text-entry
|
|
188
|
+
control parts, controls or top-layer roots. A frame a state selects is checked as the element's own is: the
|
|
189
|
+
text keyline, the fit in a grid cell and corner overpaint run for it; a hit area never changes by state,
|
|
190
|
+
neighbouring targets are proven at every gap a state selects, and overlapping targets are refused.
|
|
191
|
+
- **Standalone artwork with its own colour.** A recipe that is only a visual part takes `surface` on its root: a
|
|
192
|
+
colour-only surface, the colour its foreground drawing takes (an Icon's quiet tone, so a slot that holds it
|
|
193
|
+
sets none).
|
|
194
|
+
- **Decorative boxes in a control.** A control holds at most one text part and one visual part, and any number of
|
|
195
|
+
decorative boxes (parts without a `kind`, each with `frame: { profile }`): a switch is a control with a knob
|
|
196
|
+
that travels under `&[aria-checked="true"]`. The text part is no longer required. The knob's position is the
|
|
197
|
+
state's shape, kept under reduced motion.
|
|
198
|
+
- **Several drawings in one region.** A region may declare several visual parts, each bound to its own asset
|
|
199
|
+
and read by its own name: a row with a leading mark and a trailing one, a tile with a picture and a badge.
|
|
200
|
+
`construction/parts-visual-repeated` is retired. A control and standalone artwork still have one visual part.
|
|
201
|
+
- **A visual part inside another part.** An owner reads the class and drawing of a visual part nested in
|
|
202
|
+
another part of the same recipe by the part's name (`recipe.parts.glyph`, `recipe.assets.glyph.source`), as it
|
|
203
|
+
does for a top-level part: a mark inside a boxed cell beside a label needs no owner of its own. A name several
|
|
204
|
+
nested parts share is `choice/part-ambiguous`.
|
|
205
|
+
- **Any artwork in a control.** A control's visual part draws slot artwork (several paints, each a token or the
|
|
206
|
+
text colour) and intrinsic artwork (a product's logo in its own colours, as an `<img>`), not only foreground
|
|
207
|
+
glyphs. Slot artwork needs one paint at 3:1 on the control's own background in every theme, brand and state
|
|
208
|
+
(`construction/artwork-paint-contrast-insufficient`); a logo is not checked. Where the control paints no
|
|
209
|
+
background of its own the static check has nothing to prove against, and the render audit's icon contrast
|
|
210
|
+
applies. `construction/paint-unsupported` is retired.
|
|
211
|
+
- **A progress bar's fill.** `pseudo: { progressValue: { surface } }` on a `<progress>` part paints the filled part
|
|
212
|
+
over the part's own surface, the track, in each engine's own pseudo-element, and proves the fill at 3:1 against
|
|
213
|
+
the track.
|
|
214
|
+
- **Prose.** `spaceAfter` on a block (the space to whatever follows it, in place of the rhythm; the larger of it and
|
|
215
|
+
the next block's own `spaceBefore`, where that block states one); `markers` on `list` (an unordered list's marker shape per depth of nesting); `markerText` on `item` (a
|
|
216
|
+
text profile whose weight the marker takes); `elements.component` (`spaceBefore` and `spaceAfter` for any
|
|
217
|
+
component placed directly among the blocks).
|
|
218
|
+
- `textAlign` on a control's text part (`"start" | "center" | "end"`): how a button's label lines sit once the label
|
|
219
|
+
wraps or the control is wider than it. It was accepted on other text parts and refused here
|
|
220
|
+
(`spec/field-unsupported`).
|
|
221
|
+
- **Showcase: where each asset is drawn, and at what size.** Each Artwork tile says which owners draw the asset and
|
|
222
|
+
at what size ("drawn at 20px by Button; 16px by Menu"). Owner analysis records each binding's visual size (a glyph
|
|
223
|
+
set's members at the set's size); the preview facts carry it, sorted, so an owner edit that leaves its artwork as it
|
|
224
|
+
was does not rebuild the view. Owner analyses and lowered constructions cached by an earlier version are computed
|
|
225
|
+
once again.
|
|
226
|
+
- **Showcase: artwork beside text.** The Artwork page's settings gain **Place**: alone, or beside text, where each
|
|
227
|
+
tile draws its asset at the chosen size before its title in body text, as a control places a glyph before its
|
|
228
|
+
label.
|
|
229
|
+
- **Showcase: the section menu on a phone.** Below 36rem the header's row of sections is one select naming the
|
|
230
|
+
current section, so the tools keep their room; wider, the row returns.
|
|
231
|
+
- **Showcase: the artwork catalogue.** The "all sizes" page of an artwork folder (formerly the icon catalogue) is
|
|
232
|
+
named for what it draws: any artwork, whatever its paint.
|
|
233
|
+
|
|
234
|
+
## 0.5.1
|
|
235
|
+
|
|
59
236
|
Upgrade from 0.5.0 with the `ads-migrate` skill
|
|
60
237
|
(`skills/ads-migrate/references/0.5.0-to-0.5.1.md`): the text keyline check can
|
|
61
238
|
fail a design system that passed before, animation defined in script is now
|
package/docs/GUIDE.md
CHANGED
|
@@ -318,7 +318,10 @@ explicitly.
|
|
|
318
318
|
- Writes `tsconfig.json` and `ads-env.d.ts` when the package has no tsconfig:
|
|
319
319
|
bundler resolution, the framework's JSX, `@ds` mapped to the barrel, and SVG
|
|
320
320
|
module declarations. Editors and the package's own typecheck thus never use
|
|
321
|
-
the tsconfig of an enclosing application.
|
|
321
|
+
the tsconfig of an enclosing application. `ads check` analyses with these
|
|
322
|
+
compiler options, following its `extends` chain; a configuration in the chain
|
|
323
|
+
that does not parse, has an option TypeScript rejects, extends a missing file
|
|
324
|
+
or extends in a circle is a `typescript-config-invalid` error.
|
|
322
325
|
- Never edits `.gitignore`, never writes a lockfile, never follows symlinks and
|
|
323
326
|
never overwrites a project file. Ignore `.ds/` (ADS's caches and working
|
|
324
327
|
files) yourself.
|
|
@@ -695,6 +698,39 @@ What the audit measures in each render:
|
|
|
695
698
|
printed as a `Covered:` line, gives what was measured. What was skipped is a
|
|
696
699
|
`render-audit-skipped` info item. A render that measured none of its targets
|
|
697
700
|
is a `render-audit-nothing-measured` review item.
|
|
701
|
+
- **Owner states, derived by ADS**: every state a recipe declares (`when` entries
|
|
702
|
+
of a root or a part, whatever they select) is measured on each scenario that
|
|
703
|
+
renders the owner, without a scenario showing it. ADS writes what each
|
|
704
|
+
construction declares to a file of the preview tree only
|
|
705
|
+
(`ads-preview-audit.json`; `ads emit` never writes it); the audit finds each
|
|
706
|
+
construction's first rendered element by the preview's owner marker and its
|
|
707
|
+
classes, switches each state on (an attribute, a native property such as
|
|
708
|
+
`:checked`, or a direct part's), measures colour contrast, non-text contrast,
|
|
709
|
+
layout overflow, image shape and corner overpaint, and layout that keeps
|
|
710
|
+
moving once the state has settled (`layout-shift`), and puts it back. Each
|
|
711
|
+
declared runtime paint value and each member of a glyph set the element draws
|
|
712
|
+
is drawn in turn and measured for contrast (and a member for its shape). Findings name the state
|
|
713
|
+
(`state &[data-expanded="true"] of patterns/Pile/Pile.tsx`). Pointer and
|
|
714
|
+
keyboard states stay the interaction pass's. A state the audit cannot set is a
|
|
715
|
+
`render-audit-skipped` info item (`derived-state-unsupported`,
|
|
716
|
+
`derived-state-not-applied`). The `Covered:` line counts the states measured.
|
|
717
|
+
Setting an attribute shows that state's CSS, not what the component's script
|
|
718
|
+
renders with it: where owner analysis proves the prop behind the attribute
|
|
719
|
+
also changes the owner's markup, that state is a `render-audit-state-forced`
|
|
720
|
+
review item until a scenario shows it. A scenario state that only shows an
|
|
721
|
+
attribute state the audit derives anyway, on an owner rendered elsewhere, is a
|
|
722
|
+
`render-audit-state-derivable` info item: it can go unless people need to see
|
|
723
|
+
it.
|
|
724
|
+
- **Widths from the design system's conditions**: besides 390, 768 and
|
|
725
|
+
1280 px, layout overflow, image shape and corner overpaint are measured just
|
|
726
|
+
inside and just outside each viewport width the design system's CSS changes
|
|
727
|
+
at (a spatial profile's named conditions and breakpoints, read from the
|
|
728
|
+
compiled media queries at 16 px per rem), up to eight widths between 320 and
|
|
729
|
+
1920 px. A layout that only breaks one pixel before a condition flips is found.
|
|
730
|
+
- **Constructions no scenario renders**: over a full audit (no scenarios named),
|
|
731
|
+
each owner with constructions that declare states and appear on no audited
|
|
732
|
+
page is a `render-audit-construction-unrendered` review item: what those
|
|
733
|
+
states do once laid out is unmeasured. Render that variant in a scenario.
|
|
698
734
|
- **Settling**: the audit waits up to 5 s for the page to settle, and each
|
|
699
735
|
measurement waits for layout to stop moving. A page that never settles is
|
|
700
736
|
measured anyway and reported as `content-still-changing`.
|
|
@@ -825,6 +861,14 @@ edit appears after it is emitted.
|
|
|
825
861
|
inert by ADS's sanitizer, and shows its title, aliases, glyph sets, what
|
|
826
862
|
differs between its drawings (themes, sizes, states), its optical centre
|
|
827
863
|
when that is not the middle of its box, and where it is declared. A themed asset shows the drawing of the preview's theme.
|
|
864
|
+
Each tile also says which owners draw the asset and at what size ("drawn at
|
|
865
|
+
20px by Button; 16px by Menu"): the visual size of each binding, a glyph set's
|
|
866
|
+
members at the set's size, and a `glyph()` reference without a size (its
|
|
867
|
+
caller gives it). A folder's settings choose the size the tiles draw at
|
|
868
|
+
(**Size**), the construction grid and optical centre (**Guides**), and
|
|
869
|
+
whether each asset stands alone or before its title in body text
|
|
870
|
+
(**Place**); **View: all sizes** shows the artwork catalogue: the folder at
|
|
871
|
+
text size, then each asset enlarged on its grid and at every artwork size.
|
|
828
872
|
`ads_show_scenario({ id: "assets" })` opens the view like a scenario.
|
|
829
873
|
- **Tokens** (id `tokens`, the Tokens section) lists every token of the
|
|
830
874
|
token inventory (`ads tokens`), whether or not an owner uses it. No scenario
|
package/docs/LANGUAGE.md
CHANGED
|
@@ -185,6 +185,33 @@ part's children.
|
|
|
185
185
|
size. Its frame profile can declare `minInlineSize` (a `control-min-size`
|
|
186
186
|
token), which makes an icon-only control square without deriving its padding
|
|
187
187
|
from its height. See the [equations](LOWERING.md#control-frame-calculation).
|
|
188
|
+
- A control holds at most one text part and one visual part, and any number of
|
|
189
|
+
**decorative boxes**: parts without a `kind`, each with `frame: { profile }`
|
|
190
|
+
(its size and shape) and optionally a `surface`. A box shows the control's
|
|
191
|
+
state by its paint or position, as a switch's knob does:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
recipe({
|
|
195
|
+
layout: "inline", profile: "switch", frame: "control", align: "center", justify: "start", surface: "switch-track",
|
|
196
|
+
when: { '&[aria-checked="true"]': { surface: "switch-track-on" } },
|
|
197
|
+
parts: {
|
|
198
|
+
knob: {
|
|
199
|
+
selector: ".switch-knob", required: true, frame: { profile: "switch-knob" }, surface: "switch-knob",
|
|
200
|
+
transition: ["translate"],
|
|
201
|
+
when: { '&[aria-checked="true"]': { translateInline: { slot: "motion", field: "distance" } } },
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
A box's `when` takes a `surface`, `translateInline` and the scales; inline
|
|
208
|
+
travel mirrors under right-to-left. Where the knob is says whether the switch
|
|
209
|
+
is on, so reduced motion keeps the position and drops only the animation. The
|
|
210
|
+
box is never a target of its own (`source/pointer-transparent-interactive`),
|
|
211
|
+
and a control that renders no text is named on its root
|
|
212
|
+
(`source/control-name-missing`). A control's effects are accepted under
|
|
213
|
+
`&[aria-checked="true"]` and `&[aria-selected="true"]` as well. ADS does not
|
|
214
|
+
prove the knob against the track: the render audit measures it.
|
|
188
215
|
- `frame: "container"` requires complete frame and surface contracts.
|
|
189
216
|
- A frame without a layout keeps native display semantics, including
|
|
190
217
|
Disclosure's summary marker.
|
|
@@ -207,19 +234,21 @@ them all.
|
|
|
207
234
|
| --- | --- | --- | --- |
|
|
208
235
|
| frame profile `paddingInline` / `paddingBlock` | frame | logical insets per axis | the profile also sets `padding` (`construction/frame-field-conflict`) |
|
|
209
236
|
| frame profile `paddingInlineStart` / `paddingInlineEnd` / `paddingBlockStart` / `paddingBlockEnd` | container frame, control frame | one side's inset, where the two sides of an axis differ (a tag padded more before its remove button). On a control frame a block side's inset is its least inset, and `minimumBlockInset` is the block axis's field | the profile also sets that side's axis or `padding`; on a control frame, a block inset beside `minimumBlockInset` (`construction/frame-field-conflict`) |
|
|
210
|
-
| `frame: { profile: "<frame profile>" }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (`box-sizing: border-box`) | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
237
|
+
| `frame: { profile: "<frame profile>" }` | part (not a control, not a vector) | the profile's insets, border, radius and sizes as the part's own box (`box-sizing: border-box`); on a visual part bound to artwork the profile's `inlineSize`/`blockSize` are the box (a disc behind a mark) and the drawing keeps its visual profile's size, centred in it | another field beside `profile`; a frame field the profile misuses, as on a root |
|
|
211
238
|
| `frame: { rules: ["block-end", …] }` (root), `frame: { kind: "control", rules: [...] }` (control part) | region root, control part | the profile's `border-width`, solid, on the named logical sides only, painted by the element's surface `border-color` (mirrors in RTL); on a control part an unruled side keeps the border's space as inset, so the box and its text do not move (a soft field's underline) | empty or repeated sides; no profile width (`rule-width-missing`); no surface border colour (`rule-paint-missing`); on a grid |
|
|
212
239
|
| `frame: { corners: ["end-start", "end-end"] }` | region root | the frame profile's `radius` on the named corners (block edge, then inline edge), `0` on the others, as `border-<corner>-radius`; every corner without it | a frame profile without `radius` (`profile-field-missing`) |
|
|
213
240
|
| `at: { <condition>: { frame: { rules?, corners? } } }` | region root with a `frame` | under the named condition of the root's spatial profile (`@media (width < bound)`), only the border and corner writes that differ: a divider that is the block-end edge when wide and the inline-start edge when narrow | a condition the spatial profile does not name (`construction/condition-unknown`); `rules` under the condition without `rules` on the frame; more than one condition |
|
|
214
241
|
| `accessibility: { boundary: "visible-label" \| "boundary-on-interaction", reason }` | control part (`frame: "control"`, a text-like input, textarea or select) | nothing: its border contrast error becomes the review item `boundary-identified-otherwise`; acceptance enforces human approval | another kind, a reason outside 20–300 characters (`accessibility-declaration-invalid`); another part (`accessibility-declaration-unsupported`); an approver, date or other field (`field-unsupported`) |
|
|
242
|
+
| `focus: { of: "<sibling part>" }` | region part | the nearest focus profile's outline on this part while the named part of the same parent has keyboard focus (`<parent>:has(> <control>:focus-visible) > <part>`): the drawn box of a checkbox, radio or switch whose native `<input>` is visually hidden. The owner keeps the native control focusable and in the same parent | `of` names the part itself or no part of the same parent (`spec/value-invalid`) |
|
|
243
|
+
| `anchorClear: { slot: "layer", field: "clearBlockStart" }` or `{ slot: "spacing", field: "anchorGap" }` | root (not a top-layer root), part, prose block element | `scroll-margin-block-start`: where a jump to the element (a fragment link, `scrollIntoView`) lands below the top of its scroll container. The layer profile's `clearBlockStart` puts it right under the region sticky elements clear; the spacing profile's `anchorGap` is the element's own distance, for a target that lines up with something beside it (a heading level with a sticky side column). Layout is unchanged. ADS does not check that the distance clears what is stuck on the page the owner ends up in | another slot or field (`spec/value-invalid`); on a top-layer root or an inline prose element (`spec/field-unsupported`) |
|
|
215
244
|
| `overflow: "clip" \| "scroll-block" \| "scroll-inline" \| "scroll-both"` | root, part | `overflow` (physical x/y pair of the horizontal writing mode) and a released axis minimum | on a top-layer root (`profile-provider-conflict`); with truncation |
|
|
216
245
|
| `align` / `justify` on an element that scrolls | root, part | `safe center` / `safe end` on the axis the element itself scrolls: content stays aligned while it fits and starts at the scroll origin when it overflows, so its start is never unreachable | n/a (automatic) |
|
|
217
246
|
| a rounded frame (`radius`) with visible overflow | region root | n/a | a first or last part of a stack, or a layer, that paints a background over a corner with no inset there (`construction/corner-overpaint`): clip the root, inset it, or round the part |
|
|
218
247
|
| `sticky: { edge: "block-start" \| "block-end", clear?: "block-start" }` | root (not a top-layer root), part | `position: sticky` at that edge of the nearest scrolling container (`inset-block-start: 0`); with `clear`, below the region the layer profile's `clearBlockStart` names; `z-index` from the layer profile's `stickyLayer` when it has one | `clear` with the end edge; `clear` without a layer profile that states `clearBlockStart` |
|
|
219
|
-
| `extent: "fill" \| "fill-both"` | part | `flex: 1 1 0`, the main-axis minimum released; `align-self: stretch` with `fill-both` | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
|
|
248
|
+
| `extent: "fill" \| "fill-both"` | part | `flex: 1 1 0`, the main-axis minimum released, so the part's content is confined to it; in a `stack` whose frame states only a minimum height (`minBlockSize`, with no `blockSize`, `maxBlockSize`, ratio or `overflow`) the part keeps its content's height and the stack grows with it; `align-self: stretch` with `fill-both` | the parent is not `stack`/`inline` (`extent-parent-unsupported`); a frame or reserved lines set that minimum |
|
|
220
249
|
| `extent: "content" \| "container"` | root of an `inline` row, or of a control | `"content"` (the default): as wide as its content, never wider than its container (`display: inline-flex; max-inline-size: 100%`, or `min(100%, <cap>)` under its frame's own cap); `"container"`: the width available in any parent, a block one, a column that aligns its children, or a row beside siblings (`display: flex; inline-size: 100%`), so a filling part has the rest of the row | on a `stack`, `flow`, `layered` or top-layer root, which never hug (`spec/field-unsupported`); `"container"` with a frame that fixes the row's width (`construction/extent-conflict`); a part with `extent: "fill"` in a `"content"` row whose frame does not fix its width (`construction/extent-row-hugs`) |
|
|
221
250
|
| `layout: "layered"` | root, part recipe | one `minmax(0,1fr)` grid area; every declared child part at `1 / 1`; paint order is DOM order, no `z-index` | fewer than two parts (`layered-parts-missing`); `gap` or `wrap` |
|
|
222
|
-
| `outset: { block?, inline? }` (spacing fields) | a childless, non-text part of a `layered` parent | `margin-block` / `margin-inline: calc(-1 * <spacing>)`: the backdrop is drawn past its parent's box (a glow behind a card); the grid area and the layout around it are unchanged | any other part (`construction/outset-unsupported`) |
|
|
251
|
+
| `outset: { block?, inline? }` (spacing fields) | a childless, non-text part of a `layered` parent | `margin-block` / `margin-inline: calc(-1 * <spacing>)`: the backdrop is drawn past its parent's box (a glow behind a card); the grid area and the layout around it are unchanged. A field bound to a `box-share` token (the spacing profile's `outsetBlock` / `outsetInline`) is a share of the box on that axis and grows with it: the same margin on the inline axis, and on the block axis `block-size: calc(100% + 2 * <share>)` centred over the area (`align-self: center`) | any other part (`construction/outset-unsupported`) |
|
|
223
252
|
| `scheme: "light" \| "dark"` | a visual part rendered as a content `<img>`; its sibling declares the other scheme | `display: var(--ads-not-light, block)` (or `--ads-not-dark`): the image is displayed under its colour scheme and `display: none` under the other, by the scheme switches `foundation.css` writes wherever it sets `color-scheme` (root `data-theme`, a themed section, the OS preference); no script. An `at` condition still hides the part: it is displayed where both show it | siblings without exactly one `light` and one `dark` part (`spec/value-invalid`); a part that is not visual (`spec/field-unsupported`); a part that is not an `<img>` or has an artwork binding (`source/scheme-image-element`, `construction/scheme-unsupported`); an image without `width` or `height` (`source/scheme-image-size-missing`); the image of the scheme the first declared theme does not have without `loading="lazy"` in every choice (`source/scheme-image-not-lazy`) |
|
|
224
253
|
| control `layout: "stack"` | control | visual above label; the control box centres visual + gap + line | `justify` |
|
|
225
254
|
| `at: { "<condition>": { visible } }` | part | `display: none` inside the condition's range, the part's own display inside its complement | unknown condition (`condition-unknown`); a required part hidden (`condition-hides-required`); more than one condition |
|
|
@@ -231,6 +260,7 @@ them all.
|
|
|
231
260
|
| `wrap: "anywhere" \| "never" \| "truncate" \| "balance" \| "pretty"` (`true` = anywhere), `textAlign`, `reserveLines: 1–3` | text part | `overflow-wrap`, `white-space`, one-line ellipsis truncation, `text-wrap: balance \| pretty` (without support: normal wrapping); `text-align`; `min-block-size: Nlh` | reserved lines without a text profile (`reserve-without-text`) |
|
|
232
261
|
| `wrap: "truncate", lines: 2 \| 3` | text part | a clamp: at most N lines, the last ending in "…" (`line-clamp` beside `display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp`, `overflow: hidden`) | `lines: 1` or another value (one line is plain `truncate`); `reserveLines` above `lines` (`spec/value-invalid` at `reserveLines`, naming both); `lines` with another `wrap`; on a declared `element`; an arrangement's display (`extent-conflict`); on, or inside, a control or form label (`source/clamp-on-control`) |
|
|
233
262
|
| control label `wrap`: absent, `true`/`"anywhere"`, `"never"` | control text part | breaks between words when one word alone would overflow (`overflow-wrap: break-word`, the default), anywhere, or never: one line, and the control does not shrink below the label's width | `"truncate"` or another value |
|
|
263
|
+
| control label `textAlign: "start" \| "center" \| "end"` | control text part | `text-align` on the label: how its lines sit once it wraps or the control is wider than it | another value |
|
|
234
264
|
| `kind: "vector", surface, stroke: { slot: "visual", field }` | part | `stroke` from a colour-only surface, `stroke-width` from the visual profile, `fill: none`, non-scaling stroke; any number of data-driven shapes | a surface with other fields (`vector-surface-unsupported`); not an SVG shape under an owned `<svg>` |
|
|
235
265
|
| `kind: "visual", media: "inspected-svg"` | part | contains the inserted drawing within the visual profile's size; its intrinsic size is data | markup, children or `dangerouslySetInnerHTML` in the part (`source/inspected-svg-inline`); the owner parses markup (`source/inspected-svg-parsed`) |
|
|
236
266
|
|
|
@@ -298,6 +328,7 @@ parts: {
|
|
|
298
328
|
input: { selector: ".ds-checkbox-input" }, // the native <input type="checkbox">
|
|
299
329
|
box: {
|
|
300
330
|
selector: ".ds-checkbox-box", surface: "control-surface",
|
|
331
|
+
focus: { of: "input" }, // the focus profile's outline, drawn on the box
|
|
301
332
|
when: {
|
|
302
333
|
"&:has(> .ds-checkbox-input:checked)": { surface: "action-surface" },
|
|
303
334
|
"&:has(> .ds-checkbox-input:focus-visible)": { surface: "focused-control-surface" },
|
|
@@ -363,8 +394,26 @@ control: {
|
|
|
363
394
|
It lowers to `& > .ds-field-control::placeholder { color; opacity: 1 }` and
|
|
364
395
|
`&[data-user-invalid] > .ds-field-control::placeholder { color }`. The
|
|
365
396
|
pseudo-element is always last; `opacity: 1` removes Firefox's default dimming.
|
|
366
|
-
`placeholder`
|
|
367
|
-
(`source/pseudo-host-unsupported`).
|
|
397
|
+
`placeholder` belongs to an `<input>` or `<textarea>`; another element cannot
|
|
398
|
+
host it (`source/pseudo-host-unsupported`).
|
|
399
|
+
|
|
400
|
+
The other pseudo-element is a progress bar's fill, on a `<progress>` part:
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
bar: { selector: ".indicator-bar", required: true, surface: "progress-track", frame: { profile: "progress-bar" },
|
|
404
|
+
pseudo: { progressValue: { surface: "progress-fill" } } },
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
The part's own surface is the track; `progressValue` takes a surface that sets
|
|
408
|
+
only `background`, with `when` for states. ADS turns off the engine's drawing
|
|
409
|
+
(`appearance: none`) and writes the fill once per engine
|
|
410
|
+
(`::-webkit-progress-value`, `::-moz-progress-bar`), since there is no standard
|
|
411
|
+
pseudo-element and a selector an engine does not know would void a shared rule.
|
|
412
|
+
The fill inherits the part's radius. It needs 3:1 against the track in every
|
|
413
|
+
theme, brand and state (`construction/progress-contrast-insufficient`); a part
|
|
414
|
+
without a background has no track to prove it on
|
|
415
|
+
(`construction/progress-contrast-unresolved`). ADS's browser tests cover
|
|
416
|
+
Chromium only.
|
|
368
417
|
|
|
369
418
|
**Contrast**, in every theme, brand and token condition:
|
|
370
419
|
|
|
@@ -396,6 +445,75 @@ typed `when` endpoints), the [root press](MOTION.md#root-press),
|
|
|
396
445
|
[measured value](MOTION.md#animating-a-measured-value). An animation is
|
|
397
446
|
[defined in the recipe and controlled in script](MOTION.md#defined-in-the-recipe-controlled-in-script).
|
|
398
447
|
|
|
448
|
+
## Geometry by state
|
|
449
|
+
|
|
450
|
+
A state selects geometry the way it selects a surface: by naming another
|
|
451
|
+
profile. A `when` entry on a region root or a part may carry a frame profile
|
|
452
|
+
and a spacing profile, and on a part whether it is collapsed:
|
|
453
|
+
|
|
454
|
+
```ts
|
|
455
|
+
const pile = recipe({
|
|
456
|
+
layout: "inline",
|
|
457
|
+
profile: "pile",
|
|
458
|
+
overlap: { slot: "spacing", field: "overlap" }, // neighbours overlap instead of being separated
|
|
459
|
+
when: { '&[data-expanded="true"]': { spacing: "pile-open" } },
|
|
460
|
+
geometryTransition: { channels: ["gap"], motion: { slot: "motion" } },
|
|
461
|
+
parts: {
|
|
462
|
+
count: { selector: ".pile-count", required: true, collapsed: true,
|
|
463
|
+
when: { '&[data-expanded="true"]': { collapsed: false } },
|
|
464
|
+
geometryTransition: { channels: ["size"], motion: { slot: "motion" } } },
|
|
465
|
+
card: { selector: ".pile-card", required: true, frame: { profile: "tile" },
|
|
466
|
+
when: { '&[data-expanded="true"]': { frame: { profile: "tile-open" } } } },
|
|
467
|
+
},
|
|
468
|
+
});
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
| Field | On | Lowers to | Rejects |
|
|
472
|
+
| --- | --- | --- | --- |
|
|
473
|
+
| `when: { state: { frame: { profile } } }` | a region root with a `frame`, a part with `frame: { profile }` | the state's frame profile lowered whole, as the element's own is; one rule under the state with only what differs | an element without a frame profile of its own, which includes a text-entry control part, whose control frame is calculated and not selected (`frame-missing`); a state frame that does not state a field the base frame writes (`field-dropped`); a control or a top-layer root (`spec/field-unsupported`) |
|
|
474
|
+
| `when: { state: { spacing: "<spacing profile>" } }` | a root or a part with an arrangement | the arrangement's `gap` and `overlap` read from that profile under the state, by the same fields as at rest | n/a |
|
|
475
|
+
| `overlap: { slot: "spacing", field: "overlap" }` | an `inline` or `stack` root or part recipe | every neighbour after the first starts inside the one before it by the spacing profile's `overlap` (an `overlap` token): real layout, so the arrangement is as large as what it shows and what follows it moves with it; later neighbours paint over earlier ones; no gap is written | beside `gap`, `rowGap` or `wrap`; on another layout |
|
|
476
|
+
| `collapsed: true \| false`, on the part and in its `when` entries | a part of a `stack` or `inline` parent | collapsed: no size on the parent's main axis whatever it holds, transparent, and out of the accessibility tree and of focus (`visibility: hidden`); open: its content's size. In an overlapping arrangement a collapsed part takes none of the overlap either | a part with a frame, an arrangement, an overflow or a filling extent of its own (`collapsed-box`): put its box on what it holds; a parent that is not a stack or a row (`collapsed-parent`) |
|
|
477
|
+
| `geometryTransition: { channels, motion }` | root, part | the listed channels' properties join the element's transition set, timed by the motion profile; instant under reduced motion. Channels: `size`, `inset` (padding), `gap`, `radius`, `border-width`, and `overlap`: the element's own start margin where an overlapping arrangement places it | a listed channel that changes under no state (`channel-unused`; `overlap` is the arrangement's to change, so it is never refused) |
|
|
478
|
+
|
|
479
|
+
All of these are `construction/state-geometry-unsupported` with the reason
|
|
480
|
+
given, unless a code is named.
|
|
481
|
+
|
|
482
|
+
- **A frame a state selects is checked as the element's own is.** The checks
|
|
483
|
+
that read an element's frame run once for the frame at rest and once for
|
|
484
|
+
each frame a state selects:
|
|
485
|
+
- the text keyline and the fit of a frame in its grid cell
|
|
486
|
+
(`source/keyline-missed`, `source/frame-exceeds-region`,
|
|
487
|
+
`component-keyline` across owners) name the state's frame profile;
|
|
488
|
+
- a rounded corner a child paints over (`construction/corner-overpaint`)
|
|
489
|
+
is found under the state whose frames open it: one that rounds the root,
|
|
490
|
+
removes its inset, or squares the part;
|
|
491
|
+
- target size reads one size per target, so it is kept by construction: a
|
|
492
|
+
control, a text-entry control part and a hit area never change by state
|
|
493
|
+
(`hit-area`), neighbouring targets are proven at every gap a state
|
|
494
|
+
selects, and targets next to each other in an overlapping arrangement are
|
|
495
|
+
refused (`targets-overlap`).
|
|
496
|
+
The render audit still sees a state only where a scenario shows it.
|
|
497
|
+
- **Not for pointer users only.** A state that names `:hover` needs a state of
|
|
498
|
+
the same geometry under `:focus-visible`, `:focus-within` or an attribute
|
|
499
|
+
(`hover-only`).
|
|
500
|
+
- **Autofill does not move layout.** Geometry under `[data-autofill]` is
|
|
501
|
+
`construction/autofill-layout-shift`.
|
|
502
|
+
- **Who animates an overlap.** A declared part animates its margin with its
|
|
503
|
+
arrangement's `gap` channel. Any other neighbour (a component, a mapped
|
|
504
|
+
element with its own recipe) lists `overlap` in its own
|
|
505
|
+
`geometryTransition`: its transitions are its own, so the arrangement never
|
|
506
|
+
writes them.
|
|
507
|
+
- **A collapsed part opening to its content's size** animates where the engine
|
|
508
|
+
interpolates to a content size (`interpolate-size`); elsewhere it opens at
|
|
509
|
+
once, with the same result.
|
|
510
|
+
- **What a state cannot change:** the layout kind, a grid's tracks, a text
|
|
511
|
+
profile's size (a state text profile still changes weight and tracking
|
|
512
|
+
only). A hover state that resizes an element in flow moves what follows it:
|
|
513
|
+
that is the designer's choice, and ADS does not refuse it; it is listed for
|
|
514
|
+
review (`review/hover-geometry-shift`). A layer of a layered parent draws over
|
|
515
|
+
its neighbours and is not listed.
|
|
516
|
+
|
|
399
517
|
## Prose: long-form content
|
|
400
518
|
|
|
401
519
|
Articles, documentation, legal text and anything a content system or Markdown
|
|
@@ -452,9 +570,29 @@ strikethrough) and the common HTML beside it:
|
|
|
452
570
|
|
|
453
571
|
**An element is a part selected by tag.** Each entry names profiles: `text`
|
|
454
572
|
(a text profile), `surface` (a surface profile, with `when` for its states) and
|
|
455
|
-
`frame` (a frame profile: padding, borders, radius, sizes).
|
|
456
|
-
to one element each:
|
|
457
|
-
|
|
573
|
+
`frame` (a frame profile: padding, borders, radius, sizes). The extras belong
|
|
574
|
+
to one element each:
|
|
575
|
+
|
|
576
|
+
- `spaceBefore` on a block replaces the rhythm before it.
|
|
577
|
+
- `spaceAfter` on a block is the space between it and whatever follows, plain
|
|
578
|
+
markup or a component, in place of the rhythm (a heading that sits closer to
|
|
579
|
+
its text than paragraphs sit to each other). Where the next block states its
|
|
580
|
+
own `spaceBefore`, the larger of the two applies, as collapsing margins would
|
|
581
|
+
give: a list with 22 px after it, followed by a heading with 44 px before
|
|
582
|
+
it, is 44 px from that heading.
|
|
583
|
+
- `indent` on `list` is its start inset; `markers` on `list` is an unordered
|
|
584
|
+
list's marker shape at each depth of nesting, outermost first (one to three
|
|
585
|
+
of `"disc"`, `"circle"`, `"square"`; a deeper list keeps the last). Ordered
|
|
586
|
+
lists keep their numbers.
|
|
587
|
+
- `anchorClear` on a block (a heading with an id) is where a jump to it lands.
|
|
588
|
+
- `component` is not a tag: it is any component placed directly among the
|
|
589
|
+
blocks (a callout, a code block with its own owner). It takes `spaceBefore`
|
|
590
|
+
and `spaceAfter` only, in place of the rhythm and with the same "larger of the
|
|
591
|
+
two" rule against a neighbour's own space. A component's design stays its
|
|
592
|
+
owner's, and every component among the blocks takes the same space.
|
|
593
|
+
- `marker` on `item` is a colour-only surface; `markerText` on `item` is a text
|
|
594
|
+
profile whose weight the marker takes (bold bullets and numbers). The
|
|
595
|
+
marker's size and line stay the item's.
|
|
458
596
|
|
|
459
597
|
**What ADS guarantees.**
|
|
460
598
|
|
package/docs/MOTION.md
CHANGED
|
@@ -147,6 +147,13 @@ effective motion profile. A `when` entry gives each channel its endpoint,
|
|
|
147
147
|
| `scale` | `scale` | `scale` | Scale 1 | Uniform visual scaling; no frame or hit-area resizing |
|
|
148
148
|
| `rotate` | `rotate` | `angle` | Zero rotation | Positive is clockwise; not reversed for RTL |
|
|
149
149
|
|
|
150
|
+
A turn under a state says something (a plus turned into a cross while its panel
|
|
151
|
+
is open), so reduced motion keeps the turned shape and only drops its animation;
|
|
152
|
+
travel and scale return to rest. A control's artwork takes its effects under
|
|
153
|
+
pointer feedback (`&:hover:not(:disabled)`, `&:active:not(:disabled)`), a busy
|
|
154
|
+
control (`&[aria-busy="true"]`) and the two toggle states a control shows by its
|
|
155
|
+
artwork (`&[aria-expanded="true"]`, `&[aria-pressed="true"]`).
|
|
156
|
+
|
|
150
157
|
The neutral values are operation identities, not authored offsets. A motion
|
|
151
158
|
distance never becomes a static alignment correction or replaces an asset's
|
|
152
159
|
optical center.
|
|
@@ -290,8 +297,9 @@ recipe({
|
|
|
290
297
|
motion profile's `distance`), `scale`, and `scaleInline` or `scaleBlock` for
|
|
291
298
|
one axis only with the other at rest (a blink closes on the block axis); the
|
|
292
299
|
three scales read the profile's `scale` and are one channel, so a state takes
|
|
293
|
-
one of them.
|
|
294
|
-
|
|
300
|
+
one of them. `rotate` turns the part in place by the profile's `angle`. A
|
|
301
|
+
control's visual part takes the same scales and `rotate`.
|
|
302
|
+
- `transition` lists the channels that animate: `translate`, `scale`, `rotate`. An effect
|
|
295
303
|
whose channel is not listed applies at once. A listed channel without an
|
|
296
304
|
effect is refused.
|
|
297
305
|
- `motion` on the part names its motion profile; without it the part takes the
|
package/docs/PROFILE-KINDS.md
CHANGED
|
@@ -154,6 +154,7 @@ effect fields into them in a fixed order, whatever order the profile states:
|
|
|
154
154
|
| `groupShadow` | `shadow` | One shadow cast by a container and everything in it | `filter: drop-shadow()` |
|
|
155
155
|
| `backdropBlur` | `blur` | Blurs what is behind the element | `backdrop-filter: blur()` |
|
|
156
156
|
| `backdropSaturate` | `saturation` | Makes what is behind the element more or less vivid | `backdrop-filter: saturate()` |
|
|
157
|
+
| `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
158
|
|
|
158
159
|
The element is blurred before its shadow is cast (`filter: blur() drop-shadow()`),
|
|
159
160
|
and the backdrop is blurred before it is saturated
|
|
@@ -295,7 +296,14 @@ its optical center.
|
|
|
295
296
|
Fields: `contentGap`, `labelGap`, `detailsGap`, `metaGap`, and for
|
|
296
297
|
[prose](LANGUAGE.md#prose-long-form-content) `sectionGap` (the space before a
|
|
297
298
|
section's heading) and `indent` (a list's start inset), each `content-gap`
|
|
298
|
-
or `spacing`.
|
|
299
|
+
or `spacing`. `anchorGap` (`layout-size`, `content-gap` or `spacing`) is where a
|
|
300
|
+
jump to an element lands below the top of its scroll container
|
|
301
|
+
([`anchorClear`](LANGUAGE.md)). `overlap` (`overlap`, `content-gap` or
|
|
302
|
+
`spacing`) is how far the neighbours of an arrangement overlap in place of a
|
|
303
|
+
gap ([geometry by state](LANGUAGE.md#geometry-by-state)); a state selects
|
|
304
|
+
another spacing profile to change it. `outsetBlock` and `outsetInline` are how far a layered backdrop is
|
|
305
|
+
drawn past its box ([`outset`](LANGUAGE.md)): a `content-gap` or `spacing`
|
|
306
|
+
length, or a `box-share` percentage, which grows with the box.
|
|
299
307
|
|
|
300
308
|
- Gaps have a purpose: content to visual, label to control, name to detail,
|
|
301
309
|
between metadata runs, list items or sections. Inline and block axes can be
|