import * as React from "react";
import y from "../../../../../../../../../../_virtual/index12.js";
import { baseButtonPropDefs as i } from "./base-button.props.js";
import { Flex as p } from "../flex.js";
import { Spinner as s } from "../spinner.js";
import { VisuallyHidden as d } from "../visually-hidden.js";
import { extractProps as v } from "../../helpers/extract-props.js";
import { mapResponsiveProp as s$1, mapButtonSizeToSpinnerSize as r$1 } from "../../helpers/map-prop-values.js";
import { marginPropDefs as r } from "../../props/margin.props.js";
import { Root as Slot } from "../../../../../../../../@radix-ui_react-slot@1.2.3_@types_react@19.1.13_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.js";
const n = React.forwardRef((t, p$1) => {
  const { size: i$1 = i.size.default } = t, { className: a, children: e, asChild: m, color: d$1, radius: l, disabled: s$2 = t.loading, ...u } = v(t, i, r), f = m ? Slot : "button";
  return React.createElement(f, { "data-disabled": s$2 || void 0, "data-accent-color": d$1, "data-radius": l, ...u, ref: p$1, className: y("rt-reset", "rt-BaseButton", a), disabled: s$2 }, t.loading ? React.createElement(React.Fragment, null, React.createElement("span", { style: { display: "contents", visibility: "hidden" }, "aria-hidden": true }, e), React.createElement(d, null, e), React.createElement(p, { asChild: true, align: "center", justify: "center", position: "absolute", inset: "0" }, React.createElement("span", null, React.createElement(s, { size: s$1(i$1, r$1) })))) : e);
});
n.displayName = "BaseButton";
export {
  n as BaseButton
};
//# sourceMappingURL=base-button.js.map
