diff --git a/.storybook/config.js b/.storybook/config.js
new file mode 100644
index 0000000000..2adefcc742
--- /dev/null
+++ b/.storybook/config.js
@@ -0,0 +1,9 @@
+import {configure} from '@kadira/storybook';
+
+const req = require.context('./../Resources/Private/JavaScript', true, /story\.js$/);
+
+function loadStories() {
+ req.keys().forEach(req);
+}
+
+configure(loadStories, module);
diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js
new file mode 100644
index 0000000000..45e02281a9
--- /dev/null
+++ b/.storybook/webpack.config.js
@@ -0,0 +1,12 @@
+const defaultConfig = require('./../webpack.config');
+
+module.exports = Object.assign({}, defaultConfig, {
+ module: {
+ loaders: [
+ {
+ test: /\.css$/,
+ loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader'
+ }
+ ]
+ }
+});
diff --git a/Build/Utilities/Environment.js b/Build/Utilities/Environment.js
index 470f67d05d..463d0948cd 100644
--- a/Build/Utilities/Environment.js
+++ b/Build/Utilities/Environment.js
@@ -1,4 +1,5 @@
module.exports = {
isCi: process.env.CI,
- isTesting: process.env.TEST
+ isTesting: process.env.TEST,
+ isStorybook: process.env.STORY
};
diff --git a/Resources/Private/JavaScript/Components/Bar/index.story.js b/Resources/Private/JavaScript/Components/Bar/index.story.js
new file mode 100644
index 0000000000..17640d5daa
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Bar/index.story.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Bar from './index.js';
+
+storiesOf('Bar', module)
+ .add('default', () => (
+
+
+ Top bar
+
+
+ Bottom bar
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Button/index.js b/Resources/Private/JavaScript/Components/Button/index.js
index 7086cd61c4..843932ccfa 100644
--- a/Resources/Private/JavaScript/Components/Button/index.js
+++ b/Resources/Private/JavaScript/Components/Button/index.js
@@ -25,7 +25,6 @@ const Button = props => {
[styles['btn--lighter']]: style === 'lighter',
[styles['btn--transparent']]: style === 'transparent',
[styles['btn--cleanHover']]: hoverStyle === 'clean',
- [styles['btn--lighterHover']]: hoverStyle === 'lighter',
[styles['btn--brandHover']]: hoverStyle === 'brand',
[styles['btn--darkenHover']]: hoverStyle === 'darken',
[styles['btn--brandActive']]: isActive,
diff --git a/Resources/Private/JavaScript/Components/Button/index.story.js b/Resources/Private/JavaScript/Components/Button/index.story.js
new file mode 100644
index 0000000000..9a668d9f1d
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Button/index.story.js
@@ -0,0 +1,36 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import Button from './index.js';
+
+storiesOf('Button', module)
+ .add('states', () => (
+
+
+
+
+
+
+ ))
+ .add('background styles', () => (
+
+
+
+
+
+ ))
+ .add('hover styles', () => (
+
+
+
+
+
+ ))
+ .add('events', () => (
+
+
+
+
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/CheckBox/index.story.js b/Resources/Private/JavaScript/Components/CheckBox/index.story.js
new file mode 100644
index 0000000000..64fe2d4ac2
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/CheckBox/index.story.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import CheckBox from './index.js';
+
+storiesOf('CheckBox', module)
+ .add('default', () => (
+
+
Unchecked:
+
+ Checked:
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Dialog/index.story.js b/Resources/Private/JavaScript/Components/Dialog/index.story.js
new file mode 100644
index 0000000000..49838c4112
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Dialog/index.story.js
@@ -0,0 +1,21 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import Dialog from './index.js';
+
+storiesOf('Dialog', module)
+ .add('default', () => (
+
+
+ ]}
+ >
+ H1ello world
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/DropDown/index.story.js b/Resources/Private/JavaScript/Components/DropDown/index.story.js
new file mode 100644
index 0000000000..a5df783066
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/DropDown/index.story.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import DropDown from './index.js';
+
+storiesOf('DropDown', module)
+ .add('default', () => (
+
+
+ Dropdown header
+
+
+ Dropdown contents
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Grid/index.story.js b/Resources/Private/JavaScript/Components/Grid/index.story.js
new file mode 100644
index 0000000000..a48b21abfd
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Grid/index.story.js
@@ -0,0 +1,16 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Grid from './index.js';
+import GridItem from './GridItem/index.js';
+
+storiesOf('Grid', module)
+ .add('default', () => (
+
+ Item 1
+ Item 2
+ Item 3
+ Item 4
+ Item 5
+ Item 6
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Headline/index.story.js b/Resources/Private/JavaScript/Components/Headline/index.story.js
new file mode 100644
index 0000000000..442681c171
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Headline/index.story.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Headline from './index.js';
+
+storiesOf('Headline', module)
+ .add('default', () => (
+
+ Heading 1
+ Heading 2
+ Heading 3
+ Heading 4
+ Heading 5
+ Heading 6
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Icon/index.story.js b/Resources/Private/JavaScript/Components/Icon/index.story.js
new file mode 100644
index 0000000000..a0a1b73868
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Icon/index.story.js
@@ -0,0 +1,24 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Icon from './index.js';
+
+storiesOf('Icon', module)
+ .add('size', () => (
+
+ ))
+ .add('padded', () => (
+
+ ))
+ .add('spin', () => (
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/IconButton/index.story.js b/Resources/Private/JavaScript/Components/IconButton/index.story.js
new file mode 100644
index 0000000000..b08887fe10
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/IconButton/index.story.js
@@ -0,0 +1,10 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import IconButton from './index.js';
+
+storiesOf('IconButton', module)
+ .add('default', () => (
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/IconButtonDropDown/index.story.js b/Resources/Private/JavaScript/Components/IconButtonDropDown/index.story.js
new file mode 100644
index 0000000000..55d4f6843e
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/IconButtonDropDown/index.story.js
@@ -0,0 +1,20 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import IconButtonDropDown from './index.js';
+import Icon from './../Icon/index.js';
+
+storiesOf('IconButtonDropDown', module)
+ .add('default', () => (
+
+
+
+
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Label/index.story.js b/Resources/Private/JavaScript/Components/Label/index.story.js
new file mode 100644
index 0000000000..7b46810246
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Label/index.story.js
@@ -0,0 +1,10 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Label from './index.js';
+
+storiesOf('Label', module)
+ .add('default', () => (
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Portal/index.story.js b/Resources/Private/JavaScript/Components/Portal/index.story.js
new file mode 100644
index 0000000000..1d3d3a612a
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Portal/index.story.js
@@ -0,0 +1,8 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Portal from './index.js';
+
+storiesOf('Portal', module)
+ .add('default', () => (
+ Test portal
+ ));
diff --git a/Resources/Private/JavaScript/Components/SideBar/index.story.js b/Resources/Private/JavaScript/Components/SideBar/index.story.js
new file mode 100644
index 0000000000..177b4aa8bf
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/SideBar/index.story.js
@@ -0,0 +1,11 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import SideBar from './index.js';
+
+storiesOf('SideBar', module)
+ .add('default', () => (
+
+ Left sidebar
+ Right sidebar
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Tabs/index.story.js b/Resources/Private/JavaScript/Components/Tabs/index.story.js
new file mode 100644
index 0000000000..5b8dead583
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Tabs/index.story.js
@@ -0,0 +1,13 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import Tabs from './index.js';
+
+storiesOf('Tabs', module)
+ .add('default', () => (
+
+
+ Tab 1 contents
+ Tab 2 contents
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/TextInput/index.story.js b/Resources/Private/JavaScript/Components/TextInput/index.story.js
new file mode 100644
index 0000000000..878164f88f
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/TextInput/index.story.js
@@ -0,0 +1,23 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import TextInput from './index.js';
+
+storiesOf('TextInput', module)
+ .add('default', () => (
+
+
+
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/ToggablePanel/index.story.js b/Resources/Private/JavaScript/Components/ToggablePanel/index.story.js
new file mode 100644
index 0000000000..8fefd39af8
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/ToggablePanel/index.story.js
@@ -0,0 +1,10 @@
+import React from 'react';
+import {storiesOf} from '@kadira/storybook';
+import ToggablePanel from './index.js';
+
+storiesOf('ToggablePanel', module)
+ .add('default', () => (
+
+ Panel contents
+
+ ));
diff --git a/Resources/Private/JavaScript/Components/Tree/index.story.js b/Resources/Private/JavaScript/Components/Tree/index.story.js
new file mode 100644
index 0000000000..820fcb24b4
--- /dev/null
+++ b/Resources/Private/JavaScript/Components/Tree/index.story.js
@@ -0,0 +1,78 @@
+import React from 'react';
+import {storiesOf, action} from '@kadira/storybook';
+import Tree from './index.js';
+
+storiesOf('Tree', module)
+ .add('default', () => (
+
+ adfasdfa
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ));
diff --git a/karma.entry.js b/karma.entry.js
index fbfeedb26a..90c0113665 100644
--- a/karma.entry.js
+++ b/karma.entry.js
@@ -9,6 +9,6 @@
// Instead, this way of requiring all spec files results in one big test bundle webpack
// needs to compile, which is a lot faster than the default configuration.
//
-const context = require.context('./Resources/Private/JavaScript', true, /.js$/);
+const context = require.context('./Resources/Private/JavaScript', true, /(?!.*story.js$)^.*js$/);
context.keys().forEach(context);
diff --git a/package.json b/package.json
index ab53ec7be2..0f81dfc1c6 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,7 @@
"main": "Resources/Public/JavaScript/Host.js",
"private": true,
"devDependencies": {
+ "@kadira/storybook": "^1.27.0",
"autoprefixer": "^6.2.2",
"babel-core": "^6.4.0",
"babel-eslint": "^6.0.2",
@@ -117,7 +118,8 @@
"watch:karma": "export TEST=true && karma start",
"watch": "npm run watch:build & npm run watch:karma",
"prewatch": "Build/check-dependencies",
- "prebuild": "Build/check-dependencies"
+ "prebuild": "Build/check-dependencies",
+ "storybook": "export STORY=true && start-storybook -p 9001"
},
"contributors": [
{
diff --git a/webpack.config.js b/webpack.config.js
index b772a71cdf..27dec54cbd 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -90,7 +90,7 @@ const config = {
//
// Adjust the config depending on the env.
//
-if (!env.isCi && !env.isTesting) {
+if (!env.isCi && !env.isTesting && !env.isStorybook) {
config.plugins.push(new LiveReloadPlugin({appendScriptTag: true}));
}