Skip to content

Commit 4ebeb9e

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
2 parents ed5c27c + 7c33985 commit 4ebeb9e

88 files changed

Lines changed: 6344 additions & 208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/huge-crabs-prove.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@tanstack/solid-devtools': patch
3+
'@tanstack/devtools-a11y': patch
4+
'@tanstack/devtools-ui': patch
5+
'@tanstack/devtools': patch
6+
---
7+
8+
Adds tanstack Devtool plugin. PR also includes some minor patches

.changeset/thirty-spies-fetch.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@tanstack/preact-devtools': minor
3+
'@tanstack/devtools-utils': minor
4+
'@tanstack/react-devtools': minor
5+
'@tanstack/solid-devtools': minor
6+
'@tanstack/devtools': minor
7+
---
8+
9+
Change the way props are passed to the plugins

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ vite.config.ts.timestamp-*
5858
.angular
5959
.nitro
6060
.sonda
61-
*settings.local.json
61+
*settings.local.json
62+
.claude/worktrees

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ npx @tanstack/intent@latest install
6363

6464
<table align="center">
6565
<tr>
66-
<td>
66+
<td>
6767
<a href="https://www.coderabbit.ai/?via=tanstack&dub_id=aCcEEdAOqqutX6OS" >
6868
<picture>
69-
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-CMcuvjEy.svg" height="40" />
70-
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" />
71-
<img src="https://tanstack.com/assets/coderabbit-light-DVMJ2jHi.svg" height="40" alt="CodeRabbit" />
69+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/coderabbit-dark-D643Zkrv.svg" />
70+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg" />
71+
<img src="https://tanstack.com/assets/coderabbit-light-CIzGLYU_.svg" height="40" alt="CodeRabbit" />
7272
</picture>
7373
</a>
7474
</td>
7575
<td>
7676
<a href="https://www.cloudflare.com?utm_source=tanstack">
7777
<picture>
78-
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-DQDB7UaL.svg" height="60" />
79-
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" />
80-
<img src="https://tanstack.com/assets/cloudflare-black-CPufaW0B.svg" height="60" alt="Cloudflare" />
78+
<source media="(prefers-color-scheme: dark)" srcset="https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg" />
79+
<source media="(prefers-color-scheme: light)" srcset="https://tanstack.com/assets/cloudflare-black-6Ojsn8yh.svg" />
80+
<img src="https://tanstack.com/assets/cloudflare-white-Co-Tyjbl.svg" height="60" alt="Cloudflare" />
8181
</picture>
8282
</a>
8383
</td>

docs/config.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,34 @@
175175
]
176176
}
177177
]
178+
},
179+
{
180+
"label": "Plugins",
181+
"children": [],
182+
"frameworks": [
183+
{
184+
"label": "react",
185+
"children": [
186+
{
187+
"label": "a11y",
188+
"to": "framework/react/examples/a11y-devtools"
189+
}
190+
]
191+
},
192+
{
193+
"label": "preact",
194+
"children": []
195+
},
196+
{
197+
"label": "solid",
198+
"children": [
199+
{
200+
"label": "A11y",
201+
"to": "framework/solif/examples/a11y-devtools"
202+
}
203+
]
204+
}
205+
]
178206
}
179207
]
180208
}

docs/plugins/a11y.md

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
---
2+
title: Accessibility Plugin
3+
id: a11y-plugin
4+
---
5+
6+
The TanStack Devtools Accessibility (A11y) Plugin provides real-time accessibility auditing for your web applications, powered by [axe-core](https://github.com/dequelabs/axe-core). It helps you identify and fix accessibility issues during development.
7+
8+
## Features
9+
10+
- **Full Page Scanning** - Audit your entire page for accessibility violations
11+
- **Component-Level Scanning** - Scope audits to specific components using React hooks
12+
- **Visual Overlays** - Highlight problematic elements with severity-based colors
13+
- **Click-to-Navigate** - Click on an issue to automatically scroll to and highlight the element
14+
- **Dark Mode Support** - Automatically adapts to the devtools theme
15+
- **Devtools-Aware** - Automatically excludes devtools panels from scanning
16+
- **Configurable Rule Sets** - Support for WCAG 2.0/2.1/2.2 (A/AA/AAA), Section 508, and best practices
17+
- **Export Reports** - Download results as JSON or CSV
18+
- **Persistent Settings** - Configuration saved to localStorage
19+
20+
## Installation
21+
22+
```bash
23+
npm install @tanstack/devtools-a11y
24+
# or
25+
pnpm add @tanstack/devtools-a11y
26+
# or
27+
yarn add @tanstack/devtools-a11y
28+
```
29+
30+
## Quick Start (React)
31+
32+
```tsx
33+
import { createRoot } from 'react-dom/client'
34+
import { TanStackDevtools } from '@tanstack/react-devtools'
35+
import { a11yDevtoolsPlugin } from '@tanstack/devtools-a11y/react'
36+
37+
createRoot(document.getElementById('root')!).render(
38+
<>
39+
<App />
40+
<TanStackDevtools plugins={[a11yDevtoolsPlugin()]} />
41+
</>,
42+
)
43+
```
44+
45+
## Quick Start (Solid)
46+
47+
```tsx
48+
import { render } from 'solid-js/web'
49+
import { TanStackDevtools } from '@tanstack/solid-devtools'
50+
import { a11yDevtoolsPlugin } from '@tanstack/devtools-a11y/solid'
51+
52+
render(
53+
() => (
54+
<>
55+
<App />
56+
<TanStackDevtools plugins={[a11yDevtoolsPlugin()]} />
57+
</>
58+
),
59+
document.getElementById('root')!,
60+
)
61+
```
62+
63+
## Quick Start (Vue)
64+
65+
```ts
66+
import { createA11yDevtoolsVuePlugin } from '@tanstack/devtools-a11y/vue'
67+
68+
const plugins = [createA11yDevtoolsVuePlugin()]
69+
```
70+
71+
## Click-to-Navigate
72+
73+
When you click on an issue in the panel, the plugin will:
74+
75+
1. **Scroll** the problematic element into view (centered in the viewport)
76+
2. **Highlight** the element with a pulsing overlay matching its severity color
77+
3. **Show a tooltip** with the rule ID and impact level
78+
79+
This makes it easy to locate and inspect issues directly on the page.
80+
81+
## Panel Configuration
82+
83+
Initial configuration can be provided via the vanilla plugin API:
84+
85+
```ts
86+
import { createA11yPlugin } from '@tanstack/devtools-a11y'
87+
88+
const plugin = createA11yPlugin({
89+
threshold: 'serious',
90+
ruleSet: 'wcag21aa',
91+
showOverlays: true,
92+
persistSettings: true,
93+
disabledRules: [],
94+
})
95+
```
96+
97+
Common `options` fields:
98+
99+
- `threshold`: minimum impact level to show
100+
- `ruleSet`: rule preset (`'wcag2a' | 'wcag2aa' | 'wcag21aa' | 'wcag22aa' | 'section508' | 'best-practice' | 'all'`)
101+
- `showOverlays`: highlight issues in the page
102+
- `persistSettings`: store config in localStorage
103+
- `disabledRules`: rule IDs to ignore
104+
105+
If you don't need to provide initial configuration, you can use the framework plugin helpers
106+
directly (the settings UI persists changes to localStorage by default).
107+
108+
## Severity Levels
109+
110+
Issues are categorized by impact level with corresponding overlay colors:
111+
112+
| Impact | Color | Description |
113+
|--------|-------|-------------|
114+
| Critical | Red | Must be fixed - prevents users from accessing content |
115+
| Serious | Orange | Should be fixed - significantly impacts user experience |
116+
| Moderate | Yellow | Consider fixing - affects some users |
117+
| Minor | Blue | Optional improvement - minor impact |
118+
119+
## Framework Support
120+
121+
The panel UI is implemented in Solid and wrapped for React, Solid, Preact, and Vue
122+
using `@tanstack/devtools-utils`.
123+
124+
## Export Formats
125+
126+
### JSON Export
127+
128+
```ts
129+
import { exportToJSON } from '@tanstack/devtools-a11y'
130+
131+
const jsonString = exportToJSON(auditResult)
132+
```
133+
134+
### CSV Export
135+
136+
```ts
137+
import { exportToCSV } from '@tanstack/devtools-a11y'
138+
139+
const csvString = exportToCSV(auditResult)
140+
```
141+
142+
## Supported Standards
143+
144+
The plugin supports the following accessibility standards:
145+
146+
- **WCAG 2.0** Level A, AA, AAA
147+
- **WCAG 2.1** Level A, AA, AAA
148+
- **WCAG 2.2** Level AA
149+
- **Section 508**
150+
- **Best Practices** (non-standard recommendations)
151+
152+
## Troubleshooting
153+
154+
### Issues not appearing
155+
156+
1. Check that the element is visible in the viewport
157+
2. Ensure the element is not excluded by `excludeSelectors`
158+
3. Verify the selected standard includes the relevant rule
159+
160+
### Overlays not showing
161+
162+
1. Confirm overlays are enabled in the panel settings
163+
2. Check for CSS conflicts with `z-index` or `pointer-events`
164+
3. Ensure the container element exists in the DOM
165+
166+
## Example
167+
168+
See the full working example at:
169+
`examples/react/a11y-devtools/`
170+
171+
Run it with:
172+
```bash
173+
cd examples/react/a11y-devtools
174+
pnpm dev
175+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" type="image/svg+xml" href="/emblem-light.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
9+
<title>A11y Devtools - TanStack Devtools</title>
10+
</head>
11+
<body>
12+
<noscript>You need to enable JavaScript to run this app.</noscript>
13+
<div id="root"></div>
14+
<script type="module" src="/src/index.tsx"></script>
15+
</body>
16+
</html>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "@tanstack/react-devtools-a11y-example",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"dev": "vite --port=3002",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"test:types": "tsc"
10+
},
11+
"dependencies": {
12+
"@tanstack/devtools-a11y": "workspace:*",
13+
"@tanstack/react-devtools": "^0.9.13",
14+
"react": "^19.2.0",
15+
"react-dom": "^19.2.0"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^19.2.0",
19+
"@types/react-dom": "^19.2.0",
20+
"@vitejs/plugin-react": "^5.0.4",
21+
"vite": "^7.1.7"
22+
},
23+
"browserslist": {
24+
"production": [
25+
">0.2%",
26+
"not dead",
27+
"not op_mini all"
28+
],
29+
"development": [
30+
"last 1 chrome version",
31+
"last 1 firefox version",
32+
"last 1 safari version"
33+
]
34+
}
35+
}

0 commit comments

Comments
 (0)