1 | import React from 'react';
|
2 | import { addons, types } from '@storybook/addons';
|
3 | import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
|
4 | import { VisionSimulator } from './components/VisionSimulator';
|
5 | import { A11YPanel } from './components/A11YPanel';
|
6 | import { A11yContextProvider } from './components/A11yContext';
|
7 | addons.register(ADDON_ID, function () {
|
8 | addons.add(PANEL_ID, {
|
9 | title: '',
|
10 | type: types.TOOL,
|
11 | match: function match(_ref) {
|
12 | var viewMode = _ref.viewMode;
|
13 | return viewMode === 'story';
|
14 | },
|
15 | render: function render() {
|
16 | return React.createElement(VisionSimulator, null);
|
17 | }
|
18 | });
|
19 | addons.add(PANEL_ID, {
|
20 | title: 'Accessibility',
|
21 | type: types.PANEL,
|
22 | render: function render(_ref2) {
|
23 | var _ref2$active = _ref2.active,
|
24 | active = _ref2$active === void 0 ? true : _ref2$active,
|
25 | key = _ref2.key;
|
26 | return React.createElement(A11yContextProvider, {
|
27 | key: key,
|
28 | active: active
|
29 | }, React.createElement(A11YPanel, null));
|
30 | },
|
31 | paramKey: PARAM_KEY
|
32 | });
|
33 | }); |
\ | No newline at end of file |