-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Raphaël Benitte
committed
Aug 9, 2017
1 parent
18c4347
commit e056aa0
Showing
9 changed files
with
3,113 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ | ||
|
||
import '@storybook/addon-actions/register' | ||
import '@storybook/addon-links/register' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ | ||
|
||
import { configure } from '@storybook/react' | ||
|
||
const req = require.context('../stories', true, /\.stories\.js$/) | ||
|
||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)) | ||
} | ||
|
||
configure(loadStories, module) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
|
||
import { storiesOf } from '@storybook/react' | ||
import { generateDrinkStats } from 'nivo-generators' | ||
import { Bar } from '../../src' | ||
|
||
const commonProperties = { | ||
width: 900, | ||
height: 360, | ||
margin: { top: 60, right: 80, bottom: 60, left: 80 }, | ||
data: generateDrinkStats(18), | ||
xPadding: 0.2, | ||
} | ||
|
||
storiesOf('Bar', module) | ||
.addDecorator(story => | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
width: '100%', | ||
height: '100%', | ||
top: 0, | ||
left: 0, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
{story()} | ||
</div> | ||
) | ||
.add('stacked', () => <Bar {...commonProperties} />) | ||
.add('grouped', () => <Bar {...commonProperties} groupMode="grouped" />) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
|
||
import { storiesOf } from '@storybook/react' | ||
import { generateSerie, randColor } from 'nivo-generators' | ||
import { Radar } from '../../src' | ||
|
||
const commonProperties = { | ||
width: 600, | ||
height: 600, | ||
margin: { top: 60, right: 60, bottom: 60, left: 60 }, | ||
facets: ['fruity', 'bitter', 'heavy', 'strong', 'sunny'], | ||
//colors: 'nivo', | ||
data: ['chardonay', 'carmenere', 'syrah'].map(id => ({ | ||
id, | ||
color: randColor(), | ||
data: generateSerie(5), | ||
})), | ||
} | ||
|
||
storiesOf('Radar', module) | ||
.addDecorator(story => | ||
<div | ||
style={{ | ||
position: 'absolute', | ||
width: '100%', | ||
height: '100%', | ||
top: 0, | ||
left: 0, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}} | ||
> | ||
{story()} | ||
</div> | ||
) | ||
.add('default', () => <Radar {...commonProperties} />) | ||
.add('linear grid shape', () => <Radar {...commonProperties} gridShape="linear" />) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
|
||
import { storiesOf } from '@storybook/react' | ||
import { action } from '@storybook/addon-actions' | ||
import { linkTo } from '@storybook/addon-links' | ||
|
||
import { Button, Welcome } from '@storybook/react/demo' | ||
|
||
storiesOf('Welcome', module).add('to Storybook', () => <Welcome showApp={linkTo('Button')} />) | ||
|
||
storiesOf('Button', module) | ||
.add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>) | ||
.add('with some emoji', () => <Button onClick={action('clicked')}>😀 😎 👍 💯</Button>) |
Oops, something went wrong.