Commit bc67b2af by Ari Rizzitano

some base storybook config

parent f6ec233c
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */
import React from 'react';
import { storiesOf } from '@storybook/react';
storiesOf('Paragon', module)
.add('Welcome', () => (
<div>
<h1>💎 Paragon</h1>
<p>
This is a documentation and demo space for the Paragon accessible UI component
library. Better docs coming soon, but for now, check out our existing components
via the links to the left-hand side.
</p>
<p>
Documentation generated with <a
href="https://github.com/kadirahq/react-storybook"
target="_blank"
rel="noopener noreferrer"
>
React Storybook
</a>.
</p>
</div>
));
import '@storybook/addon-options/register';
import { configure } from '@storybook/react'; import { configure } from '@storybook/react';
import { setOptions } from '@storybook/addon-options';
const req = require.context('../src', true, /\.stories\.jsx$/) setOptions({
name: '💎 PARAGON',
url: 'https://github.com/edx/paragon',
showDownPanel: false,
});
const req = require.context('../src', true, /\.stories\.jsx$/);
function loadStories() { function loadStories() {
req.keys().forEach((filename) => req(filename)) require('./Paragon.stories.jsx');
req.keys().forEach((filename) => req(filename));
} }
configure(loadStories, module); configure(loadStories, module);
...@@ -16,25 +16,27 @@ ...@@ -16,25 +16,27 @@
"test-storybook": "storyshots" "test-storybook": "storyshots"
}, },
"dependencies": { "dependencies": {
"babel-jest": "^20.0.3",
"babel-preset-es2015": "^6.24.1",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"prop-types": "^15.5.8", "prop-types": "^15.5.8",
"react": "^15.5.4", "react": "^15.5.4",
"react-dom": "^15.5.4", "react-dom": "^15.5.4",
"react-test-renderer": "^15.6.1",
"react-transition-group": "^1.1.2", "react-transition-group": "^1.1.2",
"reactstrap": "^4.6.2" "reactstrap": "^4.6.2"
}, },
"devDependencies": { "devDependencies": {
"@kadira/storybook-deployer": "^1.2.0", "@kadira/storybook-deployer": "^1.2.0",
"@kadira/storyshots": "^2.1.0", "@kadira/storyshots": "^2.1.0",
"@storybook/addon-options": "^3.1.6",
"@storybook/addon-storyshots": "^3.1.7",
"@storybook/react": "3.1.3", "@storybook/react": "3.1.3",
"@storybook/storybook-deployer": "^2.0.0",
"babel-cli": "^6.24.1", "babel-cli": "^6.24.1",
"babel-jest": "^20.0.3",
"babel-loader": "^7.0.0", "babel-loader": "^7.0.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-babili": "^0.0.12", "babel-preset-babili": "^0.0.12",
"babel-preset-env": "^1.4.0", "babel-preset-env": "^1.4.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1", "babel-preset-react": "^6.24.1",
"enzyme": "^2.8.2", "enzyme": "^2.8.2",
"eslint": "^3.19.0", "eslint": "^3.19.0",
...@@ -46,6 +48,7 @@ ...@@ -46,6 +48,7 @@
"husky": "^0.13.4", "husky": "^0.13.4",
"jest": "^20.0.4", "jest": "^20.0.4",
"react-router-dom": "^4.1.1", "react-router-dom": "^4.1.1",
"react-test-renderer": "^15.6.1",
"source-map-loader": "^0.2.1", "source-map-loader": "^0.2.1",
"webpack": "^2.4.1", "webpack": "^2.4.1",
"webpack-dev-server": "^2.4.4" "webpack-dev-server": "^2.4.4"
......
import React from 'react';
const styles = {
main: {
margin: 15,
maxWidth: 600,
lineHeight: 1.4,
fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif',
},
logo: {
width: 200,
},
link: {
color: '#1474f3',
textDecoration: 'none',
borderBottom: '1px solid #1474f3',
paddingBottom: 2,
},
code: {
fontSize: 15,
fontWeight: 600,
padding: '2px 5px',
border: '1px solid #eae9e9',
borderRadius: 4,
backgroundColor: '#f3f2f2',
color: '#3a3a3a',
},
note: {
opacity: 0.5,
},
};
export default function Welcome() {
return (
<div style={styles.main}>
<h1>Paragon</h1>
<p>
This is a documentation and demo space for the Paragon accessible UI Component
library. Better docs coming soon, but for now, check out our existing components
via the links to the left-hand side.
</p>
<p>
Documentation generated with <a
style={styles.link}
href="https://github.com/kadirahq/react-storybook"
target="_blank"
rel="noopener noreferrer"
>
React Storybook
</a>.
</p>
</div>
);
}
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { storiesOf, linkTo } from '@storybook/react';
import Welcome from './Welcome';
storiesOf('Welcome', module)
.add('to Storybook', () => (
<Welcome showApp={linkTo('Button')} />
));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment