Skip to content

Commit

Permalink
Added story
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasmus Wølk authored and Rasmus Wølk committed Nov 27, 2017
1 parent dfb9539 commit 8d52c87
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
12 changes: 12 additions & 0 deletions atom.cson
@@ -0,0 +1,12 @@
"*":
editor:
backUpBeforeSaving: true
fontSize: 13
invisibles: {}
lineHeight: 2.5
scrollPastEnd: true
scrollSensitivity: 80
showIndentGuide: true
showInvisibles: true
tabLength: 2
zoomFontWhenCtrlScrolling: true
3 changes: 1 addition & 2 deletions lib/Checkbox/Checkbox.css
Expand Up @@ -44,8 +44,7 @@
flex-grow: 2;
padding: 7px 2px;
margin: 0 4px;
font-size: 0.8rem;
font-weight: bold;
font-weight: 600;
color: var(--labelColor);

&.error {
Expand Down
51 changes: 51 additions & 0 deletions lib/Checkbox/Checkbox.stories.js
@@ -0,0 +1,51 @@
import React from 'react';
import { storiesOf } from '@storybook/react'; // eslint-disable-line import/no-extraneous-dependencies
import Checkbox from './Checkbox';

class CheckboxExample extends React.Component {
constructor() {
super();
this.state = {
selected: 'option_1',
options: [
{
label: 'Option 1',
value: 'option_1',
},
{
label: 'Option 2',
value: 'option_2',
},
{
label: 'Option 3',
value: 'option_3',
},
{
label: 'Option 4',
value: 'option_4',
},
{
label: 'Option 5 (with error)',
value: 'option_5',
error: true,
},
],
};
}
render() {
const { selected, options } = this.state;
return (
<div style={{ padding: '15px' }}>
{ options.map(option => (
<Checkbox
id={option.value}
label={option.label}
/>
)) }
</div>
);
}
}

storiesOf('Checkbox', module)
.add('Basic Usage', () => (<CheckboxExample />));

0 comments on commit 8d52c87

Please sign in to comment.