@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
66 lines (65 loc) • 2.81 kB
JavaScript
import { jsx as L, jsxs as $ } from "react/jsx-runtime";
import { c as q } from "react/compiler-runtime";
import { useListItem as z, useMergeRefs as E } from "@floating-ui/react";
import { forwardRef as F } from "react";
import { twMerge as G } from "tailwind-merge";
import { mergeDeep as H } from "../../helpers/merge-deep.mjs";
import { ButtonBase as J } from "../Button/ButtonBase.mjs";
import { useDropdownContext as K } from "./DropdownContext.mjs";
const Q = F((D, b) => {
const e = q(49);
let o, t, m, i, r, s;
e[0] !== D ? ({
children: t,
className: m,
icon: o,
onClick: i,
theme: s,
...r
} = D, e[0] = D, e[1] = o, e[2] = t, e[3] = m, e[4] = i, e[5] = r, e[6] = s) : (o = e[1], t = e[2], m = e[3], i = e[4], r = e[5], s = e[6]);
let x;
e[7] !== s ? (x = s === void 0 ? {} : s, e[7] = s, e[8] = x) : x = e[8];
const k = x, w = typeof t == "string" ? t : void 0;
let N;
e[9] !== w ? (N = {
label: w
}, e[9] = w, e[10] = N) : N = e[10];
const {
ref: T,
index: O
} = z(N);
let v;
e[11] !== b || e[12] !== T ? (v = [b, T], e[11] = b, e[12] = T, e[13] = v) : v = e[13];
const j = E(v), {
theme: y,
activeIndex: R,
dismissOnClick: B,
getItemProps: M,
handleSelect: P
} = K(), S = R === O;
let n, c, f, a, p, d, l;
e[14] !== m || e[15] !== k || e[16] !== r || e[17] !== j || e[18] !== y.floating.item ? (l = H(y.floating.item, k), d = r, a = "menuitem", p = l.container, n = J, c = j, f = G(l.base, m), e[14] = m, e[15] = k, e[16] = r, e[17] = j, e[18] = y.floating.item, e[19] = n, e[20] = c, e[21] = f, e[22] = a, e[23] = p, e[24] = d, e[25] = l) : (n = e[19], c = e[20], f = e[21], a = e[22], p = e[23], d = e[24], l = e[25]);
let h;
e[26] !== B || e[27] !== P || e[28] !== i ? (h = () => {
i && i(), B && P(null);
}, e[26] = B, e[27] = P, e[28] = i, e[29] = h) : h = e[29];
let g;
e[30] !== M || e[31] !== h ? (g = M({
onClick: h
}), e[30] = M, e[31] = h, e[32] = g) : g = e[32];
const A = S ? 0 : -1;
let u;
e[33] !== o || e[34] !== l ? (u = o && /* @__PURE__ */ L(o, { className: l.icon }), e[33] = o, e[34] = l, e[35] = u) : u = e[35];
let I;
e[36] !== n || e[37] !== t || e[38] !== g || e[39] !== A || e[40] !== u || e[41] !== c || e[42] !== f || e[43] !== d ? (I = /* @__PURE__ */ $(n, { ref: c, className: f, ...d, ...g, tabIndex: A, children: [
u,
t
] }), e[36] = n, e[37] = t, e[38] = g, e[39] = A, e[40] = u, e[41] = c, e[42] = f, e[43] = d, e[44] = I) : I = e[44];
let C;
return e[45] !== I || e[46] !== a || e[47] !== p ? (C = /* @__PURE__ */ L("li", { role: a, className: p, children: I }), e[45] = I, e[46] = a, e[47] = p, e[48] = C) : C = e[48], C;
});
Q.displayName = "DropdownItem";
export {
Q as DropdownItem
};
//# sourceMappingURL=DropdownItem.mjs.map