@anoki/fse-ui
Version:
FSE UI components library
20 lines (19 loc) • 1.37 kB
JavaScript
import * as e from "react";
import u from "./index.es541.js";
import { baseButtonPropDefs as s } from "./index.es570.js";
import { Flex as f } from "./index.es543.js";
import { Spinner as B } from "./index.es560.js";
import { VisuallyHidden as b } from "./index.es565.js";
import { extractProps as y } from "./index.es544.js";
import { mapResponsiveProp as E, mapButtonSizeToSpinnerSize as g } from "./index.es571.js";
import { marginPropDefs as h } from "./index.es546.js";
import { Root as z } from "./index.es481.js";
const S = e.forwardRef((t, o) => {
const { size: i = s.size.default } = t, { className: n, children: a, asChild: l, color: m, radius: d, disabled: r = t.loading, ...p } = y(t, s, h), c = l ? z : "button";
return e.createElement(c, { "data-disabled": r || void 0, "data-accent-color": m, "data-radius": d, ...p, ref: o, className: u("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);
});
S.displayName = "BaseButton";
export {
S as BaseButton
};
//# sourceMappingURL=index.es542.js.map