aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button-group/button-group.stories.js
blob: 14e1a7e4962718949ddfa0358863f7009632f607 (plain) (blame)
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
import React from 'react'
import { storiesOf } from '@storybook/react'
import { action } from '@storybook/addon-actions'
import ButtonGroup from './'
import Button from '../button'
import { text, boolean } from '@storybook/addon-knobs/react'

storiesOf('ButtonGroup', module)
  .add('with Buttons', () =>
    <ButtonGroup
      style={{ width: '300px' }}
      disabled={boolean('Disabled', false)}
      defaultActiveButtonIndex={1}
    >
      <Button
        onClick={action('cheap')}
      >
        {text('Button1', 'Cheap')}
      </Button>
      <Button
        onClick={action('average')}
      >
        {text('Button2', 'Average')}
      </Button>
      <Button
        onClick={action('fast')}
      >
        {text('Button3', 'Fast')}
      </Button>
    </ButtonGroup>
  )
  .add('with a disabled Button', () =>
    <ButtonGroup
      style={{ width: '300px' }}
      disabled={boolean('Disabled', false)}
    >
      <Button
        onClick={action('enabled')}
      >
        {text('Button1', 'Enabled')}
      </Button>
      <Button
        onClick={action('disabled')}
        disabled
      >
        {text('Button2', 'Disabled')}
      </Button>
    </ButtonGroup>
  )