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