@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
69 lines (68 loc) • 2.43 kB
JavaScript
import { jsx as C } from "react/jsx-runtime";
import { c as w } from "react/compiler-runtime";
import { useState as N } from "react";
import { twMerge as I } from "tailwind-merge";
import { mergeDeep as R } from "../../helpers/merge-deep.mjs";
import { getTheme as k } from "../../theme-store/index.mjs";
import { ToastContext as D } from "./ToastContext.mjs";
import { ToastToggle as _ } from "./ToastToggle.mjs";
const M = {
75: "duration-75",
100: "duration-100",
150: "duration-150",
200: "duration-200",
300: "duration-300",
500: "duration-500",
700: "duration-700",
1e3: "duration-1000"
}, x = (b) => {
const t = w(29);
let o, r, s, c, e;
t[0] !== b ? ({
children: o,
className: r,
duration: c,
theme: e,
...s
} = b, t[0] = b, t[1] = o, t[2] = r, t[3] = s, t[4] = c, t[5] = e) : (o = t[1], r = t[2], s = t[3], c = t[4], e = t[5]);
const u = c === void 0 ? 300 : c;
let p;
t[6] !== e ? (p = e === void 0 ? {} : e, t[6] = e, t[7] = p) : p = t[7];
const h = p, [T, S] = N(!1), [g, j] = N(!1);
let l, a, i, n, m, d;
if (t[8] !== r || t[9] !== h || t[10] !== u || t[11] !== T || t[12] !== g) {
d = Symbol.for("react.early_return_sentinel");
t: {
const y = R(k().toast, h);
if (g) {
d = null;
break t;
}
l = D.Provider, m = {
theme: y,
duration: u,
isClosed: T,
isRemoved: g,
setIsClosed: S,
setIsRemoved: j
}, a = "flowbite-toast", i = "alert", n = I(y.root.base, M[u], T && y.root.closed, r);
}
t[8] = r, t[9] = h, t[10] = u, t[11] = T, t[12] = g, t[13] = l, t[14] = a, t[15] = i, t[16] = n, t[17] = m, t[18] = d;
} else
l = t[13], a = t[14], i = t[15], n = t[16], m = t[17], d = t[18];
if (d !== Symbol.for("react.early_return_sentinel"))
return d;
let f;
t[19] !== o || t[20] !== s || t[21] !== a || t[22] !== i || t[23] !== n ? (f = /* @__PURE__ */ C("div", { "data-testid": a, role: i, className: n, ...s, children: o }), t[19] = o, t[20] = s, t[21] = a, t[22] = i, t[23] = n, t[24] = f) : f = t[24];
let v;
return t[25] !== l || t[26] !== m || t[27] !== f ? (v = /* @__PURE__ */ C(l, { value: m, children: f }), t[25] = l, t[26] = m, t[27] = f, t[28] = v) : v = t[28], v;
};
x.displayName = "Toast";
_.displayName = "Toast.Toggle";
const F = Object.assign(x, {
Toggle: _
});
export {
F as Toast
};
//# sourceMappingURL=Toast.mjs.map