-
Notifications
You must be signed in to change notification settings - Fork 37
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
Rasmus Wølk
authored and
Rasmus Wølk
committed
Nov 27, 2017
1 parent
dfb9539
commit 8d52c87
Showing
3 changed files
with
64 additions
and
2 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,12 @@ | ||
"*": | ||
editor: | ||
backUpBeforeSaving: true | ||
fontSize: 13 | ||
invisibles: {} | ||
lineHeight: 2.5 | ||
scrollPastEnd: true | ||
scrollSensitivity: 80 | ||
showIndentGuide: true | ||
showInvisibles: true | ||
tabLength: 2 | ||
zoomFontWhenCtrlScrolling: true |
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,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 />)); |