"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

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

var _propTypes = _interopRequireDefault(require("prop-types"));

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

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _injectE2E = _interopRequireDefault(require("../../Tools/injectE2E"));

var _interpolation = require("../../Tools/interpolation");

var Wrapper =
/*#__PURE__*/
_styledComponents.default.button.attrs(_injectE2E.default).withConfig({
  componentId: "sc-1t2k7dn-0"
})(["\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n  height: 2.5rem;\n  line-height: 2.5rem;\n  width: 100%;\n  padding: 0 1rem;\n  box-sizing: border-box;\n  color: ", ";\n  background-color: ", ";\n  border: none;\n  border-radius: ", ";\n  cursor: ", ";\n  outline: none;\n  transition: all 0.3s ease 0s;\n  opacity: ", ";\n  font-family: ", ";\n  font-size: ", ";\n  font-weight: 600;\n\n  &:hover {\n    background-color: ", ";\n    transform: ", ";\n  }\n"], (0, _interpolation.theme)('buttonColor'), (0, _interpolation.theme)('buttonBackgroundColor'), (0, _interpolation.theme)('buttonBorderRadius'), function (props) {
  return props.disabled === true ? 'not-allowed' : 'pointer';
}, function (props) {
  return props.disabled === true ? 0.5 : 1;
}, (0, _interpolation.theme)('fontPrimary'), (0, _interpolation.fontSize)('md'), function (props) {
  return props.disabled === true ? (0, _interpolation.theme)('buttonBackgroundColor')(props) : (0, _interpolation.theme)('buttonHoverColor')(props);
}, function (props) {
  return props.bounced === true ? 'scale(0.95)' : 'none';
});

var Button = function Button(_ref) {
  var children = _ref.children,
      rest = (0, _objectWithoutProperties2.default)(_ref, ["children"]);
  return React.createElement(Wrapper, rest, children);
};

Button.propTypes = process.env.NODE_ENV !== "production" ? {
  bounced: _propTypes.default.bool,
  children: _propTypes.default.node,
  disabled: _propTypes.default.bool,
  e2e: _propTypes.default.string,
  type: _propTypes.default.oneOf(['button', 'reset', 'submit'])
} : {};
Button.defaultProps = {
  bounced: false,
  disabled: false,
  e2e: 'defaultButton',
  type: 'button'
};
var _default = Button;
exports.default = _default;