UNPKG

react-loader-spinner

Version:

react-spinner-loader provides simple React.js spinner component which can be implemented for async wait operation before data load to the view.

5 lines 1.46 kB
'use strict';var d=require('styled-components'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var p="#4fa94d",g={"aria-busy":true,role:"progressbar"};var b=d__default.default.div` display: ${r=>r.$visible?"flex":"none"}; `;var l=20,S=r=>["M"+r+" 0c0-9.94-8.06",r,r,r].join("-"),f=(r,s,e)=>{let o=Math.max(r,s),n=-e-o/2+1,i=e*2+o;return [n,n,i,i].join(" ")},P=({height:r=80,width:s=80,color:e=p,secondaryColor:o=p,ariaLabel:n="oval-loading",wrapperStyle:i,wrapperClass:c,visible:u=true,strokeWidth:a=2,strokeWidthSecondary:m,animationDuration:v=1})=>jsxRuntime.jsx(b,{style:i,$visible:u,className:c,"data-testid":"oval-loading","aria-label":n,...g,children:jsxRuntime.jsx("svg",{width:s,height:r,viewBox:f(Number(a),Number(m||a),l),xmlns:"http://www.w3.org/2000/svg",stroke:e,"data-testid":"oval-svg",children:jsxRuntime.jsx("g",{fill:"none",fillRule:"evenodd",children:jsxRuntime.jsxs("g",{transform:"translate(1 1)",strokeWidth:Number(m||a),"data-testid":"oval-secondary-group",children:[jsxRuntime.jsx("circle",{strokeOpacity:".5",cx:"0",cy:"0",r:l,stroke:o,strokeWidth:a}),jsxRuntime.jsx("path",{d:S(l),children:jsxRuntime.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 0 0",to:"360 0 0",dur:`${v}s`,repeatCount:"indefinite"})})]})})})}); exports.Oval=P;//# sourceMappingURL=oval.cjs.map //# sourceMappingURL=oval.cjs.map