UNPKG

react-loading-icons

Version:

React implementation of the SVG Loaders library by Sam Herbert

33 lines (32 loc) 2.4 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; import React from 'react'; export default function TailSpin(props) { var _a, _b, _c, _d, _e; var speed = Number(String((_a = props.speed) !== null && _a !== void 0 ? _a : 1)); var stroke = (_b = props.stroke) !== null && _b !== void 0 ? _b : '#fff'; var strokeWidth = (_c = props.strokeWidth) !== null && _c !== void 0 ? _c : 2; var strokeOpacity = props.strokeOpacity; return (React.createElement("svg", __assign({}, __assign(__assign({}, props), { className: props.className ? "icon-loading ".concat(props.className) : 'icon-loading', fill: undefined, fillOpacity: undefined, height: (_d = props.height) !== null && _d !== void 0 ? _d : 38, speed: undefined, stroke: undefined, strokeOpacity: undefined, strokeWidth: undefined, width: (_e = props.width) !== null && _e !== void 0 ? _e : 38 }), { viewBox: "0 0 38 38" }), React.createElement("defs", null, React.createElement("linearGradient", { x1: "8.042%", y1: "0%", x2: "65.682%", y2: "23.865%", id: "prefix__a" }, React.createElement("stop", { stopOpacity: 0, offset: "0%" }), React.createElement("stop", { stopOpacity: 0.631, offset: "63.146%" }), React.createElement("stop", { offset: "100%" }))), React.createElement("g", { transform: "translate(1 1)", fill: "none", fillRule: "evenodd" }, React.createElement("path", __assign({ d: "M36 18c0-9.94-8.06-18-18-18" }, { stroke: stroke, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }), React.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "".concat(0.9 / speed, "s"), repeatCount: "indefinite" })), React.createElement("circle", { cx: 36, cy: 18, r: 1 }, React.createElement("animateTransform", { attributeName: "transform", type: "rotate", from: "0 18 18", to: "360 18 18", dur: "".concat(0.9 / speed, "s"), repeatCount: "indefinite" }))))); }