@clubmed/trident-ui
Version:
Shared ClubMed React UI components
51 lines (50 loc) • 1.25 kB
JavaScript
"use client";
import { jsx as n } from "react/jsx-runtime";
import { c as l } from "../../chunks/clsx.js";
import { getButtonClasses as B } from "./Button.type.js";
import { ButtonContent as c } from "./ButtonContent.js";
function p({ component: t, disabled: r, ...a }) {
return t === "a" || "href" in a || typeof t == "object" ? {
attrs: {
"data-name": "ButtonAnchor",
"aria-disabled": r ? "true" : void 0,
...a
},
Cmp: "a"
} : t === "span" || t === "div" ? {
attrs: {
"data-name": "FakeButton",
"aria-disabled": r ? "true" : void 0,
...a
},
Cmp: "span"
} : {
attrs: {
"data-name": "Button",
type: "button",
disabled: r,
...a
},
Cmp: "button"
};
}
const C = ({
className: t,
children: r,
color: a = "saffron",
icon: e,
iconWidth: o,
size: u = "medium",
theme: i = "solid",
variant: s = "pill",
...m
}) => {
const { Cmp: f, attrs: d } = p(m);
return /* @__PURE__ */ n(f, { ...d, className: l(B({ color: a, size: u, theme: i, variant: s }), t), children: /* @__PURE__ */ n(c, { icon: e, iconWidth: o, children: r }) });
};
C.displayName = "Button";
export {
C as Button,
p as useButton
};
//# sourceMappingURL=Button.js.map