UNPKG

@transkripid/flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork

65 lines (64 loc) 4.04 kB
import { jsx as a, jsxs as E } from "react/jsx-runtime"; import { c as J } from "react/compiler-runtime"; import { twMerge as l } from "tailwind-merge"; import { mergeDeep as K } from "../../helpers/merge-deep.mjs"; import { getTheme as L } from "../../theme-store/index.mjs"; import { AvatarGroup as Q } from "./AvatarGroup.mjs"; import { AvatarGroupCounter as S } from "./AvatarGroupCounter.mjs"; const F = (D) => { const t = J(48); let s, d, o, c, r, w, N, x, z, A, C, k, P, i; t[0] !== D ? ({ alt: w, bordered: N, children: s, className: d, color: x, img: o, placeholderInitials: z, rounded: A, size: C, stacked: k, status: r, statusPosition: P, theme: i, ...c } = D, t[0] = D, t[1] = s, t[2] = d, t[3] = o, t[4] = c, t[5] = r, t[6] = w, t[7] = N, t[8] = x, t[9] = z, t[10] = A, t[11] = C, t[12] = k, t[13] = P, t[14] = i) : (s = t[1], d = t[2], o = t[3], c = t[4], r = t[5], w = t[6], N = t[7], x = t[8], z = t[9], A = t[10], C = t[11], k = t[12], P = t[13], i = t[14]); const j = w === void 0 ? "" : w, n = N === void 0 ? !1 : N, G = x === void 0 ? "light" : x, y = z === void 0 ? "" : z, I = A === void 0 ? !1 : A, M = C === void 0 ? "md" : C, R = k === void 0 ? !1 : k, H = P === void 0 ? "top-left" : P; let T; t[15] !== i ? (T = i === void 0 ? {} : i, t[15] = i, t[16] = T) : T = t[16]; const O = T; let m, v, f, p, g, u; if (t[17] !== j || t[18] !== n || t[19] !== d || t[20] !== G || t[21] !== O || t[22] !== o || t[23] !== y || t[24] !== c || t[25] !== I || t[26] !== M || t[27] !== R || t[28] !== r || t[29] !== H) { const e = K(L().avatar, O), $ = l(e.root.img.base, n && e.root.bordered, n && e.root.color[G], I && e.root.rounded, R && e.root.stacked, e.root.img.on, e.root.size[M]), q = { className: l($, e.root.img.on), "data-testid": "flowbite-avatar-img" }; p = l(e.root.base, d), g = "flowbite-avatar", u = c, m = "relative", v = o ? typeof o == "string" ? /* @__PURE__ */ a("img", { alt: j, src: o, ...q }) : o({ alt: j, ...q }) : y ? /* @__PURE__ */ a("div", { className: l(e.root.img.off, e.root.initials.base, R && e.root.stacked, n && e.root.bordered, n && e.root.color[G], e.root.size[M], I && e.root.rounded), "data-testid": "flowbite-avatar-initials-placeholder", children: /* @__PURE__ */ a("span", { className: l(e.root.initials.text), "data-testid": "flowbite-avatar-initials-placeholder-text", children: y }) }) : /* @__PURE__ */ a("div", { className: l($, e.root.img.off), "data-testid": "flowbite-avatar-img", children: /* @__PURE__ */ a("svg", { className: e.root.img.placeholder, fill: "currentColor", viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ a("path", { fillRule: "evenodd", d: "M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z", clipRule: "evenodd" }) }) }), f = r && /* @__PURE__ */ a("span", { "data-testid": "flowbite-avatar-status", className: l(e.root.status.base, e.root.status[r], e.root.statusPosition[H]) }), t[17] = j, t[18] = n, t[19] = d, t[20] = G, t[21] = O, t[22] = o, t[23] = y, t[24] = c, t[25] = I, t[26] = M, t[27] = R, t[28] = r, t[29] = H, t[30] = m, t[31] = v, t[32] = f, t[33] = p, t[34] = g, t[35] = u; } else m = t[30], v = t[31], f = t[32], p = t[33], g = t[34], u = t[35]; let h; t[36] !== m || t[37] !== v || t[38] !== f ? (h = /* @__PURE__ */ E("div", { className: m, children: [ v, f ] }), t[36] = m, t[37] = v, t[38] = f, t[39] = h) : h = t[39]; let b; t[40] !== s ? (b = s && /* @__PURE__ */ a("div", { children: s }), t[40] = s, t[41] = b) : b = t[41]; let B; return t[42] !== p || t[43] !== g || t[44] !== u || t[45] !== h || t[46] !== b ? (B = /* @__PURE__ */ E("div", { className: p, "data-testid": g, ...u, children: [ h, b ] }), t[42] = p, t[43] = g, t[44] = u, t[45] = h, t[46] = b, t[47] = B) : B = t[47], B; }; F.displayName = "Avatar"; const tt = Object.assign(F, { Group: Q, Counter: S }); export { tt as Avatar }; //# sourceMappingURL=Avatar.mjs.map