"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/jsx-runtime.js"),j=require("react"),R=require("../../utils/index.js"),f=require("./utils.js"),r=require("./styles.js"),m=require("../Spinner/index.js");function p(t){return t&&t.__esModule?t:{default:t}}var v=p(j);const E=v.default.forwardRef(({variant:t="primary",size:x="large",children:a,type:d="button",disabled:l=!1,isLoading:i=!1,fullWidth:o=!1,iconPosition:s="leading",...n},c)=>{const u=R.getId(n["data-testid"]);return e.jsxRuntimeExports.jsx(r.StyledButton,{...n,variant:t,size:x,ref:c,disabled:l,isLoading:i,type:d,fullWidth:o,"data-status":i?"loading":null,children:i?e.jsxRuntimeExports.jsx(r.SpinnerWrapper,{children:e.jsxRuntimeExports.jsx(m.Spinner,{"data-testid":u("spinner"),variant:f.getSpinnerVariant(t),size:"S"})}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[s==="leading"&&n.icon&&e.jsxRuntimeExports.jsx(r.IconContainer,{children:n.icon}),a&&e.jsxRuntimeExports.jsx(r.ContentWrapper,{"data-testid":u("content"),children:a}),s==="trailing"&&n.icon&&e.jsxRuntimeExports.jsx(r.IconContainer,{children:n.icon})]})})});exports.Button=E;
