allowing component directories to contain there own stories for storybook. A component directory should now contain index.js, story.js and readme.md
This commit is contained in:
parent
62b7524e53
commit
900268ab27
@ -1,7 +1,10 @@
|
||||
const { configure } = require('@kadira/storybook');
|
||||
|
||||
const req = require.context('../src/components', true, /story.js$/)
|
||||
|
||||
function loadStories() {
|
||||
req.keys().forEach((filename) => req(filename));
|
||||
require('../stories');
|
||||
}
|
||||
|
||||
configure(loadStories, module);
|
||||
configure(loadStories, module);
|
27
ui/src/components/button/story.js
Normal file
27
ui/src/components/button/story.js
Normal file
@ -0,0 +1,27 @@
|
||||
const React = require('react');
|
||||
const {
|
||||
storiesOf
|
||||
} = require('@kadira/storybook');
|
||||
|
||||
const Button = require('./');
|
||||
|
||||
storiesOf('Button', module)
|
||||
.add('With text', () => (
|
||||
<Button>
|
||||
Inspire the lazy
|
||||
</Button>
|
||||
)).add('Secondary', () => (
|
||||
<Button secondary>
|
||||
Inspire the brave
|
||||
</Button>
|
||||
)).add('Disabled', () => (
|
||||
<Button disabled>
|
||||
Inspire the liars
|
||||
</Button>
|
||||
)).add('Anchor', () => (
|
||||
<div>
|
||||
<Button href='#'>
|
||||
Inspire the anchor
|
||||
</Button>
|
||||
</div>
|
||||
));
|
@ -7,7 +7,7 @@ const {
|
||||
|
||||
const {
|
||||
Base,
|
||||
Button,
|
||||
// Button,
|
||||
Container,
|
||||
Checkbox,
|
||||
Row,
|
||||
@ -178,26 +178,26 @@ storiesOf('Avatar', module)
|
||||
</Base>
|
||||
));
|
||||
|
||||
storiesOf('Button', module)
|
||||
.add('With text', () => (
|
||||
<Button>
|
||||
Inspire the lazy
|
||||
</Button>
|
||||
)).add('Secondary', () => (
|
||||
<Button secondary>
|
||||
Inspire the brave
|
||||
</Button>
|
||||
)).add('Disabled', () => (
|
||||
<Button disabled>
|
||||
Inspire the liars
|
||||
</Button>
|
||||
)).add('Anchor', () => (
|
||||
<div>
|
||||
<Button href='#'>
|
||||
Inspire the anchor
|
||||
</Button>
|
||||
</div>
|
||||
));
|
||||
// storiesOf('Button', module)
|
||||
// .add('With text', () => (
|
||||
// <Button>
|
||||
// Inspire the lazy
|
||||
// </Button>
|
||||
// )).add('Secondary', () => (
|
||||
// <Button secondary>
|
||||
// Inspire the brave
|
||||
// </Button>
|
||||
// )).add('Disabled', () => (
|
||||
// <Button disabled>
|
||||
// Inspire the liars
|
||||
// </Button>
|
||||
// )).add('Anchor', () => (
|
||||
// <div>
|
||||
// <Button href='#'>
|
||||
// Inspire the anchor
|
||||
// </Button>
|
||||
// </div>
|
||||
// ));
|
||||
|
||||
storiesOf('Checkbox', module)
|
||||
.add('Default', () => (
|
||||
|
Loading…
Reference in New Issue
Block a user