-
Notifications
You must be signed in to change notification settings - Fork 93
/
index.js
61 lines (57 loc) · 2.05 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import React from 'react'
import { storiesOf } from '@storybook/react'
// import { action } from '@storybook/addon-actions'
import { muiTheme } from 'storybook-addon-material-ui'
import SuperSelectField from '../src'
import welcome from './welcome'
import { multiple, multipleWithClose } from './multiple'
import customStyle from './customStyle'
import autocomplete from './autocomplete'
import optionsGrouping from './optionsGrouping'
storiesOf('Welcome', module).addDecorator(muiTheme()).add('to SuperSelectField', welcome)
storiesOf('SuperSelectField', module)
.addDecorator(muiTheme())
.add('No child', () =>
<SuperSelectField
style={{ width: 300, margin: 20 }}>
</SuperSelectField>)
.add('Single child', () =>
<SuperSelectField
style={{ width: 300, margin: 20 }}>
<span value={1} label='Option 1'>Option 1</span>
</SuperSelectField>)
.add('Error text', () =>
<SuperSelectField
errorText='Error text warning something is wrong!'
style={{ width: 300, margin: 20 }}>
<span value={1} label='Option 1'>Option 1</span>
<span value={2} label='Option 2'>Option 2</span>
</SuperSelectField>)
.add('Disabled', () =>
<SuperSelectField
hintText='Disabled'
disabled={true}
style={{ width: 300, margin: 20 }}>
</SuperSelectField>)
.add('Floating label', () =>
<SuperSelectField
floatingLabel='Floating label'
style={{ width: 300, margin: 20 }}>
<span value={1} label='Option 1'>Option 1</span>
<span value={2} label='Option 2'>Option 2</span>
<span value={3} label='Option 3'>Option 3</span>
</SuperSelectField>)
.add('Empty groups', () =>
<SuperSelectField
hintText='Empty groups'
style={{ width: 300, margin: 20 }}>
<optgroup label='Group A'>
</optgroup>
<optgroup label='Group B'>
</optgroup>
</SuperSelectField>)
.add('Multiple', multiple)
.add('Multiple with close button', multipleWithClose)
.add('Autocomplete', autocomplete)
.add('Custom styling', customStyle)
.add('Options grouping', optionsGrouping)