@techsio/storybook-better-a11y 0.0.5 → 0.0.7

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.
@@ -18,4 +18,4 @@ async function postinstall(options) {
18
18
  args
19
19
  });
20
20
  }
21
- export { postinstall as default };
21
+ export default postinstall;
package/dist/preview.js CHANGED
@@ -1,68 +1 @@
1
- import { expect } from "storybook/test";
2
- import { run } from "./a11yRunner.js";
3
- import { getIsVitestStandaloneRun } from "./utils.js";
4
- import { withVisionSimulator } from "./withVisionSimulator.js";
5
- let vitestMatchersExtended = false;
6
- const decorators = [
7
- withVisionSimulator
8
- ];
9
- const afterEach = async ({ id: storyId, reporting, parameters, globals, viewMode })=>{
10
- const a11yParameter = parameters.a11y;
11
- const a11yGlobals = globals.a11y;
12
- const shouldRunEnvironmentIndependent = a11yParameter?.disable !== true && a11yParameter?.test !== 'off' && a11yGlobals?.manual !== true;
13
- const getMode = ()=>{
14
- switch(a11yParameter?.test){
15
- case 'todo':
16
- return 'warning';
17
- case 'error':
18
- default:
19
- return 'failed';
20
- }
21
- };
22
- if (shouldRunEnvironmentIndependent && 'story' === viewMode) try {
23
- const result = await run(a11yParameter, storyId);
24
- if (result) {
25
- const hasViolations = (result?.violations.length ?? 0) > 0;
26
- reporting.addReport({
27
- type: 'a11y',
28
- version: 1,
29
- result,
30
- status: hasViolations ? getMode() : 'passed'
31
- });
32
- if (getIsVitestStandaloneRun()) {
33
- if (hasViolations && 'failed' === getMode()) {
34
- if (!vitestMatchersExtended) {
35
- const { toHaveNoViolations } = await import("vitest-axe/matchers");
36
- expect.extend({
37
- toHaveNoViolations
38
- });
39
- vitestMatchersExtended = true;
40
- }
41
- expect(result).toHaveNoViolations();
42
- }
43
- }
44
- }
45
- } catch (e) {
46
- reporting.addReport({
47
- type: 'a11y',
48
- version: 1,
49
- result: {
50
- error: e
51
- },
52
- status: 'failed'
53
- });
54
- if (getIsVitestStandaloneRun()) throw e;
55
- }
56
- };
57
- const initialGlobals = {
58
- a11y: {
59
- manual: false
60
- },
61
- vision: void 0
62
- };
63
- const preview_parameters = {
64
- a11y: {
65
- test: 'todo'
66
- }
67
- };
68
- export { afterEach, decorators, initialGlobals, preview_parameters as parameters };
1
+ export { afterEach, decorators, initialGlobals, parameters } from "./699.js";
@@ -0,0 +1,37 @@
1
+ var __webpack_module_cache__ = {};
2
+ function __webpack_require__(moduleId) {
3
+ var cachedModule = __webpack_module_cache__[moduleId];
4
+ if (void 0 !== cachedModule) return cachedModule.exports;
5
+ var module = __webpack_module_cache__[moduleId] = {
6
+ exports: {}
7
+ };
8
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
9
+ return module.exports;
10
+ }
11
+ (()=>{
12
+ __webpack_require__.add = function(modules) {
13
+ Object.assign(__webpack_require__.m, modules);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.d = (exports, definition)=>{
18
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
19
+ enumerable: true,
20
+ get: definition[key]
21
+ });
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.r = (exports)=>{
29
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
30
+ value: 'Module'
31
+ });
32
+ Object.defineProperty(exports, '__esModule', {
33
+ value: true
34
+ });
35
+ };
36
+ })();
37
+ export { __webpack_require__ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techsio/storybook-better-a11y",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Storybook Accessibility addon with APCA (WCAG 3) support",
5
5
  "keywords": [
6
6
  "storybook",