@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
44 lines (43 loc) • 1.79 kB
JavaScript
import { jsxs as N, jsx as g } from "react/jsx-runtime";
import { c as A } from "react/compiler-runtime";
import { twMerge as x } from "tailwind-merge";
import { mergeDeep as T } from "../../helpers/merge-deep.mjs";
import { getTheme as j } from "../../theme-store/index.mjs";
import { useAccordionContext as v } from "./AccordionPanelContext.mjs";
const H = (p) => {
const e = A(20);
let t, r, n, i, o;
e[0] !== p ? ({
as: i,
children: t,
className: r,
theme: o,
...n
} = p, e[0] = p, e[1] = t, e[2] = r, e[3] = n, e[4] = i, e[5] = o) : (t = e[1], r = e[2], n = e[3], i = e[4], o = e[5]);
const h = i === void 0 ? "h2" : i;
let c;
e[6] !== o ? (c = o === void 0 ? {} : o, e[6] = o, e[7] = c) : c = e[7];
const u = c, {
arrowIcon: a,
flush: w,
isOpen: l,
setOpen: f
} = v();
let m;
e[8] !== f ? (m = () => typeof f < "u" && f(), e[8] = f, e[9] = m) : m = e[9];
const b = m;
let d;
if (e[10] !== a || e[11] !== h || e[12] !== t || e[13] !== r || e[14] !== u || e[15] !== w || e[16] !== l || e[17] !== b || e[18] !== n) {
const s = T(j().accordion.title, u);
d = /* @__PURE__ */ N("button", { className: x(s.base, s.flush[w ? "on" : "off"], s.open[l ? "on" : "off"], r), onClick: b, type: "button", ...n, children: [
/* @__PURE__ */ g(h, { className: s.heading, "data-testid": "flowbite-accordion-heading", children: t }),
a && /* @__PURE__ */ g(a, { "aria-hidden": !0, className: x(s.arrow.base, s.arrow.open[l ? "on" : "off"]), "data-testid": "flowbite-accordion-arrow" })
] }), e[10] = a, e[11] = h, e[12] = t, e[13] = r, e[14] = u, e[15] = w, e[16] = l, e[17] = b, e[18] = n, e[19] = d;
} else
d = e[19];
return d;
};
export {
H as AccordionTitle
};
//# sourceMappingURL=AccordionTitle.mjs.map