"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.StyledBaseButton = undefined;

var _styledBase = require("@emotion/styled-base");

var _styledBase2 = _interopRequireDefault(_styledBase);

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _core = require("@emotion/core");

var _presets = require("../../utils/presets");

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

var _Button2 = _interopRequireDefault(_Button);

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

function _templateObject2() {
  var data = _taggedTemplateLiteral(["\n  33% {\n    transform: translateX(0.2em) scale(1.05);\n    }\n  66% {\n    transform: translateX(0.2em) scale(0.85);\n  }\n\n"]);

  _templateObject2 = function _templateObject2() {
    return data;
  };

  return data;
}

function _templateObject() {
  var data = _taggedTemplateLiteral(["\n  0% {\n    transform: translateX(0.2em) rotate(0);\n  }\n  100% {\n    transform: translateX(0.2em) rotate(360deg);\n  }\n"]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var loading = (0, _core.keyframes)(_templateObject());
var pulse = (0, _core.keyframes)(_templateObject2());
var sizes = {
  S: {
    fontSize: 0.875,
    height: 1.5,
    horizontalPadding: 0.5,
    verticalPadding: 0.3
  },
  M: {
    fontSize: 1,
    height: 2,
    horizontalPadding: 0.75,
    verticalPadding: 0.45
  },
  L: {
    fontSize: 1.125,
    height: 2.25,
    horizontalPadding: 1,
    verticalPadding: 0.55
  },
  XL: {
    fontSize: 1.5,
    height: 3.25,
    horizontalPadding: 1.25,
    verticalPadding: 0.65
  }
};
var StyledBaseButton = exports.StyledBaseButton = (
/*#__PURE__*/
0, _styledBase2["default"])(_Button.SkeletonStyledComponent, {
  target: "e2s9gwk0",
  label: "StyledBaseButton"
})("align-items:center;border:", _presets.palette.grey[600], ";border-radius:", _presets.radius["default"], ";box-sizing:border-box;cursor:pointer;display:inline-flex;font-family:", _presets.fontFamilies.headerFontFamily, ";font-size:", function (props) {
  return sizes[props.size].fontSize;
}, "rem;justify-content:center;line-height:1;min-height:", function (props) {
  return sizes[props.size].height;
}, "rem;padding:", function (props) {
  return sizes[props.size].verticalPadding;
}, "rem ", function (props) {
  return sizes[props.size].horizontalPadding;
}, "rem;text-decoration:none;transition:0.5s;&[disabled],&[disabled]:hover{cursor:not-allowed;opacity:0.5;}svg{animation-name:", function (props) {
  return props.showLoading ? loading : "";
}, ";animation-duration:1s;animation-iteration-count:infinite;animation-timing-function:linear;flex-shrink:0;transform:translateX(0.2em) scale(1);}&:hover:not([disabled]){svg{animation:", pulse, " 1s linear infinite;}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL0J1dHRvbi9CYXNlQnV0dG9uLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBEK0QiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvQnV0dG9uL0Jhc2VCdXR0b24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSBcInJlYWN0XCJcbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiXG5pbXBvcnQgeyBrZXlmcmFtZXMgfSBmcm9tIFwiQGVtb3Rpb24vY29yZVwiXG5cbmltcG9ydCB7IGZvbnRGYW1pbGllcywgcmFkaXVzLCBwYWxldHRlIH0gZnJvbSBcIi4uLy4uL3V0aWxzL3ByZXNldHNcIlxuXG5pbXBvcnQgQnV0dG9uU2tlbGV0b24sIHtcbiAgYnV0dG9uUHJvcFR5cGVzLFxuICBidXR0b25EZWZhdWx0UHJvcFR5cGVzLFxuICBTa2VsZXRvblN0eWxlZENvbXBvbmVudCxcbn0gZnJvbSBcIi4vQnV0dG9uLl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RpbWluZy1mdW5jdGlvbjogbGluZWFyO1xuICAgIGZsZXgtc2hyaW5rOiAwO1xuICAgIHRyYW5zZm9ybTogdHJhbnNsYXRlWCgwLjJlbSkgc2NhbGUoMSk7XG4gIH1cblxuICAmOmhvdmVyOm5vdChbZGlzYWJsZWRdKSB7XG4gICAgc3ZnIHtcbiAgICAgIGFuaW1hdGlvbjogJHtwdWxzZX0gMXMgbGluZWFyIGluZmluaXRlO1xuICAgIH1cbiAgfVxuYFxuXG5jb25zdCBCYXNlQnV0dG9uID0gcHJvcHMgPT4gKFxuICA8QnV0dG9uU2tlbGV0b24gU3R5bGVkQ29tcG9uZW50PXtTdHlsZWRCYXNlQnV0dG9ufSB7Li4ucHJvcHN9IC8+XG4pXG5cbkJhc2VCdXR0b24ucHJvcFR5cGVzID0gYnV0dG9uUHJvcFR5cGVzXG5CYXNlQnV0dG9uLmRlZmF1bHRQcm9wcyA9IGJ1dHRvbkRlZmF1bHRQcm9wVHlwZXNcblxuZXhwb3J0IGRlZmF1bHQgQmFzZUJ1dHRvblxuIl19 */"));

var BaseButton = function BaseButton(props) {
  return _react2["default"].createElement(_Button2["default"], Object.assign({
    StyledComponent: StyledBaseButton
  }, props));
};

BaseButton.propTypes = _Button.buttonPropTypes;
BaseButton.defaultProps = _Button.buttonDefaultPropTypes;
exports["default"] = BaseButton;