"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.WithError = exports.OptionGroup = exports.InverseOption = exports.Disabled = exports.DefaultDropdown = void 0;

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

var _Dropdown = _interopRequireDefault(require("./Dropdown"));

var _Select = _interopRequireDefault(require("./Select"));

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

var _default = {
  title: 'Components/Dropdown',
  component: _Dropdown.default,
  argTypes: {
    children: {
      control: false
    },
    options: {
      control: false
    }
  },
  subcomponents: {
    Select: _Select.default
  }
};
exports.default = _default;
var dropdownOptions = [{
  label: '- Select an option -',
  value: ''
}, {
  label: 'Option 1',
  value: '1'
}, {
  label: 'Option 2',
  value: '2'
}, {
  label: 'Option 3',
  value: '3'
}, {
  label: 'Option 4',
  value: '4'
}, {
  label: 'Option 5',
  value: '5'
}, {
  label: 'Option 6',
  value: '6'
}, {
  label: 'Option 7',
  value: '7'
}, {
  label: 'Option 8',
  value: '8'
}];

var optGroupData = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("optgroup", {
  label: "Option group"
}, /*#__PURE__*/_react.default.createElement("option", {
  value: "1-1"
}, "Option 1"), /*#__PURE__*/_react.default.createElement("option", {
  value: "1-2"
}, "Option 2"), /*#__PURE__*/_react.default.createElement("option", {
  value: "1-3"
}, "Option 3")), /*#__PURE__*/_react.default.createElement("optgroup", {
  label: "More option groups"
}, /*#__PURE__*/_react.default.createElement("option", {
  value: "2-1"
}, "Option 4"), /*#__PURE__*/_react.default.createElement("option", {
  value: "2-2"
}, "Option 5"), /*#__PURE__*/_react.default.createElement("option", {
  value: "2-3"
}, "Option 6")));

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

var DefaultDropdown = Template.bind({});
exports.DefaultDropdown = DefaultDropdown;
DefaultDropdown.args = {
  options: dropdownOptions,
  label: 'Dropdown example',
  name: 'dropdown_field'
};
var WithError = Template.bind({});
exports.WithError = WithError;
WithError.args = {
  options: dropdownOptions,
  errorMessage: 'Example error message',
  hint: 'Helpful hint text',
  label: 'Error example',
  name: 'error_dropdown_field'
};
var Disabled = Template.bind({});
exports.Disabled = Disabled;
Disabled.args = {
  options: dropdownOptions,
  label: 'Disabled example',
  disabled: true,
  name: 'disabled_dropdown_field'
};
var OptionGroup = Template.bind({});
exports.OptionGroup = OptionGroup;
OptionGroup.args = {
  options: [],
  defaultValue: '1-1',
  label: 'Option group example',
  name: 'custom_dropdown_field',
  children: optGroupData
};
var InverseOption = Template.bind({});
exports.InverseOption = InverseOption;
InverseOption.args = {
  options: dropdownOptions,
  errorMessage: 'Example error message',
  hint: 'Helpful hint text',
  label: 'Inverse example',
  name: 'inverse_dropdown_field',
  inversed: true
};
InverseOption.parameters = {
  backgrounds: {
    default: process.env.STORYBOOK_DS === 'medicare' ? 'Mgov dark' : 'Hcgov dark'
  }
};