|
| 1 | +import { Preview } from "@storybook/react"; |
1 | 2 | import { themes } from "@storybook/theming"; |
2 | 3 | import { action } from "@storybook/addon-actions"; |
3 | 4 |
|
4 | 5 | // Allow all stories/components to use Codicons |
5 | 6 | import "@vscode/codicons/dist/codicon.css"; |
6 | 7 |
|
| 8 | +(window as any).acquireVsCodeApi = () => ({ |
| 9 | + postMessage: action("post-vscode-message"), |
| 10 | + setState: action("set-vscode-state"), |
| 11 | +}); |
| 12 | + |
7 | 13 | // https://storybook.js.org/docs/react/configure/overview#configure-story-rendering |
8 | | -export const parameters = { |
9 | | - // All props starting with `on` will automatically receive an action as a prop |
10 | | - actions: { argTypesRegex: "^on[A-Z].*" }, |
11 | | - // All props matching these names will automatically get the correct control |
12 | | - controls: { |
13 | | - matchers: { |
14 | | - color: /(background|color)$/i, |
15 | | - date: /Date$/, |
| 14 | +const preview: Preview = { |
| 15 | + parameters: { |
| 16 | + // All props starting with `on` will automatically receive an action as a prop |
| 17 | + actions: { argTypesRegex: "^on[A-Z].*" }, |
| 18 | + // All props matching these names will automatically get the correct control |
| 19 | + controls: { |
| 20 | + matchers: { |
| 21 | + color: /(background|color)$/i, |
| 22 | + date: /Date$/, |
| 23 | + }, |
| 24 | + }, |
| 25 | + // Use a dark theme to be aligned with VSCode |
| 26 | + docs: { |
| 27 | + theme: themes.dark, |
| 28 | + }, |
| 29 | + backgrounds: { |
| 30 | + // The background is injected by our theme CSS files |
| 31 | + disable: true, |
16 | 32 | }, |
17 | | - }, |
18 | | - // Use a dark theme to be aligned with VSCode |
19 | | - docs: { |
20 | | - theme: themes.dark, |
21 | | - }, |
22 | | - backgrounds: { |
23 | | - // The background is injected by our theme CSS files |
24 | | - disable: true, |
25 | 33 | }, |
26 | 34 | }; |
27 | 35 |
|
28 | | -(window as any).acquireVsCodeApi = () => ({ |
29 | | - postMessage: action("post-vscode-message"), |
30 | | - setState: action("set-vscode-state"), |
31 | | -}); |
| 36 | +export default preview; |
0 commit comments