Skip to content

Commit

Permalink
Add some more stories
Browse files Browse the repository at this point in the history
  • Loading branch information
dpikt committed Mar 27, 2017
1 parent 5267fe1 commit b20ebd0
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ npm-debug.log*
node_modules

# compiled storybook dir
stories/static/compiled
.storybook/static/storybook
1 change: 1 addition & 0 deletions .storybook/static/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php header( 'Location: /storybook/index.html' ); ?>
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: vendor/bin/heroku-php-nginx stories/static/
web: vendor/bin/heroku-php-nginx .storybook/static/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"prepublish": "yarn run lint && yarn run clean && yarn run build && yarn run storybook:build",
"test": "jest",
"storybook": "start-storybook -p 6006",
"storybook:build": "build-storybook -o stories/static/compiled"
"storybook:build": "build-storybook -o .storybook/static/storybook"
},
"files": [
"README.md",
Expand Down
9 changes: 6 additions & 3 deletions stories/button.story.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import { storiesOf, action } from '@kadira/storybook';
import { Button } from '../src';
import React from 'react'
import { storiesOf, action } from '@kadira/storybook'
import { Button } from '../src'

storiesOf('Button', module)
.add('with text', () => (
<Button onClick={action('clicked')}>Hello Button</Button>
))
.add('with emoji', () => (
<Button onClick={action('clicked')}>😎</Button>
))
42 changes: 42 additions & 0 deletions stories/input.story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import { storiesOf, action } from '@kadira/storybook'
import { Input } from '../src'

const inputProps = {
name: 'person.firstName',
value: '',
onChange: action('field changed')
}

storiesOf('Input', module)
.add('with default label', () => (
<Input
input={inputProps}
meta={{}}
/>
))
.add('with custom label', () => (
<Input
input={inputProps}
meta={{}}
label="Custom Label"
/>
))
.add('with no label', () => (
<Input
input={inputProps}
meta={{}}
label={false}
/>
))
.add('with invalid input', () => (
<Input
input={inputProps}
meta={{
invalid: true,
touched: true,
error: 'Invalid input'
}}
value="0000"
/>
))
1 change: 0 additions & 1 deletion stories/static/index.php

This file was deleted.

0 comments on commit b20ebd0

Please sign in to comment.