@reqvire-org/ads 0.5.19 → 0.5.20
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 +2 -2
- package/dist/analysis/owner-source.mjs +7 -1
- package/dist/construction-spec.d.mts +5 -0
- package/dist/construction-spec.mjs +6 -2
- package/dist/design-context-model.d.mts +2 -0
- package/dist/design-context-model.mjs +2 -1
- package/dist/foundation-macro.d.mts +5 -0
- package/dist/lowering-properties.mjs +2 -0
- package/dist/lowering-region-layout.mjs +2 -0
- package/dist/mcp/preview-http.bundle.js +3 -3
- package/dist/mcp/preview-widget.bundle.js +13 -13
- package/dist/ownership-model.mjs +1 -0
- package/dist/preview-resources.mjs +1 -0
- package/dist/recipe-macro.d.mts +6 -0
- package/dist/recipe-model.mjs +2 -1
- package/dist/render-audit/layout-overflow.page.mjs +1 -1
- package/dist/skills/ads-designer/references/accessibility.md +3 -1
- package/docs/CHANGELOG.md +61 -0
- package/docs/GUIDE.md +3 -0
- package/docs/LANGUAGE.md +1 -0
- package/docs/RULES.md +1 -1
- package/package.json +1 -1
package/dist/ownership-model.mjs
CHANGED
|
@@ -62,6 +62,7 @@ const identifier = /^[a-z][\w-]*$/, profile = /^[a-z][\w-]*(?:\([a-z][\w-]*:\s*[
|
|
|
62
62
|
selector: (value) => /^\.[a-z][\w-]*$/.test(value),
|
|
63
63
|
required: oneOf("true", "false"),
|
|
64
64
|
wrap: oneOf("true", "false", ...TEXT_WRAPS),
|
|
65
|
+
hyphens: oneOf("auto"),
|
|
65
66
|
"text-align": TEXT_ALIGN,
|
|
66
67
|
"reserve-lines": oneOf("1", "2", "3"),
|
|
67
68
|
collapsed: oneOf("true", "false"),
|
|
@@ -257,6 +257,7 @@ export async function createPreviewResources(output, options, entries, { retain,
|
|
|
257
257
|
...refresh ? { refresh } : {},
|
|
258
258
|
themes: contexts.themes,
|
|
259
259
|
...contexts.brands.length ? { brands: contexts.brands } : {},
|
|
260
|
+
...contexts.language === void 0 ? {} : { language: contexts.language },
|
|
260
261
|
...spatial === void 0 ? {} : { spatial },
|
|
261
262
|
assets: records,
|
|
262
263
|
scenarios
|
package/dist/recipe-macro.d.mts
CHANGED
|
@@ -332,6 +332,12 @@ export interface RecipeSpec {
|
|
|
332
332
|
*/
|
|
333
333
|
/** `"preserve"`: spaces and line breaks kept, long lines wrapped (code that stays visible at the column's width). */
|
|
334
334
|
readonly wrap?: boolean | "anywhere" | "never" | "truncate" | "balance" | "pretty" | "preserve";
|
|
335
|
+
/**
|
|
336
|
+
* `"auto"`: a word too long for its line breaks at a hyphenation point, with a hyphen, in the document's language
|
|
337
|
+
* (the foundation's `language` in previews; the application's `<html lang>`). For headings and titles whose long
|
|
338
|
+
* words can outgrow a narrow column at large text sizes.
|
|
339
|
+
*/
|
|
340
|
+
readonly hyphens?: "auto";
|
|
335
341
|
readonly textAlign?: "start" | "center" | "end";
|
|
336
342
|
/** Lines of the part's text profile it always reserves. */
|
|
337
343
|
readonly reserveLines?: 1 | 2 | 3;
|
package/dist/recipe-model.mjs
CHANGED
|
@@ -222,7 +222,8 @@ export const combineRecipes = (...inputs) => rejecting(() => {
|
|
|
222
222
|
};
|
|
223
223
|
return makeRecipe(inputs.reduce((result, input) => merge(result, input.spec, "recipe"), {}));
|
|
224
224
|
}), foundation = (spec) => rejecting(() => {
|
|
225
|
-
only(spec, ["tokens", "text", "surface", "focus", "reset", "themes", "brands", "palette", "followSystemTheme", "sections", "appIcon", "scrollbarGutter"]);
|
|
225
|
+
only(spec, ["tokens", "text", "surface", "focus", "reset", "themes", "brands", "palette", "followSystemTheme", "sections", "appIcon", "scrollbarGutter", "language"]);
|
|
226
|
+
check(spec.language === void 0 || typeof spec.language === "string" && /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(spec.language), `Foundation's language is a BCP 47 tag ("en", "de-CH"), or omitted`);
|
|
226
227
|
check(spec.scrollbarGutter === void 0 || spec.scrollbarGutter === "stable", `Foundation's scrollbarGutter is "stable", or omitted`);
|
|
227
228
|
check(spec.tokens === "./tokens", "Foundation uses the owned role directory");
|
|
228
229
|
check(typeof spec.text === "string" && typeof spec.surface === "string", "Foundation needs text and surface profiles");
|
|
@@ -177,7 +177,7 @@ export async function layoutOverflow({ nodeLimit, width: expected, container, sm
|
|
|
177
177
|
report(edge, element, { overflow: Math.round(Math.max(box.right - pane.right, pane.left - box.left)) });
|
|
178
178
|
{
|
|
179
179
|
let broken = 0;
|
|
180
|
-
const flowing = style.textOverflow !== "ellipsis" && !style.whiteSpace.startsWith("pre") && !style.whiteSpace.startsWith("break");
|
|
180
|
+
const flowing = !((style.hyphens === "auto" || style.getPropertyValue("-webkit-hyphens") === "auto") && !!element.closest("[lang]")?.getAttribute("lang")) && style.textOverflow !== "ellipsis" && !style.whiteSpace.startsWith("pre") && !style.whiteSpace.startsWith("break");
|
|
181
181
|
for (const node of flowing ? element.childNodes : []) {
|
|
182
182
|
if (node.nodeType !== Node.TEXT_NODE)
|
|
183
183
|
continue;
|
|
@@ -216,7 +216,9 @@ manual checks below.
|
|
|
216
216
|
like its sibling without that state fails (`a11y-forced-colors-render`).
|
|
217
217
|
- **What the layout pass reports.** Words broken across lines by a squeezed box (`broken-word`); a scroll area
|
|
218
218
|
collapsed to nothing while it holds content (`collapsed-scroller`); a box whose painted edge a clip cuts (a card's
|
|
219
|
-
border and corners); text, controls and overflow as before. An inert pane of no size is skipped.
|
|
219
|
+
border and corners); text, controls and overflow as before. An inert pane of no size is skipped. A long heading
|
|
220
|
+
word that cannot fit a phone column at 200% text is not fixed by a minimum width: give the text part
|
|
221
|
+
`hyphens: "auto"` and the foundation its `language`, so it breaks at a hyphenation point, which is not reported.
|
|
220
222
|
- **What it no longer reports.** A target whose owned hit area is 24 × 24px; `aria-hidden` text (avatar initials)
|
|
221
223
|
as a control's visible label; a multi-colour mark judged by its first outline instead of its strongest paint.
|
|
222
224
|
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,66 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.20
|
|
4
|
+
|
|
5
|
+
<!-- ads-local-tests:start -->
|
|
6
|
+
Hot patch: the unit and integration groups; the browser group was not run.
|
|
7
|
+
Quick hot patch (on the owner's instruction, only the tests the fix may affect): unit region-layout-lowering.test.ts, design-contexts.test.ts, recipe-owner-values.test.ts; integration hyphenation.test.mjs, scroll-reach.test.mjs, interaction-properties.test.ts, starter-check.test.ts, showcase-ui-foundation.test.ts; not the whole unit or integration group. The changed audit page check runs only in tests/browser/broken-words.test.mjs, which passed 4/4 on this source separately.
|
|
8
|
+
Local verification: **104/104 passed** (unit 56, integration 48).
|
|
9
|
+
Tested commit: `ad62c6a0359d5e4dcaf115849395e9c86996669b`; Bun 1.4.4.
|
|
10
|
+
Completed 2026-11-26T20:48:50.947Z (68 seconds).
|
|
11
|
+
|
|
12
|
+
<!-- ads-local-test-proof
|
|
13
|
+
{
|
|
14
|
+
"schema": 3,
|
|
15
|
+
"version": "0.5.20",
|
|
16
|
+
"commit": "ad62c6a0359d5e4dcaf115849395e9c86996669b",
|
|
17
|
+
"sourceSha256": "ea8139ed8c484fe0d4f4980fff097f96cc0eab32a7920f223c6d665c69e2bc85",
|
|
18
|
+
"command": "bun run test:hotpatch",
|
|
19
|
+
"scope": "hotpatch",
|
|
20
|
+
"result": "pass",
|
|
21
|
+
"tests": 104,
|
|
22
|
+
"pass": 104,
|
|
23
|
+
"fail": 0,
|
|
24
|
+
"skipped": 0,
|
|
25
|
+
"groups": [
|
|
26
|
+
{
|
|
27
|
+
"name": "unit",
|
|
28
|
+
"tests": 56,
|
|
29
|
+
"pass": 56,
|
|
30
|
+
"fail": 0,
|
|
31
|
+
"skipped": 0,
|
|
32
|
+
"reportSha256": "2b48ad63d7d229bcd50a6efb35cf4b64f7fc7b0a37e89d20e84f7ffa564b1a6a"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "integration",
|
|
36
|
+
"tests": 48,
|
|
37
|
+
"pass": 48,
|
|
38
|
+
"fail": 0,
|
|
39
|
+
"skipped": 0,
|
|
40
|
+
"reportSha256": "da9f30995ea6add7c084635f2d07e01dfc7a48a6c91706b2523ed6ed69568b82"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"testOverrides": {},
|
|
44
|
+
"bun": "1.4.4",
|
|
45
|
+
"completedAt": "2026-11-26T20:48:50.947Z",
|
|
46
|
+
"durationMs": 68373,
|
|
47
|
+
"logSha256": "08059cf29c478fef02acc0df98af7f1b5e1b549590667e72ce0427d9ffffeaf4"
|
|
48
|
+
}
|
|
49
|
+
-->
|
|
50
|
+
<!-- ads-local-tests:end -->
|
|
51
|
+
|
|
52
|
+
- *Hyphenation*: a text part's `hyphens: "auto"` breaks a long word at a
|
|
53
|
+
hyphenation point, with a hyphen, in the document's language (a heading word
|
|
54
|
+
at 200% text on a phone). The foundation's new `language` (a BCP 47 tag) is
|
|
55
|
+
declared on previews' `<html lang>`. The render audit does not report a word
|
|
56
|
+
hyphenated in a page with a language as a broken word.
|
|
57
|
+
- *Keyboard access to scrolling layers*: `review/scroll-unreachable` now also
|
|
58
|
+
covers a popover or dialog root whose frame caps its height (it scrolls by
|
|
59
|
+
ADS's lowering), and content inside a scroller with a negative `tabIndex` no
|
|
60
|
+
longer counts as reaching it; a scroller with its own `tabIndex` (a listbox an
|
|
61
|
+
input names by `aria-activedescendant`) does. Its repair names the fix: scroll
|
|
62
|
+
the listbox itself.
|
|
63
|
+
|
|
3
64
|
## 0.5.19
|
|
4
65
|
|
|
5
66
|
<!-- ads-local-tests:start -->
|
package/docs/GUIDE.md
CHANGED
|
@@ -1029,6 +1029,9 @@ declared order. The first theme and brand are the defaults: the `:root` values
|
|
|
1029
1029
|
of the token sheets. The render audit, capture, the showcase and `ads_status`
|
|
1030
1030
|
read the same declaration. Two optional fields are `true` or omitted:
|
|
1031
1031
|
|
|
1032
|
+
- `language: "en"` (a BCP 47 tag): the language of the content. Previews
|
|
1033
|
+
declare it on `<html lang>`, so text parts with `hyphens: "auto"` hyphenate
|
|
1034
|
+
there as they do in the application, which sets its own `<html lang>`.
|
|
1032
1035
|
- `scrollbarGutter: "stable"` (a value, not `true`): the page keeps its
|
|
1033
1036
|
scrollbar's room at all times (`scrollbar-gutter: stable` on the document),
|
|
1034
1037
|
so opening a modal, whose scroll lock hides the scrollbar, shifts nothing,
|
package/docs/LANGUAGE.md
CHANGED
|
@@ -287,6 +287,7 @@ them all.
|
|
|
287
287
|
| `normalize: { textDecoration: "none", pointerEvents: "none", borderStyle: "none" }` | root, `normalize.when`; `textDecoration` and `pointerEvents` also on a part (a link card's link, a decorative layer at any depth) | `text-decoration-line`, `pointer-events`, `border-style` | pointer transparency on focusable or interactive, non-`aria-hidden` markup (`source/pointer-transparent-interactive`) |
|
|
288
288
|
| `normalize: { cursor, touchAction, userSelect }`, `snap` | root, part, `normalize.when`; scrolling arrangement | see [interaction properties](#interaction-properties) | a value outside its set (`spec/value-invalid`); snap without scrolling (`snap-without-scroll`) |
|
|
289
289
|
| `wrap: "anywhere" \| "never" \| "truncate" \| "balance" \| "pretty" \| "preserve"` (`true` = anywhere), `textAlign`, `reserveLines: 1–3` | text part | `overflow-wrap`, `white-space`, one-line ellipsis truncation, `text-wrap: balance \| pretty` (without support: normal wrapping); `"preserve"`: `white-space: pre-wrap` with `overflow-wrap: anywhere`, so code keeps its spaces and line breaks and a long line continues on the next visual line (all of it visible at the column's width; `overflow: "scroll-inline"` on its block keeps lines whole instead); `text-align`; `min-block-size: Nlh` | reserved lines without a text profile (`reserve-without-text`) |
|
|
290
|
+
| `hyphens: "auto"` | text part | a word too long for its line breaks at a hyphenation point, with a hyphen (`hyphens: auto` and `-webkit-hyphens: auto`), in the document's language: the application's `<html lang>`, the foundation's `language` in previews. For headings and titles whose long words outgrow a narrow column at large text sizes; the render audit does not report such a word as broken when the page has a language | with `wrap: "never"`, `"truncate"` or `"preserve"` (that text is not broken across lines) |
|
|
290
291
|
| `wrap: "truncate", lines: 2 \| 3` | text part | a clamp: at most N lines, the last ending in "…" (`line-clamp` beside `display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp`, `overflow: hidden`) | `lines: 1` or another value (one line is plain `truncate`); `reserveLines` above `lines` (`spec/value-invalid` at `reserveLines`, naming both); `lines` with another `wrap`; on a declared `element`; an arrangement's display (`extent-conflict`); on, or inside, a control or form label (`source/clamp-on-control`) |
|
|
291
292
|
| control label `wrap`: absent, `true`/`"anywhere"`, `"never"` | control text part | breaks between words when one word alone would overflow (`overflow-wrap: break-word`, the default), anywhere, or never: one line, and the control does not shrink below the label's width | `"truncate"` or another value |
|
|
292
293
|
| control label `textAlign: "start" \| "center" \| "end"` | control text part | `text-align` on the label: how its lines sit once it wraps or the control is wider than it | another value |
|
package/docs/RULES.md
CHANGED
|
@@ -268,7 +268,7 @@ Owned markup or motion lacks required accessible semantics: a text alternative,
|
|
|
268
268
|
| `review/motion-endless` | review | Motion that starts by itself, runs longer than five seconds and is shown beside other content can be paused, stopped or hidden by the user (WCAG 2.2 2.2.2). A repeating sequence a part plays whenever it is rendered has no owner state to stop it by; reduced motion stops it only for users who set that preference. A note, not a review: a short indicator shown only while something is working ends with that work. | If it can run for more than five seconds beside other content, play it under an owner state (`when: { '&[data-working="true"]': { play } }`) and give the user a way to stop it; an indicator that is rendered only while work is in progress needs nothing. | `ads://guides/accessibility`, `ads://guides/recipes` |
|
|
269
269
|
| `review/non-text-contrast-unresolved` | review | A control part's border and focus contrast against its surroundings is proven from tokens; a translucent background, an unresolved colour or an offset ADS cannot evaluate is reviewed, never passed. | Check the rendered boundary and focus indicator by hand (ads audit), or use opaque colour tokens for the control and its surroundings. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
270
270
|
| `review/paint-contrast-unresolved` | review | A runtime paint's contrast over its declared values is proven from tokens against the background the construction knows; an element painting on its parent's background, a translucent background or an unresolved colour is reviewed, never passed. | Give the element (or the root it sits in) a surface with an opaque background colour token, or check the rendered paints in every context by hand (ads audit). | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
271
|
-
| `review/scroll-unreachable` | review | A scroll container is reachable by keyboard: it or content inside it is
|
|
271
|
+
| `review/scroll-unreachable` | review | A scroll container is reachable by keyboard: it takes focus itself (any tabIndex), or content inside it is in the Tab order (a negative tabIndex inside is not). A popover or dialog root whose frame caps its height scrolls too. Some browsers (Safari) do not focus a scroller on their own. | Scroll the element that is reachable: a listbox whose options an input names (`aria-activedescendant`) scrolls itself (`overflow: "scroll-block"` and the height cap on that part, not on the popover). Otherwise give the scroll container `tabIndex={0}` and an accessible name when its content holds nothing focusable; ignore this note when public components inside it are focusable. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
272
272
|
| `review/state-contrast-unresolved` | review | An element's owner states pair colours and backgrounds whose contrast ADS proves from tokens; a translucent or unresolvable pair is reviewed, never passed. | Check the state's rendered contrast by hand (ads audit), or give the state an opaque surface that sets both colour and background. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
273
273
|
| `review/touch-action-unhandled` | review | `touchAction: "none"` hands every touch gesture on the element to the owner: its markup handles pointer or touch events (`onPointerDown`, `onTouchStart`, …), or the element cannot be scrolled, zoomed or used on a touch screen. | Handle the gesture on the element (`onPointerDown` with `setPointerCapture`, then `onPointerMove`/`onPointerUp`), use `pan-x` or `pan-y` to keep scrolling on the other axis, or remove `touchAction`; ignore this note when a declared behaviour library attaches the listeners. | `ads://guides/recipes`, `ads://guides/accessibility` |
|
|
274
274
|
| `review/truncated-text-unnamed` | review | Truncated or clamped text keeps its full text available to sighted readers: a `title` with the same text, an expand control or the full content elsewhere (assistive technology reads the full text already). Analysis sees only a `title`. | Set `title` on the truncated element to its full text; when an expand control or the full content elsewhere shows it, the note can be dismissed after review. | `ads://guides/recipes`, `ads://guides/accessibility` |
|