@storybook/addon-a11y 10.6.0-alpha.0 → 10.6.0-alpha.2
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/dist/chunk-lw2YNZji.d.ts +40 -0
- package/dist/index.d.ts +36 -69
- package/dist/postinstall.js +11 -9
- package/dist/preset.js +6 -6
- package/dist/preview.d.ts +11 -47
- package/package.json +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RunOptions, Selector, SelectorList, Spec } from "axe-core";
|
|
2
|
+
|
|
3
|
+
//#region code/addons/a11y/.dts-emit/code/addons/a11y/src/params.d.ts
|
|
4
|
+
type SelectorWithoutNode = Omit<Selector, 'Node'> | Omit<SelectorList, 'NodeList'>;
|
|
5
|
+
type ContextObjectWithoutNode = {
|
|
6
|
+
include: SelectorWithoutNode;
|
|
7
|
+
exclude?: SelectorWithoutNode;
|
|
8
|
+
} | {
|
|
9
|
+
exclude: SelectorWithoutNode;
|
|
10
|
+
include?: SelectorWithoutNode;
|
|
11
|
+
};
|
|
12
|
+
type ContextSpecWithoutNode = SelectorWithoutNode | ContextObjectWithoutNode;
|
|
13
|
+
type A11yTest = 'off' | 'todo' | 'error';
|
|
14
|
+
interface A11yParameters {
|
|
15
|
+
/**
|
|
16
|
+
* Context parameter for axe-core's run function, except without support for passing Nodes and
|
|
17
|
+
* NodeLists directly.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/context.md
|
|
20
|
+
*/
|
|
21
|
+
context?: ContextSpecWithoutNode;
|
|
22
|
+
/**
|
|
23
|
+
* Options for running axe-core.
|
|
24
|
+
*
|
|
25
|
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
|
26
|
+
*/
|
|
27
|
+
options?: RunOptions;
|
|
28
|
+
/**
|
|
29
|
+
* Configuration object for axe-core.
|
|
30
|
+
*
|
|
31
|
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
|
|
32
|
+
*/
|
|
33
|
+
config?: Spec;
|
|
34
|
+
/** Whether to disable accessibility tests. */
|
|
35
|
+
disable?: boolean;
|
|
36
|
+
/** Defines how accessibility violations should be handled: 'off', 'todo', or 'error'. */
|
|
37
|
+
test?: A11yTest;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { SelectorWithoutNode as i, ContextObjectWithoutNode as n, ContextSpecWithoutNode as r, A11yParameters as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,87 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type SelectorWithoutNode = Omit<Selector, 'Node'> | Omit<SelectorList, 'NodeList'>;
|
|
5
|
-
type ContextObjectWithoutNode = {
|
|
6
|
-
include: SelectorWithoutNode;
|
|
7
|
-
exclude?: SelectorWithoutNode;
|
|
8
|
-
} | {
|
|
9
|
-
exclude: SelectorWithoutNode;
|
|
10
|
-
include?: SelectorWithoutNode;
|
|
11
|
-
};
|
|
12
|
-
type ContextSpecWithoutNode = SelectorWithoutNode | ContextObjectWithoutNode;
|
|
13
|
-
type A11yTest = 'off' | 'todo' | 'error';
|
|
14
|
-
interface A11yParameters$1 {
|
|
15
|
-
/**
|
|
16
|
-
* Context parameter for axe-core's run function, except without support for passing Nodes and
|
|
17
|
-
* NodeLists directly.
|
|
18
|
-
*
|
|
19
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/context.md
|
|
20
|
-
*/
|
|
21
|
-
context?: ContextSpecWithoutNode;
|
|
22
|
-
/**
|
|
23
|
-
* Options for running axe-core.
|
|
24
|
-
*
|
|
25
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
|
26
|
-
*/
|
|
27
|
-
options?: RunOptions;
|
|
28
|
-
/**
|
|
29
|
-
* Configuration object for axe-core.
|
|
30
|
-
*
|
|
31
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
|
|
32
|
-
*/
|
|
33
|
-
config?: Spec;
|
|
34
|
-
/** Whether to disable accessibility tests. */
|
|
35
|
-
disable?: boolean;
|
|
36
|
-
/** Defines how accessibility violations should be handled: 'off', 'todo', or 'error'. */
|
|
37
|
-
test?: A11yTest;
|
|
38
|
-
}
|
|
1
|
+
import { i as SelectorWithoutNode, n as ContextObjectWithoutNode, r as ContextSpecWithoutNode, t as A11yParameters } from "./chunk-lw2YNZji.js";
|
|
2
|
+
import { AxeResults, NodeResult, Result } from "axe-core";
|
|
39
3
|
|
|
4
|
+
//#region code/addons/a11y/.dts-emit/code/addons/a11y/src/types.d.ts
|
|
40
5
|
type A11yReport = EnhancedResults | {
|
|
41
|
-
|
|
6
|
+
error: Error;
|
|
42
7
|
};
|
|
43
|
-
interface A11yParameters {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
8
|
+
interface A11yParameters$1 {
|
|
9
|
+
/**
|
|
10
|
+
* Accessibility configuration
|
|
11
|
+
*
|
|
12
|
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
|
|
13
|
+
*/
|
|
14
|
+
a11y?: A11yParameters;
|
|
50
15
|
}
|
|
51
16
|
interface A11yGlobals {
|
|
17
|
+
/**
|
|
18
|
+
* Accessibility configuration
|
|
19
|
+
*
|
|
20
|
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
|
|
21
|
+
*/
|
|
22
|
+
a11y?: {
|
|
52
23
|
/**
|
|
53
|
-
*
|
|
24
|
+
* Prevent the addon from executing automated accessibility checks upon visiting a story. You
|
|
25
|
+
* can still trigger the checks from the addon panel.
|
|
54
26
|
*
|
|
55
|
-
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
|
|
27
|
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing#disable-automated-checks
|
|
56
28
|
*/
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* Prevent the addon from executing automated accessibility checks upon visiting a story. You
|
|
60
|
-
* can still trigger the checks from the addon panel.
|
|
61
|
-
*
|
|
62
|
-
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing#disable-automated-checks
|
|
63
|
-
*/
|
|
64
|
-
manual?: boolean;
|
|
65
|
-
};
|
|
29
|
+
manual?: boolean;
|
|
30
|
+
};
|
|
66
31
|
}
|
|
67
32
|
type EnhancedNodeResult = NodeResult & {
|
|
68
|
-
|
|
33
|
+
linkPath: string;
|
|
69
34
|
};
|
|
70
35
|
type EnhancedResult = Omit<Result, 'nodes'> & {
|
|
71
|
-
|
|
36
|
+
nodes: EnhancedNodeResult[];
|
|
72
37
|
};
|
|
73
38
|
type EnhancedResults = Omit<AxeResults, 'incomplete' | 'passes' | 'violations'> & {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
39
|
+
incomplete: EnhancedResult[];
|
|
40
|
+
passes: EnhancedResult[];
|
|
41
|
+
violations: EnhancedResult[];
|
|
77
42
|
};
|
|
78
43
|
interface A11yTypes {
|
|
79
|
-
|
|
80
|
-
|
|
44
|
+
parameters: A11yParameters$1;
|
|
45
|
+
globals: A11yGlobals;
|
|
81
46
|
}
|
|
82
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region code/addons/a11y/.dts-emit/code/addons/a11y/src/constants.d.ts
|
|
83
49
|
declare const PARAM_KEY = "a11y";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region code/addons/a11y/.dts-emit/code/addons/a11y/src/index.d.ts
|
|
52
|
+
declare function _default(): import("storybook/internal/csf").PreviewAddon<A11yTypes>;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { type A11yGlobals, A11yParameters, type A11yReport, type A11yTypes, ContextObjectWithoutNode, ContextSpecWithoutNode, PARAM_KEY, SelectorWithoutNode, _default as default };
|
package/dist/postinstall.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_jx76yheow0j from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_jx76yheow0j from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_jx76yheow0j from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_jx76yheow0j.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_jx76yheow0j.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_jx76yheow0j.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,8 +13,10 @@ var require = CJS_COMPAT_NODE_MODULE_f1d01odkq3t.createRequire(import.meta.url);
|
|
|
13
13
|
// src/postinstall.ts
|
|
14
14
|
import { JsPackageManagerFactory, versions } from "storybook/internal/common";
|
|
15
15
|
async function postinstall(options) {
|
|
16
|
-
let args = [
|
|
17
|
-
|
|
16
|
+
let useRemotePkg = options.useRemotePkg ?? !!options.skipInstall, args = [
|
|
17
|
+
// A versioned spec only resolves through the ephemeral runner; the local
|
|
18
|
+
// binary is invoked by bare name.
|
|
19
|
+
useRemotePkg ? `storybook@${versions.storybook}` : "storybook",
|
|
18
20
|
"automigrate",
|
|
19
21
|
"addon-a11y-addon-test"
|
|
20
22
|
];
|
|
@@ -24,7 +26,7 @@ async function postinstall(options) {
|
|
|
24
26
|
}).runPackageCommand({
|
|
25
27
|
args,
|
|
26
28
|
stdio: ["ignore", "pipe", "pipe"],
|
|
27
|
-
useRemotePkg
|
|
29
|
+
useRemotePkg
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
32
|
export {
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_jx76yheow0j from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_jx76yheow0j from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_jx76yheow0j from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_jx76yheow0j.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_jx76yheow0j.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_jx76yheow0j.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
package/dist/preview.d.ts
CHANGED
|
@@ -1,53 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AfterEach } from
|
|
3
|
-
import { Selector, SelectorList, RunOptions, Spec } from 'axe-core';
|
|
1
|
+
import { t as A11yParameters } from "./chunk-lw2YNZji.js";
|
|
2
|
+
import { AfterEach } from "storybook/internal/types";
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
include: SelectorWithoutNode;
|
|
8
|
-
exclude?: SelectorWithoutNode;
|
|
9
|
-
} | {
|
|
10
|
-
exclude: SelectorWithoutNode;
|
|
11
|
-
include?: SelectorWithoutNode;
|
|
12
|
-
};
|
|
13
|
-
type ContextSpecWithoutNode = SelectorWithoutNode | ContextObjectWithoutNode;
|
|
14
|
-
type A11yTest = 'off' | 'todo' | 'error';
|
|
15
|
-
interface A11yParameters {
|
|
16
|
-
/**
|
|
17
|
-
* Context parameter for axe-core's run function, except without support for passing Nodes and
|
|
18
|
-
* NodeLists directly.
|
|
19
|
-
*
|
|
20
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/context.md
|
|
21
|
-
*/
|
|
22
|
-
context?: ContextSpecWithoutNode;
|
|
23
|
-
/**
|
|
24
|
-
* Options for running axe-core.
|
|
25
|
-
*
|
|
26
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
|
27
|
-
*/
|
|
28
|
-
options?: RunOptions;
|
|
29
|
-
/**
|
|
30
|
-
* Configuration object for axe-core.
|
|
31
|
-
*
|
|
32
|
-
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
|
|
33
|
-
*/
|
|
34
|
-
config?: Spec;
|
|
35
|
-
/** Whether to disable accessibility tests. */
|
|
36
|
-
disable?: boolean;
|
|
37
|
-
/** Defines how accessibility violations should be handled: 'off', 'todo', or 'error'. */
|
|
38
|
-
test?: A11yTest;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
declare const decorators: storybook_internal_csf.DecoratorFunction[];
|
|
4
|
+
//#region code/addons/a11y/.dts-emit/code/addons/a11y/src/preview.d.ts
|
|
5
|
+
declare const decorators: import("storybook/internal/types").DecoratorFunction[];
|
|
42
6
|
declare const afterEach: AfterEach<any>;
|
|
43
7
|
declare const initialGlobals: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
8
|
+
a11y: {
|
|
9
|
+
manual: boolean;
|
|
10
|
+
};
|
|
11
|
+
vision: undefined;
|
|
48
12
|
};
|
|
49
13
|
declare const parameters: {
|
|
50
|
-
|
|
14
|
+
a11y: A11yParameters;
|
|
51
15
|
};
|
|
52
|
-
|
|
53
|
-
export { afterEach, decorators, initialGlobals, parameters };
|
|
16
|
+
//#endregion
|
|
17
|
+
export { afterEach, decorators, initialGlobals, parameters };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-a11y",
|
|
3
|
-
"version": "10.6.0-alpha.
|
|
3
|
+
"version": "10.6.0-alpha.2",
|
|
4
4
|
"description": "Storybook Addon A11y: Test UI component compliance with WCAG web accessibility standards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"react": "^18.2.0",
|
|
70
70
|
"react-dom": "^18.2.0",
|
|
71
71
|
"react-resize-detector": "^7.1.2",
|
|
72
|
-
"typescript": "^
|
|
72
|
+
"typescript": "^6.0.3",
|
|
73
73
|
"vitest-axe": "^0.1.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"storybook": "^10.6.0-alpha.
|
|
76
|
+
"storybook": "^10.6.0-alpha.2"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|