aboutsummaryrefslogtreecommitdiffstats
path: root/stories/react/RadioGroup.stories.js
blob: 912f9b947d90f83c9c5b25aa063ff363d6b7ea92 (plain)
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
import React from 'react';
import Examples from './utils/Examples.js';

import RadioGroup from '../../src/react/RadioGroup';
import HTMLRadioGroup from '../../components/radioGroup/radio-group.html';
import HTMLRadioGroupValue from '../../components/radioGroup/radio-group-value.html';
import HTMLRadioGroupDisabled from '../../components/radioGroup/radio-group-disabled.html';
import HTMLRadioGroupNoTitle from '../../components/radioGroup/radio-group-no-title.html';

let examples = {
	'Value': {
		jsx: <RadioGroup name='grp2' value='1' title='Group B' onChange={()=>{}} data-test-id='grp2' options={[{value: '1', label: 'option 1'}, {value: '2', label: 'option 2'}]} />,
		html: HTMLRadioGroupValue
	},
	'No Value': {
		jsx: <RadioGroup name='grp3' title='Group C' onChange={()=>{}} data-test-id='grp3' options={[{value: '1', label: 'option 1'}, {value: '2', label: 'option 2'}]} />,
		html: HTMLRadioGroup
	},
	'Disabled': {
		jsx: <RadioGroup name='grp4' disabled={true} title='Group D' onChange={()=>{}} data-test-id='grp4' options={[{value: '1', label: 'option 1'}, {value: '2', label: 'option 2'}]} />,
		html: HTMLRadioGroupDisabled
	},
	'No title': {
		jsx: <RadioGroup name='grp5' onChange={()=>{}} data-test-id='grp4' options={[{value: '1', label: 'option 1'}, {value: '2', label: 'option 2'}]} />,
		html: HTMLRadioGroupNoTitle
	}

};

const RadioGroups = () => (
	<Examples examples={examples} />
);

export default RadioGroups;