docthub-core-components 3.3.11 → 3.3.14

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