import r,{forwardRef as e,useMemo as t}from"react";import a from"classnames";import{LoaderSizes as o,LoaderColors as s}from"./LoaderConstants.js";import i from"./Loader.module.scss.js";import{withStaticProps as c}from"../../../../shared/dist/types/withStaticProps.js";import{getTestId as n}from"../../../../shared/dist/tests/test-ids-utils.js";import{ComponentDefaultTestId as l}from"../../../../shared/dist/tests/constants.js";var d={xs:16,small:24,medium:40,large:64},m={primary:"primary-color",secondary:"secondary-text-color",onPrimary:"text-color-on-inverted",dark:"primary-text-color"},p=c(e((function(e,o){var s=e.className,c=e.wrapperClassName,p=e.size,f=e.color,u=e.hasBackground,h=void 0!==u&&u,y=e.id,v=e["data-testid"],x=t((function(){var r="string"==typeof p?d[p]:p;if("number"==typeof r)return{width:r,height:r}}),[p]),L=t((function(){if(m[f])return"var(--".concat(m[f],")")}),[f]);return r.createElement("div",{className:a(i.loaderContainer,c),ref:o,role:"alert",title:"loading",style:x,id:y,"data-testid":v||n(l.LOADER,y)},r.createElement("svg",{className:a(i.circleLoaderSpinner,s),viewBox:"0 0 50 50",color:L,"aria-hidden":!0},h&&r.createElement("circle",{className:i.circleLoaderSpinnerBackground,cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"5"}),r.createElement("circle",{className:i.circleLoaderSpinnerPath,cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"5"})))})),{sizes:o,colors:s});export{p as default};
//# sourceMappingURL=Loader.js.map
