@motion-proto/live-tokens 0.98.2 → 0.99.0

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/bin/contractRunner.mjs +2 -2
  3. package/bin/rules/a11y.mjs +1 -1
  4. package/dist-plugin/index.cjs +71 -15
  5. package/dist-plugin/index.js +71 -15
  6. package/package.json +1 -1
  7. package/src/editor/bootstrap.ts +3 -1
  8. package/src/editor/component-editor/SectionDividerEditor.svelte +9 -10
  9. package/src/editor/core/a11y/a11yReport.ts +85 -22
  10. package/src/editor/core/a11y/a11yReportTypes.ts +11 -3
  11. package/src/editor/core/a11y/contrastFixes.ts +41 -0
  12. package/src/editor/core/palettes/contrastPairs.ts +4 -1
  13. package/src/editor/docs/content/accessibility.md +67 -18
  14. package/src/editor/docs/content/editing-tokens.md +4 -0
  15. package/src/editor/docs/content.generated.ts +2 -2
  16. package/src/editor/pages/ComponentEditorPage.svelte +4 -3
  17. package/src/editor/pages/EditorShell.svelte +10 -8
  18. package/src/editor/styles/ui-editor.css +2 -0
  19. package/src/editor/ui/a11y/A11yByEye.svelte +264 -0
  20. package/src/editor/ui/a11y/A11yComponentIssues.svelte +34 -16
  21. package/src/editor/ui/a11y/A11yFindingRow.svelte +66 -4
  22. package/src/editor/ui/a11y/A11yIssueRow.svelte +55 -24
  23. package/src/editor/ui/a11y/A11yOverview.svelte +72 -68
  24. package/src/editor/ui/a11y/A11yPanel.svelte +29 -4
  25. package/src/editor/ui/a11y/A11yPropertyMark.svelte +8 -8
  26. package/src/editor/ui/a11y/A11yRailMark.svelte +11 -4
  27. package/src/editor/ui/a11y/AccessibilityTab.svelte +22 -35
  28. package/src/editor/ui/a11y/a11yView.ts +50 -11
  29. package/src/live-tokens/data/colors-and-type/halloween.json +1 -1
  30. package/src/live-tokens/data/themes/autumn.json +16 -16
  31. package/src/live-tokens/data/themes/halloween.json +17 -17
  32. package/src/live-tokens/data/themes/midnight-study.json +16 -16
  33. package/src/live-tokens/data/themes/ocean.json +16 -16
  34. package/src/live-tokens/data/themes/royal-velvet.json +16 -16
  35. package/src/live-tokens/data/themes/sketchy.json +16 -16
  36. package/src/live-tokens/data/themes/spring-meadow.json +16 -16
  37. package/src/live-tokens/data/themes/sunset.json +16 -16
  38. package/src/system/components/Button.svelte +3 -3
  39. package/src/system/components/InlineEditActions.svelte +1 -1
  40. package/src/system/components/Input.svelte +1 -1
  41. package/src/system/components/MenuSelect.svelte +1 -1
  42. package/src/system/components/ProgressBar.svelte +1 -1
  43. package/src/system/components/SlidePager.svelte +1 -1
  44. package/src/system/components/Slider.svelte +6 -6
  45. package/src/system/components/TabBar.svelte +1 -1
  46. package/src/system/components/Toggle.svelte +1 -1
  47. package/src/testing-js/{chunk-RWH46IU5.js → chunk-7QXUJRSO.js} +2 -2
  48. package/src/testing-js/chunk-GZKUYLDW.js +193 -0
  49. package/src/testing-js/chunk-GZKUYLDW.js.map +1 -0
  50. package/src/testing-js/{chunk-SHLPDNAQ.js → chunk-RTZQLW3F.js} +172 -181
  51. package/src/testing-js/chunk-RTZQLW3F.js.map +1 -0
  52. package/src/testing-js/{chunk-5HNZHIHG.js → chunk-RWOT2XDB.js} +2 -2
  53. package/src/testing-js/{chunk-5HNZHIHG.js.map → chunk-RWOT2XDB.js.map} +1 -1
  54. package/src/testing-js/{chunk-R54I7YL6.js → chunk-THWGMSRH.js} +2 -2
  55. package/src/testing-js/component-a11y.contract.js +53 -23
  56. package/src/testing-js/component-a11y.contract.js.map +1 -1
  57. package/src/testing-js/component-behavior.contract.js +1 -1
  58. package/src/testing-js/component-editor.contract.js +3 -3
  59. package/src/testing-js/component-render.contract.js +3 -3
  60. package/src/testing-js/index.js +4 -4
  61. package/src/testing-js/index.js.map +1 -1
  62. package/src/testing-js/page-compliance.contract.js +3 -3
  63. package/src/testing-js/vitest.js +2 -2
  64. package/template/_gitignore +3 -0
  65. package/src/testing-js/chunk-EWSGE27V.js +0 -168
  66. package/src/testing-js/chunk-EWSGE27V.js.map +0 -1
  67. package/src/testing-js/chunk-SHLPDNAQ.js.map +0 -1
  68. /package/src/testing-js/{chunk-RWH46IU5.js.map → chunk-7QXUJRSO.js.map} +0 -0
  69. /package/src/testing-js/{chunk-R54I7YL6.js.map → chunk-THWGMSRH.js.map} +0 -0
@@ -1,168 +0,0 @@
1
- // src/testing/support/a11y.ts
2
- import { test } from "@playwright/test";
3
- var A11Y_ANNOTATION = "a11y";
4
- var AXE_TAGS = ["wcag2a", "wcag2aa", "wcag21aa", "wcag22aa"];
5
- var SCOPE_ATTR = "data-lt-a11y-scope";
6
- var EXCLUDE_ATTR = "data-lt-a11y-exclude";
7
- var HTML_LIMIT = 300;
8
- var EngineMissing = class extends Error {
9
- };
10
- async function importEngine(packageName, load) {
11
- try {
12
- return await load();
13
- } catch (error) {
14
- if (error.code === "ERR_MODULE_NOT_FOUND") throw new EngineMissing(`${packageName} is not installed`);
15
- throw error;
16
- }
17
- }
18
- var axeModules = null;
19
- async function importAxe() {
20
- await importEngine("axe-core", () => import("axe-core"));
21
- const { AxeBuilder } = await importEngine("@axe-core/playwright", () => import("@axe-core/playwright"));
22
- return { AxeBuilder };
23
- }
24
- var loadAxe = () => axeModules ??= importAxe();
25
- var alfaModules = null;
26
- async function importAlfa() {
27
- const { Audit, Outcome } = await importEngine("@siteimprove/alfa-act", () => import("@siteimprove/alfa-act"));
28
- const { Rules } = await importEngine("@siteimprove/alfa-rules", () => import("@siteimprove/alfa-rules"));
29
- const { Node } = await importEngine("@siteimprove/alfa-dom", () => import("@siteimprove/alfa-dom"));
30
- const { Native: DomNative } = await importEngine("@siteimprove/alfa-dom", () => import("@siteimprove/alfa-dom/native"));
31
- const { Device } = await importEngine("@siteimprove/alfa-device", () => import("@siteimprove/alfa-device"));
32
- const { Native: DeviceNative } = await importEngine("@siteimprove/alfa-device", () => import("@siteimprove/alfa-device/native"));
33
- const { Page: AlfaPage } = await importEngine("@siteimprove/alfa-web", () => import("@siteimprove/alfa-web"));
34
- const http = await importEngine("@siteimprove/alfa-http", () => import("@siteimprove/alfa-http"));
35
- const { URL } = await importEngine("@siteimprove/alfa-url", () => import("@siteimprove/alfa-url"));
36
- return {
37
- Audit,
38
- Outcome,
39
- R65: Rules.get("R65").getUnsafe(),
40
- Node,
41
- DomNative,
42
- Device,
43
- DeviceNative,
44
- AlfaPage,
45
- http,
46
- URL
47
- };
48
- }
49
- var loadAlfa = () => alfaModules ??= importAlfa();
50
- async function missingEngine(engines) {
51
- try {
52
- for (const name of engines) await (name === "axe" ? loadAxe() : loadAlfa());
53
- return null;
54
- } catch (error) {
55
- if (error instanceof EngineMissing) return error.message;
56
- throw error;
57
- }
58
- }
59
- function axeResults(rule, results, withReasons) {
60
- return results.flatMap(
61
- (result) => result.nodes.map((node) => {
62
- const reasons = withReasons ? [...new Set([...node.any, ...node.all, ...node.none].map((check) => check.message).filter(Boolean))] : [];
63
- return {
64
- rule,
65
- engineRule: result.id,
66
- impact: node.impact ?? result.impact ?? null,
67
- target: node.target.map((part) => Array.isArray(part) ? part.join(" >>> ") : String(part)).join(" | "),
68
- html: node.html.slice(0, HTML_LIMIT),
69
- help: [result.help, ...reasons].join(". "),
70
- helpUrl: result.helpUrl
71
- };
72
- })
73
- );
74
- }
75
- async function scanAxe(page, scope, exclude, rule, only) {
76
- const { AxeBuilder } = await loadAxe();
77
- let builder = new AxeBuilder({ page }).include(scope);
78
- builder = only ? builder.withRules(only) : builder.withTags(AXE_TAGS);
79
- for (const selector of exclude) builder = builder.exclude(selector);
80
- if (rule === "a11y-page") builder = builder.disableRules(["color-contrast"]);
81
- const result = await builder.analyze();
82
- return [
83
- ...axeResults(rule, result.violations, false),
84
- ...axeResults("a11y-review", result.incomplete, true)
85
- ];
86
- }
87
- function pruneToScope(node) {
88
- if (node.type === "element" && node.attributes?.some((a) => a.name === SCOPE_ATTR)) return true;
89
- if (!node.children) return false;
90
- if (node.type === "element" && node.name === "head") return true;
91
- node.children = node.children.filter((child) => child.type === "type" || pruneToScope(child));
92
- return node.type === "document" || node.children.some((child) => child.type === "element");
93
- }
94
- var FOCUS_HELP = {
95
- failed: "Focusing the element changes nothing visible",
96
- cantTell: "Focusing the element changes no style on it, its descendants, or its ancestors"
97
- };
98
- async function scanFocusVisible(page, scope, exclude) {
99
- const alfa = await loadAlfa();
100
- await page.evaluate(({ scope: scope2, exclude: exclude2, scopeAttr, excludeAttr }) => {
101
- for (const element of document.querySelectorAll(scope2)) element.setAttribute(scopeAttr, "");
102
- for (const selector of exclude2) {
103
- for (const element of document.querySelectorAll(selector)) element.setAttribute(excludeAttr, "");
104
- }
105
- }, { scope, exclude, scopeAttr: SCOPE_ATTR, excludeAttr: EXCLUDE_ATTR });
106
- let json;
107
- try {
108
- const handle = await page.evaluateHandle(() => document);
109
- json = await handle.evaluate(alfa.DomNative.fromNode);
110
- await handle.dispose();
111
- } finally {
112
- await page.evaluate((attrs) => {
113
- for (const attr of attrs) for (const element of document.querySelectorAll(`[${attr}]`)) element.removeAttribute(attr);
114
- }, [SCOPE_ATTR, EXCLUDE_ATTR]);
115
- }
116
- pruneToScope(json);
117
- const fromWindow = alfa.DeviceNative.fromWindow;
118
- const device = alfa.Device.from(await page.evaluate(fromWindow));
119
- const url = alfa.URL.parse(page.url()).getUnsafe();
120
- const { Request, Response, Headers, Header } = alfa.http;
121
- const alfaPage = alfa.AlfaPage.of(
122
- Request.of("GET", url),
123
- Response.of(url, 200, Headers.of([Header.of("Content-Type", "text/html")])),
124
- alfa.Node.from(json, device),
125
- device
126
- );
127
- const results = [];
128
- for (const outcome of await alfa.Audit.of(alfaPage, [alfa.R65]).evaluate()) {
129
- const kind = alfa.Outcome.isFailed(outcome) ? "failed" : alfa.Outcome.isCantTell(outcome) ? "cantTell" : null;
130
- if (!kind) continue;
131
- const target = outcome.target;
132
- if (!inScope(target)) continue;
133
- results.push({
134
- rule: "a11y-focus-visible",
135
- engineRule: "SIA-R65",
136
- impact: null,
137
- target: elementLabel(target),
138
- html: target.toString().replace(/\s+/g, " ").slice(0, HTML_LIMIT),
139
- help: FOCUS_HELP[kind],
140
- helpUrl: alfa.R65.uri
141
- });
142
- }
143
- return results;
144
- }
145
- function inScope(target) {
146
- for (const node of target.inclusiveAncestors()) {
147
- if (typeof node.attribute !== "function") continue;
148
- if (node.attribute(EXCLUDE_ATTR).isSome()) return false;
149
- if (node.attribute(SCOPE_ATTR).isSome()) return true;
150
- }
151
- return false;
152
- }
153
- function elementLabel(target) {
154
- const id = target.id.isSome() ? `#${target.id.get()}` : "";
155
- return `${target.name}${id}${[...target.classes].map((name) => `.${name}`).join("")}`;
156
- }
157
- function recordA11y(results) {
158
- if (results.length === 0) return;
159
- test.info().annotations.push({ type: A11Y_ANNOTATION, description: JSON.stringify(results) });
160
- }
161
-
162
- export {
163
- missingEngine,
164
- scanAxe,
165
- scanFocusVisible,
166
- recordA11y
167
- };
168
- //# sourceMappingURL=chunk-EWSGE27V.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../testing/support/a11y.ts"],"sourcesContent":["import { test, type Page } from '@playwright/test';\n\nexport type A11yRule =\n | 'a11y-component'\n | 'a11y-page'\n | 'a11y-review'\n | 'a11y-focus-visible'\n | 'a11y-text-spacing'\n | 'a11y-reduced-motion'\n | 'a11y-keyboard';\n\n/** One element one engine flagged. `line` is the page file line, which only\n * the page suite can resolve; a component finding anchors on its runtime.\n * `view` names the variants, states, and themes the element failed in.\n * `variables` names the component properties the result traced to. */\nexport interface A11yResult {\n rule: A11yRule;\n engineRule: string;\n impact: string | null;\n target: string;\n html: string;\n help: string;\n helpUrl: string;\n line?: number;\n view?: string;\n variables?: string[];\n}\n\nconst A11Y_ANNOTATION = 'a11y';\n\nexport type A11yEngine = 'axe' | 'alfa';\n\nconst AXE_TAGS = ['wcag2a', 'wcag2aa', 'wcag21aa', 'wcag22aa'];\nconst SCOPE_ATTR = 'data-lt-a11y-scope';\nconst EXCLUDE_ATTR = 'data-lt-a11y-exclude';\nconst HTML_LIMIT = 300;\n\nclass EngineMissing extends Error {}\n\nexport async function importEngine<T>(packageName: string, load: () => Promise<T>): Promise<T> {\n try {\n return await load();\n } catch (error) {\n if ((error as { code?: string }).code === 'ERR_MODULE_NOT_FOUND') throw new EngineMissing(`${packageName} is not installed`);\n throw error;\n }\n}\n\nlet axeModules: ReturnType<typeof importAxe> | null = null;\nasync function importAxe() {\n await importEngine('axe-core', () => import('axe-core'));\n const { AxeBuilder } = await importEngine('@axe-core/playwright', () => import('@axe-core/playwright'));\n return { AxeBuilder };\n}\nconst loadAxe = () => (axeModules ??= importAxe());\n\nlet alfaModules: ReturnType<typeof importAlfa> | null = null;\nasync function importAlfa() {\n const { Audit, Outcome } = await importEngine('@siteimprove/alfa-act', () => import('@siteimprove/alfa-act'));\n const { Rules } = await importEngine('@siteimprove/alfa-rules', () => import('@siteimprove/alfa-rules'));\n const { Node } = await importEngine('@siteimprove/alfa-dom', () => import('@siteimprove/alfa-dom'));\n const { Native: DomNative } = await importEngine('@siteimprove/alfa-dom', () => import('@siteimprove/alfa-dom/native'));\n const { Device } = await importEngine('@siteimprove/alfa-device', () => import('@siteimprove/alfa-device'));\n const { Native: DeviceNative } = await importEngine('@siteimprove/alfa-device', () => import('@siteimprove/alfa-device/native'));\n const { Page: AlfaPage } = await importEngine('@siteimprove/alfa-web', () => import('@siteimprove/alfa-web'));\n const http = await importEngine('@siteimprove/alfa-http', () => import('@siteimprove/alfa-http'));\n const { URL } = await importEngine('@siteimprove/alfa-url', () => import('@siteimprove/alfa-url'));\n return {\n Audit, Outcome, R65: Rules.get('R65').getUnsafe(), Node, DomNative, Device, DeviceNative, AlfaPage, http, URL,\n };\n}\nconst loadAlfa = () => (alfaModules ??= importAlfa());\n\n/** The reason to annotate a test `inapplicable` with when one of `engines`\n * cannot load, or null when all of them load. */\nexport async function missingEngine(engines: A11yEngine[]): Promise<string | null> {\n try {\n for (const name of engines) await (name === 'axe' ? loadAxe() : loadAlfa());\n return null;\n } catch (error) {\n if (error instanceof EngineMissing) return error.message;\n throw error;\n }\n}\n\ninterface AxeNode {\n target: unknown[];\n html: string;\n impact?: string | null;\n any: { message: string }[];\n all: { message: string }[];\n none: { message: string }[];\n}\n\ninterface AxeRuleResult {\n id: string;\n impact?: string | null;\n help: string;\n helpUrl: string;\n nodes: AxeNode[];\n}\n\nfunction axeResults(rule: A11yRule, results: AxeRuleResult[], withReasons: boolean): A11yResult[] {\n return results.flatMap((result) =>\n result.nodes.map((node) => {\n const reasons = withReasons\n ? [...new Set([...node.any, ...node.all, ...node.none].map((check) => check.message).filter(Boolean))]\n : [];\n return {\n rule,\n engineRule: result.id,\n impact: node.impact ?? result.impact ?? null,\n target: node.target.map((part) => (Array.isArray(part) ? part.join(' >>> ') : String(part))).join(' | '),\n html: node.html.slice(0, HTML_LIMIT),\n help: [result.help, ...reasons].join('. '),\n helpUrl: result.helpUrl,\n };\n }),\n );\n}\n\n/** axe over `scope` (a selector), minus `exclude`. Violations report under\n * `rule`, and the results axe cannot decide under `a11y-review`. A page scan\n * leaves contrast to `page-contrast` (decision 8). `only` narrows the scan\n * from the WCAG tags to the axe rules it names. */\nexport async function scanAxe(\n page: Page,\n scope: string,\n exclude: string[],\n rule: 'a11y-component' | 'a11y-page',\n only?: string[],\n): Promise<A11yResult[]> {\n const { AxeBuilder } = await loadAxe();\n let builder = new AxeBuilder({ page }).include(scope);\n builder = only ? builder.withRules(only) : builder.withTags(AXE_TAGS);\n for (const selector of exclude) builder = builder.exclude(selector);\n if (rule === 'a11y-page') builder = builder.disableRules(['color-contrast']);\n const result = await builder.analyze();\n return [\n ...axeResults(rule, result.violations as AxeRuleResult[], false),\n ...axeResults('a11y-review', result.incomplete as AxeRuleResult[], true),\n ];\n}\n\ninterface SerialNode {\n type: string;\n name?: string;\n attributes?: { name: string }[];\n children?: SerialNode[];\n}\n\n/** Keeps the head, every scope's ancestor chain, and each scope's subtree\n * whole. The style sheets travel on the document node, so the cascade stays\n * intact, and SIA-R65 skips the editor's own controls: 0.3 to 0.8 s a scan\n * against 2.5 s for the whole document, with the same outcomes. */\nfunction pruneToScope(node: SerialNode): boolean {\n if (node.type === 'element' && node.attributes?.some((a) => a.name === SCOPE_ATTR)) return true;\n if (!node.children) return false;\n if (node.type === 'element' && node.name === 'head') return true;\n node.children = node.children.filter((child) => child.type === 'type' || pruneToScope(child));\n return node.type === 'document' || node.children.some((child) => child.type === 'element');\n}\n\nconst FOCUS_HELP = {\n failed: 'Focusing the element changes nothing visible',\n cantTell: 'Focusing the element changes no style on it, its descendants, or its ancestors',\n};\n\n/** Alfa's SIA-R65 over `scope` (a selector), minus `exclude`. A cantTell\n * outcome means Alfa found no focus style at all, so it reports beside a\n * failure under `a11y-focus-visible`. */\nexport async function scanFocusVisible(page: Page, scope: string, exclude: string[]): Promise<A11yResult[]> {\n const alfa = await loadAlfa();\n await page.evaluate(({ scope, exclude, scopeAttr, excludeAttr }) => {\n for (const element of document.querySelectorAll(scope)) element.setAttribute(scopeAttr, '');\n for (const selector of exclude) {\n for (const element of document.querySelectorAll(selector)) element.setAttribute(excludeAttr, '');\n }\n }, { scope, exclude, scopeAttr: SCOPE_ATTR, excludeAttr: EXCLUDE_ATTR });\n let json: SerialNode;\n try {\n const handle = await page.evaluateHandle(() => document);\n json = (await handle.evaluate(alfa.DomNative.fromNode as (node: Document) => Promise<unknown>)) as SerialNode;\n await handle.dispose();\n } finally {\n await page.evaluate((attrs) => {\n for (const attr of attrs) for (const element of document.querySelectorAll(`[${attr}]`)) element.removeAttribute(attr);\n }, [SCOPE_ATTR, EXCLUDE_ATTR]);\n }\n pruneToScope(json);\n\n const fromWindow = alfa.DeviceNative.fromWindow as () => ReturnType<typeof alfa.DeviceNative.fromWindow>;\n const device = alfa.Device.from(await page.evaluate(fromWindow));\n const url = alfa.URL.parse(page.url()).getUnsafe();\n const { Request, Response, Headers, Header } = alfa.http;\n const alfaPage = alfa.AlfaPage.of(\n Request.of('GET', url),\n Response.of(url, 200, Headers.of([Header.of('Content-Type', 'text/html')])),\n alfa.Node.from(json as Parameters<typeof alfa.Node.from>[0], device) as Parameters<typeof alfa.AlfaPage.of>[2],\n device,\n );\n\n const results: A11yResult[] = [];\n for (const outcome of await alfa.Audit.of(alfaPage, [alfa.R65]).evaluate()) {\n const kind = alfa.Outcome.isFailed(outcome) ? 'failed' : alfa.Outcome.isCantTell(outcome) ? 'cantTell' : null;\n if (!kind) continue;\n const target = outcome.target as unknown as AlfaElement;\n if (!inScope(target)) continue;\n results.push({\n rule: 'a11y-focus-visible',\n engineRule: 'SIA-R65',\n impact: null,\n target: elementLabel(target),\n html: target.toString().replace(/\\s+/g, ' ').slice(0, HTML_LIMIT),\n help: FOCUS_HELP[kind],\n helpUrl: alfa.R65.uri,\n });\n }\n return results;\n}\n\ninterface AlfaElement {\n name: string;\n classes: Iterable<string>;\n id: { isSome(): boolean; get(): string };\n attribute?: (name: string) => { isSome(): boolean };\n inclusiveAncestors(): Iterable<AlfaElement>;\n toString(): string;\n}\n\nfunction inScope(target: AlfaElement): boolean {\n for (const node of target.inclusiveAncestors()) {\n if (typeof node.attribute !== 'function') continue;\n if (node.attribute(EXCLUDE_ATTR).isSome()) return false;\n if (node.attribute(SCOPE_ATTR).isSome()) return true;\n }\n return false;\n}\n\nfunction elementLabel(target: AlfaElement): string {\n const id = target.id.isSome() ? `#${target.id.get()}` : '';\n return `${target.name}${id}${[...target.classes].map((name) => `.${name}`).join('')}`;\n}\n\n/** Records `results` on the running test as the annotation the runner turns\n * into findings (decision 3). The test itself passes. */\nexport function recordA11y(results: A11yResult[]): void {\n if (results.length === 0) return;\n test.info().annotations.push({ type: A11Y_ANNOTATION, description: JSON.stringify(results) });\n}\n"],"mappings":";AAAA,SAAS,YAAuB;AA4BhC,IAAM,kBAAkB;AAIxB,IAAM,WAAW,CAAC,UAAU,WAAW,YAAY,UAAU;AAC7D,IAAM,aAAa;AACnB,IAAM,eAAe;AACrB,IAAM,aAAa;AAEnB,IAAM,gBAAN,cAA4B,MAAM;AAAC;AAEnC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GAAG,EAAE,MAAM,GAAG,UAAU;AAAA,MAChE,MAAM,WAAW,IAAI;AAAA,MACrB,SAAS,KAAK,IAAI;AAAA,IACpB,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAWA,SAAS,QAAQ,QAA8B;AAC7C,aAAW,QAAQ,OAAO,mBAAmB,GAAG;AAC9C,QAAI,OAAO,KAAK,cAAc,WAAY;AAC1C,QAAI,KAAK,UAAU,YAAY,EAAE,OAAO,EAAG,QAAO;AAClD,QAAI,KAAK,UAAU,UAAU,EAAE,OAAO,EAAG,QAAO;AAAA,EAClD;AACA,SAAO;AACT;AAEA,SAAS,aAAa,QAA6B;AACjD,QAAM,KAAK,OAAO,GAAG,OAAO,IAAI,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK;AACxD,SAAO,GAAG,OAAO,IAAI,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,OAAO,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC;AACrF;AAIO,SAAS,WAAW,SAA6B;AACtD,MAAI,QAAQ,WAAW,EAAG;AAC1B,OAAK,KAAK,EAAE,YAAY,KAAK,EAAE,MAAM,iBAAiB,aAAa,KAAK,UAAU,OAAO,EAAE,CAAC;AAC9F;","names":["scope","exclude"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../testing/support/traceProperties.ts","../testing/support/nonTextContrast.ts","../testing/support/textSpacingAndMotion.ts"],"sourcesContent":["import type { CDPSession, Page } from '@playwright/test';\n\n/** The CSS properties a result's verdict reads, per element. A name ending in\n * `*` matches every property that starts with the rest; `*` alone matches\n * every property. */\nexport interface TraceAxes {\n target: string[];\n pseudoElements: string[];\n ancestors: string[];\n /** Pseudo-classes forced on the target while its styles are read. The\n * target then keeps only the declarations the force brings in or changes. */\n force?: string[];\n}\n\nconst BOX_SIZE = ['width', 'height', 'min-*', 'inline-size', 'block-size', 'padding*'];\nconst FOCUS = ['focus', 'focus-visible'];\n// Every border property but the radii, which carry no colour or width.\nconst BORDER_PAINT = ['border-block*', 'border-inline*', ...['', '-top', '-right', '-bottom', '-left']\n .flatMap((side) => [`border${side}`, `border${side}-color`, `border${side}-width`, `border${side}-style`])];\n\n// What sets how long a motion lasts; easing and fill shape it without lengthening it.\nconst MOTION = ['animation', 'animation-name', 'animation-duration', 'animation-delay', 'animation-iteration-count',\n 'transition', 'transition-property', 'transition-duration', 'transition-delay'];\n\n/** Decision 2 of docs/plans/a11y-property-marks.md, keyed by engine rule. An\n * engine rule absent here traces nothing. */\nexport const TRACE_AXES: Readonly<Record<string, TraceAxes>> = {\n 'color-contrast': {\n target: ['color', 'background*', 'opacity', 'text-shadow'],\n pseudoElements: ['*'],\n ancestors: ['background*', 'opacity'],\n },\n 'SIA-R65': {\n target: ['outline*', 'box-shadow', 'border*', 'background*', 'color', 'text-decoration*'],\n pseudoElements: [],\n ancestors: [],\n force: FOCUS,\n },\n 'target-size': { target: BOX_SIZE, pseudoElements: BOX_SIZE, ancestors: [] },\n 'focus-indicator-contrast': {\n target: ['outline*', 'box-shadow', ...BORDER_PAINT, 'background*', 'color'],\n pseudoElements: [],\n ancestors: ['background*'],\n force: FOCUS,\n },\n 'control-boundary-contrast': {\n target: [...BORDER_PAINT, 'outline', 'outline-color', 'outline-width', 'outline-style', 'background*'],\n pseudoElements: [],\n ancestors: ['background*'],\n },\n // Every element's line height is 1.5 under the override, so the theme's own cannot cause the overflow.\n 'text-spacing': {\n target: ['height', 'max-height', 'width', 'max-width', 'padding*', 'overflow*', 'white-space'],\n pseudoElements: [],\n ancestors: [],\n },\n // A pseudo-element that does not display does not move, so its display gates the motion, as Button's shimmer does.\n 'prefers-reduced-motion': { target: MOTION, pseudoElements: [...MOTION, 'display'], ancestors: [] },\n};\n\ninterface Declaration {\n name: string;\n value: string;\n text?: string;\n important?: boolean;\n}\n\ninterface Style {\n cssProperties: Declaration[];\n}\n\ninterface RuleMatch {\n rule: {\n origin: string;\n style: Style & { range?: unknown };\n styleSheetId?: string;\n selectorList: { text: string };\n };\n}\n\ninterface ElementStyles {\n inlineStyle?: Style;\n matchedCSSRules?: RuleMatch[];\n}\n\nconst sessions = new WeakMap<Page, Promise<CDPSession>>();\n\n/** One DevTools session per page, with `DOM` and `CSS` enabled. */\nexport function cdpSession(page: Page): Promise<CDPSession> {\n let session = sessions.get(page);\n if (!session) {\n session = (async () => {\n const cdp = await page.context().newCDPSession(page);\n await cdp.send('DOM.enable');\n await cdp.send('CSS.enable');\n return cdp;\n })();\n sessions.set(page, session);\n }\n return session;\n}\n\nfunction onAxis(property: string, axis: string[]): boolean {\n return axis.some((name) => (name.endsWith('*') ? property.startsWith(name.slice(0, -1)) : property === name));\n}\n\n/** Authored declarations only: Chromium also lists each shorthand's longhands\n * without text, which would repeat every reference. */\nfunction authored(style: Style | undefined): Declaration[] {\n return (style?.cssProperties ?? []).filter((declaration) => declaration.text);\n}\n\nfunction regularRules(styles: ElementStyles): RuleMatch['rule'][] {\n return (styles.matchedCSSRules ?? []).filter(({ rule }) => rule.origin === 'regular').map(({ rule }) => rule);\n}\n\nfunction declarations(styles: ElementStyles): Declaration[] {\n return [authored(styles.inlineStyle), ...regularRules(styles).map((rule) => authored(rule.style))].flat();\n}\n\n/** One element's declarations from lowest to highest precedence: its rules\n * in cascade order, then its inline style. */\nfunction cascadeOrder(styles: ElementStyles): Declaration[] {\n return [...regularRules(styles).flatMap((rule) => authored(rule.style)), ...authored(styles.inlineStyle)];\n}\n\n/** The declaration of `name` that wins among `ordered`, or none. */\nfunction winning(ordered: Declaration[], name: string): Declaration | undefined {\n const all = ordered.filter((d) => d.name === name);\n // Chromium flags `important` on standard properties and leaves it in a custom property's value.\n return all.filter((d) => d.important || /!\\s*important\\s*$/i.test(d.value)).at(-1) ?? all.at(-1);\n}\n\nfunction ruleKey(rule: RuleMatch['rule']): string {\n return JSON.stringify([rule.styleSheetId, rule.selectorList.text, rule.style.range]);\n}\n\ntype Longhands = (names: string[]) => Promise<Map<string, string[]>>;\n\n/** The longhands each property sets, read from the page's CSSOM, so that\n * `outline` and `outline-color` count as the same property. */\nfunction longhandsIn(page: Page): Longhands {\n return async (names) => new Map(await page.evaluate((names) => names.map((name): [string, string[]] => {\n if (name.startsWith('--')) return [name, [name]];\n const style = document.createElement('div').style;\n style.setProperty(name, 'initial');\n return [name, style.length ? Array.from({ length: style.length }, (_, i) => style.item(i)) : [name]];\n }), names));\n}\n\n/**\n * The target's declarations under `forced` that the force brings in or\n * changes: every declaration of a rule that matches only under the force,\n * and every declaration of a later rule, or of the inline style, that sets a\n * property one of those rules sets. Rules that match in every state drop, so\n * a field's resting border and surface never name a focus finding.\n */\nasync function forcedDeclarations(plain: ElementStyles, forced: ElementStyles, longhands: Longhands): Promise<Declaration[]> {\n const before = new Set(regularRules(plain).map(ruleKey));\n const cascade = [\n ...regularRules(forced).map((rule) => ({ forcedOnly: !before.has(ruleKey(rule)), declarations: authored(rule.style) })),\n { forcedOnly: false, declarations: authored(forced.inlineStyle) },\n ];\n const expanded = await longhands([...new Set(cascade.flatMap((entry) => entry.declarations.map((d) => d.name)))]);\n const changed = new Set<string>();\n const kept: Declaration[] = [];\n for (const { forcedOnly, declarations } of cascade) {\n for (const d of declarations) {\n const sets = expanded.get(d.name) ?? [d.name];\n if (forcedOnly) sets.forEach((name) => changed.add(name));\n if (forcedOnly || sets.some((name) => changed.has(name))) kept.push(d);\n }\n }\n return kept;\n}\n\nfunction references(value: string): string[] {\n return [...value.matchAll(/var\\(\\s*(--[\\w-]+)/g)].map((match) => match[1]);\n}\n\n/** How many ancestors separate each element `selector` matches from the\n * nearest element `scope` matches, in document order, or -1 outside it. */\nfunction scopeDepths(page: Page, selector: string, scope: string): Promise<number[]> {\n return page.evaluate(({ selector, scope }) => [...document.querySelectorAll(selector)].map((element) => {\n let depth = 0;\n for (let node: Element | null = element; node; node = node.parentElement, depth++) {\n if (node.matches(scope)) return depth;\n }\n return -1;\n }), { selector, scope });\n}\n\nasync function matchedStyles(cdp: CDPSession, nodeId: number, force: string[] = [], forceNodeId = nodeId) {\n const forcePseudoState = (forcedPseudoClasses: string[]) => cdp.send('CSS.forcePseudoState', { nodeId: forceNodeId, forcedPseudoClasses });\n if (force.length === 0) return cdp.send('CSS.getMatchedStylesForNode', { nodeId });\n await forcePseudoState(force);\n return cdp.send('CSS.getMatchedStylesForNode', { nodeId }).finally(() => forcePseudoState([]));\n}\n\ninterface TraceNode {\n nodeId: number;\n depth: number;\n forceNodeId?: number;\n ancestorsFrom: number;\n}\n\nasync function traceNode(\n cdp: CDPSession,\n node: TraceNode,\n axes: TraceAxes,\n known: ReadonlySet<string>,\n longhands: Longhands,\n): Promise<string[]> {\n const matched = await matchedStyles(cdp, node.nodeId, axes.force, node.forceNodeId);\n const own = axes.force\n ? await forcedDeclarations(await matchedStyles(cdp, node.nodeId), matched, longhands)\n : declarations(matched);\n const pseudo = (matched.pseudoElements ?? []).flatMap(({ matches }) => declarations({ matchedCSSRules: matches }));\n const chain = (matched.inherited ?? []).slice(0, node.depth);\n\n // A reference resolves on the element whose declaration holds it: level 0\n // is the target, level n its nth ancestor, and PSEUDO its pseudo-elements.\n // Only the winning declaration of a private property counts there, so a\n // selected tab traces its selected binding and leaves the default one out.\n const PSEUDO = -1;\n const levels = [cascadeOrder(matched), ...chain.map(cascadeOrder)];\n const pseudoCustom = pseudo.filter((d) => d.name.startsWith('--'));\n const from = Math.max(node.ancestorsFrom - 1, 0);\n const pending: { name: string; level: number }[] = [\n ...own.filter((d) => onAxis(d.name, axes.target)).map((d) => ({ d, level: 0 })),\n ...pseudo.filter((d) => onAxis(d.name, axes.pseudoElements)).map((d) => ({ d, level: PSEUDO })),\n ...chain.slice(from).flatMap((entry, i) => declarations(entry)\n .filter((d) => onAxis(d.name, axes.ancestors))\n .map((d) => ({ d, level: from + i + 1 }))),\n ].flatMap(({ d, level }) => references(d.value).map((name) => ({ name, level })));\n\n const resolve = (name: string, level: number): { declarations: Declaration[]; level: number } => {\n if (level === PSEUDO) {\n const own = pseudoCustom.filter((d) => d.name === name);\n if (own.length > 0) return { declarations: own, level: PSEUDO };\n }\n for (let at = Math.max(level, 0); at < levels.length; at++) {\n const won = winning(levels[at], name);\n if (won) return { declarations: [won], level: at };\n }\n return { declarations: [], level };\n };\n\n const found = new Set<string>();\n const followed = new Set<string>();\n for (let next = pending.pop(); next !== undefined; next = pending.pop()) {\n const { name, level } = next;\n const key = `${name}@${level}`;\n if (known.has(name)) found.add(name);\n else if (!followed.has(key)) {\n followed.add(key);\n const resolved = resolve(name, level);\n for (const d of resolved.declarations) pending.push(...references(d.value).map((ref) => ({ name: ref, level: resolved.level })));\n }\n }\n return [...found];\n}\n\n/** The element a trace reads, inside `scope`. `forceOn`, when set, names the\n * element `axes.force` applies to, for a focus style drawn on another\n * element. `ancestorsFrom` is the nearest ancestor whose `axes.ancestors`\n * declarations count, 1 being the parent and the default. */\nexport interface TraceTarget {\n selector: string;\n scope: string;\n forceOn?: string;\n ancestorsFrom?: number;\n}\n\n/**\n * The component properties `axes` reads on the element `target.selector`\n * names inside `target.scope` (decisions 1 to 3): each matched declaration on\n * an axis, narrowed under `axes.force` to the ones the force brings in or\n * changes, its `var()` references followed through the winning declaration\n * of each private custom property on the target or an in-scope ancestor,\n * kept where a name is in `known`. Sorted and unique.\n */\nexport async function traceProperties(\n page: Page,\n target: TraceTarget,\n axes: TraceAxes,\n known: ReadonlySet<string>,\n): Promise<string[]> {\n let depths: number[];\n let forceDepths: number[] = [];\n try {\n depths = await scopeDepths(page, target.selector, target.scope);\n if (target.forceOn) forceDepths = await scopeDepths(page, target.forceOn, target.scope);\n } catch {\n // An Alfa label or an axe frame path need not parse as one selector.\n return [];\n }\n const cdp = await cdpSession(page);\n const { root } = await cdp.send('DOM.getDocument', { depth: 0 });\n const query = async (selector: string) => (await cdp.send('DOM.querySelectorAll', { nodeId: root.nodeId, selector })).nodeIds;\n const nodeIds = await query(target.selector);\n const forceNodeId = target.forceOn\n ? (await query(target.forceOn)).find((_, index) => forceDepths[index] >= 0)\n : undefined;\n if (target.forceOn && forceNodeId === undefined) return [];\n const longhands = longhandsIn(page);\n const found = new Set<string>();\n for (const [index, nodeId] of nodeIds.entries()) {\n if (depths[index] < 0) continue;\n const node = { nodeId, depth: depths[index], forceNodeId, ancestorsFrom: target.ancestorsFrom ?? 1 };\n for (const name of await traceNode(cdp, node, axes, known, longhands)) found.add(name);\n }\n return [...found].sort();\n}\n","import type { Page } from '@playwright/test';\nimport type { A11yResult } from './a11y';\nimport { cdpSession } from './traceProperties';\n\nexport const FOCUS_INDICATOR_RULE = 'focus-indicator-contrast';\nexport const BOUNDARY_RULE = 'control-boundary-contrast';\n\nconst NON_TEXT_URL = 'https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast.html';\nconst FOCUS_ATTR = 'data-lt-focus-probe';\nconst NO_TRANSITION_ID = 'lt-focus-probe-no-transition';\nconst FORCE = ['focus', 'focus-visible'];\n\n/** Where the trace reads a result's properties: `selector` names the element\n * that paints the colour, `forceOn` the element focus is forced on, and\n * `ancestorsFrom` the nearest ancestor (1 is the parent, 0 the element\n * itself) whose surface lies behind the measured edge. */\nexport interface TraceRequest {\n selector: string;\n forceOn?: string;\n ancestorsFrom?: number;\n}\n\nexport interface CheckedResult {\n result: A11yResult;\n trace: TraceRequest;\n}\n\n/** A part whose border, outline or surface draws a control's visible edge.\n * `when` narrows it to the elements that also match, such as a state class. */\nexport interface BoundaryPart {\n selector: string;\n label: string;\n when?: string;\n}\n\ntype Snapshot = string[];\n\ntype FocusOutcome =\n | { kind: 'none' | 'browser' | 'pass' }\n | {\n kind: 'fail' | 'review';\n channel: string;\n ratio?: number;\n target: string;\n indicator: string;\n html: string;\n ancestorsFrom: number;\n };\n\ntype BoundaryOutcome = {\n kind: 'fail' | 'review';\n label: string;\n target: string;\n html: string;\n edge: { channel: 'border' | 'outline'; ratio: number } | null;\n surface: number | null;\n ancestorsFrom: number;\n};\n\ntype PageRequest =\n | { kind: 'focusables'; scope: string; exclude: string[]; attr: string; styleId: string }\n | { kind: 'snapshot'; attr: string; index: number; scope: string; exclude: string[] }\n | { kind: 'measure'; attr: string; index: number; scope: string; exclude: string[]; before: Snapshot }\n | { kind: 'cleanup'; attr: string; styleId: string }\n | { kind: 'boundaries'; scope: string; exclude: string[]; parts: BoundaryPart[]; root: string }\n | { kind: 'describe'; scope: string; exclude: string[]; attr: string; values: string[] };\n\n/**\n * Runs in the page, so it carries every helper it needs. Colours resolve and\n * composite on a 1px canvas, which reads any CSS colour syntax the computed\n * style returns and blends alpha the way the page paints it.\n */\nfunction inPage(request: PageRequest): unknown {\n const scopes = [...document.querySelectorAll<HTMLElement>(('scope' in request && request.scope) || ':not(*)')];\n const excluded = (el: Element) => 'exclude' in request && request.exclude.some((selector) => el.closest(selector));\n const inScope = (el: Element) => scopes.some((scope) => scope.contains(el)) && !excluded(el);\n\n const canvas = document.createElement('canvas');\n canvas.width = canvas.height = 1;\n const ctx = canvas.getContext('2d', { willReadFrequently: true })!;\n const paint = (layers: string[]): number[] => {\n ctx.clearRect(0, 0, 1, 1);\n for (const layer of ['#fff', ...layers]) {\n ctx.fillStyle = 'transparent';\n ctx.fillStyle = layer;\n ctx.fillRect(0, 0, 1, 1);\n }\n return [...ctx.getImageData(0, 0, 1, 1).data.slice(0, 3)];\n };\n const alpha = (color: string): number => {\n ctx.clearRect(0, 0, 1, 1);\n ctx.fillStyle = 'transparent';\n ctx.fillStyle = color;\n ctx.fillRect(0, 0, 1, 1);\n return ctx.getImageData(0, 0, 1, 1).data[3] / 255;\n };\n const rgb = (channels: number[]) => `rgb(${channels.join(' ')})`;\n const luminance = (channels: number[]) => {\n const [r, g, b] = channels.map((c) => {\n const s = c / 255;\n return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;\n });\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n };\n const contrast = (a: number[], b: number[]) => {\n const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x);\n return (hi + 0.05) / (lo + 0.05);\n };\n\n const selectorFor = (el: Element): string => {\n const count = (selector: string) => scopes.reduce((n, scope) => n + (scope.matches(selector) ? 1 : 0) + scope.querySelectorAll(selector).length, 0);\n const own = (e: Element) => e.tagName.toLowerCase()\n + [...e.classList].filter((name) => !name.startsWith('svelte-') && /^[\\w-]+$/.test(name)).map((name) => `.${name}`).join('');\n const path: string[] = [];\n for (let e: Element | null = el; e; e = e.parentElement) {\n const step = own(e);\n path.unshift(step);\n if (count(path.join(' > ')) === 1) break;\n const same = [...(e.parentElement?.children ?? [])].filter((c) => c.tagName === e!.tagName);\n if (same.length > 1) path[0] = `${step}:nth-of-type(${same.indexOf(e) + 1})`;\n if (count(path.join(' > ')) === 1 || scopes.includes(e as HTMLElement)) break;\n }\n return path.join(' > ');\n };\n\n /** The surfaces behind `ring`, from the nearest box that contains it up to\n * the first opaque one, composited over white. A gradient or image among\n * them leaves the colour unknown. */\n const backdrop = (from: Element, ring: DOMRect) => {\n const layers: string[] = [];\n let level = 0;\n let first = -1;\n for (let e: Element | null = from; e; e = e.parentElement, level++) {\n const box = e.getBoundingClientRect();\n const contains = box.left <= ring.left + 0.5 && box.top <= ring.top + 0.5\n && box.right >= ring.right - 0.5 && box.bottom >= ring.bottom - 0.5;\n if (!contains) continue;\n if (first < 0) first = level;\n const style = getComputedStyle(e);\n if (style.backgroundImage !== 'none') return { color: null, first };\n const a = alpha(style.backgroundColor);\n if (a > 0) layers.unshift(style.backgroundColor);\n if (a >= 1) break;\n }\n return { color: paint(layers), first: Math.max(first, 0) };\n };\n const inflate = (box: DOMRect, by: number) => new DOMRect(box.x - by, box.y - by, box.width + 2 * by, box.height + 2 * by);\n const px = (value: string) => parseFloat(value) || 0;\n const html = (el: Element) => el.outerHTML.replace(/\\s+/g, ' ').slice(0, 300);\n\n const SIDES = ['Top', 'Right', 'Bottom', 'Left'] as const;\n const visibleSide = (style: CSSStyleDeclaration, side: string) => {\n const s = style as unknown as Record<string, string>;\n return !['none', 'hidden'].includes(s[`border${side}Style`]) && px(s[`border${side}Width`]) >= 0.99\n ? s[`border${side}Color`] : null;\n };\n\n const candidates = (target: Element): Element[] => {\n const list = [target, ...target.querySelectorAll('*')];\n for (const sibling of target.parentElement?.children ?? []) {\n if (sibling !== target) list.push(sibling, ...sibling.querySelectorAll('*'));\n }\n return list.filter(inScope);\n };\n const signature = (el: Element) => {\n const s = getComputedStyle(el);\n return JSON.stringify([\n [s.outlineStyle, s.outlineWidth, s.outlineColor, s.outlineOffset],\n s.boxShadow,\n SIDES.map((side) => visibleSide(s, side)),\n ]);\n };\n\n /** The colour focus brings in on `el`, by decision 8's order: an outline,\n * else the first outer box shadow, else a border. A channel focus leaves\n * alone, or paints fully transparent, is no indicator. */\n const indicatorOf = (el: Element, before: string) => {\n const [outlineBefore, shadowBefore, bordersBefore] = JSON.parse(before);\n const s = getComputedStyle(el);\n const outline = [s.outlineStyle, s.outlineWidth, s.outlineColor, s.outlineOffset];\n if (JSON.stringify(outline) !== JSON.stringify(outlineBefore) && s.outlineStyle !== 'none' && px(s.outlineWidth) > 0) {\n if (s.outlineStyle === 'auto') return { channel: 'browser', color: '', extent: 0 };\n if (alpha(s.outlineColor) > 0) return { channel: 'outline', color: s.outlineColor, extent: px(s.outlineOffset) + px(s.outlineWidth) };\n }\n if (s.boxShadow !== shadowBefore && s.boxShadow !== 'none') {\n const shadows = s.boxShadow.split(/,(?![^(]*\\))/).map((part) => part.trim());\n for (const shadow of shadows) {\n if (/\\binset\\b/.test(shadow)) continue;\n const color = /^(?:[a-z-]+\\([^)]*\\)|#[\\da-f]+|[a-z]+)/i.exec(shadow)?.[0] ?? '';\n if (!color || alpha(color) === 0) continue;\n const [x = 0, y = 0, blur = 0, spread = 0] = (shadow.slice(color.length).match(/-?[\\d.]+px/g) ?? []).map(px);\n return { channel: 'shadow', color, extent: Math.max(Math.abs(x), Math.abs(y)) + blur + spread };\n }\n }\n const borders = SIDES.map((side) => visibleSide(s, side));\n for (const [i, color] of borders.entries()) {\n if (color && color !== bordersBefore[i] && alpha(color) > 0) return { channel: 'border', color, extent: 0 };\n }\n return null;\n };\n\n switch (request.kind) {\n case 'focusables': {\n // A focus transition would leave the computed colour at its start.\n const style = document.createElement('style');\n style.id = request.styleId;\n style.textContent = '*, *::before, *::after { transition: none !important; }';\n document.head.append(style);\n const focusable = 'a[href], area[href], button, input:not([type=\"hidden\"]), select, textarea, summary, iframe, [tabindex], [contenteditable]:not([contenteditable=\"false\"])';\n const found = scopes.flatMap((scope) => [scope, ...scope.querySelectorAll(focusable)])\n .filter((el, i, all) => all.indexOf(el) === i && el.matches(focusable) && inScope(el))\n .filter((el) => (el as HTMLElement).tabIndex >= 0 && !el.matches(':disabled') && el.checkVisibility({ visibilityProperty: true }));\n found.forEach((el, i) => el.setAttribute(request.attr, String(i)));\n return found.length;\n }\n case 'snapshot': {\n const target = document.querySelector(`[${request.attr}=\"${request.index}\"]`)!;\n return candidates(target).map(signature);\n }\n case 'measure': {\n const target = document.querySelector(`[${request.attr}=\"${request.index}\"]`)!;\n const list = candidates(target);\n for (const [i, el] of list.entries()) {\n if (request.before[i] === undefined || request.before[i] === signature(el)) continue;\n const found = indicatorOf(el, request.before[i]);\n if (!found) continue;\n if (found.channel === 'browser') return { kind: 'browser' };\n const ring = inflate(el.getBoundingClientRect(), Math.max(found.extent, 0));\n const behind = backdrop(found.channel === 'border' ? el.parentElement! : el, found.extent < 0 ? el.getBoundingClientRect() : ring);\n const offset = found.channel === 'border' ? 1 : 0;\n const common = {\n channel: found.channel,\n target: selectorFor(target),\n indicator: selectorFor(el),\n html: html(target),\n ancestorsFrom: behind.first + offset,\n };\n if (!behind.color) return { kind: 'review', ...common };\n const ratio = contrast(paint([rgb(behind.color), found.color]), behind.color);\n return ratio < 3 ? { kind: 'fail', ratio, ...common } : { kind: 'pass' };\n }\n return { kind: 'none' };\n }\n case 'cleanup': {\n document.getElementById(request.styleId)?.remove();\n for (const el of document.querySelectorAll(`[${request.attr}]`)) el.removeAttribute(request.attr);\n return null;\n }\n case 'boundaries': {\n const outcomes: BoundaryOutcome[] = [];\n const control = 'button, input, select, textarea, [aria-disabled]';\n const inactive = (el: Element) => {\n const root = el.closest(request.root) ?? el;\n const controls = [root, ...root.querySelectorAll(control)].filter((c) => c.matches(control));\n return controls.length > 0 && controls.every((c) => c.matches(':disabled') || c.getAttribute('aria-disabled') === 'true');\n };\n for (const part of request.parts) {\n const elements = scopes.flatMap((scope) => [scope, ...scope.querySelectorAll(part.selector)])\n .filter((el, i, all) => all.indexOf(el) === i && el.matches(part.selector) && inScope(el))\n .filter((el) => !part.when || el.matches(part.when))\n .filter((el) => el.checkVisibility({ visibilityProperty: true }) && el.getBoundingClientRect().width > 0 && !inactive(el));\n for (const el of elements) {\n const style = getComputedStyle(el);\n const behind = backdrop(el.parentElement!, el.getBoundingClientRect());\n const common = { label: part.label, target: selectorFor(el), html: html(el), ancestorsFrom: behind.first + 1 };\n if (!behind.color) {\n outcomes.push({ kind: 'review', edge: null, surface: null, ...common });\n continue;\n }\n const surfaceColor = paint([rgb(behind.color), style.backgroundColor]);\n const surface = style.backgroundImage === 'none' ? contrast(surfaceColor, behind.color) : null;\n // A state indicator may draw one side, as TabBar's underline does, or\n // an inset outline, as SegmentedControl's selected option does.\n const edges: { channel: 'border' | 'outline'; color: string; under: number[] }[] = [];\n const borderUnder = style.backgroundClip === 'border-box' ? surfaceColor : behind.color;\n for (const side of SIDES) {\n const color = visibleSide(style, side);\n if (color) edges.push({ channel: 'border', color, under: borderUnder });\n }\n if (!['none', 'auto'].includes(style.outlineStyle) && px(style.outlineWidth) >= 0.99) {\n edges.push({ channel: 'outline', color: style.outlineColor, under: px(style.outlineOffset) < 0 ? surfaceColor : behind.color });\n }\n const edge = edges\n .map(({ channel, color, under }) => ({ channel, ratio: contrast(paint([rgb(under), color]), behind.color) }))\n .reduce<BoundaryOutcome['edge']>((best, next) => (best && best.ratio >= next.ratio ? best : next), null);\n if ((edge?.ratio ?? 0) >= 3 || (surface ?? 0) >= 3) continue;\n outcomes.push({ kind: surface === null ? 'review' : 'fail', edge, surface, ...common });\n }\n }\n return outcomes;\n }\n case 'describe': {\n return request.values.map((value) => {\n const el = document.querySelector(`[${request.attr}=\"${value}\"]`)!;\n return { target: selectorFor(el), html: html(el) };\n });\n }\n }\n}\n\nfunction run<T>(page: Page, request: PageRequest): Promise<T> {\n return page.evaluate(inPage, request) as Promise<T>;\n}\n\n/** The selector and markup a result names for each element in `scope` whose\n * `attr` holds one of `values`, in that order. The selector is unique in\n * `scope`, which the trace needs. */\nexport function describeTagged(\n page: Page,\n scope: string,\n exclude: string[],\n attr: string,\n values: string[],\n): Promise<{ target: string; html: string }[]> {\n return run(page, { kind: 'describe', scope, exclude, attr, values });\n}\n\n/** Below 3:1 fails; WCAG does not round, so neither does the reading. */\nfunction ratioText(ratio: number): string {\n return `${Math.floor(ratio * 100) / 100}:1`;\n}\n\n/**\n * Decision 8: focus forced on each focusable element in `scope`, the colour\n * it brings in measured against the surfaces behind it. The indicator is the\n * first of the element, its descendants and its siblings whose outline, box\n * shadow or border focus changes, so a ring drawn on a sibling, as Slider\n * draws it, counts. Chromium's own `auto` ring pairs a dark and a light band,\n * one of which contrasts with any backdrop, so it passes. An element focus\n * leaves unchanged is SIA-R65's finding and adds none here.\n */\nexport async function scanFocusIndicators(page: Page, scope: string, exclude: string[]): Promise<CheckedResult[]> {\n const cdp = await cdpSession(page);\n const count = await run<number>(page, { kind: 'focusables', scope, exclude, attr: FOCUS_ATTR, styleId: NO_TRANSITION_ID });\n const checked: CheckedResult[] = [];\n try {\n const { root } = await cdp.send('DOM.getDocument', { depth: 0 });\n for (let index = 0; index < count; index++) {\n const { nodeId } = await cdp.send('DOM.querySelector', { nodeId: root.nodeId, selector: `[${FOCUS_ATTR}=\"${index}\"]` });\n const before = await run<Snapshot>(page, { kind: 'snapshot', attr: FOCUS_ATTR, index, scope, exclude });\n await cdp.send('CSS.forcePseudoState', { nodeId, forcedPseudoClasses: FORCE });\n let outcome: FocusOutcome;\n try {\n outcome = await run<FocusOutcome>(page, { kind: 'measure', attr: FOCUS_ATTR, index, scope, exclude, before });\n } finally {\n await cdp.send('CSS.forcePseudoState', { nodeId, forcedPseudoClasses: [] });\n }\n if (outcome.kind !== 'fail' && outcome.kind !== 'review') continue;\n const where = outcome.indicator === outcome.target ? '' : ` on ${outcome.indicator}`;\n checked.push({\n result: {\n rule: outcome.kind === 'fail' ? 'a11y-component' : 'a11y-review',\n engineRule: FOCUS_INDICATOR_RULE,\n impact: null,\n target: outcome.target,\n html: outcome.html,\n help: outcome.kind === 'fail'\n ? `Focus ${outcome.channel}${where} ${ratioText(outcome.ratio!)} against the backdrop, needs 3:1`\n : `Focus ${outcome.channel}${where} sits over a gradient or image. Check by eye that it contrasts 3:1 with the backdrop`,\n helpUrl: NON_TEXT_URL,\n },\n trace: { selector: outcome.indicator, forceOn: outcome.target, ancestorsFrom: outcome.ancestorsFrom },\n });\n }\n } finally {\n await run(page, { kind: 'cleanup', attr: FOCUS_ATTR, styleId: NO_TRANSITION_ID });\n }\n return checked;\n}\n\n/**\n * Decision 9: each visible element of each boundary part in `scope` passes\n * when its best border side or outline, 1px or wider, or its surface\n * contrasts 3:1 with the surfaces behind it. A part of a control whose every\n * form control is disabled is inactive, which SC 1.4.11 exempts. `root` names\n * the component's root part, the extent of the control.\n */\nexport async function scanBoundaries(\n page: Page,\n scope: string,\n exclude: string[],\n parts: BoundaryPart[],\n root: string,\n): Promise<CheckedResult[]> {\n if (parts.length === 0) return [];\n const outcomes = await run<BoundaryOutcome[]>(page, { kind: 'boundaries', scope, exclude, parts, root });\n return outcomes.map((outcome) => {\n const edge = outcome.edge === null ? 'no border' : `${outcome.edge.channel} ${ratioText(outcome.edge.ratio)}`;\n return {\n result: {\n rule: outcome.kind === 'fail' ? 'a11y-component' : 'a11y-review',\n engineRule: BOUNDARY_RULE,\n impact: null,\n target: outcome.target,\n html: outcome.html,\n help: outcome.kind === 'fail'\n ? `${outcome.label} ${edge} and surface ${ratioText(outcome.surface!)} against the backdrop, needs 3:1`\n : `${outcome.label} sits on or carries a gradient or image. Check by eye that its edge contrasts 3:1 with the backdrop`,\n helpUrl: NON_TEXT_URL,\n },\n trace: { selector: outcome.target, ancestorsFrom: outcome.ancestorsFrom },\n };\n });\n}\n","import type { Page } from '@playwright/test';\nimport type { A11yResult } from './a11y';\nimport { describeTagged, type CheckedResult } from './nonTextContrast';\n\nexport const TEXT_SPACING_URL = 'https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html';\n\n/** An animation that ends within this many milliseconds of its start reads as\n * a fade or a state change, which reduced motion leaves alone. */\nexport const MOTION_MS = 200;\nexport const MOTION_URL = 'https://www.w3.org/WAI/WCAG22/Techniques/css/C39';\n\nexport const TEXT_SPACING_RULE = 'text-spacing';\nexport const REDUCED_MOTION_RULE = 'prefers-reduced-motion';\n\nconst SPACING_ATTR = 'data-lt-spacing-probe';\nconst MOTION_ATTR = 'data-lt-motion-probe';\nconst STILL_ID = 'lt-spacing-probe-still';\nconst TOLERANCE = 1;\n\n/** The override SC 1.4.12 names, as the W3C's own text spacing bookmarklet\n * applies it, over the whole page or inside `scope`. */\nexport function textSpacingCss(scope?: string): string {\n const every = scope ? `${scope}, ${scope} *` : '*';\n const paragraphs = scope ? `${scope} p` : 'p';\n return `\n${every} { line-height: 1.5 !important; letter-spacing: 0.12em !important; word-spacing: 0.16em !important; }\n${paragraphs} { margin-bottom: 2em !important; }\n`;\n}\n\n/**\n * What `observe` finds under the SC 1.4.12 override and not without it. The\n * pixel counts in a failure move under the override, so `key` names a failure\n * by what fails and where; a key found n times without the override excuses n\n * under it.\n */\nexport async function newUnderTextSpacing<T>(\n page: Page,\n observe: () => Promise<T[]>,\n key: (failure: T) => string,\n scope?: string,\n): Promise<T[]> {\n const before = await observe();\n const style = await page.addStyleTag({ content: textSpacingCss(scope) });\n let after: T[];\n try {\n after = await observe();\n } finally {\n await style.evaluate((node) => (node as Element).remove());\n }\n const known = new Map<string, number>();\n for (const failure of before) known.set(key(failure), (known.get(key(failure)) ?? 0) + 1);\n return after.filter((failure) => {\n const left = known.get(key(failure)) ?? 0;\n if (left > 0) known.set(key(failure), left - 1);\n return left === 0;\n });\n}\n\n/** Tags with its index under `attr` each element inside `scope`, outside\n * `exclude`, that is or sits inside one of `own`, and returns how many it\n * tagged. `own` names the component's root and portaled parts, so the\n * editor's scaffolding around the preview stays out. */\nfunction tagInScope(page: Page, scope: string, exclude: string[], own: string[], attr: string): Promise<number> {\n return page.evaluate(({ scope, exclude, own, attr }) => {\n const found = [...document.querySelectorAll(scope)].flatMap((root) => [root, ...root.querySelectorAll('*')])\n .filter((el, i, all) => all.indexOf(el) === i && el.closest(own) && !exclude.some((selector) => el.closest(selector)));\n found.forEach((el, i) => el.setAttribute(attr, String(i)));\n return found.length;\n }, { scope, exclude, own: own.join(', '), attr });\n}\n\nfunction untag(page: Page, attr: string, styleId?: string): Promise<void> {\n return page.evaluate(({ attr, styleId }) => {\n if (styleId) document.getElementById(styleId)?.remove();\n for (const el of document.querySelectorAll(`[${attr}]`)) el.removeAttribute(attr);\n }, { attr, styleId });\n}\n\ninterface Overflow {\n index: string;\n axis: 'x' | 'y';\n tag: string;\n content: number;\n box: number;\n overflow: string;\n}\n\n/** Each tagged element whose content runs past its box on an axis it does not\n * scroll. */\nfunction observeOverflow(page: Page): Promise<Overflow[]> {\n return page.evaluate(({ attr, tolerance }) => [...document.querySelectorAll(`[${attr}]`)].flatMap((el) => {\n const style = getComputedStyle(el);\n if (style.display === 'none' || style.display === 'contents') return [];\n // An inline box reports 0 for both, so it would read as overflowing its own zero size.\n if (el.clientWidth === 0 && el.clientHeight === 0) return [];\n // A box with no text under it holds icon glyphs, which letter spacing pads with nothing visible.\n if (!el.textContent?.trim()) return [];\n const index = el.getAttribute(attr)!;\n const tag = el.tagName.toLowerCase();\n const found: Overflow[] = [];\n const axes = [\n ['x', el.scrollWidth, el.clientWidth, style.overflowX],\n ['y', el.scrollHeight, el.clientHeight, style.overflowY],\n ] as const;\n for (const [axis, content, box, overflow] of axes) {\n if (overflow === 'auto' || overflow === 'scroll' || content <= box + tolerance) continue;\n found.push({ index, axis, tag, content, box, overflow });\n }\n return found;\n }), { attr: SPACING_ATTR, tolerance: TOLERANCE });\n}\n\nfunction groupBy<T>(items: T[], key: (item: T) => string): Map<string, T[]> {\n const groups = new Map<string, T[]>();\n for (const item of items) groups.set(key(item), [...(groups.get(key(item)) ?? []), item]);\n return groups;\n}\n\n/**\n * Decision 10: each element of the component in `scope` that overflows or\n * clips under the SC 1.4.12 override, applied inside `scope`, and did not\n * without it. A transition would leave the box at its start size, so\n * transitions stay off while the check reads.\n */\nexport async function scanTextSpacing(page: Page, scope: string, exclude: string[], own: string[]): Promise<A11yResult[]> {\n await page.evaluate(({ id, scope }) => {\n const style = document.createElement('style');\n style.id = id;\n style.textContent = `${scope} *, ${scope} *::before, ${scope} *::after { transition: none !important; }`;\n document.head.append(style);\n }, { id: STILL_ID, scope });\n try {\n if (await tagInScope(page, scope, exclude, own, SPACING_ATTR) === 0) return [];\n const found = await newUnderTextSpacing(page, () => observeOverflow(page), (o) => `${o.index}|${o.axis}`, scope);\n if (found.length === 0) return [];\n const byElement = groupBy(found, (o) => o.index);\n const described = await describeTagged(page, scope, exclude, SPACING_ATTR, [...byElement.keys()]);\n return [...byElement.values()].map((overflows, i) => ({\n rule: 'a11y-text-spacing',\n engineRule: TEXT_SPACING_RULE,\n impact: null,\n target: described[i].target,\n html: described[i].html,\n help: `Under the text spacing override, ${overflows.map((o) =>\n `<${o.tag}> holds ${o.content}px of content in ${o.box}px of ${o.axis === 'x' ? 'width' : 'height'}, `\n + `and its overflow-${o.axis} is ${o.overflow}`).join('; ')}`,\n helpUrl: TEXT_SPACING_URL,\n }));\n } finally {\n await untag(page, SPACING_ATTR, STILL_ID);\n }\n}\n\ninterface Motion {\n index: string;\n pseudo: string;\n kind: 'animation' | 'transition' | 'script';\n name: string;\n end: number;\n}\n\n/** Each tagged element's animations and transitions, and its pseudo-elements',\n * that last past `MOTION_MS`. The harness finishes every finite animation\n * when it selects a view, so the read takes each declared one at its length,\n * run or not. A script animation counts while it runs. */\nfunction observeMotion(page: Page): Promise<Motion[]> {\n return page.evaluate(({ attr, limit }) => {\n const ms = (time: string) => parseFloat(time) * (time.trim().endsWith('ms') ? 1 : 1000) || 0;\n const list = (value: string) => value.split(/,(?![^(]*\\))/).map((part) => part.trim());\n const at = (values: string[], i: number) => values[i % values.length];\n const found: Motion[] = [];\n const tagged = [...document.querySelectorAll(`[${attr}]`)].filter((el) => el.checkVisibility());\n for (const el of tagged) {\n const index = el.getAttribute(attr)!;\n for (const pseudo of ['', '::before', '::after']) {\n const style = getComputedStyle(el, pseudo || null);\n if (pseudo && (style.content === 'none' || style.content === 'normal' || style.display === 'none')) continue;\n const durations = list(style.animationDuration);\n const counts = list(style.animationIterationCount);\n const delays = list(style.animationDelay);\n list(style.animationName).forEach((name, i) => {\n if (name === 'none') return;\n const count = at(counts, i);\n const end = ms(at(delays, i)) + (count === 'infinite' ? Infinity : ms(at(durations, i)) * parseFloat(count));\n // Svelte scopes a component's keyframes with a hash its source never spells.\n if (end > limit) found.push({ index, pseudo, kind: 'animation', name: name.replace(/^svelte-[a-z0-9]+-/, ''), end });\n });\n const transitionDurations = list(style.transitionDuration);\n const transitionDelays = list(style.transitionDelay);\n list(style.transitionProperty).forEach((name, i) => {\n const end = ms(at(transitionDurations, i)) + ms(at(transitionDelays, i));\n if (name !== 'none' && end > limit) found.push({ index, pseudo, kind: 'transition', name, end });\n });\n }\n }\n for (const animation of document.getAnimations()) {\n if (animation instanceof CSSAnimation || animation instanceof CSSTransition || animation.playState !== 'running') continue;\n const effect = animation.effect;\n if (!(effect instanceof KeyframeEffect) || !effect.target?.hasAttribute(attr)) continue;\n const end = Number(effect.getComputedTiming().endTime ?? 0);\n if (end > limit) {\n found.push({ index: effect.target.getAttribute(attr)!, pseudo: effect.pseudoElement ?? '', kind: 'script', name: animation.id, end });\n }\n }\n return found;\n }, { attr: MOTION_ATTR, limit: MOTION_MS });\n}\n\nconst capitalize = (text: string) => text.charAt(0).toUpperCase() + text.slice(1);\n\nfunction describeMotion({ kind, name, end }: Motion): string {\n const what = kind === 'animation' ? `the animation ${name}`\n : kind === 'transition' ? `a transition of ${name}` : `a script animation${name ? ` ${name}` : ''}`;\n return `${what} ${Number.isFinite(end) ? `lasts ${Math.round(end)} ms` : 'runs without end'}`;\n}\n\n/**\n * Decision 11: the animations and transitions of the component in `scope`\n * that last past `MOTION_MS`, read again under `prefers-reduced-motion:\n * reduce`. Each one still that long reports. A view with none skips the\n * second read, and the emulation lifts before the check returns.\n */\nexport async function scanReducedMotion(page: Page, scope: string, exclude: string[], own: string[]): Promise<CheckedResult[]> {\n try {\n if (await tagInScope(page, scope, exclude, own, MOTION_ATTR) === 0) return [];\n if ((await observeMotion(page)).length === 0) return [];\n let reduced: Motion[];\n await page.emulateMedia({ reducedMotion: 'reduce' });\n try {\n // A script that listens for the preference reacts on a later frame.\n await page.evaluate(() => new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve()))));\n reduced = await observeMotion(page);\n } finally {\n await page.emulateMedia({ reducedMotion: null });\n }\n if (reduced.length === 0) return [];\n const byTarget = groupBy(reduced, (m) => `${m.index}\\n${m.pseudo}`);\n const groups = [...byTarget.values()];\n const described = await describeTagged(page, scope, exclude, MOTION_ATTR, groups.map((motions) => motions[0].index));\n return groups.map((motions, i) => ({\n result: {\n rule: 'a11y-reduced-motion',\n engineRule: REDUCED_MOTION_RULE,\n impact: null,\n target: `${described[i].target}${motions[0].pseudo}`,\n html: described[i].html,\n help: capitalize(`${motions.map(describeMotion).join('; ')} under prefers-reduced-motion: reduce`),\n helpUrl: MOTION_URL,\n },\n trace: { selector: described[i].target },\n }));\n } finally {\n await untag(page, MOTION_ATTR);\n }\n}\n"],"mappings":";AAcA,IAAM,WAAW,CAAC,SAAS,UAAU,SAAS,eAAe,cAAc,UAAU;AACrF,IAAM,QAAQ,CAAC,SAAS,eAAe;AAEvC,IAAM,eAAe,CAAC,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