UNPKG

spinners-react

Version:

Lightweight SVG/CSS spinners for React

3 lines (2 loc) 3.16 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).SpinnersReact={},e.React)}(this,(function(e,t){"use strict";var r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function n(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}"function"==typeof SuppressedError&&SuppressedError;var o=r(r({},{speed:100,still:!1,thickness:100}),{secondaryColor:"rgba(0,0,0,0.44)"}),i={color:"#38ad48",enabled:!0,size:50,style:{}},s=function(e){return parseFloat(e.toString()).toString()===e.toString()?"".concat(e,"px"):e.toString()};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("@keyframes spinners-react-infinity{0%{stroke-dasharray:1,347;stroke-dashoffset:75}25%,75%{stroke-dasharray:17,330}50%{stroke-dasharray:1,347}to{stroke-dasharray:1,347;stroke-dashoffset:423}}");var a=function(e){return function(o){var a=o.color,l=void 0===a?i.color:a,c=o.enabled,d=void 0===c?i.enabled:c,f=o.size,p=void 0===f?i.size:f,y=o.style,u=void 0===y?i.style:y,h=n(o,["color","enabled","size","style"]),v=r(r({},h),{style:r({color:l,overflow:"visible",width:s(p)},u)});return d?t.createElement(e,r({},v)):null}}((function(e){var i=e.secondaryColor,s=void 0===i?o.secondaryColor:i,a=e.speed,l=void 0===a?o.speed:a,c=e.still,d=void 0===c?o.still:c,f=e.thickness,p=void 0===f?o.thickness:f,y=n(e,["secondaryColor","speed","still","thickness"]),u=p/100*7,h=d?{}:{animation:"spinners-react-infinity ".concat(140/l,"s linear infinite")};return t.createElement("svg",r({fill:"none",viewBox:"0 0 131 55"},y),t.createElement("defs",null,t.createElement("path",{d:"M46.57 45.5138C36.346 55.4954 19.8919 55.4954 9.66794 45.5138C-0.55598 35.5321 -0.55598 19.4678 9.66794 9.48624C19.8919 -0.495412 36.346 -0.495412 46.57 9.48624L84.4303 45.5138C94.6543 55.4954 111.108 55.4954 121.332 45.5138C131.556 35.5321 131.556 19.4678 121.332 9.48624C111.108 -0.495412 94.6543 -0.495412 84.4303 9.48624L46.57 45.5138Z",id:"spinners-react-infinity-path"})),t.createElement("use",{stroke:s,strokeWidth:u,xlinkHref:"#spinners-react-infinity-path"}),t.createElement("use",{fill:"none",stroke:"currentColor",strokeDasharray:"1, 347",strokeDashoffset:"75",strokeLinecap:"round",strokeWidth:u,style:h,xlinkHref:"#spinners-react-infinity-path"}))}));e.SpinnerInfinity=a})); //# sourceMappingURL=SpinnerInfinity.min.js.map