@accesslint/storybook-addon 0.8.11 → 0.8.13
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/portable.cjs +1 -1
- package/dist/portable.js +1 -1
- package/dist/{preview-B8cvp9pY.cjs → preview-CaOVR1-l.cjs} +1 -1
- package/dist/{preview-B3suakeJ.js → preview-dJjvcmhI.js} +1 -1
- package/dist/preview.cjs +1 -1
- package/dist/preview.js +1 -1
- package/dist/vitest-setup.cjs +1 -1
- package/dist/vitest-setup.js +1 -1
- package/package.json +3 -3
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/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_preview = require("./preview-
|
|
1
|
+
const require_preview = require("./preview-CaOVR1-l.cjs");
|
|
2
2
|
let storybook_internal_csf = require("storybook/internal/csf");
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
var src_default = () => (0, storybook_internal_csf.definePreviewAddon)(require_preview.preview_exports);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as preview_exports } from "./preview-
|
|
1
|
+
import { i as preview_exports } from "./preview-dJjvcmhI.js";
|
|
2
2
|
import { definePreviewAddon } from "storybook/internal/csf";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
var src_default = () => definePreviewAddon(preview_exports);
|
package/dist/portable.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
27
27
|
});
|
|
28
28
|
const initialGlobals = { accesslint: {} };
|
|
29
29
|
const parameters = { accesslint: {} };
|
|
30
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
30
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
31
31
|
/**
|
|
32
32
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
33
33
|
* componentMode, locale) into the options used for every Storybook audit.
|
package/dist/portable.js
CHANGED
|
@@ -15,7 +15,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
15
15
|
});
|
|
16
16
|
const initialGlobals = { accesslint: {} };
|
|
17
17
|
const parameters = { accesslint: {} };
|
|
18
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
18
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
19
19
|
/**
|
|
20
20
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
21
21
|
* componentMode, locale) into the options used for every Storybook audit.
|
|
@@ -26,7 +26,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
26
26
|
});
|
|
27
27
|
const initialGlobals = { accesslint: {} };
|
|
28
28
|
const parameters = { accesslint: {} };
|
|
29
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
29
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
30
30
|
/**
|
|
31
31
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
32
32
|
* componentMode, locale) into the options used for every Storybook audit.
|
|
@@ -25,7 +25,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
25
25
|
});
|
|
26
26
|
const initialGlobals = { accesslint: {} };
|
|
27
27
|
const parameters = { accesslint: {} };
|
|
28
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
28
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
29
29
|
/**
|
|
30
30
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
31
31
|
* componentMode, locale) into the options used for every Storybook audit.
|
package/dist/preview.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_preview = require("./preview-
|
|
2
|
+
const require_preview = require("./preview-CaOVR1-l.cjs");
|
|
3
3
|
exports.afterEach = require_preview.afterEach;
|
|
4
4
|
exports.initialGlobals = require_preview.initialGlobals;
|
|
5
5
|
exports.parameters = require_preview.parameters;
|
package/dist/preview.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as setAuditOptions, n as initialGlobals, r as parameters, t as afterEach } from "./preview-
|
|
1
|
+
import { a as setAuditOptions, n as initialGlobals, r as parameters, t as afterEach } from "./preview-dJjvcmhI.js";
|
|
2
2
|
export { afterEach, initialGlobals, parameters, setAuditOptions };
|
package/dist/vitest-setup.cjs
CHANGED
|
@@ -29,7 +29,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
29
29
|
});
|
|
30
30
|
const initialGlobals = { accesslint: {} };
|
|
31
31
|
const parameters = { accesslint: {} };
|
|
32
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
32
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
33
33
|
/**
|
|
34
34
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
35
35
|
* componentMode, locale) into the options used for every Storybook audit.
|
package/dist/vitest-setup.js
CHANGED
|
@@ -28,7 +28,7 @@ var preview_exports = /* @__PURE__ */ __exportAll({
|
|
|
28
28
|
});
|
|
29
29
|
const initialGlobals = { accesslint: {} };
|
|
30
30
|
const parameters = { accesslint: {} };
|
|
31
|
-
let AUDIT_OPTIONS = { disabledRules: ["
|
|
31
|
+
let AUDIT_OPTIONS = { disabledRules: ["landmarks/region"] };
|
|
32
32
|
/**
|
|
33
33
|
* Merge additional audit options (disabledRules, additionalRules, includeAAA,
|
|
34
34
|
* componentMode, locale) into the options used for every Storybook audit.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accesslint/storybook-addon",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
4
4
|
"description": "Catch accessibility violations in your Storybook stories as you develop",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
"prepublishOnly": "bun run build"
|
|
121
121
|
},
|
|
122
122
|
"dependencies": {
|
|
123
|
-
"@accesslint/core": "0.
|
|
124
|
-
"@accesslint/vitest": "0.3.
|
|
123
|
+
"@accesslint/core": "0.16.0",
|
|
124
|
+
"@accesslint/vitest": "0.3.1"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@types/react": "^19.2.14",
|