DocSpace-client/web/ASC.Web.Storybook/stories/input/combobox/combobox.stories.js

48 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-07-18 08:00:54 +00:00
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs, boolean} from '@storybook/addon-knobs/react';
import withReadme from 'storybook-readme/with-readme';
import Readme from './README.md';
import Section from '../../../.storybook/decorators/section';
import { ComboBox } from 'asc-web-components'
2019-07-31 18:42:23 +00:00
import { action } from '@storybook/addon-actions';
2019-07-18 08:00:54 +00:00
2019-07-31 18:42:23 +00:00
const options = [
2019-07-18 08:00:54 +00:00
{
key: 1,
icon: 'CatalogEmployeeIcon',
label: 'Option 1'
2019-07-18 08:00:54 +00:00
},
{
key: 2,
icon: 'CatalogGuestIcon',
label: 'Option 2',
2019-07-18 08:00:54 +00:00
},
{
key: 3,
label: 'Option 3'
},
{
key: 4,
label: 'Option 4'
},
{
key: 5,
icon: 'CopyIcon',
label: 'Option 5'
2019-07-18 08:00:54 +00:00
}
];
storiesOf('Components|Input', module)
.addDecorator(withKnobs)
.addDecorator(withReadme(Readme))
.add('combo box', () => (
<Section>
<ComboBox
options={options}
2019-07-31 18:42:23 +00:00
onSelect={option => action("Selected option")(option)}
2019-07-18 08:00:54 +00:00
isDisabled={boolean('isDisabled', false)}
withBorder={boolean('withBorder', true)}
2019-07-18 08:00:54 +00:00
/>
</Section>
));