import { a as a$2 } from './chunk-YT7VOOFF.js';
import { a as a$1 } from './chunk-BZFPT54B.js';
import { a } from './chunk-TWGPE4V7.js';
import { cx } from '@onbeam/styled-system/css';
import { LedOnIcon, LedOffIcon } from '@onbeam/icons';
import { button } from '@onbeam/styled-system/recipes';
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';

var b=a(({as:m="button",children:i,variant:y="primary",size:p="md",className:B,iconLeft:r,iconRight:c,isLoading:e=!1,loadingMessage:v,hasLed:f=!1,ledOn:P=!1,disabled:d=!1,...x},N)=>{let h=(f?"led":void 0)||(r?"left":void 0)||(c?"right":void 0),o=button({variant:y,size:p,isLoading:e}),n=p==="sm"?16:24,a=d||e;return jsxs(m,{ref:N,className:cx(o.root,B),disabled:a,"aria-disabled":a,tabIndex:a?-1:void 0,"data-icon":h,...m==="button"&&{type:"button"},...x,children:[f&&!e&&jsx("div",{className:o.led,children:jsx(a$1,{size:16,children:P&&!d?jsx(LedOnIcon,{}):jsx(LedOffIcon,{})})}),r&&!e&&jsx("div",{className:o.iconLeft,children:jsx(a$1,{size:n,children:r})}),e?jsxs(Fragment,{children:[jsx(a$2,{variant:"spinner",style:{height:`${n}px`,width:`${n}px`}}),jsx("span",{children:v||i})]}):i,c&&!e&&jsx("div",{className:o.iconRight,children:jsx(a$1,{size:n,children:c})})]})});b.displayName="Button";

export { b as a };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-UPX6JFOI.js.map