├── .npmignore ├── .travis.yml ├── src ├── server │ ├── config │ │ ├── polyfills.js │ │ ├── globals.js │ │ ├── babel.prod.js │ │ ├── babel.js │ │ ├── WatchMissingNodeModulesPlugin.js │ │ ├── utils.js │ │ ├── defaults │ │ │ └── webpack.config.js │ │ ├── webpack.config.js │ │ └── webpack.config.prod.js │ ├── public │ │ └── favicon.ico │ ├── addons.js │ ├── utils.js │ ├── __tests__ │ │ └── utils.js │ ├── middleware.js │ ├── iframe.html.js │ ├── index.html.js │ ├── babel_config.js │ ├── track_usage.js │ ├── build.js │ ├── config.js │ └── index.js └── client │ ├── manager │ ├── index.js │ ├── preview.js │ └── provider.js │ ├── index.js │ └── preview │ ├── init.js │ ├── actions.js │ ├── reducer.js │ ├── error_display.js │ ├── index.js │ ├── story_store.js │ ├── config_api.js │ ├── client_api.js │ ├── render.js │ └── __tests__ │ └── client_api.js ├── .babelrc ├── scripts ├── publish.sh ├── prepublish.sh └── mocha_runner.js ├── .gitignore ├── dist ├── server │ ├── config │ │ ├── polyfills.js │ │ ├── babel.prod.js │ │ ├── babel.js │ │ ├── defaults │ │ │ └── webpack.config.js │ │ ├── utils.js │ │ ├── webpack.config.js │ │ └── webpack.config.prod.js │ ├── addons.js │ ├── utils.js │ ├── iframe.html.js │ ├── middleware.js │ ├── index.html.js │ ├── track_usage.js │ ├── build.js │ ├── config.js │ └── index.js └── client │ ├── manager │ ├── index.js │ ├── preview.js │ └── provider.js │ ├── preview │ ├── actions.js │ ├── init.js │ ├── error_display.js │ ├── reducer.js │ ├── config_api.js │ ├── index.js │ ├── story_store.js │ ├── client_api.js │ └── render.js │ └── index.js ├── docs ├── demo.gif ├── .DS_Store ├── storybooks_io_logo.png └── react_storybook_screenshot.png ├── demo ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── index.css │ ├── index.js │ ├── App.test.js │ ├── App.css │ ├── stories │ │ ├── index.js │ │ ├── Button.js │ │ └── Welcome.js │ ├── App.js │ └── logo.svg ├── .storybook │ └── config.js ├── README.md ├── .gitignore └── package.json ├── addons.js ├── ROADMAP.md ├── config └── storybook.d.ts ├── .eslintrc ├── LICENSE ├── README.md ├── CONTRIBUTING.md ├── package.json └── CHANGELOG.md /.npmignore: -------------------------------------------------------------------------------- 1 | docs 2 | src 3 | .babelrc 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "5" 4 | -------------------------------------------------------------------------------- /src/server/config/polyfills.js: -------------------------------------------------------------------------------- 1 | require('airbnb-js-shims'); 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "es2016", "stage-0", "react"] 3 | } 4 | -------------------------------------------------------------------------------- /scripts/publish.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | npm publish --access=public 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | .idea 4 | npm-shrinkwrap.json 5 | dist 6 | -------------------------------------------------------------------------------- /dist/server/config/polyfills.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('airbnb-js-shims'); -------------------------------------------------------------------------------- /docs/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/docs/demo.gif -------------------------------------------------------------------------------- /docs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/docs/.DS_Store -------------------------------------------------------------------------------- /demo/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/demo/public/favicon.ico -------------------------------------------------------------------------------- /demo/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | } 6 | -------------------------------------------------------------------------------- /src/server/config/globals.js: -------------------------------------------------------------------------------- 1 | /* globals window */ 2 | 3 | window.STORYBOOK_REACT_CLASSES = {}; 4 | -------------------------------------------------------------------------------- /docs/storybooks_io_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/docs/storybooks_io_logo.png -------------------------------------------------------------------------------- /src/server/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/src/server/public/favicon.ico -------------------------------------------------------------------------------- /docs/react_storybook_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tes/react-storybook/master/docs/react_storybook_screenshot.png -------------------------------------------------------------------------------- /src/server/addons.js: -------------------------------------------------------------------------------- 1 | import '@kadira/storybook-addon-actions/register'; 2 | import '@kadira/storybook-addon-links/register'; 3 | -------------------------------------------------------------------------------- /dist/server/addons.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | require('@kadira/storybook-addon-actions/register'); 4 | 5 | require('@kadira/storybook-addon-links/register'); -------------------------------------------------------------------------------- /demo/.storybook/config.js: -------------------------------------------------------------------------------- 1 | import { configure } from '@kadira/storybook'; 2 | 3 | function loadStories() { 4 | require('../src/stories'); 5 | } 6 | 7 | configure(loadStories, module); 8 | -------------------------------------------------------------------------------- /demo/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | import './index.css'; 5 | 6 | ReactDOM.render( 7 | , 8 | document.getElementById('root') 9 | ); 10 | -------------------------------------------------------------------------------- /addons.js: -------------------------------------------------------------------------------- 1 | // We are not using this file inside this project. 2 | // But, this will be useful when a user is configuring it's own addons. 3 | // Then he can import this file to add default set of addons. 4 | require('./dist/server/addons'); 5 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | # Storybook Demo 2 | 3 | This is a demo app created using `create-react-app` to test new versions of Storybook. Run `npm install` to sync Storybook module with the source code and run `npm run storybook` to start the Storybook. 4 | -------------------------------------------------------------------------------- /demo/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | }); 9 | -------------------------------------------------------------------------------- /src/client/manager/index.js: -------------------------------------------------------------------------------- 1 | /* global document */ 2 | 3 | import renderStorybookUI from '@kadira/storybook-ui'; 4 | import Provider from './provider'; 5 | 6 | const rootEl = document.getElementById('root'); 7 | renderStorybookUI(rootEl, new Provider()); 8 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | 6 | # testing 7 | coverage 8 | 9 | # production 10 | build 11 | 12 | # misc 13 | .DS_Store 14 | .env 15 | npm-debug.log 16 | -------------------------------------------------------------------------------- /scripts/prepublish.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "> Start transpiling ES2015" 4 | echo "" 5 | rm -rf ./dist 6 | ./node_modules/.bin/babel --ignore __tests__ --plugins "transform-runtime" ./src --out-dir ./dist 7 | cp -r ./src/server/public ./dist/server/public 8 | echo "" 9 | echo "> Complete transpiling ES2015" 10 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | ### Short Term 4 | 5 | * Addon API and addons 6 | * A clear guide to hack React Storybook 7 | * React Native Support 8 | 9 | ### Long Term 10 | 11 | * Automatic story generation (and edge case detection) based on propTypes. 12 | * Angular Support 13 | * Vue Support 14 | * UI addons (Add different panels like Action Logger) 15 | -------------------------------------------------------------------------------- /demo/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 80px; 8 | } 9 | 10 | .App-header { 11 | background-color: #222; 12 | height: 150px; 13 | padding: 20px; 14 | color: white; 15 | } 16 | 17 | .App-intro { 18 | font-size: large; 19 | } 20 | 21 | @keyframes App-logo-spin { 22 | from { transform: rotate(0deg); } 23 | to { transform: rotate(360deg); } 24 | } 25 | -------------------------------------------------------------------------------- /src/client/manager/preview.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | const iframeStyle = { 4 | width: '100%', 5 | height: '100%', 6 | border: 0, 7 | margin: 0, 8 | padding: 0, 9 | }; 10 | 11 | const Preview = ({ url }) => ( 12 |