import React from 'react'
import PropTypes from 'prop-types'
import {storiesOf} from '@storybook/react'
import {
controller,
Clear,
Select,
Item,
Label,
Search,
List,
TagList,
Tag,
} from '../src'
import {renderOrCloneComponent} from '../src/utils'
import {
rendering,
renderingList,
renderingItem,
renderingSearch,
renderingTag,
onChange,
} from './utils/dummy'
const simpleOptions = [
{value: 'paris', label: 'Paris'},
{value: 'newyork', label: 'New-York'},
{value: 'tokyo', label: 'Tokyo'},
]
const simpleOptionsWithId = [
{id: 'paris', label: 'Paris'},
{id: 'newyork', label: 'New-York'},
{id: 'tokyo', label: 'Tokyo'},
]
const Container = props =>
const StatefulDisabled = BaseComponent => {
class Stateful extends React.Component {
state = {disabled: false}
_setDisabled = e => this.setState({disabled: e.target.checked})
render() {
return (
)
}
}
return
}
const StatefulChangeOptions = BaseComponent => {
class Stateful extends React.Component {
state = {fill: true}
_setFill = e => this.setState({fill: e.target.checked})
render() {
return (
)
}
}
return
}
storiesOf('Sync', module)
.add('Basic', () =>
)
.add('Basic - Wraning on undefined options', () =>
)
.add('Basic withCustom Key', () =>
)
.add('Basic changing options', () =>
StatefulChangeOptions(props =>
} />
)
)
.add('Basic without close on blur', () =>
)
.add('Basic disabled', () =>
)
.add('Search disabled', () =>
StatefulDisabled(props =>
}
/>
)
)
.add('Stay open', () =>
)
.add('Default value', () =>
props.onSelectValue(props.data)}
children={props.data.value}
/>}
/>
}
/>
)
.add('Custom placeholder', () =>
)
.add('Custom Label', () =>
)
.add('Custom List', () =>
)
.add('Custom Item', () =>
} />
)
.add('With Clear', () =>
{label}
}
/>
)
.add('With Search', () =>
} />
)
.add('Multi', () =>
)
.add('Multi Custom Tag', () =>
} />
)