@accesslint/storybook-addon 0.8.11 → 0.8.12
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/README.md +7 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/@accesslint/storybook-addon)
|
|
2
|
-
[](https://github.com/AccessLint/accesslint/blob/main/
|
|
2
|
+
[](https://github.com/AccessLint/accesslint/blob/main/storybook-addon/LICENSE)
|
|
3
3
|
|
|
4
4
|
# @accesslint/storybook-addon
|
|
5
5
|
|
|
@@ -13,6 +13,8 @@ Catch accessibility violations in your Storybook stories as you develop. Powered
|
|
|
13
13
|
npm install @accesslint/storybook-addon
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
`storybook` 9+ and `vitest` 3+ are required as peer dependencies.
|
|
17
|
+
|
|
16
18
|
Add the addon to your `.storybook/main.ts` (or `.storybook/main.js`):
|
|
17
19
|
|
|
18
20
|
```ts
|
|
@@ -103,7 +105,7 @@ test("LoginForm is accessible", () => {
|
|
|
103
105
|
|
|
104
106
|
```ts
|
|
105
107
|
await expect(canvasElement).toBeAccessible({
|
|
106
|
-
disabledRules: ["
|
|
108
|
+
disabledRules: ["landmarks/region"],
|
|
107
109
|
});
|
|
108
110
|
```
|
|
109
111
|
|
|
@@ -114,10 +116,10 @@ When the assertion fails, the error message lists each violation with its rule I
|
|
|
114
116
|
```
|
|
115
117
|
Expected element to have no accessibility violations, but found 2:
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
text-alternatives/img-alt [A] (1.1.1): Image is missing alt text
|
|
118
120
|
img[src="hero.png"]
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
labels-and-names/form-label [A] (1.3.1): Form input is missing a label
|
|
121
123
|
input[type="email"]
|
|
122
124
|
```
|
|
123
125
|
|
|
@@ -183,7 +185,7 @@ Extend the addon's audit options from your preview file:
|
|
|
183
185
|
import { setAuditOptions } from "@accesslint/storybook-addon/preview";
|
|
184
186
|
|
|
185
187
|
setAuditOptions({
|
|
186
|
-
disabledRules: ["
|
|
188
|
+
disabledRules: ["landmarks/region"], // e.g. disable landmark region rule
|
|
187
189
|
});
|
|
188
190
|
```
|
|
189
191
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accesslint/storybook-addon",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.12",
|
|
4
4
|
"description": "Catch accessibility violations in your Storybook stories as you develop",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
123
|
"@accesslint/core": "0.9.0",
|
|
124
|
-
"@accesslint/vitest": "0.3.
|
|
124
|
+
"@accesslint/vitest": "0.3.1"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@types/react": "^19.2.14",
|