'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var evokit = require('evokit');

function _interopNamespaceCompat(e) {
  if (e && typeof e === 'object' && 'default' in e) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);

function _extends() {
  _extends = Object.assign ? Object.assign.bind() : 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 _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;
}
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;
}

var css = {"ek-spinner":"Spinner__ek-spinner___rQ9Id","rotate":"Spinner__rotate___3-ehr","ek-spinner__circle":"Spinner__ek-spinner__circle___WUAuk","dash":"Spinner__dash___7Gan0","ek-spinner_color_violet-500":"Spinner__ek-spinner_color_violet-500___2-Ca6","ek-spinner_color_white":"Spinner__ek-spinner_color_white___8PnDF","ek-spinner_color_yellow-500":"Spinner__ek-spinner_color_yellow-500___qa3Oc"};

var _excluded = ["width", "height"];
var SpinnerBlock = evokit.createBlock('svg', 'spinner', ['color'], {
  css: css
});
var SpinnerCircleBlock = evokit.createBlock('circle', 'spinner__circle', [], {
  css: css
});
var Spinner = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
  var _ref$width = _ref.width,
    width = _ref$width === void 0 ? '1em' : _ref$width,
    _ref$height = _ref.height,
    height = _ref$height === void 0 ? '1em' : _ref$height,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React__namespace.createElement(SpinnerBlock, _extends({
    ref: ref,
    role: "progressbar",
    width: width,
    height: height
  }, props, {
    viewBox: "22 22 44 44"
  }), /*#__PURE__*/React__namespace.createElement(SpinnerCircleBlock, {
    fill: "none",
    cx: 44,
    cy: 44,
    r: 20.2,
    strokeWidth: 3.6
  }));
});
Spinner.displayName = 'Spinner';

exports.Spinner = Spinner;

require('./style.development.v2.css');
