aboutsummaryrefslogtreecommitdiffstats
path: root/stories/react/RadioGroup.stories.js
diff options
context:
space:
mode:
Diffstat (limited to 'stories/react/RadioGroup.stories.js')
-rw-r--r--stories/react/RadioGroup.stories.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/stories/react/RadioGroup.stories.js b/stories/react/RadioGroup.stories.js
new file mode 100644
index 0000000..912f9b9
--- /dev/null
+++ b/stories/react/RadioGroup.stories.js
@@ -0,0 +1,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;