UNPKG

1.1 kBJavaScriptView Raw
1import React from 'react';
2import { addons, types } from '@storybook/addons';
3import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants';
4import { VisionSimulator } from './components/VisionSimulator';
5import { A11YPanel } from './components/A11YPanel';
6import { A11yContextProvider } from './components/A11yContext';
7addons.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 /*#__PURE__*/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 /*#__PURE__*/React.createElement(A11yContextProvider, {
27 key: key,
28 active: active
29 }, /*#__PURE__*/React.createElement(A11YPanel, null));
30 },
31 paramKey: PARAM_KEY
32 });
33});
\No newline at end of file