import _extends from "@babel/runtime/helpers/extends";
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import React, { useState } from 'react';
import { addStoryInGroup, LOW_LEVEL_BLOCKS } from '../../../.storybook/utils';
import { RadioGroup, RadioButton } from '../../index';
var values = ['Option one', 'Option two', 'Option three'];
export default {
  component: RadioButton,
  title: addStoryInGroup(LOW_LEVEL_BLOCKS, 'Form elements/Radio'),
  parameters: {
    design: {
      type: 'figma',
      url: 'https://www.figma.com/file/LHH25GN90ljQaBEUNMsdJn/Desktop-components?node-id=6454%3A22776'
    }
  }
};
export var DefaultStory = function DefaultStory(args) {
  return /*#__PURE__*/React.createElement(RadioButton, args);
};
DefaultStory.args = {
  checked: true,
  label: 'I am the label',
  value: 'the_value'
};
export var Group = function Group(args) {
  var _useState = useState('Option one'),
      _useState2 = _slicedToArray(_useState, 2),
      value = _useState2[0],
      setValue = _useState2[1];

  var handleChange = function handleChange(value) {
    setValue(value);
  };

  return /*#__PURE__*/React.createElement(RadioGroup, _extends({}, args, {
    name: "stringValue",
    onChange: handleChange,
    value: value
  }), values.map(function (value, key) {
    return /*#__PURE__*/React.createElement(RadioButton, {
      key: key,
      marginVertical: 3,
      label: value,
      value: value
    });
  }));
};