diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index a8be29392b99..000000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "extends": [
- "./node_modules/eslint-config-airbnb-base/rules/es6.js"
- ],
- "plugins": [
- "prettier"
- ],
- "parser": "babel-eslint",
- "parserOptions": {
- "sourceType": "module"
- },
- "env": {
- "es6": true,
- "node": true
- },
- "rules": {
- "strict": 0,
- "prettier/prettier": ["warn", {
- "printWidth": 100,
- "tabWidth": 2,
- "bracketSpacing": true,
- # "trailingComma": "es5",
- "singleQuote": true
- }],
- "quotes": ["warn", "single"],
- "arrow-parens": ["warn", "as-needed"]
- # "comma-dangle": ["warn", "always"]
- }
-}
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 000000000000..ea25eb04850a
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,28 @@
+module.exports = {
+ extends: [
+ './node_modules/eslint-config-airbnb-base/rules/es6.js',
+ ],
+ plugins: [
+ 'prettier',
+ ],
+ parser: 'babel-eslint',
+ parserOptions: {
+ sourceType: 'module',
+ },
+ env: {
+ es6: true,
+ node: true,
+ },
+ rules: {
+ strict: 0,
+ 'prettier/prettier': ['warn', {
+ printWidth: 100,
+ tabWidth: 2,
+ bracketSpacing: true,
+ trailingComma: 'all',
+ singleQuote: true,
+ }],
+ quotes: ['warn', 'single'],
+ 'arrow-parens': ['warn', 'as-needed'],
+ },
+}
diff --git a/package.json b/package.json
index 9e97e82e8ecb..c9cff6725965 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,13 @@
{
"name": "storybook",
"devDependencies": {
- "babel-eslint": "^7.2.1",
+ "babel-eslint": "^7.2.2",
"eslint": "^3.19.0",
- "eslint-config-airbnb-base": "^11.1.2",
+ "eslint-config-airbnb-base": "^11.1.3",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-prettier": "^2.0.1",
- "lerna": "2.0.0-rc.1",
- "prettier": "^0.22.0"
+ "lerna": "2.0.0-rc.2",
+ "prettier": "^1.1.0"
},
"scripts": {
"postinstall": "lerna bootstrap",
diff --git a/packages/addon-actions/src/components/ActionLogger/index.js b/packages/addon-actions/src/components/ActionLogger/index.js
index 4ecfd31ad1a5..203d2f1bf4d8 100644
--- a/packages/addon-actions/src/components/ActionLogger/index.js
+++ b/packages/addon-actions/src/components/ActionLogger/index.js
@@ -9,12 +9,9 @@ class ActionLogger extends Component {
if (latest) {
const borderLeft = style.action.borderLeft;
latest.style.borderLeft = 'solid 5px #aaa';
- setTimeout(
- () => {
- latest.style.borderLeft = borderLeft;
- },
- 300
- );
+ setTimeout(() => {
+ latest.style.borderLeft = borderLeft;
+ }, 300);
}
}
@@ -53,7 +50,7 @@ class ActionLogger extends Component {
ActionLogger.propTypes = {
onClear: PropTypes.func,
- actions: PropTypes.array
+ actions: PropTypes.array,
};
export default ActionLogger;
diff --git a/packages/addon-actions/src/components/ActionLogger/style.js b/packages/addon-actions/src/components/ActionLogger/style.js
index d370a9b8c31f..d82497e1adad 100644
--- a/packages/addon-actions/src/components/ActionLogger/style.js
+++ b/packages/addon-actions/src/components/ActionLogger/style.js
@@ -2,14 +2,14 @@ export default {
wrapper: {
flex: 1,
display: 'flex',
- position: 'relative'
+ position: 'relative',
},
actions: {
flex: 1,
margin: 0,
padding: '8px 2px 20px 0',
overflowY: 'auto',
- color: '#666'
+ color: '#666',
},
action: {
display: 'flex',
@@ -17,21 +17,21 @@ export default {
borderLeft: '5px solid white',
borderBottom: '1px solid #fafafa',
transition: 'all 0.1s',
- alignItems: 'center'
+ alignItems: 'center',
},
countwrap: {
- paddingBottom: 2
+ paddingBottom: 2,
},
counter: {
margin: '0 5px 0 5px',
backgroundColor: '#777777',
color: '#ffffff',
padding: '1px 5px',
- borderRadius: '20px'
+ borderRadius: '20px',
},
inspector: {
flex: 1,
- padding: '0 0 0 5px'
+ padding: '0 0 0 5px',
},
button: {
position: 'absolute',
@@ -44,6 +44,6 @@ export default {
padding: '5px 10px',
borderRadius: '4px 0 0 0',
color: 'rgba(0, 0, 0, 0.5)',
- outline: 'none'
- }
+ outline: 'none',
+ },
};
diff --git a/packages/addon-actions/src/containers/ActionLogger/index.js b/packages/addon-actions/src/containers/ActionLogger/index.js
index 49c70ef1b1a2..a4668784b059 100644
--- a/packages/addon-actions/src/containers/ActionLogger/index.js
+++ b/packages/addon-actions/src/containers/ActionLogger/index.js
@@ -38,7 +38,7 @@ export default class ActionLogger extends React.Component {
render() {
const props = {
actions: this.state.actions,
- onClear: () => this.clearActions()
+ onClear: () => this.clearActions(),
};
return ;
}
diff --git a/packages/addon-actions/src/manager.js b/packages/addon-actions/src/manager.js
index 14c80cc4fff4..4728e7ac6d3d 100644
--- a/packages/addon-actions/src/manager.js
+++ b/packages/addon-actions/src/manager.js
@@ -8,7 +8,7 @@ export function register() {
const channel = addons.getChannel();
addons.addPanel(PANEL_ID, {
title: 'Action Logger',
- render: () =>
+ render: () => ,
});
});
}
diff --git a/packages/addon-actions/src/preview.js b/packages/addon-actions/src/preview.js
index 963ab29d28b8..a2dfd1b31a0f 100644
--- a/packages/addon-actions/src/preview.js
+++ b/packages/addon-actions/src/preview.js
@@ -16,7 +16,7 @@ export function action(name) {
const randomId = Math.random().toString(16).slice(2);
channel.emit(EVENT_ID, {
id: randomId,
- data: { name, args }
+ data: { name, args },
});
};
diff --git a/packages/addon-comments/src/index.js b/packages/addon-comments/src/index.js
index 99555c12786d..4a7863a01254 100644
--- a/packages/addon-comments/src/index.js
+++ b/packages/addon-comments/src/index.js
@@ -7,7 +7,7 @@ const buttonStyles = {
backgroundColor: '#FFFFFF',
cursor: 'pointer',
fontSize: 15,
- padding: '3px 10px'
+ padding: '3px 10px',
};
const Button = ({ children, onClick, style = {} }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick, style = {} }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
onClick: PropTypes.func,
- style: PropTypes.object
+ style: PropTypes.object,
};
export default Button;
diff --git a/packages/addon-comments/src/manager/components/CommentForm/index.js b/packages/addon-comments/src/manager/components/CommentForm/index.js
index 9eda02fe05f6..c2259db8fdcb 100644
--- a/packages/addon-comments/src/manager/components/CommentForm/index.js
+++ b/packages/addon-comments/src/manager/components/CommentForm/index.js
@@ -17,7 +17,7 @@ marked.setOptions({
pedantic: false,
sanitize: true,
smartLists: true,
- smartypants: false
+ smartypants: false,
});
export default class CommentForm extends Component {
@@ -85,5 +85,5 @@ export default class CommentForm extends Component {
}
CommentForm.propTypes = {
- addComment: PropTypes.func
+ addComment: PropTypes.func,
};
diff --git a/packages/addon-comments/src/manager/components/CommentForm/style.js b/packages/addon-comments/src/manager/components/CommentForm/style.js
index 3efb44b649f6..99ec998e9ff4 100644
--- a/packages/addon-comments/src/manager/components/CommentForm/style.js
+++ b/packages/addon-comments/src/manager/components/CommentForm/style.js
@@ -7,19 +7,19 @@ const button = {
padding: '7px 15px',
fontSize: 12,
lineHeight: 1,
- color: 'rgba(0, 0, 0, 0.5)'
+ color: 'rgba(0, 0, 0, 0.5)',
};
export default {
wrapper: {
display: 'flex',
alignItems: 'center',
- borderTop: '1px solid rgb(234, 234, 234)'
+ borderTop: '1px solid rgb(234, 234, 234)',
},
submitButton: {
...button,
cursor: 'pointer',
- borderRadius: '0 0 4px 0'
+ borderRadius: '0 0 4px 0',
},
input: {
flex: 1,
@@ -34,6 +34,6 @@ export default {
lineHeight: 1.6,
color: 'rgba(0, 0, 0, 0.8)',
fontFamily: 'sans-serif',
- resize: 'none'
- }
+ resize: 'none',
+ },
};
diff --git a/packages/addon-comments/src/manager/components/CommentItem/index.js b/packages/addon-comments/src/manager/components/CommentItem/index.js
index 88cc0122b7f6..023c451eb9ea 100644
--- a/packages/addon-comments/src/manager/components/CommentItem/index.js
+++ b/packages/addon-comments/src/manager/components/CommentItem/index.js
@@ -74,5 +74,5 @@ export default class CommentItem extends Component {
CommentItem.propTypes = {
deleteComment: PropTypes.func,
comment: PropTypes.object,
- ownComment: PropTypes.bool
+ ownComment: PropTypes.bool,
};
diff --git a/packages/addon-comments/src/manager/components/CommentItem/style.js b/packages/addon-comments/src/manager/components/CommentItem/style.js
index fd3388d98e2f..b27c4942e3af 100644
--- a/packages/addon-comments/src/manager/components/CommentItem/style.js
+++ b/packages/addon-comments/src/manager/components/CommentItem/style.js
@@ -2,28 +2,28 @@ const commentItem = {
display: 'flex',
paddingBottom: '5px',
WebkitFontSmoothing: 'antialiased',
- transition: 'opacity 0.5s'
+ transition: 'opacity 0.5s',
};
export default {
commentItem: {
- ...commentItem
+ ...commentItem,
},
commentItemloading: {
...commentItem,
- opacity: 0.25
+ opacity: 0.25,
},
commentAside: {
- margin: '5px 10px 0 0'
+ margin: '5px 10px 0 0',
},
commentAvatar: {
width: 32,
height: 32,
- borderRadius: 5
+ borderRadius: 5,
},
commentContent: {
position: 'relative',
- flex: 1
+ flex: 1,
},
commentHead: {
//
@@ -33,19 +33,19 @@ export default {
fontSize: 13,
lineHeight: 1,
fontWeight: 'bold',
- marginRight: 5
+ marginRight: 5,
},
commentTime: {
fontFamily: 'sans-serif',
fontSize: 11,
lineHeight: 1,
- color: 'rgb(150, 150, 150)'
+ color: 'rgb(150, 150, 150)',
},
commentText: {
fontFamily: 'sans-serif',
fontSize: 13,
lineHeight: 1.7,
- maxWidth: 650
+ maxWidth: 650,
},
commentDelete: {
fontFamily: 'sans-serif',
@@ -53,6 +53,6 @@ export default {
top: 2,
right: 0,
fontSize: 11,
- color: 'rgb(200, 200, 200)'
- }
+ color: 'rgb(200, 200, 200)',
+ },
};
diff --git a/packages/addon-comments/src/manager/components/CommentList/index.js b/packages/addon-comments/src/manager/components/CommentList/index.js
index b122369052e4..790c659153a5 100644
--- a/packages/addon-comments/src/manager/components/CommentList/index.js
+++ b/packages/addon-comments/src/manager/components/CommentList/index.js
@@ -53,5 +53,5 @@ export default class CommentList extends Component {
CommentList.propTypes = {
comments: PropTypes.array,
user: PropTypes.object,
- deleteComment: PropTypes.func
+ deleteComment: PropTypes.func,
};
diff --git a/packages/addon-comments/src/manager/components/CommentList/style.js b/packages/addon-comments/src/manager/components/CommentList/style.js
index e502e4654f04..8b9aab9d0af1 100644
--- a/packages/addon-comments/src/manager/components/CommentList/style.js
+++ b/packages/addon-comments/src/manager/components/CommentList/style.js
@@ -2,11 +2,11 @@ export default {
wrapper: {
flex: 1,
overflow: 'auto',
- padding: '7px 15px'
+ padding: '7px 15px',
},
noComments: {
fontFamily: 'sans-serif',
fontSize: 13,
- padding: '10px 0'
- }
+ padding: '10px 0',
+ },
};
diff --git a/packages/addon-comments/src/manager/components/CommentsPanel/index.js b/packages/addon-comments/src/manager/components/CommentsPanel/index.js
index f5832a58838c..0c09975c852f 100644
--- a/packages/addon-comments/src/manager/components/CommentsPanel/index.js
+++ b/packages/addon-comments/src/manager/components/CommentsPanel/index.js
@@ -39,5 +39,5 @@ export default class CommentsPanel extends Component {
CommentsPanel.propTypes = {
loading: PropTypes.bool,
user: PropTypes.object,
- appNotAvailable: PropTypes.bool
+ appNotAvailable: PropTypes.bool,
};
diff --git a/packages/addon-comments/src/manager/components/CommentsPanel/style.js b/packages/addon-comments/src/manager/components/CommentsPanel/style.js
index 6f92dfce5ecf..00ca94c7ae17 100644
--- a/packages/addon-comments/src/manager/components/CommentsPanel/style.js
+++ b/packages/addon-comments/src/manager/components/CommentsPanel/style.js
@@ -3,7 +3,7 @@ export default {
flex: 1,
display: 'flex',
flexDirection: 'column',
- position: 'relative'
+ position: 'relative',
},
message: {
flex: 1,
@@ -15,7 +15,7 @@ export default {
fontSize: 11,
letterSpacing: 1,
textDecoration: 'none',
- textTransform: 'uppercase'
+ textTransform: 'uppercase',
},
button: {
textDecoration: 'none',
@@ -24,6 +24,6 @@ export default {
background: 'rgb(240, 240, 240)',
borderRadius: 5,
textTransform: 'none',
- fontSize: 12
- }
+ fontSize: 12,
+ },
};
diff --git a/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js b/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js
index 7c0523f2ef29..17e1a13d6baa 100644
--- a/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js
+++ b/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js
@@ -19,7 +19,7 @@ export default class DataStore {
const key = this._getStoryKey(currentStory);
this.cache[key] = {
comments,
- addedAt: Date.now()
+ addedAt: Date.now(),
};
}
@@ -50,7 +50,7 @@ export default class DataStore {
() => {
this._loadUsers().then(() => this._loadComments());
},
- 1000 * 60 // Reload for every minute
+ 1000 * 60, // Reload for every minute
);
}
@@ -94,16 +94,13 @@ export default class DataStore {
return null;
}
return this.db.getCollection('users').get(query, options).then(users => {
- this.users = users.reduce(
- (newUsers, user) => {
- const usersObj = {
- ...newUsers
- };
- usersObj[user.id] = user;
- return usersObj;
- },
- {}
- );
+ this.users = users.reduce((newUsers, user) => {
+ const usersObj = {
+ ...newUsers,
+ };
+ usersObj[user.id] = user;
+ return usersObj;
+ }, {});
});
});
}
@@ -193,7 +190,7 @@ export default class DataStore {
const doc = {
...comment,
...this.currentStory,
- sbProtected: true
+ sbProtected: true,
};
return this.db.getCollection('comments').set(doc);
diff --git a/packages/addon-comments/src/manager/containers/CommentsPanel/index.js b/packages/addon-comments/src/manager/containers/CommentsPanel/index.js
index 703a68cd36db..dcb5ef8d23de 100644
--- a/packages/addon-comments/src/manager/containers/CommentsPanel/index.js
+++ b/packages/addon-comments/src/manager/containers/CommentsPanel/index.js
@@ -14,7 +14,7 @@ export default class Container extends Component {
user: null,
users: [],
comments: [],
- loading: true
+ loading: true,
};
}
@@ -86,7 +86,7 @@ export default class Container extends Component {
const comment = {
text,
time,
- userId: user.id
+ userId: user.id,
};
this.store.addComment(comment);
@@ -103,7 +103,7 @@ export default class Container extends Component {
loading: this.state.loading,
appNotAvailable: this.state.appNotAvailable,
deleteComment: commentId => this.deleteComment(commentId),
- addComment: text => this.addComment(text)
+ addComment: text => this.addComment(text),
};
return ;
@@ -111,5 +111,5 @@ export default class Container extends Component {
}
Container.propTypes = {
- api: PropTypes.object
+ api: PropTypes.object,
};
diff --git a/packages/addon-comments/src/manager/index.js b/packages/addon-comments/src/manager/index.js
index 207bfacdc63f..574d224494c0 100644
--- a/packages/addon-comments/src/manager/index.js
+++ b/packages/addon-comments/src/manager/index.js
@@ -10,7 +10,7 @@ export function init() {
// add 'Comments' panel
addons.addPanel(PANEL_ID, {
title: 'Comments',
- render: () =>
+ render: () => ,
});
});
}
diff --git a/packages/addon-comments/src/stories/index.js b/packages/addon-comments/src/stories/index.js
index 245ebe2741a2..98a7783dfe2c 100644
--- a/packages/addon-comments/src/stories/index.js
+++ b/packages/addon-comments/src/stories/index.js
@@ -7,7 +7,7 @@ import CommentsPanel from '../manager/components/CommentsPanel';
const userObj = {
avatar: 'http://www.gravatar.com/avatar/?d=identicon',
- name: 'User A'
+ name: 'User A',
};
const commentsList = [
@@ -15,29 +15,29 @@ const commentsList = [
loading: false,
user: {
avatar: 'http://www.gravatar.com/avatar/?d=identicon',
- name: 'User A'
+ name: 'User A',
},
time: 'Wed Oct 12 2016 13:36:59 GMT+0530 (IST)',
- text: 'Lorem ipsum dolor sit amet,
Ut odio massa, rutrum et purus id.
'
+ text: 'Lorem ipsum dolor sit amet, Ut odio massa, rutrum et purus id.
',
},
{
loading: false,
user: {
avatar: 'http://www.gravatar.com/avatar/?d=identicon',
- name: 'User B'
+ name: 'User B',
},
time: 'Wed Oct 12 2016 13:38:46 GMT+0530 (IST)',
- text: 'Vivamus tortor nisi, efficitur in rutrum ac, tempor et mauris
. In et rutrum enim'
+ text: 'Vivamus tortor nisi, efficitur in rutrum ac, tempor et mauris
. In et rutrum enim',
},
{
loading: true,
user: {
avatar: 'http://www.gravatar.com/avatar/?d=identicon',
- name: 'User C'
+ name: 'User C',
},
time: 'Wed Oct 12 2016 13:38:55 GMT+0530 (IST)',
- text: 'sample comment 3'
- }
+ text: 'sample comment 3',
+ },
];
storiesOf('Button', module)
@@ -47,7 +47,7 @@ storiesOf('Button', module)
const style = {
fontSize: 20,
textTransform: 'uppercase',
- color: '#FF8833'
+ color: '#FF8833',
};
return ;
});
diff --git a/packages/addon-comments/src/tests/dataStore.js b/packages/addon-comments/src/tests/dataStore.js
index d2e9fce6fb44..110de0afed7d 100644
--- a/packages/addon-comments/src/tests/dataStore.js
+++ b/packages/addon-comments/src/tests/dataStore.js
@@ -17,14 +17,14 @@ const myDb = {
},
set() {
return new Promise(dbSetPromiseReturn);
- }
+ },
};
},
persister: {
_getAppInfo() {
return Promise.resolve(true);
- }
- }
+ },
+ },
};
addons.setDatabase(myDb);
@@ -38,14 +38,14 @@ describe('DataStore', () => {
expect(dbGetPromiseReturn.called).to.equal(false);
expect(theStore.currentStory).to.deep.equal({
sbKind: 'Components',
- sbStory: 'CommentList - No Comments'
+ sbStory: 'CommentList - No Comments',
});
});
it('set current user', () => {
theStore.setCurrentUser({
id: 'user-id',
- name: 'user-name'
+ name: 'user-name',
});
expect(theStore.user).to.deep.equal({ id: 'user-id', name: 'user-name' });
@@ -57,7 +57,7 @@ describe('DataStore', () => {
expect(dbGetPromiseReturn.called).to.equal(true);
expect(theStore.currentStory).to.deep.equal({
sbKind: 'Components',
- sbStory: 'CommentList - No Comments'
+ sbStory: 'CommentList - No Comments',
});
});
@@ -65,7 +65,7 @@ describe('DataStore', () => {
const comment = {
text: 'sample comment',
time: 1476435982029,
- userId: 'user-id'
+ userId: 'user-id',
};
theStore.addComment(comment);
diff --git a/packages/addon-graphql/demo/index.js b/packages/addon-graphql/demo/index.js
index b3852a0f68c7..debae1bb27e0 100644
--- a/packages/addon-graphql/demo/index.js
+++ b/packages/addon-graphql/demo/index.js
@@ -14,8 +14,8 @@ const userType = new graphql.GraphQLObjectType({
name: 'User',
fields: {
id: { type: graphql.GraphQLString },
- name: { type: graphql.GraphQLString }
- }
+ name: { type: graphql.GraphQLString },
+ },
});
// Define the schema with one top-level field, `user`, that
@@ -30,7 +30,7 @@ const schema = new graphql.GraphQLSchema({
type: userType,
// `args` describes the arguments that the `user` query accepts
args: {
- id: { type: graphql.GraphQLString }
+ id: { type: graphql.GraphQLString },
},
// The resolve function describes how to "resolve" or fulfill
// the incoming query.
@@ -38,10 +38,10 @@ const schema = new graphql.GraphQLSchema({
// to get the User from `data`
resolve(_, args) {
return data[args.id];
- }
- }
- }
- })
+ },
+ },
+ },
+ }),
});
express().use(cors()).use('/graphql', graphqlHTTP({ schema, pretty: true })).listen(3000);
diff --git a/packages/addon-graphql/src/components/FullScreen/style.js b/packages/addon-graphql/src/components/FullScreen/style.js
index 5001a7e1f9cc..9d36b5a767d9 100644
--- a/packages/addon-graphql/src/components/FullScreen/style.js
+++ b/packages/addon-graphql/src/components/FullScreen/style.js
@@ -4,6 +4,6 @@ export default {
top: 0,
right: 0,
bottom: 0,
- left: 0
- }
+ left: 0,
+ },
};
diff --git a/packages/addon-graphql/src/preview.js b/packages/addon-graphql/src/preview.js
index cda20a3ae1e0..54807c35c078 100644
--- a/packages/addon-graphql/src/preview.js
+++ b/packages/addon-graphql/src/preview.js
@@ -5,7 +5,7 @@ import 'graphiql/graphiql.css';
const FETCH_OPTIONS = {
method: 'post',
- headers: { 'Content-Type': 'application/json' }
+ headers: { 'Content-Type': 'application/json' },
};
function getDefautlFetcher(url) {
diff --git a/packages/addon-info/example/Button.js b/packages/addon-info/example/Button.js
index 1fd1c16b38ca..df7c34c01288 100644
--- a/packages/addon-info/example/Button.js
+++ b/packages/addon-info/example/Button.js
@@ -13,8 +13,8 @@ Object.assign(Button, {
label: PropTypes.string.isRequired,
style: PropTypes.object,
disabled: PropTypes.bool,
- onClick: PropTypes.func
- }
+ onClick: PropTypes.func,
+ },
});
export default Button;
diff --git a/packages/addon-info/example/story.js b/packages/addon-info/example/story.js
index 4021b96fdb7c..e24e26a5b0d8 100644
--- a/packages/addon-info/example/story.js
+++ b/packages/addon-info/example/story.js
@@ -16,7 +16,7 @@ storiesOf('Button').addWithInfo(
Click the "?" mark at top-right to view the info.
- )
+ ),
);
storiesOf('Button').addWithInfo(
@@ -25,7 +25,7 @@ storiesOf('Button').addWithInfo(
This is the basic usage with the button with providing a label to show the text.
`,
() => ,
- { inline: true }
+ { inline: true },
);
storiesOf('Button').addWithInfo(
@@ -34,7 +34,7 @@ storiesOf('Button').addWithInfo(
This is the basic usage with the button with providing a label to show the text.
`,
() => ,
- { source: false, inline: true }
+ { source: false, inline: true },
);
storiesOf('Button').addWithInfo(
@@ -43,7 +43,7 @@ storiesOf('Button').addWithInfo(
This is the basic usage with the button with providing a label to show the text.
`,
() => ,
- { header: false, inline: true }
+ { header: false, inline: true },
);
storiesOf('Button').addWithInfo(
@@ -52,7 +52,7 @@ storiesOf('Button').addWithInfo(
This is the basic usage with the button with providing a label to show the text.
`,
() => ,
- { propTables: false, inline: true }
+ { propTables: false, inline: true },
);
storiesOf('Button').addWithInfo(
@@ -79,7 +79,7 @@ storiesOf('Button').addWithInfo(
),
- { inline: true, propTables: [Button] }
+ { inline: true, propTables: [Button] },
);
storiesOf('Button').addWithInfo(
@@ -109,7 +109,7 @@ storiesOf('Button').addWithInfo(
Click the "?" mark at top-right to view the info.
- )
+ ),
);
storiesOf('Button').addWithInfo(
@@ -132,7 +132,7 @@ storiesOf('Button').addWithInfo(
,
() => ,
- { inline: true }
+ { inline: true },
);
storiesOf('Button')
@@ -149,9 +149,9 @@ storiesOf('Button')
inline: true,
styles: stylesheet => {
stylesheet.infoPage = {
- backgroundColor: '#ccc'
+ backgroundColor: '#ccc',
};
return stylesheet;
- }
- }
+ },
+ },
);
diff --git a/packages/addon-info/src/components/Node.js b/packages/addon-info/src/components/Node.js
index 1f222c01e8c4..c2892317fba7 100644
--- a/packages/addon-info/src/components/Node.js
+++ b/packages/addon-info/src/components/Node.js
@@ -4,8 +4,8 @@ import Props from './Props';
const stylesheet = {
containerStyle: {},
tagStyle: {
- color: '#777'
- }
+ color: '#777',
+ },
};
export default class Node extends React.Component {
@@ -15,7 +15,7 @@ export default class Node extends React.Component {
const leftPad = {
paddingLeft: 3 + (depth + 1) * 15,
- paddingRight: 3
+ paddingRight: 3,
};
Object.assign(containerStyle, leftPad);
@@ -68,7 +68,7 @@ function getData(element) {
const data = {
name: null,
text: null,
- children: null
+ children: null,
};
if (typeof element == 'string') {
diff --git a/packages/addon-info/src/components/PropTable.js b/packages/addon-info/src/components/PropTable.js
index 016e706e6418..7b200a2c751e 100644
--- a/packages/addon-info/src/components/PropTable.js
+++ b/packages/addon-info/src/components/PropTable.js
@@ -16,8 +16,8 @@ const stylesheet = {
propTable: {
marginLeft: -10,
borderSpacing: '10px 5px',
- borderCollapse: 'separate'
- }
+ borderCollapse: 'separate',
+ },
};
export default class PropTable extends React.Component {
@@ -91,5 +91,5 @@ export default class PropTable extends React.Component {
PropTable.displayName = 'PropTable';
PropTable.propTypes = {
- type: PropTypes.func
+ type: PropTypes.func,
};
diff --git a/packages/addon-info/src/components/PropVal.js b/packages/addon-info/src/components/PropVal.js
index d2988998ff13..f03af69feb4b 100644
--- a/packages/addon-info/src/components/PropVal.js
+++ b/packages/addon-info/src/components/PropVal.js
@@ -3,37 +3,37 @@ import createFragment from 'react-addons-create-fragment';
const valueStyles = {
func: {
- color: '#170'
+ color: '#170',
},
attr: {
- color: '#666'
+ color: '#666',
},
object: {
- color: '#666'
+ color: '#666',
},
array: {
- color: '#666'
+ color: '#666',
},
number: {
- color: '#a11'
+ color: '#a11',
},
string: {
color: '#22a',
- wordBreak: 'break-word'
+ wordBreak: 'break-word',
},
bool: {
- color: '#a11'
+ color: '#a11',
},
empty: {
- color: '#777'
- }
+ color: '#777',
+ },
};
function previewArray(val) {
diff --git a/packages/addon-info/src/components/Props.js b/packages/addon-info/src/components/Props.js
index 49050cd43241..ae7c3c835e43 100644
--- a/packages/addon-info/src/components/Props.js
+++ b/packages/addon-info/src/components/Props.js
@@ -4,7 +4,7 @@ import PropVal from './PropVal';
const stylesheet = {
propStyle: {},
propNameStyle: {},
- propValueStyle: {}
+ propValueStyle: {},
};
export default class Props extends React.Component {
@@ -21,7 +21,7 @@ export default class Props extends React.Component {
name =>
name[0] !== '_' &&
name !== 'children' &&
- (!defaultProps || props[name] != defaultProps[name])
+ (!defaultProps || props[name] != defaultProps[name]),
);
const breakIntoNewLines = names.length > 3;
@@ -45,7 +45,7 @@ export default class Props extends React.Component {
}
{i === names.length - 1 && (breakIntoNewLines ?
: endingSpace)}
-
+ ,
);
});
diff --git a/packages/addon-info/src/components/Story.js b/packages/addon-info/src/components/Story.js
index e6534e9c2650..be70e3a1fff0 100644
--- a/packages/addon-info/src/components/Story.js
+++ b/packages/addon-info/src/components/Story.js
@@ -17,13 +17,13 @@ const stylesheet = {
background: '#28c',
color: '#fff',
padding: '5px 15px',
- cursor: 'pointer'
+ cursor: 'pointer',
},
topRight: {
top: 0,
right: 0,
- borderRadius: '0 0 0 5px'
- }
+ borderRadius: '0 0 0 5px',
+ },
},
info: {
position: 'absolute',
@@ -33,54 +33,54 @@ const stylesheet = {
left: 0,
right: 0,
padding: '0 40px',
- overflow: 'auto'
+ overflow: 'auto',
},
children: {
position: 'relative',
- zIndex: 0
+ zIndex: 0,
},
infoBody: {
...baseFonts,
fontWeight: 300,
lineHeight: 1.45,
- fontSize: '15px'
+ fontSize: '15px',
},
infoContent: {
- marginBottom: 0
+ marginBottom: 0,
},
jsxInfoContent: {
borderTop: '1px solid #eee',
- margin: '20px 0 0 0'
+ margin: '20px 0 0 0',
},
header: {
h1: {
margin: 0,
padding: 0,
- fontSize: '35px'
+ fontSize: '35px',
},
h2: {
margin: '0 0 10px 0',
padding: 0,
fontWeight: 400,
- fontSize: '22px'
+ fontSize: '22px',
},
body: {
borderBottom: '1px solid #eee',
paddingTop: 10,
- marginBottom: 10
- }
+ marginBottom: 10,
+ },
},
source: {
h1: {
margin: '20px 0 0 0',
padding: '0 0 5px 0',
fontSize: '25px',
- borderBottom: '1px solid #EEE'
- }
+ borderBottom: '1px solid #EEE',
+ },
},
propTableHead: {
- margin: '20px 0 0 0'
- }
+ margin: '20px 0 0 0',
+ },
};
export default class Story extends React.Component {
@@ -88,14 +88,14 @@ export default class Story extends React.Component {
super(...args);
this.state = {
open: false,
- stylesheet: this.props.styles(JSON.parse(JSON.stringify(stylesheet)))
+ stylesheet: this.props.styles(JSON.parse(JSON.stringify(stylesheet))),
};
MTRC.configure(this.props.mtrcConf);
}
componentWillReceiveProps(nextProps) {
this.setState({
- stylesheet: nextProps.styles(JSON.parse(JSON.stringify(stylesheet)))
+ stylesheet: nextProps.styles(JSON.parse(JSON.stringify(stylesheet))),
});
}
@@ -132,7 +132,7 @@ export default class Story extends React.Component {
_renderOverlay() {
const linkStyle = {
...stylesheet.link.base,
- ...stylesheet.link.topRight
+ ...stylesheet.link.topRight,
};
const infoStyle = Object.assign({}, stylesheet.info);
@@ -316,12 +316,12 @@ Story.propTypes = {
showSource: PropTypes.bool,
styles: PropTypes.func.isRequired,
children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
- mtrcConf: PropTypes.object
+ mtrcConf: PropTypes.object,
};
Story.defaultProps = {
showInline: false,
showHeader: true,
showSource: true,
- mtrcConf: {}
+ mtrcConf: {},
};
diff --git a/packages/addon-info/src/components/markdown/code.js b/packages/addon-info/src/components/markdown/code.js
index 23fe4caea4d8..0e54a1c7fbc8 100644
--- a/packages/addon-info/src/components/markdown/code.js
+++ b/packages/addon-info/src/components/markdown/code.js
@@ -18,7 +18,7 @@ export class Code extends React.Component {
render() {
const codeStyle = {
fontFamily: 'Menlo, Monaco, "Courier New", monospace',
- backgroundColor: '#fafafa'
+ backgroundColor: '#fafafa',
};
const preStyle = {
@@ -26,7 +26,7 @@ export class Code extends React.Component {
backgroundColor: '#fafafa',
padding: '.5rem',
lineHeight: 1.5,
- overflowX: 'scroll'
+ overflowX: 'scroll',
};
const className = this.props.language ? `language-${this.props.language}` : '';
@@ -49,7 +49,7 @@ export class Pre extends React.Component {
backgroundColor: '#fafafa',
padding: '.5rem',
lineHeight: 1.5,
- overflowX: 'scroll'
+ overflowX: 'scroll',
};
return {this.props.children}
;
@@ -62,7 +62,7 @@ export class Blockquote extends React.Component {
fontSize: '1.88em',
fontFamily: 'Menlo, Monaco, "Courier New", monospace',
borderLeft: '8px solid #fafafa',
- padding: '1rem'
+ padding: '1rem',
};
return {this.props.children}
;
diff --git a/packages/addon-info/src/components/markdown/htags.js b/packages/addon-info/src/components/markdown/htags.js
index 554dd6e8509e..0fb0007f5552 100644
--- a/packages/addon-info/src/components/markdown/htags.js
+++ b/packages/addon-info/src/components/markdown/htags.js
@@ -9,7 +9,7 @@ export class H1 extends React.Component {
fontWeight: 600,
margin: 0,
padding: 0,
- fontSize: '40px'
+ fontSize: '40px',
};
return {this.props.children}
;
@@ -23,7 +23,7 @@ export class H2 extends React.Component {
fontWeight: 600,
margin: 0,
padding: 0,
- fontSize: '30px'
+ fontSize: '30px',
};
return {this.props.children}
;
@@ -38,7 +38,7 @@ export class H3 extends React.Component {
margin: 0,
padding: 0,
fontSize: '22px',
- textTransform: 'uppercase'
+ textTransform: 'uppercase',
};
return {this.props.children}
;
@@ -52,7 +52,7 @@ export class H4 extends React.Component {
fontWeight: 600,
margin: 0,
padding: 0,
- fontSize: '20px'
+ fontSize: '20px',
};
return {this.props.children}
;
@@ -66,7 +66,7 @@ export class H5 extends React.Component {
fontWeight: 600,
margin: 0,
padding: 0,
- fontSize: '18px'
+ fontSize: '18px',
};
return {this.props.children}
;
@@ -80,7 +80,7 @@ export class H6 extends React.Component {
fontWeight: 400,
margin: 0,
padding: 0,
- fontSize: '18px'
+ fontSize: '18px',
};
return {this.props.children}
;
diff --git a/packages/addon-info/src/components/markdown/text.js b/packages/addon-info/src/components/markdown/text.js
index 08481dd98615..58f35c18e9bc 100644
--- a/packages/addon-info/src/components/markdown/text.js
+++ b/packages/addon-info/src/components/markdown/text.js
@@ -5,7 +5,7 @@ export class P extends React.Component {
render() {
const style = {
...baseFonts,
- fontSize: '15px'
+ fontSize: '15px',
};
return {this.props.children}
;
}
@@ -15,7 +15,7 @@ export class LI extends React.Component {
render() {
const style = {
...baseFonts,
- fontSize: '15px'
+ fontSize: '15px',
};
return {this.props.children};
}
@@ -25,7 +25,7 @@ export class UL extends React.Component {
render() {
const style = {
...baseFonts,
- fontSize: '15px'
+ fontSize: '15px',
};
return ;
@@ -35,7 +35,7 @@ export class UL extends React.Component {
export class A extends React.Component {
render() {
const style = {
- color: '#3498db'
+ color: '#3498db',
};
return {this.props.children};
diff --git a/packages/addon-info/src/components/theme.js b/packages/addon-info/src/components/theme.js
index 6718b96700fc..ac246549cde8 100644
--- a/packages/addon-info/src/components/theme.js
+++ b/packages/addon-info/src/components/theme.js
@@ -4,5 +4,5 @@ export const baseFonts = {
"Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif
`,
color: '#444',
- WebkitFontSmoothing: 'antialiased'
+ WebkitFontSmoothing: 'antialiased',
};
diff --git a/packages/addon-info/src/index.js b/packages/addon-info/src/index.js
index b33632dacc49..a2f6f78081c3 100644
--- a/packages/addon-info/src/index.js
+++ b/packages/addon-info/src/index.js
@@ -7,7 +7,7 @@ const defaultOptions = {
inline: false,
header: true,
source: true,
- propTables: []
+ propTables: [],
};
const defaultMtrcConf = {
@@ -21,7 +21,7 @@ const defaultMtrcConf = {
p: P,
a: A,
li: LI,
- ul: UL
+ ul: UL,
};
export default {
@@ -38,7 +38,7 @@ export default {
const options = {
...defaultOptions,
- ..._options
+ ..._options,
};
// props.propTables can only be either an array of components or null
@@ -62,7 +62,7 @@ export default {
showSource: Boolean(options.source),
propTables: options.propTables,
styles: typeof options.styles === 'function' ? options.styles : s => s,
- mtrcConf
+ mtrcConf,
};
return (
@@ -71,7 +71,7 @@ export default {
);
});
- }
+ },
};
export function setDefaults(newDefaults) {
diff --git a/packages/addon-knobs/example/stories/index.js b/packages/addon-knobs/example/stories/index.js
index b2a3759431c1..c0c9e8c0676d 100644
--- a/packages/addon-knobs/example/stories/index.js
+++ b/packages/addon-knobs/example/stories/index.js
@@ -22,14 +22,14 @@ stories.add('with all knobs', () => {
const customStyle = object('Style', {
fontFamily: 'Arial',
- padding: 20
+ padding: 20,
});
const style = {
...customStyle,
fontWeight: bold ? 800 : 400,
favoriteNumber,
- color: selectedColor
+ color: selectedColor,
};
return (
diff --git a/packages/addon-knobs/src/KnobManager.js b/packages/addon-knobs/src/KnobManager.js
index 41a3e6668283..fb83c872fa4b 100644
--- a/packages/addon-knobs/src/KnobManager.js
+++ b/packages/addon-knobs/src/KnobManager.js
@@ -28,7 +28,7 @@ export default class KnobManager {
const knobInfo = {
...options,
name,
- defaultValue
+ defaultValue,
};
knobStore.set(name, knobInfo);
@@ -41,7 +41,7 @@ export default class KnobManager {
let knobStore = this.knobStoreMap[key];
if (!knobStore) {
- knobStore = (this.knobStoreMap[key] = new KnobStore());
+ knobStore = this.knobStoreMap[key] = new KnobStore();
}
this.knobStore = knobStore;
@@ -66,13 +66,10 @@ export default class KnobManager {
}
this.calling = true;
- setTimeout(
- () => {
- this.calling = false;
- // emit to the channel and trigger a panel re-render
- this.channel.emit('addon:knobs:setKnobs', this.knobStore.getAll());
- },
- PANEL_UPDATE_INTERVAL
- );
+ setTimeout(() => {
+ this.calling = false;
+ // emit to the channel and trigger a panel re-render
+ this.channel.emit('addon:knobs:setKnobs', this.knobStore.getAll());
+ }, PANEL_UPDATE_INTERVAL);
}
}
diff --git a/packages/addon-knobs/src/components/Panel.js b/packages/addon-knobs/src/components/Panel.js
index 4771181693a7..1ac699a1ffd1 100644
--- a/packages/addon-knobs/src/components/Panel.js
+++ b/packages/addon-knobs/src/components/Panel.js
@@ -5,12 +5,12 @@ import Types from './types';
const styles = {
panelWrapper: {
- width: '100%'
+ width: '100%',
},
panel: {
padding: '5px',
width: 'auto',
- position: 'relative'
+ position: 'relative',
},
noKnobs: {
fontFamily: `
@@ -21,7 +21,7 @@ const styles = {
width: '100%',
textAlign: 'center',
color: 'rgb(190, 190, 190)',
- padding: '10px'
+ padding: '10px',
},
resetButton: {
position: 'absolute',
@@ -34,8 +34,8 @@ const styles = {
padding: '5px 10px',
borderRadius: '4px 0 0 0',
color: 'rgba(0, 0, 0, 0.5)',
- outline: 'none'
- }
+ outline: 'none',
+ },
};
export default class Panel extends React.Component {
@@ -90,7 +90,7 @@ export default class Panel extends React.Component {
const newKnobs = { ...knobs };
newKnobs[name] = {
...newKnobs[name],
- ...changedKnob
+ ...changedKnob,
};
this.setState({ knobs: newKnobs });
@@ -124,5 +124,5 @@ export default class Panel extends React.Component {
Panel.propTypes = {
channel: PropTypes.object,
onReset: PropTypes.object,
- api: PropTypes.object
+ api: PropTypes.object,
};
diff --git a/packages/addon-knobs/src/components/PropField.js b/packages/addon-knobs/src/components/PropField.js
index 80f65c6271c6..32f5aa01ac43 100644
--- a/packages/addon-knobs/src/components/PropField.js
+++ b/packages/addon-knobs/src/components/PropField.js
@@ -7,7 +7,7 @@ const InvalidType = () => Invalid Type;
const stylesheet = {
field: {
display: 'table-row',
- padding: '5px'
+ padding: '5px',
},
label: {
display: 'table-cell',
@@ -20,18 +20,18 @@ const stylesheet = {
fontSize: 10,
color: 'rgb(68, 68, 68)',
textTransform: 'uppercase',
- fontWeight: 600
- }
+ fontWeight: 600,
+ },
};
stylesheet.textarea = {
...stylesheet.input,
- height: '100px'
+ height: '100px',
};
stylesheet.checkbox = {
...stylesheet.input,
- width: 'auto'
+ width: 'auto',
};
export default class PropField extends React.Component {
@@ -62,5 +62,5 @@ export default class PropField extends React.Component {
PropField.propTypes = {
onChange: PropTypes.func.isRequired,
- knob: PropTypes.object
+ knob: PropTypes.object,
};
diff --git a/packages/addon-knobs/src/components/PropForm.js b/packages/addon-knobs/src/components/PropForm.js
index 7a14c0cdcf2e..19a92f055741 100644
--- a/packages/addon-knobs/src/components/PropForm.js
+++ b/packages/addon-knobs/src/components/PropForm.js
@@ -13,8 +13,8 @@ const stylesheet = {
boxSizing: 'border-box',
width: '100%',
borderCollapse: 'separate',
- borderSpacing: '5px'
- }
+ borderSpacing: '5px',
+ },
};
export default class propForm extends React.Component {
@@ -52,5 +52,5 @@ propForm.displayName = 'propForm';
propForm.propTypes = {
knobs: PropTypes.array.isRequired,
- onFieldChange: PropTypes.func.isRequired
+ onFieldChange: PropTypes.func.isRequired,
};
diff --git a/packages/addon-knobs/src/components/WrapStory.js b/packages/addon-knobs/src/components/WrapStory.js
index 12d4d78400ad..1293a070ec86 100644
--- a/packages/addon-knobs/src/components/WrapStory.js
+++ b/packages/addon-knobs/src/components/WrapStory.js
@@ -65,5 +65,5 @@ WrapStory.propTypes = {
storyFn: PropTypes.func,
channel: PropTypes.object,
knobStore: PropTypes.object,
- initialContent: PropTypes.object
+ initialContent: PropTypes.object,
};
diff --git a/packages/addon-knobs/src/components/tests/Array.js b/packages/addon-knobs/src/components/tests/Array.js
index b6840f3fc09b..bd5c6971af5c 100644
--- a/packages/addon-knobs/src/components/tests/Array.js
+++ b/packages/addon-knobs/src/components/tests/Array.js
@@ -12,7 +12,7 @@ describe('Array', () => {
+ />,
);
wrapper.simulate('change', { target: { value: 'Fhishing,Skiing,Dancing' } });
diff --git a/packages/addon-knobs/src/components/tests/Panel.js b/packages/addon-knobs/src/components/tests/Panel.js
index 39a4d5fe898d..a53d9d9b4913 100644
--- a/packages/addon-knobs/src/components/tests/Panel.js
+++ b/packages/addon-knobs/src/components/tests/Panel.js
@@ -20,17 +20,17 @@ describe('Panel', () => {
on: (e, handler) => {
handlers[e] = handler;
},
- emit: sinon.spy()
+ emit: sinon.spy(),
};
const testQueryParams = {
'knob-foo': 'test string',
- bar: 'some other string'
+ bar: 'some other string',
};
const testApi = {
getQueryParam: key => testQueryParams[key],
- setQueryParams: sinon.spy()
+ setQueryParams: sinon.spy(),
};
shallow();
@@ -40,20 +40,20 @@ describe('Panel', () => {
foo: {
name: 'foo',
value: 'default string',
- type: 'text'
+ type: 'text',
},
baz: {
name: 'baz',
value: 'another knob value',
- type: 'text'
- }
+ type: 'text',
+ },
};
setKnobsHandler(knobs);
const knobFromUrl = {
name: 'foo',
value: testQueryParams['knob-foo'],
- type: 'text'
+ type: 'text',
};
const e = 'addon:knobs:knobChange';
expect(testChannel.emit.calledWith(e, knobFromUrl)).to.equal(true);
@@ -66,17 +66,17 @@ describe('Panel', () => {
on: (e, handler) => {
handlers[e] = handler;
},
- emit: sinon.spy()
+ emit: sinon.spy(),
};
const testQueryParams = {
'knob-foo': 'test string',
- bar: 'some other string'
+ bar: 'some other string',
};
const testApi = {
getQueryParam: key => testQueryParams[key],
- setQueryParams: sinon.spy()
+ setQueryParams: sinon.spy(),
};
const wrapper = shallow();
@@ -86,13 +86,13 @@ describe('Panel', () => {
foo: {
name: 'foo',
value: 'default string',
- type: 'text'
+ type: 'text',
},
baz: {
name: 'baz',
value: 'another knob value',
- type: 'text'
- }
+ type: 'text',
+ },
};
// Make it act like that url params are already checked
@@ -101,7 +101,7 @@ describe('Panel', () => {
setKnobsHandler(knobs);
const knobFromStory = {
'knob-foo': knobs.foo.value,
- 'knob-baz': knobs.baz.value
+ 'knob-baz': knobs.baz.value,
};
expect(testApi.setQueryParams.calledWith(knobFromStory)).to.equal(true);
@@ -112,12 +112,12 @@ describe('Panel', () => {
it('should set queryParams and emit knobChange event', () => {
const testChannel = {
on: sinon.spy(),
- emit: sinon.spy()
+ emit: sinon.spy(),
};
const testApi = {
getQueryParam: sinon.spy(),
- setQueryParams: sinon.spy()
+ setQueryParams: sinon.spy(),
};
const wrapper = shallow();
@@ -125,7 +125,7 @@ describe('Panel', () => {
const testChangedKnob = {
name: 'foo',
value: 'changed text',
- type: 'text'
+ type: 'text',
};
wrapper.instance().handleChange(testChangedKnob);
expect(testChannel.emit.calledWith('addon:knobs:knobChange', testChangedKnob)).to.equal(true);
diff --git a/packages/addon-knobs/src/components/types/Array.js b/packages/addon-knobs/src/components/types/Array.js
index 54952ac2accf..259a9bec4093 100644
--- a/packages/addon-knobs/src/components/types/Array.js
+++ b/packages/addon-knobs/src/components/types/Array.js
@@ -13,7 +13,7 @@ const styles = {
borderRadius: 2,
fontSize: 11,
padding: '5px',
- color: '#555'
+ color: '#555',
};
class ArrayType extends React.Component {
@@ -33,7 +33,7 @@ class ArrayType extends React.Component {
ArrayType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
ArrayType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Boolean.js b/packages/addon-knobs/src/components/types/Boolean.js
index a1a73100524d..ea261e5cfca0 100644
--- a/packages/addon-knobs/src/components/types/Boolean.js
+++ b/packages/addon-knobs/src/components/types/Boolean.js
@@ -9,7 +9,7 @@ const styles = {
outline: 'none',
border: '1px solid #ececec',
fontSize: '12px',
- color: '#555'
+ color: '#555',
};
class BooleanType extends React.Component {
@@ -31,7 +31,7 @@ class BooleanType extends React.Component {
BooleanType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
BooleanType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Color.js b/packages/addon-knobs/src/components/types/Color.js
index 508f308dd96b..04c82af7574e 100644
--- a/packages/addon-knobs/src/components/types/Color.js
+++ b/packages/addon-knobs/src/components/types/Color.js
@@ -9,19 +9,19 @@ const styles = {
border: '1px solid rgb(247, 244, 244)',
display: 'inline-block',
cursor: 'pointer',
- width: '100%'
+ width: '100%',
},
popover: {
position: 'absolute',
- zIndex: '2'
+ zIndex: '2',
},
cover: {
position: 'fixed',
top: '0px',
right: '0px',
bottom: '0px',
- left: '0px'
- }
+ left: '0px',
+ },
};
class ColorType extends React.Component {
@@ -30,7 +30,7 @@ class ColorType extends React.Component {
this.handleClick = this.handleClick.bind(this);
this.onWindowMouseDown = this.onWindowMouseDown.bind(this);
this.state = {
- displayColorPicker: false
+ displayColorPicker: false,
};
}
@@ -46,13 +46,13 @@ class ColorType extends React.Component {
if (this.popover.contains(e.target)) return;
this.setState({
- displayColorPicker: false
+ displayColorPicker: false,
});
}
handleClick() {
this.setState({
- displayColorPicker: !this.state.displayColorPicker
+ displayColorPicker: !this.state.displayColorPicker,
});
}
@@ -63,7 +63,7 @@ class ColorType extends React.Component {
height: '20px',
borderRadius: '2px',
margin: 5,
- background: knob.value
+ background: knob.value,
};
return (
@@ -87,7 +87,7 @@ class ColorType extends React.Component {
ColorType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
ColorType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Date/index.js b/packages/addon-knobs/src/components/types/Date/index.js
index 9e72accadfb4..e7ad0197c9e8 100644
--- a/packages/addon-knobs/src/components/types/Date/index.js
+++ b/packages/addon-knobs/src/components/types/Date/index.js
@@ -39,7 +39,7 @@ class DateType extends React.Component {
DateType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
DateType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Number.js b/packages/addon-knobs/src/components/types/Number.js
index a59db85276bb..211d9403edbc 100644
--- a/packages/addon-knobs/src/components/types/Number.js
+++ b/packages/addon-knobs/src/components/types/Number.js
@@ -12,7 +12,7 @@ const styles = {
borderRadius: 2,
fontSize: 11,
padding: '5px',
- color: '#444'
+ color: '#444',
};
class NumberType extends React.Component {
@@ -64,7 +64,7 @@ class NumberType extends React.Component {
NumberType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
NumberType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Object.js b/packages/addon-knobs/src/components/types/Object.js
index 30c5e36c382a..f08aab7aa0a6 100644
--- a/packages/addon-knobs/src/components/types/Object.js
+++ b/packages/addon-knobs/src/components/types/Object.js
@@ -14,7 +14,7 @@ const styles = {
fontSize: 11,
padding: '5px',
color: '#555',
- fontFamily: 'monospace'
+ fontFamily: 'monospace',
};
class ObjectType extends React.Component {
@@ -42,7 +42,7 @@ class ObjectType extends React.Component {
handleChange(e) {
const { onChange } = this.props;
const newState = {
- jsonString: e.target.value
+ jsonString: e.target.value,
};
try {
@@ -80,7 +80,7 @@ class ObjectType extends React.Component {
ObjectType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
ObjectType.serialize = function(object) {
diff --git a/packages/addon-knobs/src/components/types/Select.js b/packages/addon-knobs/src/components/types/Select.js
index 65e9dc4a97aa..3198f9db9a10 100644
--- a/packages/addon-knobs/src/components/types/Select.js
+++ b/packages/addon-knobs/src/components/types/Select.js
@@ -12,14 +12,14 @@ const styles = {
borderRadius: 2,
fontSize: 11,
padding: '5px',
- color: '#555'
+ color: '#555',
};
class SelectType extends React.Component {
_makeOpt(key, val) {
const opts = {
key,
- value: key
+ value: key,
};
return
;
@@ -53,7 +53,7 @@ class SelectType extends React.Component {
SelectType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
SelectType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/Text.js b/packages/addon-knobs/src/components/types/Text.js
index f62b722f052b..f1ebb3fb6e5a 100644
--- a/packages/addon-knobs/src/components/types/Text.js
+++ b/packages/addon-knobs/src/components/types/Text.js
@@ -13,7 +13,7 @@ const styles = {
borderRadius: 2,
fontSize: 11,
padding: '5px',
- color: '#555'
+ color: '#555',
};
class TextType extends React.Component {
@@ -34,7 +34,7 @@ class TextType extends React.Component {
TextType.propTypes = {
knob: PropTypes.object,
- onChange: PropTypes.func
+ onChange: PropTypes.func,
};
TextType.serialize = function(value) {
diff --git a/packages/addon-knobs/src/components/types/index.js b/packages/addon-knobs/src/components/types/index.js
index c5f43454a4b4..a74e2459eaa6 100644
--- a/packages/addon-knobs/src/components/types/index.js
+++ b/packages/addon-knobs/src/components/types/index.js
@@ -15,5 +15,5 @@ export default {
object: ObjectType,
select: SelectType,
array: ArrayType,
- date: DateType
+ date: DateType,
};
diff --git a/packages/addon-knobs/src/index.js b/packages/addon-knobs/src/index.js
index 497a6dad48ae..3ee0100bdb25 100644
--- a/packages/addon-knobs/src/index.js
+++ b/packages/addon-knobs/src/index.js
@@ -20,7 +20,7 @@ export function number(name, value, options = {}) {
range: false,
min: 0,
max: 10,
- step: 1
+ step: 1,
};
const mergedOptions = { ...defaults, ...options };
@@ -28,7 +28,7 @@ export function number(name, value, options = {}) {
const finalOptions = {
...mergedOptions,
type: 'number',
- value
+ value,
};
return manager.knob(name, finalOptions);
diff --git a/packages/addon-knobs/src/register.js b/packages/addon-knobs/src/register.js
index e5debc682142..82a6ef9b2617 100644
--- a/packages/addon-knobs/src/register.js
+++ b/packages/addon-knobs/src/register.js
@@ -7,6 +7,6 @@ addons.register('kadirahq/storybook-addon-knobs', api => {
addons.addPanel('kadirahq/storybook-addon-knobs', {
title: 'Knobs',
- render: () =>
+ render: () =>
,
});
});
diff --git a/packages/addon-knobs/src/tests/KnobManager.js b/packages/addon-knobs/src/tests/KnobManager.js
index 2eed7384da9c..7e248d081284 100644
--- a/packages/addon-knobs/src/tests/KnobManager.js
+++ b/packages/addon-knobs/src/tests/KnobManager.js
@@ -16,15 +16,15 @@ describe('KnobManager', () => {
get: () => ({
defaultValue: 'default value',
value: 'current value',
- name: 'foo'
- })
+ name: 'foo',
+ }),
};
});
it('should return the existing knob value when defaults match', () => {
const defaultKnob = {
name: 'foo',
- value: 'default value'
+ value: 'default value',
};
const knob = testManager.knob('foo', defaultKnob);
expect(knob).to.equal('current value');
@@ -34,13 +34,13 @@ describe('KnobManager', () => {
it('should return the new default knob value when default has changed', () => {
const defaultKnob = {
name: 'foo',
- value: 'changed default value'
+ value: 'changed default value',
};
testManager.knob('foo', defaultKnob);
const newKnob = {
...defaultKnob,
- defaultValue: defaultKnob.value
+ defaultValue: defaultKnob.value,
};
expect(testManager.knobStore.set.calledWith('foo', newKnob)).to.equal(true);
@@ -53,7 +53,7 @@ describe('KnobManager', () => {
beforeEach(() => {
testManager.knobStore = {
set: sinon.spy(),
- get: sinon.stub()
+ get: sinon.stub(),
};
testManager.knobStore.get.onFirstCall().returns(undefined);
@@ -63,13 +63,13 @@ describe('KnobManager', () => {
it('should return the new default knob value when default has changed', () => {
const defaultKnob = {
name: 'foo',
- value: 'normal value'
+ value: 'normal value',
};
testManager.knob('foo', defaultKnob);
const newKnob = {
...defaultKnob,
- defaultValue: defaultKnob.value
+ defaultValue: defaultKnob.value,
};
expect(testManager.knobStore.set.calledWith('foo', newKnob)).to.equal(true);
@@ -85,7 +85,7 @@ describe('KnobManager', () => {
const testStory = () =>
Test Content
;
const testContext = {
kind: 'Foo',
- story: 'bar baz'
+ story: 'bar baz',
};
const wrappedStory = testManager.wrapStory(testChannel, testStory, testContext);
const wrapper = shallow(wrappedStory);
diff --git a/packages/addon-knobs/src/tests/typescript.js b/packages/addon-knobs/src/tests/typescript.js
index 4fbe9c79e58c..c8ebe6406be6 100644
--- a/packages/addon-knobs/src/tests/typescript.js
+++ b/packages/addon-knobs/src/tests/typescript.js
@@ -9,7 +9,7 @@ describe('TypeScript definitions', function() {
tt.compileDirectory(
`${__dirname}/../../example/typescript`,
fileName => fileName.match(/\.ts$/),
- () => done()
+ () => done(),
);
});
});
diff --git a/packages/channel/src/__tests__/index.js b/packages/channel/src/__tests__/index.js
index 20984256652e..245f429bbf96 100644
--- a/packages/channel/src/__tests__/index.js
+++ b/packages/channel/src/__tests__/index.js
@@ -76,7 +76,7 @@ describe('Channel', () => {
channel.on('type-2', 22);
const expected = {
'type-1': [11],
- 'type-2': [21, 22]
+ 'type-2': [21, 22],
};
expect(channel._listeners).to.deep.equal(expected);
});
@@ -115,7 +115,7 @@ describe('Channel', () => {
channel.prependListener('type-2', 22);
const expected = {
'type-1': [11],
- 'type-2': [22, 21]
+ 'type-2': [22, 21],
};
expect(channel._listeners).to.deep.equal(expected);
});
@@ -164,7 +164,7 @@ describe('Channel', () => {
channel.on('type-2', 22);
const expected = {
'type-1': [11],
- 'type-2': [21]
+ 'type-2': [21],
};
channel.removeListener('type-2', 22);
expect(channel._listeners).to.deep.equal(expected);
diff --git a/packages/decorator-centered/src/index.js b/packages/decorator-centered/src/index.js
index 125a18aa97bd..2761bdfa615a 100644
--- a/packages/decorator-centered/src/index.js
+++ b/packages/decorator-centered/src/index.js
@@ -8,7 +8,7 @@ const style = {
right: 0,
display: 'flex',
alignItems: 'center',
- justifyContent: 'center'
+ justifyContent: 'center',
};
export default function(storyFn) {
diff --git a/packages/getstorybook/bin/generate.js b/packages/getstorybook/bin/generate.js
index ad0615ab1615..8d4ee4f131b0 100755
--- a/packages/getstorybook/bin/generate.js
+++ b/packages/getstorybook/bin/generate.js
@@ -28,7 +28,7 @@ logger.log(chalk.inverse(`\n ${welcomeMessage} \n`));
const useYarn = Boolean(program.useNpm !== true) && hasYarn();
const npmOptions = {
- useYarn
+ useYarn,
};
const runStorybookCommand = useYarn ? 'yarn run storybook' : 'npm run storybook';
@@ -36,7 +36,7 @@ const runStorybookCommand = useYarn ? 'yarn run storybook' : 'npm run storybook'
// Update notify code.
updateNotifier({
pkg,
- updateCheckInterval: 1000 * 60 * 60 // every hour (we could increase this later on.)
+ updateCheckInterval: 1000 * 60 * 60, // every hour (we could increase this later on.)
}).notify();
let projectType;
@@ -44,7 +44,7 @@ let projectType;
let done = commandLog('Detecting project type');
try {
projectType = detect({
- force: program.force
+ force: program.force,
});
} catch (ex) {
done(ex.message);
diff --git a/packages/getstorybook/generators/METEOR/index.js b/packages/getstorybook/generators/METEOR/index.js
index 491dd20568d3..f6f9a54254f4 100644
--- a/packages/getstorybook/generators/METEOR/index.js
+++ b/packages/getstorybook/generators/METEOR/index.js
@@ -26,7 +26,7 @@ if (fs.existsSync('.babelrc')) {
} else {
babelrc = {
presets: ['es2015', 'es2016', 'react', 'stage-1'],
- plugins: ['babel-root-slash-import']
+ plugins: ['babel-root-slash-import'],
};
packageJson.devDependencies['babel-preset-es2015'] = '^6.9.0';
diff --git a/packages/getstorybook/generators/REACT/template/stories/Button.js b/packages/getstorybook/generators/REACT/template/stories/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/getstorybook/generators/REACT/template/stories/Button.js
+++ b/packages/getstorybook/generators/REACT/template/stories/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/getstorybook/generators/REACT/template/stories/Welcome.js b/packages/getstorybook/generators/REACT/template/stories/Welcome.js
index 6f0ca488aeb7..4e9ee8eb7317 100644
--- a/packages/getstorybook/generators/REACT/template/stories/Welcome.js
+++ b/packages/getstorybook/generators/REACT/template/stories/Welcome.js
@@ -5,18 +5,18 @@ const styles = {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
- fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif'
+ fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
- width: 200
+ width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
- paddingBottom: 2
+ paddingBottom: 2,
},
code: {
@@ -26,8 +26,8 @@ const styles = {
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
- color: '#3a3a3a'
- }
+ color: '#3a3a3a',
+ },
};
export default class Welcome extends React.Component {
diff --git a/packages/getstorybook/generators/REACT_NATIVE/index.js b/packages/getstorybook/generators/REACT_NATIVE/index.js
index 455e8bb3bd7b..00e9c7cfdae0 100644
--- a/packages/getstorybook/generators/REACT_NATIVE/index.js
+++ b/packages/getstorybook/generators/REACT_NATIVE/index.js
@@ -8,8 +8,8 @@ mergeDirs(path.resolve(__dirname, 'template/'), '.', 'overwrite');
// set correct project name on entry files if possible
const dirname = shell.ls('-d', 'ios/*.xcodeproj').stdout;
-const projectName = dirname &&
- dirname.slice('ios/'.length, dirname.length - '.xcodeproj'.length - 1);
+const projectName =
+ dirname && dirname.slice('ios/'.length, dirname.length - '.xcodeproj'.length - 1);
if (projectName) {
shell.sed('-i', '%APP_NAME%', projectName, 'storybook/index.ios.js');
shell.sed('-i', '%APP_NAME%', projectName, 'storybook/index.android.js');
diff --git a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.android.js b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.android.js
index b36980fe6bef..0dc3a5a82b86 100644
--- a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.android.js
+++ b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.android.js
@@ -2,12 +2,9 @@ import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@kadira/react-native-storybook';
// import stories
-configure(
- () => {
- require('./stories');
- },
- module
-);
+configure(() => {
+ require('./stories');
+}, module);
const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' });
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI);
diff --git a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.ios.js b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.ios.js
index b36980fe6bef..0dc3a5a82b86 100644
--- a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.ios.js
+++ b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/index.ios.js
@@ -2,12 +2,9 @@ import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@kadira/react-native-storybook';
// import stories
-configure(
- () => {
- require('./stories');
- },
- module
-);
+configure(() => {
+ require('./stories');
+}, module);
const StorybookUI = getStorybookUI({ port: 7007, host: 'localhost' });
AppRegistry.registerComponent('%APP_NAME%', () => StorybookUI);
diff --git a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/CenterView/style.js b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/CenterView/style.js
index f34efdca9f79..ff347fd9841f 100644
--- a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/CenterView/style.js
+++ b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/CenterView/style.js
@@ -3,6 +3,6 @@ export default {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
- backgroundColor: '#F5FCFF'
- }
+ backgroundColor: '#F5FCFF',
+ },
};
diff --git a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js
index 8c9e331ce277..2305b830c30f 100644
--- a/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js
+++ b/packages/getstorybook/generators/REACT_NATIVE/template/storybook/stories/Welcome/index.js
@@ -6,17 +6,17 @@ export default class Welcome extends React.Component {
wrapper: {
flex: 1,
padding: 24,
- justifyContent: 'center'
+ justifyContent: 'center',
},
header: {
fontSize: 18,
- marginBottom: 18
+ marginBottom: 18,
},
content: {
fontSize: 12,
marginBottom: 10,
- lineHeight: 18
- }
+ lineHeight: 18,
+ },
};
showApp(e) {
diff --git a/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Button.js b/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Button.js
+++ b/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Welcome.js b/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Welcome.js
index 2bd4462940ce..2b20b2a1b4a4 100644
--- a/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Welcome.js
+++ b/packages/getstorybook/generators/REACT_SCRIPTS/template/src/stories/Welcome.js
@@ -5,18 +5,18 @@ const styles = {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
- fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif'
+ fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
- width: 200
+ width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
- paddingBottom: 2
+ paddingBottom: 2,
},
code: {
@@ -26,14 +26,14 @@ const styles = {
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
- color: '#3a3a3a'
+ color: '#3a3a3a',
},
codeBlock: {
backgroundColor: '#f3f2f2',
padding: '1px 10px',
- margin: '10px 0'
- }
+ margin: '10px 0',
+ },
};
const codeBlock = `
diff --git a/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Button.js b/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Button.js
+++ b/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Welcome.js b/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Welcome.js
index c1a504ea7458..acd48b6409bc 100644
--- a/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Welcome.js
+++ b/packages/getstorybook/generators/WEBPACK_REACT/template/stories/Welcome.js
@@ -5,18 +5,18 @@ const styles = {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
- fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif'
+ fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
- width: 200
+ width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
- paddingBottom: 2
+ paddingBottom: 2,
},
code: {
@@ -26,12 +26,12 @@ const styles = {
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
- color: '#3a3a3a'
+ color: '#3a3a3a',
},
note: {
- opacity: 0.5
- }
+ opacity: 0.5,
+ },
};
export default class Welcome extends React.Component {
diff --git a/packages/getstorybook/lib/project_types.js b/packages/getstorybook/lib/project_types.js
index c70204d67c4d..1c3bbe537434 100644
--- a/packages/getstorybook/lib/project_types.js
+++ b/packages/getstorybook/lib/project_types.js
@@ -6,5 +6,5 @@ module.exports = {
REACT_NATIVE: 'REACT_NATIVE',
REACT_PROJECT: 'REACT_PROJECT',
WEBPACK_REACT: 'WEBPACK_REACT',
- ALREADY_HAS_STORYBOOK: 'ALREADY_HAS_STORYBOOK'
+ ALREADY_HAS_STORYBOOK: 'ALREADY_HAS_STORYBOOK',
};
diff --git a/packages/getstorybookio/src/components/Docs/Container/index.js b/packages/getstorybookio/src/components/Docs/Container/index.js
index 504a601ad89b..eb2fbb549ae9 100644
--- a/packages/getstorybookio/src/components/Docs/Container/index.js
+++ b/packages/getstorybookio/src/components/Docs/Container/index.js
@@ -24,7 +24,7 @@ class Container extends React.Component {
sections,
selectedItem,
selectedSectionId,
- selectedItemId
+ selectedItemId,
} = this.props;
const gitHubRepoUrl = 'https://github.com/kadirahq/getstorybook.io';
@@ -87,7 +87,7 @@ Container.propTypes = {
sections: PropTypes.array,
selectedItem: PropTypes.object,
selectedSectionId: PropTypes.string,
- selectedItemId: PropTypes.string
+ selectedItemId: PropTypes.string,
};
export default Container;
diff --git a/packages/getstorybookio/src/components/Docs/Content/index.js b/packages/getstorybookio/src/components/Docs/Content/index.js
index ff6e2be60e6b..2f8d533e87f5 100644
--- a/packages/getstorybookio/src/components/Docs/Content/index.js
+++ b/packages/getstorybookio/src/components/Docs/Content/index.js
@@ -13,7 +13,7 @@ marked.setOptions({
pedantic: false,
sanitize: false,
smartLists: true,
- smartypants: false
+ smartypants: false,
});
const DocsContent = ({ title, content, editUrl }) => (
@@ -34,7 +34,7 @@ const DocsContent = ({ title, content, editUrl }) => (
DocsContent.propTypes = {
title: PropTypes.string,
content: PropTypes.string.isRequired,
- editUrl: PropTypes.string
+ editUrl: PropTypes.string,
};
export default DocsContent;
diff --git a/packages/getstorybookio/src/components/Docs/Nav/dropdown.js b/packages/getstorybookio/src/components/Docs/Nav/dropdown.js
index 7cad4ea8f10a..25b24a07025e 100644
--- a/packages/getstorybookio/src/components/Docs/Nav/dropdown.js
+++ b/packages/getstorybookio/src/components/Docs/Nav/dropdown.js
@@ -58,7 +58,7 @@ Nav.propTypes = {
selectedCatId: PropTypes.string,
sections: PropTypes.array,
selectedSection: PropTypes.string,
- selectedItem: PropTypes.string
+ selectedItem: PropTypes.string,
};
export default Nav;
diff --git a/packages/getstorybookio/src/components/Docs/Nav/index.js b/packages/getstorybookio/src/components/Docs/Nav/index.js
index a118dd08103e..35d8906cd3a1 100644
--- a/packages/getstorybookio/src/components/Docs/Nav/index.js
+++ b/packages/getstorybookio/src/components/Docs/Nav/index.js
@@ -44,7 +44,7 @@ Nav.propTypes = {
selectedCatId: PropTypes.string,
sections: PropTypes.array,
selectedItem: PropTypes.string,
- prefix: PropTypes.string
+ prefix: PropTypes.string,
};
export default Nav;
diff --git a/packages/getstorybookio/src/components/Docs/Navigation/index.js b/packages/getstorybookio/src/components/Docs/Navigation/index.js
index 828d42a3cd60..54c6a91bf3d8 100644
--- a/packages/getstorybookio/src/components/Docs/Navigation/index.js
+++ b/packages/getstorybookio/src/components/Docs/Navigation/index.js
@@ -6,7 +6,7 @@ import { Link } from 'react-router';
class Navigation extends React.Component {
renderHeading(caption) {
const style = {
- ...styles.h3
+ ...styles.h3,
};
return
{caption}
;
@@ -53,7 +53,7 @@ Navigation.propTypes = {
sections: PropTypes.array,
selectedSection: PropTypes.string,
selectedItem: PropTypes.string,
- prefix: PropTypes.string
+ prefix: PropTypes.string,
};
export default Navigation;
diff --git a/packages/getstorybookio/src/components/Docs/Navigation/styles.js b/packages/getstorybookio/src/components/Docs/Navigation/styles.js
index 2400cd2dc990..f1ab365cf157 100644
--- a/packages/getstorybookio/src/components/Docs/Navigation/styles.js
+++ b/packages/getstorybookio/src/components/Docs/Navigation/styles.js
@@ -5,36 +5,36 @@ const styles = {
...theme.base,
...theme.text,
borderRight: '1px solid #ECECEC',
- marginRight: 30
+ marginRight: 30,
},
h3: {
color: '#000',
margin: '25px 0 7px 0',
padding: 0,
- fontSize: 20
+ fontSize: 20,
},
ul: {
margin: 0,
padding: 0,
- listStyle: 'none'
+ listStyle: 'none',
},
li: {
margin: '8px 0',
- lineHeight: '25px'
+ lineHeight: '25px',
},
item: {
...theme.text,
- textDecoration: 'none'
- }
+ textDecoration: 'none',
+ },
};
styles.selectedItem = {
...styles.item,
- fontWeight: 600
+ fontWeight: 600,
};
export default styles;
diff --git a/packages/getstorybookio/src/components/Docs/index.js b/packages/getstorybookio/src/components/Docs/index.js
index e91b1b4007fb..1dcacc043bdf 100644
--- a/packages/getstorybookio/src/components/Docs/index.js
+++ b/packages/getstorybookio/src/components/Docs/index.js
@@ -14,7 +14,7 @@ class Docs extends React.Component {
sections,
selectedItem,
selectedSectionId,
- selectedItemId
+ selectedItemId,
} = this.props;
const selectedCat = categories.find(cat => cat.id === selectedCatId);
@@ -44,7 +44,7 @@ Docs.propTypes = {
sections: PropTypes.array,
selectedItem: PropTypes.object,
selectedSectionId: PropTypes.string,
- selectedItemId: PropTypes.string
+ selectedItemId: PropTypes.string,
};
export default Docs;
diff --git a/packages/getstorybookio/src/components/Homepage/Featured/index.js b/packages/getstorybookio/src/components/Homepage/Featured/index.js
index ac5e71ff9102..f8ee1d736ecf 100644
--- a/packages/getstorybookio/src/components/Homepage/Featured/index.js
+++ b/packages/getstorybookio/src/components/Homepage/Featured/index.js
@@ -42,7 +42,7 @@ class Featured extends React.Component {
}
Featured.propTypes = {
- featuredStorybooks: PropTypes.array
+ featuredStorybooks: PropTypes.array,
};
export default Featured;
diff --git a/packages/getstorybookio/src/components/Homepage/Header/index.js b/packages/getstorybookio/src/components/Homepage/Header/index.js
index 20e8f299fcb0..cbe6288d7b7b 100644
--- a/packages/getstorybookio/src/components/Homepage/Header/index.js
+++ b/packages/getstorybookio/src/components/Homepage/Header/index.js
@@ -6,7 +6,7 @@ import storybookLogo from '../../../design/homepage/storybook-logo.png';
const sections = [
{ id: 'home', caption: 'Home', href: '/' },
- { id: 'docs', caption: 'Docs', href: '/docs' }
+ { id: 'docs', caption: 'Docs', href: '/docs' },
];
class Header extends React.Component {
@@ -49,7 +49,7 @@ class Header extends React.Component {
}
Header.propTypes = {
- currentSection: PropTypes.string
+ currentSection: PropTypes.string,
};
export default Header;
diff --git a/packages/getstorybookio/src/components/Homepage/index.js b/packages/getstorybookio/src/components/Homepage/index.js
index b33437a78fd5..59cfc786e2cb 100644
--- a/packages/getstorybookio/src/components/Homepage/index.js
+++ b/packages/getstorybookio/src/components/Homepage/index.js
@@ -15,28 +15,28 @@ const featuredStorybooks = [
owner: 'https://avatars0.githubusercontent.com/u/698437?v=3&s=200',
storybook: {
name: 'React Dates',
- link: 'http://airbnb.io/react-dates/'
+ link: 'http://airbnb.io/react-dates/',
},
- source: 'https://github.com/airbnb/react-dates'
+ source: 'https://github.com/airbnb/react-dates',
},
{
owner: 'https://avatars3.githubusercontent.com/u/239676?v=3&s=460',
storybook: {
name: 'React Native Web',
- link: 'https://necolas.github.io/react-native-web/storybook'
+ link: 'https://necolas.github.io/react-native-web/storybook',
},
- source: 'https://github.com/necolas/react-native-web'
+ source: 'https://github.com/necolas/react-native-web',
},
{
owner: 'https://avatars1.githubusercontent.com/u/15616844?v=3&s=200',
storybook: {
name: 'React Button',
- link: 'http://kadira-samples.github.io/react-button/'
+ link: 'http://kadira-samples.github.io/react-button/',
},
- source: 'https://github.com/kadira-samples/react-button'
- }
+ source: 'https://github.com/kadira-samples/react-button',
+ },
];
const Homepage = () => (
@@ -53,7 +53,7 @@ const Homepage = () => (
);
Homepage.propTypes = {
- featuredStorybooks: PropTypes.array
+ featuredStorybooks: PropTypes.array,
};
export default Homepage;
diff --git a/packages/getstorybookio/src/containers/Docs.js b/packages/getstorybookio/src/containers/Docs.js
index d421aa276445..abed4004ed3e 100644
--- a/packages/getstorybookio/src/containers/Docs.js
+++ b/packages/getstorybookio/src/containers/Docs.js
@@ -5,7 +5,7 @@ import {
getNavigationData,
getItem,
getFirstItem,
- getFirstItemOfSection
+ getFirstItemOfSection,
} from '../docs';
class DocsContainer extends React.Component {
@@ -32,7 +32,7 @@ class DocsContainer extends React.Component {
sections: getNavigationData(selectedCatId),
selectedItem,
selectedSectionId,
- selectedItemId
+ selectedItemId,
};
return
;
diff --git a/packages/getstorybookio/src/docs/index.js b/packages/getstorybookio/src/docs/index.js
index e37f71cca729..42db8c9ad4ba 100644
--- a/packages/getstorybookio/src/docs/index.js
+++ b/packages/getstorybookio/src/docs/index.js
@@ -1,12 +1,12 @@
const data = {
'react-storybook': {
title: 'React Storybook',
- sections: require('./react-storybook').default
+ sections: require('./react-storybook').default,
},
'storybook-hub': {
title: 'Storybook Hub',
- sections: require('./storybook-hub').default
- }
+ sections: require('./storybook-hub').default,
+ },
};
export function getCategories() {
@@ -16,7 +16,7 @@ export function getCategories() {
catIds.forEach(catId => {
categories.push({
id: catId,
- title: data[catId].title
+ title: data[catId].title,
});
});
diff --git a/packages/getstorybookio/src/docs/react-storybook/addons/addon-gallery.js b/packages/getstorybookio/src/docs/react-storybook/addons/addon-gallery.js
index 7b393851d672..c751ec30fdc3 100644
--- a/packages/getstorybookio/src/docs/react-storybook/addons/addon-gallery.js
+++ b/packages/getstorybookio/src/docs/react-storybook/addons/addon-gallery.js
@@ -77,5 +77,5 @@ export default {
Given possible values for each prop, renders your component with all combinations of prop values. Useful for finding edge cases or just seeing all component states at once.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/addons/api.js b/packages/getstorybookio/src/docs/react-storybook/addons/api.js
index 7ad765da2aea..42efb2a492f9 100644
--- a/packages/getstorybookio/src/docs/react-storybook/addons/api.js
+++ b/packages/getstorybookio/src/docs/react-storybook/addons/api.js
@@ -133,5 +133,5 @@ export default {
~~~js
storybookAPI.onStory((kind, story) => console.log(kind, story));
~~~
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/addons/introduction.js b/packages/getstorybookio/src/docs/react-storybook/addons/introduction.js
index 0c9041eeba5c..15b38201368c 100644
--- a/packages/getstorybookio/src/docs/react-storybook/addons/introduction.js
+++ b/packages/getstorybookio/src/docs/react-storybook/addons/introduction.js
@@ -1,7 +1,7 @@
import { stripIndent } from 'common-tags';
const images = {
- addonActionsDemo: require('./static/addon-actions-demo.gif')
+ addonActionsDemo: require('./static/addon-actions-demo.gif'),
};
export default {
@@ -107,5 +107,5 @@ export default {
* [Using addons](/docs/react-storybook/addons/using-addons)
* [Addon gallery](/docs/react-storybook/addons/addon-gallery)
* [Write your own addon](/docs/react-storybook/addons/writing-addons)
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/addons/using-addons.js b/packages/getstorybookio/src/docs/react-storybook/addons/using-addons.js
index 8779dc6b35a3..6381a99ca90a 100644
--- a/packages/getstorybookio/src/docs/react-storybook/addons/using-addons.js
+++ b/packages/getstorybookio/src/docs/react-storybook/addons/using-addons.js
@@ -2,7 +2,7 @@ import { stripIndent } from 'common-tags';
const images = {
storiesWithoutNotes: require('./static/stories-without-notes.png'),
- storiesWithNotes: require('./static/stories-with-notes.png')
+ storiesWithNotes: require('./static/stories-with-notes.png'),
};
export default {
@@ -67,5 +67,5 @@ export default {
> This particular addon has created a panel in Storybook. Some addons may not create a panel and may use some other Storybook platform features.
>
> So, look at the addon’s own documentation on how to use it.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/addons/writing-addons.js b/packages/getstorybookio/src/docs/react-storybook/addons/writing-addons.js
index 2ec7bcf40d8a..1815444e7891 100644
--- a/packages/getstorybookio/src/docs/react-storybook/addons/writing-addons.js
+++ b/packages/getstorybookio/src/docs/react-storybook/addons/writing-addons.js
@@ -3,7 +3,7 @@ import { stripIndent } from 'common-tags';
const images = {
storybookComponents: require('./static/storybook-components.png'),
storiesWithoutNotes: require('./static/stories-without-notes.png'),
- storiesWithNotes: require('./static/stories-with-notes.png')
+ storiesWithNotes: require('./static/stories-with-notes.png'),
};
export default {
@@ -185,5 +185,5 @@ export default {
Your packaged Storybook addon needed to be written in ES5. If you are using ES6, then you need to transpile it.
In that case, we recommend to use [React CDK](https://github.com/kadirahq/react-cdk) for that.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/exporting-storybook.js b/packages/getstorybookio/src/docs/react-storybook/basics/exporting-storybook.js
index 5a78ccbb0254..46bbb66cedd6 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/exporting-storybook.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/exporting-storybook.js
@@ -40,5 +40,5 @@ export default {
Additionally, you can deploy Storybook directly into GitHub pages with our [storybook-deployer](https://github.com/kadirahq/storybook-deployer) tool.
Or, you can simply export your storybook into the docs directory and use it as the root for GitHub pages. Have a look at [this guide](https://github.com/blog/2233-publish-your-project-documentation-with-github-pages) for more information.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/faq.js b/packages/getstorybookio/src/docs/react-storybook/basics/faq.js
index 64e6c49970ea..6d8a09828092 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/faq.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/faq.js
@@ -13,5 +13,5 @@ export default {
~~~
npm test -- --coverage --collectCoverageFrom='["src/**/*.{js,jsx}","!src/**/stories/*"]'
~~~
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/introduction.js b/packages/getstorybookio/src/docs/react-storybook/basics/introduction.js
index 424a1e94d25c..2e9f5efc7335 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/introduction.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/introduction.js
@@ -1,7 +1,7 @@
import { stripIndent } from 'common-tags';
const images = {
- screenshot: require('./static/screenshot.png')
+ screenshot: require('./static/screenshot.png'),
};
export default {
@@ -21,5 +21,5 @@ export default {
* [React Button](http://kadira-samples.github.io/react-button) - [source](https://github.com/kadira-samples/react-button)
* [Demo of React Dates](http://airbnb.io/react-dates/) - [source](https://github.com/airbnb/react-dates)
* [Demo of React Native Web](http://necolas.github.io/react-native-web/storybook/) - [source](https://github.com/necolas/react-native-web)
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/quick-start-guide.js b/packages/getstorybookio/src/docs/react-storybook/basics/quick-start-guide.js
index 72a667e21df0..61e9d6c39a32 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/quick-start-guide.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/quick-start-guide.js
@@ -24,5 +24,5 @@ export default {
---
To learn more about what \`getstorybook\` command does, have a look at our [Slow Start Guide](/docs/react-storybook/basics/slow-start-guide).
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/slow-start-guide.js b/packages/getstorybookio/src/docs/react-storybook/basics/slow-start-guide.js
index 03f2cc8b785c..6ab1a9a642b7 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/slow-start-guide.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/slow-start-guide.js
@@ -1,7 +1,7 @@
import { stripIndent } from 'common-tags';
const images = {
- basicsStories: require('./static/basic-stories.png')
+ basicsStories: require('./static/basic-stories.png'),
};
export default {
@@ -103,5 +103,5 @@ export default {
![](${images.basicsStories})
Now you can change components and write stories whenever you need to. You'll get those changes into Storybook in a snap with the help of Webpack's HMR API.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/basics/writing-stories.js b/packages/getstorybookio/src/docs/react-storybook/basics/writing-stories.js
index 24bb8568dbb9..724779f6e172 100644
--- a/packages/getstorybookio/src/docs/react-storybook/basics/writing-stories.js
+++ b/packages/getstorybookio/src/docs/react-storybook/basics/writing-stories.js
@@ -1,7 +1,7 @@
import { stripIndent } from 'common-tags';
const images = {
- basicsStories: require('./static/basic-stories.png')
+ basicsStories: require('./static/basic-stories.png'),
};
export default {
@@ -146,5 +146,5 @@ export default {
* Have one repo for the theme, and one for the app.
* Have one repo for each UI component and use those in different apps.
* Have a few repos for different kinds of UI components and use them in different apps.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/add-custom-head-tags.js b/packages/getstorybookio/src/docs/react-storybook/configurations/add-custom-head-tags.js
index 4e5df5df57c7..5b67298bf390 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/add-custom-head-tags.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/add-custom-head-tags.js
@@ -18,5 +18,5 @@ export default {
> **Important**
> Storybook will inject these tags to the iframe where your components are rendered. So, these won’t be loaded into the main Storybook UI.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/cli-options.js b/packages/getstorybookio/src/docs/react-storybook/configurations/cli-options.js
index daa8572ca44f..b478a8366630 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/cli-options.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/cli-options.js
@@ -39,5 +39,5 @@ export default {
-c, --config-dir [dir-name] Directory where to load Storybook configurations from
~~~
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/custom-babel-config.js b/packages/getstorybookio/src/docs/react-storybook/configurations/custom-babel-config.js
index 685a15c1a7c7..52635081ef80 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/custom-babel-config.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/custom-babel-config.js
@@ -11,5 +11,5 @@ export default {
Then Storybook will load the Babel configuration only from that file.
> Currently we do not support loading the Babel config from the package.json.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/custom-webpack-config.js b/packages/getstorybookio/src/docs/react-storybook/configurations/custom-webpack-config.js
index 4bc83151ff9b..20a74d51ce9b 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/custom-webpack-config.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/custom-webpack-config.js
@@ -104,5 +104,5 @@ export default {
* Simply import your main Webpack config into Storybook's \`webpack.config.js\` and use the loaders and plugins used in that.
* Create a new file with common Webpack options and use it in both inside the main Webpack config and inside Storybook's \`webpack.config.js\`.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/default-config.js b/packages/getstorybookio/src/docs/react-storybook/configurations/default-config.js
index 97807c6a05ec..13af047981c3 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/default-config.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/default-config.js
@@ -68,5 +68,5 @@ export default {
> Unfortunately, we don't support Meteor packages. If your UI component includes one or more Meteor packages, try to avoid using them in UI components.
> If they are containers, you can use [React Stubber](https://github.com/kadirahq/react-stubber) to use them in Storybook.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/env-vars.js b/packages/getstorybookio/src/docs/react-storybook/configurations/env-vars.js
index df5591b7377d..741982e299d7 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/env-vars.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/env-vars.js
@@ -35,5 +35,5 @@ export default {
* When running \`npm run storybook\`, we set NODE_ENV to 'development'
* When building storybook, we set NODE_ENV to 'production'
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/configurations/serving-static-files.js b/packages/getstorybookio/src/docs/react-storybook/configurations/serving-static-files.js
index bc3e95ab6313..65fb756384b7 100644
--- a/packages/getstorybookio/src/docs/react-storybook/configurations/serving-static-files.js
+++ b/packages/getstorybookio/src/docs/react-storybook/configurations/serving-static-files.js
@@ -75,5 +75,5 @@ export default {
If you load static content via importing, this is automatic and you do not have to do anything.
If you are using a static directory, then you need to use _relative paths_ to load images.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/index.js b/packages/getstorybookio/src/docs/react-storybook/index.js
index cddba3bd67e8..dba7c086415f 100644
--- a/packages/getstorybookio/src/docs/react-storybook/index.js
+++ b/packages/getstorybookio/src/docs/react-storybook/index.js
@@ -8,8 +8,8 @@ export default [
require('./basics/slow-start-guide').default,
require('./basics/writing-stories').default,
require('./basics/exporting-storybook').default,
- require('./basics/faq').default
- ]
+ require('./basics/faq').default,
+ ],
},
{
id: 'configurations',
@@ -21,8 +21,8 @@ export default [
require('./configurations/add-custom-head-tags').default,
require('./configurations/serving-static-files').default,
require('./configurations/env-vars').default,
- require('./configurations/cli-options').default
- ]
+ require('./configurations/cli-options').default,
+ ],
},
{
id: 'testing',
@@ -32,8 +32,8 @@ export default [
require('./testing/structural-testing').default,
require('./testing/interaction-testing').default,
require('./testing/css-style-testing').default,
- require('./testing/manual-testing').default
- ]
+ require('./testing/manual-testing').default,
+ ],
},
{
id: 'addons',
@@ -43,7 +43,7 @@ export default [
require('./addons/using-addons').default,
require('./addons/addon-gallery').default,
require('./addons/writing-addons').default,
- require('./addons/api').default
- ]
- }
+ require('./addons/api').default,
+ ],
+ },
];
diff --git a/packages/getstorybookio/src/docs/react-storybook/testing/css-style-testing.js b/packages/getstorybookio/src/docs/react-storybook/testing/css-style-testing.js
index d243708d0912..e230d9dce2a8 100644
--- a/packages/getstorybookio/src/docs/react-storybook/testing/css-style-testing.js
+++ b/packages/getstorybookio/src/docs/react-storybook/testing/css-style-testing.js
@@ -32,5 +32,5 @@ export default {
It will be hard to use all the frameworks we've [mentioned](/docs/react-storybook/testing/react-ui-testing#3-css-style-testing), but we'll be able to use frameworks which are based on URL as the input source. (Such as [BackstopJS](https://github.com/garris/BackstopJS) and [Gemini](https://github.com/gemini-testing/gemini))
> In the future we are also planning to smooth this process with the help of [StoryShots](https://github.com/storybooks/storyshots).
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/testing/interaction-testing.js b/packages/getstorybookio/src/docs/react-storybook/testing/interaction-testing.js
index 4b1053dd3ce7..23eb7d5241e0 100644
--- a/packages/getstorybookio/src/docs/react-storybook/testing/interaction-testing.js
+++ b/packages/getstorybookio/src/docs/react-storybook/testing/interaction-testing.js
@@ -18,5 +18,5 @@ export default {
With that, you can write test specs directly inside stories.
Additionally, you also can use your CI server to run those tests.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/testing/manual-testing.js b/packages/getstorybookio/src/docs/react-storybook/testing/manual-testing.js
index 65bec91f0f3d..afd4e023f01e 100644
--- a/packages/getstorybookio/src/docs/react-storybook/testing/manual-testing.js
+++ b/packages/getstorybookio/src/docs/react-storybook/testing/manual-testing.js
@@ -20,5 +20,5 @@ export default {
> We will be releasing it in the first week of October.
> Join our [Newsletter](http://tinyletter.com/storybooks) or [Slack Team](https://storybooks-slackin.herokuapp.com/) to get updates.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/testing/react-ui-testing.js b/packages/getstorybookio/src/docs/react-storybook/testing/react-ui-testing.js
index 2e050a6f5b3e..36bf6ece4619 100644
--- a/packages/getstorybookio/src/docs/react-storybook/testing/react-ui-testing.js
+++ b/packages/getstorybookio/src/docs/react-storybook/testing/react-ui-testing.js
@@ -77,5 +77,5 @@ export default {
* [Interaction Testing with Specs Addon](/docs/react-storybook/testing/interaction-testing)
* [Storybook as the Base for CSS/Style Testing](/docs/react-storybook/testing/css-style-testing)
* [Storybook for Manual UI Testing](/docs/react-storybook/testing/manual-testing)
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/react-storybook/testing/structural-testing.js b/packages/getstorybookio/src/docs/react-storybook/testing/structural-testing.js
index 40ce10445420..9cc039e6670f 100644
--- a/packages/getstorybookio/src/docs/react-storybook/testing/structural-testing.js
+++ b/packages/getstorybookio/src/docs/react-storybook/testing/structural-testing.js
@@ -61,5 +61,5 @@ export default {
StoryShots also comes with a few important [productive features](https://github.com/storybooks/storyshots#key-features) that can be customized. Have a look at the StoryShots [repo](https://github.com/storybooks/storyshots) for more information.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/basics/comments.js b/packages/getstorybookio/src/docs/storybook-hub/basics/comments.js
index f82f6e2f9b98..c2eedb52df18 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/basics/comments.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/basics/comments.js
@@ -39,5 +39,5 @@ export default {
* Make sure you are on the correct branch.
Then you'll be able to access these comments. You'll be asked to login to storybook Hub, if needed, right from your comments panel.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/basics/getting-started.js b/packages/getstorybookio/src/docs/storybook-hub/basics/getting-started.js
index 5a41d302fc22..f5c55c712b07 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/basics/getting-started.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/basics/getting-started.js
@@ -53,5 +53,5 @@ export default {
You can also access these storybooks, right next to your PR.
![Access Storybooks via GitHub PR](${storybooksViaPRImage})
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/basics/github-pr-integration.js b/packages/getstorybookio/src/docs/storybook-hub/basics/github-pr-integration.js
index a79aee1bfbc2..a5f318f0b40f 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/basics/github-pr-integration.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/basics/github-pr-integration.js
@@ -21,5 +21,5 @@ export default {
![Storybooks via GitHub Deploy Link](${githubPRDeployLinkImage})
You can access all these storybooks by visiting your app's page on Storybook Hub as well. We arrange them according to your branches.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/basics/private-or-public-apps.js b/packages/getstorybookio/src/docs/storybook-hub/basics/private-or-public-apps.js
index fb7f3dc58d68..155bd764a7f4 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/basics/private-or-public-apps.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/basics/private-or-public-apps.js
@@ -20,5 +20,5 @@ export default {
> Anyway, since your GitHub repo is private, no one in the public will be able to see your storybooks, unless you share them.
Additionally, our storybook URLs are hard to guess. (They carried an UUID)
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/basics/security.js b/packages/getstorybookio/src/docs/storybook-hub/basics/security.js
index 6417db96aae6..8af8748bca5e 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/basics/security.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/basics/security.js
@@ -59,5 +59,5 @@ export default {
## TALK TO US
If you need more information or have found a vulnerability, email us at [storybooks@kadira.io](mailto:storybooks@kadira.io). We're happy to talk with you.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/index.js b/packages/getstorybookio/src/docs/storybook-hub/index.js
index a42818a50a49..68e659709d9e 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/index.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/index.js
@@ -7,8 +7,8 @@ export default [
require('./basics/github-pr-integration').default,
require('./basics/comments').default,
require('./basics/private-or-public-apps').default,
- require('./basics/security').default
- ]
+ require('./basics/security').default,
+ ],
},
{
@@ -18,7 +18,7 @@ export default [
require('./management-features/workspaces').default,
require('./management-features/sharing-storybooks').default,
require('./management-features/env-variables').default,
- require('./management-features/private-npm-packages').default
- ]
- }
+ require('./management-features/private-npm-packages').default,
+ ],
+ },
];
diff --git a/packages/getstorybookio/src/docs/storybook-hub/management-features/env-variables.js b/packages/getstorybookio/src/docs/storybook-hub/management-features/env-variables.js
index fc41e8e850b6..ce0e6649f371 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/management-features/env-variables.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/management-features/env-variables.js
@@ -20,5 +20,5 @@ export default {
Then you could set environment variables like this:
![Set Environment Varibles](${envVarsImage})
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/management-features/private-npm-packages.js b/packages/getstorybookio/src/docs/storybook-hub/management-features/private-npm-packages.js
index 2fba92483554..fbb1cdf35892 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/management-features/private-npm-packages.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/management-features/private-npm-packages.js
@@ -31,5 +31,5 @@ export default {
~~~sh
SB_SSHKEY
~~~
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/management-features/sharing-storybooks.js b/packages/getstorybookio/src/docs/storybook-hub/management-features/sharing-storybooks.js
index 62f16590fbce..5ba2733d158f 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/management-features/sharing-storybooks.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/management-features/sharing-storybooks.js
@@ -19,5 +19,5 @@ export default {
For private apps, any collaborator in your workspace could access storybooks for that app.
You can easily add or remove collaborators by visiting your [workspace](https://hub.getstorybook.io/workspaces).
- `
+ `,
};
diff --git a/packages/getstorybookio/src/docs/storybook-hub/management-features/workspaces.js b/packages/getstorybookio/src/docs/storybook-hub/management-features/workspaces.js
index f4b9eb532d55..1fca227a0f3a 100644
--- a/packages/getstorybookio/src/docs/storybook-hub/management-features/workspaces.js
+++ b/packages/getstorybookio/src/docs/storybook-hub/management-features/workspaces.js
@@ -14,5 +14,5 @@ export default {
You'll have access to more workspaces as you are added as a collaborator. Then you can see apps from those workspaces as well.
> Currently, we don't allow the creation of additional workspaces. But we'll be adding that feature soon.
- `
+ `,
};
diff --git a/packages/getstorybookio/src/index.js b/packages/getstorybookio/src/index.js
index e08bb90c9741..833e6f2ef02f 100644
--- a/packages/getstorybookio/src/index.js
+++ b/packages/getstorybookio/src/index.js
@@ -15,5 +15,5 @@ ReactDOM.render(
,
- document.getElementById('root')
+ document.getElementById('root'),
);
diff --git a/packages/getstorybookio/src/lib/highlight.js b/packages/getstorybookio/src/lib/highlight.js
index ce7494f91a8c..70ce9b5b0fb1 100644
--- a/packages/getstorybookio/src/lib/highlight.js
+++ b/packages/getstorybookio/src/lib/highlight.js
@@ -29,7 +29,7 @@ class Highlight extends React.Component {
}
Highlight.propTypes = {
- children: PropTypes.string
+ children: PropTypes.string,
};
export default Highlight;
diff --git a/packages/getstorybookio/src/stories/data.js b/packages/getstorybookio/src/stories/data.js
index 5fc18698910d..12b910fccd92 100644
--- a/packages/getstorybookio/src/stories/data.js
+++ b/packages/getstorybookio/src/stories/data.js
@@ -2,12 +2,12 @@ export const docsData = {
categories: [
{
id: 'cat-1',
- title: 'CAT 1'
+ title: 'CAT 1',
},
{
id: 'cat-2',
- title: 'CAT 2'
- }
+ title: 'CAT 2',
+ },
],
sections: [
{
@@ -16,8 +16,8 @@ export const docsData = {
items: [
{ id: 'getting-started', title: 'Getting Started' },
{ id: 'writing-stories', title: 'Writing Stories' },
- { id: 'build-as-a-static-app', title: 'Build as a Static App' }
- ]
+ { id: 'build-as-a-static-app', title: 'Build as a Static App' },
+ ],
},
{
id: 'configurations',
@@ -25,9 +25,9 @@ export const docsData = {
items: [
{ id: 'default-config', title: 'Default Config' },
{ id: 'webpack', title: 'Webpack' },
- { id: 'babel', title: 'Babel' }
- ]
- }
+ { id: 'babel', title: 'Babel' },
+ ],
+ },
],
selectedItem: {
id: 'writing-stories',
@@ -55,34 +55,34 @@ storiesOf('Toggle', module)
return
});
~~~
- `
+ `,
},
featuredStorybooks: [
{
owner: 'https://avatars0.githubusercontent.com/u/698437?v=3&s=200',
storybook: {
name: 'React Dates',
- link: 'http://airbnb.io/react-dates/'
+ link: 'http://airbnb.io/react-dates/',
},
- source: 'https://github.com/airbnb/react-dates'
+ source: 'https://github.com/airbnb/react-dates',
},
{
owner: 'https://avatars3.githubusercontent.com/u/239676?v=3&s=460',
storybook: {
name: 'React Native Web',
- link: 'https://necolas.github.io/react-native-web/storybook'
+ link: 'https://necolas.github.io/react-native-web/storybook',
},
- source: 'https://github.com/necolas/react-native-web'
+ source: 'https://github.com/necolas/react-native-web',
},
{
owner: 'https://avatars1.githubusercontent.com/u/15616844?v=3&s=200',
storybook: {
name: 'React Button',
- link: 'http://kadira-samples.github.io/react-button/'
+ link: 'http://kadira-samples.github.io/react-button/',
},
- source: 'https://github.com/kadira-samples/react-button'
- }
- ]
+ source: 'https://github.com/kadira-samples/react-button',
+ },
+ ],
};
diff --git a/packages/getstorybookio/src/stories/designs.js b/packages/getstorybookio/src/stories/designs.js
index 1cd07b1a9f4c..f7273cc286c4 100644
--- a/packages/getstorybookio/src/stories/designs.js
+++ b/packages/getstorybookio/src/stories/designs.js
@@ -7,14 +7,14 @@ export default {
Overall this will be a simple design.
All these content should render inside a BS containers and it support mobile.
- `
+ `,
},
'Homepage.header': {
design: require('../design/homepage/header.png'),
note: `
Just a simple header. In the mobile view, this will show one after other.
- `
+ `,
},
'Homepage.heading': {
@@ -22,7 +22,7 @@ export default {
note: `
Use the "Storybook" font to make it super bold. (font-weight=800)
In the mobile view, try to make the font-size smaller.
- `
+ `,
},
'Homepage.demo': {
@@ -30,7 +30,7 @@ export default {
note: `
Use the image located at src/design/homepage/screenshot.png for this.
But in production we use an animated GIF here.
- `
+ `,
},
'Homepage.built-for': {
@@ -46,7 +46,7 @@ export default {
This one and few components below share some commong features.
Those includes bottom border and margins. So create a common component inside
the Homepage/styles.css stylesheet and use that class in this other components below.
- `
+ `,
},
'Homepage.main-links': {
@@ -56,7 +56,7 @@ export default {
You can also use that in the component below.
In the mobile view, two sections in here show one after other.
- `
+ `,
},
'Homepage.featured-storybooks': {
@@ -97,7 +97,7 @@ export default {
source: "https://github.com/kadira-samples/react-button"
},
]
- `
+ `,
},
'Homepage.footer': {
@@ -109,7 +109,7 @@ export default {
* NewsLetter: https://tinyletter.com/storybooks
* Twiiter: https://twitter.com/kadirahq
* Medium: https://voice.kadira.io
- `
+ `,
},
'Docs.page': {
@@ -121,7 +121,7 @@ export default {
Here we reuse the header and footer from the Homepage.
Bootstrap Layout is also pretty similar to the Homepage.
- `
+ `,
},
'Docs.docs-container': {
@@ -129,7 +129,7 @@ export default {
note: `
This is a container and this as no content.
But this one has top and bottom borders and some margins.
- `
+ `,
},
'Docs.docs-nav': {
@@ -142,7 +142,7 @@ export default {
Others are with '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif"' and 17px.
Selected item is marked with bold and in this color: #E25E5E.
- `
+ `,
},
'Docs.docs-content': {
@@ -156,6 +156,6 @@ export default {
* color: #333
(You can look at the BulletProof Meteor for the actual styles.)
- `
- }
+ `,
+ },
};
diff --git a/packages/getstorybookio/src/stories/implementations.js b/packages/getstorybookio/src/stories/implementations.js
index c9ad379c69bb..d516eb495808 100644
--- a/packages/getstorybookio/src/stories/implementations.js
+++ b/packages/getstorybookio/src/stories/implementations.js
@@ -62,5 +62,5 @@ export default {
selectedSection={docsData.selectedItem.sectionId}
selectedItem={docsData.selectedItem.id}
/>
- )
+ ),
};
diff --git a/packages/getstorybookio/src/stories/with_design.js b/packages/getstorybookio/src/stories/with_design.js
index 05a6b073a5af..d712891d6e3e 100644
--- a/packages/getstorybookio/src/stories/with_design.js
+++ b/packages/getstorybookio/src/stories/with_design.js
@@ -6,7 +6,7 @@ const styles = {
toolbar: {
marginBottom: 10,
fontSize: 11,
- fontFamily: '-apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif'
+ fontFamily: '-apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif',
},
toolbarButton: {
@@ -17,11 +17,11 @@ const styles = {
cursor: 'pointer',
outline: 0,
letterSpacing: 0.5,
- WebkitFontSmoothing: 'antialiased'
+ WebkitFontSmoothing: 'antialiased',
},
wrapper: {
- padding: 10
+ padding: 10,
},
heading: {
@@ -29,12 +29,12 @@ const styles = {
textTransform: 'uppercase',
fontSize: 20,
margin: '10px 0',
- padding: '0'
+ padding: '0',
},
container: {
- border: '1px dashed #DDD'
- }
+ border: '1px dashed #DDD',
+ },
};
export default class WithDesign extends React.Component {
@@ -93,22 +93,21 @@ export default class WithDesign extends React.Component {
renderToolbar() {
const { type: currentType } = this.state;
- const changeState = type =>
- () => {
- localStorage.setItem('WITH_DESIGN_TYPE', type);
- this.setState({ type });
- this.tryCalculateScale();
- };
+ const changeState = type => () => {
+ localStorage.setItem('WITH_DESIGN_TYPE', type);
+ this.setState({ type });
+ this.tryCalculateScale();
+ };
const buttons = [
['Side by Side', 'COMPARE'],
['One After Other', 'SHOW_BOTH'],
['Implementation', 'SHOW_IMPLEMENTATION'],
- ['Design', 'SHOW_DESIGN']
+ ['Design', 'SHOW_DESIGN'],
].map(([caption, typeName]) => {
const style = {
...styles.toolbarButton,
- fontWeight: currentType === typeName ? 600 : 400
+ fontWeight: currentType === typeName ? 600 : 400,
};
return (
@@ -148,7 +147,7 @@ export default class WithDesign extends React.Component {
const containerStyle = {
...styles.container,
- zoom: implementationScale
+ zoom: implementationScale,
};
return (
diff --git a/packages/react-native-storybook/src/bin/storybook-start.js b/packages/react-native-storybook/src/bin/storybook-start.js
index 102cbb569c8a..a2a1253dd7b7 100644
--- a/packages/react-native-storybook/src/bin/storybook-start.js
+++ b/packages/react-native-storybook/src/bin/storybook-start.js
@@ -28,7 +28,7 @@ const server = new Server({
configDir,
environment: program.environment,
manualId: program.manualId,
- secured: program.secured
+ secured: program.secured,
});
server.listen(...listenAddr, err => {
@@ -48,10 +48,10 @@ if (!program.skipPackager) {
'node node_modules/react-native/local-cli/cli.js start',
`--projectRoots ${projectRoots.join(',')}`,
`--root ${projectDir}`,
- program.resetCache && '--reset-cache'
+ program.resetCache && '--reset-cache',
]
.filter(x => x)
.join(' '),
- { async: true }
+ { async: true },
);
}
diff --git a/packages/react-native-storybook/src/preview/components/StoryView/style.js b/packages/react-native-storybook/src/preview/components/StoryView/style.js
index 30f5f279606e..b5fe466b9043 100644
--- a/packages/react-native-storybook/src/preview/components/StoryView/style.js
+++ b/packages/react-native-storybook/src/preview/components/StoryView/style.js
@@ -1,11 +1,11 @@
export default {
main: {
- flex: 1
+ flex: 1,
},
help: {
flex: 1,
padding: 15,
alignItems: 'center',
- justifyContent: 'center'
- }
+ justifyContent: 'center',
+ },
};
diff --git a/packages/react-native-storybook/src/preview/story_kind.js b/packages/react-native-storybook/src/preview/story_kind.js
index d9c3cce86ee7..1c91a6d85b1a 100644
--- a/packages/react-native-storybook/src/preview/story_kind.js
+++ b/packages/react-native-storybook/src/preview/story_kind.js
@@ -19,12 +19,11 @@ export default class StoryKindApi {
_decorate(fn) {
return this._decorators.reduce(
- (decorated, decorator) =>
- context => {
- const _fn = () => decorated(context);
- return decorator(_fn, context);
- },
- fn
+ (decorated, decorator) => context => {
+ const _fn = () => decorated(context);
+ return decorator(_fn, context);
+ },
+ fn,
);
}
}
diff --git a/packages/react-native-storybook/src/preview/story_store.js b/packages/react-native-storybook/src/preview/story_store.js
index fc826dd5b3e7..65a8d40df25a 100644
--- a/packages/react-native-storybook/src/preview/story_store.js
+++ b/packages/react-native-storybook/src/preview/story_store.js
@@ -10,14 +10,14 @@ export default class StoryStore {
this._data[kind] = {
kind,
index: cnt++,
- stories: {}
+ stories: {},
};
}
this._data[kind].stories[name] = {
name,
index: cnt++,
- fn
+ fn,
};
}
diff --git a/packages/react-native-storybook/src/server/config.js b/packages/react-native-storybook/src/server/config.js
index 29cea4745bcf..d715cff14b43 100644
--- a/packages/react-native-storybook/src/server/config.js
+++ b/packages/react-native-storybook/src/server/config.js
@@ -123,7 +123,7 @@ export default function(configType, baseConfig, projectDir, configDir) {
...config.module,
// We need to use our and custom loaders.
...customConfig.module,
- loaders: [...config.module.loaders, ...(customConfig.module.loaders || [])]
- }
+ loaders: [...config.module.loaders, ...(customConfig.module.loaders || [])],
+ },
};
}
diff --git a/packages/react-native-storybook/src/server/config/babel.js b/packages/react-native-storybook/src/server/config/babel.js
index ab66265649ba..70ff7a9fc944 100644
--- a/packages/react-native-storybook/src/server/config/babel.js
+++ b/packages/react-native-storybook/src/server/config/babel.js
@@ -19,7 +19,7 @@ module.exports = {
// exponentiation
require.resolve('babel-preset-es2016'),
// JSX, Flow
- require.resolve('babel-preset-react')
+ require.resolve('babel-preset-react'),
],
plugins: [
// function x(a, b, c,) { }
@@ -38,8 +38,8 @@ module.exports = {
{
helpers: true,
polyfill: true,
- regenerator: true
- }
- ]
- ]
+ regenerator: true,
+ },
+ ],
+ ],
};
diff --git a/packages/react-native-storybook/src/server/config/babel.prod.js b/packages/react-native-storybook/src/server/config/babel.prod.js
index fd847f98bf7e..12359442f545 100644
--- a/packages/react-native-storybook/src/server/config/babel.prod.js
+++ b/packages/react-native-storybook/src/server/config/babel.prod.js
@@ -16,7 +16,7 @@ module.exports = {
// exponentiation
require.resolve('babel-preset-es2016'),
// JSX, Flow
- require.resolve('babel-preset-react')
+ require.resolve('babel-preset-react'),
],
plugins: [
// function x(a, b, c,) { }
@@ -35,10 +35,10 @@ module.exports = {
{
helpers: true,
polyfill: true,
- regenerator: true
- }
+ regenerator: true,
+ },
],
// Optimization: hoist JSX that never changes out of render()
- require.resolve('babel-plugin-transform-react-constant-elements')
- ]
+ require.resolve('babel-plugin-transform-react-constant-elements'),
+ ],
};
diff --git a/packages/react-native-storybook/src/server/config/defaults/webpack.config.js b/packages/react-native-storybook/src/server/config/defaults/webpack.config.js
index fe8c59b57637..0c052d8250ab 100644
--- a/packages/react-native-storybook/src/server/config/defaults/webpack.config.js
+++ b/packages/react-native-storybook/src/server/config/defaults/webpack.config.js
@@ -12,21 +12,21 @@ module.exports = storybookBaseConfig => {
loaders: [
require.resolve('style-loader'),
require.resolve('css-loader'),
- require.resolve('postcss-loader')
- ]
+ require.resolve('postcss-loader'),
+ ],
},
{
test: /\.json$/,
include: includePaths,
- loader: require.resolve('json-loader')
+ loader: require.resolve('json-loader'),
},
{
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)(\?.*)?$/,
include: includePaths,
loader: require.resolve('file-loader'),
query: {
- name: 'static/media/[name].[hash:8].[ext]'
- }
+ name: 'static/media/[name].[hash:8].[ext]',
+ },
},
{
test: /\.(mp4|webm)(\?.*)?$/,
@@ -34,15 +34,15 @@ module.exports = storybookBaseConfig => {
loader: require.resolve('url-loader'),
query: {
limit: 10000,
- name: 'static/media/[name].[hash:8].[ext]'
- }
- }
+ name: 'static/media/[name].[hash:8].[ext]',
+ },
+ },
];
newConfig.postcss = () => [
autoprefixer({
- browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9']
- })
+ browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
+ }),
];
newConfig.resolve = {
@@ -50,8 +50,8 @@ module.exports = storybookBaseConfig => {
extensions: ['.js', '.json', ''],
alias: {
// This is to support NPM2
- 'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator')
- }
+ 'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator'),
+ },
};
// Return the altered config
diff --git a/packages/react-native-storybook/src/server/config/webpack.config.js b/packages/react-native-storybook/src/server/config/webpack.config.js
index 5a23efebfb6d..5f069df7932a 100644
--- a/packages/react-native-storybook/src/server/config/webpack.config.js
+++ b/packages/react-native-storybook/src/server/config/webpack.config.js
@@ -6,17 +6,17 @@ import { OccurenceOrderPlugin, includePaths, excludePaths } from './utils';
const config = {
devtool: '#cheap-module-eval-source-map',
entry: {
- manager: [require.resolve('../../manager')]
+ manager: [require.resolve('../../manager')],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'static/[name].bundle.js',
- publicPath: '/'
+ publicPath: '/',
},
plugins: [
new OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
- new CaseSensitivePathsPlugin()
+ new CaseSensitivePathsPlugin(),
],
module: {
loaders: [
@@ -25,10 +25,10 @@ const config = {
loader: require.resolve('babel-loader'),
query: require('./babel.js'),
include: includePaths,
- exclude: excludePaths
- }
- ]
- }
+ exclude: excludePaths,
+ },
+ ],
+ },
};
export default config;
diff --git a/packages/react-native-storybook/src/server/config/webpack.config.prod.js b/packages/react-native-storybook/src/server/config/webpack.config.prod.js
index e85d2bd21c8c..80a9c34d8719 100644
--- a/packages/react-native-storybook/src/server/config/webpack.config.prod.js
+++ b/packages/react-native-storybook/src/server/config/webpack.config.prod.js
@@ -4,7 +4,7 @@ import { OccurenceOrderPlugin, includePaths, excludePaths } from './utils';
const entries = {
preview: [],
- manager: [path.resolve(__dirname, '../../manager')]
+ manager: [path.resolve(__dirname, '../../manager')],
};
const config = {
@@ -19,7 +19,7 @@ const config = {
// This works with css and image loaders too.
// This is working for storybook since, we don't use pushState urls and
// relative URLs works always.
- publicPath: '/'
+ publicPath: '/',
},
plugins: [
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
@@ -27,16 +27,16 @@ const config = {
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
- warnings: false
+ warnings: false,
},
mangle: {
- screw_ie8: true
+ screw_ie8: true,
},
output: {
comments: false,
- screw_ie8: true
- }
- })
+ screw_ie8: true,
+ },
+ }),
],
module: {
loaders: [
@@ -45,10 +45,10 @@ const config = {
loader: require.resolve('babel-loader'),
query: require('./babel.prod.js'),
include: includePaths,
- exclude: excludePaths
- }
- ]
- }
+ exclude: excludePaths,
+ },
+ ],
+ },
};
// Webpack 2 doesn't have a OccurenceOrderPlugin plugin in the production mode.
diff --git a/packages/react-native-storybook/src/server/middleware.js b/packages/react-native-storybook/src/server/middleware.js
index 881412996a5f..7b9ad36028d3 100644
--- a/packages/react-native-storybook/src/server/middleware.js
+++ b/packages/react-native-storybook/src/server/middleware.js
@@ -39,7 +39,7 @@ export default function({ projectDir, configDir, ...options }) {
const devMiddlewareOptions = {
noInfo: true,
publicPath: config.output.publicPath,
- watchOptions: config.watchOptions || {}
+ watchOptions: config.watchOptions || {},
};
const router = new Router();
@@ -56,8 +56,8 @@ export default function({ projectDir, configDir, ...options }) {
res.send(
getIndexHtml(publicPath, {
manualId: options.manualId,
- secured: options.secured
- })
+ secured: options.secured,
+ }),
);
});
diff --git a/packages/react-storybook/demo/src/stories/Button.js b/packages/react-storybook/demo/src/stories/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/react-storybook/demo/src/stories/Button.js
+++ b/packages/react-storybook/demo/src/stories/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/react-storybook/demo/src/stories/Welcome.js b/packages/react-storybook/demo/src/stories/Welcome.js
index 776d5c0d435c..5886c30148ad 100644
--- a/packages/react-storybook/demo/src/stories/Welcome.js
+++ b/packages/react-storybook/demo/src/stories/Welcome.js
@@ -5,18 +5,18 @@ const styles = {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
- fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif'
+ fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
- width: 200
+ width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
- paddingBottom: 2
+ paddingBottom: 2,
},
code: {
@@ -26,14 +26,14 @@ const styles = {
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
- color: '#3a3a3a'
+ color: '#3a3a3a',
},
codeBlock: {
backgroundColor: '#f3f2f2',
padding: '1px 10px',
- margin: '10px 0'
- }
+ margin: '10px 0',
+ },
};
const codeBlock = `
diff --git a/packages/react-storybook/scripts/mocha_runner.js b/packages/react-storybook/scripts/mocha_runner.js
index 1dbdfc1fa852..4b6b7654db95 100755
--- a/packages/react-storybook/scripts/mocha_runner.js
+++ b/packages/react-storybook/scripts/mocha_runner.js
@@ -16,7 +16,7 @@ Object.keys(document.defaultView).forEach(property => {
});
global.navigator = {
- userAgent: 'node.js'
+ userAgent: 'node.js',
};
process.on('unhandledRejection', error => {
diff --git a/packages/react-storybook/src/client/manager/preview.js b/packages/react-storybook/src/client/manager/preview.js
index 808da590d9ab..208ddf109aa2 100644
--- a/packages/react-storybook/src/client/manager/preview.js
+++ b/packages/react-storybook/src/client/manager/preview.js
@@ -6,7 +6,7 @@ const iframeStyle = {
height: '100%',
border: 0,
margin: 0,
- padding: 0
+ padding: 0,
};
class Preview extends Component {
@@ -34,7 +34,7 @@ class Preview extends Component {
}
Preview.propTypes = {
- url: PropTypes.string.isRequired
+ url: PropTypes.string.isRequired,
};
export default Preview;
diff --git a/packages/react-storybook/src/client/manager/provider.js b/packages/react-storybook/src/client/manager/provider.js
index 5e7021e87e51..3a9756892097 100644
--- a/packages/react-storybook/src/client/manager/provider.js
+++ b/packages/react-storybook/src/client/manager/provider.js
@@ -22,7 +22,7 @@ export default class ReactProvider extends Provider {
renderPreview(selectedKind, selectedStory) {
const queryParams = {
selectedKind,
- selectedStory
+ selectedStory,
};
// Add the react-perf query string to the iframe if that present.
diff --git a/packages/react-storybook/src/client/preview/__tests__/client_api.js b/packages/react-storybook/src/client/preview/__tests__/client_api.js
index 91c9617878d1..e0d7ff8278eb 100644
--- a/packages/react-storybook/src/client/preview/__tests__/client_api.js
+++ b/packages/react-storybook/src/client/preview/__tests__/client_api.js
@@ -13,39 +13,30 @@ class StoryStore {
}
getStoryKinds() {
- return this.stories.reduce(
- (kinds, info) => {
- if (kinds.indexOf(info.kind) === -1) {
- kinds.push(info.kind);
- }
- return kinds;
- },
- []
- );
+ return this.stories.reduce((kinds, info) => {
+ if (kinds.indexOf(info.kind) === -1) {
+ kinds.push(info.kind);
+ }
+ return kinds;
+ }, []);
}
getStories(kind) {
- return this.stories.reduce(
- (stories, info) => {
- if (info.kind === kind) {
- stories.push(info.story);
- }
- return stories;
- },
- []
- );
+ return this.stories.reduce((stories, info) => {
+ if (info.kind === kind) {
+ stories.push(info.story);
+ }
+ return stories;
+ }, []);
}
getStory(kind, name) {
- return this.stories.reduce(
- (fn, info) => {
- if (!fn && info.kind === kind && info.story === name) {
- return info.fn;
- }
- return fn;
- },
- null
- );
+ return this.stories.reduce((fn, info) => {
+ if (!fn && info.kind === kind && info.story === name) {
+ return info.fn;
+ }
+ return fn;
+ }, null);
}
hasStory(kind, name) {
@@ -62,7 +53,7 @@ describe('preview.client_api', () => {
api.setAddon({
aa() {
data = 'foo';
- }
+ },
});
api.storiesOf('none').aa();
@@ -76,13 +67,13 @@ describe('preview.client_api', () => {
api.setAddon({
aa() {
data.push('foo');
- }
+ },
});
api.setAddon({
bb() {
data.push('bar');
- }
+ },
});
api.storiesOf('none').aa().bb();
@@ -96,7 +87,7 @@ describe('preview.client_api', () => {
api.setAddon({
aa() {
data = typeof this.add;
- }
+ },
});
api.storiesOf('none').aa();
@@ -110,13 +101,13 @@ describe('preview.client_api', () => {
api.setAddon({
aa() {
data = 'foo';
- }
+ },
});
api.setAddon({
bb() {
this.aa();
- }
+ },
});
api.storiesOf('none').bb();
@@ -131,7 +122,7 @@ describe('preview.client_api', () => {
api.setAddon({
aa() {
data = this.kind;
- }
+ },
});
api.storiesOf(kind).aa();
@@ -227,7 +218,7 @@ describe('preview.client_api', () => {
'story-1.1': () => 'story-1.1',
'story-1.2': () => 'story-1.2',
'story-2.1': () => 'story-2.1',
- 'story-2.2': () => 'story-2.2'
+ 'story-2.2': () => 'story-2.2',
};
const kind1 = api.storiesOf('kind-1');
kind1.add('story-1.1', functions['story-1.1']);
@@ -241,16 +232,16 @@ describe('preview.client_api', () => {
kind: 'kind-1',
stories: [
{ name: 'story-1.1', render: functions['story-1.1'] },
- { name: 'story-1.2', render: functions['story-1.2'] }
- ]
+ { name: 'story-1.2', render: functions['story-1.2'] },
+ ],
},
{
kind: 'kind-2',
stories: [
{ name: 'story-2.1', render: functions['story-2.1'] },
- { name: 'story-2.2', render: functions['story-2.2'] }
- ]
- }
+ { name: 'story-2.2', render: functions['story-2.2'] },
+ ],
+ },
]);
});
});
diff --git a/packages/react-storybook/src/client/preview/actions.js b/packages/react-storybook/src/client/preview/actions.js
index 81eaf57f2e28..f15e8676a205 100644
--- a/packages/react-storybook/src/client/preview/actions.js
+++ b/packages/react-storybook/src/client/preview/actions.js
@@ -2,26 +2,26 @@ export const types = {
SET_ERROR: 'PREVIEW_SET_ERROR',
CLEAR_ERROR: 'PREVIEW_CLEAR_ERROR',
SELECT_STORY: 'PREVIEW_SELECT_STORY',
- SET_INITIAL_STORY: 'PREVIEW_SET_INITIAL_STORY'
+ SET_INITIAL_STORY: 'PREVIEW_SET_INITIAL_STORY',
};
export function setInitialStory(storyKindList) {
return {
type: types.SET_INITIAL_STORY,
- storyKindList
+ storyKindList,
};
}
export function setError(error) {
return {
type: types.SET_ERROR,
- error
+ error,
};
}
export function clearError() {
return {
- type: types.CLEAR_ERROR
+ type: types.CLEAR_ERROR,
};
}
@@ -29,6 +29,6 @@ export function selectStory(kind, story) {
return {
type: types.SELECT_STORY,
kind,
- story
+ story,
};
}
diff --git a/packages/react-storybook/src/client/preview/client_api.js b/packages/react-storybook/src/client/preview/client_api.js
index e203b7b605e4..ecbabc571fae 100644
--- a/packages/react-storybook/src/client/preview/client_api.js
+++ b/packages/react-storybook/src/client/preview/client_api.js
@@ -11,7 +11,7 @@ export default class ClientApi {
setAddon(addon) {
this._addons = {
...this._addons,
- ...addon
+ ...addon,
};
}
@@ -36,7 +36,7 @@ export default class ClientApi {
const localDecorators = [];
const api = {
- kind
+ kind,
};
// apply addons
@@ -60,7 +60,7 @@ export default class ClientApi {
const fn = decorators.reduce(
(decorated, decorator) => context => decorator(() => decorated(context), context),
- getStory
+ getStory,
);
// Add the fully decorated getStory function.
diff --git a/packages/react-storybook/src/client/preview/error_display.js b/packages/react-storybook/src/client/preview/error_display.js
index 925e6f577bd1..0b4e51d8fcf6 100644
--- a/packages/react-storybook/src/client/preview/error_display.js
+++ b/packages/react-storybook/src/client/preview/error_display.js
@@ -10,7 +10,7 @@ const mainStyle = {
padding: 20,
backgroundColor: 'rgb(187, 49, 49)',
color: '#FFF',
- WebkitFontSmoothing: 'antialiased'
+ WebkitFontSmoothing: 'antialiased',
};
const headingStyle = {
@@ -21,13 +21,13 @@ const headingStyle = {
fontFamily: `
-apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI",
"Helvetica Neue", "Lucida Grande", sans-serif
- `
+ `,
};
const codeStyle = {
fontSize: 14,
width: '100vw',
- overflow: 'auto'
+ overflow: 'auto',
};
const ErrorDisplay = ({ error }) => (
@@ -42,7 +42,7 @@ const ErrorDisplay = ({ error }) => (
);
ErrorDisplay.propTypes = {
- error: PropTypes.object.isRequired
+ error: PropTypes.object.isRequired,
};
export default ErrorDisplay;
diff --git a/packages/react-storybook/src/client/preview/index.js b/packages/react-storybook/src/client/preview/index.js
index b005ae5a82fa..14abf6828f88 100644
--- a/packages/react-storybook/src/client/preview/index.js
+++ b/packages/react-storybook/src/client/preview/index.js
@@ -14,7 +14,8 @@ import reducer from './reducer';
// check whether we're running on node/browser
const { navigator } = global;
-const isBrowser = navigator &&
+const isBrowser =
+ navigator &&
navigator.userAgent !== 'storyshots' &&
!(navigator.userAgent.indexOf('Node.js') > -1);
diff --git a/packages/react-storybook/src/client/preview/reducer.js b/packages/react-storybook/src/client/preview/reducer.js
index a3b7012b8637..015df6c83915 100644
--- a/packages/react-storybook/src/client/preview/reducer.js
+++ b/packages/react-storybook/src/client/preview/reducer.js
@@ -5,14 +5,14 @@ export default function reducer(state = {}, action) {
case types.CLEAR_ERROR: {
return {
...state,
- error: null
+ error: null,
};
}
case types.SET_ERROR: {
return {
...state,
- error: action.error
+ error: action.error,
};
}
@@ -20,7 +20,7 @@ export default function reducer(state = {}, action) {
return {
...state,
selectedKind: action.kind,
- selectedStory: action.story
+ selectedStory: action.story,
};
}
diff --git a/packages/react-storybook/src/client/preview/render.js b/packages/react-storybook/src/client/preview/render.js
index 565c97c1f3c5..655615635525 100644
--- a/packages/react-storybook/src/client/preview/render.js
+++ b/packages/react-storybook/src/client/preview/render.js
@@ -67,7 +67,7 @@ export function renderMain(data, storyStore) {
const context = {
kind: selectedKind,
- story: selectedStory
+ story: selectedStory,
};
const element = story(context);
@@ -79,7 +79,7 @@ export function renderMain(data, storyStore) {
description: stripIndents`
Did you forget to return the React element from the story?
Use "() => (
)" or "() => { return
; }" when defining the story.
- `
+ `,
/* eslint-enable */
};
return renderError(error);
@@ -91,7 +91,7 @@ export function renderMain(data, storyStore) {
description: stripIndents`
Seems like you are not returning a correct React element from the story.
Could you double check that?
- `
+ `,
};
return renderError(error);
}
diff --git a/packages/react-storybook/src/client/preview/story_store.js b/packages/react-storybook/src/client/preview/story_store.js
index bf19ca5045bf..0cdb82fb0122 100644
--- a/packages/react-storybook/src/client/preview/story_store.js
+++ b/packages/react-storybook/src/client/preview/story_store.js
@@ -15,14 +15,14 @@ export default class StoryStore {
this._data[kind] = {
kind,
index: getId(),
- stories: {}
+ stories: {},
};
}
this._data[kind].stories[name] = {
name,
index: getId(),
- fn
+ fn,
};
}
diff --git a/packages/react-storybook/src/server/__tests__/utils.js b/packages/react-storybook/src/server/__tests__/utils.js
index baad93ebcc10..f7eb52794e22 100644
--- a/packages/react-storybook/src/server/__tests__/utils.js
+++ b/packages/react-storybook/src/server/__tests__/utils.js
@@ -10,7 +10,7 @@ describe('server.getHeadHtml', () => {
describe('when .storybook/head.html does not exist', () => {
beforeEach(() => {
mock({
- config: {}
+ config: {},
});
});
@@ -28,8 +28,8 @@ describe('server.getHeadHtml', () => {
beforeEach(() => {
mock({
config: {
- 'head.html': HEAD_HTML_CONTENTS
- }
+ 'head.html': HEAD_HTML_CONTENTS,
+ },
});
});
diff --git a/packages/react-storybook/src/server/babel_config.js b/packages/react-storybook/src/server/babel_config.js
index f57528904fe4..a49ef43975d0 100644
--- a/packages/react-storybook/src/server/babel_config.js
+++ b/packages/react-storybook/src/server/babel_config.js
@@ -70,7 +70,7 @@ export default function(configDir) {
finalConfig.plugins = finalConfig.plugins || [];
finalConfig.plugins.push([
require.resolve('babel-plugin-react-docgen'),
- { DOC_GEN_COLLECTION_NAME: 'STORYBOOK_REACT_CLASSES' }
+ { DOC_GEN_COLLECTION_NAME: 'STORYBOOK_REACT_CLASSES' },
]);
return finalConfig;
diff --git a/packages/react-storybook/src/server/build.js b/packages/react-storybook/src/server/build.js
index 0fff7569d129..d63279f5449a 100644
--- a/packages/react-storybook/src/server/build.js
+++ b/packages/react-storybook/src/server/build.js
@@ -34,8 +34,8 @@ if (program.enableDb || program.dbPath) {
[
'Error: the experimental local database addon is no longer bundled with',
'react-storybook. Please remove these flags (-d,--db-path,--enable-db)',
- 'from the command or npm script and try again.'
- ].join(' ')
+ 'from the command or npm script and try again.',
+ ].join(' '),
);
process.exit(1);
}
@@ -45,7 +45,7 @@ if (program.enableDb || program.dbPath) {
getEnvConfig(program, {
staticDir: 'SBCONFIG_STATIC_DIR',
outputDir: 'SBCONFIG_OUTPUT_DIR',
- configDir: 'SBCONFIG_CONFIG_DIR'
+ configDir: 'SBCONFIG_CONFIG_DIR',
});
const configDir = program.configDir || './.storybook';
@@ -85,7 +85,7 @@ webpack(config).run((err, stats) => {
const data = {
publicPath: config.output.publicPath,
- assets: stats.toJson().assetsByChunkName
+ assets: stats.toJson().assetsByChunkName,
};
const headHtml = getHeadHtml(configDir);
diff --git a/packages/react-storybook/src/server/config.js b/packages/react-storybook/src/server/config.js
index 3176cda32965..964cb9b1c7e5 100644
--- a/packages/react-storybook/src/server/config.js
+++ b/packages/react-storybook/src/server/config.js
@@ -69,16 +69,16 @@ export default function(configType, baseConfig, configDir) {
...config.module,
// We need to use our and custom rules.
...customConfig.module,
- rules: [...config.module.rules, ...(customConfig.module.rules || [])]
+ rules: [...config.module.rules, ...(customConfig.module.rules || [])],
},
resolve: {
...config.resolve,
...customConfig.resolve,
alias: {
...config.alias,
- ...(customConfig.resolve && customConfig.resolve.alias)
- }
- }
+ ...(customConfig.resolve && customConfig.resolve.alias),
+ },
+ },
};
return newConfig;
diff --git a/packages/react-storybook/src/server/config/babel.js b/packages/react-storybook/src/server/config/babel.js
index 1a8739a9eef8..eeec410c39a3 100644
--- a/packages/react-storybook/src/server/config/babel.js
+++ b/packages/react-storybook/src/server/config/babel.js
@@ -16,5 +16,5 @@ module.exports = {
// It enables a cache directory for faster-rebuilds
// `find-cache-dir` will create the cache directory under the node_modules directory.
cacheDirectory: findCacheDir({ name: 'react-storybook' }),
- presets: ['es2015', 'es2016', 'stage-0', 'react']
+ presets: ['es2015', 'es2016', 'stage-0', 'react'],
};
diff --git a/packages/react-storybook/src/server/config/babel.prod.js b/packages/react-storybook/src/server/config/babel.prod.js
index fa7cadd05248..8383f5d34687 100644
--- a/packages/react-storybook/src/server/config/babel.prod.js
+++ b/packages/react-storybook/src/server/config/babel.prod.js
@@ -10,5 +10,5 @@
module.exports = {
// Don't try to find .babelrc because we want to force this configuration.
babelrc: false,
- presets: ['es2015', 'es2016', 'stage-0', 'react']
+ presets: ['es2015', 'es2016', 'stage-0', 'react'],
};
diff --git a/packages/react-storybook/src/server/config/defaults/webpack.config.js b/packages/react-storybook/src/server/config/defaults/webpack.config.js
index 8a05bb7083fc..69ec7d68f6ab 100644
--- a/packages/react-storybook/src/server/config/defaults/webpack.config.js
+++ b/packages/react-storybook/src/server/config/defaults/webpack.config.js
@@ -4,29 +4,47 @@ import { includePaths } from '../utils';
// Add a default custom config which is similar to what React Create App does.
module.exports = storybookBaseConfig => {
const newConfig = { ...storybookBaseConfig };
- newConfig.module.loaders = [
- ...storybookBaseConfig.module.loaders,
+ newConfig.plugins = [
+ ...storybookBaseConfig.plugins,
+ new webpack.LoaderOptionsPlugin({
+ options: {
+ postcss: [
+ autoprefixer({
+ browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
+ }),
+ ],
+ },
+ }),
+ ];
+ newConfig.module.rules = [
+ ...storybookBaseConfig.module.rules,
{
test: /\.css?$/,
include: includePaths,
- loaders: [
- require.resolve('style-loader'),
- `${require.resolve('css-loader')}?importLoaders=1`,
- require.resolve('postcss-loader')
- ]
+ exclude: excludePaths,
+ use: [
+ 'style-loader',
+ {
+ loader: 'css-loader',
+ options: {
+ importLoaders: 1,
+ },
+ },
+ 'postcss-loader',
+ ],
},
{
test: /\.json$/,
include: includePaths,
- loader: require.resolve('json-loader')
+ loader: require.resolve('json-loader'),
},
{
test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2)(\?.*)?$/,
include: includePaths,
loader: require.resolve('file-loader'),
query: {
- name: 'static/media/[name].[hash:8].[ext]'
- }
+ name: 'static/media/[name].[hash:8].[ext]',
+ },
},
{
test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/,
@@ -34,21 +52,21 @@ module.exports = storybookBaseConfig => {
loader: require.resolve('url-loader'),
query: {
limit: 10000,
- name: 'static/media/[name].[hash:8].[ext]'
- }
- }
+ name: 'static/media/[name].[hash:8].[ext]',
+ },
+ },
];
newConfig.postcss = () => [
autoprefixer({
- browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9']
- })
+ browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
+ }),
];
newConfig.resolve.alias = {
...storybookBaseConfig.resolve.alias,
// This is to support NPM2
- 'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator')
+ 'babel-runtime/regenerator': require.resolve('babel-runtime/regenerator'),
};
// Return the altered config
diff --git a/packages/react-storybook/src/server/config/utils.js b/packages/react-storybook/src/server/config/utils.js
index e54d7a58be16..8cb15c640d93 100644
--- a/packages/react-storybook/src/server/config/utils.js
+++ b/packages/react-storybook/src/server/config/utils.js
@@ -20,7 +20,7 @@ export function loadEnv(options = {}) {
// In production we set this to dot(.) to allow the browser to access these assests
// even when deployed inside a subpath. (like in GitHub pages)
// In development this is just empty as we always serves from the root.
- PUBLIC_URL: JSON.stringify(options.production ? '.' : '')
+ PUBLIC_URL: JSON.stringify(options.production ? '.' : ''),
};
Object.keys(process.env).filter(name => /^STORYBOOK_/.test(name)).forEach(name => {
@@ -28,6 +28,6 @@ export function loadEnv(options = {}) {
});
return {
- 'process.env': env
+ 'process.env': env,
};
}
diff --git a/packages/react-storybook/src/server/config/webpack.config.js b/packages/react-storybook/src/server/config/webpack.config.js
index 53d27804f62f..5caed1b869e5 100644
--- a/packages/react-storybook/src/server/config/webpack.config.js
+++ b/packages/react-storybook/src/server/config/webpack.config.js
@@ -13,19 +13,19 @@ export default function() {
preview: [
require.resolve('./polyfills'),
require.resolve('./globals'),
- `${require.resolve('webpack-hot-middleware/client')}?reload=true`
- ]
+ `${require.resolve('webpack-hot-middleware/client')}?reload=true`,
+ ],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'static/[name].bundle.js',
- publicPath: '/'
+ publicPath: '/',
},
plugins: [
new webpack.DefinePlugin(loadEnv()),
new webpack.HotModuleReplacementPlugin(),
new CaseSensitivePathsPlugin(),
- new WatchMissingNodeModulesPlugin(nodeModulesPaths)
+ new WatchMissingNodeModulesPlugin(nodeModulesPaths),
],
module: {
rules: [
@@ -34,9 +34,9 @@ export default function() {
loader: require.resolve('babel-loader'),
query: babelLoaderConfig,
include: includePaths,
- exclude: excludePaths
- }
- ]
+ exclude: excludePaths,
+ },
+ ],
},
resolve: {
// Since we ship with json-loader always, it's better to move extensions to here
@@ -44,8 +44,8 @@ export default function() {
extensions: ['.js', '.json', '.jsx'],
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
- modules: ['node_modules'].concat(nodePaths)
- }
+ modules: ['node_modules'].concat(nodePaths),
+ },
};
return config;
diff --git a/packages/react-storybook/src/server/config/webpack.config.prod.js b/packages/react-storybook/src/server/config/webpack.config.prod.js
index 2135b7ba0edf..989b1adca7ad 100644
--- a/packages/react-storybook/src/server/config/webpack.config.prod.js
+++ b/packages/react-storybook/src/server/config/webpack.config.prod.js
@@ -6,7 +6,7 @@ import { includePaths, excludePaths, loadEnv, nodePaths } from './utils';
export default function() {
const entries = {
preview: [require.resolve('./polyfills'), require.resolve('./globals')],
- manager: [require.resolve('./polyfills'), path.resolve(__dirname, '../../client/manager')]
+ manager: [require.resolve('./polyfills'), path.resolve(__dirname, '../../client/manager')],
};
const config = {
@@ -20,21 +20,21 @@ export default function() {
// This works with css and image loaders too.
// This is working for storybook since, we don't use pushState urls and
// relative URLs works always.
- publicPath: ''
+ publicPath: '',
},
plugins: [
new webpack.DefinePlugin(loadEnv({ production: true })),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
- warnings: false
+ warnings: false,
},
mangle: false,
output: {
comments: false,
- screw_ie8: true
- }
- })
+ screw_ie8: true,
+ },
+ }),
],
module: {
rules: [
@@ -43,9 +43,9 @@ export default function() {
loader: require.resolve('babel-loader'),
query: babelLoaderConfig,
include: includePaths,
- exclude: excludePaths
- }
- ]
+ exclude: excludePaths,
+ },
+ ],
},
resolve: {
// Since we ship with json-loader always, it's better to move extensions to here
@@ -53,8 +53,8 @@ export default function() {
extensions: ['.js', '.json', '.jsx'],
// Add support to NODE_PATH. With this we could avoid relative path imports.
// Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253
- modules: ['node_modules'].concat(nodePaths)
- }
+ modules: ['node_modules'].concat(nodePaths),
+ },
};
return config;
diff --git a/packages/react-storybook/src/server/iframe.html.js b/packages/react-storybook/src/server/iframe.html.js
index 9121754c3878..8c6d19ef77c2 100644
--- a/packages/react-storybook/src/server/iframe.html.js
+++ b/packages/react-storybook/src/server/iframe.html.js
@@ -11,19 +11,19 @@ import url from 'url';
const previewUrlsFromAssets = assets => {
if (!assets) {
return {
- js: 'static/preview.bundle.js'
+ js: 'static/preview.bundle.js',
};
}
if (typeof assets.preview === 'string') {
return {
- js: assets.preview
+ js: assets.preview,
};
}
return {
js: assets.preview.find(filename => filename.match(/\.js$/)),
- css: assets.preview.find(filename => filename.match(/\.css$/))
+ css: assets.preview.find(filename => filename.match(/\.css$/)),
};
};
diff --git a/packages/react-storybook/src/server/index.html.js b/packages/react-storybook/src/server/index.html.js
index bff1b58d43bd..6e0236e6aaaa 100644
--- a/packages/react-storybook/src/server/index.html.js
+++ b/packages/react-storybook/src/server/index.html.js
@@ -11,19 +11,19 @@ import { version } from '../../package.json';
const managerUrlsFromAssets = assets => {
if (!assets || !assets.manager) {
return {
- js: 'static/manager.bundle.js'
+ js: 'static/manager.bundle.js',
};
}
if (typeof assets.manager === 'string') {
return {
- js: assets.manager
+ js: assets.manager,
};
}
return {
js: assets.manager.find(filename => filename.match(/\.js$/)),
- css: assets.manager.find(filename => filename.match(/\.css$/))
+ css: assets.manager.find(filename => filename.match(/\.css$/)),
};
};
diff --git a/packages/react-storybook/src/server/index.js b/packages/react-storybook/src/server/index.js
index 6ff21cf36fb8..7a347c540884 100755
--- a/packages/react-storybook/src/server/index.js
+++ b/packages/react-storybook/src/server/index.js
@@ -25,12 +25,12 @@ program
.option('--dont-track', 'Do not send anonymous usage stats.')
.option(
'--https',
- 'Serve Storybook over HTTPS. Note: You must provide your own certificate information.'
+ 'Serve Storybook over HTTPS. Note: You must provide your own certificate information.',
)
.option(
'--ssl-ca
',
'Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)',
- parseList
+ parseList,
)
.option('--ssl-cert ', 'Provide an SSL certificate. (Required with --https)')
.option('--ssl-key ', 'Provide an SSL key. (Required with --https)')
@@ -45,8 +45,8 @@ if (program.enableDb || program.dbPath) {
[
'Error: the experimental local database addon is no longer bundled with',
'react-storybook. Please remove these flags (-d,--db-path,--enable-db)',
- 'from the command or npm script and try again.'
- ].join(' ')
+ 'from the command or npm script and try again.',
+ ].join(' '),
);
process.exit(1);
}
@@ -58,7 +58,7 @@ getEnvConfig(program, {
host: 'SBCONFIG_HOSTNAME',
staticDir: 'SBCONFIG_STATIC_DIR',
configDir: 'SBCONFIG_CONFIG_DIR',
- dontTrack: 'SBCONFIG_DO_NOT_TRACK'
+ dontTrack: 'SBCONFIG_DO_NOT_TRACK',
});
if (program.dontTrack) {
@@ -94,7 +94,7 @@ if (program.https) {
const sslOptions = {
ca: (program.sslCa || []).map(ca => fs.readFileSync(ca, 'utf-8')),
cert: fs.readFileSync(program.sslCert, 'utf-8'),
- key: fs.readFileSync(program.sslKey, 'utf-8')
+ key: fs.readFileSync(program.sslKey, 'utf-8'),
};
server = https.createServer(sslOptions, app);
@@ -132,10 +132,10 @@ const configDir = program.configDir || './.storybook';
// The repository info is sent to the storybook while running on
// development mode so it'll be easier for tools to integrate.
const exec = cmd => shelljs.exec(cmd, { silent: true }).stdout.trim();
-process.env.STORYBOOK_GIT_ORIGIN = process.env.STORYBOOK_GIT_ORIGIN ||
- exec('git remote get-url origin');
-process.env.STORYBOOK_GIT_BRANCH = process.env.STORYBOOK_GIT_BRANCH ||
- exec('git symbolic-ref HEAD --short');
+process.env.STORYBOOK_GIT_ORIGIN =
+ process.env.STORYBOOK_GIT_ORIGIN || exec('git remote get-url origin');
+process.env.STORYBOOK_GIT_BRANCH =
+ process.env.STORYBOOK_GIT_BRANCH || exec('git symbolic-ref HEAD --short');
// NOTE changes to env should be done before calling `getBaseConfig`
// `getBaseConfig` function which is called inside the middleware
diff --git a/packages/react-storybook/src/server/middleware.js b/packages/react-storybook/src/server/middleware.js
index 41048dee46e9..e2ca8d2ace87 100644
--- a/packages/react-storybook/src/server/middleware.js
+++ b/packages/react-storybook/src/server/middleware.js
@@ -25,7 +25,7 @@ export default function(configDir) {
noInfo: true,
publicPath: config.output.publicPath,
watchOptions: config.watchOptions || {},
- ...config.devServer
+ ...config.devServer,
};
const router = new Router();
diff --git a/packages/react-storybook/src/server/track_usage.js b/packages/react-storybook/src/server/track_usage.js
index 45c3821fabe8..cec6d02a9169 100644
--- a/packages/react-storybook/src/server/track_usage.js
+++ b/packages/react-storybook/src/server/track_usage.js
@@ -68,10 +68,10 @@ export function track() {
{
json: {
userId,
- version: pkg.version
- }
+ version: pkg.version,
+ },
},
- () => {}
+ () => {},
);
if (!store.get('startTrackingOn')) {
diff --git a/packages/storybook-ui/example/client/preview.js b/packages/storybook-ui/example/client/preview.js
index 4064861613bf..11c719ff542e 100644
--- a/packages/storybook-ui/example/client/preview.js
+++ b/packages/storybook-ui/example/client/preview.js
@@ -2,7 +2,7 @@ import React from 'react';
const mainStyle = {
padding: 10,
- fontFamily: 'arial'
+ fontFamily: 'arial',
};
export default class Preview extends React.Component {
@@ -15,13 +15,13 @@ export default class Preview extends React.Component {
if (this.mounted) {
this.setState({
kind,
- story
+ story,
});
} else {
this.state = {
...this.state,
kind,
- story
+ story,
};
}
});
diff --git a/packages/storybook-ui/example/client/provider.js b/packages/storybook-ui/example/client/provider.js
index 205497a288bc..e95f76c55c00 100644
--- a/packages/storybook-ui/example/client/provider.js
+++ b/packages/storybook-ui/example/client/provider.js
@@ -11,7 +11,7 @@ const style = {
flex: 1,
display: 'flex',
alignItems: 'center',
- justifyContent: 'center'
+ justifyContent: 'center',
};
export default class ReactProvider extends Provider {
@@ -43,20 +43,20 @@ export default class ReactProvider extends Provider {
/>
);
- }
+ },
},
test2: {
title: 'Test 2',
- render: () => II
+ render: () => II
,
},
test3: {
title: 'Test 3',
- render: () => III
+ render: () => III
,
},
test4: {
title: 'Test 4',
- render: () => IV
- }
+ render: () => IV
,
+ },
};
return panels;
}
@@ -77,20 +77,20 @@ export default class ReactProvider extends Provider {
handleAPI(api) {
this.api = api;
this.api.setOptions({
- name: 'REACT-STORYBOOK'
+ name: 'REACT-STORYBOOK',
});
// set stories
this.api.setStories([
{
kind: 'Component 1',
- stories: ['State 1', 'State 2']
+ stories: ['State 1', 'State 2'],
},
{
kind: 'Component 2',
- stories: ['State a', 'State b']
- }
+ stories: ['State a', 'State b'],
+ },
]);
// listen to the story change and update the preview.
@@ -113,7 +113,7 @@ export default class ReactProvider extends Provider {
ctrlKey: true,
shiftKey: true,
keyCode: keycode('F'),
- preventDefault() {}
+ preventDefault() {},
};
const parsedEvent = parseKeyEvent(event);
this.api.handleShortcut(parsedEvent);
diff --git a/packages/storybook-ui/example/server.js b/packages/storybook-ui/example/server.js
index 010bb65dc5b8..8867ab57f46d 100644
--- a/packages/storybook-ui/example/server.js
+++ b/packages/storybook-ui/example/server.js
@@ -5,7 +5,7 @@ const config = require('./webpack.config');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: false,
- historyApiFallback: true
+ historyApiFallback: true,
}).listen(9999, 'localhost', (err, result) => {
if (err) {
return console.log(err);
diff --git a/packages/storybook-ui/example/webpack.config.js b/packages/storybook-ui/example/webpack.config.js
index 5af382f9d480..83f56d360bb1 100644
--- a/packages/storybook-ui/example/webpack.config.js
+++ b/packages/storybook-ui/example/webpack.config.js
@@ -5,12 +5,12 @@ module.exports = {
devtool: 'eval',
entry: [
`${require.resolve('webpack-dev-server/client')}?http://localhost:9999`,
- './client/index'
+ './client/index',
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
- publicPath: '/static/'
+ publicPath: '/static/',
},
plugins: [new webpack.HotModuleReplacementPlugin()],
module: {
@@ -19,8 +19,8 @@ module.exports = {
test: /\.js$/,
loader: require.resolve('babel-loader'),
query: { presets: ['react', 'es2015', 'stage-0'] },
- include: [path.join(__dirname, 'client'), path.resolve(__dirname, '../src')]
- }
- ]
- }
+ include: [path.join(__dirname, 'client'), path.resolve(__dirname, '../src')],
+ },
+ ],
+ },
};
diff --git a/packages/storybook-ui/src/compose.js b/packages/storybook-ui/src/compose.js
index 8c8e5ae643b0..8b6f28352a0e 100644
--- a/packages/storybook-ui/src/compose.js
+++ b/packages/storybook-ui/src/compose.js
@@ -16,8 +16,8 @@ const compose = setDefaults({
pure: true,
env: {
context: () => context,
- actions: () => actions
- }
+ actions: () => actions,
+ },
});
export default compose;
diff --git a/packages/storybook-ui/src/context.js b/packages/storybook-ui/src/context.js
index dcd6b90d4424..211e0dadb9b0 100644
--- a/packages/storybook-ui/src/context.js
+++ b/packages/storybook-ui/src/context.js
@@ -2,6 +2,6 @@ export default function(clientStore, domNode, provider) {
return {
clientStore,
domNode,
- provider
+ provider,
};
}
diff --git a/packages/storybook-ui/src/index.js b/packages/storybook-ui/src/index.js
index bf596f35480a..360135418416 100644
--- a/packages/storybook-ui/src/index.js
+++ b/packages/storybook-ui/src/index.js
@@ -27,7 +27,7 @@ export default function(domNode, provider) {
const defaultState = {
...shortcutsModule.defaultState,
...apiModule.defaultState,
- ...uiModule.defaultState
+ ...uiModule.defaultState,
};
const clientStore = new Podda(defaultState);
clientStore.registerAPI('toggle', (store, key) => store.set(key, !store.get(key)));
diff --git a/packages/storybook-ui/src/libs/key_events.js b/packages/storybook-ui/src/libs/key_events.js
index aa2e778a91b1..e9db25eb5be1 100755
--- a/packages/storybook-ui/src/libs/key_events.js
+++ b/packages/storybook-ui/src/libs/key_events.js
@@ -9,7 +9,7 @@ export const features = {
NEXT_STORY: 6,
PREV_STORY: 7,
SEARCH: 8,
- DOWN_PANEL_IN_RIGHT: 9
+ DOWN_PANEL_IN_RIGHT: 9,
};
export function isModifierPressed(e) {
@@ -17,8 +17,9 @@ export function isModifierPressed(e) {
}
function focusInInput(e) {
- return /input|textarea/i.test(e.target.tagName) ||
- e.target.getAttribute('contenteditable') !== null;
+ return (
+ /input|textarea/i.test(e.target.tagName) || e.target.getAttribute('contenteditable') !== null
+ );
}
export default function handle(e) {
diff --git a/packages/storybook-ui/src/modules/api/actions/__tests__/api.js b/packages/storybook-ui/src/modules/api/actions/__tests__/api.js
index 5412e41e4e84..be00d0ca3efc 100755
--- a/packages/storybook-ui/src/modules/api/actions/__tests__/api.js
+++ b/packages/storybook-ui/src/modules/api/actions/__tests__/api.js
@@ -10,7 +10,7 @@ class MockClientStore {
const stories = [
{ kind: 'abc', stories: ['a', 'b', 'c'] },
- { kind: 'bbc', stories: ['x', 'y', 'z'] }
+ { kind: 'bbc', stories: ['x', 'y', 'z'] },
];
describe('manager.api.actions.api', () => {
@@ -24,7 +24,7 @@ describe('manager.api.actions.api', () => {
expect(newState).to.deep.equal({
stories,
selectedKind: 'abc',
- selectedStory: 'a'
+ selectedStory: 'a',
});
});
});
@@ -36,13 +36,13 @@ describe('manager.api.actions.api', () => {
const state = {
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const newState = clientStore.updateCallback(state);
expect(newState).to.deep.equal({
stories,
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
});
});
});
@@ -54,13 +54,13 @@ describe('manager.api.actions.api', () => {
const state = {
selectedKind: 'bbc',
- selectedStory: 'k'
+ selectedStory: 'k',
};
const newState = clientStore.updateCallback(state);
expect(newState).to.deep.equal({
stories,
selectedKind: 'bbc',
- selectedStory: 'x'
+ selectedStory: 'x',
});
});
});
@@ -72,13 +72,13 @@ describe('manager.api.actions.api', () => {
const state = {
selectedKind: 'kky',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const newState = clientStore.updateCallback(state);
expect(newState).to.deep.equal({
stories,
selectedKind: 'abc',
- selectedStory: 'a'
+ selectedStory: 'a',
});
});
});
@@ -93,12 +93,12 @@ describe('manager.api.actions.api', () => {
const state = {
stories,
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
selectedKind: 'bbc',
- selectedStory: 'y'
+ selectedStory: 'y',
});
});
});
@@ -111,12 +111,12 @@ describe('manager.api.actions.api', () => {
const state = {
stories,
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
selectedKind: 'bbc',
- selectedStory: 'x'
+ selectedStory: 'x',
});
});
});
@@ -131,12 +131,12 @@ describe('manager.api.actions.api', () => {
const state = {
stories,
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
selectedKind: 'bbc',
- selectedStory: 'x'
+ selectedStory: 'x',
});
});
@@ -147,12 +147,12 @@ describe('manager.api.actions.api', () => {
const state = {
stories,
selectedKind: 'abc',
- selectedStory: 'c'
+ selectedStory: 'c',
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
selectedKind: 'abc',
- selectedStory: 'b'
+ selectedStory: 'b',
});
});
});
@@ -165,12 +165,12 @@ describe('manager.api.actions.api', () => {
const state = {
stories,
selectedKind: 'bbc',
- selectedStory: 'z'
+ selectedStory: 'z',
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
selectedKind: 'bbc',
- selectedStory: 'z'
+ selectedStory: 'z',
});
});
});
@@ -182,12 +182,12 @@ describe('manager.api.actions.api', () => {
actions.setOptions({ clientStore }, { abc: 10 });
const state = {
- uiOptions: { bbc: 50, abc: 40 }
+ uiOptions: { bbc: 50, abc: 40 },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- uiOptions: { bbc: 50, abc: 10 }
+ uiOptions: { bbc: 50, abc: 10 },
});
});
@@ -196,12 +196,12 @@ describe('manager.api.actions.api', () => {
actions.setOptions({ clientStore }, { abc: 10, notGoingToState: 20 });
const state = {
- uiOptions: { bbc: 50, abc: 40 }
+ uiOptions: { bbc: 50, abc: 40 },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- uiOptions: { bbc: 50, abc: 10 }
+ uiOptions: { bbc: 50, abc: 10 },
});
});
});
@@ -212,12 +212,12 @@ describe('manager.api.actions.api', () => {
actions.setQueryParams({ clientStore }, { abc: 'aaa', cnn: 'ccc' });
const state = {
- customQueryParams: { bbc: 'bbb', abc: 'sshd' }
+ customQueryParams: { bbc: 'bbb', abc: 'sshd' },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- customQueryParams: { bbc: 'bbb', abc: 'aaa', cnn: 'ccc' }
+ customQueryParams: { bbc: 'bbb', abc: 'aaa', cnn: 'ccc' },
});
});
@@ -226,12 +226,12 @@ describe('manager.api.actions.api', () => {
actions.setQueryParams({ clientStore }, { abc: null, bbc: 'ccc' });
const state = {
- customQueryParams: { bbc: 'bbb', abc: 'sshd' }
+ customQueryParams: { bbc: 'bbb', abc: 'sshd' },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- customQueryParams: { bbc: 'ccc' }
+ customQueryParams: { bbc: 'ccc' },
});
});
});
diff --git a/packages/storybook-ui/src/modules/api/actions/api.js b/packages/storybook-ui/src/modules/api/actions/api.js
index 98f4d4fe1dea..ecd7c0727a79 100755
--- a/packages/storybook-ui/src/modules/api/actions/api.js
+++ b/packages/storybook-ui/src/modules/api/actions/api.js
@@ -20,7 +20,7 @@ export function jumpToStory(storyKinds, selectedKind, selectedStory, direction)
return {
selectedKind: jumpedStory.kind,
- selectedStory: jumpedStory.story
+ selectedStory: jumpedStory.story,
};
}
@@ -56,7 +56,7 @@ export default {
return {
stories,
selectedStory,
- selectedKind
+ selectedKind,
};
});
},
@@ -72,7 +72,8 @@ export default {
jumpToStory({ clientStore }, direction) {
clientStore.update(state =>
- jumpToStory(state.stories, state.selectedKind, state.selectedStory, direction));
+ jumpToStory(state.stories, state.selectedKind, state.selectedStory, direction),
+ );
},
setOptions({ clientStore }, options) {
@@ -80,7 +81,7 @@ export default {
const newOptions = pick(options, Object.keys(state.uiOptions));
const updatedOptions = {
...state.uiOptions,
- ...newOptions
+ ...newOptions,
};
return { uiOptions: updatedOptions };
@@ -91,7 +92,7 @@ export default {
clientStore.update(state => {
const updatedQueryParams = {
...state.customQueryParams,
- ...customQueryParams
+ ...customQueryParams,
};
Object.keys(customQueryParams).forEach(key => {
@@ -101,8 +102,8 @@ export default {
});
return {
- customQueryParams: updatedQueryParams
+ customQueryParams: updatedQueryParams,
};
});
- }
+ },
};
diff --git a/packages/storybook-ui/src/modules/api/actions/index.js b/packages/storybook-ui/src/modules/api/actions/index.js
index 8d44aebeeae6..7cb6cc41d693 100755
--- a/packages/storybook-ui/src/modules/api/actions/index.js
+++ b/packages/storybook-ui/src/modules/api/actions/index.js
@@ -1,5 +1,5 @@
import api from './api';
export default {
- api
+ api,
};
diff --git a/packages/storybook-ui/src/modules/api/configs/__tests__/init_api.js b/packages/storybook-ui/src/modules/api/configs/__tests__/init_api.js
index 1d8e560e50e8..0104d3970808 100644
--- a/packages/storybook-ui/src/modules/api/configs/__tests__/init_api.js
+++ b/packages/storybook-ui/src/modules/api/configs/__tests__/init_api.js
@@ -9,15 +9,15 @@ describe('manager.api.config.initApi', () => {
api: {
setStories: sinon.stub(),
selectStory: sinon.stub(),
- setQueryParams: sinon.stub()
+ setQueryParams: sinon.stub(),
},
shortcuts: {
- handleEvent: sinon.stub()
- }
+ handleEvent: sinon.stub(),
+ },
};
const clientStore = {
- subscribe: sinon.stub()
+ subscribe: sinon.stub(),
};
const provider = {
@@ -28,7 +28,7 @@ describe('manager.api.config.initApi', () => {
expect(typeof api.onStory).to.be.equal('function');
expect(typeof api.setQueryParams).to.be.equal('function');
done();
- }
+ },
};
initApi(provider, clientStore, actions);
@@ -43,8 +43,8 @@ describe('manager.api.config.initApi', () => {
subscribe: sinon.stub(),
getAll: () => ({
selectedKind,
- selectedStory
- })
+ selectedStory,
+ }),
};
const provider = {
@@ -54,7 +54,7 @@ describe('manager.api.config.initApi', () => {
expect(story).to.be.equal(selectedStory);
done();
});
- }
+ },
};
initApi(provider, clientStore, actions);
@@ -71,8 +71,8 @@ describe('manager.api.config.initApi', () => {
subscribe: sinon.stub(),
getAll: () => ({
selectedKind,
- selectedStory
- })
+ selectedStory,
+ }),
};
const provider = {
@@ -87,7 +87,7 @@ describe('manager.api.config.initApi', () => {
expect(cnt).to.be.equal(2);
done();
});
- }
+ },
};
initApi(provider, clientStore, actions);
@@ -104,8 +104,8 @@ describe('manager.api.config.initApi', () => {
subscribe: sinon.stub(),
getAll: () => ({
selectedKind,
- selectedStory
- })
+ selectedStory,
+ }),
};
const provider = {
@@ -121,7 +121,7 @@ describe('manager.api.config.initApi', () => {
expect(cnt).to.be.equal(1);
done();
});
- }
+ },
};
initApi(provider, clientStore, actions);
@@ -138,9 +138,9 @@ describe('manager.api.config.initApi', () => {
getAll: () => ({
customQueryParams: {
foo: 'foo value',
- bar: 'bar value'
- }
- })
+ bar: 'bar value',
+ },
+ }),
};
const provider = {
@@ -148,7 +148,7 @@ describe('manager.api.config.initApi', () => {
const value = api.getQueryParam('foo');
expect(value).to.be.equal('foo value');
done();
- }
+ },
};
initApi(provider, clientStore, actions);
diff --git a/packages/storybook-ui/src/modules/api/configs/init_api.js b/packages/storybook-ui/src/modules/api/configs/init_api.js
index 68c290696e64..841a4946dc25 100644
--- a/packages/storybook-ui/src/modules/api/configs/init_api.js
+++ b/packages/storybook-ui/src/modules/api/configs/init_api.js
@@ -35,7 +35,7 @@ export default function(provider, clientStore, actions) {
return state.customQueryParams[key];
}
return undefined;
- }
+ },
};
provider.handleAPI(providerApi);
diff --git a/packages/storybook-ui/src/modules/api/index.js b/packages/storybook-ui/src/modules/api/index.js
index caa831fed469..b708e5d32ccf 100755
--- a/packages/storybook-ui/src/modules/api/index.js
+++ b/packages/storybook-ui/src/modules/api/index.js
@@ -7,10 +7,10 @@ export default {
uiOptions: {
name: 'REACT STORYBOOK',
url: 'https://github.com/storybooks/react-storybook',
- sortStoriesByKind: false
- }
+ sortStoriesByKind: false,
+ },
},
load({ clientStore, provider }, _actions) {
initApi(provider, clientStore, _actions);
- }
+ },
};
diff --git a/packages/storybook-ui/src/modules/shortcuts/actions/__tests__/shortcuts.js b/packages/storybook-ui/src/modules/shortcuts/actions/__tests__/shortcuts.js
index a527133baff3..d2f567c235b8 100644
--- a/packages/storybook-ui/src/modules/shortcuts/actions/__tests__/shortcuts.js
+++ b/packages/storybook-ui/src/modules/shortcuts/actions/__tests__/shortcuts.js
@@ -15,12 +15,12 @@ describe('manager.shortcuts.actions.shortcuts', () => {
actions.setOptions({ clientStore }, { abc: 10 });
const state = {
- shortcutOptions: { bbc: 50, abc: 40 }
+ shortcutOptions: { bbc: 50, abc: 40 },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- shortcutOptions: { bbc: 50, abc: 10 }
+ shortcutOptions: { bbc: 50, abc: 10 },
});
});
@@ -29,12 +29,12 @@ describe('manager.shortcuts.actions.shortcuts', () => {
actions.setOptions({ clientStore }, { abc: 10, kki: 50 });
const state = {
- shortcutOptions: { bbc: 50, abc: 40 }
+ shortcutOptions: { bbc: 50, abc: 40 },
};
const stateUpdates = clientStore.updateCallback(state);
expect(stateUpdates).to.deep.equal({
- shortcutOptions: { bbc: 50, abc: 10 }
+ shortcutOptions: { bbc: 50, abc: 10 },
});
});
});
diff --git a/packages/storybook-ui/src/modules/shortcuts/actions/index.js b/packages/storybook-ui/src/modules/shortcuts/actions/index.js
index f4b383a8e0c0..1f8965d3d05e 100755
--- a/packages/storybook-ui/src/modules/shortcuts/actions/index.js
+++ b/packages/storybook-ui/src/modules/shortcuts/actions/index.js
@@ -1,5 +1,5 @@
import shortcuts from './shortcuts';
export default {
- shortcuts
+ shortcuts,
};
diff --git a/packages/storybook-ui/src/modules/shortcuts/actions/shortcuts.js b/packages/storybook-ui/src/modules/shortcuts/actions/shortcuts.js
index 891b6962bb2c..bb6c4d40e4f9 100755
--- a/packages/storybook-ui/src/modules/shortcuts/actions/shortcuts.js
+++ b/packages/storybook-ui/src/modules/shortcuts/actions/shortcuts.js
@@ -34,11 +34,11 @@ export default {
const newOptions = keyEventToOptions(state.shortcutOptions, event);
const updatedOptions = {
...state.shortcutOptions,
- ...newOptions
+ ...newOptions,
};
return {
- shortcutOptions: updatedOptions
+ shortcutOptions: updatedOptions,
};
});
}
@@ -48,12 +48,12 @@ export default {
clientStore.update(state => {
const updatedOptions = {
...state.shortcutOptions,
- ...pick(options, Object.keys(state.shortcutOptions))
+ ...pick(options, Object.keys(state.shortcutOptions)),
};
return {
- shortcutOptions: updatedOptions
+ shortcutOptions: updatedOptions,
};
});
- }
+ },
};
diff --git a/packages/storybook-ui/src/modules/shortcuts/index.js b/packages/storybook-ui/src/modules/shortcuts/index.js
index b0b95761c8f8..b86918e2d854 100755
--- a/packages/storybook-ui/src/modules/shortcuts/index.js
+++ b/packages/storybook-ui/src/modules/shortcuts/index.js
@@ -8,7 +8,7 @@ export default {
showLeftPanel: true,
showDownPanel: true,
showSearchBox: false,
- downPanelInRight: false
- }
- }
+ downPanelInRight: false,
+ },
+ },
};
diff --git a/packages/storybook-ui/src/modules/ui/actions/__tests__/ui.js b/packages/storybook-ui/src/modules/ui/actions/__tests__/ui.js
index 4de2b0501fcc..a21535926fc8 100755
--- a/packages/storybook-ui/src/modules/ui/actions/__tests__/ui.js
+++ b/packages/storybook-ui/src/modules/ui/actions/__tests__/ui.js
@@ -7,7 +7,7 @@ describe('manager.ui.actions.ui', () => {
describe('setStoryFilter', () => {
it('should set the given filter', () => {
const clientStore = {
- set: sinon.stub()
+ set: sinon.stub(),
};
const filter = 'kkkind';
@@ -20,7 +20,7 @@ describe('manager.ui.actions.ui', () => {
describe('toggleShortcutsHelp', () => {
it('should toggle the client sotre accordingly', () => {
const clientStore = {
- toggle: sinon.stub()
+ toggle: sinon.stub(),
};
actions.toggleShortcutsHelp({ clientStore });
@@ -32,7 +32,7 @@ describe('manager.ui.actions.ui', () => {
describe('selectDownPanel', () => {
it('should set the given panel name', () => {
const clientStore = {
- set: sinon.stub()
+ set: sinon.stub(),
};
const panelName = 'kkkind';
diff --git a/packages/storybook-ui/src/modules/ui/actions/index.js b/packages/storybook-ui/src/modules/ui/actions/index.js
index 9656c05d1df1..f3bb72336a4e 100755
--- a/packages/storybook-ui/src/modules/ui/actions/index.js
+++ b/packages/storybook-ui/src/modules/ui/actions/index.js
@@ -1,5 +1,5 @@
import ui from './ui';
export default {
- ui
+ ui,
};
diff --git a/packages/storybook-ui/src/modules/ui/actions/ui.js b/packages/storybook-ui/src/modules/ui/actions/ui.js
index e083da8af5d3..97e572bc5421 100755
--- a/packages/storybook-ui/src/modules/ui/actions/ui.js
+++ b/packages/storybook-ui/src/modules/ui/actions/ui.js
@@ -9,5 +9,5 @@ export default {
selectDownPanel({ clientStore }, panelName) {
clientStore.set('selectedDownPanel', panelName);
- }
+ },
};
diff --git a/packages/storybook-ui/src/modules/ui/components/down_panel/__tests__/index.js b/packages/storybook-ui/src/modules/ui/components/down_panel/__tests__/index.js
index 168fdbb9502f..fe8bacc6e8ca 100644
--- a/packages/storybook-ui/src/modules/ui/components/down_panel/__tests__/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/down_panel/__tests__/index.js
@@ -11,19 +11,19 @@ describe('manager.ui.components.down_panel.index', () => {
test1: {
render() {
return TEST 1
;
- }
+ },
},
test2: {
render() {
return TEST 2
;
- }
- }
+ },
+ },
};
const onPanelSelect = () => 'onPanelSelect';
const wrapper = shallow(
-
+ ,
);
expect(wrapper.find('#test1').parent().props().style.display).to.equal('none');
@@ -35,15 +35,15 @@ describe('manager.ui.components.down_panel.index', () => {
test1: {
render() {
return TEST 1
;
- }
- }
+ },
+ },
};
const onPanelSelect = sinon.spy();
const preventDefault = sinon.spy();
const wrapper = shallow(
-
+ ,
);
wrapper.find('a').simulate('click', { preventDefault });
diff --git a/packages/storybook-ui/src/modules/ui/components/down_panel/index.js b/packages/storybook-ui/src/modules/ui/components/down_panel/index.js
index 418aeb812a8e..b0c42ec8c346 100644
--- a/packages/storybook-ui/src/modules/ui/components/down_panel/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/down_panel/index.js
@@ -9,11 +9,10 @@ class DownPanel extends Component {
tabStyle = Object.assign({}, style.tablink, style.activetab);
}
- const onClick = () =>
- e => {
- e.preventDefault();
- this.props.onPanelSelect(name);
- };
+ const onClick = () => e => {
+ e.preventDefault();
+ this.props.onPanelSelect(name);
+ };
let title = panel.title;
if (typeof title === 'function') {
@@ -69,7 +68,7 @@ class DownPanel extends Component {
DownPanel.propTypes = {
panels: PropTypes.object,
onPanelSelect: PropTypes.func,
- selectedPanel: PropTypes.string
+ selectedPanel: PropTypes.string,
};
export default DownPanel;
diff --git a/packages/storybook-ui/src/modules/ui/components/down_panel/style.js b/packages/storybook-ui/src/modules/ui/components/down_panel/style.js
index dd01b88b5dc7..f371e8bcb19c 100644
--- a/packages/storybook-ui/src/modules/ui/components/down_panel/style.js
+++ b/packages/storybook-ui/src/modules/ui/components/down_panel/style.js
@@ -9,7 +9,7 @@ export default {
letterSpacing: '1px',
textTransform: 'uppercase',
alignItems: 'center',
- justifyContent: 'center'
+ justifyContent: 'center',
},
wrapper: {
@@ -20,19 +20,19 @@ export default {
borderRadius: 4,
border: 'solid 1px rgb(236, 236, 236)',
marginTop: 5,
- width: '100%'
+ width: '100%',
},
tabbar: {
display: 'flex',
flexWrap: 'wrap',
- borderBottom: 'solid 1px #eaeaea'
+ borderBottom: 'solid 1px #eaeaea',
},
content: {
flex: 1,
display: 'flex',
- overflow: 'auto'
+ overflow: 'auto',
},
tablink: {
@@ -43,10 +43,10 @@ export default {
textDecoration: 'none',
textTransform: 'uppercase',
transition: 'opacity 0.3s',
- opacity: 0.5
+ opacity: 0.5,
},
activetab: {
- opacity: 1
- }
+ opacity: 1,
+ },
};
diff --git a/packages/storybook-ui/src/modules/ui/components/layout/__tests__/index.js b/packages/storybook-ui/src/modules/ui/components/layout/__tests__/index.js
index fe1352e20b75..b110ad250a6d 100755
--- a/packages/storybook-ui/src/modules/ui/components/layout/__tests__/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/layout/__tests__/index.js
@@ -15,7 +15,7 @@ describe('manager.ui.components.layout.index', () => {
leftPanel={() => 'LeftPanel'}
downPanel={() => 'DownPanel'}
preview={() => 'Preview'}
- />
+ />,
);
expect(wrap.html()).to.match(/LeftPanel/);
@@ -32,7 +32,7 @@ describe('manager.ui.components.layout.index', () => {
leftPanel={() => 'LeftPanel'}
downPanel={() => 'DownPanel'}
preview={() => 'Preview'}
- />
+ />,
);
expect(wrap.html()).not.to.match(/LeftPanel/);
@@ -51,7 +51,7 @@ describe('manager.ui.components.layout.index', () => {
leftPanel={() => 'LeftPanel'}
downPanel={() => 'DownPanel'}
preview={() => 'Preview'}
- />
+ />,
);
expect(wrap.html()).not.to.match(/LeftPanel/);
@@ -70,7 +70,7 @@ describe('manager.ui.components.layout.index', () => {
leftPanel={() => 'LeftPanel'}
downPanel={() => 'DownPanel'}
preview={() => 'Preview'}
- />
+ />,
);
expect(wrap.html()).to.match(/LeftPanel/);
diff --git a/packages/storybook-ui/src/modules/ui/components/layout/dimensions.js b/packages/storybook-ui/src/modules/ui/components/layout/dimensions.js
index f588f167dc8f..631aeb6f191d 100644
--- a/packages/storybook-ui/src/modules/ui/components/layout/dimensions.js
+++ b/packages/storybook-ui/src/modules/ui/components/layout/dimensions.js
@@ -8,18 +8,18 @@ const container = {
padding: 5,
bottom: 10,
right: 10,
- backgroundColor: 'rgba(255, 255, 255, 0.5)'
+ backgroundColor: 'rgba(255, 255, 255, 0.5)',
};
const dimensionStyle = {
fontSize: 12,
- ...baseFonts
+ ...baseFonts,
};
const delimeterStyle = {
margin: '0px 5px',
fontSize: 12,
- ...baseFonts
+ ...baseFonts,
};
// Same as Chrome's timeout in the developer tools
@@ -30,7 +30,7 @@ class Dimensions extends React.Component {
super(props);
this.state = {
- isVisible: false
+ isVisible: false,
};
this._hideTimeout = null;
@@ -49,15 +49,12 @@ class Dimensions extends React.Component {
onChange(width, height) {
this.setState({ isVisible: true });
- this._hideTimeout = setTimeout(
- () => {
- // Ensure the dimensions aren't still changing
- if (width === this.props.width && height === this.props.height) {
- this.setState({ isVisible: false });
- }
- },
- DISPLAY_TIMEOUT
- );
+ this._hideTimeout = setTimeout(() => {
+ // Ensure the dimensions aren't still changing
+ if (width === this.props.width && height === this.props.height) {
+ this.setState({ isVisible: false });
+ }
+ }, DISPLAY_TIMEOUT);
}
render() {
@@ -65,10 +62,7 @@ class Dimensions extends React.Component {
return null;
}
- const {
- width,
- height
- } = this.props;
+ const { width, height } = this.props;
return (
@@ -82,7 +76,7 @@ class Dimensions extends React.Component {
Dimensions.propTypes = {
width: PropTypes.number.isRequired,
- height: PropTypes.number.isRequired
+ height: PropTypes.number.isRequired,
};
export default Dimensions;
diff --git a/packages/storybook-ui/src/modules/ui/components/layout/hsplit.js b/packages/storybook-ui/src/modules/ui/components/layout/hsplit.js
index bcdcaf3e4b99..b1522aee148e 100755
--- a/packages/storybook-ui/src/modules/ui/components/layout/hsplit.js
+++ b/packages/storybook-ui/src/modules/ui/components/layout/hsplit.js
@@ -6,7 +6,7 @@ const wrapStyle = {
height: '10px',
marginTop: '-8px',
marginBottom: '-10px',
- position: 'relative'
+ position: 'relative',
};
const spanStyle = {
@@ -17,7 +17,7 @@ const spanStyle = {
marginLeft: '-10px',
position: 'absolute',
borderTop: 'solid 1px rgba(0,0,0,0.1)',
- borderBottom: 'solid 1px rgba(0,0,0,0.1)'
+ borderBottom: 'solid 1px rgba(0,0,0,0.1)',
};
const HSplit = () => (
diff --git a/packages/storybook-ui/src/modules/ui/components/layout/index.js b/packages/storybook-ui/src/modules/ui/components/layout/index.js
index 5b630797cb83..0271e34704c7 100755
--- a/packages/storybook-ui/src/modules/ui/components/layout/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/layout/index.js
@@ -8,13 +8,13 @@ import SplitPane from '@kadira/react-split-pane';
const rootStyle = {
height: '100vh',
- backgroundColor: '#F7F7F7'
+ backgroundColor: '#F7F7F7',
};
const leftPanelStyle = {
position: 'absolute',
width: '100%',
- height: '100%'
+ height: '100%',
};
const downPanelStyle = {
@@ -23,7 +23,7 @@ const downPanelStyle = {
width: '100%',
height: '100%',
padding: '5px 10px 10px 0',
- boxSizing: 'border-box'
+ boxSizing: 'border-box',
};
const contentPanelStyle = {
@@ -31,7 +31,7 @@ const contentPanelStyle = {
boxSizing: 'border-box',
width: '100%',
height: '100%',
- padding: '10px 10px 10px 0'
+ padding: '10px 10px 10px 0',
};
const normalPreviewStyle = {
@@ -39,7 +39,7 @@ const normalPreviewStyle = {
height: '100%',
backgroundColor: '#FFF',
border: '1px solid #ECECEC',
- borderRadius: 4
+ borderRadius: 4,
};
const fullScreenPreviewStyle = {
@@ -54,7 +54,7 @@ const fullScreenPreviewStyle = {
border: 0,
margin: 0,
padding: 0,
- overflow: 'hidden'
+ overflow: 'hidden',
};
const vsplit = ;
@@ -92,8 +92,8 @@ class Layout extends React.Component {
this.state = {
previewPanelDimensions: {
height: 0,
- width: 0
- }
+ width: 0,
+ },
};
this.onResize = this.onResize.bind(this);
@@ -108,16 +108,13 @@ class Layout extends React.Component {
}
onResize() {
- const {
- clientWidth,
- clientHeight
- } = this.previewPanelRef;
+ const { clientWidth, clientHeight } = this.previewPanelRef;
this.setState({
previewPanelDimensions: {
width: clientWidth,
- height: clientHeight
- }
+ height: clientHeight,
+ },
});
}
@@ -129,11 +126,9 @@ class Layout extends React.Component {
downPanelInRight,
downPanel,
leftPanel,
- preview
+ preview,
} = this.props;
- const {
- previewPanelDimensions
- } = this.state;
+ const { previewPanelDimensions } = this.state;
let previewStyle = normalPreviewStyle;
@@ -206,7 +201,7 @@ Layout.propTypes = {
leftPanel: PropTypes.func.isRequired,
preview: PropTypes.func.isRequired,
downPanel: PropTypes.func.isRequired,
- downPanelInRight: PropTypes.bool.isRequired
+ downPanelInRight: PropTypes.bool.isRequired,
};
export default Layout;
diff --git a/packages/storybook-ui/src/modules/ui/components/layout/vsplit.js b/packages/storybook-ui/src/modules/ui/components/layout/vsplit.js
index 96ac04c045c6..a9c2fc55e6fc 100755
--- a/packages/storybook-ui/src/modules/ui/components/layout/vsplit.js
+++ b/packages/storybook-ui/src/modules/ui/components/layout/vsplit.js
@@ -5,7 +5,7 @@ const wrapStyle = {
height: '100%',
width: '20px',
marginLeft: '-10px',
- position: 'relative'
+ position: 'relative',
};
const spanStyle = {
@@ -16,7 +16,7 @@ const spanStyle = {
marginTop: '-10px',
position: 'absolute',
borderLeft: 'solid 1px rgba(0,0,0,0.1)',
- borderRight: 'solid 1px rgba(0,0,0,0.1)'
+ borderRight: 'solid 1px rgba(0,0,0,0.1)',
};
const VSplit = () => (
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/index.js b/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/index.js
index 98f53af8f69f..194d0aa383b0 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/index.js
@@ -14,7 +14,7 @@ describe('manager.ui.components.left_panel.index', () => {
const storyFilter = 'xxxxx';
const wrap = shallow(
-
+ ,
);
const header = wrap.find(Header).first();
expect(header.props().openShortcutsHelp).to.be.equal(openShortcutsHelp);
@@ -31,13 +31,13 @@ describe('manager.ui.components.left_panel.index', () => {
const stories = [{ kind: 'kk', stories: ['bb'] }];
const wrap = shallow(
-
+ ,
);
const header = wrap.find(Stories).first();
expect(header.props()).to.deep.equal({
stories,
selectedKind,
- selectedStory
+ selectedStory,
});
});
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/stories.js b/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/stories.js
index 0ce317a738b7..d629a7656439 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/stories.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/__tests__/stories.js
@@ -30,7 +30,12 @@ describe('manager.ui.components.left_panel.stories', () => {
const onSelectStory = sinon.spy();
const wrap = shallow(
-
+ ,
);
const kind = wrap.find('a').filterWhere(el => el.text() === 'a').last();
@@ -44,7 +49,12 @@ describe('manager.ui.components.left_panel.stories', () => {
const onSelectStory = sinon.spy();
const wrap = shallow(
-
+ ,
);
const kind = wrap.find('a').filterWhere(el => el.text() === 'b1').last();
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/header.js b/packages/storybook-ui/src/modules/ui/components/left_panel/header.js
index 24698b476259..7d647cf7536f 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/header.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/header.js
@@ -4,7 +4,7 @@ import { baseFonts } from '../theme';
const wrapperStyle = {
background: '#F7F7F7',
- marginBottom: 10
+ marginBottom: 10,
};
const headingStyle = {
@@ -21,7 +21,7 @@ const headingStyle = {
cursor: 'pointer',
margin: 0,
float: 'none',
- overflow: 'hidden'
+ overflow: 'hidden',
};
const shortcutIconStyle = {
@@ -41,11 +41,11 @@ const shortcutIconStyle = {
float: 'right',
marginLeft: 5,
backgroundColor: 'inherit',
- outline: 0
+ outline: 0,
};
const linkStyle = {
- textDecoration: 'none'
+ textDecoration: 'none',
};
const Header = ({ openShortcutsHelp, name, url }) => (
@@ -60,7 +60,7 @@ const Header = ({ openShortcutsHelp, name, url }) => (
Header.propTypes = {
openShortcutsHelp: PropTypes.func,
name: PropTypes.string,
- url: PropTypes.string
+ url: PropTypes.string,
};
export default Header;
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/index.js b/packages/storybook-ui/src/modules/ui/components/left_panel/index.js
index e5b9a376c2ab..974a5dc69263 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/index.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/index.js
@@ -8,11 +8,11 @@ import pick from 'lodash.pick';
const scrollStyle = {
height: 'calc(100vh - 105px)',
marginTop: 10,
- overflowY: 'auto'
+ overflowY: 'auto',
};
const mainStyle = {
- padding: '10px 0 10px 10px'
+ padding: '10px 0 10px 10px',
};
const storyProps = ['stories', 'selectedKind', 'selectedStory', 'onSelectStory'];
@@ -42,7 +42,7 @@ LeftPanel.propTypes = {
openShortcutsHelp: PropTypes.func,
name: PropTypes.string,
- url: PropTypes.string
+ url: PropTypes.string,
};
export default LeftPanel;
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/stories.js b/packages/storybook-ui/src/modules/ui/components/left_panel/stories.js
index 430433925f3c..c53804e25fc5 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/stories.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/stories.js
@@ -3,25 +3,25 @@ import React from 'react';
import { baseFonts } from '../theme';
const listStyle = {
- ...baseFonts
+ ...baseFonts,
};
const listStyleType = {
listStyleType: 'none',
- paddingLeft: 0
+ paddingLeft: 0,
};
const kindStyle = {
fontSize: 15,
padding: '10px 0px',
cursor: 'pointer',
- borderBottom: '1px solid #EEE'
+ borderBottom: '1px solid #EEE',
};
const storyStyle = {
fontSize: 13,
padding: '8px 0px 8px 10px',
- cursor: 'pointer'
+ cursor: 'pointer',
};
class Stories extends React.Component {
@@ -45,7 +45,7 @@ class Stories extends React.Component {
const { selectedStory } = this.props;
const style = { display: 'block', ...storyStyle };
const props = {
- onClick: this.fireOnStory.bind(this, story)
+ onClick: this.fireOnStory.bind(this, story),
};
if (story === selectedStory) {
@@ -107,7 +107,7 @@ Stories.propTypes = {
stories: PropTypes.array.isRequired,
selectedKind: PropTypes.string.isRequired,
selectedStory: PropTypes.string.isRequired,
- onSelectStory: PropTypes.func
+ onSelectStory: PropTypes.func,
};
export default Stories;
diff --git a/packages/storybook-ui/src/modules/ui/components/left_panel/text_filter.js b/packages/storybook-ui/src/modules/ui/components/left_panel/text_filter.js
index f58e735bd766..33d82562a8af 100755
--- a/packages/storybook-ui/src/modules/ui/components/left_panel/text_filter.js
+++ b/packages/storybook-ui/src/modules/ui/components/left_panel/text_filter.js
@@ -6,7 +6,7 @@ const mainStyle = {
...baseFonts,
border: '1px solid #ECECEC',
borderRadius: 2,
- position: 'relative'
+ position: 'relative',
};
export default class TextFilter extends React.Component {
@@ -14,7 +14,7 @@ export default class TextFilter extends React.Component {
super(props);
this.state = {
- query: ''
+ query: '',
};
this.onChange = this.onChange.bind(this);
@@ -37,7 +37,7 @@ export default class TextFilter extends React.Component {
render() {
const textWrapStyle = {
- background: '#F7F7F7'
+ background: '#F7F7F7',
};
const textStyle = {
@@ -49,7 +49,7 @@ export default class TextFilter extends React.Component {
boxSizing: 'border-box',
outline: 'none',
border: 0,
- height: 26
+ height: 26,
};
const clearButtonStyle = {
@@ -63,7 +63,7 @@ export default class TextFilter extends React.Component {
textAlign: 'center',
cursor: 'pointer',
lineHeight: '23px',
- fontSize: 20
+ fontSize: 20,
};
return (
@@ -91,5 +91,5 @@ export default class TextFilter extends React.Component {
TextFilter.propTypes = {
text: PropTypes.string,
onChange: PropTypes.func,
- onClear: PropTypes.func
+ onClear: PropTypes.func,
};
diff --git a/packages/storybook-ui/src/modules/ui/components/search_box.js b/packages/storybook-ui/src/modules/ui/components/search_box.js
index 49420f6af0b3..28c58f073175 100644
--- a/packages/storybook-ui/src/modules/ui/components/search_box.js
+++ b/packages/storybook-ui/src/modules/ui/components/search_box.js
@@ -11,7 +11,7 @@ const searchBoxStyle = {
top: '100px',
left: '50%',
marginLeft: '-215px',
- ...baseFonts
+ ...baseFonts,
};
const formatStories = function(stories) {
@@ -21,7 +21,7 @@ const formatStories = function(stories) {
formattedStories.push({
type: 'kind',
value: val.kind,
- id: i++
+ id: i++,
});
val.stories.forEach(story => {
@@ -29,7 +29,7 @@ const formatStories = function(stories) {
type: 'story',
value: story,
id: i++,
- kind: val.kind
+ kind: val.kind,
});
});
});
@@ -97,5 +97,5 @@ SearchBox.propTypes = {
showSearchBox: PropTypes.bool.isRequired,
stories: PropTypes.arrayOf(PropTypes.object),
onSelectStory: PropTypes.func.isRequired,
- handleEvent: PropTypes.func.isRequired
+ handleEvent: PropTypes.func.isRequired,
};
diff --git a/packages/storybook-ui/src/modules/ui/components/shortcuts_help.js b/packages/storybook-ui/src/modules/ui/components/shortcuts_help.js
index 078f67597b24..25949dc8c05b 100755
--- a/packages/storybook-ui/src/modules/ui/components/shortcuts_help.js
+++ b/packages/storybook-ui/src/modules/ui/components/shortcuts_help.js
@@ -7,12 +7,12 @@ const commandStyle = {
padding: '2px 7px',
borderRadius: 2,
lineHeight: '36px',
- marginRight: '9px'
+ marginRight: '9px',
};
const h4Style = {
marginTop: 0,
- textAlign: 'center'
+ textAlign: 'center',
};
const modalStyles = {
@@ -25,11 +25,11 @@ const modalStyles = {
border: 'none',
overflow: 'visible',
fontFamily: 'sans-serif',
- fontSize: 14
+ fontSize: 14,
},
overlay: {
- backgroundColor: 'rgba(0, 0, 0, 0.74902)'
- }
+ backgroundColor: 'rgba(0, 0, 0, 0.74902)',
+ },
};
// manage two separate shortcut keys for
@@ -44,7 +44,7 @@ export function getShortcuts(platform) {
{ name: 'Toggle Left Panel', keys: ['⌘ ⇧ L', '⌃ ⇧ L'] },
{ name: 'Toggle Down Panel', keys: ['⌘ ⇧ D', '⌃ ⇧ D'] },
{ name: 'Next Story', keys: ['⌘ ⇧ →', '⌃ ⇧ →'] },
- { name: 'Previous Story', keys: ['⌘ ⇧ ←', '⌃ ⇧ ←'] }
+ { name: 'Previous Story', keys: ['⌘ ⇧ ←', '⌃ ⇧ ←'] },
];
}
@@ -55,7 +55,7 @@ export function getShortcuts(platform) {
{ name: 'Toggle Left Panel', keys: ['Ctrl + Shift + L'] },
{ name: 'Toggle Down Panel', keys: ['Ctrl + Shift + D'] },
{ name: 'Next Story', keys: ['Ctrl + Shift + →'] },
- { name: 'Previous Story', keys: ['Ctrl + Shift + ←'] }
+ { name: 'Previous Story', keys: ['Ctrl + Shift + ←'] },
];
}
@@ -78,7 +78,7 @@ export const Keys = ({ shortcutKeys }) => {
};
Keys.propTypes = {
- shortcutKeys: PropTypes.array.isRequired
+ shortcutKeys: PropTypes.array.isRequired,
};
export const Shortcuts = ({ appShortcuts }) => {
@@ -98,7 +98,7 @@ export const Shortcuts = ({ appShortcuts }) => {
};
Shortcuts.propTypes = {
- appShortcuts: PropTypes.array.isRequired
+ appShortcuts: PropTypes.array.isRequired,
};
export const ShortcutsHelp = ({ isOpen, onClose, platform }) => (
@@ -110,7 +110,7 @@ export const ShortcutsHelp = ({ isOpen, onClose, platform }) => (
ShortcutsHelp.propTypes = {
isOpen: PropTypes.bool,
onClose: PropTypes.func,
- platform: PropTypes.string.isRequired
+ platform: PropTypes.string.isRequired,
};
export default ShortcutsHelp;
diff --git a/packages/storybook-ui/src/modules/ui/components/theme.js b/packages/storybook-ui/src/modules/ui/components/theme.js
index 3e9d49bd0409..5f2962469ba1 100755
--- a/packages/storybook-ui/src/modules/ui/components/theme.js
+++ b/packages/storybook-ui/src/modules/ui/components/theme.js
@@ -3,5 +3,5 @@ export const baseFonts = {
-apple-system, ".SFNSText-Regular", "San Francisco", "Roboto",
"Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif
`,
- color: '#444'
+ color: '#444',
};
diff --git a/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_keyevents.js b/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_keyevents.js
index c758c7f7e261..d00e4e9d8fdb 100755
--- a/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_keyevents.js
+++ b/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_keyevents.js
@@ -8,8 +8,8 @@ describe('manager.ui.config.handle_keyevents', () => {
it('should call the correct action', () => {
const actions = {
shortcuts: {
- handleEvent: sinon.mock()
- }
+ handleEvent: sinon.mock(),
+ },
};
const originalOnkeydown = window.onkeydown;
@@ -24,8 +24,8 @@ describe('manager.ui.config.handle_keyevents', () => {
tagName: 'DIV',
getAttribute() {
return null;
- }
- }
+ },
+ },
};
window.onkeydown(e);
@@ -37,8 +37,8 @@ describe('manager.ui.config.handle_keyevents', () => {
it('should not call any actions if the event target is an input', () => {
const actions = {
shortcuts: {
- handleEvent: sinon.mock()
- }
+ handleEvent: sinon.mock(),
+ },
};
const originalOnkeydown = window.onkeydown;
@@ -53,8 +53,8 @@ describe('manager.ui.config.handle_keyevents', () => {
tagName: 'INPUT',
getAttribute() {
return null;
- }
- }
+ },
+ },
};
window.onkeydown(e);
@@ -66,8 +66,8 @@ describe('manager.ui.config.handle_keyevents', () => {
it('should not call any actions if the event target has contenteditable enabled', () => {
const actions = {
shortcuts: {
- handleEvent: sinon.mock()
- }
+ handleEvent: sinon.mock(),
+ },
};
const originalOnkeydown = window.onkeydown;
@@ -82,8 +82,8 @@ describe('manager.ui.config.handle_keyevents', () => {
tagName: 'DIV',
getAttribute(attr) {
return /contenteditable/i.test(attr) ? '' : null;
- }
- }
+ },
+ },
};
window.onkeydown(e);
diff --git a/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_routing.js b/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_routing.js
index d3c5f2c29360..e1f4d099cfe8 100755
--- a/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_routing.js
+++ b/packages/storybook-ui/src/modules/ui/configs/__tests__/handle_routing.js
@@ -17,23 +17,24 @@ describe('manager.ui.config.handle_routing', () => {
selectedKind: 'kk',
selectedStory: 'ss',
customQueryParams: {
- customText: 'test'
+ customText: 'test',
},
shortcutOptions: {
goFullScreen: false,
showDownPanel: true,
showLeftPanel: true,
- downPanelInRight: true
+ downPanelInRight: true,
},
- selectedDownPanel: 'pp'
+ selectedDownPanel: 'pp',
};
const clientStore = {
- getAll: () => state
+ getAll: () => state,
};
// eslint-disable-next-line max-len
- const url = '?customText=test&selectedKind=kk&selectedStory=ss&full=0&down=1&left=1&panelRight=1&downPanel=pp';
+ const url =
+ '?customText=test&selectedKind=kk&selectedStory=ss&full=0&down=1&left=1&panelRight=1&downPanel=pp';
const pushState = {
url,
@@ -44,7 +45,7 @@ describe('manager.ui.config.handle_routing', () => {
left: true,
panelRight: true,
downPanel: 'pp',
- customText: 'test'
+ customText: 'test',
};
const originalPushState = window.history.pushState;
@@ -63,21 +64,22 @@ describe('manager.ui.config.handle_routing', () => {
const actions = {
api: {
selectStory: sinon.mock(),
- setQueryParams: sinon.mock()
+ setQueryParams: sinon.mock(),
},
shortcuts: {
- setOptions: sinon.mock()
+ setOptions: sinon.mock(),
},
ui: {
- selectDownPanel: sinon.mock()
- }
+ selectDownPanel: sinon.mock(),
+ },
};
// eslint-disable-next-line max-len
- const url = '?selectedKind=kk&selectedStory=ss&full=1&down=0&left=0&panelRight=0&downPanel=test&customText=teststring';
+ const url =
+ '?selectedKind=kk&selectedStory=ss&full=1&down=0&left=0&panelRight=0&downPanel=test&customText=teststring';
const location = {
- search: url
+ search: url,
};
window.location.search = url;
handleInitialUrl(actions, location);
@@ -91,8 +93,8 @@ describe('manager.ui.config.handle_routing', () => {
goFullScreen: true,
showDownPanel: false,
showLeftPanel: false,
- downPanelInRight: false
- })
+ downPanelInRight: false,
+ }),
).to.be.true;
expect(actions.ui.selectDownPanel.calledWith('test')).to.be.true;
expect(actions.api.setQueryParams.calledWith({ customText: 'teststring' })).to.be.true;
diff --git a/packages/storybook-ui/src/modules/ui/configs/__tests__/init_panels.js b/packages/storybook-ui/src/modules/ui/configs/__tests__/init_panels.js
index cefe9c545b47..78f70973fb73 100644
--- a/packages/storybook-ui/src/modules/ui/configs/__tests__/init_panels.js
+++ b/packages/storybook-ui/src/modules/ui/configs/__tests__/init_panels.js
@@ -7,8 +7,8 @@ describe('manager.ui.config.init_panels', () => {
it('should call the selectDownPanel with first panel name', () => {
const actions = {
ui: {
- selectDownPanel: sinon.mock()
- }
+ selectDownPanel: sinon.mock(),
+ },
};
const provider = {
@@ -16,9 +16,9 @@ describe('manager.ui.config.init_panels', () => {
return {
test1: {},
test2: {},
- test3: {}
+ test3: {},
};
- }
+ },
};
initPanels({ provider }, actions);
diff --git a/packages/storybook-ui/src/modules/ui/configs/handle_routing.js b/packages/storybook-ui/src/modules/ui/configs/handle_routing.js
index ef0853c0658d..9504af9cdf9f 100755
--- a/packages/storybook-ui/src/modules/ui/configs/handle_routing.js
+++ b/packages/storybook-ui/src/modules/ui/configs/handle_routing.js
@@ -1,6 +1,6 @@
import qs from 'qs';
export const config = {
- insidePopState: false
+ insidePopState: false,
};
export function changeUrl(clientStore) {
@@ -16,12 +16,10 @@ export function changeUrl(clientStore) {
goFullScreen: full,
showDownPanel: down,
showLeftPanel: left,
- downPanelInRight: panelRight
+ downPanelInRight: panelRight,
} = data.shortcutOptions;
- const {
- selectedDownPanel: downPanel
- } = data;
+ const { selectedDownPanel: downPanel } = data;
const urlObj = {
...customQueryParams,
@@ -31,7 +29,7 @@ export function changeUrl(clientStore) {
down: Number(down),
left: Number(left),
panelRight: Number(panelRight),
- downPanel
+ downPanel,
};
const url = `?${qs.stringify(urlObj)}`;
@@ -42,7 +40,7 @@ export function changeUrl(clientStore) {
down,
left,
panelRight,
- url
+ url,
};
window.history.pushState(state, '', url);
@@ -68,7 +66,7 @@ export function updateStore(queryParams, actions) {
goFullScreen: Boolean(Number(full)),
showDownPanel: Boolean(Number(down)),
showLeftPanel: Boolean(Number(left)),
- downPanelInRight: Boolean(Number(panelRight))
+ downPanelInRight: Boolean(Number(panelRight)),
});
if (downPanel) {
diff --git a/packages/storybook-ui/src/modules/ui/containers/__tests__/down_panel.js b/packages/storybook-ui/src/modules/ui/containers/__tests__/down_panel.js
index 2b95efbbf0d5..1a4748c74864 100644
--- a/packages/storybook-ui/src/modules/ui/containers/__tests__/down_panel.js
+++ b/packages/storybook-ui/src/modules/ui/containers/__tests__/down_panel.js
@@ -6,14 +6,14 @@ describe('manager.ui.containers.down_panel', () => {
describe('mapper', () => {
it('should give correct data', () => {
const state = {
- selectedDownPanel: 'sdp'
+ selectedDownPanel: 'sdp',
};
const selectDownPanel = () => 'selectDownPanel';
const panels = {
test1: {},
test2: {},
- sdp: {}
+ sdp: {},
};
const getPanels = () => panels;
@@ -21,14 +21,14 @@ describe('manager.ui.containers.down_panel', () => {
const env = {
actions: () => ({
ui: {
- selectDownPanel
- }
+ selectDownPanel,
+ },
}),
context: () => ({
provider: {
- getPanels
- }
- })
+ getPanels,
+ },
+ }),
};
const data = mapper(state, props, env);
diff --git a/packages/storybook-ui/src/modules/ui/containers/__tests__/layout.js b/packages/storybook-ui/src/modules/ui/containers/__tests__/layout.js
index cf76c0e6d003..8de9dfefb3a6 100755
--- a/packages/storybook-ui/src/modules/ui/containers/__tests__/layout.js
+++ b/packages/storybook-ui/src/modules/ui/containers/__tests__/layout.js
@@ -9,8 +9,8 @@ describe('manager.ui.containers.layout', () => {
shortcutOptions: {
showLeftPanel: 'aa',
showDownPanel: 'bb',
- goFullScreen: 'cc'
- }
+ goFullScreen: 'cc',
+ },
};
const data = mapper(state);
diff --git a/packages/storybook-ui/src/modules/ui/containers/__tests__/left_panel.js b/packages/storybook-ui/src/modules/ui/containers/__tests__/left_panel.js
index cba8035f0ba7..649597380266 100755
--- a/packages/storybook-ui/src/modules/ui/containers/__tests__/left_panel.js
+++ b/packages/storybook-ui/src/modules/ui/containers/__tests__/left_panel.js
@@ -10,7 +10,7 @@ describe('manager.ui.containers.left_panel', () => {
const selectedStory = 'dd';
const uiOptions = {
name: 'foo',
- url: 'bar'
+ url: 'bar',
};
const selectStory = () => 'selectStory';
@@ -21,13 +21,13 @@ describe('manager.ui.containers.left_panel', () => {
const env = {
actions: () => ({
api: {
- selectStory
+ selectStory,
},
ui: {
toggleShortcutsHelp,
- setStoryFilter
- }
- })
+ setStoryFilter,
+ },
+ }),
};
const state = {
@@ -35,7 +35,7 @@ describe('manager.ui.containers.left_panel', () => {
stories,
selectedKind,
selectedStory,
- uiOptions
+ uiOptions,
};
const data = mapper(state, props, env);
@@ -53,13 +53,13 @@ describe('manager.ui.containers.left_panel', () => {
const stories = [
{ kind: 'pk', stories: ['dd'] },
{ kind: 'ss', stories: ['dd'] },
- { kind: 'pkr', stories: ['dd'] }
+ { kind: 'pkr', stories: ['dd'] },
];
const selectedKind = 'pk';
const selectedStory = 'dd';
const uiOptions = {
name: 'foo',
- url: 'bar'
+ url: 'bar',
};
const selectStory = () => 'selectStory';
@@ -70,13 +70,13 @@ describe('manager.ui.containers.left_panel', () => {
const env = {
actions: () => ({
api: {
- selectStory
+ selectStory,
},
ui: {
toggleShortcutsHelp,
- setStoryFilter
- }
- })
+ setStoryFilter,
+ },
+ }),
};
const state = {
@@ -84,13 +84,13 @@ describe('manager.ui.containers.left_panel', () => {
stories,
selectedKind,
selectedStory,
- uiOptions
+ uiOptions,
};
const data = mapper(state, props, env);
expect(data.stories).to.deep.equal([
stories[0], // selected kind is always there. That's why this is here.
- stories[1]
+ stories[1],
]);
});
@@ -98,14 +98,14 @@ describe('manager.ui.containers.left_panel', () => {
const stories = [
{ kind: 'ss', stories: ['dd'] },
{ kind: 'pk', stories: ['dd'] },
- { kind: 'pkr', stories: ['dd'] }
+ { kind: 'pkr', stories: ['dd'] },
];
const selectedKind = 'pk';
const selectedStory = 'dd';
const uiOptions = {
name: 'foo',
url: 'bar',
- sortStoriesByKind: true
+ sortStoriesByKind: true,
};
const selectStory = () => 'selectStory';
@@ -116,13 +116,13 @@ describe('manager.ui.containers.left_panel', () => {
const env = {
actions: () => ({
api: {
- selectStory
+ selectStory,
},
ui: {
toggleShortcutsHelp,
- setStoryFilter
- }
- })
+ setStoryFilter,
+ },
+ }),
};
const state = {
@@ -130,13 +130,13 @@ describe('manager.ui.containers.left_panel', () => {
stories,
selectedKind,
selectedStory,
- uiOptions
+ uiOptions,
};
const data = mapper(state, props, env);
expect(data.stories).to.deep.equal([
stories[1], // selected kind is always there. That's why this is here.
- stories[0]
+ stories[0],
]);
});
});
diff --git a/packages/storybook-ui/src/modules/ui/containers/__tests__/shortcuts_help.js b/packages/storybook-ui/src/modules/ui/containers/__tests__/shortcuts_help.js
index ada3c2a5520f..72caceff7379 100755
--- a/packages/storybook-ui/src/modules/ui/containers/__tests__/shortcuts_help.js
+++ b/packages/storybook-ui/src/modules/ui/containers/__tests__/shortcuts_help.js
@@ -12,13 +12,13 @@ describe('manager.ui.containers.shortcuts_help', () => {
const env = {
actions: () => ({
ui: {
- toggleShortcutsHelp
- }
- })
+ toggleShortcutsHelp,
+ },
+ }),
};
const state = {
- showShortcutsHelp
+ showShortcutsHelp,
};
const data = mapper(state, props, env);
diff --git a/packages/storybook-ui/src/modules/ui/containers/down_panel.js b/packages/storybook-ui/src/modules/ui/containers/down_panel.js
index bbc7e23061ab..011d6c2d5308 100644
--- a/packages/storybook-ui/src/modules/ui/containers/down_panel.js
+++ b/packages/storybook-ui/src/modules/ui/containers/down_panel.js
@@ -10,7 +10,7 @@ export function mapper(state, props, { context, actions }) {
return {
panels,
selectedPanel,
- onPanelSelect: actionMap.ui.selectDownPanel
+ onPanelSelect: actionMap.ui.selectDownPanel,
};
}
diff --git a/packages/storybook-ui/src/modules/ui/containers/left_panel.js b/packages/storybook-ui/src/modules/ui/containers/left_panel.js
index 25b7cc815d50..8191ba886e11 100755
--- a/packages/storybook-ui/src/modules/ui/containers/left_panel.js
+++ b/packages/storybook-ui/src/modules/ui/containers/left_panel.js
@@ -19,7 +19,7 @@ export const mapper = (state, props, { actions }) => {
openShortcutsHelp: actionMap.ui.toggleShortcutsHelp,
name,
- url
+ url,
};
return data;
diff --git a/packages/storybook-ui/src/modules/ui/containers/search_box.js b/packages/storybook-ui/src/modules/ui/containers/search_box.js
index 966b786d914f..7df36200c365 100644
--- a/packages/storybook-ui/src/modules/ui/containers/search_box.js
+++ b/packages/storybook-ui/src/modules/ui/containers/search_box.js
@@ -8,7 +8,7 @@ export const mapper = (state, props, { actions }) => {
showSearchBox: state.shortcutOptions.showSearchBox,
stories: state.stories,
onSelectStory: actionMap.api.selectStory,
- handleEvent: actionMap.shortcuts.handleEvent
+ handleEvent: actionMap.shortcuts.handleEvent,
};
};
diff --git a/packages/storybook-ui/src/modules/ui/containers/shortcuts_help.js b/packages/storybook-ui/src/modules/ui/containers/shortcuts_help.js
index 16ac8f871892..10495eb79887 100755
--- a/packages/storybook-ui/src/modules/ui/containers/shortcuts_help.js
+++ b/packages/storybook-ui/src/modules/ui/containers/shortcuts_help.js
@@ -7,7 +7,7 @@ export const mapper = (state, props, { actions }) => {
const data = {
isOpen: state.showShortcutsHelp,
onClose: actionMap.ui.toggleShortcutsHelp,
- platform: window.navigator.platform.toLowerCase()
+ platform: window.navigator.platform.toLowerCase(),
};
return data;
diff --git a/packages/storybook-ui/src/modules/ui/index.js b/packages/storybook-ui/src/modules/ui/index.js
index 7b31c7e82682..321a4c535a0c 100755
--- a/packages/storybook-ui/src/modules/ui/index.js
+++ b/packages/storybook-ui/src/modules/ui/index.js
@@ -8,11 +8,11 @@ export default {
routes,
actions,
defaultState: {
- showShortcutsHelp: false
+ showShortcutsHelp: false,
},
load(c, a) {
initPanels(c, a);
handleRouting(c, a);
handleKeyEvents(a);
- }
+ },
};
diff --git a/packages/storybook-ui/src/modules/ui/libs/__tests__/filters.js b/packages/storybook-ui/src/modules/ui/libs/__tests__/filters.js
index 064bd039f94f..03b0c5e2c200 100755
--- a/packages/storybook-ui/src/modules/ui/libs/__tests__/filters.js
+++ b/packages/storybook-ui/src/modules/ui/libs/__tests__/filters.js
@@ -27,7 +27,7 @@ describe('manager.ui.libs.filters', () => {
const stories = [
{ kind: 'aa', stories: ['bb'] },
{ kind: 'bb', stories: ['bb'] },
- { kind: 'ss', stories: ['bb'] }
+ { kind: 'ss', stories: ['bb'] },
];
const selectedKind = 'bb';
const res = storyFilter(stories, 'aa', selectedKind);
@@ -39,7 +39,7 @@ describe('manager.ui.libs.filters', () => {
const stories = [
{ kind: 'ss', stories: ['bb'] },
{ kind: 'aa', stories: ['bb'] },
- { kind: 'bb', stories: ['bb'] }
+ { kind: 'bb', stories: ['bb'] },
];
const res = storyFilter(stories);
@@ -50,7 +50,7 @@ describe('manager.ui.libs.filters', () => {
const stories = [
{ kind: 'ss', stories: ['bb'] },
{ kind: 'aa', stories: ['bb'] },
- { kind: 'bb', stories: ['bb'] }
+ { kind: 'bb', stories: ['bb'] },
];
const res = storyFilter(stories, null, null, true);
diff --git a/packages/storybook-ui/src/modules/ui/libs/__tests__/gen_podda_loader.js b/packages/storybook-ui/src/modules/ui/libs/__tests__/gen_podda_loader.js
index 96d6c8fc5b61..313af25f3e93 100644
--- a/packages/storybook-ui/src/modules/ui/libs/__tests__/gen_podda_loader.js
+++ b/packages/storybook-ui/src/modules/ui/libs/__tests__/gen_podda_loader.js
@@ -12,7 +12,7 @@ describe('manager.ui.libs.gen_podda_loader', () => {
const cc = 40;
const mapper = state => ({
aa: state.aa,
- bb: state.bb
+ bb: state.bb,
});
const clientStore = new Podda({ aa, bb, cc });
@@ -29,7 +29,7 @@ describe('manager.ui.libs.gen_podda_loader', () => {
const cc = 40;
const mapper = (state, props) => ({
aa: props.aa,
- bb: props.bb
+ bb: props.bb,
});
const clientStore = new Podda();
@@ -46,7 +46,7 @@ describe('manager.ui.libs.gen_podda_loader', () => {
const cc = 40;
const mapper = (state, props, env) => ({
aa: env.aa,
- bb: env.bb
+ bb: env.bb,
});
const clientStore = new Podda();
@@ -78,7 +78,7 @@ describe('manager.ui.libs.gen_podda_loader', () => {
const cc = 40;
const mapper = state => ({
aa: state.aa,
- bb: state.bb
+ bb: state.bb,
});
const clientStore = new Podda({ aa, bb, cc });
@@ -96,7 +96,7 @@ describe('manager.ui.libs.gen_podda_loader', () => {
const cc = 40;
const mapper = state => ({
aa: state.aa,
- bb: state.bb
+ bb: state.bb,
});
const clientStore = new Podda({ aa, bb, cc });
diff --git a/packages/storyshots/src/index.js b/packages/storyshots/src/index.js
index 48826f4ff606..8377c01a0e48 100644
--- a/packages/storyshots/src/index.js
+++ b/packages/storyshots/src/index.js
@@ -12,10 +12,11 @@ let configPath;
const babel = require('babel-core');
const pkg = readPkgUp.sync().pkg;
-const isStorybook = (pkg.devDependencies && pkg.devDependencies['@kadira/storybook']) ||
+const isStorybook =
+ (pkg.devDependencies && pkg.devDependencies['@kadira/storybook']) ||
(pkg.dependencies && pkg.dependencies['@kadira/storybook']);
-const isRNStorybook = (pkg.devDependencies &&
- pkg.devDependencies['@kadira/react-native-storybook']) ||
+const isRNStorybook =
+ (pkg.devDependencies && pkg.devDependencies['@kadira/react-native-storybook']) ||
(pkg.dependencies && pkg.dependencies['@kadira/react-native-storybook']);
export default function testStorySnapshots(options = {}) {
@@ -30,7 +31,7 @@ export default function testStorySnapshots(options = {}) {
const content = babel.transformFileSync(configPath, babelConfig).code;
const contextOpts = {
filename: configPath,
- dirname: configDirPath
+ dirname: configDirPath,
};
const babelConfig = loadBabelConfig(configDirPath);
@@ -41,7 +42,7 @@ export default function testStorySnapshots(options = {}) {
require.requireActual(configPath);
} else {
throw new Error(
- 'storyshots is intended only to be used with react storybook or react native storybook'
+ 'storyshots is intended only to be used with react storybook or react native storybook',
);
}
diff --git a/packages/storyshots/src/require_context.js b/packages/storyshots/src/require_context.js
index 11346c888e84..085b938a3f4a 100644
--- a/packages/storyshots/src/require_context.js
+++ b/packages/storyshots/src/require_context.js
@@ -35,8 +35,10 @@ function isRelativeRequest(request) {
return true;
}
- return request.charCodeAt(1) === 47 /* / */ ||
- (request.charCodeAt(1) === 46 /* . */ && request.charCodeAt(2) === 47) /* / */;
+ return (
+ request.charCodeAt(1) === 47 /* / */ ||
+ (request.charCodeAt(1) === 46 /* . */ && request.charCodeAt(2) === 47) /* / */
+ );
}
export default function runWithRequireContext(content, options) {
diff --git a/packages/storyshots/src/storybook-channel-mock.js b/packages/storyshots/src/storybook-channel-mock.js
index f0e74deb694f..5621a104fedc 100644
--- a/packages/storyshots/src/storybook-channel-mock.js
+++ b/packages/storyshots/src/storybook-channel-mock.js
@@ -3,7 +3,7 @@ import Channel from '@kadira/storybook-channel';
export default function createChannel() {
const transport = {
setHandler: () => {},
- send: () => {}
+ send: () => {},
};
return new Channel({ transport });
diff --git a/packages/storyshots/stories/directly_required/Button.js b/packages/storyshots/stories/directly_required/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/storyshots/stories/directly_required/Button.js
+++ b/packages/storyshots/stories/directly_required/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/storyshots/stories/required_with_context/Button.js b/packages/storyshots/stories/required_with_context/Button.js
index 2fccb36d61a6..97a2c9f0b552 100644
--- a/packages/storyshots/stories/required_with_context/Button.js
+++ b/packages/storyshots/stories/required_with_context/Button.js
@@ -8,7 +8,7 @@ const buttonStyles = {
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px',
- margin: 10
+ margin: 10,
};
const Button = ({ children, onClick }) => (
@@ -19,7 +19,7 @@ const Button = ({ children, onClick }) => (
Button.propTypes = {
children: PropTypes.string.isRequired,
- onClick: PropTypes.func
+ onClick: PropTypes.func,
};
export default Button;
diff --git a/packages/storyshots/stories/required_with_context/Welcome.js b/packages/storyshots/stories/required_with_context/Welcome.js
index 6f0ca488aeb7..4e9ee8eb7317 100644
--- a/packages/storyshots/stories/required_with_context/Welcome.js
+++ b/packages/storyshots/stories/required_with_context/Welcome.js
@@ -5,18 +5,18 @@ const styles = {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
- fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif'
+ fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
- width: 200
+ width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
- paddingBottom: 2
+ paddingBottom: 2,
},
code: {
@@ -26,8 +26,8 @@ const styles = {
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
- color: '#3a3a3a'
- }
+ color: '#3a3a3a',
+ },
};
export default class Welcome extends React.Component {