"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.SpinnerButton = exports.LinkButton = exports.InverseButton = exports.IconButton = exports.DefaultButton = void 0;

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

var _Button = _interopRequireDefault(require("./Button"));

var _Icons = require("../Icons");

var _Spinner = _interopRequireDefault(require("../Spinner/Spinner"));

var _excluded = ["data"];

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

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var _default = {
  title: 'Components/Button',
  component: _Button.default,
  argTypes: {
    // children can be text or a ReactNode. For storybook controls, just allowing strings
    children: {
      control: {
        type: 'text'
      },
      type: {
        name: 'string',
        required: true
      }
    },
    disabled: {
      control: {
        type: 'boolean'
      }
    },
    // hiding deprecated props
    inverse: {
      table: {
        disable: true
      }
    },
    component: {
      table: {
        disable: true
      }
    },
    // hiding deprecated opts
    variation: {
      options: ['primary', 'success', 'transparent']
    }
  },
  args: {
    children: 'Your button text here'
  }
};
exports.default = _default;

var Template = function Template(_ref) {
  var data = _ref.data,
      args = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/_react.default.createElement(_Button.default, args);
};

var DefaultButton = Template.bind({});
exports.DefaultButton = DefaultButton;
var InverseButton = Template.bind({});
exports.InverseButton = InverseButton;
InverseButton.args = {
  inversed: true
};
InverseButton.parameters = {
  backgrounds: {
    default: process.env.STORYBOOK_DS === 'medicare' ? 'Mgov dark' : 'Hcgov dark'
  }
};
var IconButton = Template.bind({});
exports.IconButton = IconButton;
IconButton.args = {
  children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Button with icon ", /*#__PURE__*/_react.default.createElement(_Icons.NextIcon, null), ' ')
};
var SpinnerButton = Template.bind({});
exports.SpinnerButton = SpinnerButton;
SpinnerButton.args = {
  children: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Spinner.default, null), " Loading..."),
  variation: 'primary'
};
var LinkButton = Template.bind({});
exports.LinkButton = LinkButton;
LinkButton.args = {
  href: 'javascript:void(0);'
};
LinkButton.parameters = {
  loki: {
    skip: true
  }
};