UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

83 lines (82 loc) 1.54 kB
import { j as s } from "./index.es137.js"; import { createColorClasses as d } from "./index.es145.js"; import { clsx as w } from "./index.es139.js"; import './components/ui/Button/Button.css';/* empty css */ import { Spinner as B } from "./index.es111.js"; const R = ({ children: e, variant: t, bg: m = "primary", textColor: p = "white", border: i = "white", size: c = "3", className: l, disabled: r, loading: o, onClick: b, type: f = "button", form: j = "", asLink: x, href: C, target: S = void 0, rel: y = void 0, ...n }) => { const N = t ? "" : d({ bg: m, text: p, border: i }), u = w( "ui-button", { 2: "fs-6 py-x12 px-x24", 3: "fs-7 py-x12 px-x24", 4: "fs-6 py-x4 px-x8" }[c], // Apply variant class if provided t && `ui-button-${t}`, // Otherwise use traditional classes !t && N, { "ui-button-disabled": r || o }, { "ui-button-loading": o }, l, "fw-bold" ); if (x) { const a = x; return /* @__PURE__ */ s.jsx( a, { target: S, rel: y, href: C, className: u, ...n, children: e } ); } return /* @__PURE__ */ s.jsxs( "button", { type: f, form: j, className: u, onClick: b, disabled: r || o, ...n, children: [ e, o ? /* @__PURE__ */ s.jsx(B, {}) : null ] } ); }; export { R as Button }; //# sourceMappingURL=index.es25.js.map