'use strict';

var chunk4SZXQT5I_cjs = require('./chunk-4SZXQT5I.cjs');
var chunkUZHQMTYC_cjs = require('./chunk-UZHQMTYC.cjs');
var chunk5XB54L7P_cjs = require('./chunk-5XB54L7P.cjs');
var css = require('@onbeam/styled-system/css');
var icons = require('@onbeam/icons');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');

var b=chunk5XB54L7P_cjs.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=recipes.button({variant:y,size:p,isLoading:e}),n=p==="sm"?16:24,a=d||e;return jsxRuntime.jsxs(m,{ref:N,className:css.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&&jsxRuntime.jsx("div",{className:o.led,children:jsxRuntime.jsx(chunkUZHQMTYC_cjs.a,{size:16,children:P&&!d?jsxRuntime.jsx(icons.LedOnIcon,{}):jsxRuntime.jsx(icons.LedOffIcon,{})})}),r&&!e&&jsxRuntime.jsx("div",{className:o.iconLeft,children:jsxRuntime.jsx(chunkUZHQMTYC_cjs.a,{size:n,children:r})}),e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(chunk4SZXQT5I_cjs.a,{variant:"spinner",style:{height:`${n}px`,width:`${n}px`}}),jsxRuntime.jsx("span",{children:v||i})]}):i,c&&!e&&jsxRuntime.jsx("div",{className:o.iconRight,children:jsxRuntime.jsx(chunkUZHQMTYC_cjs.a,{size:n,children:c})})]})});b.displayName="Button";

exports.a = b;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-Y3NOL3WI.cjs.map