"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../_virtual/jsx-runtime.js"),q=require("react"),p=require("./styles.js"),R=require("../Spinner/index.js"),u=require("./utils.js"),b=require("../../icons/Placeholder.js"),m=require("../../hooks/useHasFocus.js");function S({variant:t="primary",icon:i=r.jsxRuntimeExports.jsx(b.default,{}),size:a="large",className:o,disabled:l=!1,isLoading:n=!1,type:c="button",onClick:d,...e}){const x=u.getSpinnerSize(a)||"L",f=u.getSpinnerType(t)||"brand",s=q.useRef(null),{hasFocus:j,setHasFocus:v}=m.useHasFocus(s);return r.jsxRuntimeExports.jsx(p.IconButtonContainer,{hasFocus:j,ref:s,variant:t,size:a,className:o,isLoading:n,disabled:l,type:c,onClick:d,"data-testid":e["data-testid"],"data-trackid":e["data-trackid"],"aria-label":e["aria-label"],onBlur:()=>v(!1),children:n?r.jsxRuntimeExports.jsx(R.Spinner,{variant:f,size:x}):i})}exports.IconButton=S;
