@storybook/addon-a11y 5.3.13 → 5.3.14
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/package.json +19 -11
- package/ts3.5/dist/components/A11YPanel.d.ts +34 -0
- package/ts3.5/dist/components/ColorBlindness.d.ts +9 -0
- package/ts3.5/dist/components/Report/Elements.d.ts +9 -0
- package/ts3.5/dist/components/Report/HighlightToggle.d.ts +28 -0
- package/ts3.5/dist/components/Report/Info.d.ts +7 -0
- package/ts3.5/dist/components/Report/Item.d.ts +8 -0
- package/ts3.5/dist/components/Report/Rules.d.ts +13 -0
- package/ts3.5/dist/components/Report/Tags.d.ts +7 -0
- package/ts3.5/dist/components/Report/index.d.ts +9 -0
- package/ts3.5/dist/components/Tabs.d.ts +20 -0
- package/ts3.5/dist/constants.d.ts +11 -0
- package/ts3.5/dist/index.d.ts +4 -0
- package/ts3.5/dist/redux-config.d.ts +18 -0
- package/ts3.5/dist/register.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-a11y",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.14",
|
|
4
4
|
"description": "a11y addon for storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -20,24 +20,25 @@
|
|
|
20
20
|
"directory": "addons/a11y"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
|
+
"main": "dist/index.js",
|
|
24
|
+
"types": "dist/index.d.ts",
|
|
23
25
|
"files": [
|
|
24
26
|
"dist/**/*",
|
|
25
27
|
"README.md",
|
|
26
28
|
"*.js",
|
|
27
|
-
"*.d.ts"
|
|
29
|
+
"*.d.ts",
|
|
30
|
+
"ts3.5/**/*"
|
|
28
31
|
],
|
|
29
|
-
"main": "dist/index.js",
|
|
30
|
-
"types": "dist/index.d.ts",
|
|
31
32
|
"scripts": {
|
|
32
33
|
"prepare": "node ../../scripts/prepare.js"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@storybook/addons": "5.3.
|
|
36
|
-
"@storybook/api": "5.3.
|
|
37
|
-
"@storybook/client-logger": "5.3.
|
|
38
|
-
"@storybook/components": "5.3.
|
|
39
|
-
"@storybook/core-events": "5.3.
|
|
40
|
-
"@storybook/theming": "5.3.
|
|
36
|
+
"@storybook/addons": "5.3.14",
|
|
37
|
+
"@storybook/api": "5.3.14",
|
|
38
|
+
"@storybook/client-logger": "5.3.14",
|
|
39
|
+
"@storybook/components": "5.3.14",
|
|
40
|
+
"@storybook/core-events": "5.3.14",
|
|
41
|
+
"@storybook/theming": "5.3.14",
|
|
41
42
|
"axe-core": "^3.3.2",
|
|
42
43
|
"core-js": "^3.0.1",
|
|
43
44
|
"global": "^4.3.2",
|
|
@@ -56,5 +57,12 @@
|
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"access": "public"
|
|
58
59
|
},
|
|
59
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "91d9c0c4e0afd7e494b23ec8076b21e45b7a8906",
|
|
61
|
+
"typesVersions": {
|
|
62
|
+
"<=3.5": {
|
|
63
|
+
"*": [
|
|
64
|
+
"ts3.5/*"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
60
68
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { AxeResults, Result } from 'axe-core';
|
|
3
|
+
import { API } from '@storybook/api';
|
|
4
|
+
export declare enum RuleType {
|
|
5
|
+
VIOLATION = 0,
|
|
6
|
+
PASS = 1,
|
|
7
|
+
INCOMPLETION = 2
|
|
8
|
+
}
|
|
9
|
+
interface A11YPanelNormalState {
|
|
10
|
+
status: 'ready' | 'ran' | 'running';
|
|
11
|
+
passes: Result[];
|
|
12
|
+
violations: Result[];
|
|
13
|
+
incomplete: Result[];
|
|
14
|
+
}
|
|
15
|
+
interface A11YPanelErrorState {
|
|
16
|
+
status: 'error';
|
|
17
|
+
error: unknown;
|
|
18
|
+
}
|
|
19
|
+
declare type A11YPanelState = A11YPanelNormalState | A11YPanelErrorState;
|
|
20
|
+
interface A11YPanelProps {
|
|
21
|
+
active: boolean;
|
|
22
|
+
api: API;
|
|
23
|
+
}
|
|
24
|
+
export declare class A11YPanel extends Component<A11YPanelProps, A11YPanelState> {
|
|
25
|
+
state: A11YPanelState;
|
|
26
|
+
componentDidMount(): void;
|
|
27
|
+
componentDidUpdate(prevProps: A11YPanelProps): void;
|
|
28
|
+
componentWillUnmount(): void;
|
|
29
|
+
onUpdate: ({ passes, violations, incomplete }: AxeResults) => void;
|
|
30
|
+
onError: (error: unknown) => void;
|
|
31
|
+
request: () => void;
|
|
32
|
+
render(): JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { NodeResult } from 'axe-core';
|
|
3
|
+
import { RuleType } from '../A11YPanel';
|
|
4
|
+
interface ElementsProps {
|
|
5
|
+
elements: NodeResult[];
|
|
6
|
+
type: RuleType;
|
|
7
|
+
}
|
|
8
|
+
export declare const Elements: FunctionComponent<ElementsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { NodeResult } from 'axe-core';
|
|
3
|
+
import { RuleType } from '../A11YPanel';
|
|
4
|
+
export declare class HighlightedElementData {
|
|
5
|
+
originalOutline: string;
|
|
6
|
+
isHighlighted: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ToggleProps {
|
|
9
|
+
elementsToHighlight: NodeResult[];
|
|
10
|
+
type: RuleType;
|
|
11
|
+
addElement?: (data: any) => void;
|
|
12
|
+
highlightedElementsMap?: Map<HTMLElement, HighlightedElementData>;
|
|
13
|
+
isToggledOn?: boolean;
|
|
14
|
+
toggleId?: string;
|
|
15
|
+
indeterminate?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare class HighlightToggle extends Component<ToggleProps> {
|
|
18
|
+
static defaultProps: Partial<ToggleProps>;
|
|
19
|
+
private checkBoxRef;
|
|
20
|
+
componentDidMount(): void;
|
|
21
|
+
componentDidUpdate(prevProps: Readonly<ToggleProps>): void;
|
|
22
|
+
onToggle: () => void;
|
|
23
|
+
highlightRuleLocation(targetElement: HTMLElement, addHighlight: boolean): void;
|
|
24
|
+
saveElementDataToMap(targetElement: HTMLElement, isHighlighted: boolean, originalOutline: string): void;
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof HighlightToggle, any>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { CheckResult } from 'axe-core';
|
|
3
|
+
export declare enum ImpactValue {
|
|
4
|
+
MINOR = "minor",
|
|
5
|
+
MODERATE = "moderate",
|
|
6
|
+
SERIOUS = "serious",
|
|
7
|
+
CRITICAL = "critical"
|
|
8
|
+
}
|
|
9
|
+
interface RulesProps {
|
|
10
|
+
rules: CheckResult[];
|
|
11
|
+
}
|
|
12
|
+
export declare const Rules: FunctionComponent<RulesProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { Result } from 'axe-core';
|
|
3
|
+
import { RuleType } from '../A11YPanel';
|
|
4
|
+
export interface ReportProps {
|
|
5
|
+
items: Result[];
|
|
6
|
+
empty: string;
|
|
7
|
+
type: RuleType;
|
|
8
|
+
}
|
|
9
|
+
export declare const Report: FunctionComponent<ReportProps>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { Result } from 'axe-core';
|
|
3
|
+
import { RuleType } from './A11YPanel';
|
|
4
|
+
interface TabsProps {
|
|
5
|
+
tabs: {
|
|
6
|
+
label: JSX.Element;
|
|
7
|
+
panel: JSX.Element;
|
|
8
|
+
items: Result[];
|
|
9
|
+
type: RuleType;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
interface TabsState {
|
|
13
|
+
active: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class Tabs extends Component<TabsProps, TabsState> {
|
|
16
|
+
state: TabsState;
|
|
17
|
+
onToggle: (event: React.SyntheticEvent<Element, Event>) => void;
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const ADDON_ID = "storybook/a11y";
|
|
2
|
+
export declare const PANEL_ID: string;
|
|
3
|
+
export declare const PARAM_KEY = "a11y";
|
|
4
|
+
export declare const IFRAME = "iframe";
|
|
5
|
+
export declare const ADD_ELEMENT = "ADD_ELEMENT";
|
|
6
|
+
export declare const CLEAR_ELEMENTS = "CLEAR_ELEMENTS";
|
|
7
|
+
export declare const EVENTS: {
|
|
8
|
+
RESULT: string;
|
|
9
|
+
REQUEST: string;
|
|
10
|
+
ERROR: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HighlightedElementData } from './components/Report/HighlightToggle';
|
|
2
|
+
export declare function addElement(payload: {
|
|
3
|
+
element: HTMLElement;
|
|
4
|
+
data: HighlightedElementData;
|
|
5
|
+
}): {
|
|
6
|
+
type: string;
|
|
7
|
+
payload: {
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
data: HighlightedElementData;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare function clearElements(): {
|
|
13
|
+
type: string;
|
|
14
|
+
};
|
|
15
|
+
declare const store: import("redux").Store<{
|
|
16
|
+
highlightedElementsMap: Map<any, any>;
|
|
17
|
+
}, any>;
|
|
18
|
+
export default store;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|