Skip to content
1 change: 1 addition & 0 deletions webview/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
staticDirs: ['../../extension/src/test/fixtures/plotsDiff/staticImages'],
addons: [
'storybook-addon-themes',
'storybook-addon-designs',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
Expand Down
21 changes: 20 additions & 1 deletion webview/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ declare global {
}
}

window.webviewData = { theme: 'dark' }
window.acquireVsCodeApi = () =>
({
postMessage: action('postMessage'),
Expand All @@ -22,5 +21,25 @@ export const parameters = {
viewport: {
viewports,
defaultViewport: 'default'
},
themes: {
default: 'Default Dark',
list: [
{ name: 'Default Dark', class: 'vscode-dark', color: '#222' },
{ name: 'Default Light', class: 'vscode-light', color: '#EEE' },
{ name: 'Red', class: 'vscode-red', color: '#F22' },
{ name: 'Dive Bar', class: 'vscode-divebar', color: '#E2E' },
{ name: 'One Dark Pro', class: 'vscode-onedarkpro', color: '#333' },
{
name: 'High Contrast Light',
class: 'vscode-high-contrast-light',
color: '#FFF'
},
{
name: 'High Contrast Dark',
class: 'vscode-high-contrast-dark',
color: '#000'
}
]
}
}
6 changes: 4 additions & 2 deletions webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.2",
"@storybook/testing-library": "^0.0.13",
"@tippyjs/react": "^4.2.6",
"@vscode/webview-ui-toolkit": "^1.0.0",
"classnames": "^2.2.6",
Expand All @@ -39,13 +38,15 @@
"vega-lite": "^5.2.0"
},
"devDependencies": {
"@storybook/testing-library": "^0.0.13",
"@storybook/addon-essentials": "6.5.9",
"@storybook/addon-interactions": "6.5.9",
"@storybook/addons": "6.5.9",
"@storybook/builder-webpack5": "6.5.9",
"@storybook/manager-webpack5": "6.5.9",
"@storybook/preset-scss": "1.0.3",
"@storybook/react": "6.5.9",
"@storybook/testing-library": "0.0.13",
"@svgr/cli": "6.2.1",
"@testing-library/jest-dom": "5.16.4",
"@testing-library/react": "13.3.0",
Expand Down Expand Up @@ -73,7 +74,8 @@
"raw-loader": "4.0.2",
"sass": "1.53.0",
"sass-loader": "13.0.2",
"storybook-addon-designs": "6.3.1",
"storybook-addon-designs": "^6.3.1",
"storybook-addon-themes": "^6.1.0",
"style-loader": "3.3.1",
"ts-jest": "28.0.5",
"ts-loader": "9.3.1",
Expand Down
Loading