@reqvire-org/ads 0.5.18 → 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.
@@ -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
@@ -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;
@@ -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;
@@ -12,7 +12,7 @@ import { cornerOverpaint } from "./corner-overpaint.page.mjs";
12
12
  import { forcedStates } from "./forced-states.page.mjs";
13
13
  import { overflowOnly, overridePasses, viewportPasses } from "./text-scale.mjs";
14
14
  import { auditRenderStates, listTargets } from "./render-states.mjs";
15
- import { brandReady, hasAxe, hasMainLandmark, markRenderAudit, setScenarioState, themeReady } from "./worker.page.mjs";
15
+ import { brandReady, hasAxe, hasMainLandmark, outermostGridLayout, markRenderAudit, setScenarioState, themeReady } from "./worker.page.mjs";
16
16
  const argument = process.argv[2];
17
17
  if (!argument)
18
18
  throw Error("The render audit worker needs its request file as its first argument.");
@@ -238,15 +238,23 @@ try {
238
238
  delete result.derivedCorners;
239
239
  if (app.container && !await frame.evaluate(hasMainLandmark)) {
240
240
  await frame.addStyleTag({ content: `#root { inline-size: ${app.container}px; }` });
241
- const options = { nodeLimit: request.nodeLimit, container: app.container, smallPart: request.smallPart };
242
- let narrowed = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths.at(-1) ?? request.overflowWidths[0] });
243
- if (narrowed.issues.length) {
244
- await page.setViewportSize({ width: request.overflowWidths[0], height: request.viewport.height });
245
- const folded = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths[0] }), total = (result) => Object.values(result.counts).reduce((sum, count) => sum + (count ?? 0), 0);
246
- if (total(folded) < total(narrowed))
247
- narrowed = folded;
241
+ const wide = await frame.evaluate(outermostGridLayout), widest = request.overflowWidths.at(-1) ?? request.overflowWidths[0];
242
+ await page.setViewportSize({ width: request.overflowWidths[0], height: request.viewport.height });
243
+ const narrow = await frame.evaluate(outermostGridLayout);
244
+ await page.setViewportSize({ width: widest, height: request.viewport.height });
245
+ if (wide !== null && wide !== narrow)
246
+ coverage.skipped.push({ reason: "page-section", name: "the 240 px pane render" });
247
+ else {
248
+ const options = { nodeLimit: request.nodeLimit, container: app.container, smallPart: request.smallPart };
249
+ let narrowed = await frame.evaluate(layoutOverflow, { ...options, width: widest });
250
+ if (narrowed.issues.length) {
251
+ await page.setViewportSize({ width: request.overflowWidths[0], height: request.viewport.height });
252
+ const folded = await frame.evaluate(layoutOverflow, { ...options, width: request.overflowWidths[0] }), total = (result) => Object.values(result.counts).reduce((sum, count) => sum + (count ?? 0), 0);
253
+ if (total(folded) < total(narrowed))
254
+ narrowed = folded;
255
+ }
256
+ layout.push({ width: app.container, container: !0, ...narrowed });
248
257
  }
249
- layout.push({ width: app.container, container: !0, ...narrowed });
250
258
  }
251
259
  if (await frame.locator("html").getAttribute("data-ads-preview-state") !== "ready")
252
260
  throw Error(`Scenario ${app.scenario} stopped being ready during the audit.`);
@@ -16,6 +16,24 @@ export function scenarioStateReady(state) {
16
16
  export function hasAxe() {
17
17
  return !!window.axe;
18
18
  }
19
+ export function outermostGridLayout() {
20
+ const root = document.getElementById("root");
21
+ if (!root)
22
+ return null;
23
+ const queue = [...root.children];
24
+ while (queue.length > 0) {
25
+ const element = queue.shift(), style = getComputedStyle(element);
26
+ if (style.display === "grid" || style.display === "inline-grid") {
27
+ const cells = [...element.children].map((child) => {
28
+ const cell = getComputedStyle(child);
29
+ return `${cell.gridColumnStart}/${cell.gridColumnEnd}/${cell.gridRowStart}/${cell.gridRowEnd}/${cell.display}`;
30
+ });
31
+ return JSON.stringify([style.gridTemplateColumns, style.gridTemplateRows, style.gridTemplateAreas, cells]);
32
+ }
33
+ queue.push(...element.children);
34
+ }
35
+ return null;
36
+ }
19
37
  export function hasMainLandmark() {
20
38
  return !!document.querySelector('main, [role="main"]');
21
39
  }
@@ -245,6 +245,7 @@ const skipReasons = {
245
245
  "derived-detached": "an element left the page while a derived owner state was measured",
246
246
  "derived-failed": "measuring a derived owner state failed",
247
247
  "content-still-changing": "the page kept changing past 5 s, so what it measured may be mid-change",
248
+ "page-section": "in the 240 px container its outermost grid lays out differently at a phone's viewport than at a desktop's, so its tiers follow the screen: a page section, which no pane hosts, so the container render was not measured",
248
249
  "focus-not-reachable": "a control a keyboard cannot reach (aria-hidden, inert, or tabindex -1 outside a roving widget): hover measured, focus not"
249
250
  }, overflowKinds = {
250
251
  document: {
@@ -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
 
@@ -180,8 +180,15 @@ An application follows the same rule as a mock, and can prove it with
180
180
  - **Links.** A link owner renders `<a href>` and reports the click (an
181
181
  `onNavigate` prop), so the application can navigate with its router.
182
182
  - **Libraries.** Functions and hooks are behavior and stay in the application.
183
- A component that renders nothing (a provider, an outlet) is the application's
184
- to place. A component with its own design is not used.
183
+ A component that renders nothing (a provider, an outlet, `Suspense`) is the
184
+ application's to place, listed in the guard's `allow`. A component with its
185
+ own design is not used.
186
+ - **The application's own components are composition.** Routing (`App`), a
187
+ route's page, a lazily loaded dialog host stay in the application, rendering
188
+ design-system owners: the guard checks their bodies, not their names. Never
189
+ add an element, a class or a string tag there, and never settle a guard
190
+ finding by excluding the file or listing a component in `allow` that renders
191
+ design.
185
192
 
186
193
  ### The guard
187
194
 
@@ -5,7 +5,8 @@ Adapted from Emil Kowalski's break-ui skill (MIT); see the skill README for cred
5
5
  ADS already proves the construction: `ads check` validates layout, tokens, contrast and
6
6
  accessibility rules, and the render audit fails horizontal overflow at 390, 768 and 1280 px
7
7
  (`layout-overflow`) and lists narrow-container overflow for review (`layout-overflow-narrow`),
8
- except a control spilling over its own box (kind `escaped`), an error at any width.
8
+ except a control spilling over its own box (kind `escaped`), an error at any width. A page
9
+ section, whose grid follows viewport tiers, is not rendered in that pane (a skipped info item).
9
10
  A stress test adds what no guard knows: **which real content and states break this UI**.
10
11
 
11
12
  ## Choose the work
@@ -180,8 +180,15 @@ An application follows the same rule as a mock, and can prove it with
180
180
  - **Links.** A link owner renders `<a href>` and reports the click (an
181
181
  `onNavigate` prop), so the application can navigate with its router.
182
182
  - **Libraries.** Functions and hooks are behavior and stay in the application.
183
- A component that renders nothing (a provider, an outlet) is the application's
184
- to place. A component with its own design is not used.
183
+ A component that renders nothing (a provider, an outlet, `Suspense`) is the
184
+ application's to place, listed in the guard's `allow`. A component with its
185
+ own design is not used.
186
+ - **The application's own components are composition.** Routing (`App`), a
187
+ route's page, a lazily loaded dialog host stay in the application, rendering
188
+ design-system owners: the guard checks their bodies, not their names. Never
189
+ add an element, a class or a string tag there, and never settle a guard
190
+ finding by excluding the file or listing a component in `allow` that renders
191
+ design.
185
192
 
186
193
  ### The guard
187
194
 
@@ -180,8 +180,15 @@ An application follows the same rule as a mock, and can prove it with
180
180
  - **Links.** A link owner renders `<a href>` and reports the click (an
181
181
  `onNavigate` prop), so the application can navigate with its router.
182
182
  - **Libraries.** Functions and hooks are behavior and stay in the application.
183
- A component that renders nothing (a provider, an outlet) is the application's
184
- to place. A component with its own design is not used.
183
+ A component that renders nothing (a provider, an outlet, `Suspense`) is the
184
+ application's to place, listed in the guard's `allow`. A component with its
185
+ own design is not used.
186
+ - **The application's own components are composition.** Routing (`App`), a
187
+ route's page, a lazily loaded dialog host stay in the application, rendering
188
+ design-system owners: the guard checks their bodies, not their names. Never
189
+ add an element, a class or a string tag there, and never settle a guard
190
+ finding by excluding the file or listing a component in `allow` that renders
191
+ design.
185
192
 
186
193
  ### The guard
187
194
 
package/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,131 @@
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
+
64
+ ## 0.5.19
65
+
66
+ <!-- ads-local-tests:start -->
67
+ Hot patch: the unit and integration groups; the browser group was not run.
68
+ Quick hot patch (on the owner's instruction, only the tests the fix may affect): unit render-audit-states.test.ts, render-audit-derived.test.ts, escaped-severity.test.ts; integration guard-components.test.ts, guard-package.test.mjs, design-usage.test.ts, guard-externals.test.ts; not the whole unit or integration group. The changed audit worker runs only in tests/browser/render-audit.test.mjs, which passed 38/38 on this source separately.
69
+ Local verification: **18/18 passed** (unit 8, integration 10).
70
+ Tested commit: `f4ccd26f02e5f8812f0a99891e3db21811c4657c`; Bun 1.4.4.
71
+ Completed 2026-11-26T18:24:21.095Z (2 seconds).
72
+
73
+ <!-- ads-local-test-proof
74
+ {
75
+ "schema": 3,
76
+ "version": "0.5.19",
77
+ "commit": "f4ccd26f02e5f8812f0a99891e3db21811c4657c",
78
+ "sourceSha256": "34284323140a5e289b261623eb489d022f8b1f77349fcaee5b38b0dfcdba89d6",
79
+ "command": "bun run test:hotpatch",
80
+ "scope": "hotpatch",
81
+ "result": "pass",
82
+ "tests": 18,
83
+ "pass": 18,
84
+ "fail": 0,
85
+ "skipped": 0,
86
+ "groups": [
87
+ {
88
+ "name": "unit",
89
+ "tests": 8,
90
+ "pass": 8,
91
+ "fail": 0,
92
+ "skipped": 0,
93
+ "reportSha256": "ca7eeb2e9a60e6dd5c113096463e03eea7edcc4f6dc1625ca74fb797826ccb2c"
94
+ },
95
+ {
96
+ "name": "integration",
97
+ "tests": 10,
98
+ "pass": 10,
99
+ "fail": 0,
100
+ "skipped": 0,
101
+ "reportSha256": "2b54f3b8443ec52a1d2e322aa232b18dbbaca7fbf0f20cd7cfe01069c1e63bd3"
102
+ }
103
+ ],
104
+ "testOverrides": {},
105
+ "bun": "1.4.4",
106
+ "completedAt": "2026-11-26T18:24:21.095Z",
107
+ "durationMs": 2171,
108
+ "logSha256": "40e04ff8fd3b03408376ea5c1a1a4e287741f6e53a44f9ec1af2c2ee1207005c"
109
+ }
110
+ -->
111
+ <!-- ads-local-tests:end -->
112
+
113
+ - *ads-guard: components are composition* (#81): the guard reads the
114
+ application with its own TypeScript types. Its own components (an `App` that
115
+ routes, a route's `Page` held in state, a lazily loaded dialog body, `memo`
116
+ and `lazy` of its components) pass, and their bodies are checked. Markup it
117
+ creates stays `design-usage/local-markup`, now also a tag whose type is a
118
+ string and `h("div")`. New: `design-usage/unlisted-component` for a component
119
+ read from a package not in `allow` (imported, off a namespace, or from a
120
+ factory such as `styled("div")`), and `design-usage/unchecked-component` for
121
+ one declared in a file the guard does not check. `Fragment` and `Suspense`
122
+ now need listing in `allow` when imported.
123
+ - *Render audit: page sections are not measured in a pane*: in the 240 px
124
+ container the audit lays a scenario out at a desktop and a phone viewport;
125
+ when its outermost grid's layout differs, its tiers follow the screen, so no
126
+ pane hosts it. The container render is skipped, reported as a
127
+ `render-audit-skipped` info item. Container-context grids are still measured.
128
+
3
129
  ## 0.5.18
4
130
 
5
131
  <!-- ads-local-tests:start -->
package/docs/GUIDE.md CHANGED
@@ -678,10 +678,15 @@ What the audit measures in each render:
678
678
  fixed layers and visually hidden content are exempt.
679
679
  - Components and patterns are also rendered in a 240 px container. What does
680
680
  not fit a side pane is a `layout-overflow-narrow` review item (an escaping
681
- control is an error). A layout whose tiers follow the viewport (a page
682
- section's grid) is measured in that container at the 390 px viewport, where
683
- it folds, when that reports less: it never shows its desktop layout in a
684
- pane. A container-context grid follows the pane at any viewport.
681
+ control is an error).
682
+ - A page section is not measured there. In the 240 px container the audit
683
+ lays the scenario out at a desktop and at a phone viewport; when its
684
+ outermost grid's tracks or cell placement differ, its tiers follow the
685
+ screen, so no pane hosts it (a hero, a pricing band, a page-wide card grid).
686
+ The skip is a `render-audit-skipped` info item naming the scenario. A grid
687
+ with `context: "container"` lays out the same at both and is measured.
688
+ - A layout whose tiers follow the viewport further in is measured in that
689
+ container at the 390 px viewport, where it folds, when that reports less.
685
690
  - **Text scaling** (WCAG 1.4.4, 1.4.10, 1.4.12), once per scenario in the first
686
691
  theme and brand, because text does not follow colour. The passes add about a
687
692
  tenth to the audit's time.
@@ -1024,6 +1029,9 @@ declared order. The first theme and brand are the defaults: the `:root` values
1024
1029
  of the token sheets. The render audit, capture, the showcase and `ads_status`
1025
1030
  read the same declaration. Two optional fields are `true` or omitted:
1026
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>`.
1027
1035
  - `scrollbarGutter: "stable"` (a value, not `true`): the page keeps its
1028
1036
  scrollbar's room at all times (`scrollbar-gutter: stable` on the document),
1029
1037
  so opening a modal, whose scroll lock hides the scrollbar, shifts nothing,
@@ -1563,6 +1571,15 @@ Where to run it:
1563
1571
  that does not exist is an error, so the list cannot hide anything.
1564
1572
  - `allow` lists components of other packages that carry no design, one by one:
1565
1573
  a router's outlet, providers, the framework's own markers.
1574
+ - Design is markup and style; components are composition. The application's
1575
+ own components (an `App` that routes, a route's page held in state, a lazily
1576
+ loaded dialog body, `memo` and `lazy` of its components) pass wherever they
1577
+ are rendered, and their bodies are checked. What the application creates
1578
+ itself is `design-usage/local-markup`: an element, a tag whose type is a
1579
+ string, `h("div")`. A component read from a package not in `allow` is
1580
+ `design-usage/unlisted-component`, where it is read; one declared in a file
1581
+ the guard does not check is `design-usage/unchecked-component`. The guard
1582
+ reads each file with the application's own TypeScript project.
1566
1583
  - Tests and the design system's own files are never checked; the report counts
1567
1584
  them. Document metadata (`<title>`, `<meta>`, `<script>`, a `<link>` that is
1568
1585
  not a stylesheet) is accepted anywhere.
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 focusable. Some browsers (Safari) do not focus a scroller on their own. | 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` |
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` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reqvire-org/ads",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
4
4
  "type": "module",
5
5
  "description": "A design system your agent can see and shape. Your components. Your look. Your code.",
6
6
  "repository": {