"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _typeof = require("@babel/runtime/helpers/typeof");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.HorizontalGrouping = exports.VerticalGrouping = exports.HideLabel = exports.DisabledInput = exports.Indeterminate = exports.CheckedInput = exports.Regular = exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

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

var _README = _interopRequireDefault(require("./README.mdx"));

var _ = _interopRequireDefault(require("."));

var _InputGroup = _interopRequireDefault(require("../InputGroup"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

var _default = {
  title: 'Components/Forms/Checkbox',
  component: _.default,
  parameters: {
    componentSubtitle: 'Component',
    status: 'released',
    mdx: _README.default
  }
};
exports.default = _default;

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

exports.Regular = Regular;
Regular.args = {
  labelText: 'Label text',
  id: 'check-1'
};
var description = "\nYou can customize the content by using `BannerNavigation`.\n";
Regular.story = {
  parameters: {
    docs: {
      storyDescription: description
    }
  }
};

var CheckedInput = function CheckedInput(args) {
  var _useState = (0, _react.useState)(true),
      _useState2 = (0, _slicedToArray2.default)(_useState, 2),
      isChecked = _useState2[0],
      setChecked = _useState2[1];

  return /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    onChange: function onChange() {
      return setChecked(!isChecked);
    },
    checked: isChecked
  }));
};

exports.CheckedInput = CheckedInput;
CheckedInput.args = {
  labelText: 'Checked Input',
  id: 'check-2'
};
var check = "Specify whether the underlying input should be checked.";
CheckedInput.story = {
  parameters: {
    docs: {
      storyDescription: check
    }
  }
};

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

exports.Indeterminate = Indeterminate;
Indeterminate.args = {
  labelText: 'Indeterminate Input',
  indeterminate: true,
  id: 'check-3'
};
var indeterminate = "Is a state that is neither checked nor unchecked. It\u2019s that in-between state that we might consider the \u201CMaybe\u201D between \u201CYes\u201D and \u201CNo\u201D options";
Indeterminate.story = {
  parameters: {
    docs: {
      storyDescription: indeterminate
    }
  }
};

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

exports.DisabledInput = DisabledInput;
DisabledInput.args = {
  labelText: 'Disabled Input',
  disabled: true,
  id: 'check-4'
};
var disabled = "Specify whether the Checkbox should be interactive or not";
DisabledInput.story = {
  parameters: {
    docs: {
      storyDescription: disabled
    }
  }
};

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

exports.HideLabel = HideLabel;
HideLabel.args = {
  labelText: 'Hidden Label',
  hideLabel: true,
  id: 'check-5'
};
var nolabel = "Specify whether the label should be hidden or not";
HideLabel.story = {
  parameters: {
    docs: {
      storyDescription: nolabel
    }
  }
};

var VerticalGrouping = function VerticalGrouping(args) {
  return /*#__PURE__*/_react.default.createElement(_InputGroup.default, {
    helperText: "select any that apply",
    labelText: "Programming language preference",
    vertical: true
  }, /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    defaultChecked: true,
    labelText: "ReactJs",
    id: "react"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    defaultChecked: true,
    labelText: "ReactNative",
    id: "native"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    labelText: "Node.js",
    id: "node"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    labelText: "PHP",
    id: "php"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    labelText: "Java",
    id: "java"
  })));
};

exports.VerticalGrouping = VerticalGrouping;
VerticalGrouping.args = {}; // const nolabel = `Specify whether the label should be hidden or not`;
// CheckboxGroup.story = {
//   parameters: {
//     docs: {
//       storyDescription: nolabel,
//     },
//   },
// };

var HorizontalGrouping = function HorizontalGrouping(args) {
  return /*#__PURE__*/_react.default.createElement(_InputGroup.default, {
    helperText: "select any that apply",
    labelText: "Programming language preference"
  }, /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    defaultChecked: true,
    labelText: "ReactJs",
    id: "react1"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    defaultChecked: true,
    labelText: "ReactNative",
    id: "native1"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    labelText: "Node.js",
    id: "node1"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    defaultChecked: true,
    labelText: "PHP",
    id: "php1"
  })), /*#__PURE__*/_react.default.createElement(_.default, (0, _extends2.default)({}, args, {
    labelText: "Java",
    id: "java1"
  })));
};

exports.HorizontalGrouping = HorizontalGrouping;
HorizontalGrouping.args = {};