@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
64 lines (63 loc) • 2.45 kB
JavaScript
import { jsx as I } from "react/jsx-runtime";
import { c as E } from "react/compiler-runtime";
import { useState as H, Children as M, cloneElement as S } from "react";
import { HiChevronDown as $ } from "react-icons/hi";
import { twMerge as k } from "tailwind-merge";
import { mergeDeep as q } from "../../helpers/merge-deep.mjs";
import { getTheme as z } from "../../theme-store/index.mjs";
import { AccordionContent as T } from "./AccordionContent.mjs";
import { AccordionPanel as g } from "./AccordionPanel.mjs";
import { AccordionTitle as b } from "./AccordionTitle.mjs";
const P = (O) => {
const e = E(30);
let n, s, i, a, m, p, d, t;
e[0] !== O ? ({
alwaysOpen: a,
arrowIcon: m,
children: n,
flush: p,
collapseAll: d,
className: s,
theme: t,
...i
} = O, e[0] = O, e[1] = n, e[2] = s, e[3] = i, e[4] = a, e[5] = m, e[6] = p, e[7] = d, e[8] = t) : (n = e[1], s = e[2], i = e[3], a = e[4], m = e[5], p = e[6], d = e[7], t = e[8]);
const f = a === void 0 ? !1 : a, h = m === void 0 ? $ : m, o = p === void 0 ? !1 : p, j = d === void 0 ? !1 : d;
let A;
e[9] !== t ? (A = t === void 0 ? {} : t, e[9] = t, e[10] = A) : A = e[10];
const u = A, [r, x] = H(j ? -1 : 0);
let N, v;
if (e[11] !== f || e[12] !== h || e[13] !== n || e[14] !== o || e[15] !== r) {
let l;
e[17] !== f || e[18] !== h || e[19] !== o || e[20] !== r ? (l = (D, C) => S(D, {
alwaysOpen: f,
arrowIcon: h,
flush: o,
isOpen: r === C,
setOpen: () => x(r === C ? -1 : C)
}), e[17] = f, e[18] = h, e[19] = o, e[20] = r, e[21] = l) : l = e[21], v = M.map(n, l), e[11] = f, e[12] = h, e[13] = n, e[14] = o, e[15] = r, e[16] = v;
} else
v = e[16];
N = v;
const y = N;
let c;
if (e[22] !== s || e[23] !== u || e[24] !== o) {
const l = q(z().accordion.root, u);
c = k(l.base, l.flush[o ? "on" : "off"], s), e[22] = s, e[23] = u, e[24] = o, e[25] = c;
} else
c = e[25];
let w;
return e[26] !== y || e[27] !== i || e[28] !== c ? (w = /* @__PURE__ */ I("div", { className: c, "data-testid": "flowbite-accordion", ...i, children: y }), e[26] = y, e[27] = i, e[28] = c, e[29] = w) : w = e[29], w;
};
P.displayName = "Accordion";
g.displayName = "Accordion.Panel";
b.displayName = "Accordion.Title";
T.displayName = "Accordion.Content";
const W = Object.assign(P, {
Panel: g,
Title: b,
Content: T
});
export {
W as Accordion
};
//# sourceMappingURL=Accordion.mjs.map