-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1497 from github/koesie10/storybook
Setup Storybook for testing UI components
- Loading branch information
Showing
28 changed files
with
58,628 additions
and
10,582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Storybook requires this option to be set. See https://github.com/storybookjs/storybook/issues/18298 | ||
legacy-peer-deps=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { StorybookConfig } from '@storybook/core-common'; | ||
|
||
const config: StorybookConfig = { | ||
stories: [ | ||
'../src/**/*.stories.mdx', | ||
'../src/**/*.stories.@(js|jsx|ts|tsx)' | ||
], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions' | ||
], | ||
framework: '@storybook/react', | ||
core: { | ||
builder: '@storybook/builder-webpack5' | ||
} | ||
}; | ||
|
||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { addons } from '@storybook/addons'; | ||
import { themes } from '@storybook/theming'; | ||
|
||
addons.setConfig({ | ||
theme: themes.dark, | ||
enableShortcuts: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { themes } from '@storybook/theming'; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
// Allow all stories/components to use Codicons | ||
import '@vscode/codicons/dist/codicon.css'; | ||
|
||
import '../src/stories/vscode-theme.css'; | ||
|
||
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering | ||
export const parameters = { | ||
// All props starting with `on` will automatically receive an action as a prop | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
// All props matching these names will automatically get the correct control | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
// Use a dark theme to be aligned with VSCode | ||
docs: { | ||
theme: themes.dark, | ||
}, | ||
backgrounds: { | ||
default: 'dark', | ||
values: [ | ||
{ | ||
name: 'dark', | ||
value: '#1e1e1e', | ||
}, | ||
], | ||
} | ||
}; | ||
|
||
(window as any).acquireVsCodeApi = () => ({ | ||
postMessage: action('post-vscode-message') | ||
}); |
Oops, something went wrong.