@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
63 lines (62 loc) • 3.89 kB
JavaScript
import { jsx as I, jsxs as U, Fragment as V } from "react/jsx-runtime";
import { c as W } from "react/compiler-runtime";
import { forwardRef as X } from "react";
import { twMerge as $ } from "tailwind-merge";
import { mergeDeep as Y } from "../../helpers/merge-deep.mjs";
import { getTheme as Z } from "../../theme-store/index.mjs";
import { ButtonBase as _ } from "./ButtonBase.mjs";
import { ButtonGroup as ee } from "./ButtonGroup.mjs";
import { Spinner as te } from "../Spinner/Spinner.mjs";
const H = X((k, q) => {
const e = W(59);
let i, r, l, c, o, n, a, p, d, S, L, j, w, x, D, y, s;
e[0] !== k ? ({
children: i,
className: r,
color: S,
disabled: l,
fullSized: c,
isProcessing: L,
processingLabel: j,
processingSpinner: p,
gradientDuoTone: o,
gradientMonochrome: n,
label: a,
outline: w,
pill: x,
positionInGroup: D,
size: y,
theme: s,
...d
} = k, e[0] = k, e[1] = i, e[2] = r, e[3] = l, e[4] = c, e[5] = o, e[6] = n, e[7] = a, e[8] = p, e[9] = d, e[10] = S, e[11] = L, e[12] = j, e[13] = w, e[14] = x, e[15] = D, e[16] = y, e[17] = s) : (i = e[1], r = e[2], l = e[3], c = e[4], o = e[5], n = e[6], a = e[7], p = e[8], d = e[9], S = e[10], L = e[11], j = e[12], w = e[13], x = e[14], D = e[15], y = e[16], s = e[17]);
const F = S === void 0 ? "info" : S, m = L === void 0 ? !1 : L, A = j === void 0 ? "Loading..." : j, f = w === void 0 ? !1 : w, M = x === void 0 ? !1 : x, C = D === void 0 ? "none" : D, u = y === void 0 ? "md" : y;
let O;
e[18] !== s ? (O = s === void 0 ? {} : s, e[18] = s, e[19] = O) : O = e[19];
const E = O;
let g, b, h, v, P, T, B, N;
if (e[20] !== i || e[21] !== r || e[22] !== F || e[23] !== E || e[24] !== l || e[25] !== c || e[26] !== o || e[27] !== n || e[28] !== m || e[29] !== a || e[30] !== f || e[31] !== M || e[32] !== C || e[33] !== A || e[34] !== p || e[35] !== d || e[36] !== q || e[37] !== u) {
const {
buttonGroup: J,
button: K
} = Z(), t = Y(K, E), Q = d;
g = _, P = q, T = l, B = $(t.base, l && t.disabled, !o && !n && t.color[F], o && !n && t.gradientDuoTone[o], !o && n && t.gradient[n], f && (t.outline.color[F] ?? t.outline.color.default), t.pill[M ? "on" : "off"], c && t.fullSized, J.position[C], r), N = Q, v = $(t.inner.base, t.outline[f ? "on" : "off"], t.outline.pill[f && M ? "on" : "off"], t.size[u], f && !t.outline.color[F] && t.inner.outline, m && t.isProcessing, m && t.inner.isProcessingPadding[u], t.inner.position[C]), b = m && /* @__PURE__ */ I("span", { className: $(t.spinnerSlot, t.spinnerLeftPosition[u]), children: p || /* @__PURE__ */ I(te, { size: u }) }), h = typeof i < "u" ? i : /* @__PURE__ */ I("span", { "data-testid": "flowbite-button-label", className: $(t.label), children: m ? A : a }), e[20] = i, e[21] = r, e[22] = F, e[23] = E, e[24] = l, e[25] = c, e[26] = o, e[27] = n, e[28] = m, e[29] = a, e[30] = f, e[31] = M, e[32] = C, e[33] = A, e[34] = p, e[35] = d, e[36] = q, e[37] = u, e[38] = g, e[39] = b, e[40] = h, e[41] = v, e[42] = P, e[43] = T, e[44] = B, e[45] = N;
} else
g = e[38], b = e[39], h = e[40], v = e[41], P = e[42], T = e[43], B = e[44], N = e[45];
let z;
e[46] !== b || e[47] !== h ? (z = /* @__PURE__ */ U(V, { children: [
b,
h
] }), e[46] = b, e[47] = h, e[48] = z) : z = e[48];
let G;
e[49] !== v || e[50] !== z ? (G = /* @__PURE__ */ I("span", { className: v, children: z }), e[49] = v, e[50] = z, e[51] = G) : G = e[51];
let R;
return e[52] !== g || e[53] !== P || e[54] !== T || e[55] !== B || e[56] !== N || e[57] !== G ? (R = /* @__PURE__ */ I(g, { ref: P, disabled: T, className: B, ...N, children: G }), e[52] = g, e[53] = P, e[54] = T, e[55] = B, e[56] = N, e[57] = G, e[58] = R) : R = e[58], R;
});
H.displayName = "Button";
const de = Object.assign(H, {
Group: ee
});
export {
de as Button
};
//# sourceMappingURL=Button.mjs.map