"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.SmallOption = exports.InverseOption = exports.DefaultRadio = exports.DefaultCheckbox = exports.ChoiceChildren = void 0;

var _react = _interopRequireDefault(require("react"));

var _Alert = require("../Alert");

var _ChoiceList = _interopRequireDefault(require("./ChoiceList"));

var _Choice = _interopRequireDefault(require("./Choice"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = {
  title: 'Components/ChoiceList',
  component: _ChoiceList.default,
  argTypes: {
    choices: {
      control: false
    }
  },
  args: {
    choices: [{
      label: 'Choice 1',
      value: 'A',
      defaultChecked: true,
      inputRef: function inputRef() {
        console.log('I am a ref callback being called!');
      }
    }, {
      label: 'Choice 2',
      requirementLabel: 'Choice hint text',
      value: 'B'
    }, {
      label: 'Disabled choice 3',
      value: 'C',
      disabled: true
    }]
  },
  subcomponents: {
    Alert: _Alert.Alert,
    Choice: _Choice.default
  }
};
exports.default = _default;

var Template = function Template(args) {
  return /*#__PURE__*/_react.default.createElement(_ChoiceList.default, args);
};

var DefaultCheckbox = Template.bind({});
exports.DefaultCheckbox = DefaultCheckbox;
DefaultCheckbox.args = {
  label: 'Checkbox example',
  hint: 'Helpful hint text',
  name: 'checkbox_choices',
  type: 'checkbox'
};
var DefaultRadio = Template.bind({});
exports.DefaultRadio = DefaultRadio;
DefaultRadio.args = {
  errorMessage: 'Example error message',
  label: 'Radio example',
  name: 'radio_choices',
  type: 'radio'
};
var SmallOption = Template.bind({});
exports.SmallOption = SmallOption;
SmallOption.args = {
  label: 'Small size example',
  name: 'size-variants',
  type: 'radio',
  size: 'small'
};
var InverseOption = Template.bind({});
exports.InverseOption = InverseOption;
InverseOption.args = {
  label: 'Inverse example',
  errorMessage: 'Example error message',
  hint: 'Helpful hint text',
  name: 'inverse_choices_field',
  type: 'checkbox',
  inversed: true
};
InverseOption.parameters = {
  backgrounds: {
    default: process.env.STORYBOOK_DS === 'medicare' ? 'Mgov dark' : 'Hcgov dark'
  }
};
var ChoiceChildren = Template.bind({});
exports.ChoiceChildren = ChoiceChildren;
ChoiceChildren.args = {
  name: 'radio_choices',
  type: 'radio',
  choices: [{
    label: 'Choice 1',
    value: 'A',
    defaultChecked: true,
    checkedChildren: /*#__PURE__*/_react.default.createElement(_Alert.Alert, {
      heading: "You'll save more with this option"
    }, "Based on the household information you provided, this option will give you the maximum savings. We are adding some filler text just to show what it looks like when you have a long alert as the checkedChildren of a Choice component.")
  }, {
    label: 'Choice 2',
    requirementLabel: 'Choice hint text',
    value: 'B',
    checkedChildren: /*#__PURE__*/_react.default.createElement(_Alert.Alert, {
      variation: "warn",
      heading: "Are you sure?"
    }, "Based on the household information you provided, you can actually save more with the other option. You are free to change this at any point during the application process until you have signed and submitted your final application.")
  }]
};