mainstack-design-system 1.23.0 → 1.23.2

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 (156) hide show
  1. package/dist/index.d.ts +6 -4
  2. package/dist/mainstack-design-system.cjs +1 -1
  3. package/dist/mainstack-design-system.js +20 -20
  4. package/dist/mainstack-design-system17.cjs +1 -1
  5. package/dist/mainstack-design-system17.js +24 -22
  6. package/dist/mainstack-design-system19.cjs +1 -1
  7. package/dist/mainstack-design-system19.js +1 -1
  8. package/dist/mainstack-design-system20.cjs +1 -1
  9. package/dist/mainstack-design-system20.js +1 -1
  10. package/dist/mainstack-design-system25.cjs +1 -1
  11. package/dist/mainstack-design-system25.js +1 -1
  12. package/dist/mainstack-design-system27.cjs +1 -1
  13. package/dist/mainstack-design-system27.js +7 -7
  14. package/dist/mainstack-design-system28.cjs +1 -1
  15. package/dist/mainstack-design-system28.js +27 -25
  16. package/dist/mainstack-design-system29.cjs +1 -1
  17. package/dist/mainstack-design-system29.js +97 -75
  18. package/dist/mainstack-design-system30.cjs +1 -1
  19. package/dist/mainstack-design-system30.js +5 -69
  20. package/dist/mainstack-design-system31.cjs +1 -1
  21. package/dist/mainstack-design-system31.js +59 -26
  22. package/dist/mainstack-design-system32.cjs +1 -1
  23. package/dist/mainstack-design-system32.js +35 -18
  24. package/dist/mainstack-design-system33.cjs +1 -1
  25. package/dist/mainstack-design-system33.js +19 -18
  26. package/dist/mainstack-design-system34.cjs +1 -1
  27. package/dist/mainstack-design-system34.js +8 -8
  28. package/dist/mainstack-design-system35.cjs +1 -2
  29. package/dist/mainstack-design-system35.js +14 -46
  30. package/dist/mainstack-design-system36.cjs +2 -1
  31. package/dist/mainstack-design-system36.js +47 -36
  32. package/dist/mainstack-design-system37.cjs +1 -1
  33. package/dist/mainstack-design-system37.js +39 -12
  34. package/dist/mainstack-design-system374.cjs +1 -1
  35. package/dist/mainstack-design-system374.js +1 -1
  36. package/dist/mainstack-design-system381.cjs +1 -1
  37. package/dist/mainstack-design-system381.js +1 -1
  38. package/dist/mainstack-design-system384.cjs +1 -1
  39. package/dist/mainstack-design-system384.js +3 -3
  40. package/dist/mainstack-design-system386.cjs +1 -1
  41. package/dist/mainstack-design-system386.js +1 -1
  42. package/dist/mainstack-design-system387.cjs +1 -1
  43. package/dist/mainstack-design-system387.js +1 -1
  44. package/dist/mainstack-design-system389.cjs +1 -1
  45. package/dist/mainstack-design-system389.js +1 -1
  46. package/dist/mainstack-design-system390.cjs +1 -1
  47. package/dist/mainstack-design-system390.js +2 -2
  48. package/dist/mainstack-design-system43.cjs +1 -1
  49. package/dist/mainstack-design-system43.js +1 -1
  50. package/dist/mainstack-design-system45.cjs +1 -1
  51. package/dist/mainstack-design-system45.js +1 -1
  52. package/dist/mainstack-design-system457.cjs +1 -1
  53. package/dist/mainstack-design-system457.js +1 -1
  54. package/dist/mainstack-design-system487.cjs +1 -1
  55. package/dist/mainstack-design-system487.js +1 -1
  56. package/dist/mainstack-design-system523.cjs +1 -1
  57. package/dist/mainstack-design-system523.js +1 -1
  58. package/dist/mainstack-design-system529.cjs +1 -1
  59. package/dist/mainstack-design-system529.js +1 -1
  60. package/dist/mainstack-design-system532.cjs +1 -1
  61. package/dist/mainstack-design-system532.js +2 -2
  62. package/dist/mainstack-design-system540.cjs +1 -1
  63. package/dist/mainstack-design-system540.js +1 -1
  64. package/dist/mainstack-design-system561.cjs +1 -1
  65. package/dist/mainstack-design-system561.js +1 -1
  66. package/dist/mainstack-design-system562.cjs +1 -1
  67. package/dist/mainstack-design-system562.js +1 -1
  68. package/dist/mainstack-design-system564.cjs +1 -1
  69. package/dist/mainstack-design-system564.js +1 -1
  70. package/dist/mainstack-design-system565.cjs +1 -1
  71. package/dist/mainstack-design-system565.js +1 -1
  72. package/dist/mainstack-design-system566.cjs +1 -1
  73. package/dist/mainstack-design-system566.js +1 -1
  74. package/dist/mainstack-design-system568.cjs +1 -1
  75. package/dist/mainstack-design-system568.js +1 -1
  76. package/dist/mainstack-design-system571.cjs +1 -1
  77. package/dist/mainstack-design-system571.js +1 -1
  78. package/dist/mainstack-design-system574.cjs +1 -1
  79. package/dist/mainstack-design-system574.js +1 -1
  80. package/dist/mainstack-design-system575.cjs +1 -1
  81. package/dist/mainstack-design-system575.js +1 -1
  82. package/dist/mainstack-design-system576.cjs +1 -1
  83. package/dist/mainstack-design-system576.js +1 -1
  84. package/dist/mainstack-design-system577.cjs +1 -1
  85. package/dist/mainstack-design-system577.js +1 -1
  86. package/dist/mainstack-design-system578.cjs +1 -1
  87. package/dist/mainstack-design-system578.js +1 -1
  88. package/dist/mainstack-design-system579.cjs +1 -1
  89. package/dist/mainstack-design-system579.js +1 -1
  90. package/dist/mainstack-design-system582.cjs +1 -1
  91. package/dist/mainstack-design-system582.js +1 -1
  92. package/dist/mainstack-design-system593.cjs +1 -1
  93. package/dist/mainstack-design-system593.js +1 -1
  94. package/dist/mainstack-design-system594.cjs +1 -1
  95. package/dist/mainstack-design-system594.js +1 -1
  96. package/dist/mainstack-design-system595.cjs +1 -1
  97. package/dist/mainstack-design-system595.js +1 -1
  98. package/dist/mainstack-design-system596.cjs +1 -1
  99. package/dist/mainstack-design-system596.js +1 -1
  100. package/dist/mainstack-design-system597.cjs +1 -1
  101. package/dist/mainstack-design-system597.js +1 -1
  102. package/dist/mainstack-design-system598.cjs +1 -1
  103. package/dist/mainstack-design-system598.js +2 -2
  104. package/dist/mainstack-design-system6.cjs +1 -1
  105. package/dist/mainstack-design-system6.js +1 -1
  106. package/dist/mainstack-design-system605.cjs +1 -1
  107. package/dist/mainstack-design-system605.js +1 -1
  108. package/dist/mainstack-design-system607.cjs +1 -1
  109. package/dist/mainstack-design-system607.js +1 -1
  110. package/dist/mainstack-design-system621.cjs +1 -1
  111. package/dist/mainstack-design-system621.js +12 -20
  112. package/dist/mainstack-design-system622.cjs +1 -1
  113. package/dist/mainstack-design-system622.js +19 -10
  114. package/dist/mainstack-design-system623.cjs +1 -2
  115. package/dist/mainstack-design-system623.js +10 -11
  116. package/dist/mainstack-design-system624.cjs +2 -1
  117. package/dist/mainstack-design-system624.js +12 -12
  118. package/dist/mainstack-design-system625.cjs +1 -1
  119. package/dist/mainstack-design-system625.js +12 -22
  120. package/dist/mainstack-design-system626.cjs +1 -2
  121. package/dist/mainstack-design-system626.js +21 -259
  122. package/dist/mainstack-design-system627.cjs +1 -1
  123. package/dist/mainstack-design-system627.js +228 -120
  124. package/dist/mainstack-design-system628.cjs +2 -1
  125. package/dist/mainstack-design-system628.js +146 -55
  126. package/dist/mainstack-design-system629.cjs +1 -1
  127. package/dist/mainstack-design-system629.js +60 -23
  128. package/dist/mainstack-design-system630.cjs +1 -2
  129. package/dist/mainstack-design-system630.js +21 -96
  130. package/dist/mainstack-design-system631.cjs +1 -1
  131. package/dist/mainstack-design-system631.js +93 -135
  132. package/dist/mainstack-design-system632.cjs +1 -2
  133. package/dist/mainstack-design-system632.js +130 -396
  134. package/dist/mainstack-design-system633.cjs +2 -9
  135. package/dist/mainstack-design-system633.js +392 -161
  136. package/dist/mainstack-design-system634.cjs +10 -5
  137. package/dist/mainstack-design-system634.js +158 -2143
  138. package/dist/mainstack-design-system635.cjs +5 -2
  139. package/dist/mainstack-design-system635.js +2115 -398
  140. package/dist/mainstack-design-system636.cjs +1 -41
  141. package/dist/mainstack-design-system636.js +386 -23680
  142. package/dist/mainstack-design-system637.cjs +41 -3
  143. package/dist/mainstack-design-system637.js +23496 -7198
  144. package/dist/mainstack-design-system638.cjs +3 -1
  145. package/dist/mainstack-design-system638.js +7286 -2042
  146. package/dist/mainstack-design-system639.cjs +2 -1
  147. package/dist/mainstack-design-system639.js +2195 -58
  148. package/dist/mainstack-design-system640.cjs +1 -1
  149. package/dist/mainstack-design-system640.js +61 -1
  150. package/dist/mainstack-design-system641.cjs +1 -1
  151. package/dist/mainstack-design-system641.js +1 -25
  152. package/dist/mainstack-design-system642.cjs +1 -1
  153. package/dist/mainstack-design-system642.js +23 -11
  154. package/dist/mainstack-design-system643.cjs +1 -0
  155. package/dist/mainstack-design-system643.js +13 -0
  156. package/package.json +1 -1
@@ -1,409 +1,143 @@
1
1
  'use client';
2
- import { jsxs as q, jsx as it } from "react/jsx-runtime";
3
- import w, { useRef as lt, useState as v, useCallback as B, useEffect as O, forwardRef as st } from "react";
4
- import { InputRoot as ft } from "./mainstack-design-system455.js";
5
- import { InputField as ct } from "./mainstack-design-system456.js";
6
- import "./mainstack-design-system454.js";
7
- import { w as S, x as yt, y as F, A as J, z as L, B as pt, C as mt, P as m, I as dt, D as Ct, E as K, F as gt, G as ht, c as Nt, k as bt } from "./utils-C21jc49d.js";
8
- import { usePhoneNumberContext as vt } from "./mainstack-design-system604.js";
9
- function A(t, n) {
10
- return Tt(t) || It(t, n) || Ot(t, n) || At();
11
- }
12
- function At() {
13
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
15
- }
16
- function Ot(t, n) {
17
- if (t) {
18
- if (typeof t == "string") return z(t, n);
19
- var e = Object.prototype.toString.call(t).slice(8, -1);
20
- if (e === "Object" && t.constructor && (e = t.constructor.name), e === "Map" || e === "Set") return Array.from(t);
21
- if (e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)) return z(t, n);
22
- }
23
- }
24
- function z(t, n) {
25
- (n == null || n > t.length) && (n = t.length);
26
- for (var e = 0, a = new Array(n); e < n; e++) a[e] = t[e];
27
- return a;
28
- }
29
- function It(t, n) {
30
- var e = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
31
- if (e != null) {
32
- var a, r, o, s, f = [], c = !0, u = !1;
33
- try {
34
- if (o = (e = e.call(t)).next, n !== 0) for (; !(c = (a = o.call(e)).done) && (f.push(a.value), f.length !== n); c = !0) ;
35
- } catch (l) {
36
- u = !0, r = l;
37
- } finally {
38
- try {
39
- if (!c && e.return != null && (s = e.return(), Object(s) !== s)) return;
40
- } finally {
41
- if (u) throw r;
42
- }
43
- }
44
- return f;
45
- }
46
- }
47
- function Tt(t) {
48
- if (Array.isArray(t)) return t;
49
- }
50
- function Pt(t) {
51
- var n = this, e = t.value, a = t.onChange, r = t.country, o = t.defaultCountry, s = t.international, f = t.withCountryCallingCode, c = t.useNationalFormatForDefaultCountryValue, u = t.metadata;
52
- typeof f == "boolean" && !(r && s) && console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"), r && o && console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"), typeof s == "boolean" && !r && console.error("[react-phone-number-input] `international` property can only be used together with `country` property");
53
- var l = Ft({
54
- international: s,
55
- country: r,
56
- defaultCountry: o,
57
- withCountryCallingCode: f
58
- }), y = lt(), C = function(p, d, b) {
59
- console.error("[react-phone-number-input] Expected phone number ".concat(p, " to correspond to country ").concat(d, " but ").concat(b ? "in reality it corresponds to country " + b : "it doesn't", ".")), y.current = !0;
60
- }, g = function(p) {
61
- return e && yt(e), wt(e, r, o, l, c, u, function() {
62
- p && p.onCountryMismatch && p.onCountryMismatch();
63
- for (var d = arguments.length, b = new Array(d), P = 0; P < d; P++)
64
- b[P] = arguments[P];
65
- C.apply(n, b);
66
- });
67
- }, j = v(r), I = A(j, 2), E = I[0], X = I[1], Z = v(o), V = A(Z, 2), tt = V[0], et = V[1], nt = v(g()), D = A(nt, 2), rt = D[0], h = D[1], at = v(e), M = A(at, 2), T = M[0], N = M[1], ot = v(), W = A(ot, 2);
68
- W[0];
69
- var k = W[1], U = B(function() {
70
- return k({});
71
- }, [k]);
72
- function Y(i) {
73
- if (i) {
74
- l === "NATIONAL_PART_OF_INTERNATIONAL" && (i = "+".concat(F(r, u)).concat(i));
75
- var p = new J(r || o, u);
76
- return p.input(i), p.getNumberValue();
77
- }
78
- }
79
- O(function() {
80
- e !== T && (N(e), h(g()));
81
- }, [e]), O(function() {
82
- if (r !== E) {
83
- X(r);
84
- var i, p = g({
85
- onCountryMismatch: function() {
86
- i = !0;
87
- }
88
- });
89
- h(p), i && N(Y(p));
90
- }
91
- }, [r]), O(function() {
92
- o !== tt && (et(o), h(g()));
93
- }, [o]), O(function() {
94
- T !== e && a(T);
95
- }, [T]);
96
- var ut = B(function(i) {
97
- var p;
98
- if (r)
99
- if (l === "INTERNATIONAL") {
100
- var d = S(r, u);
101
- if (i.indexOf(d) !== 0) {
102
- if (i && i[0] !== "+")
103
- i = d + i;
104
- else if (!y.current) return h(d), N(void 0), U();
105
- }
106
- } else
107
- i && i[0] === "+" && (i = i.slice(1));
108
- else o || i && i[0] !== "+" && (i = "+" + i);
109
- i && (p = Y(i)), h(i), N(p);
110
- }, [r, l, o, u, h, N, U, y]);
111
- return {
112
- phoneDigits: rt,
113
- setPhoneDigits: ut,
114
- inputFormat: l
115
- };
116
- }
117
- function wt(t, n, e, a, r, o, s) {
118
- if (n && a === "INTERNATIONAL") {
119
- var f = S(n, o);
120
- return t ? (t.indexOf(f) !== 0 && s(t, n), t) : f;
121
- }
122
- if (!t)
123
- return "";
124
- if (!n && !e)
125
- return t;
126
- var c = new J(void 0, o);
127
- c.input(t);
128
- var u = c.getNumber();
129
- if (u)
130
- if (n)
131
- switch (u.country && u.country !== n ? s(t, n, u.country) : u.countryCallingCode !== F(n, o) && s(t, n), a) {
132
- case "NATIONAL":
133
- return L(u.formatNational());
134
- case "NATIONAL_PART_OF_INTERNATIONAL":
135
- return L(pt(u.formatInternational(), S(n, o)));
136
- case "INTERNATIONAL":
137
- throw new Error('`inputFormat: "INTERNATIONAL"` case should\'ve already been handled earlier in the code');
138
- case "INTERNATIONAL_OR_NATIONAL":
139
- throw new Error('`inputFormat: "INTERNATIONAL_OR_NATIONAL"` is not possible when `country` is fixed');
140
- default:
141
- throw new Error("Unknown `inputFormat`: ".concat(a));
142
- }
143
- else
144
- return u.countryCallingCode && u.countryCallingCode === F(e, o) && r ? L(u.formatNational()) : t;
145
- else
146
- return "";
147
- }
148
- function Ft(t) {
149
- var n = t.international, e = t.country, a = t.defaultCountry, r = t.withCountryCallingCode;
150
- return e ? n ? r ? "INTERNATIONAL" : "NATIONAL_PART_OF_INTERNATIONAL" : "NATIONAL" : a ? "INTERNATIONAL_OR_NATIONAL" : "INTERNATIONAL";
151
- }
152
- var Rt = ["Component", "country", "defaultCountry", "useNationalFormatForDefaultCountryValue", "value", "onChange", "metadata", "international", "withCountryCallingCode"];
153
- function _() {
154
- return _ = Object.assign ? Object.assign.bind() : function(t) {
155
- for (var n = 1; n < arguments.length; n++) {
156
- var e = arguments[n];
157
- for (var a in e)
158
- Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
159
- }
160
- return t;
161
- }, _.apply(this, arguments);
162
- }
163
- function jt(t, n) {
164
- if (t == null) return {};
165
- var e = Et(t, n), a, r;
166
- if (Object.getOwnPropertySymbols) {
167
- var o = Object.getOwnPropertySymbols(t);
168
- for (r = 0; r < o.length; r++)
169
- a = o[r], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (e[a] = t[a]);
170
- }
171
- return e;
172
- }
173
- function Et(t, n) {
174
- if (t == null) return {};
175
- var e = {}, a = Object.keys(t), r, o;
176
- for (o = 0; o < a.length; o++)
177
- r = a[o], !(n.indexOf(r) >= 0) && (e[r] = t[r]);
178
- return e;
179
- }
180
- function R(t, n) {
181
- var e = t.Component, a = t.country, r = t.defaultCountry, o = t.useNationalFormatForDefaultCountryValue, s = o === void 0 ? !0 : o, f = t.value, c = t.onChange, u = t.metadata, l = t.international, y = t.withCountryCallingCode, C = jt(t, Rt), g = Pt({
182
- value: f,
183
- onChange: c,
184
- country: a,
185
- defaultCountry: r,
186
- international: l,
187
- withCountryCallingCode: y,
188
- useNationalFormatForDefaultCountryValue: s,
189
- metadata: u
190
- }), j = g.phoneDigits, I = g.setPhoneDigits, E = g.inputFormat;
191
- return /* @__PURE__ */ w.createElement(e, _({}, C, {
192
- ref: n,
193
- metadata: u,
194
- inputFormat: E,
195
- international: l,
196
- withCountryCallingCode: y,
197
- country: a || r,
198
- value: j,
199
- onChange: I
200
- }));
201
- }
202
- R = /* @__PURE__ */ w.forwardRef(R);
203
- R.propTypes = {
204
- /**
205
- * The phone number (in E.164 format).
206
- * Examples: `"+12"`, `"+12133734253"`.
207
- * An "empty" `value` could be represented by any "falsy" value like `undefined`, `null` or an empty string `""`.
208
- */
209
- value: m.string,
210
- /**
211
- * A function of `value: string?`.
212
- * Updates the `value` property (to `undefined` in case it's empty).
213
- */
214
- onChange: m.func.isRequired,
215
- /**
216
- * A two-letter country code for formatting `value`
217
- * as a national phone number (example: `(213) 373-4253`),
218
- * or as an international phone number without "country calling code"
219
- * if `international` property is passed (example: `213 373 4253`).
220
- * Example: "US".
221
- * If no `country` is passed then `value`
222
- * is formatted as an international phone number.
223
- * (example: `+1 213 373 4253`)
224
- */
225
- country: m.string,
226
- /**
227
- * A two-letter country code for formatting `value`
228
- * when a user inputs a national phone number (example: `(213) 373-4253`).
229
- * The user can still input a phone number in international format.
230
- * Example: "US".
231
- * `country` and `defaultCountry` properties are mutually exclusive.
232
- */
233
- defaultCountry: m.string,
234
- /**
235
- * If `country` property is passed along with `international={true}` property
236
- * then the phone number will be input in "international" format for that `country`
237
- * (without "country calling code").
238
- * For example, if `country="US"` property is passed to "without country select" input
239
- * then the phone number will be input in the "national" format for `US` (`(213) 373-4253`).
240
- * But if both `country="US"` and `international={true}` properties are passed then
241
- * the phone number will be input in the "international" format for `US` (`213 373 4253`)
242
- * (without "country calling code" `+1`).
243
- */
244
- international: m.bool,
245
- /**
246
- * If `country` and `international` properties are set,
247
- * then by default it won't include "country calling code" in the input field.
248
- * To change that, pass `withCountryCallingCode` property,
249
- * and it will include "country calling code" in the input field.
250
- */
251
- withCountryCallingCode: m.bool,
252
- /**
253
- * A component that renders the `<input/>` itself and also
254
- * parses and formats its `value` as the user inputs it.
255
- * See `InputBasic.js` and `InputSmart.js` for an example.
256
- */
257
- Component: m.elementType.isRequired,
258
- /**
259
- * When `defaultCountry` is defined and the initial `value` corresponds to `defaultCountry`,
260
- * then the `value` will be formatted as a national phone number by default.
261
- * To format the initial `value` of `defaultCountry` as an international number instead
262
- * set `useNationalFormatForDefaultCountryValue` property to `true`.
263
- */
264
- useNationalFormatForDefaultCountryValue: m.bool,
265
- /**
266
- * `libphonenumber-js` metadata.
267
- */
268
- metadata: mt
269
- };
270
- var Lt = ["type", "autoComplete", "smartCaret", "metadata"];
271
- function x() {
272
- return x = Object.assign ? Object.assign.bind() : function(t) {
273
- for (var n = 1; n < arguments.length; n++) {
274
- var e = arguments[n];
275
- for (var a in e)
276
- Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
277
- }
278
- return t;
279
- }, x.apply(this, arguments);
280
- }
281
- function St(t, n) {
282
- if (t == null) return {};
283
- var e = _t(t, n), a, r;
284
- if (Object.getOwnPropertySymbols) {
285
- var o = Object.getOwnPropertySymbols(t);
286
- for (r = 0; r < o.length; r++)
287
- a = o[r], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (e[a] = t[a]);
288
- }
289
- return e;
290
- }
291
- function _t(t, n) {
292
- if (t == null) return {};
293
- var e = {}, a = Object.keys(t), r, o;
294
- for (o = 0; o < a.length; o++)
295
- r = a[o], !(n.indexOf(r) >= 0) && (e[r] = t[r]);
296
- return e;
297
- }
298
- function Q(t) {
299
- function n(e, a) {
300
- var r = e.type, o = r === void 0 ? "tel" : r, s = e.autoComplete, f = s === void 0 ? "tel" : s, c = e.smartCaret, u = c === void 0 ? !0 : c, l = e.metadata, y = l === void 0 ? t : l, C = St(e, Lt);
301
- return /* @__PURE__ */ w.createElement(R, x({}, C, {
302
- type: o,
303
- autoComplete: f,
304
- metadata: y,
305
- ref: a,
306
- Component: u ? dt : Ct
307
- }));
308
- }
309
- return n = /* @__PURE__ */ w.forwardRef(n), n.propTypes = {
310
- /**
311
- * HTML `<input/>` `type` attribute.
312
- */
313
- type: m.string,
314
- /**
315
- * HTML `<input/>` `autocomplete` attribute.
316
- */
317
- autoComplete: m.string,
318
- /**
319
- * By default, the caret position is being "intelligently" managed
320
- * while a user inputs a phone number.
321
- * This "smart" caret behavior can be turned off
322
- * by passing `smartCaret={false}` property.
323
- * This is just an "escape hatch" for any possible caret position issues.
324
- */
325
- // Is `true` by default.
326
- smartCaret: m.bool,
327
- /**
328
- * `libphonenumber-js` metadata.
329
- */
330
- metadata: m.object
331
- }, n;
332
- }
333
- Q();
334
- function $(t, n) {
335
- var e = Array.prototype.slice.call(n);
336
- return e.push(K), t.apply(this, e);
337
- }
338
- Q(K);
339
- function G() {
340
- return $(ht, arguments);
341
- }
342
- function H() {
343
- return $(F, arguments);
344
- }
345
- function xt() {
346
- return $(gt, arguments);
347
- }
348
- const $t = st(
349
- ({
350
- placeholder: t = "000 - 000 - 000",
351
- disabled: n,
352
- ...e
353
- }, a) => {
2
+ import { jsx as d, jsxs as M } from "react/jsx-runtime";
3
+ import { forwardRef as A, useRef as N, useMemo as S, useEffect as V } from "react";
4
+ import { t as P, q as g, r as w, u as H, c as h, v as k } from "./utils-C21jc49d.js";
5
+ import { useTimePickerContext as y } from "./mainstack-design-system619.js";
6
+ import { S as R, a as C, b as O, c as j, d as z } from "./index-CLUgda6x.js";
7
+ import { timeOptionBreakdown as D } from "./mainstack-design-system620.js";
8
+ import { i as T } from "./isValid-BMkD2Abf.js";
9
+ function x(i, l, m) {
10
+ const t = P(i, m?.in);
11
+ return t.setHours(l), t;
12
+ }
13
+ function B(i, l, m) {
14
+ const t = P(i, m?.in);
15
+ return t.setMinutes(l), t;
16
+ }
17
+ const E = A(
18
+ ({ className: i, ...l }, m) => {
354
19
  const {
355
- activeCountry: r,
356
- isDisabled: o,
357
- value: s,
358
- onValueChange: f,
359
- setActiveCountry: c
360
- } = vt(), u = (l) => {
361
- if (!l) return "";
362
- const y = G(l);
363
- if (y)
364
- return y.nationalNumber;
365
- let C = "";
366
- return r && xt(r) && (C = H(r)), l.replace(`+${C}`, "");
367
- };
368
- return O(() => {
369
- if (s && !r) {
370
- const l = G(s);
371
- l && c(l.country);
372
- }
373
- }, [r, c, s]), /* @__PURE__ */ q(
374
- ft,
20
+ value: t,
21
+ onValueChange: p,
22
+ isDisabled: v,
23
+ timeRange: u
24
+ } = y(), f = N({
25
+ Hours: {},
26
+ Minutes: {},
27
+ "AM/PM": {}
28
+ }), o = S(() => {
29
+ const s = {
30
+ Hours: "",
31
+ Minutes: "",
32
+ "AM/PM": ""
33
+ };
34
+ if (!t || !T(t)) return s;
35
+ const a = g({
36
+ date: t,
37
+ timeRange: u
38
+ });
39
+ let e = w(a) % 12;
40
+ return e = e === 0 ? 12 : e, s.Hours = e.toString().padStart(2, "0"), s.Minutes = H(a).toString().padStart(2, "0"), s["AM/PM"] = w(a) >= 12 ? "PM" : "AM", s;
41
+ }, [t, u]);
42
+ return V(() => {
43
+ const s = f.current.Hours[o.Hours], a = f.current.Minutes[o.Minutes], e = f.current["AM/PM"][o["AM/PM"]];
44
+ (s || a || e) && (s?.scrollIntoView({ block: "center", behavior: "smooth" }), a?.scrollIntoView({ block: "center", behavior: "smooth" }), e?.scrollIntoView({ block: "center", behavior: "smooth" }));
45
+ }, [o]), /* @__PURE__ */ d(
46
+ "div",
375
47
  {
376
- "data-slot": "phone-number-digit-field",
377
- className: "mds:has-disabled:opacity-50",
378
- children: [
379
- /* @__PURE__ */ q("p", { className: Nt("mds:body-extrasmall-regular"), children: [
380
- "(+",
381
- H(r || "US"),
382
- ")"
383
- ] }),
384
- /* @__PURE__ */ it(
385
- ct,
48
+ "data-slot": "date-picker-calendar",
49
+ className: h(
50
+ "mds:@container mds:grid mds:grid-cols-3 mds:justify-items-center mds:gap-16 mds:p-16 mds:pb-0 ",
51
+ i
52
+ ),
53
+ ref: m,
54
+ ...l,
55
+ children: Object.entries(D).map(([s, a]) => /* @__PURE__ */ M("div", { className: "mds:flex mds:flex-col mds:gap-16", children: [
56
+ /* @__PURE__ */ d(
57
+ "h6",
58
+ {
59
+ className: h(
60
+ "mds:body-extrasmall-regular",
61
+ "mds:text-secondary"
62
+ ),
63
+ children: s
64
+ }
65
+ ),
66
+ /* @__PURE__ */ M(
67
+ R,
386
68
  {
387
- ...e,
388
- disabled: n || o,
389
- placeholder: t,
390
- value: u(s),
391
- onChange: (l) => {
392
- const y = bt({
393
- value: l.target.value,
394
- activeCountry: r
395
- });
396
- f && (l.target.value = y.digit, f(y));
69
+ style: {
70
+ "--scrollbar-size": "8px"
397
71
  },
398
- ref: a
72
+ className: "mds:h-210 mds:overflow-hidden mds:rounded-4",
73
+ children: [
74
+ /* @__PURE__ */ d(C, { className: "mds:h-full mds:w-full mds:pr-15 mds:rounded-4", children: /* @__PURE__ */ d("div", { className: "mds:flex mds:flex-col mds:gap-16", children: a.map((e) => /* @__PURE__ */ d(
75
+ "button",
76
+ {
77
+ "data-selected": o[s] === e,
78
+ className: h(
79
+ "mds:body-extrasmall-book",
80
+ "mds:size-36 mds:basis-36 mds:shrink-0 mds:grow-0 mds:text-primary mds:rounded-full mds:cursor-pointer mds:hover:bg-interactive-secondary mds:data-[selected=true]:bg-interactive-neutral mds:data-[selected=true]:text-neutral-50 mds:disabled:cursor-not-allowed mds:disabled:opacity-50"
81
+ ),
82
+ disabled: v || !k({
83
+ timeRange: u,
84
+ columnKey: s,
85
+ value: e,
86
+ currentBreakdown: o
87
+ }),
88
+ onClick: () => {
89
+ let r = g({
90
+ date: t || /* @__PURE__ */ new Date(),
91
+ timeRange: u
92
+ });
93
+ const c = s;
94
+ let b = 0;
95
+ if (c === "AM/PM") {
96
+ b = e === "PM" ? 12 : 0;
97
+ let n = +o.Hours;
98
+ n === 12 && (n = 0), r = x(r, n + b), p(r);
99
+ }
100
+ if (c === "Hours") {
101
+ b = o["AM/PM"] === "PM" ? 12 : 0;
102
+ let n = +e;
103
+ n === 12 && (n = 0), r = x(r, n + b), p(r);
104
+ }
105
+ c === "Minutes" && (r = B(r, +e), p(r));
106
+ },
107
+ ref: (r) => {
108
+ const c = s;
109
+ r && (f.current[c][e] = r);
110
+ },
111
+ children: e
112
+ },
113
+ e
114
+ )) }) }),
115
+ /* @__PURE__ */ d(
116
+ O,
117
+ {
118
+ orientation: "vertical",
119
+ className: "mds:flex mds:select-none mds:touch-none mds:p-2 mds:w-(--scrollbar-size) mds:flex-col mds:transition-all mds:duration-200 mds:ease-out mds:bg-surface-neutral-l1",
120
+ children: /* @__PURE__ */ d(
121
+ j,
122
+ {
123
+ className: h(
124
+ " mds:rounded-(--scrollbar-size) mds:bg-border-interactive-neutral-inverse-hover mds:relative",
125
+ "mds:before:content-[''] mds:before:absolute mds:before:top-1/2 mds:before:left-1/2 mds:before:-translate-1/2 mds:before:size-full mds:before:min-w-44 mds:before:min-h-44"
126
+ )
127
+ }
128
+ )
129
+ }
130
+ ),
131
+ /* @__PURE__ */ d(z, { className: "mds:bg-border-interactive-neutral-inverse-hover" })
132
+ ]
399
133
  }
400
134
  )
401
- ]
135
+ ] }, s))
402
136
  }
403
137
  );
404
138
  }
405
139
  );
406
- $t.displayName = "PhoneNumberDigitField";
140
+ E.displayName = "TimePickerCalendar";
407
141
  export {
408
- $t as PhoneNumberDigitField
142
+ E as TimePickerCalendar
409
143
  };
@@ -1,10 +1,3 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),T=require("./index-hyBpqx_X.cjs"),I=require("./index-4R9KShCu.cjs"),N=require("./mainstack-design-system617.cjs"),s=require("react"),j=require("./MotionConfigContext-CY9MWLbl.cjs"),M=require("./use-presence-DO2ahDUQ.cjs");function A(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const E=A(s);function _(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function W(...e){return n=>{let t=!1;const o=e.map(i=>{const r=_(i,n);return!t&&typeof r=="function"&&(t=!0),r});if(t)return()=>{for(let i=0;i<o.length;i++){const r=o[i];typeof r=="function"?r():_(e[i],null)}}}}function H(...e){return E.useCallback(W(...e),e)}class K extends E.Component{getSnapshotBeforeUpdate(n){const t=this.props.childRef.current;if(t&&n.isPresent&&!this.props.isPresent){const o=t.offsetParent,i=j.isHTMLElement(o)&&o.offsetWidth||0,r=this.props.sizeRef.current;r.height=t.offsetHeight||0,r.width=t.offsetWidth||0,r.top=t.offsetTop,r.left=t.offsetLeft,r.right=i-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function U({children:e,isPresent:n,anchorX:t,root:o}){const i=s.useId(),r=s.useRef(null),m=s.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:x}=s.useContext(j.MotionConfigContext),R=H(r,e?.ref);return s.useInsertionEffect(()=>{const{width:c,height:g,top:l,left:d,right:p}=m.current;if(n||!r.current||!c||!g)return;const C=t==="left"?`left: ${d}`:`right: ${p}`;r.current.dataset.motionPopId=i;const a=document.createElement("style");x&&(a.nonce=x);const w=o??document.head;return w.appendChild(a),a.sheet&&a.sheet.insertRule(`
3
- [data-motion-pop-id="${i}"] {
4
- position: absolute !important;
5
- width: ${c}px !important;
6
- height: ${g}px !important;
7
- ${C}px !important;
8
- top: ${l}px !important;
9
- }
10
- `),()=>{w.contains(a)&&w.removeChild(a)}},[n]),f.jsx(K,{isPresent:n,childRef:r,sizeRef:m,children:E.cloneElement(e,{ref:R})})}const V=({children:e,initial:n,isPresent:t,onExitComplete:o,custom:i,presenceAffectsLayout:r,mode:m,anchorX:x,root:R})=>{const c=M.useConstant(X),g=s.useId();let l=!0,d=s.useMemo(()=>(l=!1,{id:g,initial:n,isPresent:t,custom:i,onExitComplete:p=>{c.set(p,!0);for(const C of c.values())if(!C)return;o&&o()},register:p=>(c.set(p,!1),()=>c.delete(p))}),[t,c,o]);return r&&l&&(d={...d}),s.useMemo(()=>{c.forEach((p,C)=>c.set(C,!1))},[t]),E.useEffect(()=>{!t&&!c.size&&o&&o()},[t]),m==="popLayout"&&(e=f.jsx(U,{isPresent:t,anchorX:x,root:R,children:e})),f.jsx(M.PresenceContext.Provider,{value:d,children:e})};function X(){return new Map}const y=e=>e.key||"";function $(e){const n=[];return s.Children.forEach(e,t=>{s.isValidElement(t)&&n.push(t)}),n}const k=({children:e,custom:n,initial:t=!0,onExitComplete:o,presenceAffectsLayout:i=!0,mode:r="sync",propagate:m=!1,anchorX:x="left",root:R})=>{const[c,g]=M.usePresence(m),l=s.useMemo(()=>$(e),[e]),d=m&&!c?[]:l.map(y),p=s.useRef(!0),C=s.useRef(l),a=M.useConstant(()=>new Map),[w,q]=s.useState(l),[v,z]=s.useState(l);j.useIsomorphicLayoutEffect(()=>{p.current=!1,C.current=l;for(let h=0;h<v.length;h++){const u=y(v[h]);d.includes(u)?a.delete(u):a.get(u)!==!0&&a.set(u,!1)}},[v,d.length,d.join("-")]);const b=[];if(l!==w){let h=[...l];for(let u=0;u<v.length;u++){const P=v[u],D=y(P);d.includes(D)||(h.splice(u,0,P),b.push(P))}return r==="wait"&&b.length&&(h=b),z($(h)),q(l),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:S}=s.useContext(j.LayoutGroupContext);return f.jsx(f.Fragment,{children:v.map(h=>{const u=y(h),P=m&&!c?!1:l===v||d.includes(u),D=()=>{if(a.has(u))a.set(u,!0);else return;let O=!0;a.forEach(L=>{L||(O=!1)}),O&&(S?.(),z(C.current),m&&g?.(),o&&o())};return f.jsx(V,{isPresent:P,initial:!p.current||t?void 0:!1,custom:n,presenceAffectsLayout:i,mode:r,root:R,onExitComplete:P?void 0:D,anchorX:x,children:h},u)})})},B=({children:e,...n})=>{const{isDesktop:t,open:o}=N.useResponsivePopoverDrawerContext();return t?f.jsx(I.PopoverPortal,{forceMount:!0,...n,children:f.jsx(k,{children:o?f.jsx("div",{className:"mds:relative mds:z-100","data-slot":"responsive-popover-drawer-portal",children:e}):null})}):f.jsx(T.Drawer.Portal,{forceMount:!0,"data-slot":"responsive-popover-drawer-portal",...n,children:f.jsx(k,{children:o?f.jsx("div",{className:"mds:relative mds:z-100","data-slot":"responsive-popover-drawer-portal",children:e}):null})})};exports.ResponsivePopoverDrawerPortal=B;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react/jsx-runtime"),f=require("react"),tt=require("./mainstack-design-system455.cjs"),et=require("./mainstack-design-system456.cjs");require("./mainstack-design-system454.cjs");const u=require("./utils-CpiHnfHs.cjs"),nt=require("./mainstack-design-system604.cjs");function T(t,n){return ut(t)||at(t,n)||ot(t,n)||rt()}function rt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(t,n){if(t){if(typeof t=="string")return M(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return M(t,n)}}function M(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function at(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var o,r,a,c,p=[],y=!0,i=!1;try{if(a=(e=e.call(t)).next,n!==0)for(;!(y=(o=a.call(e)).done)&&(p.push(o.value),p.length!==n);y=!0);}catch(s){i=!0,r=s}finally{try{if(!y&&e.return!=null&&(c=e.return(),Object(c)!==c))return}finally{if(i)throw r}}return p}}function ut(t){if(Array.isArray(t))return t}function it(t){var n=this,e=t.value,o=t.onChange,r=t.country,a=t.defaultCountry,c=t.international,p=t.withCountryCallingCode,y=t.useNationalFormatForDefaultCountryValue,i=t.metadata;typeof p=="boolean"&&!(r&&c)&&console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"),r&&a&&console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"),typeof c=="boolean"&&!r&&console.error("[react-phone-number-input] `international` property can only be used together with `country` property");var s=st({international:c,country:r,defaultCountry:a,withCountryCallingCode:p}),d=f.useRef(),g=function(m,C,v){console.error("[react-phone-number-input] Expected phone number ".concat(m," to correspond to country ").concat(C," but ").concat(v?"in reality it corresponds to country "+v:"it doesn't",".")),d.current=!0},h=function(m){return e&&u.validateE164Number(e),lt(e,r,a,s,y,i,function(){m&&m.onCountryMismatch&&m.onCountryMismatch();for(var C=arguments.length,v=new Array(C),I=0;I<C;I++)v[I]=arguments[I];g.apply(n,v)})},w=f.useState(r),P=T(w,2),F=P[0],B=P[1],H=f.useState(a),_=T(H,2),z=_[0],G=_[1],J=f.useState(h()),L=T(J,2),K=L[0],b=L[1],Q=f.useState(e),x=T(Q,2),A=x[0],N=x[1],X=f.useState(),$=T(X,2);$[0];var D=$[1],V=f.useCallback(function(){return D({})},[D]);function q(l){if(l){s==="NATIONAL_PART_OF_INTERNATIONAL"&&(l="+".concat(u.getCountryCallingCode$1(r,i)).concat(l));var m=new u.AsYouType(r||a,i);return m.input(l),m.getNumberValue()}}f.useEffect(function(){e!==A&&(N(e),b(h()))},[e]),f.useEffect(function(){if(r!==F){B(r);var l,m=h({onCountryMismatch:function(){l=!0}});b(m),l&&N(q(m))}},[r]),f.useEffect(function(){a!==z&&(G(a),b(h()))},[a]),f.useEffect(function(){A!==e&&o(A)},[A]);var Z=f.useCallback(function(l){var m;if(r)if(s==="INTERNATIONAL"){var C=u.getInternationalPhoneNumberPrefix(r,i);if(l.indexOf(C)!==0){if(l&&l[0]!=="+")l=C+l;else if(!d.current)return b(C),N(void 0),V()}}else l&&l[0]==="+"&&(l=l.slice(1));else a||l&&l[0]!=="+"&&(l="+"+l);l&&(m=q(l)),b(l),N(m)},[r,s,a,i,b,N,V,d]);return{phoneDigits:K,setPhoneDigits:Z,inputFormat:s}}function lt(t,n,e,o,r,a,c){if(n&&o==="INTERNATIONAL"){var p=u.getInternationalPhoneNumberPrefix(n,a);return t?(t.indexOf(p)!==0&&c(t,n),t):p}if(!t)return"";if(!n&&!e)return t;var y=new u.AsYouType(void 0,a);y.input(t);var i=y.getNumber();if(i)if(n)switch(i.country&&i.country!==n?c(t,n,i.country):i.countryCallingCode!==u.getCountryCallingCode$1(n,a)&&c(t,n),o){case"NATIONAL":return u.parseDigits(i.formatNational());case"NATIONAL_PART_OF_INTERNATIONAL":return u.parseDigits(u.removePrefixFromFormattedPhoneNumber(i.formatInternational(),u.getInternationalPhoneNumberPrefix(n,a)));case"INTERNATIONAL":throw new Error('`inputFormat: "INTERNATIONAL"` case should\'ve already been handled earlier in the code');case"INTERNATIONAL_OR_NATIONAL":throw new Error('`inputFormat: "INTERNATIONAL_OR_NATIONAL"` is not possible when `country` is fixed');default:throw new Error("Unknown `inputFormat`: ".concat(o))}else return i.countryCallingCode&&i.countryCallingCode===u.getCountryCallingCode$1(e,a)&&r?u.parseDigits(i.formatNational()):t;else return""}function st(t){var n=t.international,e=t.country,o=t.defaultCountry,r=t.withCountryCallingCode;return e?n?r?"INTERNATIONAL":"NATIONAL_PART_OF_INTERNATIONAL":"NATIONAL":o?"INTERNATIONAL_OR_NATIONAL":"INTERNATIONAL"}var ct=["Component","country","defaultCountry","useNationalFormatForDefaultCountryValue","value","onChange","metadata","international","withCountryCallingCode"];function j(){return j=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},j.apply(this,arguments)}function ft(t,n){if(t==null)return{};var e=pt(t,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)o=a[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function pt(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,a;for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function O(t,n){var e=t.Component,o=t.country,r=t.defaultCountry,a=t.useNationalFormatForDefaultCountryValue,c=a===void 0?!0:a,p=t.value,y=t.onChange,i=t.metadata,s=t.international,d=t.withCountryCallingCode,g=ft(t,ct),h=it({value:p,onChange:y,country:o,defaultCountry:r,international:s,withCountryCallingCode:d,useNationalFormatForDefaultCountryValue:c,metadata:i}),w=h.phoneDigits,P=h.setPhoneDigits,F=h.inputFormat;return f.createElement(e,j({},g,{ref:n,metadata:i,inputFormat:F,international:s,withCountryCallingCode:d,country:o||r,value:w,onChange:P}))}O=f.forwardRef(O);O.propTypes={value:u.PropTypes.string,onChange:u.PropTypes.func.isRequired,country:u.PropTypes.string,defaultCountry:u.PropTypes.string,international:u.PropTypes.bool,withCountryCallingCode:u.PropTypes.bool,Component:u.PropTypes.elementType.isRequired,useNationalFormatForDefaultCountryValue:u.PropTypes.bool,metadata:u.metadata};var yt=["type","autoComplete","smartCaret","metadata"];function S(){return S=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},S.apply(this,arguments)}function dt(t,n){if(t==null)return{};var e=mt(t,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)o=a[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function mt(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,a;for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function k(t){function n(e,o){var r=e.type,a=r===void 0?"tel":r,c=e.autoComplete,p=c===void 0?"tel":c,y=e.smartCaret,i=y===void 0?!0:y,s=e.metadata,d=s===void 0?t:s,g=dt(e,yt);return f.createElement(O,S({},g,{type:a,autoComplete:p,metadata:d,ref:o,Component:i?u.InputSmart:u.InputBasic}))}return n=f.forwardRef(n),n.propTypes={type:u.PropTypes.string,autoComplete:u.PropTypes.string,smartCaret:u.PropTypes.bool,metadata:u.PropTypes.object},n}k();function E(t,n){var e=Array.prototype.slice.call(n);return e.push(u.metadata$1),t.apply(this,e)}k(u.metadata$1);function W(){return E(u.parsePhoneNumber,arguments)}function Y(){return E(u.getCountryCallingCode$1,arguments)}function Ct(){return E(u.isSupportedCountry$1,arguments)}const U=f.forwardRef(({placeholder:t="000 - 000 - 000",disabled:n,...e},o)=>{const{activeCountry:r,isDisabled:a,value:c,onValueChange:p,setActiveCountry:y}=nt.usePhoneNumberContext(),i=s=>{if(!s)return"";const d=W(s);if(d)return d.nationalNumber;let g="";return r&&Ct(r)&&(g=Y(r)),s.replace(`+${g}`,"")};return f.useEffect(()=>{if(c&&!r){const s=W(c);s&&y(s.country)}},[r,y,c]),R.jsxs(tt.InputRoot,{"data-slot":"phone-number-digit-field",className:"mds:has-disabled:opacity-50",children:[R.jsxs("p",{className:u.cn("mds:body-extrasmall-regular"),children:["(+",Y(r||"US"),")"]}),R.jsx(et.InputField,{...e,disabled:n||a,placeholder:t,value:i(c),onChange:s=>{const d=u.getPhoneNumberDigitMetadataValueObject({value:s.target.value,activeCountry:r});p&&(s.target.value=d.digit,p(d))},ref:o})]})});U.displayName="PhoneNumberDigitField";exports.PhoneNumberDigitField=U;