Skip to content

Commit 4f27109

Browse files
author
Claudéric Demers
authored
chore: Update to @storybook/react 5 (#506)
1 parent 8c6fcc3 commit 4f27109

File tree

8 files changed

+1886
-1171
lines changed

8 files changed

+1886
-1171
lines changed

.storybook/addons.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

.storybook/config.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
import {addDecorator, configure} from '@storybook/react';
2-
import {withOptions} from '@storybook/addon-options';
1+
import {addParameters, configure} from '@storybook/react';
2+
import theme from './theme';
33

4-
addDecorator(
5-
withOptions({
6-
name: 'React Sortable HOC',
7-
url: 'https://github.com/clauderic/react-sortable-hoc',
4+
addParameters({
5+
options: {
86
showAddonPanel: false,
9-
})
10-
);
7+
theme,
8+
},
9+
});
1110

1211
function loadStories() {
1312
require('../src/.stories/index.js');

.storybook/manager-head.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<link
2+
href="https://fonts.googleapis.com/css?family=Roboto:400,500,700"
3+
rel="stylesheet"
4+
/>

.storybook/theme.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import {create} from '@storybook/theming';
2+
3+
export default create({
4+
base: 'light',
5+
6+
colorSecondary: '#9276ff',
7+
8+
// UI
9+
appBg: 'white',
10+
appContentBg: '#f9f9f9',
11+
appBorderColor: 'grey',
12+
appBorderRadius: 4,
13+
14+
// Typography
15+
fontBase: '"Roboto", Helvetica Neue, Helvetica, Arial, sans-serif',
16+
fontCode: 'monospace',
17+
18+
// Text colors
19+
textColor: '#364149',
20+
textInverseColor: 'rgba(255,255,255,0.9)',
21+
22+
// Toolbar default and active colors
23+
barTextColor: '#FFF',
24+
barSelectedColor: '#FFF',
25+
barBg: '#9276ff',
26+
27+
// Form colors
28+
inputBg: 'white',
29+
inputBorder: '#efefef',
30+
inputTextColor: '#364149',
31+
inputBorderRadius: 0,
32+
33+
brandTitle: 'React Sortable HOC',
34+
brandUrl: 'https://github.com/clauderic/react-sortable-hoc',
35+
brandImage:
36+
'https://d12c9k59mfk1gc.cloudfront.net/items/1T3k3f1s0v3K283t2W1s/react-sortable-hoc.svg',
37+
});

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363
"@babel/plugin-transform-runtime": "^7.2.0",
6464
"@babel/preset-env": "^7.2.3",
6565
"@babel/preset-react": "^7.0.0",
66-
"@storybook/addon-options": "^4.1.4",
67-
"@storybook/react": "^4.1.4",
66+
"@storybook/addon-options": "^5.0.1",
67+
"@storybook/react": "^5.0.1",
68+
"@storybook/theming": "^5.0.1",
6869
"autoprefixer": "^6.3.6",
6970
"babel-loader": "^8.0.5",
7071
"babel-plugin-transform-async-to-promises": "^0.8.4",
@@ -89,6 +90,7 @@
8990
"react-infinite": "^0.13.0",
9091
"react-tiny-virtual-list": "^2.0.1",
9192
"react-virtualized": "^9.2.2",
93+
"react-window": "^1.6.2",
9294
"rollup": "^1.0.0",
9395
"rollup-plugin-babel": "^4.2.0",
9496
"rollup-plugin-commonjs": "^9.2.0",

src/.stories/Storybook.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@
5656
display: block;
5757
width: 18px;
5858
height: 18px;
59-
background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path d="M 0 7.5 L 0 12.5 L 50 12.5 L 50 7.5 L 0 7.5 z M 0 22.5 L 0 27.5 L 50 27.5 L 50 22.5 L 0 22.5 z M 0 37.5 L 0 42.5 L 50 42.5 L 50 37.5 L 0 37.5 z" color="#000"></path></svg>');
60-
background-size: contain;
61-
background-repeat: no-repeat;
6259
opacity: 0.25;
6360
margin-right: 20px;
6461
cursor: row-resize;

0 commit comments

Comments
 (0)