"use strict";const t=require("classnames"),a=require("react"),T=require("react-feather");const i=({loadingText:e,className:r})=>a.createElement("div",{className:t("inlineLoader",r)},a.createElement("div",{className:"iconContainer"},a.createElement(T.Loader,{size:"1em",className:"icon"})),e&&a.createElement("div",{className:"loaderText ml-2"},e));const c={inline:"inline",blue:"blue"},d=e=>a.createElement("div",{className:t(e.className,"spinner")},a.createElement("svg",{height:"100%",width:"100%"},a.createElement("circle",{stroke:"white",fill:"transparent",strokeWidth:"4",strokeDasharray:"calc(2 * 22 / 7 * (50% - 2px)/ 6)",style:{strokeDashoffset:0},r:"calc(50% - 2px)",cx:"50%",cy:"50%"})));var o=(e=>(e.FLAT="flat",e.OUTLINED="outlined",e.TEXT="text",e.PLAIN="plain",e))(o||{}),m=(e=>(e.EXTRA_SMALL="extraSmall",e.SMALL="small",e.MEDIUM="medium",e.LARGE="large",e.EXTRA_LARGE="extraLarge",e))(m||{}),u=(e=>(e.PRIMARY="primary",e.SECONDARY="secondary",e.PRIMARY_WHITE="primaryWhite",e.WHITE="white",e.DARK="dark",e.TEXT="text",e.NONE="",e))(u||{});const v=(e,r,n)=>`${e} ${n??""} ${r}`,f=e=>{switch(e){case"INLINE":return a.createElement(i,null);case"SPINNER":return a.createElement(d,{className:t(c.inline,"mr-3")});default:return a.createElement(i,null)}},g=e=>{const{children:r,isFullWidth:n,hasOutline:E=!0,buttonType:N="flat",buttonFontSize:L,buttonStyle:h="primary",className:I,isLoading:s,loadingIndicator:p,disabled:b,dataQa:A,...R}=e,l=b||s;return a.createElement("button",{className:t("button",I,v(N,h,L),{hasOutline:E,fullWidth:n,disabled:l}),"data-qa-id":A,disabled:l,...R},s&&f(p),r)};exports.Button=g;exports.ButtonFontSize=m;exports.ButtonStyle=u;exports.ButtonType=o;exports.Spinner=d;exports.SpinnerStyle=c;
