"use strict";

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

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

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

var _primitives = require("../../../primitives");

var _typography = require("../../../mixins/typography");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

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 SpinnerAnimation = _styledComponents["default"].div.withConfig({
  displayName: "SpinnerAnimation",
  componentId: "b39y4p-0"
})(["display:inline-block;position:relative;width:", ";height:", ";padding-top:calc(", " * 0.0625);div{box-sizing:border-box;display:block;position:absolute;width:", ";height:", ";border:calc(", " * 0.125) solid;border-radius:50%;animation:lds-ring 1.2s cubic-bezier(0.5,0,0.5,1) infinite;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}div:nth-child(1){animation-delay:-0.45s;}div:nth-child(2){animation-delay:-0.3s;}div:nth-child(3){animation-delay:-0.15s;}@keyframes lds-ring{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}"], _typography.getFontSize, _typography.getFontSize, _typography.getFontSize, _typography.getFontSize, _typography.getFontSize, _typography.getFontSize);

var Spinner = function Spinner(_ref) {
  var className = _ref.className,
      spacing = _ref.spacing,
      grow = _ref.grow,
      shrink = _ref.shrink,
      basis = _ref.basis,
      dataQa = _ref['data-qa'],
      dataCy = _ref['data-cy'],
      id = _ref.id,
      _ref$colorName = _ref.colorName,
      colorName = _ref$colorName === void 0 ? 'greyscale-dark' : _ref$colorName,
      fontSize = _ref.fontSize,
      props = _objectWithoutProperties(_ref, ["className", "spacing", "grow", "shrink", "basis", "data-qa", "data-cy", "id", "colorName", "fontSize"]);

  return /*#__PURE__*/_react["default"].createElement(_primitives.Box, _extends({
    className: className,
    "data-cy": dataCy,
    "data-qa": dataQa,
    id: id,
    spacing: spacing,
    grow: grow,
    shrink: shrink,
    basis: basis
  }, props), /*#__PURE__*/_react["default"].createElement(SpinnerAnimation, {
    colorName: colorName,
    fontSize: fontSize
  }, /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement("div", null), /*#__PURE__*/_react["default"].createElement("div", null)));
};

exports.Spinner = Spinner;
Spinner.displayName = 'Spinner';