UNPKG

spinners-react

Version:

Lightweight SVG/CSS spinners for React

3 lines (2 loc) 2.63 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,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};function o(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}"function"==typeof SuppressedError&&SuppressedError;var n=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 o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===r&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("@keyframes spinners-react-circular-fixed{0%{stroke-dashoffset:325}to{stroke-dashoffset:151}}");var l=function(e){return function(n){var l=n.color,c=void 0===l?i.color:l,a=n.enabled,d=void 0===a?i.enabled:a,f=n.size,p=void 0===f?i.size:f,u=n.style,y=void 0===u?i.style:u,h=o(n,["color","enabled","size","style"]),v=r(r({},h),{style:r({color:c,overflow:"visible",width:s(p)},y)});return d?t.createElement(e,r({},v)):null}}((function(e){var i=e.secondaryColor,s=void 0===i?n.secondaryColor:i,l=e.speed,c=void 0===l?n.speed:l,a=e.still,d=void 0===a?n.still:a,f=e.thickness,p=void 0===f?n.thickness:f,u=o(e,["secondaryColor","speed","still","thickness"]),y=p/100*4,h=d?{}:{animation:"spinners-react-circular-fixed ".concat(140/c,"s linear infinite")};return t.createElement("svg",r({fill:"none"},u,{viewBox:"0 0 66 66"}),t.createElement("circle",{cx:"33",cy:"33",fill:"none",r:"28",stroke:s,strokeWidth:y}),t.createElement("circle",{cx:"33",cy:"33",fill:"none",r:"28",stroke:"currentColor",strokeDasharray:"40, 134",strokeDashoffset:"325",strokeLinecap:"round",strokeWidth:y,style:h}))}));e.SpinnerCircularFixed=l})); //# sourceMappingURL=SpinnerCircularFixed.min.js.map