@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
|
@@ -32,9 +32,9 @@ The `a11y-*` rules check tokens, profiles and constructions (WCAG 2.2 AA):
|
|
|
32
32
|
|
|
33
33
|
| Rule | What it requires | WCAG |
|
|
34
34
|
|---|---|---|
|
|
35
|
-
| `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; neighbouring hit areas never overlap | 2.5.8 |
|
|
35
|
+
| `a11y-target-size` | Every control and `frame: "control"` part is at least 24 × 24px, computed from its lowered box in every theme, brand and condition, a frame's `min-target-inline-size`/`min-target-block-size` hit area included; a smaller part of a stack or inline arrangement passes by the spacing exception when 24px circles centred on it and its neighbouring targets keep clear; neighbouring hit areas never overlap | 2.5.8 |
|
|
36
36
|
| `a11y-focus` | Every focus profile's width is at least 2px; the default indicator `foundation({ focus })` has 3:1 on the document surface | 2.4.7, 1.4.11 |
|
|
37
|
-
| `surface-contrast` | A surface profile setting `color` and `background` reaches 4.5:1 in every context, or 3:1 where every use of it is large text or artwork (a visual part, a text-less control), and has no minimum where every use is an `aria-hidden` visual part; a surface for disabled controls declares `state: "inactive"` (no minimum) and is selected only under `:disabled` or `[aria-disabled="true"]` (`construction/inactive-surface-active`) | 1.4.3 |
|
|
37
|
+
| `surface-contrast` | A surface profile setting `color` and `background` reaches 4.5:1 in every context, or 3:1 where every use of it is large text or artwork (a visual part, a text-less control), and has no minimum where every use is an `aria-hidden` visual part, or where its `color` is fully transparent (a glyph shown only on hover: it draws nothing at rest, and the states that show it keep their minimum); a surface for disabled controls declares `state: "inactive"` (no minimum) and is selected only under `:disabled` or `[aria-disabled="true"]` (`construction/inactive-surface-active`) | 1.4.3 |
|
|
38
38
|
| `a11y-text-resize` | `font-size` and length `line-height` tokens in `rem` or `em` | 1.4.4 |
|
|
39
39
|
| `a11y-icon-label` | Every control choice without a text part has `aria-label`, `aria-labelledby` or `title` | 4.1.2 |
|
|
40
40
|
| `owner-analysis` (`pressed-state-mismatch`) | A choice pairing `aria-pressed` with artwork that declares a `selected` state draws `selected` exactly when pressed; a value analysis cannot pair is `review/pressed-state-unresolved` | 4.1.2 |
|
|
@@ -45,8 +45,7 @@ The `a11y-*` rules check tokens, profiles and constructions (WCAG 2.2 AA):
|
|
|
45
45
|
|
|
46
46
|
Values ADS cannot evaluate are review items (`a11y-target-size-unresolved`,
|
|
47
47
|
`a11y-focus-unresolved`, `component-contrast-unresolved`: a wrapper ADS does not
|
|
48
|
-
analyze, a same-file component that does not render its children,
|
|
49
|
-
plain module's markup, a link or control without its own surface, an out-of-flow element
|
|
48
|
+
analyze, a same-file component that does not render its children, a link or control without its own surface, an out-of-flow element
|
|
50
49
|
without a background, opacity, an unknown image). A helper component in an owner's file is
|
|
51
50
|
followed only when it passes `children` through; for any other, give the text it renders
|
|
52
51
|
an opaque surface of its own, or make the helper a children wrapper or an owner. A native
|
|
@@ -240,6 +240,14 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
240
240
|
|
|
241
241
|
## Colours that depend on their surroundings
|
|
242
242
|
|
|
243
|
+
- **The container decides** (links and icons in a tinted banner, a heading's
|
|
244
|
+
links, a selected row's cells, icons and checkbox, actions on a dark card):
|
|
245
|
+
the container's surface profile provides the roles its children read,
|
|
246
|
+
`provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" }`;
|
|
247
|
+
on a selected row, the state's surface provides them while the state holds.
|
|
248
|
+
The children keep one design and need no prop. Key and value are paint
|
|
249
|
+
tokens; never provide a token the surface itself reads. Composed contrast
|
|
250
|
+
proves the children's text with the provided values on the container.
|
|
243
251
|
- **Inverted regions** (a dark footer or card on a light page): declare
|
|
244
252
|
`sections: true` in `foundation()` and put `data-theme="dark"` on the region.
|
|
245
253
|
Keep writing contexts on `:root` only; emission applies them to sections. The nearest `data-theme` and the nearest
|
|
@@ -249,15 +257,13 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
249
257
|
section's values. Contrast is already proven in every context, so a section
|
|
250
258
|
needs no extra check. A section switches whole themes/brands only; a recipe's
|
|
251
259
|
own token declaration on the section element wins.
|
|
252
|
-
- **On-image
|
|
253
|
-
the child a closed choice the caller sets, such as `tone?: "default" |
|
|
260
|
+
- **On-image controls** (a button over a photo, a background the design system
|
|
261
|
+
cannot know): give the child a closed choice the caller sets, such as `tone?: "default" |
|
|
254
262
|
"on-dark"` mapping to a precompiled recipe with its own surface profile
|
|
255
263
|
(Spectrum's `staticColor`). Use static paints (one `:root` value) for it, so
|
|
256
264
|
the pair is proven and does not change with the page's theme.
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
threaded through each child, or the surface-context construct that is planned.
|
|
260
|
-
Do not invent a theme per state. Details and limits: the ADS tool guide,
|
|
265
|
+
- Do not invent a theme per state, or a `tone` prop for a container the design
|
|
266
|
+
system owns. Details and limits: the ADS tool guide,
|
|
261
267
|
*Colours that depend on their surroundings*.
|
|
262
268
|
|
|
263
269
|
## Colors in Canvas, WebGL and SVG renderers
|
|
@@ -170,9 +170,13 @@ until that owner is fixed.
|
|
|
170
170
|
so a visible tier keeps the element's own display); `visible: true` shows it
|
|
171
171
|
again from a later tier. Hiding a part while a named condition holds is the
|
|
172
172
|
part's own `at: { "<condition>": { visible } }`, below.
|
|
173
|
-
- Each declared cell renders exactly once (`cell-missing-or-repeated`)
|
|
174
|
-
one owned element or public component
|
|
175
|
-
|
|
173
|
+
- Each declared cell renders exactly once (`cell-missing-or-repeated`) unless it
|
|
174
|
+
says otherwise. A cell names one owned element or public component.
|
|
175
|
+
`required: false` lets it be absent (keep it in auto rows, or its pinned row
|
|
176
|
+
stays empty: `review/optional-cell-row`). `repeat: true` renders it once per
|
|
177
|
+
list item: its instances flow (`start: "auto"` implied) over a numeric span or
|
|
178
|
+
`"full"`, with no start line, `end` or `row`. Several instances may also share
|
|
179
|
+
a cell that auto-places (`start: "auto"`) at every tier.
|
|
176
180
|
- An element has at most one placement (`placement-repeated`), applied in the
|
|
177
181
|
returned JSX (`placement-statement`), and a placed element carries its own recipe
|
|
178
182
|
styling (`placement-without-root`). One element carries one part or cell marker.
|
|
@@ -110,7 +110,8 @@ can stop it. A size the owner measures animates with `motion` on its
|
|
|
110
110
|
An entrance on first render is `enter` on a recipe root or a region part:
|
|
111
111
|
`enter: { from: { surface: "entering", translate: { slot: "motion", field: "distance" } }, motion: "enter-motion" }`.
|
|
112
112
|
`from.surface` is a surface profile with only `opacity` and/or `blur`; at most
|
|
113
|
-
one movement (`translate` on the block axis, `
|
|
113
|
+
one movement (`translate` on the block axis, `translateInline` on the inline
|
|
114
|
+
axis and mirrored right to left, `scale` or `rotate`) is read from
|
|
114
115
|
the entrance's motion profile, which needs a duration, an easing and
|
|
115
116
|
`reduced: "static"`. Stagger parts with motion profiles that differ in `delay`.
|
|
116
117
|
ADS emits `@starting-style` and a transition, no script; reduced motion shows
|
|
@@ -145,28 +145,47 @@ code: an attribute it sets (`data-dragging`, `aria-busy`) or a native state;
|
|
|
145
145
|
a recipe never creates a state machine.
|
|
146
146
|
|
|
147
147
|
- `paintTransition` interpolates `background-color`, `border-color`, `color`,
|
|
148
|
-
`box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
148
|
+
`text-decoration-color` (a link's underline, the surface's `textDecorationColor`), `box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
149
149
|
or `backdrop-filter` (`backdropBlur`, `backdropSaturate`) between the base
|
|
150
150
|
surface and its state surfaces, timed by a motion profile with a `static`
|
|
151
151
|
reduced-motion policy. A channel that does not change, an effect that changes
|
|
152
152
|
without its channel, or a gradient on the element, is rejected.
|
|
153
|
-
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
153
|
+
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
+
built from the design system's own components: `Heading`, `Paragraph`,
|
|
155
|
+
`Link`, `List`, `Quote`, `CodeBlock`, `Table` and the inline ones, each a
|
|
156
|
+
normal owner. A pattern places them: a `stack` whose parts are placed
|
|
157
|
+
components (`kind: "component"`, `repeat: true`, `required: false`), in any
|
|
158
|
+
order, with a part's `spaceBefore` / `spaceAfter` for the space around it (a
|
|
159
|
+
heading one `sectionGap` from what precedes it). The content arrives as a
|
|
160
|
+
typed tree (a union of node types) that the pattern renders with a ternary
|
|
161
|
+
chain over `node.type` in its `.map` callback; an inline renderer may render
|
|
162
|
+
itself for nested inline nodes. The project adapts Markdown, HTML (parsed and
|
|
163
|
+
sanitised) or CMS rich text to that tree; never style plain markup by tag and
|
|
164
|
+
never inject an HTML string. A colour that follows the container (a link in a
|
|
165
|
+
heading) is the container surface's `provides`, not a prop on the link. A list
|
|
166
|
+
item keeps its marker: give it no arrangement, and space a nested list with a
|
|
167
|
+
part's `spaceBefore` in its block flow. A flow that needs many distances gives
|
|
168
|
+
each part its own spacing profile (`spacing: "h2-spacing"` with
|
|
169
|
+
`spaceBefore`/`spaceAfter`). A paragraph or heading part has its browser margin
|
|
170
|
+
reset automatically.
|
|
171
|
+
- Markers: `pseudo: { marker: { surface, text } }` on the list item (a colour-only
|
|
172
|
+
surface, a text profile of weight and numerals) and `markers: [...]` on the
|
|
173
|
+
list (number system per depth). Numbering that the browser's list counter
|
|
174
|
+
cannot give (1.1.2 clauses, numbered headings) is a CSS counter: `counter: {
|
|
175
|
+
reset }` on the container, `counter: { increment }` on each item, and
|
|
176
|
+
`content: { counters | counter, separator, suffix }` on its `marker` or
|
|
177
|
+
`before`. Check marks are a visual part in the item, not a marker.
|
|
178
|
+
- A rule between children (table rows, settings rows) is `between: { surface,
|
|
179
|
+
frame }` on their parent, never borders on each child with a last-child
|
|
180
|
+
exception. Text only assistive technology reads (a table caption) is a part
|
|
181
|
+
with `presence: "assistive"`.
|
|
182
|
+
- A colour that depends on where an element sits (links and icons in a tinted
|
|
183
|
+
banner, the cells of a selected row, actions on a dark card) is a contextual
|
|
184
|
+
role: the container's surface profile `provides: { "--link-ink": "--on-warning" }`.
|
|
185
|
+
The children read their own roles and need no prop; composed contrast proves
|
|
186
|
+
their text there. Do not add a `tone` prop for a container's colour; keep
|
|
187
|
+
`tone` for a background the design system cannot know (a photo).
|
|
188
|
+
- `enter: { from: { surface, translate | translateInline | scale | rotate }, motion }` on a root
|
|
170
189
|
or a region part is an entrance on first render: the element starts from a
|
|
171
190
|
surface that states only `opacity` and `blur`, and at most one movement read
|
|
172
191
|
from the entrance's motion profile, then settles. See the motion reference.
|
|
@@ -175,7 +194,12 @@ a recipe never creates a state machine.
|
|
|
175
194
|
separate owner only to give an element padding, a border or a size. The
|
|
176
195
|
drawn box of a checkbox, radio or switch whose native `<input>` is hidden
|
|
177
196
|
takes `focus: { of: "<the input's part>" }`: the focus profile's outline is
|
|
178
|
-
drawn on the box while the input has keyboard focus.
|
|
197
|
+
drawn on the box while the input has keyboard focus. The input's part,
|
|
198
|
+
declared right before the box, takes `drawnBy: "<the box's part>"`: it takes
|
|
199
|
+
no room and lies, invisible, over the box at the box's frame size, so pointer
|
|
200
|
+
and keyboard still reach the real input. A part rendered once per list item
|
|
201
|
+
(`tabs.map(…)`) is declared `repeat: true`: every instance takes the part's
|
|
202
|
+
construction, and `extent: "fill"` shares the row among them. A visual part may sit
|
|
179
203
|
inside such a part: the owner reads it by its name (`recipe.parts.<name>`,
|
|
180
204
|
`recipe.assets.<name>.source`), which one nested part of the recipe has. On a
|
|
181
205
|
visual part the frame's size is the box and the drawing keeps its visual
|
|
@@ -240,6 +240,14 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
240
240
|
|
|
241
241
|
## Colours that depend on their surroundings
|
|
242
242
|
|
|
243
|
+
- **The container decides** (links and icons in a tinted banner, a heading's
|
|
244
|
+
links, a selected row's cells, icons and checkbox, actions on a dark card):
|
|
245
|
+
the container's surface profile provides the roles its children read,
|
|
246
|
+
`provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" }`;
|
|
247
|
+
on a selected row, the state's surface provides them while the state holds.
|
|
248
|
+
The children keep one design and need no prop. Key and value are paint
|
|
249
|
+
tokens; never provide a token the surface itself reads. Composed contrast
|
|
250
|
+
proves the children's text with the provided values on the container.
|
|
243
251
|
- **Inverted regions** (a dark footer or card on a light page): declare
|
|
244
252
|
`sections: true` in `foundation()` and put `data-theme="dark"` on the region.
|
|
245
253
|
Keep writing contexts on `:root` only; emission applies them to sections. The nearest `data-theme` and the nearest
|
|
@@ -249,15 +257,13 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
249
257
|
section's values. Contrast is already proven in every context, so a section
|
|
250
258
|
needs no extra check. A section switches whole themes/brands only; a recipe's
|
|
251
259
|
own token declaration on the section element wins.
|
|
252
|
-
- **On-image
|
|
253
|
-
the child a closed choice the caller sets, such as `tone?: "default" |
|
|
260
|
+
- **On-image controls** (a button over a photo, a background the design system
|
|
261
|
+
cannot know): give the child a closed choice the caller sets, such as `tone?: "default" |
|
|
254
262
|
"on-dark"` mapping to a precompiled recipe with its own surface profile
|
|
255
263
|
(Spectrum's `staticColor`). Use static paints (one `:root` value) for it, so
|
|
256
264
|
the pair is proven and does not change with the page's theme.
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
threaded through each child, or the surface-context construct that is planned.
|
|
260
|
-
Do not invent a theme per state. Details and limits: the ADS tool guide,
|
|
265
|
+
- Do not invent a theme per state, or a `tone` prop for a container the design
|
|
266
|
+
system owns. Details and limits: the ADS tool guide,
|
|
261
267
|
*Colours that depend on their surroundings*.
|
|
262
268
|
|
|
263
269
|
## Colors in Canvas, WebGL and SVG renderers
|
|
@@ -170,9 +170,13 @@ until that owner is fixed.
|
|
|
170
170
|
so a visible tier keeps the element's own display); `visible: true` shows it
|
|
171
171
|
again from a later tier. Hiding a part while a named condition holds is the
|
|
172
172
|
part's own `at: { "<condition>": { visible } }`, below.
|
|
173
|
-
- Each declared cell renders exactly once (`cell-missing-or-repeated`)
|
|
174
|
-
one owned element or public component
|
|
175
|
-
|
|
173
|
+
- Each declared cell renders exactly once (`cell-missing-or-repeated`) unless it
|
|
174
|
+
says otherwise. A cell names one owned element or public component.
|
|
175
|
+
`required: false` lets it be absent (keep it in auto rows, or its pinned row
|
|
176
|
+
stays empty: `review/optional-cell-row`). `repeat: true` renders it once per
|
|
177
|
+
list item: its instances flow (`start: "auto"` implied) over a numeric span or
|
|
178
|
+
`"full"`, with no start line, `end` or `row`. Several instances may also share
|
|
179
|
+
a cell that auto-places (`start: "auto"`) at every tier.
|
|
176
180
|
- An element has at most one placement (`placement-repeated`), applied in the
|
|
177
181
|
returned JSX (`placement-statement`), and a placed element carries its own recipe
|
|
178
182
|
styling (`placement-without-root`). One element carries one part or cell marker.
|
|
@@ -145,28 +145,47 @@ code: an attribute it sets (`data-dragging`, `aria-busy`) or a native state;
|
|
|
145
145
|
a recipe never creates a state machine.
|
|
146
146
|
|
|
147
147
|
- `paintTransition` interpolates `background-color`, `border-color`, `color`,
|
|
148
|
-
`box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
148
|
+
`text-decoration-color` (a link's underline, the surface's `textDecorationColor`), `box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
149
149
|
or `backdrop-filter` (`backdropBlur`, `backdropSaturate`) between the base
|
|
150
150
|
surface and its state surfaces, timed by a motion profile with a `static`
|
|
151
151
|
reduced-motion policy. A channel that does not change, an effect that changes
|
|
152
152
|
without its channel, or a gradient on the element, is rejected.
|
|
153
|
-
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
153
|
+
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
+
built from the design system's own components: `Heading`, `Paragraph`,
|
|
155
|
+
`Link`, `List`, `Quote`, `CodeBlock`, `Table` and the inline ones, each a
|
|
156
|
+
normal owner. A pattern places them: a `stack` whose parts are placed
|
|
157
|
+
components (`kind: "component"`, `repeat: true`, `required: false`), in any
|
|
158
|
+
order, with a part's `spaceBefore` / `spaceAfter` for the space around it (a
|
|
159
|
+
heading one `sectionGap` from what precedes it). The content arrives as a
|
|
160
|
+
typed tree (a union of node types) that the pattern renders with a ternary
|
|
161
|
+
chain over `node.type` in its `.map` callback; an inline renderer may render
|
|
162
|
+
itself for nested inline nodes. The project adapts Markdown, HTML (parsed and
|
|
163
|
+
sanitised) or CMS rich text to that tree; never style plain markup by tag and
|
|
164
|
+
never inject an HTML string. A colour that follows the container (a link in a
|
|
165
|
+
heading) is the container surface's `provides`, not a prop on the link. A list
|
|
166
|
+
item keeps its marker: give it no arrangement, and space a nested list with a
|
|
167
|
+
part's `spaceBefore` in its block flow. A flow that needs many distances gives
|
|
168
|
+
each part its own spacing profile (`spacing: "h2-spacing"` with
|
|
169
|
+
`spaceBefore`/`spaceAfter`). A paragraph or heading part has its browser margin
|
|
170
|
+
reset automatically.
|
|
171
|
+
- Markers: `pseudo: { marker: { surface, text } }` on the list item (a colour-only
|
|
172
|
+
surface, a text profile of weight and numerals) and `markers: [...]` on the
|
|
173
|
+
list (number system per depth). Numbering that the browser's list counter
|
|
174
|
+
cannot give (1.1.2 clauses, numbered headings) is a CSS counter: `counter: {
|
|
175
|
+
reset }` on the container, `counter: { increment }` on each item, and
|
|
176
|
+
`content: { counters | counter, separator, suffix }` on its `marker` or
|
|
177
|
+
`before`. Check marks are a visual part in the item, not a marker.
|
|
178
|
+
- A rule between children (table rows, settings rows) is `between: { surface,
|
|
179
|
+
frame }` on their parent, never borders on each child with a last-child
|
|
180
|
+
exception. Text only assistive technology reads (a table caption) is a part
|
|
181
|
+
with `presence: "assistive"`.
|
|
182
|
+
- A colour that depends on where an element sits (links and icons in a tinted
|
|
183
|
+
banner, the cells of a selected row, actions on a dark card) is a contextual
|
|
184
|
+
role: the container's surface profile `provides: { "--link-ink": "--on-warning" }`.
|
|
185
|
+
The children read their own roles and need no prop; composed contrast proves
|
|
186
|
+
their text there. Do not add a `tone` prop for a container's colour; keep
|
|
187
|
+
`tone` for a background the design system cannot know (a photo).
|
|
188
|
+
- `enter: { from: { surface, translate | translateInline | scale | rotate }, motion }` on a root
|
|
170
189
|
or a region part is an entrance on first render: the element starts from a
|
|
171
190
|
surface that states only `opacity` and `blur`, and at most one movement read
|
|
172
191
|
from the entrance's motion profile, then settles. See the motion reference.
|
|
@@ -175,7 +194,12 @@ a recipe never creates a state machine.
|
|
|
175
194
|
separate owner only to give an element padding, a border or a size. The
|
|
176
195
|
drawn box of a checkbox, radio or switch whose native `<input>` is hidden
|
|
177
196
|
takes `focus: { of: "<the input's part>" }`: the focus profile's outline is
|
|
178
|
-
drawn on the box while the input has keyboard focus.
|
|
197
|
+
drawn on the box while the input has keyboard focus. The input's part,
|
|
198
|
+
declared right before the box, takes `drawnBy: "<the box's part>"`: it takes
|
|
199
|
+
no room and lies, invisible, over the box at the box's frame size, so pointer
|
|
200
|
+
and keyboard still reach the real input. A part rendered once per list item
|
|
201
|
+
(`tabs.map(…)`) is declared `repeat: true`: every instance takes the part's
|
|
202
|
+
construction, and `extent: "fill"` shares the row among them. A visual part may sit
|
|
179
203
|
inside such a part: the owner reads it by its name (`recipe.parts.<name>`,
|
|
180
204
|
`recipe.assets.<name>.source`), which one nested part of the recipe has. On a
|
|
181
205
|
visual part the frame's size is the box and the drawing keeps its visual
|
|
@@ -73,3 +73,5 @@ Load only the guide(s) for the requested transition.
|
|
|
73
73
|
| 0.4.7 | 0.5.0, grids | [Grids and layout: spatial profiles, grid recipes, named conditions, subgrid rows](references/0.4.7-to-0.5.0-grid.md) (supersedes section 10 of the 0.4.1 → 0.4.2 guide; the rest of the 0.5.0 migration is the guide above) |
|
|
74
74
|
| 0.5.0 | 0.5.1 | [The text keyline check, surface effects, entrances and font fallback metrics](references/0.5.0-to-0.5.1.md) |
|
|
75
75
|
| 0.5.1 | 0.5.2 | [Two emitted-CSS fixes, checks that now accept what they refused, a TypeScript configuration error that is now reported, the render audit measuring owner states by itself (and which audit-only scenario states can go), and new state, geometry, surface, outset, focus, control and prose language](references/0.5.1-to-0.5.2.md) |
|
|
76
|
+
| 0.5.2 | 0.5.3 | [Prose becomes content components, contextual roles (`provides`), fixed-size frames keep their size, workarounds that can go (design state, heading levels, drawn inputs, repeated parts and cells, optional cells, corner radii, inline entrances, the target spacing exception, hidden glyphs), and composed contrast through plain modules](references/0.5.2-to-0.5.3.md) |
|
|
77
|
+
| 0.5.3 | 0.5.4 | [A part's browser margin is reset, five 0.5.3 gaps fixed, list markers, CSS counters, part spacing profiles, rules between children, visually hidden text and underline states](references/0.5.3-to-0.5.4.md) |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# ADS 0.5.2 → 0.5.3
|
|
2
|
+
|
|
3
|
+
One required change: Prose (`layout: "prose"`) is retired, so a design system
|
|
4
|
+
that has a prose recipe converts it to content components (below). Otherwise no
|
|
5
|
+
source change is required. One fix changes emitted CSS for frames that
|
|
6
|
+
state a size. Several checks now accept what they refused, so workarounds can
|
|
7
|
+
go. The rest is new language a project adopts when it needs it. Owner analysis
|
|
8
|
+
moves to schema `ads-owner-analysis/12`, so the first check after the upgrade
|
|
9
|
+
analyses every owner again.
|
|
10
|
+
|
|
11
|
+
## Prose becomes content components
|
|
12
|
+
|
|
13
|
+
A recipe with `layout: "prose"` now fails as an unknown layout. Long-form
|
|
14
|
+
content is the design system's own components placed by a content pattern; the
|
|
15
|
+
example design system's `patterns/Content/Content` is a complete reference.
|
|
16
|
+
|
|
17
|
+
| Prose | Now |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `elements.paragraph`, `heading2`/`heading3`, `link`, `strong`, `emphasis`, `code` | `Paragraph`, `Heading` (`level`), `Link`, `Strong`, `Emphasis`, `InlineCode`: components, each with the text and surface profiles the element named |
|
|
20
|
+
| `list`, `item` (`indent`, `marker`) | `List` (`ordered`; its frame's `paddingInlineStart` is the indent) and `ListItem` (no arrangement, so the marker stays); a nested list is a part with `spaceBefore` |
|
|
21
|
+
| `quote`, `pre`, `rule`, `table`, `headerCell`, `cell` | `Quote`, `CodeBlock` (focusable, scrolls), `Divider`, `Table`, `TableRow`, `TableCell` (`header`) |
|
|
22
|
+
| `rhythm`, `spaceBefore`, `spaceAfter` on a block | the content pattern's `stack` gap, and `spaceBefore` / `spaceAfter` on its component parts (`kind: "component"`, `repeat: true`, `required: false`) |
|
|
23
|
+
| `elements.component` | another component part of the flow, or a component placed beside the content |
|
|
24
|
+
| A link coloured inside a heading | the heading's surface `provides: { "--link-ink": "<heading ink>" }` |
|
|
25
|
+
| Plain markup as children (`<Prose><h2>…</h2></Prose>`) | a content tree (a union of node types) the pattern renders; adapt Markdown (mdast), HTML (parsed and sanitised) or CMS rich text to it in behaviour code |
|
|
26
|
+
| `ProseHtml({ html })`, `dangerouslySetInnerHTML` | parse the HTML into the tree; nothing injects a string |
|
|
27
|
+
|
|
28
|
+
Application code that wrote plain markup inside a prose owner now passes the
|
|
29
|
+
tree, or renders the content components; `ads-guard` reports plain markup as
|
|
30
|
+
`design-usage/local-markup`.
|
|
31
|
+
|
|
32
|
+
## Emitted CSS that changes
|
|
33
|
+
|
|
34
|
+
- **A frame that states a size.** A frame profile with `inlineSize` or
|
|
35
|
+
`blockSize` now also writes that size as the minimum on its axis
|
|
36
|
+
(`min-inline-size`, `min-block-size`), unless the frame states its own
|
|
37
|
+
minimum or a maximum there. A fixed box in a row no longer shrinks beside
|
|
38
|
+
long wrapping text. If a design relied on the box shrinking, give the frame
|
|
39
|
+
a `minInlineSize` (or `minBlockSize`) of its own, or a maximum.
|
|
40
|
+
|
|
41
|
+
Run `ads emit` and review the rendered owners whose frames state a size.
|
|
42
|
+
|
|
43
|
+
## Checks that now accept what they refused
|
|
44
|
+
|
|
45
|
+
| Before | Now |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| A count, an element or a lookup that selects markup (`members.length > 3`, `members[3]`, `find(…)`) was "not from a finite set"; an inner owner took the result as a prop | Declare it as design state: `const overflow: "fits" \| "overflows" = …`, `const fourth: Member \| undefined = members[3]`. The inner owner can go |
|
|
48
|
+
| A field of an object prop choosing a look (`marks[channel.color]`) | `const color: Color = channel.color`, then `marks[color]` |
|
|
49
|
+
| A heading level from a prop was read as an unknown component | `const Heading = level` with `level?: "h2" \| "h3" \| "h4"` (or a constant `const Heading = "h3"`) is that heading |
|
|
50
|
+
| A drawn checkbox's input took its native size and the row's gap; it was hidden by hand or nested | `drawnBy: "<box part>"` on the input's part, `focus: { of: "<input part>" }` on the box |
|
|
51
|
+
| A full-width trigger could not put its sign at the end | `extent: "fill"` on the control's text part |
|
|
52
|
+
| `tabs.map(…)` could not be a part (`part-missing-or-repeated`); tabs became separate parts | `repeat: true` on the part |
|
|
53
|
+
| An optional element could not be a grid cell; it moved inside another cell | `required: false` on the cell (keep it in auto rows; a pinned `row` is listed for review) |
|
|
54
|
+
| A mapped cell needed `{ span: <column count>, start: "auto" }` per tier | `repeat: true` with `span: "full"` (or a number); `span: "full"` is also accepted with `start: "auto"` |
|
|
55
|
+
| A chat bubble's tail corner was squared or the radius was one value | `startStartRadius` … `endEndRadius` on the frame profile |
|
|
56
|
+
| An entrance could only rise; a pushed screen faded in instead | `enter: { from: { translateInline: { slot: "motion", field: "distance" } }, … }` |
|
|
57
|
+
| Window controls under 24 px were refused although WCAG 2.5.8's spacing exception held; they were enlarged to 24 px | Parts of one stack or inline arrangement pass when 24 px circles centred on them keep clear of each other at every gap. A control placed by another owner has no known neighbours and keeps the minimum |
|
|
58
|
+
| A glyph transparent at rest, shown on hover, was checked at 1:1; the fill was dropped | A fully transparent text or glyph colour has no minimum where it is transparent; its visible states keep theirs |
|
|
59
|
+
| A container whose links or icons need other colours (a tinted banner, a selected row) needed a `tone` prop on every child | `provides` on the container's surface (base or state): the children read their own roles |
|
|
60
|
+
| A plain module that places components ended composed contrast with `component-contrast-unresolved` | Its placements are followed as an owner's are; the review items go, and real failures are reported |
|
|
61
|
+
| A placement that leaves a prop out was paired with every value of that prop | It selects the prop's default or absence |
|
|
62
|
+
|
|
63
|
+
Revert the workarounds where the original design was wanted, run `ads check`,
|
|
64
|
+
and review the rendered owners.
|
|
65
|
+
|
|
66
|
+
## Checks that can newly fail
|
|
67
|
+
|
|
68
|
+
- **Composed contrast through plain modules and left-out props.** Pairs that
|
|
69
|
+
were unresolved review items are now proven, so a pair that really is below
|
|
70
|
+
the minimum is now an error. Fix the colours, or pass the prop that selects
|
|
71
|
+
the intended look.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ADS 0.5.3 → 0.5.4
|
|
2
|
+
|
|
3
|
+
No source change is required. One change alters emitted CSS (a part's browser
|
|
4
|
+
margin is reset); the rest fixes 0.5.3 gaps and adds list, table and link
|
|
5
|
+
language. Owner analysis moves to schema `ads-owner-analysis/13`, so the first
|
|
6
|
+
check after the upgrade analyses every owner again.
|
|
7
|
+
|
|
8
|
+
## Emitted CSS that changes
|
|
9
|
+
|
|
10
|
+
- **A part's browser margin.** A part rendered as `p`, `h1`–`h6`, `ul`, `ol`,
|
|
11
|
+
`dl`, `dd`, `blockquote`, `figure`, `pre`, `hr` or `menu` now writes
|
|
12
|
+
`margin: 0`: the arrangement owns the space around it. A design that relied on
|
|
13
|
+
the browser's margin gives the part its space instead (`spaceBefore`,
|
|
14
|
+
`spaceAfter`, or its own `spacing` profile), or states the margin with
|
|
15
|
+
`normalize`.
|
|
16
|
+
|
|
17
|
+
Run `ads emit` and review the owners whose parts are paragraphs, headings,
|
|
18
|
+
lists or quotes.
|
|
19
|
+
|
|
20
|
+
## Fixed: workarounds that can go
|
|
21
|
+
|
|
22
|
+
| Before | Now |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `enter.from.translateInline` was refused ("Unsupported owner value: translate-inline") | Accepted: a pushed screen slides in from the side |
|
|
25
|
+
| A glyph in an optional part that a lead replaces needed `icon && lead === undefined && …` | `lead !== undefined ? <span …lead/> : icon && <span …mark…/>` works |
|
|
26
|
+
| An optional count text needed a two-value union (`"fits" \| "overflows"`) | `const rest: string \| undefined = more > 0 ? \`+${more}\` : undefined` is design state |
|
|
27
|
+
| A glyph-only `frame: "control"` part had to name a text profile | It sits on its text slot's line |
|
|
28
|
+
| A content renderer in lists and tables ended in "compositions exceed 512 distinct chains" | Followed to the end |
|
|
29
|
+
|
|
30
|
+
## New language
|
|
31
|
+
|
|
32
|
+
| Need | Write |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Bold, coloured list markers | `pseudo: { marker: { surface: "<colour-only>", text: "<weight>" } }` on the list item |
|
|
35
|
+
| Numbers, then letters, at each depth | `markers: ["decimal", "lower-alpha", "lower-roman"]` on the list |
|
|
36
|
+
| Clause numbering (1, 1.1, 1.1.2) | the list `counter: { reset: "clause" }`; each item `counter: { increment: "clause" }` and `pseudo: { marker: { content: { counters: "clause", separator: ".", suffix: ". " } } }` |
|
|
37
|
+
| A numbered heading ("2.3 Installation") | `counter` on the flow and the heading, `pseudo: { before: { content: { counters: "section", separator: ".", suffix: " " } } }` |
|
|
38
|
+
| Many distances in one flow (44/14 px around an h2, 24 px after a quote) | a spacing profile per part with `spaceBefore`/`spaceAfter`, named by the part: `spacing: "h2-spacing"` |
|
|
39
|
+
| A hairline between table rows, none after the last | `between: { surface, frame }` on the table body part |
|
|
40
|
+
| A caption only screen readers read | `presence: "assistive"` on the caption part |
|
|
41
|
+
| A pale underline that turns full on hover over 150 ms | `textDecorationColor` on the link's surfaces and `paintTransition: { channels: ["text-decoration-color"] }` |
|
|
42
|
+
| An underline a hover thickens | a hover text profile with `textDecorationThickness`; inside one container only: that container's surface `provides` the thickness token |
|
|
@@ -240,6 +240,14 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
240
240
|
|
|
241
241
|
## Colours that depend on their surroundings
|
|
242
242
|
|
|
243
|
+
- **The container decides** (links and icons in a tinted banner, a heading's
|
|
244
|
+
links, a selected row's cells, icons and checkbox, actions on a dark card):
|
|
245
|
+
the container's surface profile provides the roles its children read,
|
|
246
|
+
`provides: { "--link-ink": "--on-warning", "--icon-ink": "--on-warning" }`;
|
|
247
|
+
on a selected row, the state's surface provides them while the state holds.
|
|
248
|
+
The children keep one design and need no prop. Key and value are paint
|
|
249
|
+
tokens; never provide a token the surface itself reads. Composed contrast
|
|
250
|
+
proves the children's text with the provided values on the container.
|
|
243
251
|
- **Inverted regions** (a dark footer or card on a light page): declare
|
|
244
252
|
`sections: true` in `foundation()` and put `data-theme="dark"` on the region.
|
|
245
253
|
Keep writing contexts on `:root` only; emission applies them to sections. The nearest `data-theme` and the nearest
|
|
@@ -249,15 +257,13 @@ imports it first. Each owner sheet carries its tokens' root rules and, with
|
|
|
249
257
|
section's values. Contrast is already proven in every context, so a section
|
|
250
258
|
needs no extra check. A section switches whole themes/brands only; a recipe's
|
|
251
259
|
own token declaration on the section element wins.
|
|
252
|
-
- **On-image
|
|
253
|
-
the child a closed choice the caller sets, such as `tone?: "default" |
|
|
260
|
+
- **On-image controls** (a button over a photo, a background the design system
|
|
261
|
+
cannot know): give the child a closed choice the caller sets, such as `tone?: "default" |
|
|
254
262
|
"on-dark"` mapping to a precompiled recipe with its own surface profile
|
|
255
263
|
(Spectrum's `staticColor`). Use static paints (one `:root` value) for it, so
|
|
256
264
|
the pair is proven and does not change with the page's theme.
|
|
257
|
-
-
|
|
258
|
-
|
|
259
|
-
threaded through each child, or the surface-context construct that is planned.
|
|
260
|
-
Do not invent a theme per state. Details and limits: the ADS tool guide,
|
|
265
|
+
- Do not invent a theme per state, or a `tone` prop for a container the design
|
|
266
|
+
system owns. Details and limits: the ADS tool guide,
|
|
261
267
|
*Colours that depend on their surroundings*.
|
|
262
268
|
|
|
263
269
|
## Colors in Canvas, WebGL and SVG renderers
|
|
@@ -170,9 +170,13 @@ until that owner is fixed.
|
|
|
170
170
|
so a visible tier keeps the element's own display); `visible: true` shows it
|
|
171
171
|
again from a later tier. Hiding a part while a named condition holds is the
|
|
172
172
|
part's own `at: { "<condition>": { visible } }`, below.
|
|
173
|
-
- Each declared cell renders exactly once (`cell-missing-or-repeated`)
|
|
174
|
-
one owned element or public component
|
|
175
|
-
|
|
173
|
+
- Each declared cell renders exactly once (`cell-missing-or-repeated`) unless it
|
|
174
|
+
says otherwise. A cell names one owned element or public component.
|
|
175
|
+
`required: false` lets it be absent (keep it in auto rows, or its pinned row
|
|
176
|
+
stays empty: `review/optional-cell-row`). `repeat: true` renders it once per
|
|
177
|
+
list item: its instances flow (`start: "auto"` implied) over a numeric span or
|
|
178
|
+
`"full"`, with no start line, `end` or `row`. Several instances may also share
|
|
179
|
+
a cell that auto-places (`start: "auto"`) at every tier.
|
|
176
180
|
- An element has at most one placement (`placement-repeated`), applied in the
|
|
177
181
|
returned JSX (`placement-statement`), and a placed element carries its own recipe
|
|
178
182
|
styling (`placement-without-root`). One element carries one part or cell marker.
|
|
@@ -145,28 +145,47 @@ code: an attribute it sets (`data-dragging`, `aria-busy`) or a native state;
|
|
|
145
145
|
a recipe never creates a state machine.
|
|
146
146
|
|
|
147
147
|
- `paintTransition` interpolates `background-color`, `border-color`, `color`,
|
|
148
|
-
`box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
148
|
+
`text-decoration-color` (a link's underline, the surface's `textDecorationColor`), `box-shadow`, `filter` (the surface's `blur`, `shapeShadow`, `groupShadow`)
|
|
149
149
|
or `backdrop-filter` (`backdropBlur`, `backdropSaturate`) between the base
|
|
150
150
|
surface and its state surfaces, timed by a motion profile with a `static`
|
|
151
151
|
reduced-motion policy. A channel that does not change, an effect that changes
|
|
152
152
|
without its channel, or a gradient on the element, is rejected.
|
|
153
|
-
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
`
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
153
|
+
- Long-form content (articles, docs, legal text, Markdown or CMS output) is
|
|
154
|
+
built from the design system's own components: `Heading`, `Paragraph`,
|
|
155
|
+
`Link`, `List`, `Quote`, `CodeBlock`, `Table` and the inline ones, each a
|
|
156
|
+
normal owner. A pattern places them: a `stack` whose parts are placed
|
|
157
|
+
components (`kind: "component"`, `repeat: true`, `required: false`), in any
|
|
158
|
+
order, with a part's `spaceBefore` / `spaceAfter` for the space around it (a
|
|
159
|
+
heading one `sectionGap` from what precedes it). The content arrives as a
|
|
160
|
+
typed tree (a union of node types) that the pattern renders with a ternary
|
|
161
|
+
chain over `node.type` in its `.map` callback; an inline renderer may render
|
|
162
|
+
itself for nested inline nodes. The project adapts Markdown, HTML (parsed and
|
|
163
|
+
sanitised) or CMS rich text to that tree; never style plain markup by tag and
|
|
164
|
+
never inject an HTML string. A colour that follows the container (a link in a
|
|
165
|
+
heading) is the container surface's `provides`, not a prop on the link. A list
|
|
166
|
+
item keeps its marker: give it no arrangement, and space a nested list with a
|
|
167
|
+
part's `spaceBefore` in its block flow. A flow that needs many distances gives
|
|
168
|
+
each part its own spacing profile (`spacing: "h2-spacing"` with
|
|
169
|
+
`spaceBefore`/`spaceAfter`). A paragraph or heading part has its browser margin
|
|
170
|
+
reset automatically.
|
|
171
|
+
- Markers: `pseudo: { marker: { surface, text } }` on the list item (a colour-only
|
|
172
|
+
surface, a text profile of weight and numerals) and `markers: [...]` on the
|
|
173
|
+
list (number system per depth). Numbering that the browser's list counter
|
|
174
|
+
cannot give (1.1.2 clauses, numbered headings) is a CSS counter: `counter: {
|
|
175
|
+
reset }` on the container, `counter: { increment }` on each item, and
|
|
176
|
+
`content: { counters | counter, separator, suffix }` on its `marker` or
|
|
177
|
+
`before`. Check marks are a visual part in the item, not a marker.
|
|
178
|
+
- A rule between children (table rows, settings rows) is `between: { surface,
|
|
179
|
+
frame }` on their parent, never borders on each child with a last-child
|
|
180
|
+
exception. Text only assistive technology reads (a table caption) is a part
|
|
181
|
+
with `presence: "assistive"`.
|
|
182
|
+
- A colour that depends on where an element sits (links and icons in a tinted
|
|
183
|
+
banner, the cells of a selected row, actions on a dark card) is a contextual
|
|
184
|
+
role: the container's surface profile `provides: { "--link-ink": "--on-warning" }`.
|
|
185
|
+
The children read their own roles and need no prop; composed contrast proves
|
|
186
|
+
their text there. Do not add a `tone` prop for a container's colour; keep
|
|
187
|
+
`tone` for a background the design system cannot know (a photo).
|
|
188
|
+
- `enter: { from: { surface, translate | translateInline | scale | rotate }, motion }` on a root
|
|
170
189
|
or a region part is an entrance on first render: the element starts from a
|
|
171
190
|
surface that states only `opacity` and `blur`, and at most one movement read
|
|
172
191
|
from the entrance's motion profile, then settles. See the motion reference.
|
|
@@ -175,7 +194,12 @@ a recipe never creates a state machine.
|
|
|
175
194
|
separate owner only to give an element padding, a border or a size. The
|
|
176
195
|
drawn box of a checkbox, radio or switch whose native `<input>` is hidden
|
|
177
196
|
takes `focus: { of: "<the input's part>" }`: the focus profile's outline is
|
|
178
|
-
drawn on the box while the input has keyboard focus.
|
|
197
|
+
drawn on the box while the input has keyboard focus. The input's part,
|
|
198
|
+
declared right before the box, takes `drawnBy: "<the box's part>"`: it takes
|
|
199
|
+
no room and lies, invisible, over the box at the box's frame size, so pointer
|
|
200
|
+
and keyboard still reach the real input. A part rendered once per list item
|
|
201
|
+
(`tabs.map(…)`) is declared `repeat: true`: every instance takes the part's
|
|
202
|
+
construction, and `extent: "fill"` shares the row among them. A visual part may sit
|
|
179
203
|
inside such a part: the owner reads it by its name (`recipe.parts.<name>`,
|
|
180
204
|
`recipe.assets.<name>.source`), which one nested part of the recipe has. On a
|
|
181
205
|
visual part the frame's size is the box and the drawing keeps its visual
|
package/dist/spatial-model.mjs
CHANGED
|
@@ -268,8 +268,8 @@ function expand(css, model) {
|
|
|
268
268
|
delete next.span;
|
|
269
269
|
state = next;
|
|
270
270
|
const count = inherited?.[index] ?? Number(props.columns ?? point.count), auto = state.start === "auto", start = auto ? 1 : integer(state.start);
|
|
271
|
-
if (auto &&
|
|
272
|
-
fail(`${cell.params} auto placement
|
|
271
|
+
if (auto && state.end !== void 0)
|
|
272
|
+
fail(`${cell.params} auto placement takes a span; end needs a start line.`);
|
|
273
273
|
const span = state.end !== void 0 ? integer(state.end) - start : state.span === "full" ? count - start + 1 : integer(state.span);
|
|
274
274
|
if (!Number.isInteger(start) || !Number.isInteger(span) || span < 1 || start + span - 1 > count)
|
|
275
275
|
fail(`${cell.params} placement ${state.start}/${state.end !== void 0 ? `end ${state.end}` : String(state.span)} exceeds ${count} columns at ${point.name}.`);
|