docthub-core-components 3.3.16 → 3.3.17
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/inputs/phone-input.js +261 -270
- package/dist/components/overrides/ui/mobile-number-dialog/mobile-number-dialog.js +347 -335
- package/dist/index.js +32 -35
- package/dist/src/components/overrides/ui/inputs/phone-input.d.ts +22 -8
- package/dist/src/components/overrides/ui/mobile-number-dialog/mobile-number-dialog.d.ts +1 -1
- package/dist/src/components/overrides/ui/mobile-number-dialog/types.d.ts +9 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -1,205 +1,195 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import { DoctTypography as _e } from "../../../ui/typography.js";
|
|
15
|
-
const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
|
|
2
|
+
import { jsx as c, jsxs as G, Fragment as Ee } from "react/jsx-runtime";
|
|
3
|
+
import { c as je } from "react-compiler-runtime";
|
|
4
|
+
import { getCountries as Pe, getCountryCallingCode as ke } from "libphonenumber-js";
|
|
5
|
+
import { ChevronsUpDown as Ge, CheckIcon as Ue } from "lucide-react";
|
|
6
|
+
import * as A from "react";
|
|
7
|
+
import { CommandList as Ve, CommandEmpty as ze, CommandGroup as Xe, CommandInput as qe, Command as Me, CommandItem as He } from "../../../ui/command.js";
|
|
8
|
+
import { Input as Ze } from "../../../ui/input.js";
|
|
9
|
+
import { Label as Je } from "../../../ui/label.js";
|
|
10
|
+
import { PopoverTrigger as Ke, PopoverContent as Qe, Popover as We } from "../../../ui/popover.js";
|
|
11
|
+
import { cn as te } from "../../../../lib/utils.js";
|
|
12
|
+
import { DoctTypography as $e } from "../../../ui/typography.js";
|
|
13
|
+
const Ye = /\D/g, re = (r) => r.replace(Ye, ""), Oe = (r) => {
|
|
16
14
|
const e = r.match(/^\+\s*(\d+)\s*-\s*(\d*)\s*$/);
|
|
17
15
|
return e ? {
|
|
18
16
|
callingCode: e[1],
|
|
19
17
|
national: e[2]
|
|
20
18
|
} : null;
|
|
21
|
-
},
|
|
19
|
+
}, Ae = (r) => {
|
|
22
20
|
if (r == null) return "";
|
|
23
|
-
const e = String(r).trim(), t =
|
|
24
|
-
return t ? t.national :
|
|
25
|
-
},
|
|
21
|
+
const e = String(r).trim(), t = Oe(e);
|
|
22
|
+
return t ? t.national : re(e);
|
|
23
|
+
}, et = /^[A-Za-z]{2}$/, tt = /^\+?\d+$/, z = (r) => {
|
|
26
24
|
if (!r) return "91";
|
|
27
|
-
if (typeof r == "object" && "countryCode" in r)
|
|
28
|
-
|
|
25
|
+
if (typeof r == "object" && "countryCode" in r) {
|
|
26
|
+
const e = String(r.countryCode ?? "").trim();
|
|
27
|
+
if (tt.test(e)) return re(e) || "91";
|
|
28
|
+
if (et.test(e))
|
|
29
|
+
try {
|
|
30
|
+
return ke(e.toUpperCase());
|
|
31
|
+
} catch {
|
|
32
|
+
return "91";
|
|
33
|
+
}
|
|
34
|
+
return "91";
|
|
35
|
+
}
|
|
29
36
|
try {
|
|
30
|
-
return ke
|
|
37
|
+
return ke(r);
|
|
31
38
|
} catch {
|
|
32
39
|
return "91";
|
|
33
40
|
}
|
|
34
|
-
},
|
|
41
|
+
}, Te = (r, e) => {
|
|
35
42
|
if (r == null)
|
|
36
43
|
return e && e.length > 0 ? e[0] : "IN";
|
|
37
44
|
if (typeof r == "number" && (e != null && e.length)) {
|
|
38
45
|
const t = e[0];
|
|
39
46
|
if (t && typeof t == "object" && "countryId" in t) {
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
47
|
+
const i = e.find((l) => l.countryId === r);
|
|
48
|
+
if (i) return i;
|
|
42
49
|
}
|
|
43
50
|
return e[r];
|
|
44
51
|
}
|
|
45
52
|
return r;
|
|
46
|
-
},
|
|
47
|
-
if (!e) return r ? `+${
|
|
48
|
-
const t =
|
|
53
|
+
}, Le = (r, e) => {
|
|
54
|
+
if (!e) return r ? `+${re(r)}` : "";
|
|
55
|
+
const t = z(e);
|
|
49
56
|
return r ? `+${t}-${r}` : `+${t}`;
|
|
50
|
-
},
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return t &&
|
|
54
|
-
},
|
|
55
|
-
const e =
|
|
56
|
-
country: t,
|
|
57
|
-
countryName: o
|
|
58
|
-
} = r, n = Be[t];
|
|
59
|
-
let l;
|
|
60
|
-
e[0] !== n || e[1] !== o ? (l = n && /* @__PURE__ */ a(n, { title: o }), e[0] = n, e[1] = o, e[2] = l) : l = e[2];
|
|
61
|
-
let s;
|
|
62
|
-
return e[3] !== l ? (s = /* @__PURE__ */ a("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: l }), e[3] = l, e[4] = s) : s = e[4], s;
|
|
63
|
-
}, We = (r) => {
|
|
64
|
-
const e = ge(48), {
|
|
57
|
+
}, Re = (r, e) => e ? typeof r == "object" && "countryId" in r && typeof e == "object" && "countryId" in e ? r.countryId === e.countryId : r === e : !1, Fe = (r, e, t) => {
|
|
58
|
+
const i = re(e), l = r.map((o) => o.value).filter((o) => !!o).filter((o) => z(o) === i);
|
|
59
|
+
if (l.length !== 0)
|
|
60
|
+
return t && l.some((o) => Re(o, t)) ? t : l[0];
|
|
61
|
+
}, rt = (r) => {
|
|
62
|
+
const e = je(45), {
|
|
65
63
|
disabled: t,
|
|
66
|
-
value:
|
|
67
|
-
options:
|
|
68
|
-
onChange:
|
|
69
|
-
showFlagVariant:
|
|
70
|
-
hasError:
|
|
71
|
-
popoverAnchorRef:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
let
|
|
77
|
-
e[
|
|
78
|
-
|
|
79
|
-
}, e[2] = i) : i = e[2];
|
|
80
|
-
const d = b ? "border-destructive" : "border-gray-300", C = g && "bg-gray-100";
|
|
81
|
-
let I;
|
|
82
|
-
e[3] !== d || e[4] !== C ? (I = ee("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", d, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", C), e[3] = d, e[4] = C, e[5] = I) : I = e[5];
|
|
64
|
+
value: i,
|
|
65
|
+
options: l,
|
|
66
|
+
onChange: o,
|
|
67
|
+
showFlagVariant: d,
|
|
68
|
+
hasError: C,
|
|
69
|
+
popoverAnchorRef: p,
|
|
70
|
+
loading: v,
|
|
71
|
+
onCountrySearch: f,
|
|
72
|
+
noDataText: w
|
|
73
|
+
} = r, S = A.useRef(null), [y, b] = A.useState(""), [n, x] = A.useState(!1);
|
|
74
|
+
let h;
|
|
75
|
+
e[0] !== i ? (h = i ? `+${z(i)}` : "+91", e[0] = i, e[1] = h) : h = e[1];
|
|
76
|
+
const g = h, I = !!f;
|
|
83
77
|
let _;
|
|
84
|
-
e[
|
|
85
|
-
|
|
86
|
-
e[
|
|
87
|
-
const
|
|
78
|
+
e[2] !== f || e[3] !== y ? (_ = (O) => {
|
|
79
|
+
x(O), O && (y && (f == null || f("")), b(""));
|
|
80
|
+
}, e[2] = f, e[3] = y, e[4] = _) : _ = e[4];
|
|
81
|
+
const R = C ? "border-destructive" : "border-gray-300", T = n && "bg-gray-100";
|
|
82
|
+
let F;
|
|
83
|
+
e[5] !== R || e[6] !== T ? (F = 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", R, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", T), e[5] = R, e[6] = T, e[7] = F) : F = e[7];
|
|
84
|
+
let E;
|
|
85
|
+
e[8] !== g ? (E = /* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900", children: g }), e[8] = g, e[9] = E) : E = e[9];
|
|
86
|
+
const U = t && "hidden";
|
|
88
87
|
let u;
|
|
89
|
-
e[
|
|
90
|
-
let
|
|
91
|
-
e[
|
|
92
|
-
let
|
|
93
|
-
e[
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
e[21] === Symbol.for("react.memo_cache_sentinel") ? (O = {
|
|
88
|
+
e[10] !== U ? (u = te("h-4 w-4 text-gray-500 shrink-0", U), e[10] = U, e[11] = u) : u = e[11];
|
|
89
|
+
let X;
|
|
90
|
+
e[12] !== u ? (X = /* @__PURE__ */ c(Ge, { className: u }), e[12] = u, e[13] = X) : X = e[13];
|
|
91
|
+
let L;
|
|
92
|
+
e[14] !== t || e[15] !== F || e[16] !== E || e[17] !== X ? (L = /* @__PURE__ */ c(Ke, { asChild: !0, children: /* @__PURE__ */ G("button", { type: "button", disabled: t, className: F, children: [
|
|
93
|
+
E,
|
|
94
|
+
X
|
|
95
|
+
] }) }), e[14] = t, e[15] = F, e[16] = E, e[17] = X, e[18] = L) : L = e[18];
|
|
96
|
+
let M;
|
|
97
|
+
e[19] === Symbol.for("react.memo_cache_sentinel") ? (M = {
|
|
100
98
|
side: "flip",
|
|
101
99
|
align: "shift",
|
|
102
100
|
fallbackAxisSide: "none"
|
|
103
|
-
}, e[
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
}, e[19] = M) : M = e[19];
|
|
102
|
+
const B = !I;
|
|
103
|
+
let V;
|
|
104
|
+
e[20] !== f ? (V = (O) => {
|
|
105
|
+
b(O), f == null || f(O), window.setTimeout(() => {
|
|
106
|
+
const s = S.current;
|
|
107
|
+
s && (s.scrollTop = 0);
|
|
109
108
|
}, 0);
|
|
110
|
-
}, e[
|
|
111
|
-
let
|
|
112
|
-
e[23] !==
|
|
113
|
-
let R, V;
|
|
114
|
-
e[25] === Symbol.for("react.memo_cache_sentinel") ? (R = {
|
|
115
|
-
msOverflowStyle: "none"
|
|
116
|
-
}, V = /* @__PURE__ */ a(Ve, { children: "No country found." }), e[25] = R, e[26] = V) : (R = e[25], V = e[26]);
|
|
117
|
-
let T;
|
|
118
|
-
if (e[27] !== n || e[28] !== l || e[29] !== o || e[30] !== s) {
|
|
119
|
-
let S;
|
|
120
|
-
e[32] !== l || e[33] !== o || e[34] !== s ? (S = (U) => {
|
|
121
|
-
const {
|
|
122
|
-
value: E,
|
|
123
|
-
label: f,
|
|
124
|
-
countryCode: X
|
|
125
|
-
} = U;
|
|
126
|
-
return E ? /* @__PURE__ */ a(Ye, { country: E, countryName: f, countryCode: X, selectedCountry: o, onChange: l, onSelectComplete: () => x(!1), showFlagVariant: s }, typeof E == "object" && "countryId" in E ? E.countryId : E) : null;
|
|
127
|
-
}, e[32] = l, e[33] = o, e[34] = s, e[35] = S) : S = e[35], T = n.map(S), e[27] = n, e[28] = l, e[29] = o, e[30] = s, e[31] = T;
|
|
128
|
-
} else
|
|
129
|
-
T = e[31];
|
|
109
|
+
}, e[20] = f, e[21] = V) : V = e[21];
|
|
110
|
+
let D;
|
|
111
|
+
e[22] !== y || e[23] !== V ? (D = /* @__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(qe, { value: y, onValueChange: V, placeholder: "Search country..." }) }), e[22] = y, e[23] = V, e[24] = D) : D = e[24];
|
|
130
112
|
let j;
|
|
131
|
-
e[
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
] }) }), e[36] = T, e[37] = j) : j = e[37];
|
|
135
|
-
let A;
|
|
136
|
-
e[38] !== F || e[39] !== j ? (A = /* @__PURE__ */ B(Ue, { children: [
|
|
137
|
-
F,
|
|
138
|
-
j
|
|
139
|
-
] }), e[38] = F, e[39] = j, e[40] = A) : A = e[40];
|
|
113
|
+
e[25] === Symbol.for("react.memo_cache_sentinel") ? (j = {
|
|
114
|
+
msOverflowStyle: "none"
|
|
115
|
+
}, e[25] = j) : j = e[25];
|
|
140
116
|
let k;
|
|
141
|
-
e[
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
117
|
+
e[26] !== l || e[27] !== v || e[28] !== w || e[29] !== o || e[30] !== i || e[31] !== d ? (k = /* @__PURE__ */ c(Ve, { children: /* @__PURE__ */ c("div", { ref: S, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: j, children: v ? /* @__PURE__ */ c("div", { className: "py-6 text-center text-sm text-gray-500", children: "Loading…" }) : /* @__PURE__ */ G(Ee, { children: [
|
|
118
|
+
/* @__PURE__ */ c(ze, { children: w }),
|
|
119
|
+
/* @__PURE__ */ c(Xe, { children: l.map((O) => {
|
|
120
|
+
const {
|
|
121
|
+
value: s,
|
|
122
|
+
label: H,
|
|
123
|
+
countryCode: le
|
|
124
|
+
} = O;
|
|
125
|
+
return s ? /* @__PURE__ */ c(lt, { country: s, countryName: H, countryCode: le, selectedCountry: i, onChange: o, onSelectComplete: () => x(!1), showFlagVariant: d }, typeof s == "object" && "countryId" in s ? s.countryId : s) : null;
|
|
126
|
+
}) })
|
|
127
|
+
] }) }) }), e[26] = l, e[27] = v, e[28] = w, e[29] = o, e[30] = i, e[31] = d, e[32] = k) : k = e[32];
|
|
128
|
+
let P;
|
|
129
|
+
e[33] !== B || e[34] !== D || e[35] !== k ? (P = /* @__PURE__ */ G(Me, { shouldFilter: B, children: [
|
|
130
|
+
D,
|
|
145
131
|
k
|
|
146
|
-
] }), e[
|
|
147
|
-
|
|
148
|
-
|
|
132
|
+
] }), e[33] = B, e[34] = D, e[35] = k, e[36] = P) : P = e[36];
|
|
133
|
+
let $;
|
|
134
|
+
e[37] !== p || e[38] !== P ? ($ = /* @__PURE__ */ c(Qe, { anchor: p, 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: P }), e[37] = p, e[38] = P, e[39] = $) : $ = e[39];
|
|
135
|
+
let q;
|
|
136
|
+
return e[40] !== n || e[41] !== L || e[42] !== $ || e[43] !== _ ? (q = /* @__PURE__ */ G(We, { open: n, modal: !0, onOpenChange: _, children: [
|
|
137
|
+
L,
|
|
138
|
+
$
|
|
139
|
+
] }), e[40] = n, e[41] = L, e[42] = $, e[43] = _, e[44] = q) : q = e[44], q;
|
|
140
|
+
}, lt = (r) => {
|
|
141
|
+
const e = je(16), {
|
|
149
142
|
country: t,
|
|
150
|
-
countryName:
|
|
151
|
-
countryCode:
|
|
152
|
-
selectedCountry:
|
|
153
|
-
onChange:
|
|
154
|
-
onSelectComplete:
|
|
155
|
-
showFlagVariant:
|
|
143
|
+
countryName: i,
|
|
144
|
+
countryCode: l,
|
|
145
|
+
selectedCountry: o,
|
|
146
|
+
onChange: d,
|
|
147
|
+
onSelectComplete: C,
|
|
148
|
+
showFlagVariant: p
|
|
156
149
|
} = r;
|
|
157
150
|
let v;
|
|
158
|
-
e[0] !== t || e[1] !==
|
|
159
|
-
|
|
160
|
-
}, e[0] = t, e[1] =
|
|
161
|
-
const
|
|
162
|
-
let
|
|
151
|
+
e[0] !== t || e[1] !== d || e[2] !== C ? (v = () => {
|
|
152
|
+
d(t), C();
|
|
153
|
+
}, e[0] = t, e[1] = d, e[2] = C, e[3] = v) : v = e[3];
|
|
154
|
+
const f = v;
|
|
155
|
+
let w;
|
|
163
156
|
e: {
|
|
164
|
-
if (!
|
|
165
|
-
|
|
157
|
+
if (!o) {
|
|
158
|
+
w = !1;
|
|
166
159
|
break e;
|
|
167
160
|
}
|
|
168
|
-
if (typeof t == "object" && "countryId" in t && typeof
|
|
169
|
-
|
|
161
|
+
if (typeof t == "object" && "countryId" in t && typeof o == "object" && "countryId" in o) {
|
|
162
|
+
w = t.countryId === o.countryId;
|
|
170
163
|
break e;
|
|
171
164
|
}
|
|
172
|
-
|
|
165
|
+
w = t === o;
|
|
173
166
|
}
|
|
174
|
-
const
|
|
175
|
-
let
|
|
176
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
177
|
-
let
|
|
178
|
-
e[5] !==
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
let
|
|
188
|
-
e[13] !==
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
d
|
|
194
|
-
] }), e[15] = $, e[16] = x, e[17] = y, e[18] = i, e[19] = d, e[20] = C) : C = e[20], C;
|
|
195
|
-
}, Ze = ke.getCountries(), et = (r) => {
|
|
167
|
+
const S = w, y = `${i} ${l}`;
|
|
168
|
+
let b;
|
|
169
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (b = 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] = b) : b = e[4];
|
|
170
|
+
let n;
|
|
171
|
+
e[5] !== l || e[6] !== i || e[7] !== p ? (n = p ? /* @__PURE__ */ G(Ee, { children: [
|
|
172
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: i }),
|
|
173
|
+
/* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: l })
|
|
174
|
+
] }) : /* @__PURE__ */ G(Ee, { children: [
|
|
175
|
+
/* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: l }),
|
|
176
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: i })
|
|
177
|
+
] }), e[5] = l, e[6] = i, e[7] = p, e[8] = n) : n = e[8];
|
|
178
|
+
let x;
|
|
179
|
+
e[9] !== S ? (x = S && /* @__PURE__ */ c(Ue, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[9] = S, e[10] = x) : x = e[10];
|
|
180
|
+
let h;
|
|
181
|
+
return e[11] !== f || e[12] !== y || e[13] !== n || e[14] !== x ? (h = /* @__PURE__ */ G(He, { value: y, className: b, onSelect: f, children: [
|
|
182
|
+
n,
|
|
183
|
+
x
|
|
184
|
+
] }), e[11] = f, e[12] = y, e[13] = n, e[14] = x, e[15] = h) : h = e[15], h;
|
|
185
|
+
}, ot = Pe(), nt = (r) => {
|
|
196
186
|
if (r === void 0)
|
|
197
|
-
return
|
|
187
|
+
return ot.map((t) => ({
|
|
198
188
|
value: t,
|
|
199
189
|
label: new Intl.DisplayNames(["en"], {
|
|
200
190
|
type: "region"
|
|
201
191
|
}).of(t) ?? t,
|
|
202
|
-
countryCode: `+${
|
|
192
|
+
countryCode: `+${z(t)}`
|
|
203
193
|
}));
|
|
204
194
|
if (r.length === 0)
|
|
205
195
|
return [];
|
|
@@ -207,146 +197,147 @@ const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
|
|
|
207
197
|
return e && typeof e == "object" && "countryId" in e ? r.map((t) => ({
|
|
208
198
|
value: t,
|
|
209
199
|
label: t.countryName,
|
|
210
|
-
countryCode: t
|
|
200
|
+
countryCode: `+${z(t)}`
|
|
211
201
|
})) : r.map((t) => ({
|
|
212
202
|
value: t,
|
|
213
203
|
label: new Intl.DisplayNames(["en"], {
|
|
214
204
|
type: "region"
|
|
215
205
|
}).of(t) ?? t,
|
|
216
|
-
countryCode: `+${
|
|
206
|
+
countryCode: `+${z(t)}`
|
|
217
207
|
}));
|
|
218
208
|
};
|
|
219
|
-
function
|
|
220
|
-
const e =
|
|
221
|
-
let t,
|
|
209
|
+
function yt(r) {
|
|
210
|
+
const e = je(116);
|
|
211
|
+
let t, i, l, o, d, C, p, v, f, w, S, y, b, n, x, h, g, I, _, R, T, F, E, U;
|
|
222
212
|
e[0] !== r ? ({
|
|
223
|
-
label:
|
|
213
|
+
label: S,
|
|
224
214
|
helperText: v,
|
|
225
|
-
error:
|
|
226
|
-
required:
|
|
227
|
-
className:
|
|
215
|
+
error: p,
|
|
216
|
+
required: R,
|
|
217
|
+
className: i,
|
|
228
218
|
"aria-describedby": t,
|
|
229
|
-
id:
|
|
230
|
-
value:
|
|
231
|
-
onPhoneChange:
|
|
232
|
-
countryCode:
|
|
233
|
-
onCountryCodeChange:
|
|
234
|
-
onValuesChange:
|
|
235
|
-
onCountryChange:
|
|
236
|
-
onValueChange:
|
|
237
|
-
countries:
|
|
238
|
-
defaultCountry:
|
|
239
|
-
variant:
|
|
240
|
-
disabled:
|
|
241
|
-
placeholder:
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
e[
|
|
248
|
-
const
|
|
219
|
+
id: f,
|
|
220
|
+
value: F,
|
|
221
|
+
onPhoneChange: h,
|
|
222
|
+
countryCode: o,
|
|
223
|
+
onCountryCodeChange: n,
|
|
224
|
+
onValuesChange: I,
|
|
225
|
+
onCountryChange: b,
|
|
226
|
+
onValueChange: g,
|
|
227
|
+
countries: l,
|
|
228
|
+
defaultCountry: d,
|
|
229
|
+
variant: E,
|
|
230
|
+
disabled: C,
|
|
231
|
+
placeholder: _,
|
|
232
|
+
loading: y,
|
|
233
|
+
onCountrySearch: x,
|
|
234
|
+
noDataText: U,
|
|
235
|
+
inputRef: w,
|
|
236
|
+
...T
|
|
237
|
+
} = r, e[0] = r, e[1] = t, e[2] = i, e[3] = l, e[4] = o, e[5] = d, e[6] = C, e[7] = p, e[8] = v, e[9] = f, e[10] = w, e[11] = S, e[12] = y, e[13] = b, e[14] = n, e[15] = x, e[16] = h, e[17] = g, e[18] = I, e[19] = _, e[20] = R, e[21] = T, e[22] = F, e[23] = E, e[24] = U) : (t = e[1], i = e[2], l = e[3], o = e[4], d = e[5], C = e[6], p = e[7], v = e[8], f = e[9], w = e[10], S = e[11], y = e[12], b = e[13], n = e[14], x = e[15], h = e[16], g = e[17], I = e[18], _ = e[19], R = e[20], T = e[21], F = e[22], E = e[23], U = e[24]);
|
|
238
|
+
const u = F === void 0 ? "" : F, X = E === void 0 ? "default" : E, L = U === void 0 ? "No data found" : U, M = A.useId(), B = A.useId(), V = A.useRef(null), D = f ?? M, j = !!(v || p);
|
|
249
239
|
let k;
|
|
250
|
-
e[26] !==
|
|
251
|
-
const
|
|
252
|
-
let
|
|
253
|
-
e[
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
240
|
+
e[25] !== t || e[26] !== j || e[27] !== B ? (k = [t, j ? B : void 0].filter(Boolean).join(" ") || void 0, e[25] = t, e[26] = j, e[27] = B, e[28] = k) : k = e[28];
|
|
241
|
+
const P = k, $ = !!p, q = X === "flag";
|
|
242
|
+
let O;
|
|
243
|
+
e[29] !== l ? (O = nt(l), e[29] = l, e[30] = O) : O = e[30];
|
|
244
|
+
const s = O;
|
|
245
|
+
let H;
|
|
246
|
+
e[31] !== l || e[32] !== s || e[33] !== d || e[34] !== u ? (H = () => {
|
|
247
|
+
const m = Oe(String(u ?? "").trim());
|
|
248
|
+
if (m) {
|
|
249
|
+
const N = Fe(s, m.callingCode, void 0);
|
|
250
|
+
if (N)
|
|
251
|
+
return N;
|
|
259
252
|
}
|
|
260
|
-
return
|
|
261
|
-
}, e[
|
|
262
|
-
const
|
|
263
|
-
let
|
|
264
|
-
e[
|
|
265
|
-
const [
|
|
266
|
-
let
|
|
267
|
-
e[
|
|
268
|
-
if (
|
|
269
|
-
const
|
|
270
|
-
|
|
253
|
+
return Te(d, l);
|
|
254
|
+
}, e[31] = l, e[32] = s, e[33] = d, e[34] = u, e[35] = H) : H = e[35];
|
|
255
|
+
const le = H;
|
|
256
|
+
let oe;
|
|
257
|
+
e[36] !== le ? (oe = () => le(), e[36] = le, e[37] = oe) : oe = e[37];
|
|
258
|
+
const [a, ne] = A.useState(oe);
|
|
259
|
+
let ie, se;
|
|
260
|
+
e[38] !== l || e[39] !== d ? (ie = () => {
|
|
261
|
+
if (d != null) {
|
|
262
|
+
const m = Te(d, l);
|
|
263
|
+
m && ne(m);
|
|
271
264
|
}
|
|
272
|
-
},
|
|
273
|
-
const
|
|
274
|
-
let
|
|
275
|
-
e[
|
|
276
|
-
if (!
|
|
265
|
+
}, se = [d, l], e[38] = l, e[39] = d, e[40] = ie, e[41] = se) : (ie = e[40], se = e[41]), A.useEffect(ie, se);
|
|
266
|
+
const ae = o !== void 0;
|
|
267
|
+
let ce, de;
|
|
268
|
+
e[42] !== n || e[43] !== a ? (ce = () => {
|
|
269
|
+
if (!a)
|
|
277
270
|
return;
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
let
|
|
282
|
-
e[
|
|
283
|
-
if (!
|
|
271
|
+
const m = z(a);
|
|
272
|
+
n == null || n(m);
|
|
273
|
+
}, de = [a, n], e[42] = n, e[43] = a, e[44] = ce, e[45] = de) : (ce = e[44], de = e[45]), A.useEffect(ce, de);
|
|
274
|
+
let fe, ue;
|
|
275
|
+
e[46] !== o || e[47] !== s || e[48] !== ae || e[49] !== a ? (fe = () => {
|
|
276
|
+
if (!ae)
|
|
284
277
|
return;
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
278
|
+
const m = re(String(o ?? ""));
|
|
279
|
+
if (m === "")
|
|
287
280
|
return;
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
},
|
|
291
|
-
let
|
|
292
|
-
e[
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
281
|
+
const N = Fe(s, m, a);
|
|
282
|
+
N && !Re(N, a) && ne(N);
|
|
283
|
+
}, ue = [o, s, ae, a], e[46] = o, e[47] = s, e[48] = ae, e[49] = a, e[50] = fe, e[51] = ue) : (fe = e[50], ue = e[51]), A.useEffect(fe, ue);
|
|
284
|
+
let me, pe;
|
|
285
|
+
e[52] !== s || e[53] !== a || e[54] !== u ? (me = () => {
|
|
286
|
+
const m = Oe(String(u ?? "").trim());
|
|
287
|
+
if (!m)
|
|
295
288
|
return;
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
let
|
|
300
|
-
e[
|
|
301
|
-
const
|
|
302
|
-
let
|
|
303
|
-
e[
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
}, e[
|
|
308
|
-
const
|
|
309
|
-
let
|
|
310
|
-
e[
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
}, e[
|
|
316
|
-
const
|
|
317
|
-
let
|
|
318
|
-
e[
|
|
319
|
-
const
|
|
320
|
-
let
|
|
321
|
-
e[
|
|
289
|
+
const N = Fe(s, m.callingCode, a);
|
|
290
|
+
N && !Re(N, a) && ne(N);
|
|
291
|
+
}, pe = [u, s, a], e[52] = s, e[53] = a, e[54] = u, e[55] = me, e[56] = pe) : (me = e[55], pe = e[56]), A.useEffect(me, pe);
|
|
292
|
+
let he;
|
|
293
|
+
e[57] !== u ? (he = Ae(u), e[57] = u, e[58] = he) : he = e[58];
|
|
294
|
+
const ye = he;
|
|
295
|
+
let ge;
|
|
296
|
+
e[59] !== ye || e[60] !== b || e[61] !== n || e[62] !== g || e[63] !== I ? (ge = (m) => {
|
|
297
|
+
ne(m);
|
|
298
|
+
const N = z(m);
|
|
299
|
+
n == null || n(N), b == null || b(m), I == null || I([N, ye]), g == null || g(Le(ye, m));
|
|
300
|
+
}, e[59] = ye, e[60] = b, e[61] = n, e[62] = g, e[63] = I, e[64] = ge) : ge = e[64];
|
|
301
|
+
const Ce = ge;
|
|
302
|
+
let ve;
|
|
303
|
+
e[65] !== o || e[66] !== h || e[67] !== g || e[68] !== I || e[69] !== a ? (ve = (m) => {
|
|
304
|
+
const N = m.target.value, De = re(N);
|
|
305
|
+
h == null || h(De);
|
|
306
|
+
const Be = o ?? z(a);
|
|
307
|
+
I == null || I([Be, De]), g == null || g(Le(De, a));
|
|
308
|
+
}, e[65] = o, e[66] = h, e[67] = g, e[68] = I, e[69] = a, e[70] = ve) : ve = e[70];
|
|
309
|
+
const we = ve;
|
|
310
|
+
let be;
|
|
311
|
+
e[71] !== u ? (be = Ae(u), e[71] = u, e[72] = be) : be = e[72];
|
|
312
|
+
const Ie = be;
|
|
313
|
+
let Z;
|
|
314
|
+
e[73] !== i ? (Z = te("space-y-1", i), e[73] = i, e[74] = Z) : Z = e[74];
|
|
322
315
|
let J;
|
|
323
|
-
e[
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
] }), e[
|
|
316
|
+
e[75] !== S || e[76] !== R || e[77] !== D ? (J = S && /* @__PURE__ */ G(Je, { htmlFor: D, className: "text-sm font-medium text-foreground", children: [
|
|
317
|
+
S,
|
|
318
|
+
R && /* @__PURE__ */ c("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
|
|
319
|
+
] }), e[75] = S, e[76] = R, e[77] = D, e[78] = J) : J = e[78];
|
|
327
320
|
let K;
|
|
328
|
-
e[
|
|
329
|
-
const
|
|
321
|
+
e[79] !== s || e[80] !== C || e[81] !== Ce || e[82] !== $ || e[83] !== y || e[84] !== L || e[85] !== x || e[86] !== a || e[87] !== q ? (K = /* @__PURE__ */ c(rt, { disabled: C, value: a, options: s, onChange: Ce, showFlagVariant: q, hasError: $, popoverAnchorRef: V, loading: y, onCountrySearch: x, noDataText: L }), e[79] = s, e[80] = C, e[81] = Ce, e[82] = $, e[83] = y, e[84] = L, e[85] = x, e[86] = a, e[87] = q, e[88] = K) : K = e[88];
|
|
322
|
+
const Ne = R || void 0, Se = $ || void 0, _e = $ ? "border-destructive" : "border-gray-300";
|
|
330
323
|
let Q;
|
|
331
|
-
e[
|
|
324
|
+
e[89] !== _e ? (Q = 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", _e), e[89] = _e, e[90] = Q) : Q = e[90];
|
|
332
325
|
let W;
|
|
333
|
-
e[
|
|
326
|
+
e[91] !== P || e[92] !== C || e[93] !== we || e[94] !== w || e[95] !== Ie || e[96] !== _ || e[97] !== D || e[98] !== T || e[99] !== Ne || e[100] !== Se || e[101] !== Q ? (W = /* @__PURE__ */ c(Ze, { ...T, ref: w, id: D, type: "text", inputMode: "numeric", value: Ie, onChange: we, disabled: C, placeholder: _, "aria-required": Ne, "aria-invalid": Se, "aria-describedby": P, className: Q }), e[91] = P, e[92] = C, e[93] = we, e[94] = w, e[95] = Ie, e[96] = _, e[97] = D, e[98] = T, e[99] = Ne, e[100] = Se, e[101] = Q, e[102] = W) : W = e[102];
|
|
334
327
|
let Y;
|
|
335
|
-
e[
|
|
328
|
+
e[103] !== K || e[104] !== W ? (Y = /* @__PURE__ */ G("div", { ref: V, className: "flex w-full min-w-0 items-center", children: [
|
|
336
329
|
K,
|
|
337
330
|
W
|
|
338
|
-
] }), e[
|
|
339
|
-
let
|
|
340
|
-
e[
|
|
341
|
-
let
|
|
342
|
-
return e[
|
|
331
|
+
] }), e[103] = K, e[104] = W, e[105] = Y) : Y = e[105];
|
|
332
|
+
let ee;
|
|
333
|
+
e[106] !== p || e[107] !== j || e[108] !== B || e[109] !== v ? (ee = j && /* @__PURE__ */ c("p", { id: B, className: te("text-xs", p ? "text-destructive" : "text-muted-foreground"), role: p ? "alert" : void 0, children: p || v }), e[106] = p, e[107] = j, e[108] = B, e[109] = v, e[110] = ee) : ee = e[110];
|
|
334
|
+
let xe;
|
|
335
|
+
return e[111] !== Z || e[112] !== J || e[113] !== Y || e[114] !== ee ? (xe = /* @__PURE__ */ G("div", { className: Z, children: [
|
|
343
336
|
J,
|
|
344
337
|
Y,
|
|
345
|
-
|
|
346
|
-
] }), e[
|
|
338
|
+
ee
|
|
339
|
+
] }), e[111] = Z, e[112] = J, e[113] = Y, e[114] = ee, e[115] = xe) : xe = e[115], xe;
|
|
347
340
|
}
|
|
348
341
|
export {
|
|
349
|
-
|
|
350
|
-
pt as isPossiblePhoneNumber,
|
|
351
|
-
yt as isValidPhoneNumber
|
|
342
|
+
yt as DoctPhoneInput
|
|
352
343
|
};
|