UNPKG

@transkripid/flowbite-react

Version:

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

60 lines (59 loc) 3.23 kB
import { jsx as d, jsxs as M, Fragment as $ } from "react/jsx-runtime"; import { c as k } from "react/compiler-runtime"; import { forwardRef as q } from "react"; import { twMerge as S } from "tailwind-merge"; import { mergeDeep as B } from "../../helpers/merge-deep.mjs"; import { getTheme as C } from "../../theme-store/index.mjs"; import { HelperText as E } from "../HelperText/HelperText.mjs"; const G = q((j, A) => { const e = k(48); let i, l, o, c, s, r, a, T, b, n, y; e[0] !== j ? ({ addon: o, className: c, color: T, helperText: s, icon: i, rightIcon: l, shadow: a, sizing: b, theme: n, type: y, ...r } = j, e[0] = j, e[1] = i, e[2] = l, e[3] = o, e[4] = c, e[5] = s, e[6] = r, e[7] = a, e[8] = T, e[9] = b, e[10] = n, e[11] = y) : (i = e[1], l = e[2], o = e[3], c = e[4], s = e[5], r = e[6], a = e[7], T = e[8], b = e[9], n = e[10], y = e[11]); const f = T === void 0 ? "gray" : T, D = b === void 0 ? "md" : b; let z; e[12] !== n ? (z = n === void 0 ? {} : n, e[12] = n, e[13] = z) : z = e[13]; const F = z, H = y === void 0 ? "text" : y; let m, p, h, g, u, v; if (e[14] !== i || e[15] !== l || e[16] !== o || e[17] !== c || e[18] !== f || e[19] !== F || e[20] !== a || e[21] !== D) { const t = B(C().textInput, F); m = S(t.base, c), p = o && /* @__PURE__ */ d("span", { className: t.addon, children: o }), g = t.field.base, u = i && /* @__PURE__ */ d("div", { className: t.field.icon.base, children: /* @__PURE__ */ d(i, { className: t.field.icon.svg }) }), v = l && /* @__PURE__ */ d("div", { "data-testid": "right-icon", className: t.field.rightIcon.base, children: /* @__PURE__ */ d(l, { className: t.field.rightIcon.svg }) }), h = S(t.field.input.base, t.field.input.colors[f], t.field.input.sizes[D], t.field.input.withIcon[i ? "on" : "off"], t.field.input.withRightIcon[l ? "on" : "off"], t.field.input.withAddon[o ? "on" : "off"], t.field.input.withShadow[a ? "on" : "off"]), e[14] = i, e[15] = l, e[16] = o, e[17] = c, e[18] = f, e[19] = F, e[20] = a, e[21] = D, e[22] = m, e[23] = p, e[24] = h, e[25] = g, e[26] = u, e[27] = v; } else m = e[22], p = e[23], h = e[24], g = e[25], u = e[26], v = e[27]; let I; e[28] !== r || e[29] !== A || e[30] !== h || e[31] !== H ? (I = /* @__PURE__ */ d("input", { className: h, type: H, ...r, ref: A }), e[28] = r, e[29] = A, e[30] = h, e[31] = H, e[32] = I) : I = e[32]; let N; e[33] !== I || e[34] !== g || e[35] !== u || e[36] !== v ? (N = /* @__PURE__ */ M("div", { className: g, children: [ u, v, I ] }), e[33] = I, e[34] = g, e[35] = u, e[36] = v, e[37] = N) : N = e[37]; let x; e[38] !== m || e[39] !== p || e[40] !== N ? (x = /* @__PURE__ */ M("div", { className: m, children: [ p, N ] }), e[38] = m, e[39] = p, e[40] = N, e[41] = x) : x = e[41]; let w; e[42] !== f || e[43] !== s ? (w = s && /* @__PURE__ */ d(E, { color: f, children: s }), e[42] = f, e[43] = s, e[44] = w) : w = e[44]; let R; return e[45] !== x || e[46] !== w ? (R = /* @__PURE__ */ M($, { children: [ x, w ] }), e[45] = x, e[46] = w, e[47] = R) : R = e[47], R; }); G.displayName = "TextInput"; export { G as TextInput }; //# sourceMappingURL=TextInput.mjs.map