docthub-core-components 2.99.2 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/overrides/ui/auto-complete.js +466 -0
- package/dist/components/overrides/ui/autocomplete-checkbox.js +480 -0
- package/dist/components/overrides/ui/chips/doct-chip.js +157 -0
- package/dist/components/overrides/ui/circular-progress.js +32 -0
- package/dist/components/overrides/ui/composed/address-form-section.js +67 -0
- package/dist/components/overrides/ui/composed/contact-form-section.js +56 -0
- package/dist/components/overrides/ui/composed/search-filter-section.js +132 -0
- package/dist/components/overrides/ui/composed/user-registration-section.js +77 -0
- package/dist/components/overrides/ui/currencyInput/currency-input.js +69 -0
- package/dist/components/overrides/ui/doct-animation-loader.js +13 -0
- package/dist/components/overrides/ui/expandable-card.js +115 -0
- package/dist/components/overrides/ui/footer/doct-footer.js +35 -0
- package/dist/components/overrides/ui/footer/footer-desktop.js +92 -0
- package/dist/components/overrides/ui/footer/footer-mobile.js +123 -0
- package/dist/components/overrides/ui/footer/footer-routes.js +87 -0
- package/dist/components/overrides/ui/footer/footer-shared.js +137 -0
- package/dist/components/overrides/ui/footer/presets.js +269 -0
- package/dist/components/overrides/ui/inputs/labeled-input.js +92 -0
- package/dist/components/overrides/ui/inputs/otp-input.js +101 -0
- package/dist/components/overrides/ui/inputs/password-input.js +77 -0
- package/dist/components/overrides/ui/inputs/phone-input.js +336 -0
- package/dist/components/overrides/ui/navigation-menu/doct-navigation-menu.js +22 -0
- package/dist/components/overrides/ui/navigation-menu/individual-nav-routes.js +46 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/individual-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/nav-env.js +64 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-adapter.js +55 -0
- package/dist/components/overrides/ui/navigation-menu/navigation-menu-internal.js +36 -0
- package/dist/components/overrides/ui/navigation-menu/organization-nav-routes.js +34 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-desktop.js +109 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu-mobile.js +231 -0
- package/dist/components/overrides/ui/navigation-menu/organization-navigation-menu.js +44 -0
- package/dist/components/overrides/ui/navigation-menu/presets.js +238 -0
- package/dist/components/overrides/ui/navigation-menu/types.js +6 -0
- package/dist/components/overrides/ui/pickers/date-picker-field.js +361 -0
- package/dist/components/overrides/ui/pickers/date-range-picker-field.js +288 -0
- package/dist/components/overrides/ui/pickers/day-picker-bounds.js +38 -0
- package/dist/components/overrides/ui/pickers/select-field.js +158 -0
- package/dist/components/overrides/ui/search/auto-complete.js +64 -0
- package/dist/components/overrides/ui/search/search-input.js +65 -0
- package/dist/components/overrides/ui/showcase/component-section.js +45 -0
- package/dist/components/ui/alert.js +94 -0
- package/dist/components/ui/avatar.js +69 -0
- package/dist/components/ui/badge.js +37 -0
- package/dist/components/ui/breadcrumb.js +117 -0
- package/dist/components/ui/button.js +223 -0
- package/dist/components/ui/calendar.js +100 -0
- package/dist/components/ui/checkbox.js +57 -0
- package/dist/components/ui/collapsible.js +25 -0
- package/dist/components/ui/command.js +132 -0
- package/dist/components/ui/dialog.js +230 -0
- package/dist/components/ui/drawer.js +119 -0
- package/dist/components/ui/dropdown-menu.js +216 -0
- package/dist/components/ui/input.js +48 -0
- package/dist/components/ui/label.js +22 -0
- package/dist/components/ui/popover.js +181 -0
- package/dist/components/ui/progress.js +91 -0
- package/dist/components/ui/radio-group.js +49 -0
- package/dist/components/ui/select.js +169 -0
- package/dist/components/ui/skeleton.js +91 -0
- package/dist/components/ui/spinner.js +32 -0
- package/dist/components/ui/tabs.js +68 -0
- package/dist/components/ui/textarea.js +73 -0
- package/dist/components/ui/timeline.js +177 -0
- package/dist/components/ui/toast.js +82 -0
- package/dist/components/ui/tooltip.js +91 -0
- package/dist/components/ui/typography.js +213 -0
- package/dist/hooks/use-exclusive-dropdown.js +53 -0
- package/dist/hooks/use-mobile.js +19 -0
- package/dist/hooks/useAutocompleteCheckbox.js +204 -0
- package/dist/index.esm.js +7173 -7126
- package/dist/index.js +187 -0
- package/dist/lib/dropdown-manager.js +17 -0
- package/dist/lib/get-floating-dropdown-position.js +32 -0
- package/dist/lib/get-scroll-parents.js +20 -0
- package/dist/lib/slot.js +40 -0
- package/dist/lib/utils.js +9 -0
- package/dist/src/components/ui/alert.d.ts +1 -1
- package/dist/src/components/ui/button.d.ts +1 -1
- package/dist/src/components/ui/command.d.ts +3 -3
- package/dist/src/components/ui/timeline.d.ts +1 -1
- package/dist/src/index.d.ts +15 -15
- package/dist/src/lib/get-floating-dropdown-position.d.ts +9 -1
- package/dist/src/lib/get-scroll-parents.d.ts +6 -0
- package/dist/style.css +1 -1
- package/dist/util/getInputClasses.js +19 -0
- package/package.json +131 -132
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as E, jsxs as G } from "react/jsx-runtime";
|
|
3
|
+
import { c as ae } from "react-compiler-runtime";
|
|
4
|
+
import { useState as de, useId as oe, useEffect as ne } from "react";
|
|
5
|
+
import { Input as ce } from "../../../ui/input.js";
|
|
6
|
+
import { Label as ue } from "../../../ui/label.js";
|
|
7
|
+
import { cn as se } from "../../../../lib/utils.js";
|
|
8
|
+
const xe = (H) => {
|
|
9
|
+
const e = ae(85);
|
|
10
|
+
let S, m, h, l, s, r, v, d, i, q, o, n, g, P, c, u, a, T, D, t;
|
|
11
|
+
e[0] !== H ? ({
|
|
12
|
+
label: d,
|
|
13
|
+
placeholder: g,
|
|
14
|
+
helperText: r,
|
|
15
|
+
error: l,
|
|
16
|
+
required: c,
|
|
17
|
+
type: D,
|
|
18
|
+
leftIcon: i,
|
|
19
|
+
rightIcon: a,
|
|
20
|
+
className: m,
|
|
21
|
+
inputClassName: v,
|
|
22
|
+
onChange: o,
|
|
23
|
+
onValueChange: n,
|
|
24
|
+
showCharCount: T,
|
|
25
|
+
maxLength: q,
|
|
26
|
+
characterLimit: S,
|
|
27
|
+
value: t,
|
|
28
|
+
disabled: h,
|
|
29
|
+
readOnly: P,
|
|
30
|
+
fridged: s,
|
|
31
|
+
...u
|
|
32
|
+
} = H, e[0] = H, e[1] = S, e[2] = m, e[3] = h, e[4] = l, e[5] = s, e[6] = r, e[7] = v, e[8] = d, e[9] = i, e[10] = q, e[11] = o, e[12] = n, e[13] = g, e[14] = P, e[15] = c, e[16] = u, e[17] = a, e[18] = T, e[19] = D, e[20] = t) : (S = e[1], m = e[2], h = e[3], l = e[4], s = e[5], r = e[6], v = e[7], d = e[8], i = e[9], q = e[10], o = e[11], n = e[12], g = e[13], P = e[14], c = e[15], u = e[16], a = e[17], T = e[18], D = e[19], t = e[20]);
|
|
33
|
+
const J = D === void 0 ? "text" : D, [K, ie] = de(typeof t == "string" ? t.length : String(t ?? "").length), x = oe(), b = oe(), A = P || s, f = S || q, Q = u["aria-describedby"];
|
|
34
|
+
let F;
|
|
35
|
+
e[21] !== l || e[22] !== b || e[23] !== r || e[24] !== Q ? (F = [Q, r || l ? b : void 0].filter(Boolean).join(" ") || void 0, e[21] = l, e[22] = b, e[23] = r, e[24] = Q, e[25] = F) : F = e[25];
|
|
36
|
+
const U = F;
|
|
37
|
+
let M, R;
|
|
38
|
+
e[26] !== s ? (M = () => {
|
|
39
|
+
s && process.env.NODE_ENV !== "production" && console.warn('[LabeledInput] The "fridged" prop is deprecated and will be removed in v3.0. Please use "readOnly" instead.');
|
|
40
|
+
}, R = [s], e[26] = s, e[27] = M, e[28] = R) : (M = e[27], R = e[28]), ne(M, R);
|
|
41
|
+
let _;
|
|
42
|
+
e[29] !== o || e[30] !== n ? (_ = (re) => {
|
|
43
|
+
o == null || o(re), n == null || n(re.target.value), ie(re.target.value.length);
|
|
44
|
+
}, e[29] = o, e[30] = n, e[31] = _) : _ = e[31];
|
|
45
|
+
const V = _;
|
|
46
|
+
let $, k;
|
|
47
|
+
e[32] !== t ? ($ = () => {
|
|
48
|
+
t !== void 0 && ie(typeof t == "string" ? t.length : String(t).length);
|
|
49
|
+
}, k = [t], e[32] = t, e[33] = $, e[34] = k) : ($ = e[33], k = e[34]), ne($, k);
|
|
50
|
+
const p = T && typeof f == "number";
|
|
51
|
+
let y;
|
|
52
|
+
e[35] !== m ? (y = se("space-y-1", m), e[35] = m, e[36] = y) : y = e[36];
|
|
53
|
+
let N;
|
|
54
|
+
e[37] !== x || e[38] !== d || e[39] !== c ? (N = d && /* @__PURE__ */ G(ue, { htmlFor: x, className: "text-sm font-medium text-foreground", children: [
|
|
55
|
+
d,
|
|
56
|
+
c && /* @__PURE__ */ E("span", { className: "text-destructive ml-1", "aria-hidden": "true", children: "*" })
|
|
57
|
+
] }), e[37] = x, e[38] = d, e[39] = c, e[40] = N) : N = e[40];
|
|
58
|
+
let I;
|
|
59
|
+
e[41] !== i ? (I = i && /* @__PURE__ */ E("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none", children: i }), e[41] = i, e[42] = I) : I = e[42];
|
|
60
|
+
let C;
|
|
61
|
+
e[43] !== a || e[44] !== p ? (C = a && !p && /* @__PURE__ */ E("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none", children: a }), e[43] = a, e[44] = p, e[45] = C) : C = e[45];
|
|
62
|
+
const W = i && "pl-10", X = a && "pr-10", Y = p && "pr-16", Z = l && "border-destructive", ee = A && "cursor-not-allowed bg-muted text-muted-foreground opacity-70";
|
|
63
|
+
let L;
|
|
64
|
+
e[46] !== v || e[47] !== W || e[48] !== X || e[49] !== Y || e[50] !== Z || e[51] !== ee ? (L = se(W, X, Y, Z, ee, v), e[46] = v, e[47] = W, e[48] = X, e[49] = Y, e[50] = Z, e[51] = ee, e[52] = L) : L = e[52];
|
|
65
|
+
const te = !!l || void 0, le = c || void 0;
|
|
66
|
+
let w;
|
|
67
|
+
e[53] !== U || e[54] !== h || e[55] !== f || e[56] !== V || e[57] !== x || e[58] !== A || e[59] !== g || e[60] !== u || e[61] !== L || e[62] !== te || e[63] !== le || e[64] !== J || e[65] !== t ? (w = /* @__PURE__ */ E(ce, { id: x, type: J, placeholder: g, disabled: h, readOnly: A, value: t, maxLength: f, onChange: V, className: L, "aria-invalid": te, "aria-required": le, "aria-describedby": U, ...u }), e[53] = U, e[54] = h, e[55] = f, e[56] = V, e[57] = x, e[58] = A, e[59] = g, e[60] = u, e[61] = L, e[62] = te, e[63] = le, e[64] = J, e[65] = t, e[66] = w) : w = e[66];
|
|
68
|
+
let O;
|
|
69
|
+
e[67] !== K || e[68] !== f || e[69] !== p ? (O = p && /* @__PURE__ */ G("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted-foreground pointer-events-none", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
70
|
+
K,
|
|
71
|
+
" / ",
|
|
72
|
+
f
|
|
73
|
+
] }), e[67] = K, e[68] = f, e[69] = p, e[70] = O) : O = e[70];
|
|
74
|
+
let j;
|
|
75
|
+
e[71] !== I || e[72] !== C || e[73] !== w || e[74] !== O ? (j = /* @__PURE__ */ G("div", { className: "relative", children: [
|
|
76
|
+
I,
|
|
77
|
+
C,
|
|
78
|
+
w,
|
|
79
|
+
O
|
|
80
|
+
] }), e[71] = I, e[72] = C, e[73] = w, e[74] = O, e[75] = j) : j = e[75];
|
|
81
|
+
let B;
|
|
82
|
+
e[76] !== l || e[77] !== b || e[78] !== r ? (B = (r || l) && /* @__PURE__ */ E("p", { id: b, className: se("text-xs", l ? "text-destructive" : "text-muted-foreground"), role: l ? "alert" : void 0, children: l || r }), e[76] = l, e[77] = b, e[78] = r, e[79] = B) : B = e[79];
|
|
83
|
+
let z;
|
|
84
|
+
return e[80] !== j || e[81] !== B || e[82] !== y || e[83] !== N ? (z = /* @__PURE__ */ G("div", { className: y, children: [
|
|
85
|
+
N,
|
|
86
|
+
j,
|
|
87
|
+
B
|
|
88
|
+
] }), e[80] = j, e[81] = B, e[82] = y, e[83] = N, e[84] = z) : z = e[84], z;
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
xe as LabeledInput
|
|
92
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as F, jsxs as Z } from "react/jsx-runtime";
|
|
3
|
+
import { c as x } from "react-compiler-runtime";
|
|
4
|
+
import { useRef as _, useId as G, useLayoutEffect as tt } from "react";
|
|
5
|
+
import { Input as et } from "../../../ui/input.js";
|
|
6
|
+
import { Label as rt } from "../../../ui/label.js";
|
|
7
|
+
import { cn as Y } from "../../../../lib/utils.js";
|
|
8
|
+
const ft = (k) => {
|
|
9
|
+
const t = x(46), {
|
|
10
|
+
length: H,
|
|
11
|
+
label: i,
|
|
12
|
+
value: d,
|
|
13
|
+
onChange: j,
|
|
14
|
+
onComplete: g,
|
|
15
|
+
className: C,
|
|
16
|
+
error: c,
|
|
17
|
+
inputClassName: J,
|
|
18
|
+
autoFocus: Q,
|
|
19
|
+
autoSubmit: U,
|
|
20
|
+
secure: V
|
|
21
|
+
} = k, o = H === void 0 ? 6 : H, K = J === void 0 ? "h-10 w-10" : J, q = Q === void 0 ? !1 : Q, L = U === void 0 ? !1 : U, E = V === void 0 ? !1 : V;
|
|
22
|
+
let M;
|
|
23
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (M = [], t[0] = M) : M = t[0];
|
|
24
|
+
const a = _(M), h = G(), v = G(), S = G();
|
|
25
|
+
let O;
|
|
26
|
+
if (t[1] !== o || t[2] !== S) {
|
|
27
|
+
let n;
|
|
28
|
+
t[4] !== S ? (n = (W, z) => `${S}-digit-${z + 1}`, t[4] = S, t[5] = n) : n = t[5], O = Array.from({
|
|
29
|
+
length: o
|
|
30
|
+
}, n), t[1] = o, t[2] = S, t[3] = O;
|
|
31
|
+
} else
|
|
32
|
+
O = t[3];
|
|
33
|
+
const T = O;
|
|
34
|
+
let A, P;
|
|
35
|
+
t[6] !== q ? (A = () => {
|
|
36
|
+
var n;
|
|
37
|
+
q && ((n = a.current[0]) == null || n.focus({
|
|
38
|
+
preventScroll: !0
|
|
39
|
+
}));
|
|
40
|
+
}, P = [q], t[6] = q, t[7] = A, t[8] = P) : (A = t[7], P = t[8]), tt(A, P);
|
|
41
|
+
let b, y, D, I, u, f;
|
|
42
|
+
if (t[9] !== L || t[10] !== C || t[11] !== c || t[12] !== v || t[13] !== K || t[14] !== i || t[15] !== h || t[16] !== o || t[17] !== j || t[18] !== g || t[19] !== T || t[20] !== E || t[21] !== d) {
|
|
43
|
+
const n = (e, s) => {
|
|
44
|
+
var l;
|
|
45
|
+
const m = s.replace(/\D/g, "").slice(0, 1);
|
|
46
|
+
if (s.length > 1 && m.length <= 1)
|
|
47
|
+
return;
|
|
48
|
+
const r = [...d];
|
|
49
|
+
r[e] = m, j(r), s && e < o - 1 && ((l = a.current[e + 1]) == null || l.focus()), r.every(st) && (g && g(r.join("")), L && queueMicrotask(() => {
|
|
50
|
+
var $;
|
|
51
|
+
const B = ($ = a.current[e]) == null ? void 0 : $.closest("form");
|
|
52
|
+
B && B.requestSubmit();
|
|
53
|
+
}));
|
|
54
|
+
}, W = (e, s) => {
|
|
55
|
+
var $;
|
|
56
|
+
s.preventDefault();
|
|
57
|
+
const r = (s.clipboardData.getData("text") || "").replace(/\D/g, "").slice(0, o - e).split("");
|
|
58
|
+
if (r.length === 0)
|
|
59
|
+
return;
|
|
60
|
+
const l = [...d];
|
|
61
|
+
for (let p = 0; p < r.length && e + p < o; p++)
|
|
62
|
+
l[e + p] = r[p];
|
|
63
|
+
j(l);
|
|
64
|
+
const B = Math.min(e + r.length, o - 1);
|
|
65
|
+
($ = a.current[B]) == null || $.focus(), l.every(ot) && (g && g(l.join("")), L && queueMicrotask(() => {
|
|
66
|
+
var X;
|
|
67
|
+
const p = (X = a.current[e]) == null ? void 0 : X.closest("form");
|
|
68
|
+
p && p.requestSubmit();
|
|
69
|
+
}));
|
|
70
|
+
}, z = (e, s) => {
|
|
71
|
+
var m, r, l;
|
|
72
|
+
s.key === "Backspace" && !d[e] && e > 0 ? (m = a.current[e - 1]) == null || m.focus() : s.key === "ArrowLeft" && e > 0 ? (s.preventDefault(), (r = a.current[e - 1]) == null || r.focus()) : s.key === "ArrowRight" && e < o - 1 && (s.preventDefault(), (l = a.current[e + 1]) == null || l.focus());
|
|
73
|
+
};
|
|
74
|
+
t[28] !== C ? (u = Y("space-y-2", C), t[28] = C, t[29] = u) : u = t[29], t[30] !== i || t[31] !== h ? (f = i && /* @__PURE__ */ F(rt, { id: h, className: "text-sm font-medium text-gray-700", children: i }), t[30] = i, t[31] = h, t[32] = f) : f = t[32], b = "flex gap-2 border-0 p-0 m-0", y = i ? h : void 0, D = c ? v : void 0, I = T.map((e, s) => {
|
|
75
|
+
const m = d[s] ?? "";
|
|
76
|
+
return /* @__PURE__ */ F(et, { ref: (r) => {
|
|
77
|
+
a.current[s] = r;
|
|
78
|
+
}, type: E ? "password" : "text", inputMode: "numeric", maxLength: 1, value: m, onChange: (r) => n(s, r.target.value), onKeyDown: (r) => z(s, r), onPaste: (r) => W(s, r), className: Y("text-center p-0 text-lg font-semibold", c && "border-destructive", K), "aria-label": `${i || "OTP"} digit ${s + 1} of ${o}`, "aria-invalid": c ? "true" : "false" }, e);
|
|
79
|
+
}), t[9] = L, t[10] = C, t[11] = c, t[12] = v, t[13] = K, t[14] = i, t[15] = h, t[16] = o, t[17] = j, t[18] = g, t[19] = T, t[20] = E, t[21] = d, t[22] = b, t[23] = y, t[24] = D, t[25] = I, t[26] = u, t[27] = f;
|
|
80
|
+
} else
|
|
81
|
+
b = t[22], y = t[23], D = t[24], I = t[25], u = t[26], f = t[27];
|
|
82
|
+
let w;
|
|
83
|
+
t[33] !== b || t[34] !== y || t[35] !== D || t[36] !== I ? (w = /* @__PURE__ */ F("fieldset", { className: b, "aria-labelledby": y, "aria-describedby": D, children: I }), t[33] = b, t[34] = y, t[35] = D, t[36] = I, t[37] = w) : w = t[37];
|
|
84
|
+
let N;
|
|
85
|
+
t[38] !== c || t[39] !== v ? (N = c && /* @__PURE__ */ F("p", { id: v, className: "text-xs text-destructive mt-1", role: "alert", children: c }), t[38] = c, t[39] = v, t[40] = N) : N = t[40];
|
|
86
|
+
let R;
|
|
87
|
+
return t[41] !== u || t[42] !== f || t[43] !== w || t[44] !== N ? (R = /* @__PURE__ */ Z("div", { className: u, children: [
|
|
88
|
+
f,
|
|
89
|
+
w,
|
|
90
|
+
N
|
|
91
|
+
] }), t[41] = u, t[42] = f, t[43] = w, t[44] = N, t[45] = R) : R = t[45], R;
|
|
92
|
+
};
|
|
93
|
+
function st(k) {
|
|
94
|
+
return k !== "";
|
|
95
|
+
}
|
|
96
|
+
function ot(k) {
|
|
97
|
+
return k !== "";
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
ft as OtpInput
|
|
101
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as K, jsx as f } from "react/jsx-runtime";
|
|
3
|
+
import { c as W } from "react-compiler-runtime";
|
|
4
|
+
import { EyeOff as X, Eye as Y } from "lucide-react";
|
|
5
|
+
import { useId as M } from "react";
|
|
6
|
+
import { Input as Z } from "../../../ui/input.js";
|
|
7
|
+
import { Label as _ } from "../../../ui/label.js";
|
|
8
|
+
import { cn as S } from "../../../../lib/utils.js";
|
|
9
|
+
function ae(H) {
|
|
10
|
+
const e = W(67);
|
|
11
|
+
let u, t, o, n, i, a, d, c, m, l, q, E, k, h;
|
|
12
|
+
e[0] !== H ? ({
|
|
13
|
+
label: n,
|
|
14
|
+
placeholder: q,
|
|
15
|
+
helperText: o,
|
|
16
|
+
error: t,
|
|
17
|
+
required: m,
|
|
18
|
+
className: u,
|
|
19
|
+
showPassword: E,
|
|
20
|
+
onShowPasswordChange: d,
|
|
21
|
+
value: h,
|
|
22
|
+
onChange: i,
|
|
23
|
+
onChangeEvent: a,
|
|
24
|
+
onValueChange: c,
|
|
25
|
+
autoComplete: k,
|
|
26
|
+
...l
|
|
27
|
+
} = H, e[0] = H, e[1] = u, e[2] = t, e[3] = o, e[4] = n, e[5] = i, e[6] = a, e[7] = d, e[8] = c, e[9] = m, e[10] = l, e[11] = q, e[12] = E, e[13] = k, e[14] = h) : (u = e[1], t = e[2], o = e[3], n = e[4], i = e[5], a = e[6], d = e[7], c = e[8], m = e[9], l = e[10], q = e[11], E = e[12], k = e[13], h = e[14]);
|
|
28
|
+
const L = q === void 0 ? "Enter password" : q, s = E === void 0 ? !1 : E, O = k === void 0 ? "current-password" : k, P = M(), U = M(), p = M(), r = (l == null ? void 0 : l.id) ?? U;
|
|
29
|
+
let B;
|
|
30
|
+
e[15] !== i || e[16] !== a || e[17] !== c ? (B = (Q) => {
|
|
31
|
+
const R = Q.target.value;
|
|
32
|
+
i == null || i(R), a == null || a(Q), c == null || c(R);
|
|
33
|
+
}, e[15] = i, e[16] = a, e[17] = c, e[18] = B) : B = e[18];
|
|
34
|
+
const T = B;
|
|
35
|
+
let C;
|
|
36
|
+
e[19] !== d || e[20] !== s ? (C = () => {
|
|
37
|
+
d == null || d(!s);
|
|
38
|
+
}, e[19] = d, e[20] = s, e[21] = C) : C = e[21];
|
|
39
|
+
const V = C;
|
|
40
|
+
let x;
|
|
41
|
+
e[22] !== u ? (x = S("space-y-1", u), e[22] = u, e[23] = x) : x = e[23];
|
|
42
|
+
let g;
|
|
43
|
+
e[24] !== n || e[25] !== m || e[26] !== r ? (g = n && /* @__PURE__ */ K(_, { htmlFor: r, className: "text-sm font-medium text-gray-700", children: [
|
|
44
|
+
n,
|
|
45
|
+
m && /* @__PURE__ */ f("span", { className: "text-red-500 ml-1", "aria-hidden": "true", children: "*" })
|
|
46
|
+
] }), e[24] = n, e[25] = m, e[26] = r, e[27] = g) : g = e[27];
|
|
47
|
+
const $ = s ? "text" : "password", z = t && "border-destructive";
|
|
48
|
+
let y;
|
|
49
|
+
e[28] !== z ? (y = S("pr-10", z), e[28] = z, e[29] = y) : y = e[29];
|
|
50
|
+
const A = !!t || void 0, D = m || void 0, G = o || t ? p : l["aria-describedby"];
|
|
51
|
+
let v;
|
|
52
|
+
e[30] !== O || e[31] !== T || e[32] !== L || e[33] !== r || e[34] !== l || e[35] !== y || e[36] !== A || e[37] !== D || e[38] !== G || e[39] !== $ || e[40] !== h ? (v = /* @__PURE__ */ f(Z, { id: r, type: $, placeholder: L, autoComplete: O, className: y, value: h, onChange: T, "aria-invalid": A, "aria-required": D, "aria-describedby": G, ...l }), e[30] = O, e[31] = T, e[32] = L, e[33] = r, e[34] = l, e[35] = y, e[36] = A, e[37] = D, e[38] = G, e[39] = $, e[40] = h, e[41] = v) : v = e[41];
|
|
53
|
+
const J = s ? "Hide password" : "Show password";
|
|
54
|
+
let b;
|
|
55
|
+
e[42] !== s ? (b = s ? /* @__PURE__ */ f(X, { className: "h-4 w-4 text-gray-400 hover:text-gray-500" }) : /* @__PURE__ */ f(Y, { className: "h-4 w-4 text-gray-400 hover:text-gray-500" }), e[42] = s, e[43] = b) : b = e[43];
|
|
56
|
+
let w;
|
|
57
|
+
e[44] !== r || e[45] !== s || e[46] !== J || e[47] !== b || e[48] !== P || e[49] !== V ? (w = /* @__PURE__ */ f("button", { id: P, type: "button", onClick: V, className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring rounded p-1", "aria-label": J, "aria-pressed": s, "aria-controls": r, children: b }), e[44] = r, e[45] = s, e[46] = J, e[47] = b, e[48] = P, e[49] = V, e[50] = w) : w = e[50];
|
|
58
|
+
let N;
|
|
59
|
+
e[51] !== v || e[52] !== w ? (N = /* @__PURE__ */ K("div", { className: "relative", children: [
|
|
60
|
+
v,
|
|
61
|
+
w
|
|
62
|
+
] }), e[51] = v, e[52] = w, e[53] = N) : N = e[53];
|
|
63
|
+
let I;
|
|
64
|
+
e[54] !== t || e[55] !== p ? (I = t && /* @__PURE__ */ f("p", { id: p, className: "text-xs text-red-500", role: "alert", children: t }), e[54] = t, e[55] = p, e[56] = I) : I = e[56];
|
|
65
|
+
let j;
|
|
66
|
+
e[57] !== t || e[58] !== p || e[59] !== o ? (j = o && !t && /* @__PURE__ */ f("p", { id: p, className: "text-xs text-gray-500", children: o }), e[57] = t, e[58] = p, e[59] = o, e[60] = j) : j = e[60];
|
|
67
|
+
let F;
|
|
68
|
+
return e[61] !== N || e[62] !== I || e[63] !== j || e[64] !== x || e[65] !== g ? (F = /* @__PURE__ */ K("div", { className: x, children: [
|
|
69
|
+
g,
|
|
70
|
+
N,
|
|
71
|
+
I,
|
|
72
|
+
j
|
|
73
|
+
] }), e[61] = N, e[62] = I, e[63] = j, e[64] = x, e[65] = g, e[66] = F) : F = e[66], F;
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
ae as PasswordInput
|
|
77
|
+
};
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as c, jsxs as T, Fragment as $e } from "react/jsx-runtime";
|
|
3
|
+
import { c as he } from "react-compiler-runtime";
|
|
4
|
+
import { ChevronsUpDown as Re, CheckIcon as Pe } from "lucide-react";
|
|
5
|
+
import * as R from "react";
|
|
6
|
+
import * as je from "react-phone-number-input";
|
|
7
|
+
import { isPossiblePhoneNumber as ut, isValidPhoneNumber as mt } from "react-phone-number-input";
|
|
8
|
+
import Te from "react-phone-number-input/flags";
|
|
9
|
+
import { CommandInput as Ae, CommandEmpty as Be, CommandList as Le, CommandGroup as Ve, Command as ze, CommandItem as Ge } from "../../../ui/command.js";
|
|
10
|
+
import { Input as Ue } from "../../../ui/input.js";
|
|
11
|
+
import { Label as qe } from "../../../ui/label.js";
|
|
12
|
+
import { PopoverTrigger as Me, PopoverContent as Xe, Popover as He } from "../../../ui/popover.js";
|
|
13
|
+
import { cn as te } from "../../../../lib/utils.js";
|
|
14
|
+
import { DoctTypography as Se } from "../../../ui/typography.js";
|
|
15
|
+
const Je = /\D/g, re = (r) => r.replace(Je, ""), _e = (r) => {
|
|
16
|
+
const e = r.match(/^\+\s*(\d+)\s*-\s*(\d*)\s*$/);
|
|
17
|
+
return e ? {
|
|
18
|
+
callingCode: e[1],
|
|
19
|
+
national: e[2]
|
|
20
|
+
} : null;
|
|
21
|
+
}, De = (r) => {
|
|
22
|
+
if (r == null) return "";
|
|
23
|
+
const e = String(r).trim(), t = _e(e);
|
|
24
|
+
return t ? t.national : re(e);
|
|
25
|
+
}, q = (r) => {
|
|
26
|
+
if (!r) return "91";
|
|
27
|
+
if (typeof r == "object" && "countryCode" in r)
|
|
28
|
+
return r.countryCode.replace("+", "");
|
|
29
|
+
try {
|
|
30
|
+
return je.getCountryCallingCode(r);
|
|
31
|
+
} catch {
|
|
32
|
+
return "91";
|
|
33
|
+
}
|
|
34
|
+
}, Oe = (r, e) => {
|
|
35
|
+
if (!e) return r ? `+${re(r)}` : "";
|
|
36
|
+
const t = q(e);
|
|
37
|
+
return r ? `+${t}-${r}` : `+${t}`;
|
|
38
|
+
}, Fe = (r, e) => e ? typeof r == "object" && "countryId" in r && typeof e == "object" && "countryId" in e ? r.countryId === e.countryId : r === e : !1, Ie = (r, e, t) => {
|
|
39
|
+
const s = re(e), l = r.map((n) => n.value).filter((n) => !!n).filter((n) => q(n) === s);
|
|
40
|
+
if (l.length !== 0)
|
|
41
|
+
return t && l.some((n) => Fe(n, t)) ? t : l[0];
|
|
42
|
+
}, ke = (r) => {
|
|
43
|
+
const e = he(5), {
|
|
44
|
+
country: t,
|
|
45
|
+
countryName: s
|
|
46
|
+
} = r, l = Te[t];
|
|
47
|
+
let n;
|
|
48
|
+
e[0] !== l || e[1] !== s ? (n = l && /* @__PURE__ */ c(l, { title: s }), e[0] = l, e[1] = s, e[2] = n) : n = e[2];
|
|
49
|
+
let o;
|
|
50
|
+
return e[3] !== n ? (o = /* @__PURE__ */ c("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: n }), e[3] = n, e[4] = o) : o = e[4], o;
|
|
51
|
+
}, Ke = (r) => {
|
|
52
|
+
const e = he(48), {
|
|
53
|
+
disabled: t,
|
|
54
|
+
value: s,
|
|
55
|
+
options: l,
|
|
56
|
+
onChange: n,
|
|
57
|
+
showFlagVariant: o,
|
|
58
|
+
hasError: x,
|
|
59
|
+
popoverAnchorRef: f
|
|
60
|
+
} = r, C = R.useRef(null), [$, w] = R.useState(""), [y, u] = R.useState(!1);
|
|
61
|
+
let p;
|
|
62
|
+
e[0] !== s ? (p = s ? `+${q(s)}` : "+91", e[0] = s, e[1] = p) : p = e[1];
|
|
63
|
+
const d = p;
|
|
64
|
+
let a;
|
|
65
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (F) => {
|
|
66
|
+
u(F), F && w("");
|
|
67
|
+
}, e[2] = a) : a = e[2];
|
|
68
|
+
const h = x ? "border-destructive" : "border-gray-300", v = y && "bg-gray-100";
|
|
69
|
+
let I;
|
|
70
|
+
e[3] !== h || e[4] !== v ? (I = te("flex h-[40px] items-center gap-1.5 rounded-l-md rounded-r-none border-l-[1px] border-t-[1px] border-b-[1px] bg-white px-3 py-[1px] text-sm font-medium text-gray-900 transition-colors", h, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", v), e[3] = h, e[4] = v, e[5] = I) : I = e[5];
|
|
71
|
+
let D;
|
|
72
|
+
e[6] !== s || e[7] !== o ? (D = o && s && typeof s == "string" && /* @__PURE__ */ c("span", { className: "mr-1 flex items-center", children: /* @__PURE__ */ c(ke, { country: s, countryName: s }) }), e[6] = s, e[7] = o, e[8] = D) : D = e[8];
|
|
73
|
+
let O;
|
|
74
|
+
e[9] !== d ? (O = /* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900", children: d }), e[9] = d, e[10] = O) : O = e[10];
|
|
75
|
+
const g = t && "hidden";
|
|
76
|
+
let V;
|
|
77
|
+
e[11] !== g ? (V = te("h-4 w-4 text-gray-500 shrink-0", g), e[11] = g, e[12] = V) : V = e[12];
|
|
78
|
+
let z;
|
|
79
|
+
e[13] !== V ? (z = /* @__PURE__ */ c(Re, { className: V }), e[13] = V, e[14] = z) : z = e[14];
|
|
80
|
+
let S;
|
|
81
|
+
e[15] !== t || e[16] !== z || e[17] !== I || e[18] !== D || e[19] !== O ? (S = /* @__PURE__ */ c(Me, { asChild: !0, children: /* @__PURE__ */ T("button", { type: "button", disabled: t, className: I, children: [
|
|
82
|
+
D,
|
|
83
|
+
O,
|
|
84
|
+
z
|
|
85
|
+
] }) }), e[15] = t, e[16] = z, e[17] = I, e[18] = D, e[19] = O, e[20] = S) : S = e[20];
|
|
86
|
+
let M;
|
|
87
|
+
e[21] === Symbol.for("react.memo_cache_sentinel") ? (M = {
|
|
88
|
+
side: "flip",
|
|
89
|
+
align: "shift",
|
|
90
|
+
fallbackAxisSide: "none"
|
|
91
|
+
}, e[21] = M) : M = e[21];
|
|
92
|
+
let k;
|
|
93
|
+
e[22] === Symbol.for("react.memo_cache_sentinel") ? (k = (F) => {
|
|
94
|
+
w(F), window.setTimeout(() => {
|
|
95
|
+
const L = C.current;
|
|
96
|
+
L && (L.scrollTop = 0);
|
|
97
|
+
}, 0);
|
|
98
|
+
}, e[22] = k) : k = e[22];
|
|
99
|
+
let _;
|
|
100
|
+
e[23] !== $ ? (_ = /* @__PURE__ */ c("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ c(Ae, { value: $, onValueChange: k, placeholder: "Search country..." }) }), e[23] = $, e[24] = _) : _ = e[24];
|
|
101
|
+
let A, G;
|
|
102
|
+
e[25] === Symbol.for("react.memo_cache_sentinel") ? (A = {
|
|
103
|
+
msOverflowStyle: "none"
|
|
104
|
+
}, G = /* @__PURE__ */ c(Be, { children: "No country found." }), e[25] = A, e[26] = G) : (A = e[25], G = e[26]);
|
|
105
|
+
let j;
|
|
106
|
+
if (e[27] !== l || e[28] !== n || e[29] !== s || e[30] !== o) {
|
|
107
|
+
let F;
|
|
108
|
+
e[32] !== n || e[33] !== s || e[34] !== o ? (F = (L) => {
|
|
109
|
+
const {
|
|
110
|
+
value: i,
|
|
111
|
+
label: X,
|
|
112
|
+
countryCode: H
|
|
113
|
+
} = L;
|
|
114
|
+
return i ? /* @__PURE__ */ c(Qe, { country: i, countryName: X, countryCode: H, selectedCountry: s, onChange: n, onSelectComplete: () => u(!1), showFlagVariant: o }, typeof i == "object" && "countryId" in i ? i.countryId : i) : null;
|
|
115
|
+
}, e[32] = n, e[33] = s, e[34] = o, e[35] = F) : F = e[35], j = l.map(F), e[27] = l, e[28] = n, e[29] = s, e[30] = o, e[31] = j;
|
|
116
|
+
} else
|
|
117
|
+
j = e[31];
|
|
118
|
+
let P;
|
|
119
|
+
e[36] !== j ? (P = /* @__PURE__ */ c(Le, { children: /* @__PURE__ */ T("div", { ref: C, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: A, children: [
|
|
120
|
+
G,
|
|
121
|
+
/* @__PURE__ */ c(Ve, { children: j })
|
|
122
|
+
] }) }), e[36] = j, e[37] = P) : P = e[37];
|
|
123
|
+
let E;
|
|
124
|
+
e[38] !== _ || e[39] !== P ? (E = /* @__PURE__ */ T(ze, { children: [
|
|
125
|
+
_,
|
|
126
|
+
P
|
|
127
|
+
] }), e[38] = _, e[39] = P, e[40] = E) : E = e[40];
|
|
128
|
+
let m;
|
|
129
|
+
e[41] !== f || e[42] !== E ? (m = /* @__PURE__ */ c(Xe, { anchor: f, side: "bottom", sideOffset: 6, collisionAvoidance: M, className: "w-[min(var(--anchor-width),calc(100vw-1rem))] max-w-[var(--available-width)] min-w-0 p-1 shadow-md border border-gray-300 rounded-md", align: "start", children: E }), e[41] = f, e[42] = E, e[43] = m) : m = e[43];
|
|
130
|
+
let B;
|
|
131
|
+
return e[44] !== y || e[45] !== S || e[46] !== m ? (B = /* @__PURE__ */ T(He, { open: y, modal: !0, onOpenChange: a, children: [
|
|
132
|
+
S,
|
|
133
|
+
m
|
|
134
|
+
] }), e[44] = y, e[45] = S, e[46] = m, e[47] = B) : B = e[47], B;
|
|
135
|
+
}, Qe = (r) => {
|
|
136
|
+
const e = he(21), {
|
|
137
|
+
country: t,
|
|
138
|
+
countryName: s,
|
|
139
|
+
countryCode: l,
|
|
140
|
+
selectedCountry: n,
|
|
141
|
+
onChange: o,
|
|
142
|
+
onSelectComplete: x,
|
|
143
|
+
showFlagVariant: f
|
|
144
|
+
} = r;
|
|
145
|
+
let C;
|
|
146
|
+
e[0] !== t || e[1] !== o || e[2] !== x ? (C = () => {
|
|
147
|
+
o(t), x();
|
|
148
|
+
}, e[0] = t, e[1] = o, e[2] = x, e[3] = C) : C = e[3];
|
|
149
|
+
const $ = C;
|
|
150
|
+
let w;
|
|
151
|
+
e: {
|
|
152
|
+
if (!n) {
|
|
153
|
+
w = !1;
|
|
154
|
+
break e;
|
|
155
|
+
}
|
|
156
|
+
if (typeof t == "object" && "countryId" in t && typeof n == "object" && "countryId" in n) {
|
|
157
|
+
w = t.countryId === n.countryId;
|
|
158
|
+
break e;
|
|
159
|
+
}
|
|
160
|
+
w = t === n;
|
|
161
|
+
}
|
|
162
|
+
const y = w, u = typeof t == "object" && "countryId" in t ? `${t.countryName} ${t.countryCode}` : `${s} ${l}`;
|
|
163
|
+
let p;
|
|
164
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (p = te("flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer transition-colors", "data-[selected=true]:bg-[#F5F5F5] data-[selected=true]:text-gray-900", "hover:bg-[#F5F5F5]"), e[4] = p) : p = e[4];
|
|
165
|
+
let d;
|
|
166
|
+
e[5] !== t || e[6] !== s || e[7] !== f ? (d = f && typeof t == "string" && /* @__PURE__ */ c("span", { className: "flex items-center", children: /* @__PURE__ */ c(ke, { country: t, countryName: s }) }), e[5] = t, e[6] = s, e[7] = f, e[8] = d) : d = e[8];
|
|
167
|
+
let a;
|
|
168
|
+
e[9] !== l || e[10] !== s || e[11] !== f ? (a = f ? /* @__PURE__ */ T($e, { children: [
|
|
169
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: s }),
|
|
170
|
+
/* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: l })
|
|
171
|
+
] }) : /* @__PURE__ */ T($e, { children: [
|
|
172
|
+
/* @__PURE__ */ c(Se, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: l }),
|
|
173
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: s })
|
|
174
|
+
] }), e[9] = l, e[10] = s, e[11] = f, e[12] = a) : a = e[12];
|
|
175
|
+
let h;
|
|
176
|
+
e[13] !== y ? (h = y && /* @__PURE__ */ c(Pe, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[13] = y, e[14] = h) : h = e[14];
|
|
177
|
+
let v;
|
|
178
|
+
return e[15] !== $ || e[16] !== u || e[17] !== d || e[18] !== a || e[19] !== h ? (v = /* @__PURE__ */ T(Ge, { value: u, className: p, onSelect: $, children: [
|
|
179
|
+
d,
|
|
180
|
+
a,
|
|
181
|
+
h
|
|
182
|
+
] }), e[15] = $, e[16] = u, e[17] = d, e[18] = a, e[19] = h, e[20] = v) : v = e[20], v;
|
|
183
|
+
}, We = je.getCountries(), Ye = (r) => {
|
|
184
|
+
if (!r || r.length === 0)
|
|
185
|
+
return We.map((t) => ({
|
|
186
|
+
value: t,
|
|
187
|
+
label: new Intl.DisplayNames(["en"], {
|
|
188
|
+
type: "region"
|
|
189
|
+
}).of(t) ?? t,
|
|
190
|
+
countryCode: `+${q(t)}`
|
|
191
|
+
}));
|
|
192
|
+
const e = r[0];
|
|
193
|
+
return e && typeof e == "object" && "countryId" in e ? r.map((t) => ({
|
|
194
|
+
value: t,
|
|
195
|
+
label: t.countryName,
|
|
196
|
+
countryCode: t.countryCode
|
|
197
|
+
})) : r.map((t) => ({
|
|
198
|
+
value: t,
|
|
199
|
+
label: new Intl.DisplayNames(["en"], {
|
|
200
|
+
type: "region"
|
|
201
|
+
}).of(t) ?? t,
|
|
202
|
+
countryCode: `+${q(t)}`
|
|
203
|
+
}));
|
|
204
|
+
};
|
|
205
|
+
function ct(r) {
|
|
206
|
+
const e = he(110);
|
|
207
|
+
let t, s, l, n, o, x, f, C, $, w, y, u, p, d, a, h, v, I, D, O;
|
|
208
|
+
e[0] !== r ? ({
|
|
209
|
+
label: w,
|
|
210
|
+
helperText: C,
|
|
211
|
+
error: f,
|
|
212
|
+
required: v,
|
|
213
|
+
className: s,
|
|
214
|
+
"aria-describedby": t,
|
|
215
|
+
id: $,
|
|
216
|
+
value: D,
|
|
217
|
+
onPhoneChange: p,
|
|
218
|
+
countryCode: n,
|
|
219
|
+
onCountryCodeChange: u,
|
|
220
|
+
onValuesChange: a,
|
|
221
|
+
onCountryChange: y,
|
|
222
|
+
onValueChange: d,
|
|
223
|
+
countries: l,
|
|
224
|
+
defaultCountry: o,
|
|
225
|
+
variant: O,
|
|
226
|
+
disabled: x,
|
|
227
|
+
placeholder: h,
|
|
228
|
+
...I
|
|
229
|
+
} = r, e[0] = r, e[1] = t, e[2] = s, e[3] = l, e[4] = n, e[5] = o, e[6] = x, e[7] = f, e[8] = C, e[9] = $, e[10] = w, e[11] = y, e[12] = u, e[13] = p, e[14] = d, e[15] = a, e[16] = h, e[17] = v, e[18] = I, e[19] = D, e[20] = O) : (t = e[1], s = e[2], l = e[3], n = e[4], o = e[5], x = e[6], f = e[7], C = e[8], $ = e[9], w = e[10], y = e[11], u = e[12], p = e[13], d = e[14], a = e[15], h = e[16], v = e[17], I = e[18], D = e[19], O = e[20]);
|
|
230
|
+
const g = D === void 0 ? "" : D, V = O === void 0 ? "default" : O, z = R.useId(), S = R.useId(), M = R.useRef(null), k = $ ?? z, _ = !!(C || f);
|
|
231
|
+
let A;
|
|
232
|
+
e[21] !== t || e[22] !== _ || e[23] !== S ? (A = [t, _ ? S : void 0].filter(Boolean).join(" ") || void 0, e[21] = t, e[22] = _, e[23] = S, e[24] = A) : A = e[24];
|
|
233
|
+
const G = A, j = !!f, P = V === "flag";
|
|
234
|
+
let E;
|
|
235
|
+
e[25] !== l ? (E = Ye(l), e[25] = l, e[26] = E) : E = e[26];
|
|
236
|
+
const m = E;
|
|
237
|
+
let B;
|
|
238
|
+
e[27] !== l || e[28] !== m || e[29] !== o || e[30] !== g ? (B = () => {
|
|
239
|
+
const b = _e(String(g ?? "").trim());
|
|
240
|
+
if (b) {
|
|
241
|
+
const N = Ie(m, b.callingCode, void 0);
|
|
242
|
+
if (N)
|
|
243
|
+
return N;
|
|
244
|
+
}
|
|
245
|
+
return o == null ? l && l.length > 0 ? l[0] : "IN" : typeof o == "number" && l && l[o] ? l[o] : o;
|
|
246
|
+
}, e[27] = l, e[28] = m, e[29] = o, e[30] = g, e[31] = B) : B = e[31];
|
|
247
|
+
const F = B;
|
|
248
|
+
let L;
|
|
249
|
+
e[32] !== F ? (L = () => F(), e[32] = F, e[33] = L) : L = e[33];
|
|
250
|
+
const [i, X] = R.useState(L);
|
|
251
|
+
let H;
|
|
252
|
+
e[34] !== l || e[35] !== o ? (H = () => {
|
|
253
|
+
o != null && (typeof o == "number" && l && l[o] ? X(l[o]) : typeof o != "number" && X(o));
|
|
254
|
+
}, e[34] = l, e[35] = o, e[36] = H) : H = e[36];
|
|
255
|
+
let oe;
|
|
256
|
+
e[37] !== o ? (oe = [o], e[37] = o, e[38] = oe) : oe = e[38], R.useEffect(H, oe);
|
|
257
|
+
const U = n !== void 0;
|
|
258
|
+
let le, ne;
|
|
259
|
+
e[39] !== U || e[40] !== u || e[41] !== i ? (ne = () => {
|
|
260
|
+
if (!U && i) {
|
|
261
|
+
const b = q(i);
|
|
262
|
+
u == null || u(b);
|
|
263
|
+
}
|
|
264
|
+
}, le = [i, U, u], e[39] = U, e[40] = u, e[41] = i, e[42] = le, e[43] = ne) : (le = e[42], ne = e[43]), R.useEffect(ne, le);
|
|
265
|
+
let se, ie;
|
|
266
|
+
e[44] !== n || e[45] !== m || e[46] !== U || e[47] !== i ? (se = () => {
|
|
267
|
+
if (!U)
|
|
268
|
+
return;
|
|
269
|
+
const b = re(String(n ?? ""));
|
|
270
|
+
if (b === "")
|
|
271
|
+
return;
|
|
272
|
+
const N = Ie(m, b, i);
|
|
273
|
+
N && !Fe(N, i) && X(N);
|
|
274
|
+
}, ie = [n, m, U, i], e[44] = n, e[45] = m, e[46] = U, e[47] = i, e[48] = se, e[49] = ie) : (se = e[48], ie = e[49]), R.useEffect(se, ie);
|
|
275
|
+
let ae, ce;
|
|
276
|
+
e[50] !== m || e[51] !== i || e[52] !== g ? (ae = () => {
|
|
277
|
+
const b = _e(String(g ?? "").trim());
|
|
278
|
+
if (!b)
|
|
279
|
+
return;
|
|
280
|
+
const N = Ie(m, b.callingCode, i);
|
|
281
|
+
N && !Fe(N, i) && X(N);
|
|
282
|
+
}, ce = [g, m, i], e[50] = m, e[51] = i, e[52] = g, e[53] = ae, e[54] = ce) : (ae = e[53], ce = e[54]), R.useEffect(ae, ce);
|
|
283
|
+
let de;
|
|
284
|
+
e[55] !== g ? (de = De(g), e[55] = g, e[56] = de) : de = e[56];
|
|
285
|
+
const fe = de;
|
|
286
|
+
let ue;
|
|
287
|
+
e[57] !== fe || e[58] !== y || e[59] !== u || e[60] !== d || e[61] !== a ? (ue = (b) => {
|
|
288
|
+
X(b);
|
|
289
|
+
const N = q(b);
|
|
290
|
+
u == null || u(N), y == null || y(b), a == null || a([N, fe]), d == null || d(Oe(fe, b));
|
|
291
|
+
}, e[57] = fe, e[58] = y, e[59] = u, e[60] = d, e[61] = a, e[62] = ue) : ue = e[62];
|
|
292
|
+
const ge = ue;
|
|
293
|
+
let me;
|
|
294
|
+
e[63] !== n || e[64] !== p || e[65] !== d || e[66] !== a || e[67] !== i ? (me = (b) => {
|
|
295
|
+
const N = b.target.value, Ne = re(N);
|
|
296
|
+
p == null || p(Ne);
|
|
297
|
+
const Ee = n ?? q(i);
|
|
298
|
+
a == null || a([Ee, Ne]), d == null || d(Oe(Ne, i));
|
|
299
|
+
}, e[63] = n, e[64] = p, e[65] = d, e[66] = a, e[67] = i, e[68] = me) : me = e[68];
|
|
300
|
+
const be = me;
|
|
301
|
+
let pe;
|
|
302
|
+
e[69] !== g ? (pe = De(g), e[69] = g, e[70] = pe) : pe = e[70];
|
|
303
|
+
const ve = pe;
|
|
304
|
+
let J;
|
|
305
|
+
e[71] !== s ? (J = te("space-y-1", s), e[71] = s, e[72] = J) : J = e[72];
|
|
306
|
+
let K;
|
|
307
|
+
e[73] !== w || e[74] !== v || e[75] !== k ? (K = w && /* @__PURE__ */ T(qe, { htmlFor: k, className: "text-sm font-medium text-foreground", children: [
|
|
308
|
+
w,
|
|
309
|
+
v && /* @__PURE__ */ c("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
|
|
310
|
+
] }), e[73] = w, e[74] = v, e[75] = k, e[76] = K) : K = e[76];
|
|
311
|
+
let Q;
|
|
312
|
+
e[77] !== m || e[78] !== x || e[79] !== ge || e[80] !== j || e[81] !== i || e[82] !== P ? (Q = /* @__PURE__ */ c(Ke, { disabled: x, value: i, options: m, onChange: ge, showFlagVariant: P, hasError: j, popoverAnchorRef: M }), e[77] = m, e[78] = x, e[79] = ge, e[80] = j, e[81] = i, e[82] = P, e[83] = Q) : Q = e[83];
|
|
313
|
+
const xe = v || void 0, Ce = j || void 0, we = j ? "border-destructive" : "border-gray-300";
|
|
314
|
+
let W;
|
|
315
|
+
e[84] !== we ? (W = te("h-[40px] rounded-r-md rounded-l-none border-t-[1px] border-b-[1px] border-l-[1px] bg-white px-3 py-[1px] text-sm", we), e[84] = we, e[85] = W) : W = e[85];
|
|
316
|
+
let Y;
|
|
317
|
+
e[86] !== G || e[87] !== x || e[88] !== be || e[89] !== ve || e[90] !== h || e[91] !== k || e[92] !== I || e[93] !== xe || e[94] !== Ce || e[95] !== W ? (Y = /* @__PURE__ */ c(Ue, { ...I, ref: void 0, id: k, type: "text", inputMode: "numeric", value: ve, onChange: be, disabled: x, placeholder: h, "aria-required": xe, "aria-invalid": Ce, "aria-describedby": G, className: W }), e[86] = G, e[87] = x, e[88] = be, e[89] = ve, e[90] = h, e[91] = k, e[92] = I, e[93] = xe, e[94] = Ce, e[95] = W, e[96] = Y) : Y = e[96];
|
|
318
|
+
let Z;
|
|
319
|
+
e[97] !== Q || e[98] !== Y ? (Z = /* @__PURE__ */ T("div", { ref: M, className: "flex w-full min-w-0 items-center", children: [
|
|
320
|
+
Q,
|
|
321
|
+
Y
|
|
322
|
+
] }), e[97] = Q, e[98] = Y, e[99] = Z) : Z = e[99];
|
|
323
|
+
let ee;
|
|
324
|
+
e[100] !== f || e[101] !== _ || e[102] !== S || e[103] !== C ? (ee = _ && /* @__PURE__ */ c("p", { id: S, className: te("text-xs", f ? "text-destructive" : "text-muted-foreground"), role: f ? "alert" : void 0, children: f || C }), e[100] = f, e[101] = _, e[102] = S, e[103] = C, e[104] = ee) : ee = e[104];
|
|
325
|
+
let ye;
|
|
326
|
+
return e[105] !== J || e[106] !== K || e[107] !== Z || e[108] !== ee ? (ye = /* @__PURE__ */ T("div", { className: J, children: [
|
|
327
|
+
K,
|
|
328
|
+
Z,
|
|
329
|
+
ee
|
|
330
|
+
] }), e[105] = J, e[106] = K, e[107] = Z, e[108] = ee, e[109] = ye) : ye = e[109], ye;
|
|
331
|
+
}
|
|
332
|
+
export {
|
|
333
|
+
ct as DoctPhoneInput,
|
|
334
|
+
ut as isPossiblePhoneNumber,
|
|
335
|
+
mt as isValidPhoneNumber
|
|
336
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { c as v } from "react-compiler-runtime";
|
|
4
|
+
import { IndividualNavigationMenu as l } from "./individual-navigation-menu.js";
|
|
5
|
+
import { OrganizationNavigationMenu as m } from "./organization-navigation-menu.js";
|
|
6
|
+
function M(u) {
|
|
7
|
+
const i = v(8), {
|
|
8
|
+
groups: t,
|
|
9
|
+
className: n,
|
|
10
|
+
isMobileOverride: o,
|
|
11
|
+
variant: e
|
|
12
|
+
} = u;
|
|
13
|
+
if ((e === void 0 ? "individual" : e) === "organization") {
|
|
14
|
+
let a;
|
|
15
|
+
return i[0] !== n || i[1] !== t || i[2] !== o ? (a = /* @__PURE__ */ s(m, { groups: t, className: n, isMobileOverride: o }), i[0] = n, i[1] = t, i[2] = o, i[3] = a) : a = i[3], a;
|
|
16
|
+
}
|
|
17
|
+
let r;
|
|
18
|
+
return i[4] !== n || i[5] !== t || i[6] !== o ? (r = /* @__PURE__ */ s(l, { groups: t, className: n, isMobileOverride: o }), i[4] = n, i[5] = t, i[6] = o, i[7] = r) : r = i[7], r;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
M as DoctNavigationMenu
|
|
22
|
+
};
|