import * as e from "react";
import c from "../../../../../../../../../_virtual/index9.js";
import { Slot as u } from "../../../../../../../@radix-ui_react-slot@1.1.0_@types_react@18.3.3_react@18.3.0-canary-3d9b20132-20240124/node_modules/@radix-ui/react-slot/dist/index.js";
import { baseButtonPropDefs as o } from "./base-button.props.js";
import { Flex as f } from "./flex.js";
import { Spinner as B } from "./spinner.js";
import { VisuallyHidden as b } from "../../../../../../../@radix-ui_react-visually-hidden@1.1.0_@types_react-dom@18.3.6_@types_react@18.3.3__@typ_ed6b83029f4b3a260b4f0503b9e9f52c/node_modules/@radix-ui/react-visually-hidden/dist/index.js";
import { extractProps as y } from "../helpers/extract-props.js";
import { mapResponsiveProp as E, mapButtonSizeToSpinnerSize as g } from "../helpers/map-prop-values.js";
import { marginPropDefs as h } from "../props/margin.props.js";
const z = e.forwardRef((t, s) => {
  const { size: i = o.size.default } = t, { className: n, children: a, asChild: l, color: m, radius: d, disabled: r = t.loading, ...p } = y(t, o, h);
  return e.createElement(l ? u : "button", { "data-disabled": r || void 0, "data-accent-color": m, "data-radius": d, ...p, ref: s, className: c("rt-reset", "rt-BaseButton", n), disabled: r }, t.loading ? e.createElement(e.Fragment, null, e.createElement("span", { style: { display: "contents", visibility: "hidden" }, "aria-hidden": !0 }, a), e.createElement(b, null, a), e.createElement(f, { asChild: !0, align: "center", justify: "center", position: "absolute", inset: "0" }, e.createElement("span", null, e.createElement(B, { size: E(i, g) })))) : a);
});
z.displayName = "BaseButton";
export {
  z as BaseButton
};
//# sourceMappingURL=base-button.js.map
