@transkripid/flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork
50 lines (49 loc) • 2.58 kB
JavaScript
import { jsx as I, jsxs as D } from "react/jsx-runtime";
import { c as M } from "react/compiler-runtime";
import { forwardRef as R, useId as $ } from "react";
import { twMerge as N } from "tailwind-merge";
import { mergeDeep as k } from "../../helpers/merge-deep.mjs";
import { getTheme as q } from "../../theme-store/index.mjs";
const A = R((L, T) => {
const e = M(38);
let l, a, d, t, p, f, h, s, i;
e[0] !== L ? ({
label: d,
helperText: a,
color: p,
sizing: f,
variant: i,
disabled: h,
theme: s,
className: l,
...t
} = L, e[0] = L, e[1] = l, e[2] = a, e[3] = d, e[4] = t, e[5] = p, e[6] = f, e[7] = h, e[8] = s, e[9] = i) : (l = e[1], a = e[2], d = e[3], t = e[4], p = e[5], f = e[6], h = e[7], s = e[8], i = e[9]);
const b = p === void 0 ? "default" : p, u = f === void 0 ? "md" : f, _ = h === void 0 ? !1 : h;
let v;
e[10] !== s ? (v = s === void 0 ? {} : s, e[10] = s, e[11] = v) : v = e[11];
const y = v, g = $();
let r, n, o;
if (e[12] !== l || e[13] !== b || e[14] !== y || e[15] !== _ || e[16] !== d || e[17] !== t || e[18] !== g || e[19] !== T || e[20] !== u || e[21] !== i) {
const z = k(q().floatingLabel, y), F = i === "standard" ? "z-0" : "";
let m;
e[25] !== F ? (m = N("relative", F), e[25] = F, e[26] = m) : m = e[26];
const j = /* @__PURE__ */ I("input", { type: "text", id: t.id ? t.id : "floatingLabel" + g, "aria-describedby": "outlined_success_help", className: N(z.input[b][i][u], l), placeholder: " ", "data-testid": "floating-label", disabled: _, ...t, ref: T }), w = /* @__PURE__ */ I("label", { htmlFor: t.id ? t.id : "floatingLabel" + g, className: N(z.label[b][i][u], l), children: d });
e[27] !== m || e[28] !== j || e[29] !== w ? (o = /* @__PURE__ */ D("div", { className: m, children: [
j,
w
] }), e[27] = m, e[28] = j, e[29] = w, e[30] = o) : o = e[30], r = "outlined_helper_text" + g, n = N(z.helperText[b], l), e[12] = l, e[13] = b, e[14] = y, e[15] = _, e[16] = d, e[17] = t, e[18] = g, e[19] = T, e[20] = u, e[21] = i, e[22] = r, e[23] = n, e[24] = o;
} else
r = e[22], n = e[23], o = e[24];
let c;
e[31] !== a || e[32] !== r || e[33] !== n ? (c = /* @__PURE__ */ I("p", { id: r, className: n, children: a }), e[31] = a, e[32] = r, e[33] = n, e[34] = c) : c = e[34];
let x;
return e[35] !== o || e[36] !== c ? (x = /* @__PURE__ */ D("div", { children: [
o,
c
] }), e[35] = o, e[36] = c, e[37] = x) : x = e[37], x;
});
A.displayName = "FloatingLabel";
export {
A as FloatingLabel
};
//# sourceMappingURL=FloatingLabel.mjs.map