var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, text, boolean, object } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';

import InputRadioGroup from './index';
import inputRadioGroupOptions from './InputRadioGroup.knobs.options';
import InputRadioGroupDocs from './InputRadioGroup.md';

storiesOf('forms|molecules', module).addDecorator(withKnobs({ escapeHTML: false })).add('InputRadioGroup', function () {
  var InputRadioGroupProps = {
    title: text('title', 'Pick your favorite plant'),
    name: text('group', 'favorite-plant'),
    outline: boolean('outline', true),
    defaultSelected: text('defaultSelected', ''),
    error: boolean('error', false),
    errorMsg: text('errorMsg', 'You must selected your favorite plant.'),
    disabled: boolean('disabled', false),
    inline: boolean('inline', true),
    radioButtons: object('radioButtons', inputRadioGroupOptions.radioButtons)
  };

  return React.createElement(InputRadioGroup, _extends({}, InputRadioGroupProps, { onChange: action('onChange') }));
}, { info: InputRadioGroupDocs });