import{jsx as e}from"react/jsx-runtime";import{useDisplayState as c}from"../../hooks/useDisplayState.js";import{css as o}from"@styled/css";import{Center as h}from"@styled/jsx";const w={lg:{size:56,radius:28,strokeWidth:5,animation:"animateSpinnerLarge"},sm:{size:20,radius:10,strokeWidth:3,animation:"animateSpinnerSmall"}},f=({size:r="lg",isVisible:i=!0,onShown:s=()=>{},onHidden:a=()=>{}})=>{const{size:n,radius:m,strokeWidth:t,animation:d}=w[r],{onHide:l,onShow:p}=c({animate:!0,show:i,onHidden:a,onShown:s});return e(h,{inline:!0,animation:i?"popIn 150ms":"popOut 150ms",animationFillMode:"forwards",onAnimationEnd:i?p:l,children:e("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,fill:"none",stroke:"none",xmlns:"http://www.w3.org/2000/svg",className:o({animation:"spin 1.5s linear infinite"}),children:e("circle",{className:o({stroke:"text.primary",transformOrigin:"center center"}),style:{animation:`${d} 2s ease-in-out infinite`},cx:"50%",cy:"50%",r:m-t/2,strokeLinecap:"round",strokeWidth:t})})})};export{f as AnimatedSpinner};
//# sourceMappingURL=animated-spinner.js.map
