@ngbracket/a11y-devtools 0.7.0 → 0.7.1

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 CHANGED
@@ -3,6 +3,17 @@
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.7.1
7
+
8
+ ### Fixed
9
+
10
+ - **Tab-order badges no longer collide with the findings labels.** A numbered
11
+ tab-order badge was anchored on each control's top-left corner — exactly where
12
+ the severity-coloured finding labels sit — so on a flagged control the two
13
+ overlapped and obscured each other. Badges now sit just outside the control's
14
+ left edge, vertically centred (clamped into the viewport for controls flush to
15
+ the left), and the connector path threads those points.
16
+
6
17
  ## 0.7.0
7
18
 
8
19
  ### Added
package/README.md CHANGED
@@ -161,7 +161,15 @@ component that placed it and notes the primitive as `(via …)`.
161
161
  axe covers the machine-testable third of WCAG. **Keyboard & Focus Mode** starts on
162
162
  the rest — keyboard operability — still naming the component that owns each issue.
163
163
  Turn it on with `keyboard: true` (provider / `runA11yScan` / `scan` / `scanPages`)
164
- or `--keyboard` on the CLI. It adds:
164
+ or `--keyboard` on the CLI.
165
+
166
+ ![Keyboard & Focus Mode over the demo page: numbered tab-order badges (badge 1 in
167
+ orange flags a positive tabindex) joined by a connector path, severity-coloured
168
+ finding highlights labelled with their owning component (including the ngbr/*
169
+ keyboard findings), and the focus-follow accessibility-tree panel showing the
170
+ focused button's computed role, name and states.](./demo/keyboard-layer-2026-09.png)
171
+
172
+ It adds:
165
173
 
166
174
  - **Tab-order visualisation** (overlay): numbered badges at each tab stop and a
167
175
  connector path showing the order focus actually moves. A positive-`tabindex` stop
@@ -34226,6 +34226,8 @@
34226
34226
  var SVG_NS = "http://www.w3.org/2000/svg";
34227
34227
  var TAB_ORDER_COLOR = "#0b8f8f";
34228
34228
  var TAB_ORDER_WARN_COLOR = "#e8710a";
34229
+ var TAB_BADGE_GUTTER = 10;
34230
+ var TAB_BADGE_MIN_X = 9;
34229
34231
  var OVERLAY_ATTR = "data-ngb-a11y-overlay";
34230
34232
  var OVERLAY_EXCLUDE_SELECTOR = `[${OVERLAY_ATTR}]`;
34231
34233
  var IMPACT_COLOR = {
@@ -34298,9 +34300,11 @@
34298
34300
  const points = [];
34299
34301
  for (const { target, badge } of tabBadges) {
34300
34302
  const rect = target.getBoundingClientRect();
34301
- badge.style.top = `${rect.top}px`;
34302
- badge.style.left = `${rect.left}px`;
34303
- points.push(`${rect.left + rect.width / 2},${rect.top + rect.height / 2}`);
34303
+ const y = rect.top + rect.height / 2;
34304
+ const x = Math.max(TAB_BADGE_MIN_X, rect.left - TAB_BADGE_GUTTER);
34305
+ badge.style.top = `${y}px`;
34306
+ badge.style.left = `${x}px`;
34307
+ points.push(`${x},${y}`);
34304
34308
  }
34305
34309
  connector.setAttribute("points", points.join(" "));
34306
34310
  }
package/dist/overlay.js CHANGED
@@ -2,6 +2,9 @@ const SVG_NS = 'http://www.w3.org/2000/svg';
2
2
  /** Tab-order path + badge colours: normal teal, warning orange for positive tabindex. */
3
3
  const TAB_ORDER_COLOR = '#0b8f8f';
4
4
  const TAB_ORDER_WARN_COLOR = '#e8710a';
5
+ /** How far outside a control's left edge the tab-order badge sits, and its min viewport x. */
6
+ const TAB_BADGE_GUTTER = 10;
7
+ const TAB_BADGE_MIN_X = 9;
5
8
  /**
6
9
  * Attribute marking the overlay's own DOM. `scan()` excludes anything under it
7
10
  * so the tool never reports violations against its own highlights.
@@ -92,9 +95,16 @@ export function createOverlay(options = {}) {
92
95
  const points = [];
93
96
  for (const { target, badge } of tabBadges) {
94
97
  const rect = target.getBoundingClientRect();
95
- badge.style.top = `${rect.top}px`;
96
- badge.style.left = `${rect.left}px`;
97
- points.push(`${rect.left + rect.width / 2},${rect.top + rect.height / 2}`);
98
+ // Anchor the badge just OUTSIDE the left edge, vertically centred, so it
99
+ // clears the findings labels that sit along the top-left corner (a
100
+ // corner-anchored badge collided with them). Clamp x into the viewport so a
101
+ // control flush to the left edge still shows its badge. The connector
102
+ // threads these same points.
103
+ const y = rect.top + rect.height / 2;
104
+ const x = Math.max(TAB_BADGE_MIN_X, rect.left - TAB_BADGE_GUTTER);
105
+ badge.style.top = `${y}px`;
106
+ badge.style.left = `${x}px`;
107
+ points.push(`${x},${y}`);
98
108
  }
99
109
  connector.setAttribute('points', points.join(' '));
100
110
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngbracket/a11y-devtools",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Dev-only in-app accessibility auditing for Angular that maps each axe violation back to the component that rendered it — the attribution React overlay tools can't do.",
5
5
  "license": "MIT",
6
6
  "author": "Duncan Faulkner",