@ngbracket/a11y-devtools 0.15.6 → 0.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +44 -37
- package/dist/inpage.global.js +11 -3
- package/dist/overlay.js +20 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to `@ngbracket/a11y-devtools` are documented here.
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## 0.15.7
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- The keyboard tab-order badges now pass a colour contrast check. Their white
|
|
11
|
+
digits sat on a teal fill at 3.93:1, below the 4.5:1 that text this size
|
|
12
|
+
needs, and axe flagged them on a dark-mode page. The fill is now `#0a7a7a`
|
|
13
|
+
(5.15:1). The orange badge for a positive `tabindex` had the same problem
|
|
14
|
+
(3.09:1) and is now `#b45309` (5.02:1). The lines joining the badges keep
|
|
15
|
+
their teal.
|
|
16
|
+
- The finding labels now pass a colour contrast check too. Their white text
|
|
17
|
+
sat on the impact colour, which gave 2.42:1 to 4.11:1 for every impact except
|
|
18
|
+
critical. Labels now use a darker fill in the same hue: serious `#b45309`,
|
|
19
|
+
moderate `#8a6d00`, minor `#2563c4` and no impact `#666666`, all at least
|
|
20
|
+
4.9:1. The box outlines keep the original impact colours.
|
|
21
|
+
|
|
6
22
|
## 0.15.6
|
|
7
23
|
|
|
8
24
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
# @ngbracket/a11y-devtools
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Finds accessibility problems in Angular apps and names the component behind each one.
|
|
4
|
+
Use it as an overlay while you develop, or headless in CI. It runs axe-core, plus its
|
|
5
|
+
own keyboard checks if you turn them on, and groups the results by component:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
♿ UserCardComponent — 2 issue(s)
|
|
9
|
+
critical · image-alt: Images must have alternative text
|
|
10
|
+
serious · color-contrast: Elements must meet minimum color contrast ratio thresholds
|
|
11
|
+
```
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
Documentation: [ngbracket.com/tools/a11y-devtools/docs](https://ngbracket.com/tools/a11y-devtools/docs/introduction)
|
|
14
|
+
has the guides, every option and CLI flag, and the rule catalogue. You can also try the
|
|
15
|
+
[live demo](https://a11y-demo.ngbracket.com/a11y-demo) without installing anything.
|
|
9
16
|
|
|
10
17
|
Part of the `@ngbracket` Angular tooling family.
|
|
11
18
|
|
|
12
19
|
## Features
|
|
13
20
|
|
|
14
|
-
-
|
|
15
|
-
|
|
21
|
+
- Component attribution: every finding names the Angular component to fix. It skips
|
|
22
|
+
past UI-library components (Material, CDK, Nebular and others) to yours, using
|
|
16
23
|
Angular's documented dev debug API (`window.ng`).
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
Alt+Shift+A
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
- In-app provider: rescans each time the app settles, logs findings grouped by
|
|
25
|
+
component, and can draw an overlay on the page. Turn it on and off with the
|
|
26
|
+
on-page pill or Alt+Shift+A. The pill's menu picks what's drawn and downloads an
|
|
27
|
+
HTML report of the routes you've visited.
|
|
28
|
+
- Report mode: scans many routes headless from the CLI and writes Markdown, JSON
|
|
29
|
+
and a self-contained HTML report.
|
|
30
|
+
- CI gating with a baseline: fails only on new issues, so an app with known issues
|
|
31
|
+
can add the gate straight away.
|
|
32
|
+
- Dark mode: scans your dark theme too, however your app switches to it.
|
|
33
|
+
- Keyboard & Focus Mode: numbers the tab order, adds keyboard findings, shows the
|
|
34
|
+
Focus preview card (computed role, name and state), and finds keyboard traps by
|
|
35
|
+
pressing Tab for real.
|
|
36
|
+
- Production weight: does nothing in production builds, and axe-core isn't loaded
|
|
37
|
+
there.
|
|
31
38
|
|
|
32
39
|
## Install
|
|
33
40
|
|
|
@@ -38,7 +45,7 @@ npm i -D @ngbracket/a11y-devtools
|
|
|
38
45
|
npm i -D playwright && npx playwright install chromium
|
|
39
46
|
```
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
It needs Angular 18 or later.
|
|
42
49
|
|
|
43
50
|
## Quick start
|
|
44
51
|
|
|
@@ -56,8 +63,8 @@ export const appConfig: ApplicationConfig = {
|
|
|
56
63
|

|
|
61
68
|
|
|
62
69
|
In CI (`--serve` starts `ng serve`, waits for it, and stops it after the scan):
|
|
63
70
|
|
|
@@ -78,13 +85,13 @@ Next steps, in the docs:
|
|
|
78
85
|
[CLI reference](https://ngbracket.com/tools/a11y-devtools/docs/cli) ·
|
|
79
86
|
[Findings & rules](https://ngbracket.com/tools/a11y-devtools/docs/findings)
|
|
80
87
|
|
|
81
|
-
## What it
|
|
88
|
+
## What it leaves to you
|
|
82
89
|
|
|
83
|
-
Automated checks cover part of WCAG
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
[What it checks
|
|
90
|
+
Automated checks cover part of WCAG. The rest needs manual testing: keyboard, screen
|
|
91
|
+
reader, zoom and review by people. The keyboard findings are heuristics,
|
|
92
|
+
each labelled "verify manually". The tool helps you build toward supporting WCAG 2.2
|
|
93
|
+
AA; it doesn't certify conformance. See
|
|
94
|
+
[What it checks](https://ngbracket.com/tools/a11y-devtools/docs/coverage).
|
|
88
95
|
|
|
89
96
|
## Develop
|
|
90
97
|
|
|
@@ -111,13 +118,13 @@ ever becomes reachable through a static import.
|
|
|
111
118
|
|
|
112
119
|
### Planned
|
|
113
120
|
|
|
114
|
-
-
|
|
115
|
-
|
|
121
|
+
- A headless "linear walkthrough": the tab sequence as a reading list per route in
|
|
122
|
+
report mode. The Focus preview is overlay-only for now.
|
|
116
123
|
- Per-component filtering and a violation-count badge.
|
|
117
124
|
|
|
118
125
|
### Done
|
|
119
126
|
|
|
120
|
-
- Component attribution
|
|
127
|
+
- Component attribution: the nearest app-owned component, skipping UI primitives.
|
|
121
128
|
- Directive and `hostDirectives` attribution.
|
|
122
129
|
- Configurable framework prefixes.
|
|
123
130
|
- axe scan.
|
|
@@ -128,10 +135,10 @@ ever becomes reachable through a static import.
|
|
|
128
135
|
- HTML report output.
|
|
129
136
|
- Baseline/diff mode: CI fails only on new issues.
|
|
130
137
|
- Dark-mode scanning: `--color-scheme`, `--dark-class` / `--dark-attribute`, and theme-aware hooks.
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
|
|
138
|
+
- Keyboard & Focus Mode M1: tab-order visualisation and keyboard-reachability findings.
|
|
139
|
+
- Keyboard & Focus Mode M2: the focus-follow accessibility-tree preview (now called Focus preview).
|
|
140
|
+
- Keyboard & Focus Mode M3: missing focus-trap detection (an `aria-modal` that doesn't
|
|
141
|
+
contain focus) and the keyboard-trap walk with real Tab presses.
|
|
135
142
|
- CI production-weight guard.
|
|
136
143
|
- Real-browser E2E tests, including component attribution in a real Angular app.
|
|
137
144
|
- Report mode can start the dev server (`--serve`).
|
package/dist/inpage.global.js
CHANGED
|
@@ -34301,7 +34301,8 @@
|
|
|
34301
34301
|
// dist/overlay.js
|
|
34302
34302
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
34303
34303
|
var TAB_ORDER_COLOR = "#0b8f8f";
|
|
34304
|
-
var
|
|
34304
|
+
var TAB_BADGE_FILL = "#0a7a7a";
|
|
34305
|
+
var TAB_BADGE_WARN_FILL = "#b45309";
|
|
34305
34306
|
var TAB_BADGE_GUTTER = 10;
|
|
34306
34307
|
var TAB_BADGE_MIN_X = 9;
|
|
34307
34308
|
var LABEL_MIN_TOP = 2;
|
|
@@ -34314,6 +34315,13 @@
|
|
|
34314
34315
|
minor: "#3b7dd8",
|
|
34315
34316
|
none: "#8a8a8a"
|
|
34316
34317
|
};
|
|
34318
|
+
var IMPACT_LABEL_FILL = {
|
|
34319
|
+
critical: "#d32029",
|
|
34320
|
+
serious: "#b45309",
|
|
34321
|
+
moderate: "#8a6d00",
|
|
34322
|
+
minor: "#2563c4",
|
|
34323
|
+
none: "#666666"
|
|
34324
|
+
};
|
|
34317
34325
|
function colorFor(impact) {
|
|
34318
34326
|
return IMPACT_COLOR[impact ?? "none"];
|
|
34319
34327
|
}
|
|
@@ -34517,7 +34525,7 @@
|
|
|
34517
34525
|
return nodes;
|
|
34518
34526
|
}
|
|
34519
34527
|
function buildBadge(doc, stop) {
|
|
34520
|
-
const color = stop.positive ?
|
|
34528
|
+
const color = stop.positive ? TAB_BADGE_WARN_FILL : TAB_BADGE_FILL;
|
|
34521
34529
|
const badge = doc.createElement("div");
|
|
34522
34530
|
badge.setAttribute("data-ngb-tab-order", String(stop.order));
|
|
34523
34531
|
const owner = stop.component ? ` \xB7 ${stop.component}` : "";
|
|
@@ -34574,7 +34582,7 @@
|
|
|
34574
34582
|
padding: "1px 4px",
|
|
34575
34583
|
font: "11px/1.4 ui-monospace, monospace",
|
|
34576
34584
|
color: "#fff",
|
|
34577
|
-
background:
|
|
34585
|
+
background: IMPACT_LABEL_FILL[finding.impact ?? "none"],
|
|
34578
34586
|
whiteSpace: "nowrap"
|
|
34579
34587
|
});
|
|
34580
34588
|
box.appendChild(label);
|
package/dist/overlay.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { keepInTopLayer } from './top-layer.js';
|
|
2
2
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
3
|
-
/** Tab-order
|
|
3
|
+
/** Tab-order connector line colour (teal). */
|
|
4
4
|
const TAB_ORDER_COLOR = '#0b8f8f';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Badge fills behind white 10px digits: at least 4.5:1 with white (teal 5.15,
|
|
7
|
+
* orange 5.02). The orange marks a positive-tabindex stop.
|
|
8
|
+
*/
|
|
9
|
+
const TAB_BADGE_FILL = '#0a7a7a';
|
|
10
|
+
const TAB_BADGE_WARN_FILL = '#b45309';
|
|
6
11
|
/** How far outside a control's left edge the tab-order badge sits, and its min viewport x. */
|
|
7
12
|
const TAB_BADGE_GUTTER = 10;
|
|
8
13
|
const TAB_BADGE_MIN_X = 9;
|
|
@@ -23,6 +28,17 @@ const IMPACT_COLOR = {
|
|
|
23
28
|
minor: '#3b7dd8',
|
|
24
29
|
none: '#8a8a8a',
|
|
25
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Label fill per impact, behind white 11px text: at least 4.5:1 with white, in
|
|
33
|
+
* the same hue as the border, so the labels pass a contrast check themselves.
|
|
34
|
+
*/
|
|
35
|
+
const IMPACT_LABEL_FILL = {
|
|
36
|
+
critical: '#d32029',
|
|
37
|
+
serious: '#b45309',
|
|
38
|
+
moderate: '#8a6d00',
|
|
39
|
+
minor: '#2563c4',
|
|
40
|
+
none: '#666666',
|
|
41
|
+
};
|
|
26
42
|
function colorFor(impact) {
|
|
27
43
|
return IMPACT_COLOR[impact ?? 'none'];
|
|
28
44
|
}
|
|
@@ -268,7 +284,7 @@ function buildAxPanelContent(doc, data) {
|
|
|
268
284
|
* positive tabindex hijacks the natural order.
|
|
269
285
|
*/
|
|
270
286
|
function buildBadge(doc, stop) {
|
|
271
|
-
const color = stop.positive ?
|
|
287
|
+
const color = stop.positive ? TAB_BADGE_WARN_FILL : TAB_BADGE_FILL;
|
|
272
288
|
const badge = doc.createElement('div');
|
|
273
289
|
badge.setAttribute('data-ngb-tab-order', String(stop.order));
|
|
274
290
|
const owner = stop.component ? ` · ${stop.component}` : '';
|
|
@@ -328,7 +344,7 @@ function buildBox(doc, finding) {
|
|
|
328
344
|
padding: '1px 4px',
|
|
329
345
|
font: '11px/1.4 ui-monospace, monospace',
|
|
330
346
|
color: '#fff',
|
|
331
|
-
background:
|
|
347
|
+
background: IMPACT_LABEL_FILL[finding.impact ?? 'none'],
|
|
332
348
|
whiteSpace: 'nowrap',
|
|
333
349
|
});
|
|
334
350
|
box.appendChild(label);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngbracket/a11y-devtools",
|
|
3
|
-
"version": "0.15.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.15.7",
|
|
4
|
+
"description": "Finds accessibility problems in Angular apps and names the component behind each one. A dev overlay, or headless reports for CI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Duncan Faulkner",
|
|
7
7
|
"contributors": [
|