Skip to content

Commit

Permalink
chore(devui): upgrade storybook (#626)
Browse files Browse the repository at this point in the history
* stash

* stash

* stash

* fix

* stash

* fix css

* stash

* stash

* stash

* Fix tests
  • Loading branch information
Methuselah96 committed Sep 2, 2020
1 parent c7b0c7a commit cd4f022
Show file tree
Hide file tree
Showing 51 changed files with 3,400 additions and 2,478 deletions.
12 changes: 0 additions & 12 deletions packages/devui/.scripts/get_gh_pages_url.js

This file was deleted.

16 changes: 0 additions & 16 deletions packages/devui/.scripts/prepublish.sh

This file was deleted.

47 changes: 0 additions & 47 deletions packages/devui/.scripts/publish_storybook.sh

This file was deleted.

1 change: 0 additions & 1 deletion packages/devui/.scripts/user/prepublish.sh

This file was deleted.

1 change: 0 additions & 1 deletion packages/devui/.scripts/user/pretest.js

This file was deleted.

4 changes: 0 additions & 4 deletions packages/devui/.storybook/addons.js

This file was deleted.

30 changes: 0 additions & 30 deletions packages/devui/.storybook/config.js

This file was deleted.

11 changes: 11 additions & 0 deletions packages/devui/.storybook/main.js
@@ -0,0 +1,11 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
},
],
};
28 changes: 0 additions & 28 deletions packages/devui/.storybook/preview-head.html

This file was deleted.

48 changes: 48 additions & 0 deletions packages/devui/.storybook/preview.js
@@ -0,0 +1,48 @@
import React from 'react';
import { Container } from '../src';
import { listSchemes, listThemes } from '../src/utils/theme';
import '../src/presets.js';

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
};

export const globalTypes = {
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'default',
toolbar: {
items: listThemes(),
},
},
scheme: {
name: 'Color Scheme',
description: 'Global color scheme for components',
defaultValue: 'default',
toolbar: {
items: listSchemes(),
},
},
color: {
name: 'Color',
description: 'Global color for components',
defaultValue: 'light',
toolbar: {
items: ['light', 'dark'],
},
},
};

const withThemeProvider = (Story, context) => (
<Container
themeData={{
theme: context.globals.theme,
scheme: context.globals.scheme,
light: context.globals.color === 'light',
}}
>
<Story {...context} />
</Container>
);
export const decorators = [withThemeProvider];
60 changes: 0 additions & 60 deletions packages/devui/.storybook/themeAddon/Panel.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/devui/.storybook/themeAddon/constant.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/devui/.storybook/themeAddon/register.js

This file was deleted.

28 changes: 0 additions & 28 deletions packages/devui/.storybook/themeAddon/theme.js

This file was deleted.

8 changes: 0 additions & 8 deletions packages/devui/.storybook/webpack.config.js

This file was deleted.

13 changes: 5 additions & 8 deletions packages/devui/package.json
Expand Up @@ -18,8 +18,8 @@
"lint:css": "stylelint \"./src/**/*.js\"",
"test:update": "npm run jest -- -u",
"test": "jest --no-cache",
"storybook": "start-storybook -p 9001 -c .storybook -s ./fonts",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 6006 -s ./fonts",
"build-storybook": "build-storybook -s ./fonts",
"prepare": "npm run build",
"prepublishOnly": "npm run test && npm run build"
},
Expand All @@ -36,20 +36,17 @@
"@babel/plugin-transform-runtime": "^7.11.0",
"@babel/preset-env": "^7.11.0",
"@babel/preset-react": "^7.10.4",
"@storybook/addon-actions": "^4.1.18",
"@storybook/addon-info": "^4.1.18",
"@storybook/addon-knobs": "^4.1.18",
"@storybook/addon-options": "^4.1.18",
"@storybook/react": "4.1.18",
"@storybook/addon-essentials": "^6.0.21",
"@storybook/react": "^6.0.21",
"babel-loader": "^8.1.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.3",
"enzyme-to-json": "^3.5.0",
"git-url-parse": "^11.1.2",
"jest": "^26.2.2",
"jsdom": "^16.4.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-is": "^16.13.1",
"react-test-renderer": "^16.13.1",
"rimraf": "^3.0.2",
"stylelint": "^13.6.1",
Expand Down

0 comments on commit cd4f022

Please sign in to comment.