@reqvire-org/ads 0.5.2 → 0.5.4
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 +33 -26
- package/dist/analysis/design-usage.mjs +4 -20
- package/dist/analysis/mock-check.mjs +4 -5
- package/dist/analysis/owner-accessibility.mjs +4 -4
- package/dist/analysis/owner-analysis-key.mjs +1 -1
- package/dist/analysis/owner-choices.mjs +35 -3
- package/dist/analysis/owner-composition.mjs +75 -13
- package/dist/analysis/owner-source.mjs +64 -40
- package/dist/composed-contrast.mjs +165 -65
- package/dist/construction-output.mjs +12 -5
- package/dist/construction-spec.d.mts +125 -50
- package/dist/construction-spec.mjs +154 -81
- package/dist/corner-overpaint.mjs +5 -4
- package/dist/design-foundation.mjs +16 -0
- package/dist/design-usage.mjs +2 -8
- package/dist/emit/emission.mjs +0 -5
- package/dist/grid-lowering.mjs +3 -1
- package/dist/lowering-enter.mjs +6 -6
- package/dist/lowering-overlaps.mjs +6 -1
- package/dist/lowering-properties.mjs +3 -0
- package/dist/lowering-session.mjs +10 -0
- package/dist/lowering-transitions.mjs +1 -0
- package/dist/mcp/server-observation.mjs +6 -4
- package/dist/mcp/server-project.mjs +4 -1
- package/dist/owner-analysis-check.mjs +4 -1
- package/dist/owner-errors.mjs +2 -1
- package/dist/owner-lowering.mjs +10 -4
- package/dist/owner-scenarios.mjs +2 -22
- package/dist/ownership-model.mjs +15 -7
- package/dist/paint-contrast.mjs +6 -0
- package/dist/platform-features.mjs +6 -0
- package/dist/profile-macro.d.mts +7 -0
- package/dist/recipe-macro.d.mts +104 -45
- package/dist/recipe-model.mjs +19 -12
- package/dist/region-lowering.mjs +128 -121
- package/dist/role-vocabulary.d.mts +7 -0
- package/dist/role-vocabulary.mjs +7 -0
- package/dist/runtime-paint-contrast.mjs +5 -2
- package/dist/showcase/client.bundle.js +51 -51
- package/dist/showcase/http-client.bundle.js +13 -13
- package/dist/showcase/ui/ui.css +1 -1
- package/dist/showcase/ui/ui.js +6 -6
- package/dist/skills/ads-designer/references/accessibility.md +3 -4
- package/dist/skills/ads-designer/references/design-data.md +12 -6
- package/dist/skills/ads-designer/references/layout.md +7 -3
- package/dist/skills/ads-designer/references/motion.md +2 -1
- package/dist/skills/ads-designer/references/recipes.md +43 -19
- package/dist/skills/ads-import/references/design-data.md +12 -6
- package/dist/skills/ads-import/references/layout.md +7 -3
- package/dist/skills/ads-import/references/recipes.md +43 -19
- package/dist/skills/ads-migrate/SKILL.md +2 -0
- package/dist/skills/ads-migrate/references/0.5.2-to-0.5.3.md +71 -0
- package/dist/skills/ads-migrate/references/0.5.3-to-0.5.4.md +42 -0
- package/dist/skills/ads-port/references/design-data.md +12 -6
- package/dist/skills/ads-port/references/layout.md +7 -3
- package/dist/skills/ads-port/references/recipes.md +43 -19
- package/dist/spatial-model.mjs +2 -2
- package/dist/surface-contrast.mjs +6 -2
- package/dist/target-size.mjs +21 -3
- package/docs/ADS.md +9 -3
- package/docs/ARCHITECTURE.md +33 -23
- package/docs/CACHING.md +1 -1
- package/docs/CHANGELOG.md +181 -21
- package/docs/GUIDE.md +64 -19
- package/docs/LANGUAGE.md +169 -139
- package/docs/MCP.md +5 -1
- package/docs/MOTION.md +16 -3
- package/docs/PROFILE-KINDS.md +52 -5
- package/docs/RULES.md +16 -15
- 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
|
@@ -2,7 +2,7 @@ import { INACTIVE_STATE, SURFACE_STATE } from "./role-vocabulary.mjs";
|
|
|
2
2
|
import { selectedProfile, tokenValueContexts } from "./design-foundation.mjs";
|
|
3
3
|
import { lengthPx } from "./css-length.mjs";
|
|
4
4
|
import { resolveTokenValue } from "./token-resolution.mjs";
|
|
5
|
-
import { BOLD_WEIGHT, inactiveCondition, LARGE_BOLD_TEXT_PX, LARGE_TEXT_MINIMUM, LARGE_TEXT_PX, NON_TEXT_MINIMUM, paintContrast, reachablePairs, TEXT_MINIMUM } from "./paint-contrast.mjs";
|
|
5
|
+
import { BOLD_WEIGHT, inactiveCondition, LARGE_BOLD_TEXT_PX, LARGE_TEXT_MINIMUM, LARGE_TEXT_PX, NON_TEXT_MINIMUM, paintContrast, reachablePairs, TEXT_MINIMUM, unshown } from "./paint-contrast.mjs";
|
|
6
6
|
import { err, ok } from "./result.mjs";
|
|
7
7
|
const PAINT_FIELDS = ["color", "background", "background-image", "opacity"], paintsOf = (fields) => ({
|
|
8
8
|
foreground: fields.color ?? null,
|
|
@@ -31,6 +31,8 @@ export function surfaceContrastFindings(foundation) {
|
|
|
31
31
|
const [profile = "", ...shared] = profiles, composed = foundation.model.compose(profile), file = composed.kind === "ok" ? composed.value.file ?? null : null, failing = [], unprovable = [], placed = [];
|
|
32
32
|
let first = null, reason = null;
|
|
33
33
|
for (const context of contexts) {
|
|
34
|
+
if (unshown(paints.foreground, context))
|
|
35
|
+
continue;
|
|
34
36
|
const outcome = paintContrast(context, paints, TEXT_MINIMUM);
|
|
35
37
|
switch (outcome.kind) {
|
|
36
38
|
case "sufficient":
|
|
@@ -127,7 +129,7 @@ export function sufficientForUses(foundation, paints, uses) {
|
|
|
127
129
|
return !1;
|
|
128
130
|
return tokenValueContexts(foundation).every((context) => {
|
|
129
131
|
const minimum = Math.max(...uses.map((use) => useMinimum(use, context)));
|
|
130
|
-
return minimum === 0 || paintContrast(context, paints, minimum).kind !== "insufficient";
|
|
132
|
+
return minimum === 0 || unshown(paints.foreground, context) || paintContrast(context, paints, minimum).kind !== "insufficient";
|
|
131
133
|
});
|
|
132
134
|
}
|
|
133
135
|
function textProfile(foundation, reference) {
|
|
@@ -234,6 +236,8 @@ export function stateContrast(foundation, spec, content = () => "text") {
|
|
|
234
236
|
let noted = !1;
|
|
235
237
|
contexts ??= tokenValueContexts(foundation);
|
|
236
238
|
for (const context of contexts) {
|
|
239
|
+
if (unshown(paints.foreground, context))
|
|
240
|
+
continue;
|
|
237
241
|
const outcome = paintContrast(context, paints, painted === "graphic" ? NON_TEXT_MINIMUM : textMinimum(text, context));
|
|
238
242
|
switch (outcome.kind) {
|
|
239
243
|
case "sufficient":
|
package/dist/target-size.mjs
CHANGED
|
@@ -94,7 +94,7 @@ export function targetSizeFindings(foundation, targets) {
|
|
|
94
94
|
const key = JSON.stringify(targets), cached = byFacts.get(key);
|
|
95
95
|
if (cached !== void 0)
|
|
96
96
|
return cached;
|
|
97
|
-
const contexts = tokenValueContexts(foundation), findings = [...targets.elements.flatMap((element) => elementFindings(element, contexts)), ...targets.neighbours.flatMap((pair) => overlapFindings(pair, contexts))];
|
|
97
|
+
const contexts = tokenValueContexts(foundation), findings = [...targets.elements.flatMap((element) => elementFindings(element, contexts, targets.neighbours.filter((pair) => pair.first.element === element.element || pair.second.element === element.element))), ...targets.neighbours.flatMap((pair) => overlapFindings(pair, contexts))];
|
|
98
98
|
byFacts.set(key, findings);
|
|
99
99
|
return findings;
|
|
100
100
|
}
|
|
@@ -115,7 +115,22 @@ function contentWidth(content) {
|
|
|
115
115
|
return "the width of the native element's own content";
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
const undersized = (box) => box.block < TARGET_MIN_PX || box.inline.px < TARGET_MIN_PX;
|
|
119
|
+
function spaced(geometry, pairs, context) {
|
|
120
|
+
if (pairs.length === 0)
|
|
121
|
+
return !1;
|
|
122
|
+
const radius = TARGET_MIN_PX / 2;
|
|
123
|
+
return pairs.every((pair) => {
|
|
124
|
+
const own = measure(geometry, context), other = measure(pair.first.element === geometry.element ? pair.second : pair.first, context), gap = lengthPx(pair.gap, context);
|
|
125
|
+
if (own.kind !== "measured" || other.kind !== "measured" || gap.kind !== "px")
|
|
126
|
+
return !1;
|
|
127
|
+
const along = (box) => pair.axis === "inline" ? box.inline.px : box.block, half = along(own.size.target) / 2, otherHalf = along(other.size.target) / 2;
|
|
128
|
+
if (half + gap.px < radius)
|
|
129
|
+
return !1;
|
|
130
|
+
return !undersized(other.size.target) || half + gap.px + otherHalf >= TARGET_MIN_PX;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function elementFindings(geometry, contexts, pairs) {
|
|
119
134
|
const failing = new Tally, unproven = new Tally;
|
|
120
135
|
for (const context of contexts) {
|
|
121
136
|
const read = measure(geometry, context);
|
|
@@ -125,7 +140,10 @@ function elementFindings(geometry, contexts) {
|
|
|
125
140
|
break;
|
|
126
141
|
case "measured": {
|
|
127
142
|
const { block, inline } = read.size.target;
|
|
128
|
-
if (
|
|
143
|
+
if (undersized(read.size.target) && spaced(geometry, pairs, context)) {
|
|
144
|
+
if (geometry.measured.length > 0)
|
|
145
|
+
unproven.add(context.label, `its ${geometry.measured.map((bound) => `${bound.property} is measured at runtime ("${bound.name}", ${bound.fallback} before it is set)`).join(" and ")}`);
|
|
146
|
+
} else if (block < TARGET_MIN_PX || inline.exact && inline.px < TARGET_MIN_PX)
|
|
129
147
|
failing.add(context.label, { blockPx: block, inlinePx: inline.px, inlineExact: inline.exact });
|
|
130
148
|
else if (inline.px < TARGET_MIN_PX)
|
|
131
149
|
unproven.add(context.label, `its inline extent is ${px(inline.px)} plus ${contentWidth(geometry.content)}`);
|
package/docs/ADS.md
CHANGED
|
@@ -255,6 +255,11 @@ owners (`component-contrast`, error; [guide](GUIDE.md#design-system-source)).
|
|
|
255
255
|
- Every component the barrel exports is also checked on the document surface
|
|
256
256
|
that `foundation({ surface })` declares. Applications place those components;
|
|
257
257
|
their own coloured containers are outside the design system.
|
|
258
|
+
- A placement is checked with what its arguments select: a prop it leaves out
|
|
259
|
+
takes its default (or its absence), and an owner state that tests an attribute
|
|
260
|
+
the markup writes holds only where the placement can render that value. A row
|
|
261
|
+
placed with no `state` is not paired with its selected tints there; every
|
|
262
|
+
value stays checked on the document surface for applications.
|
|
258
263
|
- The minimum is 4.5:1, or 3:1 over provably large text inherited across owners.
|
|
259
264
|
Hidden, absent or inactive text has none.
|
|
260
265
|
- A component of the placing owner's own file is expanded only when it passes
|
|
@@ -262,8 +267,9 @@ owners (`component-contrast`, error; [guide](GUIDE.md#design-system-source)).
|
|
|
262
267
|
of is the user agent's own pair and adds nothing.
|
|
263
268
|
- What the check cannot prove is `component-contrast-unresolved` (review) at the
|
|
264
269
|
placement or element concerned, never passed. Examples are an unanalyzed
|
|
265
|
-
wrapper,
|
|
266
|
-
|
|
270
|
+
wrapper, a user-agent paint, an out-of-flow element, opacity, an unknown image
|
|
271
|
+
and a limit. A plain module that places components (a sheet arranging rows)
|
|
272
|
+
is followed like an owner.
|
|
267
273
|
|
|
268
274
|
#### Grids, spatial profiles and text layout
|
|
269
275
|
|
|
@@ -588,7 +594,7 @@ accessibility, interaction, responsive layout, themes and motion.
|
|
|
588
594
|
- The package ships no design system. `ads init` sets up configuration,
|
|
589
595
|
dependencies and an empty design-system folder; the project authors what goes
|
|
590
596
|
in it. The example design system the documents quote is ADS's own test
|
|
591
|
-
project (`tests/fixtures/
|
|
597
|
+
project (`tests/fixtures/example-project/` in the repository), which the
|
|
592
598
|
package does not contain.
|
|
593
599
|
- The tool does not require any design system's names or styles and ships no
|
|
594
600
|
product UI catalogue.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -125,12 +125,12 @@ author in. It never replaces a project file, edits `.gitignore` or writes a
|
|
|
125
125
|
lockfile.
|
|
126
126
|
|
|
127
127
|
ADS tests itself with one example design system, written for React
|
|
128
|
-
(`tests/fixtures/
|
|
128
|
+
(`tests/fixtures/example-project/`). The build writes its declared file set
|
|
129
129
|
and, through an overlay (`tests/helpers/starter/starter-overlay.mts`), a native
|
|
130
130
|
Preact copy of the same source to `.ds/test-starters/`, outside the package;
|
|
131
131
|
the overlay stops the build on a React API without a declared Preact
|
|
132
132
|
counterpart. The tests install it after `ads init`
|
|
133
|
-
(`tests/helpers/
|
|
133
|
+
(`tests/helpers/example-project.mjs`).
|
|
134
134
|
|
|
135
135
|
### No production runtime
|
|
136
136
|
|
|
@@ -204,10 +204,10 @@ section, not a parallel set of "on dark" tokens or component variants.
|
|
|
204
204
|
A theme is the unit for sections because it is the unit the checks prove. Every
|
|
205
205
|
token sheet value is evaluated, and the contrast of every surface pair is
|
|
206
206
|
proven, in each theme, brand and brand × theme context. A section can therefore
|
|
207
|
-
only select a context whose whole colour mode already passes.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
only select a context whose whole colour mode already passes. The finer construct,
|
|
208
|
+
a surface that sets the colours its descendants read (selected rows, tinted
|
|
209
|
+
banners), is a contextual role (`provides`, below): it re-binds paint tokens only,
|
|
210
|
+
and composed contrast proves what sits inside it with the provided values.
|
|
211
211
|
|
|
212
212
|
Sections are opt-in because of their cost: the section rules add CSS to every
|
|
213
213
|
owner sheet, and a design system that switches only `<html>` gains nothing from
|
|
@@ -332,19 +332,27 @@ them through `writeKeyframes`. Script-defined animation is refused by
|
|
|
332
332
|
through the checker so that a project function of the same name is not
|
|
333
333
|
reported.
|
|
334
334
|
|
|
335
|
-
**
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
the
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
335
|
+
**Contextual roles.** A surface profile's `provides` entries are profile fields
|
|
336
|
+
named by the token they re-bind (`--link-ink`), checked in
|
|
337
|
+
`src/design-foundation.mts` (paint to paint; a surface that reads a token it
|
|
338
|
+
provides is `provided-role-self`). Every lowering path that applies a surface
|
|
339
|
+
passes its fields to the rule writer (`src/construction-output.mts`), which sends
|
|
340
|
+
custom-property keys through `LoweringSession.writeProvidedRoles`: the only
|
|
341
|
+
operation that admits custom properties, never `--ads-*` or asset channels.
|
|
342
|
+
Composed contrast (`src/composed-contrast.mts` `providedVariants`) resolves each
|
|
343
|
+
token the text's colour or a backdrop layer reads to the nearest provider at or
|
|
344
|
+
above the element that reads it; a provider under an owner state contributes its
|
|
345
|
+
condition to the pair's requirements, so it pairs only with that state's
|
|
346
|
+
backdrop. Chains are keyed by what their evaluation reads (`evaluationKey`), and
|
|
347
|
+
a component that places itself is followed through each recursive placement once
|
|
348
|
+
per chain, so nested inline content renderers stay within the chain bound.
|
|
349
|
+
|
|
350
|
+
**Content flows.** A region part may be a placed public component
|
|
351
|
+
(`PartContent.kind: "component"`), matched by its marker among the element's
|
|
352
|
+
component facts (`src/analysis/owner-source.mts`); lowering writes its placement
|
|
353
|
+
only. `writePartSpace` (`src/region-lowering.mts`) lowers part `spaceBefore` /
|
|
354
|
+
`spaceAfter` as start margins relative to the stack's gap, ranked by specificity
|
|
355
|
+
(before < after < pair) so the overlap check needs no order.
|
|
348
356
|
|
|
349
357
|
**Entrances.** `enter` on a region root, a region part or a control root is
|
|
350
358
|
parsed into an `EnterSpec` (`src/construction-spec.mts`) that carries its
|
|
@@ -430,10 +438,12 @@ reaches it is `component-contrast-unresolved` at the placement.
|
|
|
430
438
|
show it passes its children through: it renders `children` in place, passes
|
|
431
439
|
it on, or spreads its props into a placement. Any other same-file component
|
|
432
440
|
ends the chain at its placement.
|
|
433
|
-
-
|
|
434
|
-
|
|
435
|
-
other plain-module checks, each
|
|
436
|
-
|
|
441
|
+
- A plain module whose markup places design-system components (a sheet that
|
|
442
|
+
arranges rows and avatars) records composition facts as an owner does, read
|
|
443
|
+
from the revision's program beside the other plain-module checks, each
|
|
444
|
+
revision, so no owner outcome changes; the join follows its placements like an
|
|
445
|
+
owner's. Only where its facts cannot be read do its placements end the chain,
|
|
446
|
+
as unknown above.
|
|
437
447
|
|
|
438
448
|
A native control's pair is the user agent's, and skipped, only when neither its
|
|
439
449
|
colour nor any background between the text and its fill comes from the design
|
package/docs/CACHING.md
CHANGED
|
@@ -173,7 +173,7 @@ the profile declarations already in its key. The composed contrast join over
|
|
|
173
173
|
every owner's facts belongs to the revision's memoized check, not to an owner's
|
|
174
174
|
entry: a token edit reuses every owner analysis and reruns only the join (stage
|
|
175
175
|
`composed-contrast`), and an owner edit changes that owner's facts alone. The
|
|
176
|
-
outcome schema is `ads-owner-analysis/
|
|
176
|
+
outcome schema is `ads-owner-analysis/13` (it carries each owner's closed props for the showcase's live controls, the assets it draws with the size of each, which value of each prop a placement that leaves the prop out selects, and each element's marker and generated-content colours); it includes the composition facts and
|
|
177
177
|
the profile/choice inventory `design`.
|
|
178
178
|
|
|
179
179
|
- Settled outcomes (facts or a deterministic analysis failure) are reused;
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,219 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.5.
|
|
3
|
+
## 0.5.4
|
|
4
4
|
|
|
5
5
|
<!-- ads-local-tests:start -->
|
|
6
|
-
Local verification: **
|
|
7
|
-
Tested commit: `
|
|
8
|
-
Completed 2026-11-
|
|
6
|
+
Local verification: **2098/2098 passed** with `bun run test`.
|
|
7
|
+
Tested commit: `c4d1419fafe01533a4a77496d2edd1f18d6bc819`; Bun 1.4.4.
|
|
8
|
+
Completed 2026-11-23T13:00:46.468Z (1184 seconds).
|
|
9
9
|
|
|
10
10
|
<!-- ads-local-test-proof
|
|
11
11
|
{
|
|
12
12
|
"schema": 3,
|
|
13
|
-
"version": "0.5.
|
|
14
|
-
"commit": "
|
|
15
|
-
"sourceSha256": "
|
|
13
|
+
"version": "0.5.4",
|
|
14
|
+
"commit": "c4d1419fafe01533a4a77496d2edd1f18d6bc819",
|
|
15
|
+
"sourceSha256": "883fcc4568b791d31f164913176c7bf58ff0b894d90640694ef92996e193bb26",
|
|
16
16
|
"command": "bun run test",
|
|
17
17
|
"result": "pass",
|
|
18
|
-
"tests":
|
|
19
|
-
"pass":
|
|
18
|
+
"tests": 2098,
|
|
19
|
+
"pass": 2098,
|
|
20
20
|
"fail": 0,
|
|
21
21
|
"skipped": 0,
|
|
22
22
|
"groups": [
|
|
23
23
|
{
|
|
24
24
|
"name": "unit",
|
|
25
|
-
"tests":
|
|
26
|
-
"pass":
|
|
25
|
+
"tests": 816,
|
|
26
|
+
"pass": 816,
|
|
27
27
|
"fail": 0,
|
|
28
28
|
"skipped": 0,
|
|
29
|
-
"reportSha256": "
|
|
29
|
+
"reportSha256": "4155c54a755bfb84a739199b4f32c023d309d807522d0023b7d5cb77ef3d937e"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"name": "integration",
|
|
33
|
-
"tests":
|
|
34
|
-
"pass":
|
|
33
|
+
"tests": 975,
|
|
34
|
+
"pass": 975,
|
|
35
35
|
"fail": 0,
|
|
36
36
|
"skipped": 0,
|
|
37
|
-
"reportSha256": "
|
|
37
|
+
"reportSha256": "79a67c96988288f209568e10831fc94359519a2dd793dffdba7f99188e95c6df"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"name": "browser",
|
|
41
|
-
"tests":
|
|
42
|
-
"pass":
|
|
41
|
+
"tests": 307,
|
|
42
|
+
"pass": 307,
|
|
43
43
|
"fail": 0,
|
|
44
44
|
"skipped": 0,
|
|
45
|
-
"reportSha256": "
|
|
45
|
+
"reportSha256": "632f6be63e9efd765fe48121d7809d2d5998f085478ef9b8d91ac313c83bef8e"
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
"testOverrides": {},
|
|
49
49
|
"bun": "1.4.4",
|
|
50
|
-
"completedAt": "2026-11-
|
|
51
|
-
"durationMs":
|
|
52
|
-
"logSha256": "
|
|
50
|
+
"completedAt": "2026-11-23T13:00:46.468Z",
|
|
51
|
+
"durationMs": 1184411,
|
|
52
|
+
"logSha256": "0af4056b6d50efdb4e90499d6b4d0dd6e2c430b14a7f420fca7b9af1ddec383e"
|
|
53
53
|
}
|
|
54
54
|
-->
|
|
55
55
|
<!-- ads-local-tests:end -->
|
|
56
56
|
|
|
57
|
+
### Changed
|
|
58
|
+
|
|
59
|
+
- **A part's browser margin is reset.** A part rendered as an element the browser gives a margin (`p`, `h1`–`h6`,
|
|
60
|
+
`ul`, `ol`, `dl`, `dd`, `blockquote`, `figure`, `pre`, `hr`, `menu`) now has `margin: 0`: the arrangement owns the
|
|
61
|
+
space around it. Before, a paragraph or heading declared as a part kept the browser's margin on top of the gap,
|
|
62
|
+
while `normalize: { margin: 0 }` was refused on parts (it is allowed now). Emitted CSS changes for such parts.
|
|
63
|
+
- Owner analysis schema `ads-owner-analysis/13`: composition facts carry each element's marker and generated-content
|
|
64
|
+
colours, so the first check after the upgrade analyses every owner again.
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
|
|
68
|
+
- **List markers.** `pseudo: { marker: { surface, text, content } }` on a list item: a colour-only surface (with
|
|
69
|
+
states), a text profile of weight and numerals, generated content. `markers: [...]` on a list sets the number
|
|
70
|
+
system or bullet at each nesting depth. Prose's `marker`, `markerText` and `markers` have their component form
|
|
71
|
+
again. Composed contrast proves a marker where its item is placed (3:1 for a bullet, the text minimum for a
|
|
72
|
+
number), through provided roles.
|
|
73
|
+
- **CSS counters.** `counter: { reset, increment }` on roots and parts, and generated content
|
|
74
|
+
(`content: { counter | counters, style, separator, prefix, suffix }`) on `marker` or a new `before`
|
|
75
|
+
pseudo-element: clause numbering (1, 1.1, 1.1.2), numbered headings and figures, step numbers. Literals are at most
|
|
76
|
+
four punctuation marks or spaces; `before` is refused on replaced elements.
|
|
77
|
+
- **A part's own spacing profile.** `spacing: "<spacing profile>"` on a part reads that profile's new `spaceBefore`
|
|
78
|
+
and `spaceAfter` fields, so a flow can have as many distances as its design needs (44/14 px around an h2, 24 px
|
|
79
|
+
after a quote). The overlap check now knows that adjacent-sibling selectors name one fixed element each.
|
|
80
|
+
- **A rule between children.** `between: { surface, frame }` draws the frame's border width in the surface's border
|
|
81
|
+
paint between consecutive children, none after the last: table rows without a header row, settings rows, menus.
|
|
82
|
+
- **Visually hidden text.** `presence: "assistive"` on a part: hidden on screen, read by assistive technology (a
|
|
83
|
+
table caption, a skip link's text).
|
|
84
|
+
- **Underlines in states.** A state's text profile may change the underline's colour, thickness and offset (a hover
|
|
85
|
+
that thickens a link's underline), and `provides` accepts the `border-width` role, so links in a table cell can
|
|
86
|
+
thicken there only.
|
|
87
|
+
|
|
88
|
+
- **An underline is a paint of its surface.** `textDecorationColor` on a surface profile, so a hover state deepens
|
|
89
|
+
a link's pale underline and `paintTransition` fades it (`text-decoration-color` channel). Before, the underline
|
|
90
|
+
colour lived only in the text profile, which a state may change in weight and tracking only.
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
|
|
94
|
+
- **The sideways entrance is accepted.** `enter.from.translateInline` (0.5.3) was refused through the recipe macro
|
|
95
|
+
("Unsupported owner value: translate-inline"): the grammar named the field in camel case, the macro writes it in
|
|
96
|
+
kebab case. The tests now go through the macro as owners author it.
|
|
97
|
+
- **A glyph inside an optional part.** A required visual part inside an optional part that a combination does not
|
|
98
|
+
render (a frame's mark, which a lead replaces: `lead !== undefined ? <span …lead/> : icon && <span mark><span
|
|
99
|
+
glyph/></span>`) reported `construction/artwork-binding-missing`. It now needs no drawing there.
|
|
100
|
+
- **Optional text as design state.** `const rest: string | undefined = more > 0 ? \`+${more}\` : undefined` was "not
|
|
101
|
+
from a finite set"; text a derivation computes is a presence choice, shown or not, like an optional element.
|
|
102
|
+
- **Composed contrast through nested content renderers.** A walk that reaches a component's root again with the same
|
|
103
|
+
evaluated elements continues as before, so it is taken once: a content renderer nested in lists and tables no
|
|
104
|
+
longer ends in "compositions exceed 512 distinct chains".
|
|
105
|
+
- **A glyph-only control part.** A `frame: "control"` part without text of its own (a window control) failed
|
|
106
|
+
"Profile text has no field line-height"; it now sits on its text slot's line, composed through `with`.
|
|
107
|
+
|
|
108
|
+
## 0.5.3
|
|
109
|
+
|
|
110
|
+
### Removed
|
|
111
|
+
|
|
112
|
+
- **Prose (`layout: "prose"`) is retired.** Long-form content is assembled from the design system's own components,
|
|
113
|
+
checked as any component is (see Added). `rhythm`, `elements`, the `ads-prose.json` manifest, the guard's
|
|
114
|
+
`design-usage/prose-element-undeclared` and `construction/prose-contrast-insufficient` are gone; a recipe with
|
|
115
|
+
`layout: "prose"` fails as an unknown layout. The migration guide maps every Prose element to its component.
|
|
116
|
+
|
|
117
|
+
### Added
|
|
118
|
+
|
|
119
|
+
- **Long-form content as components.** A `stack` may place public components as parts (`kind: "component"`, matched
|
|
120
|
+
by the marker the placement passes, as a grid cell is), each repeated and optional, in any order; a part's
|
|
121
|
+
`spaceBefore` and `spaceAfter` replace the gap on its side (a heading one section gap from what precedes it; the
|
|
122
|
+
larger applies where two meet), also in the block flow of a parent without an arrangement (a list item that keeps
|
|
123
|
+
its marker). A content tree typed as a union is rendered with a finite choice over `node.type`; composed contrast
|
|
124
|
+
follows a renderer that places itself (nested inline content) through each recursive placement. The example
|
|
125
|
+
design system's `Content` pattern shows the set: headings, paragraphs, links, lists with nested lists, quotes,
|
|
126
|
+
code blocks, dividers and tables.
|
|
127
|
+
- **Contextual roles (`provides`).** A surface profile may re-bind paint tokens for the subtree of every element that
|
|
128
|
+
takes it: `provides: { "--link-ink": "--heading-ink" }` on a heading's surface makes a link inside it take the
|
|
129
|
+
heading's ink, with no prop and no rule on the link. A state's surface provides while the state holds (a selected
|
|
130
|
+
row's cells). Composed contrast proves the text inside with the provided values on the container's background; a
|
|
131
|
+
surface that provides a token it reads itself is refused (`foundation/provided-role-self`). This settles the
|
|
132
|
+
surface-context gap the guide listed (selected rows, tinted banners).
|
|
133
|
+
|
|
134
|
+
- **Design state derived from data.** A `const` with an explicit finite type (`const overflow: "fits" | "overflows" =
|
|
135
|
+
members.length > 3 ? …`) or an optional value (`const fourth: Member | undefined = members[3]`, a `find` result) is a
|
|
136
|
+
choice over its declared type when its initializer reads data the analysis does not evaluate. Every value is
|
|
137
|
+
checked; the derivation stays the component's own logic. Before, a count, an element or a lookup selecting markup
|
|
138
|
+
was "not from a finite set", and a component needed an inner owner taking the result as an optional prop.
|
|
139
|
+
- **A heading level the caller chooses.** A capitalised JSX tag that names a variable holding an element name is
|
|
140
|
+
that element: a constant (`const Heading = "h3"`), or a prop typed as a union of heading levels
|
|
141
|
+
(`level?: "h2" | "h3" | "h4"`, `const Heading = level`). The levels are checked as one heading. Before, such a tag
|
|
142
|
+
was read as an unknown component, so an Accordion could not take its heading level from its place in the page.
|
|
143
|
+
- **Standalone artwork binds its asset in its own recipe.** A standalone logo's one visual part may state
|
|
144
|
+
`asset`, `set`, `glyph`, `state` and `visual` itself, as a region's visual part may; before, those fields were
|
|
145
|
+
refused on an artwork recipe and the binding needed a separate fragment.
|
|
146
|
+
- **A drawn checkbox's native input takes no room.** `drawnBy: "<part>"` on the part holding a native control
|
|
147
|
+
(a checkbox's, radio's or switch's `<input>`) makes it invisible and out of the flow, laid over the named part
|
|
148
|
+
at that part's frame size: pointer and keyboard still reach the real control, its states still reach the
|
|
149
|
+
drawing part, and the label starts one gap after the box. The drawing part follows it and shows its focus
|
|
150
|
+
(`focus: { of }`). Before, a direct input part took its native size, the browser's margins and the row's gap.
|
|
151
|
+
- **Parts and grid cells rendered once per list item.** `repeat: true` on a region part lets `tabs.map(…)` render
|
|
152
|
+
it any number of times, each instance taking the part's construction (`extent: "fill"` shares the row among
|
|
153
|
+
them); a repeated control part is checked for hit-area overlap and spacing against its next instance. On a grid
|
|
154
|
+
cell, `repeat: true` lets mapped elements flow one after another (`start: "auto"` implied) over a numeric span or
|
|
155
|
+
`"full"`. Before, a mapped part was "rendered zero or several times", and a mapped cell had to repeat the column
|
|
156
|
+
count by hand (`span: 14, start: "auto"`), since `span: "full"` was refused with auto placement; it is now accepted
|
|
157
|
+
there too.
|
|
158
|
+
- **An optional grid cell.** `required: false` lets a cell be absent (a page's notice rendered only when given). A
|
|
159
|
+
cell that may be absent and is pinned to a `row` is listed for review (`review/optional-cell-row`): absent, it
|
|
160
|
+
leaves that row empty with its gaps. Before, a cell had to render exactly once.
|
|
161
|
+
- **A radius per corner.** A frame profile's `startStartRadius`, `startEndRadius`, `endStartRadius` and
|
|
162
|
+
`endEndRadius` replace its `radius` on that corner, so a chat bubble keeps its small tail corner. Before,
|
|
163
|
+
`frame: { corners }` could only round a corner by the one radius or square it.
|
|
164
|
+
- **A pushed screen can slide in from the side.** `enter.from.translateInline` moves an entrance on the inline axis
|
|
165
|
+
by the motion profile's `distance`, mirrored right to left. Before, an entrance moved on the block axis only.
|
|
166
|
+
- **WCAG 2.5.8's spacing exception.** A `frame: "control"` part smaller than 24 px passes when it sits between
|
|
167
|
+
targets of a stack or inline arrangement and a 24 px circle centred on it reaches neither a neighbouring target
|
|
168
|
+
nor a smaller neighbour's circle, at every gap (window controls 20 px wide and 28 px apart). A root, or a part
|
|
169
|
+
with no neighbouring target, keeps the 24 px minimum.
|
|
170
|
+
- **A glyph shown only on hover.** A fully transparent text or glyph colour draws nothing, so it has no contrast
|
|
171
|
+
minimum where it is transparent; the states that show it keep theirs. Before, a control whose glyph was
|
|
172
|
+
transparent at rest on a faint fill was checked at 1:1. Focus indicators and boundaries stay checked.
|
|
173
|
+
- **A control's label can fill the row.** `extent: "fill"` on the text part of an `inline` control makes the
|
|
174
|
+
label take the room the control's other content leaves, so a visual after it stands at the far end: a
|
|
175
|
+
full-width disclosure or FAQ trigger with its sign at the edge, a select trigger with its chevron.
|
|
176
|
+
|
|
177
|
+
### Fixed
|
|
178
|
+
|
|
179
|
+
- **`showcase-ui`'s Popover opens at its control.** `placement: "trigger"` opens the panel in the top layer at the
|
|
180
|
+
control that opens it, measured from that control (as the example design system's Popover does); the default
|
|
181
|
+
keeps it pinned under the header's end. It was built on 2026-11-20 and withdrawn because the showcase server ran
|
|
182
|
+
out of memory warming it; that no longer happens (peak about 1 GiB while warming, under the 2 GiB limit).
|
|
183
|
+
- **The showcase sidebar fills in after the first preview.** A showcase opened before any revision was previewed
|
|
184
|
+
(right after the server started) showed the Tokens, Profiles and Artwork sections without their pages, and kept
|
|
185
|
+
them empty until a reload: the explorer was announced only when discovery or drafts changed. It is now also
|
|
186
|
+
announced when an emitted revision changes what the views offer. The Tokens view's Problems page has browser
|
|
187
|
+
coverage.
|
|
188
|
+
- **A release re-run finishes a half-published release.** When ADS was published and the guard package was not,
|
|
189
|
+
re-running the release workflow refused because one package already had the version. It now publishes only the
|
|
190
|
+
missing package and keeps an existing GitHub release.
|
|
191
|
+
- **Composed contrast follows plain modules.** A module with no recipe that arranges components (a sheet placing
|
|
192
|
+
rows and avatars) ended every chain at its placements with a `component-contrast-unresolved` review item. It now
|
|
193
|
+
records composition facts as an owner does, so those pairs are proven or reported as failures. Only a module
|
|
194
|
+
whose facts cannot be read keeps the review item.
|
|
195
|
+
- **Composed contrast checks a placement with what it selects.** A placement that leaves a prop out was paired
|
|
196
|
+
with every value of that prop, and an owner state was paired wherever its construction appeared: a shared
|
|
197
|
+
Avatar was held against a Row's selected tints in every colour where the Row was given no `state` and no
|
|
198
|
+
`color`. A prop left out now takes its default (or its absence), and a state that tests an attribute the
|
|
199
|
+
markup writes (`&[data-state="selected"]` with `data-state={state}`) holds only where that value is rendered.
|
|
200
|
+
Every value is still checked on the document surface, where applications place a public component. Owner
|
|
201
|
+
analysis schema `ads-owner-analysis/12`.
|
|
202
|
+
- **An optional glyph in a region.** A region whose optional visual part draws a received glyph only when one is
|
|
203
|
+
given (`icon && <span …/>`, alone or in a ternary's branch) failed with `construction/artwork-binding-missing`:
|
|
204
|
+
the combination without the glyph had nothing to bind, and lowering asked for a binding anyway. A combination
|
|
205
|
+
that does not render an optional visual part now writes no drawing for it.
|
|
206
|
+
- **A glyph's presence test anywhere in a chain of tests.** `lead === undefined && icon && <span …/>` reported
|
|
207
|
+
`glyph-reference-read`, while `icon && lead === undefined && …` passed. The glyph is tested in either position.
|
|
208
|
+
- **`construction/artwork-binding-missing` names what is missing.** A binding that names its asset but no visual
|
|
209
|
+
profile now says so (the drawing has no size), and the repair shows the binding's `visual` field.
|
|
210
|
+
- **A fixed-size box keeps its size in a row.** A frame that states `inlineSize` or `blockSize` now also states
|
|
211
|
+
that size as its minimum on the axis, unless the frame states its own minimum or a maximum there. Before, a
|
|
212
|
+
fixed box in an `inline` row shrank beside long wrapping text: a 22 px disc came out at 9 px. Emitted CSS changes
|
|
213
|
+
for every such frame (`min-inline-size` and `min-block-size`).
|
|
214
|
+
|
|
215
|
+
## 0.5.2
|
|
216
|
+
|
|
57
217
|
### Fixed
|
|
58
218
|
|
|
59
219
|
- Accepting a draft while its preview was still building could log a background compiler
|
package/docs/GUIDE.md
CHANGED
|
@@ -1163,7 +1163,7 @@ when it is enough for every place the design system uses the profile (the
|
|
|
1163
1163
|
table above). A quiet icon colour at 3:1 is its own surface profile, selected
|
|
1164
1164
|
only by visual parts or text-less controls. These keep 4.5:1: a profile
|
|
1165
1165
|
nothing uses, one a composite slot supplies, the document surface, and one the
|
|
1166
|
-
recipe also names for a pseudo-element, a
|
|
1166
|
+
recipe also names for a pseudo-element, a backdrop or an
|
|
1167
1167
|
entrance. Nothing is released while an owner fails, because its uses are not
|
|
1168
1168
|
known.
|
|
1169
1169
|
|
|
@@ -1947,7 +1947,11 @@ follows:
|
|
|
1947
1947
|
and the finding names it (for example `:root under @media (pointer: coarse)`).
|
|
1948
1948
|
- `ads emit` writes the overrides into the emitted sheets unchanged. Nothing
|
|
1949
1949
|
runs at runtime.
|
|
1950
|
-
- ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer.
|
|
1950
|
+
- ADS checks WCAG 2.2 AA (2.5.8): 24 px, whatever the pointer. A smaller part
|
|
1951
|
+
between targets of one arrangement passes by the spacing exception: a 24 px
|
|
1952
|
+
circle centred on it reaches neither a neighbouring target nor a smaller
|
|
1953
|
+
neighbour's circle, at every gap (window controls 20 px wide, 28 px apart).
|
|
1954
|
+
A root or a part with no neighbouring target keeps the minimum. Larger touch
|
|
1951
1955
|
targets (44 px is a common platform guideline) are a design choice that the
|
|
1952
1956
|
tokens express, not a rule that ADS enforces. An owned hit area
|
|
1953
1957
|
(`minTargetBlockSize`, `minTargetInlineSize` on a frame profile) can enlarge
|
|
@@ -1979,7 +1983,60 @@ translucent surface and a lifted drawing.
|
|
|
1979
1983
|
Some UI must change its colours with what it sits on. Examples are a dark footer
|
|
1980
1984
|
or dark card on a light page, a button over a photo or a strongly coloured
|
|
1981
1985
|
banner, the cells and icons of a selected table row, and the links inside a
|
|
1982
|
-
warning banner. ADS has
|
|
1986
|
+
warning banner. ADS has three checked patterns for this; pick one by where the
|
|
1987
|
+
difference comes from:
|
|
1988
|
+
|
|
1989
|
+
| The colour follows | Pattern |
|
|
1990
|
+
| --- | --- |
|
|
1991
|
+
| The container it sits in: links in a heading or a banner, the cells of a selected row, actions on a dark card | [Contextual roles](#contextual-roles) (`provides` on the container's surface) |
|
|
1992
|
+
| A whole theme or brand for a section of the page: a dark footer | [Nested theme and brand sections](#nested-theme-and-brand-sections) |
|
|
1993
|
+
| A look the caller chooses for a background the design system does not know: a button over a photo | [Explicit choices](#explicit-choices) |
|
|
1994
|
+
|
|
1995
|
+
#### Contextual roles
|
|
1996
|
+
|
|
1997
|
+
A container's surface profile re-binds the paint roles its subtree reads
|
|
1998
|
+
([`provides`](PROFILE-KINDS.md#contextual-roles-provides)). The children keep
|
|
1999
|
+
one design each and read their own roles; inside the container those roles take
|
|
2000
|
+
the container's values. Nothing is passed through props, and the container never
|
|
2001
|
+
styles a child's elements.
|
|
2002
|
+
|
|
2003
|
+
```css
|
|
2004
|
+
/* tokens/Surfaces/paint.ads.css: the roles children read. */
|
|
2005
|
+
:root {
|
|
2006
|
+
--link-ink: var(--action-fill);
|
|
2007
|
+
--icon-ink: var(--text-secondary);
|
|
2008
|
+
}
|
|
2009
|
+
```
|
|
2010
|
+
|
|
2011
|
+
```ts
|
|
2012
|
+
// A warning banner: links and icons inside it take its on-warning ink.
|
|
2013
|
+
profile({ name: "banner-warning", kind: "surface", fields: { background: "--warning-fill", color: "--on-warning" }, provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" } });
|
|
2014
|
+
// A selected row: while the row is selected, its cells' inks follow it.
|
|
2015
|
+
profile({ name: "row-selected", kind: "surface", fields: { background: "--selected-fill", color: "--on-selected" }, provides: { "--link-ink": "--on-selected", "--icon-ink": "--on-selected" } });
|
|
2016
|
+
```
|
|
2017
|
+
|
|
2018
|
+
```ts
|
|
2019
|
+
// The row's recipe selects the providing surface under its state; the cells need no prop.
|
|
2020
|
+
recipe({ layout: "inline", surface: "row", when: { '&[aria-selected="true"]': { surface: "row-selected" } } });
|
|
2021
|
+
```
|
|
2022
|
+
|
|
2023
|
+
**Guarantees.**
|
|
2024
|
+
|
|
2025
|
+
- Lowering writes the provided roles as custom properties on the element that
|
|
2026
|
+
takes the surface (`.row[aria-selected="true"] { --link-ink: var(--on-selected) }`);
|
|
2027
|
+
CSS inheritance carries them to every descendant, components included.
|
|
2028
|
+
- Composed contrast proves the text of everything that can sit inside the
|
|
2029
|
+
container with the provided values on the container's background, in every
|
|
2030
|
+
theme and brand. A provider under a state holds only with that state, so the
|
|
2031
|
+
on-selected ink is paired with the selected background, never the resting one.
|
|
2032
|
+
The nearest provider wins.
|
|
2033
|
+
- Only paint roles are provided, each to another paint token. A surface that
|
|
2034
|
+
provides a token its own fields read is refused
|
|
2035
|
+
(`foundation/provided-role-self`): the element would repaint itself.
|
|
2036
|
+
|
|
2037
|
+
**Limits.** Composed contrast covers text. An icon or a boundary that reads a
|
|
2038
|
+
provided role is checked with its own default value where it is defined; check
|
|
2039
|
+
such non-text paints in the rendered container (the render audit).
|
|
1983
2040
|
|
|
1984
2041
|
#### Nested theme and brand sections
|
|
1985
2042
|
|
|
@@ -2113,21 +2170,6 @@ static paints do not change between contexts. The on-dark treatment is thus
|
|
|
2113
2170
|
readable whatever theme the page uses. Whether the photo needs the treatment is
|
|
2114
2171
|
the caller's decision, which the type makes explicit.
|
|
2115
2172
|
|
|
2116
|
-
#### What neither pattern covers
|
|
2117
|
-
|
|
2118
|
-
Two cases are not covered:
|
|
2119
|
-
|
|
2120
|
-
- state that cascades to children: a selected table row whose cells, icons and
|
|
2121
|
-
checkbox switch to "on selected" colours;
|
|
2122
|
-
- tinted containers: a success or warning banner whose links and icons must stay
|
|
2123
|
-
readable on its tint.
|
|
2124
|
-
|
|
2125
|
-
These cases need a prop passed through each child (an explicit choice at every
|
|
2126
|
-
level), or a construct that lets a surface set the context that its descendants
|
|
2127
|
-
read. ADS has no such surface-context construct. Do not emulate one with a theme
|
|
2128
|
-
per state: a theme is a whole colour mode, and the checks would prove every
|
|
2129
|
-
token of it.
|
|
2130
|
-
|
|
2131
2173
|
### Emitting the design system
|
|
2132
2174
|
|
|
2133
2175
|
`ads emit [directory] [--json] [--force] [--watch]` compiles the design system
|
|
@@ -2655,7 +2697,10 @@ tag; see [npm publishing rules](https://docs.npmjs.com/cli/v11/commands/npm-publ
|
|
|
2655
2697
|
the release notes. It does not repeat the local browser and package suite.
|
|
2656
2698
|
Stable tags publish as `latest`; prerelease tags publish as `next`.
|
|
2657
2699
|
4. Check the workflow result and the npm version before you update consumer
|
|
2658
|
-
dependencies.
|
|
2700
|
+
dependencies. If the second publish failed, re-run the workflow for the same
|
|
2701
|
+
tag: it publishes only the package that does not have the version yet, and
|
|
2702
|
+
leaves an existing GitHub release as it is. A version both packages already
|
|
2703
|
+
have needs a new tag.
|
|
2659
2704
|
|
|
2660
2705
|
The manual workflow moves a label to an existing published version. It does not
|
|
2661
2706
|
publish new source.
|