'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 ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);
  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    enumerableOnly && (symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    })), keys.push.apply(keys, symbols);
  }
  return keys;
}
function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = null != arguments[i] ? arguments[i] : {};
    i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
      _defineProperty(target, key, source[key]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
      Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
    });
  }
  return target;
}
function _defineProperty(obj, key, value) {
  key = _toPropertyKey(key);
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }
  return obj;
}
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;
}
function _toPrimitive(input, hint) {
  if (typeof input !== "object" || input === null) return input;
  var prim = input[Symbol.toPrimitive];
  if (prim !== undefined) {
    var res = prim.call(input, hint || "default");
    if (typeof res !== "object") return res;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
  var key = _toPrimitive(arg, "string");
  return typeof key === "symbol" ? key : String(key);
}

var css = {"ek-skeleton":"Skeleton__ek-skeleton___k6rop","ek-skeleton_theme_black-100":"Skeleton__ek-skeleton_theme_black-100___eJWcz","ek-skeleton_theme_white":"Skeleton__ek-skeleton_theme_white___PCwFG","ek-skeleton_variant_text":"Skeleton__ek-skeleton_variant_text___NbT89","ek-skeleton_variant_circle":"Skeleton__ek-skeleton_variant_circle___SlAh0","ek-skeleton_variant_square":"Skeleton__ek-skeleton_variant_square___7p339","ek-skeleton_align_left":"Skeleton__ek-skeleton_align_left___TbAuG","ek-skeleton_align_center":"Skeleton__ek-skeleton_align_center___De09W","ek-skeleton_align_right":"Skeleton__ek-skeleton_align_right___C-QUn","ek-skeleton_opacity_0":"Skeleton__ek-skeleton_opacity_0___BV48x","ek-skeleton_opacity_10":"Skeleton__ek-skeleton_opacity_10___oVBvx","ek-skeleton_opacity_20":"Skeleton__ek-skeleton_opacity_20___F--5F","ek-skeleton_opacity_30":"Skeleton__ek-skeleton_opacity_30___rwtgY","ek-skeleton_opacity_40":"Skeleton__ek-skeleton_opacity_40___iR-d8","ek-skeleton_opacity_50":"Skeleton__ek-skeleton_opacity_50___r6goB","ek-skeleton_opacity_60":"Skeleton__ek-skeleton_opacity_60___-DW2y","ek-skeleton_opacity_70":"Skeleton__ek-skeleton_opacity_70___zqdBc","ek-skeleton_opacity_80":"Skeleton__ek-skeleton_opacity_80___Vc9gU","ek-skeleton_opacity_90":"Skeleton__ek-skeleton_opacity_90___t9rT-","ek-skeleton_opacity_100":"Skeleton__ek-skeleton_opacity_100___lw65w"};

var _excluded = ["align", "height", "opacity", "style", "theme", "variant", "width"];
var SkeletonBlock = evokit.createBlock('div', 'skeleton', ['align', 'theme', 'variant', 'opacity'], {
  css: css
});
var Skeleton = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
  var _ref$align = _ref.align,
    align = _ref$align === void 0 ? 'left' : _ref$align,
    height = _ref.height,
    opacity = _ref.opacity,
    style = _ref.style,
    _ref$theme = _ref.theme,
    theme = _ref$theme === void 0 ? 'black-100' : _ref$theme,
    _ref$variant = _ref.variant,
    variant = _ref$variant === void 0 ? 'text' : _ref$variant,
    width = _ref.width,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React__namespace.createElement(SkeletonBlock, _extends({
    "skeleton-align": align,
    "skeleton-theme": theme,
    "skeleton-variant": variant,
    "skeleton-opacity": opacity,
    style: _objectSpread2({
      height: height,
      width: width
    }, style),
    "data-qaid": "skeleton",
    "data-testid": "skeleton"
  }, props, {
    ref: ref
  }));
});
Skeleton.displayName = 'Skeleton';

exports.Skeleton = Skeleton;

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