Skip to content

Commit 3a8b6e6

Browse files
committed
feat: add storybook
1 parent 4c85d11 commit 3a8b6e6

19 files changed

+4210
-96
lines changed

.storybook/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
stories: ['../stories/index.js'],
3+
};

.storybook/manager.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { addons } from '@storybook/addons';
2+
import { create } from '@storybook/theming/create';
3+
4+
addons.setConfig({
5+
theme: create({
6+
base: 'light',
7+
brandTitle: 'React Sortable Tree',
8+
brandUrl: 'https://github.com/frontend-collective/react-sortable-tree',
9+
gridCellSize: 12,
10+
}),
11+
});

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
"prettier": "prettier --write '{src,test}/**/*.js'",
4343
"lint": "eslint src test",
4444
"release": "standard-version",
45+
"build:storybook": "build-storybook -o build",
46+
"storybook": "start-storybook -p ${PORT:-3001} -h 0.0.0.0",
4547
"deploy": "gh-pages -d build",
4648
"prepublishOnly": "yarn run test && yarn run build"
4749
},
@@ -62,6 +64,9 @@
6264
"@babel/preset-react": "^7.7.0",
6365
"@emotion/core": "^10.0.22",
6466
"@emotion/styled": "^10.0.23",
67+
"@storybook/addons": "^5.3.17",
68+
"@storybook/react": "^5.3.17",
69+
"@storybook/theming": "^5.3.17",
6570
"@types/react": "^16.9.11",
6671
"babel-eslint": "^10.0.3",
6772
"babelify": "^10.0.0",

website/examples/basic/BasicHorizontal.js renamed to stories/BasicHorizontal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane split="horizontal">

website/examples/basic/BasicNested.js renamed to stories/BasicNested.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane

website/examples/basic/BasicStep.js renamed to stories/BasicStep.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane

website/examples/basic/BasicVertical.js renamed to stories/BasicVertical.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane split="vertical">

website/examples/advanced/InlineStyles.js renamed to stories/InlineStyles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => {
55
const styleA = { background: '#eee' };

website/examples/advanced/MultipleHorizontal.js renamed to stories/MultipleHorizontal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane split="horizontal" defaultSize="33%">

website/examples/advanced/MultipleVertical.js renamed to stories/MultipleVertical.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import SplitPane from '../../../src';
2+
import SplitPane from '../src';
33

44
export default () => (
55
<SplitPane split="vertical" defaultSize="33%">

0 commit comments

Comments
 (0)