"use strict"; var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); /** @jsx jsx */ var React = __importStar(require("react")); var core_1 = require("@emotion/core"); var helpers_1 = require("./helpers"); var skew = core_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 25% {transform: perspective(100px) rotateX(180deg) rotateY(0)}\n 50% {transform: perspective(100px) rotateX(180deg) rotateY(180deg)}\n 75% {transform: perspective(100px) rotateX(0) rotateY(180deg)}\n 100% {transform: perspective(100px) rotateX(0) rotateY(0)}\n"], ["\n 25% {transform: perspective(100px) rotateX(180deg) rotateY(0)}\n 50% {transform: perspective(100px) rotateX(180deg) rotateY(180deg)}\n 75% {transform: perspective(100px) rotateX(0) rotateY(180deg)}\n 100% {transform: perspective(100px) rotateX(0) rotateY(0)}\n"]))); var Loader = /** @class */ (function (_super) { __extends(Loader, _super); function Loader() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.getSize = function () { return _this.props.size || Loader.defaultProps.size; }; _this.style = function () { var color = _this.props.color; return core_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 0;\n height: 0;\n border-left: ", " solid transparent;\n border-right: ", " solid transparent;\n border-bottom: ", " solid ", ";\n display: inline-block;\n animation: ", " 3s 0s infinite cubic-bezier(0.09, 0.57, 0.49, 0.9);\n animation-fill-mode: both;\n "], ["\n width: 0;\n height: 0;\n border-left: ", " solid transparent;\n border-right: ", " solid transparent;\n border-bottom: ", " solid ", ";\n display: inline-block;\n animation: ", " 3s 0s infinite cubic-bezier(0.09, 0.57, 0.49, 0.9);\n animation-fill-mode: both;\n "])), helpers_1.cssValue(_this.getSize()), helpers_1.cssValue(_this.getSize()), helpers_1.cssValue(_this.getSize()), color, skew); }; return _this; } Loader.prototype.render = function () { var _a = this.props, loading = _a.loading, css = _a.css; return loading ? core_1.jsx("span", { css: [this.style(), css] }) : null; }; Loader.defaultProps = helpers_1.sizeDefaults(20); return Loader; }(React.PureComponent)); exports.default = Loader; var templateObject_1, templateObject_2;