@alfadocs/ui-kit-debug 1.80.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{address-fields-GnoSkvh6.js → address-fields-CfnXK8RT.js} +4 -4
- package/dist/_chunks/{address-fields-GnoSkvh6.js.map → address-fields-CfnXK8RT.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js → ai-prompt-input-DH_rnV-F.js} +33 -26
- package/dist/_chunks/{ai-prompt-input-M6u29f87.js.map → ai-prompt-input-DH_rnV-F.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js → anamnesis-summary-rows-6gMuu0ZK.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-lONg-zja.js.map → anamnesis-summary-rows-6gMuu0ZK.js.map} +1 -1
- package/dist/_chunks/{autocomplete-DosDnGie.js → autocomplete-CnB1mHGc.js} +65 -64
- package/dist/_chunks/{autocomplete-DosDnGie.js.map → autocomplete-CnB1mHGc.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js → balance-badge-cell-BHXJS8Ga.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-Dzd-Z_5W.js.map → balance-badge-cell-BHXJS8Ga.js.map} +1 -1
- package/dist/_chunks/{benefit-card-BWBClvdF.js → benefit-card-BcPtRHgM.js} +37 -36
- package/dist/_chunks/{benefit-card-BWBClvdF.js.map → benefit-card-BcPtRHgM.js.map} +1 -1
- package/dist/_chunks/booking-dsgiuhKg.js +4304 -0
- package/dist/_chunks/booking-dsgiuhKg.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js → calendar-appointment-editor-dialog-BuumJbcv.js} +4 -4
- package/dist/_chunks/{calendar-appointment-editor-dialog-DhTTWgXw.js.map → calendar-appointment-editor-dialog-BuumJbcv.js.map} +1 -1
- package/dist/_chunks/{city-input-3J3bz9EO.js → city-input-CJVGswxp.js} +2 -2
- package/dist/_chunks/{city-input-3J3bz9EO.js.map → city-input-CJVGswxp.js.map} +1 -1
- package/dist/_chunks/{combobox-vF9O-QoG.js → combobox-CDPm_n0p.js} +93 -92
- package/dist/_chunks/{combobox-vF9O-QoG.js.map → combobox-CDPm_n0p.js.map} +1 -1
- package/dist/_chunks/{command-palette-D9TBzmOG.js → command-palette-B3dVqm9D.js} +68 -68
- package/dist/_chunks/{command-palette-D9TBzmOG.js.map → command-palette-B3dVqm9D.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-DKk94l-d.js → contact-profile-card-Da1vmJQI.js} +115 -102
- package/dist/_chunks/contact-profile-card-Da1vmJQI.js.map +1 -0
- package/dist/_chunks/{country-select-CSE2Zm_s.js → country-select-DQ8q7ypA.js} +2 -2
- package/dist/_chunks/{country-select-CSE2Zm_s.js.map → country-select-DQ8q7ypA.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BIPJqw9f.js → face-scheme-BgJGFDTa.js} +2 -2
- package/dist/_chunks/{face-scheme-BIPJqw9f.js.map → face-scheme-BgJGFDTa.js.map} +1 -1
- package/dist/_chunks/{header-settings-BYpVmLip.js → header-settings-CifwJEKB.js} +2 -2
- package/dist/_chunks/{header-settings-BYpVmLip.js.map → header-settings-CifwJEKB.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js → link-cell-renderer-C0ynDik7.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-B0riA_h_.js.map → link-cell-renderer-C0ynDik7.js.map} +1 -1
- package/dist/_chunks/{locale-picker-DzdGDSBI.js → locale-picker-QbT1p60X.js} +39 -38
- package/dist/_chunks/{locale-picker-DzdGDSBI.js.map → locale-picker-QbT1p60X.js.map} +1 -1
- package/dist/_chunks/{map-view-C6MIVaqn.js → map-view-Bvi06RVh.js} +2 -2
- package/dist/_chunks/{map-view-C6MIVaqn.js.map → map-view-Bvi06RVh.js.map} +1 -1
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js → marketplace-app-shell-vON3WhD0.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-mS7Q2-81.js.map → marketplace-app-shell-vON3WhD0.js.map} +1 -1
- package/dist/_chunks/{multi-select-BOad3za9.js → multi-select-i5MFRpXg.js} +194 -187
- package/dist/_chunks/multi-select-i5MFRpXg.js.map +1 -0
- package/dist/_chunks/{otp-input-BgEZi0py.js → otp-input-gV1446Dw.js} +70 -70
- package/dist/_chunks/otp-input-gV1446Dw.js.map +1 -0
- package/dist/_chunks/{patient-details-B-I9Xkh9.js → patient-details-D0P5eog5.js} +2 -2
- package/dist/_chunks/{patient-details-B-I9Xkh9.js.map → patient-details-D0P5eog5.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js → patient-field-row-R73dZJY6.js} +5 -5
- package/dist/_chunks/{patient-field-row-Bn0z6lAZ.js.map → patient-field-row-R73dZJY6.js.map} +1 -1
- package/dist/_chunks/{patient-search-CxqNcth4.js → patient-search-Dy0sxcwv.js} +2 -2
- package/dist/_chunks/{patient-search-CxqNcth4.js.map → patient-search-Dy0sxcwv.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js → patient-summary-card-6U74-ivO.js} +2 -2
- package/dist/_chunks/{patient-summary-card-bhDo0gVX.js.map → patient-summary-card-6U74-ivO.js.map} +1 -1
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js → payment-automation-upsell-D1YdO1xY.js} +2 -2
- package/dist/_chunks/{payment-automation-upsell-AQpHOS1X.js.map → payment-automation-upsell-D1YdO1xY.js.map} +1 -1
- package/dist/_chunks/{phone-input-C3NrD-nl.js → phone-input-DJ4BN8tG.js} +70 -63
- package/dist/_chunks/{phone-input-C3NrD-nl.js.map → phone-input-DJ4BN8tG.js.map} +1 -1
- package/dist/_chunks/{practice-results-CtOanuzZ.js → practice-results-B61krlwu.js} +2 -2
- package/dist/_chunks/{practice-results-CtOanuzZ.js.map → practice-results-B61krlwu.js.map} +1 -1
- package/dist/_chunks/{province-select-CDjs5obD.js → province-select-CPdTwEob.js} +2 -2
- package/dist/_chunks/{province-select-CDjs5obD.js.map → province-select-CPdTwEob.js.map} +1 -1
- package/dist/_chunks/{registration-form-CNBfUduG.js → registration-form-DmP3YUfp.js} +3 -3
- package/dist/_chunks/{registration-form-CNBfUduG.js.map → registration-form-DmP3YUfp.js.map} +1 -1
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js → send-registration-link-form-CZYOO7NO.js} +2 -2
- package/dist/_chunks/{send-registration-link-form-vTn1HxjA.js.map → send-registration-link-form-CZYOO7NO.js.map} +1 -1
- package/dist/_chunks/{task-editor-Cpw-NmND.js → task-editor-BOETWbjU.js} +2 -2
- package/dist/_chunks/{task-editor-Cpw-NmND.js.map → task-editor-BOETWbjU.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js → use-appointment-details-read-CWN-nJCZ.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-lFUL4kkd.js.map → use-appointment-details-read-CWN-nJCZ.js.map} +1 -1
- package/dist/agent-catalog.json +4 -4
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/benefit-card/benefit-card.d.ts +7 -1
- package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/booking/booking-types.d.ts +35 -2
- package/dist/components/booking/booking-types.d.ts.map +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/code-step.d.ts +4 -2
- package/dist/components/booking/code-step.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts +2 -0
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/handover.d.ts +12 -0
- package/dist/components/booking/handover.d.ts.map +1 -0
- package/dist/components/booking/index.js +1 -1
- package/dist/components/booking/reserved.d.ts +24 -0
- package/dist/components/booking/reserved.d.ts.map +1 -0
- package/dist/components/booking/use-booking-payment.d.ts +3 -1
- package/dist/components/booking/use-booking-payment.d.ts.map +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +4 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/locale-picker/locale-picker.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +1 -1
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/phone-input/index.js +1 -1
- package/dist/components/phone-input/phone-input.d.ts.map +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +8 -0
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +8 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +8 -0
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +8 -0
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +8 -0
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +8 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +8 -0
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +8 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +8 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +8 -0
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +8 -0
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +8 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +8 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +8 -0
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +8 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +8 -0
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +8 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +8 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +8 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +8 -0
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +8 -0
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +8 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +8 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +8 -0
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +8 -0
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +8 -0
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +8 -0
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +8 -0
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +8 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +8 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +8 -0
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +30 -30
- package/dist/locales/ar.json +8 -0
- package/dist/locales/de.json +8 -0
- package/dist/locales/el.json +8 -0
- package/dist/locales/en.json +8 -0
- package/dist/locales/es.json +8 -0
- package/dist/locales/fr.json +8 -0
- package/dist/locales/hi.json +8 -0
- package/dist/locales/it.json +8 -0
- package/dist/locales/ja.json +8 -0
- package/dist/locales/nl.json +8 -0
- package/dist/locales/pl.json +8 -0
- package/dist/locales/pt.json +8 -0
- package/dist/locales/ro.json +8 -0
- package/dist/locales/ru.json +8 -0
- package/dist/locales/sq.json +8 -0
- package/dist/locales/sv.json +8 -0
- package/dist/locales/tr.json +8 -0
- package/dist/locales/zh.json +8 -0
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/payment-automation-upsell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/send-registration-link-form/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-By4I_1A-.js +0 -4068
- package/dist/_chunks/booking-By4I_1A-.js.map +0 -1
- package/dist/_chunks/contact-profile-card-DKk94l-d.js.map +0 -1
- package/dist/_chunks/multi-select-BOad3za9.js.map +0 -1
- package/dist/_chunks/otp-input-BgEZi0py.js.map +0 -1
|
@@ -8,7 +8,7 @@ import { u as ot, f as rt } from "./non-modal-tab-exit-j3CPOuE3.js";
|
|
|
8
8
|
import { R as at, _ as I } from "./index-4xgbg-sn.js";
|
|
9
9
|
import { c as pe } from "./index-D2ZczOXr.js";
|
|
10
10
|
import { useTranslation as it } from "react-i18next";
|
|
11
|
-
import { getCountries as dt, parsePhoneNumberFromString as
|
|
11
|
+
import { getCountries as dt, parsePhoneNumberFromString as V, AsYouType as W, getCountryCallingCode as lt } from "libphonenumber-js/min";
|
|
12
12
|
import { u as ut, F as ct, a as pt } from "./form-field-context-DtiROUJV.js";
|
|
13
13
|
import { c as ft } from "./compose-refs-C0k0tdqF.js";
|
|
14
14
|
import { n as le } from "./normalize-diacritics-BNGbFNlJ.js";
|
|
@@ -257,10 +257,10 @@ const Et = Xe(
|
|
|
257
257
|
disabled: b,
|
|
258
258
|
readOnly: x,
|
|
259
259
|
placeholder: Se,
|
|
260
|
-
popularCountries:
|
|
261
|
-
allowedCountries:
|
|
260
|
+
popularCountries: D,
|
|
261
|
+
allowedCountries: L,
|
|
262
262
|
className: Ee,
|
|
263
|
-
id:
|
|
263
|
+
id: j,
|
|
264
264
|
name: Y,
|
|
265
265
|
nameFormat: ke = "national",
|
|
266
266
|
required: Pe,
|
|
@@ -272,10 +272,10 @@ const Et = Xe(
|
|
|
272
272
|
() => new Set(dt()),
|
|
273
273
|
[]
|
|
274
274
|
), p = v(() => {
|
|
275
|
-
if (!
|
|
276
|
-
const e = /* @__PURE__ */ new Set(), t =
|
|
275
|
+
if (!L || L.length === 0) return null;
|
|
276
|
+
const e = /* @__PURE__ */ new Set(), t = L.filter((n) => !h.has(n) || e.has(n) ? !1 : (e.add(n), !0));
|
|
277
277
|
return t.length > 0 ? t : null;
|
|
278
|
-
}, [
|
|
278
|
+
}, [L, h]), Ve = p !== null && p.length === 1, J = v(() => {
|
|
279
279
|
const e = Re(
|
|
280
280
|
o,
|
|
281
281
|
h,
|
|
@@ -284,7 +284,7 @@ const Et = Xe(
|
|
|
284
284
|
p
|
|
285
285
|
), t = a ?? c;
|
|
286
286
|
if (t) {
|
|
287
|
-
const n =
|
|
287
|
+
const n = V(t);
|
|
288
288
|
return n != null && n.country ? !p || p.includes(n.country) ? {
|
|
289
289
|
country: n.country,
|
|
290
290
|
display: n.formatNational(),
|
|
@@ -298,11 +298,11 @@ const Et = Xe(
|
|
|
298
298
|
} : { country: e, display: t, pinned: !1 };
|
|
299
299
|
}
|
|
300
300
|
return { country: e, display: "", pinned: !1 };
|
|
301
|
-
}, []), [l,
|
|
301
|
+
}, []), [l, A] = G(J.country), [Q, g] = G(
|
|
302
302
|
J.display
|
|
303
|
-
), [X,
|
|
303
|
+
), [X, B] = G(!1), [De, fe] = G(""), me = a !== void 0, ee = y(""), $ = y(null), H = y(J.pinned), P = y(null), Le = ft(Te, P), je = st(P, Q), he = y(null), ge = y(null);
|
|
304
304
|
de(() => {
|
|
305
|
-
if (
|
|
305
|
+
if (H.current) return;
|
|
306
306
|
const e = Re(
|
|
307
307
|
o,
|
|
308
308
|
h,
|
|
@@ -310,7 +310,7 @@ const Et = Xe(
|
|
|
310
310
|
E.language,
|
|
311
311
|
p
|
|
312
312
|
);
|
|
313
|
-
|
|
313
|
+
A((t) => t === e ? t : e);
|
|
314
314
|
}, [
|
|
315
315
|
E.language,
|
|
316
316
|
o,
|
|
@@ -325,18 +325,18 @@ const Et = Xe(
|
|
|
325
325
|
g("");
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
|
-
const t =
|
|
329
|
-
t != null && t.country && (!p || p.includes(t.country)) ? (
|
|
328
|
+
const t = V(e);
|
|
329
|
+
t != null && t.country && (!p || p.includes(t.country)) ? (H.current = !0, A(t.country), g(t.formatNational())) : g(t ? t.formatNational() : e);
|
|
330
330
|
}, [a, me, p]), nt(() => {
|
|
331
|
-
if (
|
|
332
|
-
const e =
|
|
333
|
-
|
|
331
|
+
if ($.current == null) return;
|
|
332
|
+
const e = $.current;
|
|
333
|
+
$.current = null;
|
|
334
334
|
const t = P.current;
|
|
335
335
|
t && document.activeElement === t && t.setSelectionRange(e, e);
|
|
336
336
|
});
|
|
337
337
|
const N = U(
|
|
338
338
|
(e, t) => {
|
|
339
|
-
const n =
|
|
339
|
+
const n = V(e, t), u = (n == null ? void 0 : n.number) ?? "";
|
|
340
340
|
ee.current = u, i == null || i(u, {
|
|
341
341
|
country: t,
|
|
342
342
|
isValid: (n == null ? void 0 : n.isValid()) ?? !1,
|
|
@@ -345,9 +345,9 @@ const Et = Xe(
|
|
|
345
345
|
});
|
|
346
346
|
},
|
|
347
347
|
[i]
|
|
348
|
-
), Ae = pt(R,
|
|
349
|
-
|
|
350
|
-
const ne = y(!1),
|
|
348
|
+
), Ae = pt(R, j), Be = j ?? (k ? Ae : void 0), te = (k ? R.disabled : !1) || !!b, $e = (k ? R.required : !1) || !!Pe, ve = k ? R.invalid : !1, He = ve ? "error" : C, Ke = k && R.describedBy ? R.describedBy : void 0, Me = Se ?? z("inputs.phone.placeholder", "Phone number"), K = y(Z);
|
|
349
|
+
K.current = Z;
|
|
350
|
+
const ne = y(!1), M = y(!1), _ = U(
|
|
351
351
|
(e) => {
|
|
352
352
|
var t, n;
|
|
353
353
|
return e instanceof Node && !!((t = he.current) != null && t.contains(e) || (n = ge.current) != null && n.contains(e));
|
|
@@ -355,31 +355,31 @@ const Et = Xe(
|
|
|
355
355
|
[]
|
|
356
356
|
), se = U(() => {
|
|
357
357
|
var e;
|
|
358
|
-
ne.current && (ne.current = !1, (e =
|
|
358
|
+
ne.current && (ne.current = !1, (e = K.current) == null || e.call(K));
|
|
359
359
|
}, []), _e = () => {
|
|
360
360
|
ne.current = !0;
|
|
361
361
|
}, qe = (e) => {
|
|
362
362
|
const t = e.relatedTarget;
|
|
363
|
-
|
|
363
|
+
_(t) || t === null && M.current || se();
|
|
364
364
|
}, ye = Z !== void 0;
|
|
365
365
|
de(() => {
|
|
366
366
|
if (!ye) return;
|
|
367
367
|
let e;
|
|
368
368
|
const t = (u) => {
|
|
369
|
-
|
|
370
|
-
|
|
369
|
+
M.current = _(u.target), !M.current && (e = window.setTimeout(() => {
|
|
370
|
+
_(document.activeElement) || se();
|
|
371
371
|
}, 0));
|
|
372
372
|
}, n = () => {
|
|
373
|
-
|
|
373
|
+
M.current = !1;
|
|
374
374
|
};
|
|
375
375
|
return document.addEventListener("pointerdown", t, !0), document.addEventListener("pointerup", n, !0), document.addEventListener("pointercancel", n, !0), () => {
|
|
376
376
|
window.clearTimeout(e), document.removeEventListener("pointerdown", t, !0), document.removeEventListener("pointerup", n, !0), document.removeEventListener("pointercancel", n, !0);
|
|
377
377
|
};
|
|
378
|
-
}, [ye,
|
|
379
|
-
const oe = ke === "e164" && Y !== void 0, Ge = oe ? ((Ne =
|
|
378
|
+
}, [ye, _, se]);
|
|
379
|
+
const oe = ke === "e164" && Y !== void 0, Ge = oe ? ((Ne = V(Q, l)) == null ? void 0 : Ne.number) ?? "" : "", Ue = (e) => {
|
|
380
380
|
if (je(), x) return;
|
|
381
381
|
const t = e.target, n = t.value, u = t.selectionStart ?? n.length, S = zt(n, u), ie = new W(l).input(n);
|
|
382
|
-
|
|
382
|
+
$.current = Rt(ie, S), g(ie), N(ie, l);
|
|
383
383
|
}, be = ee, Oe = v(
|
|
384
384
|
() => ({
|
|
385
385
|
getValue: () => be.current,
|
|
@@ -388,9 +388,9 @@ const Et = Xe(
|
|
|
388
388
|
g(""), N("", l);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
const t =
|
|
391
|
+
const t = V(e);
|
|
392
392
|
if (t != null && t.country)
|
|
393
|
-
|
|
393
|
+
H.current = !0, A(t.country), g(t.formatNational()), N(t.formatNational(), t.country);
|
|
394
394
|
else {
|
|
395
395
|
const u = new W(l).input(e);
|
|
396
396
|
g(u), N(u, l);
|
|
@@ -406,17 +406,17 @@ const Et = Xe(
|
|
|
406
406
|
}),
|
|
407
407
|
[l, N, be]
|
|
408
408
|
);
|
|
409
|
-
tt(gt, Oe,
|
|
409
|
+
tt(gt, Oe, j);
|
|
410
410
|
const We = ot(!0, {
|
|
411
411
|
getAnchor: rt,
|
|
412
|
-
onReturnToTrigger: () =>
|
|
412
|
+
onReturnToTrigger: () => B(!1)
|
|
413
413
|
}), Ye = (e) => {
|
|
414
414
|
if (e === l) {
|
|
415
|
-
|
|
415
|
+
B(!1);
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
const t = Q.replace(/\D/g, ""), n = new W(e), u = t ? n.input(t) : "";
|
|
419
|
-
|
|
419
|
+
H.current = !0, A(e), g(u), B(!1), fe(""), N(u, e), requestAnimationFrame(() => {
|
|
420
420
|
var S;
|
|
421
421
|
(S = P.current) == null || S.focus();
|
|
422
422
|
});
|
|
@@ -427,19 +427,19 @@ const Et = Xe(
|
|
|
427
427
|
),
|
|
428
428
|
[E.language, h, p]
|
|
429
429
|
), F = v(() => {
|
|
430
|
-
if (!
|
|
430
|
+
if (!D || D.length === 0) return [];
|
|
431
431
|
const e = new Map(w.map((t) => [t.code, t]));
|
|
432
|
-
return
|
|
433
|
-
}, [
|
|
432
|
+
return D.filter((t) => h.has(t)).map((t) => e.get(t)).filter((t) => !!t);
|
|
433
|
+
}, [D, w, h]), re = v(
|
|
434
434
|
() => new Set(F.map((e) => e.code)),
|
|
435
435
|
[F]
|
|
436
436
|
), Ze = v(
|
|
437
437
|
() => re.size > 0 ? w.filter((e) => !re.has(e.code)) : w,
|
|
438
438
|
[w, re]
|
|
439
|
-
),
|
|
439
|
+
), q = v(
|
|
440
440
|
() => w.find((e) => e.code === l),
|
|
441
441
|
[w, l]
|
|
442
|
-
), ae =
|
|
442
|
+
), ae = q ? q.dialCode : "", Ce = q ? q.name : l, T = z("inputs.phone.countryPickerLabel", "Country"), Je = `${T}: ${Ce}, +${ae}`, Qe = U(
|
|
443
443
|
(e, t, n) => {
|
|
444
444
|
const u = le(e), S = le(t), we = n == null ? void 0 : n.map(le);
|
|
445
445
|
return at(
|
|
@@ -478,7 +478,7 @@ const Et = Xe(
|
|
|
478
478
|
onFocus: _e,
|
|
479
479
|
onBlur: qe,
|
|
480
480
|
"data-component": "phone-input",
|
|
481
|
-
"data-component-id":
|
|
481
|
+
"data-component-id": j,
|
|
482
482
|
"data-slot": "phone-input",
|
|
483
483
|
"data-read-only": x ? "" : void 0,
|
|
484
484
|
className: vt({
|
|
@@ -493,7 +493,7 @@ const Et = Xe(
|
|
|
493
493
|
"data-slot": "phone-country-fixed",
|
|
494
494
|
className: `${Ie({ size: d })} ds:cursor-default ds:hover:bg-transparent`,
|
|
495
495
|
children: [
|
|
496
|
-
/* @__PURE__ */ r("span", { className: "ds:sr-only", children: `${
|
|
496
|
+
/* @__PURE__ */ r("span", { className: "ds:sr-only", children: `${T}: ${Ce}` }),
|
|
497
497
|
/* @__PURE__ */ r(ue, { country: l, size: ce[d] }),
|
|
498
498
|
/* @__PURE__ */ m("bdi", { dir: "ltr", className: "ds:tabular-nums", children: [
|
|
499
499
|
"+",
|
|
@@ -501,7 +501,7 @@ const Et = Xe(
|
|
|
501
501
|
] })
|
|
502
502
|
]
|
|
503
503
|
}
|
|
504
|
-
) : /* @__PURE__ */ m(O.Root, { open: X, onOpenChange:
|
|
504
|
+
) : /* @__PURE__ */ m(O.Root, { open: X, onOpenChange: B, children: [
|
|
505
505
|
/* @__PURE__ */ r(O.Trigger, { asChild: !0, children: /* @__PURE__ */ m(
|
|
506
506
|
"button",
|
|
507
507
|
{
|
|
@@ -539,7 +539,7 @@ const Et = Xe(
|
|
|
539
539
|
onKeyDown: We,
|
|
540
540
|
sideOffset: 6,
|
|
541
541
|
align: "start",
|
|
542
|
-
"aria-label":
|
|
542
|
+
"aria-label": T,
|
|
543
543
|
className: bt,
|
|
544
544
|
children: /* @__PURE__ */ m(
|
|
545
545
|
I,
|
|
@@ -547,7 +547,7 @@ const Et = Xe(
|
|
|
547
547
|
filter: Qe,
|
|
548
548
|
shouldFilter: !0,
|
|
549
549
|
loop: !0,
|
|
550
|
-
label:
|
|
550
|
+
label: T,
|
|
551
551
|
children: [
|
|
552
552
|
/* @__PURE__ */ r(
|
|
553
553
|
I.Input,
|
|
@@ -572,23 +572,30 @@ const Et = Xe(
|
|
|
572
572
|
)
|
|
573
573
|
}
|
|
574
574
|
),
|
|
575
|
-
/* @__PURE__ */ m(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
children:
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
575
|
+
/* @__PURE__ */ m(
|
|
576
|
+
I.List,
|
|
577
|
+
{
|
|
578
|
+
label: T,
|
|
579
|
+
className: xt,
|
|
580
|
+
children: [
|
|
581
|
+
/* @__PURE__ */ r(I.Empty, { className: wt, children: z("inputs.phone.noCountryFound", "No country found") }),
|
|
582
|
+
F.length > 0 ? /* @__PURE__ */ r(
|
|
583
|
+
I.Group,
|
|
584
|
+
{
|
|
585
|
+
heading: /* @__PURE__ */ r("span", { className: ze, children: z("inputs.phone.popularCountries", "Popular") }),
|
|
586
|
+
children: F.map(xe)
|
|
587
|
+
}
|
|
588
|
+
) : null,
|
|
589
|
+
/* @__PURE__ */ r(
|
|
590
|
+
I.Group,
|
|
591
|
+
{
|
|
592
|
+
heading: F.length > 0 ? /* @__PURE__ */ r("span", { className: ze, children: z("inputs.phone.allCountries", "All countries") }) : void 0,
|
|
593
|
+
children: Ze.map(xe)
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
)
|
|
592
599
|
]
|
|
593
600
|
}
|
|
594
601
|
)
|
|
@@ -636,4 +643,4 @@ export {
|
|
|
636
643
|
Ie as c,
|
|
637
644
|
vt as p
|
|
638
645
|
};
|
|
639
|
-
//# sourceMappingURL=phone-input-
|
|
646
|
+
//# sourceMappingURL=phone-input-DJ4BN8tG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input-C3NrD-nl.js","sources":["../../src/components/phone-input/phone-input.agent.ts","../../src/components/phone-input/phone-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PhoneInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PhoneInputHandle } from './phone-input';\n\nexport const phoneInputAgent: AgentAdapter<PhoneInputHandle> = {\n id: 'phone-input',\n // A phone number is a single form value, not free-form rich text — `set_value`\n // (not `edit_inline`, which is reserved for in-place rich/cell editing).\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.phoneInput.state.value',\n description:\n 'Current E.164 phone number, or empty string when not yet valid.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.phoneInput.state.isEmpty',\n description: 'Whether the input has no value.',\n read: (handle) => handle.getValue() === '',\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'Phone number in E.164 or national format; the parser infers the country.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.phoneInput.actions.setValue',\n description:\n 'Replace the phone number (E.164 or national format; parser will infer country).',\n examples: [\n { args: { value: '+393331234567' }, note: 'Set an Italian mobile.' },\n ],\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.phoneInput.actions.clear',\n description: 'Empty the input. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.phoneInput.actions.focus',\n description: 'Move keyboard focus to the phone-number input.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'phone-input',\n description: 'Marks the PhoneInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type FocusEvent,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { phoneInputAgent } from './phone-input.agent';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useDomValue } from '../_shared/use-dom-value';\n\n/** Agent-readiness curated handle for PhoneInput. */\nexport interface PhoneInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n}\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n findPopoverTrigger,\n useNonModalTabExit,\n} from '../_shared/non-modal-tab-exit';\nimport { Command, defaultFilter } from 'cmdk';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport {\n AsYouType,\n getCountries,\n getCountryCallingCode,\n parsePhoneNumberFromString,\n type CountryCode,\n} from 'libphonenumber-js/min';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport { Flag } from '../flag';\n\nexport interface PhoneInputChangeMeta {\n country: CountryCode;\n isValid: boolean;\n isPossible: boolean;\n type?: string;\n}\n\nexport interface PhoneInputProps {\n value?: string;\n defaultValue?: string;\n /**\n * Country pre-selected when no value is supplied. Defaults to `IT`\n * (AlfaDocs's dominant user base is Italian). Pass a different\n * `CountryCode` to override, or enable `detectBrowserCountry` to\n * derive it from the browser locale.\n */\n defaultCountry?: CountryCode;\n /**\n * When true, infer the default country from `navigator.language` /\n * `Intl.Locale` before falling back to `defaultCountry` (or `IT`).\n * Off by default — most AlfaDocs flows should stay on IT regardless\n * of the visitor's browser locale.\n */\n detectBrowserCountry?: boolean;\n onChange?: (e164: string, meta: PhoneInputChangeMeta) => void;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n popularCountries?: CountryCode[];\n /**\n * Restrict the country picker to this set (ISO 3166-1 alpha-2 codes), in\n * the order given. Unsupported or duplicate codes are dropped; an empty /\n * all-invalid list is ignored (every country stays selectable).\n * `popularCountries` is intersected with this set. When the list resolves\n * to a single country the picker collapses to a fixed, non-interactive\n * dial code — only the national-number field stays editable.\n */\n allowedCountries?: CountryCode[];\n className?: string;\n id?: string;\n name?: string;\n /**\n * What `name` posts in a native form. `national` (the default) posts the\n * number field's own text, e.g. `333 123 4567`. `e164` posts the full\n * number from a hidden field instead, e.g. `+393331234567`: the string\n * `onChange` reports, so it is empty while the text is not yet a number.\n */\n nameFormat?: 'national' | 'e164';\n required?: boolean;\n /**\n * Fires once when focus has left the whole control. Moving between the\n * country picker and the number field does not fire it. It takes no\n * event: the control has several parts, so there is no single target.\n */\n onBlur?: () => void;\n 'aria-label'?: string;\n}\n\nconst phoneInputWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-stretch ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--control-border)] ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n /* The ring is for the number field only. The country button draws its\n own, and `focus-within` here would draw a second one around it. */\n 'ds:has-[input:focus]:outline-[length:var(--focus-ring-width)] ds:has-[input:focus]:outline-solid',\n 'ds:has-[input:focus]:outline-ring ds:has-[input:focus]:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:has-[input:focus]:outline-[CanvasText]',\n 'ds:has-[input:disabled]:cursor-not-allowed ds:has-[input:disabled]:opacity-50',\n /* A locked number looks like a locked TextInput: muted, flat, no dimming.\n Keyed on an explicit attribute, not `has-[input:read-only]`, which also\n matches hidden inputs inside the wrapper. */\n 'ds:data-[read-only]:bg-muted ds:data-[read-only]:shadow-none ds:data-[read-only]:cursor-default',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:has-[input:focus]:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst countryTriggerVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'ds:bg-transparent ds:text-foreground',\n 'ds:border-0 ds:border-e ds:border-e-border',\n 'ds:rounded-s-[var(--radius-sm)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-muted',\n 'ds:focus:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-3 ds:pe-2',\n md: 'ds:ps-3 ds:pe-2',\n lg: 'ds:ps-4 ds:pe-3',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst phoneNumberInputVariants = cva(\n [\n 'ds:flex-1 ds:min-w-0 ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:border-0 ds:outline-none',\n 'ds:disabled:cursor-not-allowed',\n 'ds:read-only:cursor-default',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-2 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:ps-2 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:ps-3 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst pickerContentClasses = [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-72',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst pickerSearchClasses = [\n 'ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:border-0 ds:border-b ds:border-b-border ds:outline-none',\n 'ds:ps-3 ds:pe-3 ds:py-2 ds:text-[var(--font-size-sm)]',\n 'ds:focus:outline-none',\n].join(' ');\n\nconst pickerListClasses =\n 'ds:max-h-72 ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst pickerItemClasses = [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)] ds:ps-3 ds:pe-3 ds:py-2 ds:text-[var(--font-size-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n].join(' ');\n\nconst pickerGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst pickerEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst chevronSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst flagSizeBySize = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const satisfies Record<'sm' | 'md' | 'lg', 'sm' | 'md' | 'lg'>;\n\nfunction countDigitsBefore(str: string, position: number): number {\n let digits = 0;\n for (let i = 0; i < position && i < str.length; i++) {\n if (str[i] >= '0' && str[i] <= '9') digits++;\n }\n return digits;\n}\n\nfunction positionAfterDigits(str: string, targetDigits: number): number {\n if (targetDigits === 0) return 0;\n let count = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] >= '0' && str[i] <= '9') {\n count++;\n if (count === targetDigits) return i + 1;\n }\n }\n return str.length;\n}\n\nfunction resolveDefaultCountry(\n explicit: CountryCode | undefined,\n supported: Set<string>,\n detectBrowser: boolean,\n locale: string,\n allowedList: CountryCode[] | null,\n): CountryCode {\n const allowed =\n allowedList && allowedList.length ? new Set<string>(allowedList) : null;\n const ok = (code: string) =>\n supported.has(code) && (!allowed || allowed.has(code));\n\n if (explicit && ok(explicit)) return explicit;\n\n if (detectBrowser) {\n const fromNavigator =\n typeof navigator !== 'undefined' ? navigator.language : undefined;\n if (fromNavigator) {\n const match = fromNavigator.match(/-([A-Za-z]{2})/);\n if (match) {\n const candidate = match[1].toUpperCase();\n if (ok(candidate)) return candidate as CountryCode;\n }\n }\n\n try {\n const region = new Intl.Locale(locale).region;\n if (region && ok(region.toUpperCase())) {\n return region.toUpperCase() as CountryCode;\n }\n } catch {\n // Intl.Locale may throw on malformed BCP-47 — fall through.\n }\n }\n\n // A restricted list with no explicit / detected hit defaults to the\n // consumer's first listed country; otherwise AlfaDocs's Italian-first\n // fallback.\n if (allowed) return allowedList![0];\n return 'IT';\n}\n\ninterface CountryRow {\n code: CountryCode;\n name: string;\n dialCode: string;\n}\n\nfunction buildCountryRows(\n locale: string,\n countries: CountryCode[],\n): CountryRow[] {\n let displayNames: Intl.DisplayNames;\n try {\n displayNames = new Intl.DisplayNames([locale], { type: 'region' });\n } catch {\n displayNames = new Intl.DisplayNames(['en'], { type: 'region' });\n }\n const rows = countries.map<CountryRow>((code) => ({\n code,\n name: displayNames.of(code) ?? code,\n dialCode: getCountryCallingCode(code),\n }));\n const collator = new Intl.Collator(locale);\n return rows.sort((a, b) => collator.compare(a.name, b.name));\n}\n\nexport const PhoneInput = forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value,\n defaultValue,\n defaultCountry,\n detectBrowserCountry = false,\n onChange,\n size = 'md',\n tone = 'default',\n disabled,\n readOnly,\n placeholder,\n popularCountries,\n allowedCountries,\n className,\n id,\n name,\n nameFormat = 'national',\n required,\n onBlur,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t, i18n } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const supportedCountries = useMemo(\n () => new Set(getCountries() as string[]),\n [],\n );\n\n // Consumer-restricted country set, filtered to supported + deduped with\n // order preserved. `null` means \"no restriction\" (every country shown).\n const allowedList = useMemo<CountryCode[] | null>(() => {\n if (!allowedCountries || allowedCountries.length === 0) return null;\n const seen = new Set<string>();\n const filtered = allowedCountries.filter((code) => {\n if (!supportedCountries.has(code) || seen.has(code)) return false;\n seen.add(code);\n return true;\n });\n return filtered.length > 0 ? filtered : null;\n }, [allowedCountries, supportedCountries]);\n\n // A single allowed country has nothing to pick — render the dial code as a\n // fixed, non-interactive prefix instead of a one-item picker.\n const isCountryFixed = allowedList !== null && allowedList.length === 1;\n\n const initialState = useMemo(() => {\n const resolvedCountry = resolveDefaultCountry(\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n i18n.language,\n allowedList,\n );\n const raw = value ?? defaultValue;\n if (raw) {\n const parsed = parsePhoneNumberFromString(raw);\n if (parsed?.country) {\n // Clamp the parsed country to `allowedCountries` so the rendered dial\n // code can never leave the allowed set — a single-country lock stays\n // on its country even when handed an off-set value.\n if (!allowedList || allowedList.includes(parsed.country)) {\n return {\n country: parsed.country,\n display: parsed.formatNational(),\n pinned: true,\n };\n }\n return {\n country: resolvedCountry,\n display: new AsYouType(resolvedCountry).input(\n parsed.nationalNumber,\n ),\n pinned: true,\n };\n }\n return { country: resolvedCountry, display: raw, pinned: false };\n }\n return { country: resolvedCountry, display: '', pinned: false };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [country, setCountry] = useState<CountryCode>(initialState.country);\n const [displayValue, setDisplayValue] = useState<string>(\n initialState.display,\n );\n const [pickerOpen, setPickerOpen] = useState(false);\n const [pickerSearch, setPickerSearch] = useState('');\n\n const isControlled = value !== undefined;\n const lastEmittedRef = useRef<string>('');\n const pendingCaretRef = useRef<number | null>(null);\n // Pins the country once the user (or an incoming value) selects one,\n // so the locale-flip effect below stops re-resolving.\n const userSelectedCountryRef = useRef(initialState.pinned);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const composedInputRef = composeRefs(ref, inputRef);\n // The number is written to the input's DOM property, never to its\n // `value` attribute, where a copied outerHTML or a session replay\n // could read it. Declared before the caret effect below, which places\n // the caret in the text this one writes.\n const syncDisplay = useDomValue(inputRef, displayValue);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const pickerContentRef = useRef<HTMLDivElement | null>(null);\n\n // Re-resolve the country when i18n.language flips from the bootstrap\n // fallback to the real locale on first paint, unless the user has\n // already pinned a country.\n useEffect(() => {\n if (userSelectedCountryRef.current) return;\n const next = resolveDefaultCountry(\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n i18n.language,\n allowedList,\n );\n setCountry((prev) => (prev === next ? prev : next));\n }, [\n i18n.language,\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n allowedList,\n ]);\n\n // Sync state back from a controlled `value` prop change that did not\n // originate from this component (e.g. parent reset). Skip the sync when\n // the incoming value matches what we just emitted.\n useEffect(() => {\n if (!isControlled) return;\n const current = value ?? '';\n if (current === lastEmittedRef.current) return;\n if (current === '') {\n setDisplayValue('');\n return;\n }\n const parsed = parsePhoneNumberFromString(current);\n if (\n parsed?.country &&\n (!allowedList || allowedList.includes(parsed.country))\n ) {\n userSelectedCountryRef.current = true;\n setCountry(parsed.country);\n setDisplayValue(parsed.formatNational());\n } else {\n // Off-set or unparseable controlled value — keep the country within the\n // allowed set; only sync the displayed digits.\n setDisplayValue(parsed ? parsed.formatNational() : current);\n }\n }, [value, isControlled, allowedList]);\n\n useIsomorphicLayoutEffect(() => {\n if (pendingCaretRef.current == null) return;\n const pos = pendingCaretRef.current;\n pendingCaretRef.current = null;\n const node = inputRef.current;\n if (node && document.activeElement === node) {\n node.setSelectionRange(pos, pos);\n }\n });\n\n const emit = useCallback(\n (nextDisplay: string, nextCountry: CountryCode) => {\n const parsed = parsePhoneNumberFromString(nextDisplay, nextCountry);\n const e164 = parsed?.number ?? '';\n lastEmittedRef.current = e164;\n onChange?.(e164, {\n country: nextCountry,\n isValid: parsed?.isValid() ?? false,\n isPossible: parsed?.isPossible() ?? false,\n type: parsed?.getType(),\n });\n },\n [onChange],\n );\n\n const controlId = useFormFieldControlId(ctx, id);\n const inputId = id ?? (inFormField ? controlId : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.phone.placeholder', 'Phone number');\n\n /* Focus leaving the whole control. The picker is portalled, so it is\n outside the wrapper in the DOM but still part of the control. */\n const onBlurRef = useRef(onBlur);\n onBlurRef.current = onBlur;\n const focusInsideRef = useRef(false);\n const pressInsideRef = useRef(false);\n const isInside = useCallback(\n (node: EventTarget | null) =>\n node instanceof Node &&\n Boolean(\n wrapperRef.current?.contains(node) ||\n pickerContentRef.current?.contains(node),\n ),\n [],\n );\n const leave = useCallback(() => {\n if (!focusInsideRef.current) return;\n focusInsideRef.current = false;\n onBlurRef.current?.();\n }, []);\n const handleFocus = () => {\n focusInsideRef.current = true;\n };\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n const next = event.relatedTarget;\n if (isInside(next)) return;\n /* Safari does not focus a button on click: pressing the country\n button blurs the number field to nowhere. */\n if (next === null && pressInsideRef.current) return;\n leave();\n };\n const listensForBlur = onBlur !== undefined;\n useEffect(() => {\n if (!listensForBlur) return;\n let check: number | undefined;\n const onPointerDown = (event: PointerEvent) => {\n pressInsideRef.current = isInside(event.target);\n if (pressInsideRef.current) return;\n /* A press outside closes the picker, and its focused search box\n can unmount without a blur event. */\n check = window.setTimeout(() => {\n if (!isInside(document.activeElement)) leave();\n }, 0);\n };\n const onPointerUp = () => {\n pressInsideRef.current = false;\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('pointerup', onPointerUp, true);\n document.addEventListener('pointercancel', onPointerUp, true);\n return () => {\n window.clearTimeout(check);\n document.removeEventListener('pointerdown', onPointerDown, true);\n document.removeEventListener('pointerup', onPointerUp, true);\n document.removeEventListener('pointercancel', onPointerUp, true);\n };\n }, [listensForBlur, isInside, leave]);\n\n const postsE164 = nameFormat === 'e164' && name !== undefined;\n const e164Value = postsE164\n ? (parsePhoneNumberFromString(displayValue, country)?.number ?? '')\n : '';\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n // A keystroke the formatter drops (or a read-only field refuses)\n // leaves the text as it was, so no render follows: ask for one, to\n // take the refused character out.\n syncDisplay();\n if (readOnly) return;\n const target = event.target;\n const raw = target.value;\n const caret = target.selectionStart ?? raw.length;\n const digitsBefore = countDigitsBefore(raw, caret);\n\n const formatter = new AsYouType(country);\n const formatted = formatter.input(raw);\n\n pendingCaretRef.current = positionAfterDigits(formatted, digitsBefore);\n setDisplayValue(formatted);\n emit(formatted, country);\n };\n\n const lastEmittedRefForHandle = lastEmittedRef;\n const agentHandle = useMemo<PhoneInputHandle>(\n () => ({\n getValue: () => lastEmittedRefForHandle.current,\n setValue: (next) => {\n if (next === '') {\n setDisplayValue('');\n emit('', country);\n return;\n }\n const parsed = parsePhoneNumberFromString(next);\n if (parsed?.country) {\n userSelectedCountryRef.current = true;\n setCountry(parsed.country);\n setDisplayValue(parsed.formatNational());\n emit(parsed.formatNational(), parsed.country);\n } else {\n const formatter = new AsYouType(country);\n const formatted = formatter.input(next);\n setDisplayValue(formatted);\n emit(formatted, country);\n }\n },\n clear: () => {\n setDisplayValue('');\n emit('', country);\n },\n focus: () => inputRef.current?.focus(),\n }),\n [country, emit, lastEmittedRefForHandle],\n );\n useAgentRegistration(phoneInputAgent, agentHandle, id);\n const exitOnTab = useNonModalTabExit(true, {\n getAnchor: findPopoverTrigger,\n onReturnToTrigger: () => setPickerOpen(false),\n });\n\n const handleCountrySelect = (nextCountry: CountryCode) => {\n if (nextCountry === country) {\n setPickerOpen(false);\n return;\n }\n const digits = displayValue.replace(/\\D/g, '');\n const formatter = new AsYouType(nextCountry);\n const reformatted = digits ? formatter.input(digits) : '';\n userSelectedCountryRef.current = true;\n setCountry(nextCountry);\n setDisplayValue(reformatted);\n setPickerOpen(false);\n setPickerSearch('');\n emit(reformatted, nextCountry);\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n };\n\n const countryRows = useMemo(\n () =>\n buildCountryRows(\n i18n.language,\n allowedList ?? (Array.from(supportedCountries) as CountryCode[]),\n ),\n [i18n.language, supportedCountries, allowedList],\n );\n\n const popularRows = useMemo(() => {\n if (!popularCountries || popularCountries.length === 0) return [];\n const byCode = new Map(countryRows.map((row) => [row.code, row]));\n return popularCountries\n .filter((code): code is CountryCode => supportedCountries.has(code))\n .map((code) => byCode.get(code))\n .filter((row): row is CountryRow => Boolean(row));\n }, [popularCountries, countryRows, supportedCountries]);\n\n const popularCodes = useMemo(\n () => new Set(popularRows.map((row) => row.code)),\n [popularRows],\n );\n\n const remainingRows = useMemo(\n () =>\n popularCodes.size > 0\n ? countryRows.filter((row) => !popularCodes.has(row.code))\n : countryRows,\n [countryRows, popularCodes],\n );\n\n const selected = useMemo(\n () => countryRows.find((row) => row.code === country),\n [countryRows, country],\n );\n const selectedDialCode = selected ? selected.dialCode : '';\n const selectedName = selected ? selected.name : country;\n\n const triggerLabel = t('inputs.phone.countryPickerLabel', 'Country');\n const triggerAccessibleName = `${triggerLabel}: ${selectedName}, +${selectedDialCode}`;\n\n const filterFn = useCallback(\n (candidate: string, searchStr: string, keywords?: string[]) => {\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [],\n );\n\n const renderRow = (row: CountryRow) => {\n const accessibleLabel = `${row.name}, +${row.dialCode}`;\n return (\n <Command.Item\n key={row.code}\n value={row.code}\n keywords={[row.name, row.dialCode, `+${row.dialCode}`]}\n onSelect={() => handleCountrySelect(row.code)}\n className={pickerItemClasses}\n aria-label={accessibleLabel}\n >\n <Flag country={row.code} size={flagSizeBySize[size]} />\n <span className=\"ds:flex-1 ds:truncate\">{row.name}</span>\n <bdi dir=\"ltr\" className=\"ds:text-muted-foreground ds:tabular-nums\">\n +{row.dialCode}\n </bdi>\n </Command.Item>\n );\n };\n\n return (\n <div\n ref={wrapperRef}\n onFocus={handleFocus}\n onBlur={handleBlur}\n data-component=\"phone-input\"\n data-component-id={id}\n data-slot=\"phone-input\"\n data-read-only={readOnly ? '' : undefined}\n className={phoneInputWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n {isCountryFixed ? (\n <span\n data-slot=\"phone-country-fixed\"\n className={`${countryTriggerVariants({ size })} ds:cursor-default ds:hover:bg-transparent`}\n >\n <span className=\"ds:sr-only\">{`${triggerLabel}: ${selectedName}`}</span>\n <Flag country={country} size={flagSizeBySize[size]} />\n <bdi dir=\"ltr\" className=\"ds:tabular-nums\">\n +{selectedDialCode}\n </bdi>\n </span>\n ) : (\n <Popover.Root open={pickerOpen} onOpenChange={setPickerOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n // A read-only number keeps its country too. The wrapper dims only for\n // a disabled number field, so a locked number stays legible.\n disabled={effectiveDisabled || Boolean(readOnly)}\n // What opens is a dialog: a search box over the list.\n aria-haspopup=\"dialog\"\n aria-expanded={pickerOpen}\n aria-label={triggerAccessibleName}\n className={countryTriggerVariants({ size })}\n >\n <Flag country={country} size={flagSizeBySize[size]} />\n <bdi dir=\"ltr\" className=\"ds:tabular-nums\">\n +{selectedDialCode}\n </bdi>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n chevronSizeBySize[size],\n 'ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n pickerOpen ? 'ds:rotate-180' : '',\n ].join(' ')}\n />\n </button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n ref={pickerContentRef}\n onKeyDown={exitOnTab}\n sideOffset={6}\n align=\"start\"\n // Radix gives the content role=\"dialog\" with no name.\n aria-label={triggerLabel}\n className={pickerContentClasses}\n >\n <Command\n filter={filterFn}\n shouldFilter\n loop\n label={triggerLabel}\n >\n <Command.Input\n asChild\n value={pickerSearch}\n onValueChange={setPickerSearch}\n >\n <input\n data-phone-country-search=\"true\"\n type=\"text\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n placeholder={t(\n 'inputs.phone.searchCountry',\n 'Search countries…',\n )}\n className={pickerSearchClasses}\n />\n </Command.Input>\n <Command.List className={pickerListClasses}>\n <Command.Empty className={pickerEmptyClasses}>\n {t('inputs.phone.noCountryFound', 'No country found')}\n </Command.Empty>\n {popularRows.length > 0 ? (\n <Command.Group\n heading={\n <span className={pickerGroupHeadingClasses}>\n {t('inputs.phone.popularCountries', 'Popular')}\n </span>\n }\n >\n {popularRows.map(renderRow)}\n </Command.Group>\n ) : null}\n <Command.Group\n heading={\n popularRows.length > 0 ? (\n <span className={pickerGroupHeadingClasses}>\n {t('inputs.phone.allCountries', 'All countries')}\n </span>\n ) : undefined\n }\n >\n {remainingRows.map(renderRow)}\n </Command.Group>\n </Command.List>\n </Command>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n )}\n <input\n ref={composedInputRef}\n id={inputId}\n name={postsE164 ? undefined : name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel-national\"\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={readOnly}\n required={effectiveRequired}\n aria-label={ariaLabel}\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onChange={handleInputChange}\n className={phoneNumberInputVariants({ size })}\n />\n {postsE164 ? (\n <input\n type=\"hidden\"\n name={name}\n value={e164Value}\n disabled={effectiveDisabled}\n />\n ) : null}\n </div>\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport {\n phoneInputWrapperVariants,\n countryTriggerVariants,\n phoneNumberInputVariants,\n};\n"],"names":["phoneInputAgent","handle","args","phoneInputWrapperVariants","cva","countryTriggerVariants","phoneNumberInputVariants","pickerContentClasses","pickerSearchClasses","pickerListClasses","pickerItemClasses","MENU_ROW_HIGHLIGHT","pickerGroupHeadingClasses","pickerEmptyClasses","chevronSizeBySize","flagSizeBySize","countDigitsBefore","str","position","digits","i","positionAfterDigits","targetDigits","count","resolveDefaultCountry","explicit","supported","detectBrowser","locale","allowedList","allowed","ok","code","fromNavigator","match","candidate","region","buildCountryRows","countries","displayNames","rows","getCountryCallingCode","collator","a","b","PhoneInput","forwardRef","value","defaultValue","defaultCountry","detectBrowserCountry","onChange","size","tone","disabled","readOnly","placeholder","popularCountries","allowedCountries","className","id","name","nameFormat","required","onBlur","ariaLabel","ref","t","i18n","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","supportedCountries","useMemo","getCountries","seen","filtered","isCountryFixed","initialState","resolvedCountry","raw","parsed","parsePhoneNumberFromString","AsYouType","country","setCountry","useState","displayValue","setDisplayValue","pickerOpen","setPickerOpen","pickerSearch","setPickerSearch","isControlled","lastEmittedRef","useRef","pendingCaretRef","userSelectedCountryRef","inputRef","composedInputRef","composeRefs","syncDisplay","useDomValue","wrapperRef","pickerContentRef","useEffect","next","prev","current","useIsomorphicLayoutEffect","pos","node","emit","useCallback","nextDisplay","nextCountry","e164","controlId","useFormFieldControlId","inputId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","onBlurRef","focusInsideRef","pressInsideRef","isInside","_a","_b","leave","handleFocus","handleBlur","event","listensForBlur","check","onPointerDown","onPointerUp","postsE164","e164Value","handleInputChange","target","caret","digitsBefore","formatted","lastEmittedRefForHandle","agentHandle","useAgentRegistration","exitOnTab","useNonModalTabExit","findPopoverTrigger","handleCountrySelect","formatter","reformatted","countryRows","popularRows","byCode","row","popularCodes","remainingRows","selected","selectedDialCode","selectedName","triggerLabel","triggerAccessibleName","filterFn","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","renderRow","accessibleLabel","jsxs","Command","jsx","Flag","Popover","ChevronDown"],"mappings":";;;;;;;;;;;;;;;;;AASO,MAAMA,KAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,OA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AA,cACC,KAAKhF;AAAA,cACL,IAAIoB;AAAA,cACJ,MAAMqB,KAAY,SAAYlF;AAAA,cAC9B,MAAK;AAAA,cACL,WAAU;AAAA,cACV,cAAa;AAAA,cACb,aAAamE;AAAA,cACb,UAAUL;AAAA,cACV,UAAApE;AAAA,cACA,UAAUqE;AAAA,cACV,cAAY3D;AAAA,cACZ,oBAAkB8D;AAAA,cAClB,gBAAcF,MAAoB;AAAA,cAClC,UAAUoB;AAAA,cACV,WAAW3I,GAAyB,EAAE,MAAA8C,EAAA,CAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAE7C2F,KACC,gBAAAuC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAAzH;AAAA,cACA,OAAOmF;AAAA,cACP,UAAUrB;AAAA,YAAA;AAAA,UAAA,IAEV;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA9E,GAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"phone-input-DJ4BN8tG.js","sources":["../../src/components/phone-input/phone-input.agent.ts","../../src/components/phone-input/phone-input.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — PhoneInput. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { PhoneInputHandle } from './phone-input';\n\nexport const phoneInputAgent: AgentAdapter<PhoneInputHandle> = {\n id: 'phone-input',\n // A phone number is a single form value, not free-form rich text — `set_value`\n // (not `edit_inline`, which is reserved for in-place rich/cell editing).\n capabilities: ['set_value'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.phoneInput.state.value',\n description:\n 'Current E.164 phone number, or empty string when not yet valid.',\n read: (handle) => handle.getValue(),\n },\n isEmpty: {\n type: 'boolean',\n descriptionKey: 'ui.agent.phoneInput.state.isEmpty',\n description: 'Whether the input has no value.',\n read: (handle) => handle.getValue() === '',\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n description:\n 'Phone number in E.164 or national format; the parser infers the country.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.phoneInput.actions.setValue',\n description:\n 'Replace the phone number (E.164 or national format; parser will infer country).',\n examples: [\n { args: { value: '+393331234567' }, note: 'Set an Italian mobile.' },\n ],\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.phoneInput.actions.clear',\n description: 'Empty the input. Loses any typed value.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n focus: {\n safety: 'read',\n descriptionKey: 'ui.agent.phoneInput.actions.focus',\n description: 'Move keyboard focus to the phone-number input.',\n invoke: (handle) => {\n handle.focus();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'phone-input',\n description: 'Marks the PhoneInput wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ChangeEvent,\n type FocusEvent,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { phoneInputAgent } from './phone-input.agent';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useDomValue } from '../_shared/use-dom-value';\n\n/** Agent-readiness curated handle for PhoneInput. */\nexport interface PhoneInputHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n focus: () => void;\n}\nimport * as Popover from '@radix-ui/react-popover';\nimport {\n findPopoverTrigger,\n useNonModalTabExit,\n} from '../_shared/non-modal-tab-exit';\nimport { Command, defaultFilter } from 'cmdk';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ChevronDown } from 'lucide-react';\nimport {\n AsYouType,\n getCountries,\n getCountryCallingCode,\n parsePhoneNumberFromString,\n type CountryCode,\n} from 'libphonenumber-js/min';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlId,\n} from '../form-field/form-field-context';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport { Flag } from '../flag';\n\nexport interface PhoneInputChangeMeta {\n country: CountryCode;\n isValid: boolean;\n isPossible: boolean;\n type?: string;\n}\n\nexport interface PhoneInputProps {\n value?: string;\n defaultValue?: string;\n /**\n * Country pre-selected when no value is supplied. Defaults to `IT`\n * (AlfaDocs's dominant user base is Italian). Pass a different\n * `CountryCode` to override, or enable `detectBrowserCountry` to\n * derive it from the browser locale.\n */\n defaultCountry?: CountryCode;\n /**\n * When true, infer the default country from `navigator.language` /\n * `Intl.Locale` before falling back to `defaultCountry` (or `IT`).\n * Off by default — most AlfaDocs flows should stay on IT regardless\n * of the visitor's browser locale.\n */\n detectBrowserCountry?: boolean;\n onChange?: (e164: string, meta: PhoneInputChangeMeta) => void;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n disabled?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n popularCountries?: CountryCode[];\n /**\n * Restrict the country picker to this set (ISO 3166-1 alpha-2 codes), in\n * the order given. Unsupported or duplicate codes are dropped; an empty /\n * all-invalid list is ignored (every country stays selectable).\n * `popularCountries` is intersected with this set. When the list resolves\n * to a single country the picker collapses to a fixed, non-interactive\n * dial code — only the national-number field stays editable.\n */\n allowedCountries?: CountryCode[];\n className?: string;\n id?: string;\n name?: string;\n /**\n * What `name` posts in a native form. `national` (the default) posts the\n * number field's own text, e.g. `333 123 4567`. `e164` posts the full\n * number from a hidden field instead, e.g. `+393331234567`: the string\n * `onChange` reports, so it is empty while the text is not yet a number.\n */\n nameFormat?: 'national' | 'e164';\n required?: boolean;\n /**\n * Fires once when focus has left the whole control. Moving between the\n * country picker and the number field does not fire it. It takes no\n * event: the control has several parts, so there is no single target.\n */\n onBlur?: () => void;\n 'aria-label'?: string;\n}\n\nconst phoneInputWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-stretch ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-[color:var(--control-border)] ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n /* The ring is for the number field only. The country button draws its\n own, and `focus-within` here would draw a second one around it. */\n 'ds:has-[input:focus]:outline-[length:var(--focus-ring-width)] ds:has-[input:focus]:outline-solid',\n 'ds:has-[input:focus]:outline-ring ds:has-[input:focus]:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:has-[input:focus]:outline-[CanvasText]',\n 'ds:has-[input:disabled]:cursor-not-allowed ds:has-[input:disabled]:opacity-50',\n /* A locked number looks like a locked TextInput: muted, flat, no dimming.\n Keyed on an explicit attribute, not `has-[input:read-only]`, which also\n matches hidden inputs inside the wrapper. */\n 'ds:data-[read-only]:bg-muted ds:data-[read-only]:shadow-none ds:data-[read-only]:cursor-default',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:has-[input:focus]:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst countryTriggerVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]',\n 'ds:bg-transparent ds:text-foreground',\n 'ds:border-0 ds:border-e ds:border-e-border',\n 'ds:rounded-s-[var(--radius-sm)]',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-muted',\n 'ds:focus:outline-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-3 ds:pe-2',\n md: 'ds:ps-3 ds:pe-2',\n lg: 'ds:ps-4 ds:pe-3',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst phoneNumberInputVariants = cva(\n [\n 'ds:flex-1 ds:min-w-0 ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:border-0 ds:outline-none',\n 'ds:disabled:cursor-not-allowed',\n 'ds:read-only:cursor-default',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:ps-2 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:ps-2 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:ps-3 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst pickerContentClasses = [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-72',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n].join(' ');\n\nconst pickerSearchClasses = [\n 'ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:border-0 ds:border-b ds:border-b-border ds:outline-none',\n 'ds:ps-3 ds:pe-3 ds:py-2 ds:text-[var(--font-size-sm)]',\n 'ds:focus:outline-none',\n].join(' ');\n\nconst pickerListClasses =\n 'ds:max-h-72 ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst pickerItemClasses = [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)] ds:ps-3 ds:pe-3 ds:py-2 ds:text-[var(--font-size-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n].join(' ');\n\nconst pickerGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst pickerEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst chevronSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst flagSizeBySize = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const satisfies Record<'sm' | 'md' | 'lg', 'sm' | 'md' | 'lg'>;\n\nfunction countDigitsBefore(str: string, position: number): number {\n let digits = 0;\n for (let i = 0; i < position && i < str.length; i++) {\n if (str[i] >= '0' && str[i] <= '9') digits++;\n }\n return digits;\n}\n\nfunction positionAfterDigits(str: string, targetDigits: number): number {\n if (targetDigits === 0) return 0;\n let count = 0;\n for (let i = 0; i < str.length; i++) {\n if (str[i] >= '0' && str[i] <= '9') {\n count++;\n if (count === targetDigits) return i + 1;\n }\n }\n return str.length;\n}\n\nfunction resolveDefaultCountry(\n explicit: CountryCode | undefined,\n supported: Set<string>,\n detectBrowser: boolean,\n locale: string,\n allowedList: CountryCode[] | null,\n): CountryCode {\n const allowed =\n allowedList && allowedList.length ? new Set<string>(allowedList) : null;\n const ok = (code: string) =>\n supported.has(code) && (!allowed || allowed.has(code));\n\n if (explicit && ok(explicit)) return explicit;\n\n if (detectBrowser) {\n const fromNavigator =\n typeof navigator !== 'undefined' ? navigator.language : undefined;\n if (fromNavigator) {\n const match = fromNavigator.match(/-([A-Za-z]{2})/);\n if (match) {\n const candidate = match[1].toUpperCase();\n if (ok(candidate)) return candidate as CountryCode;\n }\n }\n\n try {\n const region = new Intl.Locale(locale).region;\n if (region && ok(region.toUpperCase())) {\n return region.toUpperCase() as CountryCode;\n }\n } catch {\n // Intl.Locale may throw on malformed BCP-47 — fall through.\n }\n }\n\n // A restricted list with no explicit / detected hit defaults to the\n // consumer's first listed country; otherwise AlfaDocs's Italian-first\n // fallback.\n if (allowed) return allowedList![0];\n return 'IT';\n}\n\ninterface CountryRow {\n code: CountryCode;\n name: string;\n dialCode: string;\n}\n\nfunction buildCountryRows(\n locale: string,\n countries: CountryCode[],\n): CountryRow[] {\n let displayNames: Intl.DisplayNames;\n try {\n displayNames = new Intl.DisplayNames([locale], { type: 'region' });\n } catch {\n displayNames = new Intl.DisplayNames(['en'], { type: 'region' });\n }\n const rows = countries.map<CountryRow>((code) => ({\n code,\n name: displayNames.of(code) ?? code,\n dialCode: getCountryCallingCode(code),\n }));\n const collator = new Intl.Collator(locale);\n return rows.sort((a, b) => collator.compare(a.name, b.name));\n}\n\nexport const PhoneInput = forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value,\n defaultValue,\n defaultCountry,\n detectBrowserCountry = false,\n onChange,\n size = 'md',\n tone = 'default',\n disabled,\n readOnly,\n placeholder,\n popularCountries,\n allowedCountries,\n className,\n id,\n name,\n nameFormat = 'national',\n required,\n onBlur,\n 'aria-label': ariaLabel,\n },\n ref,\n ) {\n const { t, i18n } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const supportedCountries = useMemo(\n () => new Set(getCountries() as string[]),\n [],\n );\n\n // Consumer-restricted country set, filtered to supported + deduped with\n // order preserved. `null` means \"no restriction\" (every country shown).\n const allowedList = useMemo<CountryCode[] | null>(() => {\n if (!allowedCountries || allowedCountries.length === 0) return null;\n const seen = new Set<string>();\n const filtered = allowedCountries.filter((code) => {\n if (!supportedCountries.has(code) || seen.has(code)) return false;\n seen.add(code);\n return true;\n });\n return filtered.length > 0 ? filtered : null;\n }, [allowedCountries, supportedCountries]);\n\n // A single allowed country has nothing to pick — render the dial code as a\n // fixed, non-interactive prefix instead of a one-item picker.\n const isCountryFixed = allowedList !== null && allowedList.length === 1;\n\n const initialState = useMemo(() => {\n const resolvedCountry = resolveDefaultCountry(\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n i18n.language,\n allowedList,\n );\n const raw = value ?? defaultValue;\n if (raw) {\n const parsed = parsePhoneNumberFromString(raw);\n if (parsed?.country) {\n // Clamp the parsed country to `allowedCountries` so the rendered dial\n // code can never leave the allowed set — a single-country lock stays\n // on its country even when handed an off-set value.\n if (!allowedList || allowedList.includes(parsed.country)) {\n return {\n country: parsed.country,\n display: parsed.formatNational(),\n pinned: true,\n };\n }\n return {\n country: resolvedCountry,\n display: new AsYouType(resolvedCountry).input(\n parsed.nationalNumber,\n ),\n pinned: true,\n };\n }\n return { country: resolvedCountry, display: raw, pinned: false };\n }\n return { country: resolvedCountry, display: '', pinned: false };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const [country, setCountry] = useState<CountryCode>(initialState.country);\n const [displayValue, setDisplayValue] = useState<string>(\n initialState.display,\n );\n const [pickerOpen, setPickerOpen] = useState(false);\n const [pickerSearch, setPickerSearch] = useState('');\n\n const isControlled = value !== undefined;\n const lastEmittedRef = useRef<string>('');\n const pendingCaretRef = useRef<number | null>(null);\n // Pins the country once the user (or an incoming value) selects one,\n // so the locale-flip effect below stops re-resolving.\n const userSelectedCountryRef = useRef(initialState.pinned);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const composedInputRef = composeRefs(ref, inputRef);\n // The number is written to the input's DOM property, never to its\n // `value` attribute, where a copied outerHTML or a session replay\n // could read it. Declared before the caret effect below, which places\n // the caret in the text this one writes.\n const syncDisplay = useDomValue(inputRef, displayValue);\n const wrapperRef = useRef<HTMLDivElement | null>(null);\n const pickerContentRef = useRef<HTMLDivElement | null>(null);\n\n // Re-resolve the country when i18n.language flips from the bootstrap\n // fallback to the real locale on first paint, unless the user has\n // already pinned a country.\n useEffect(() => {\n if (userSelectedCountryRef.current) return;\n const next = resolveDefaultCountry(\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n i18n.language,\n allowedList,\n );\n setCountry((prev) => (prev === next ? prev : next));\n }, [\n i18n.language,\n defaultCountry,\n supportedCountries,\n detectBrowserCountry,\n allowedList,\n ]);\n\n // Sync state back from a controlled `value` prop change that did not\n // originate from this component (e.g. parent reset). Skip the sync when\n // the incoming value matches what we just emitted.\n useEffect(() => {\n if (!isControlled) return;\n const current = value ?? '';\n if (current === lastEmittedRef.current) return;\n if (current === '') {\n setDisplayValue('');\n return;\n }\n const parsed = parsePhoneNumberFromString(current);\n if (\n parsed?.country &&\n (!allowedList || allowedList.includes(parsed.country))\n ) {\n userSelectedCountryRef.current = true;\n setCountry(parsed.country);\n setDisplayValue(parsed.formatNational());\n } else {\n // Off-set or unparseable controlled value — keep the country within the\n // allowed set; only sync the displayed digits.\n setDisplayValue(parsed ? parsed.formatNational() : current);\n }\n }, [value, isControlled, allowedList]);\n\n useIsomorphicLayoutEffect(() => {\n if (pendingCaretRef.current == null) return;\n const pos = pendingCaretRef.current;\n pendingCaretRef.current = null;\n const node = inputRef.current;\n if (node && document.activeElement === node) {\n node.setSelectionRange(pos, pos);\n }\n });\n\n const emit = useCallback(\n (nextDisplay: string, nextCountry: CountryCode) => {\n const parsed = parsePhoneNumberFromString(nextDisplay, nextCountry);\n const e164 = parsed?.number ?? '';\n lastEmittedRef.current = e164;\n onChange?.(e164, {\n country: nextCountry,\n isValid: parsed?.isValid() ?? false,\n isPossible: parsed?.isPossible() ?? false,\n type: parsed?.getType(),\n });\n },\n [onChange],\n );\n\n const controlId = useFormFieldControlId(ctx, id);\n const inputId = id ?? (inFormField ? controlId : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.phone.placeholder', 'Phone number');\n\n /* Focus leaving the whole control. The picker is portalled, so it is\n outside the wrapper in the DOM but still part of the control. */\n const onBlurRef = useRef(onBlur);\n onBlurRef.current = onBlur;\n const focusInsideRef = useRef(false);\n const pressInsideRef = useRef(false);\n const isInside = useCallback(\n (node: EventTarget | null) =>\n node instanceof Node &&\n Boolean(\n wrapperRef.current?.contains(node) ||\n pickerContentRef.current?.contains(node),\n ),\n [],\n );\n const leave = useCallback(() => {\n if (!focusInsideRef.current) return;\n focusInsideRef.current = false;\n onBlurRef.current?.();\n }, []);\n const handleFocus = () => {\n focusInsideRef.current = true;\n };\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n const next = event.relatedTarget;\n if (isInside(next)) return;\n /* Safari does not focus a button on click: pressing the country\n button blurs the number field to nowhere. */\n if (next === null && pressInsideRef.current) return;\n leave();\n };\n const listensForBlur = onBlur !== undefined;\n useEffect(() => {\n if (!listensForBlur) return;\n let check: number | undefined;\n const onPointerDown = (event: PointerEvent) => {\n pressInsideRef.current = isInside(event.target);\n if (pressInsideRef.current) return;\n /* A press outside closes the picker, and its focused search box\n can unmount without a blur event. */\n check = window.setTimeout(() => {\n if (!isInside(document.activeElement)) leave();\n }, 0);\n };\n const onPointerUp = () => {\n pressInsideRef.current = false;\n };\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('pointerup', onPointerUp, true);\n document.addEventListener('pointercancel', onPointerUp, true);\n return () => {\n window.clearTimeout(check);\n document.removeEventListener('pointerdown', onPointerDown, true);\n document.removeEventListener('pointerup', onPointerUp, true);\n document.removeEventListener('pointercancel', onPointerUp, true);\n };\n }, [listensForBlur, isInside, leave]);\n\n const postsE164 = nameFormat === 'e164' && name !== undefined;\n const e164Value = postsE164\n ? (parsePhoneNumberFromString(displayValue, country)?.number ?? '')\n : '';\n\n const handleInputChange = (event: ChangeEvent<HTMLInputElement>) => {\n // A keystroke the formatter drops (or a read-only field refuses)\n // leaves the text as it was, so no render follows: ask for one, to\n // take the refused character out.\n syncDisplay();\n if (readOnly) return;\n const target = event.target;\n const raw = target.value;\n const caret = target.selectionStart ?? raw.length;\n const digitsBefore = countDigitsBefore(raw, caret);\n\n const formatter = new AsYouType(country);\n const formatted = formatter.input(raw);\n\n pendingCaretRef.current = positionAfterDigits(formatted, digitsBefore);\n setDisplayValue(formatted);\n emit(formatted, country);\n };\n\n const lastEmittedRefForHandle = lastEmittedRef;\n const agentHandle = useMemo<PhoneInputHandle>(\n () => ({\n getValue: () => lastEmittedRefForHandle.current,\n setValue: (next) => {\n if (next === '') {\n setDisplayValue('');\n emit('', country);\n return;\n }\n const parsed = parsePhoneNumberFromString(next);\n if (parsed?.country) {\n userSelectedCountryRef.current = true;\n setCountry(parsed.country);\n setDisplayValue(parsed.formatNational());\n emit(parsed.formatNational(), parsed.country);\n } else {\n const formatter = new AsYouType(country);\n const formatted = formatter.input(next);\n setDisplayValue(formatted);\n emit(formatted, country);\n }\n },\n clear: () => {\n setDisplayValue('');\n emit('', country);\n },\n focus: () => inputRef.current?.focus(),\n }),\n [country, emit, lastEmittedRefForHandle],\n );\n useAgentRegistration(phoneInputAgent, agentHandle, id);\n const exitOnTab = useNonModalTabExit(true, {\n getAnchor: findPopoverTrigger,\n onReturnToTrigger: () => setPickerOpen(false),\n });\n\n const handleCountrySelect = (nextCountry: CountryCode) => {\n if (nextCountry === country) {\n setPickerOpen(false);\n return;\n }\n const digits = displayValue.replace(/\\D/g, '');\n const formatter = new AsYouType(nextCountry);\n const reformatted = digits ? formatter.input(digits) : '';\n userSelectedCountryRef.current = true;\n setCountry(nextCountry);\n setDisplayValue(reformatted);\n setPickerOpen(false);\n setPickerSearch('');\n emit(reformatted, nextCountry);\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n };\n\n const countryRows = useMemo(\n () =>\n buildCountryRows(\n i18n.language,\n allowedList ?? (Array.from(supportedCountries) as CountryCode[]),\n ),\n [i18n.language, supportedCountries, allowedList],\n );\n\n const popularRows = useMemo(() => {\n if (!popularCountries || popularCountries.length === 0) return [];\n const byCode = new Map(countryRows.map((row) => [row.code, row]));\n return popularCountries\n .filter((code): code is CountryCode => supportedCountries.has(code))\n .map((code) => byCode.get(code))\n .filter((row): row is CountryRow => Boolean(row));\n }, [popularCountries, countryRows, supportedCountries]);\n\n const popularCodes = useMemo(\n () => new Set(popularRows.map((row) => row.code)),\n [popularRows],\n );\n\n const remainingRows = useMemo(\n () =>\n popularCodes.size > 0\n ? countryRows.filter((row) => !popularCodes.has(row.code))\n : countryRows,\n [countryRows, popularCodes],\n );\n\n const selected = useMemo(\n () => countryRows.find((row) => row.code === country),\n [countryRows, country],\n );\n const selectedDialCode = selected ? selected.dialCode : '';\n const selectedName = selected ? selected.name : country;\n\n const triggerLabel = t('inputs.phone.countryPickerLabel', 'Country');\n const triggerAccessibleName = `${triggerLabel}: ${selectedName}, +${selectedDialCode}`;\n\n const filterFn = useCallback(\n (candidate: string, searchStr: string, keywords?: string[]) => {\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [],\n );\n\n const renderRow = (row: CountryRow) => {\n const accessibleLabel = `${row.name}, +${row.dialCode}`;\n return (\n <Command.Item\n key={row.code}\n value={row.code}\n keywords={[row.name, row.dialCode, `+${row.dialCode}`]}\n onSelect={() => handleCountrySelect(row.code)}\n className={pickerItemClasses}\n aria-label={accessibleLabel}\n >\n <Flag country={row.code} size={flagSizeBySize[size]} />\n <span className=\"ds:flex-1 ds:truncate\">{row.name}</span>\n <bdi dir=\"ltr\" className=\"ds:text-muted-foreground ds:tabular-nums\">\n +{row.dialCode}\n </bdi>\n </Command.Item>\n );\n };\n\n return (\n <div\n ref={wrapperRef}\n onFocus={handleFocus}\n onBlur={handleBlur}\n data-component=\"phone-input\"\n data-component-id={id}\n data-slot=\"phone-input\"\n data-read-only={readOnly ? '' : undefined}\n className={phoneInputWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n {isCountryFixed ? (\n <span\n data-slot=\"phone-country-fixed\"\n className={`${countryTriggerVariants({ size })} ds:cursor-default ds:hover:bg-transparent`}\n >\n <span className=\"ds:sr-only\">{`${triggerLabel}: ${selectedName}`}</span>\n <Flag country={country} size={flagSizeBySize[size]} />\n <bdi dir=\"ltr\" className=\"ds:tabular-nums\">\n +{selectedDialCode}\n </bdi>\n </span>\n ) : (\n <Popover.Root open={pickerOpen} onOpenChange={setPickerOpen}>\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n // A read-only number keeps its country too. The wrapper dims only for\n // a disabled number field, so a locked number stays legible.\n disabled={effectiveDisabled || Boolean(readOnly)}\n // What opens is a dialog: a search box over the list.\n aria-haspopup=\"dialog\"\n aria-expanded={pickerOpen}\n aria-label={triggerAccessibleName}\n className={countryTriggerVariants({ size })}\n >\n <Flag country={country} size={flagSizeBySize[size]} />\n <bdi dir=\"ltr\" className=\"ds:tabular-nums\">\n +{selectedDialCode}\n </bdi>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n chevronSizeBySize[size],\n 'ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n pickerOpen ? 'ds:rotate-180' : '',\n ].join(' ')}\n />\n </button>\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content\n ref={pickerContentRef}\n onKeyDown={exitOnTab}\n sideOffset={6}\n align=\"start\"\n // Radix gives the content role=\"dialog\" with no name.\n aria-label={triggerLabel}\n className={pickerContentClasses}\n >\n <Command\n filter={filterFn}\n shouldFilter\n loop\n label={triggerLabel}\n >\n <Command.Input\n asChild\n value={pickerSearch}\n onValueChange={setPickerSearch}\n >\n <input\n data-phone-country-search=\"true\"\n type=\"text\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n placeholder={t(\n 'inputs.phone.searchCountry',\n 'Search countries…',\n )}\n className={pickerSearchClasses}\n />\n </Command.Input>\n <Command.List\n label={triggerLabel}\n className={pickerListClasses}\n >\n <Command.Empty className={pickerEmptyClasses}>\n {t('inputs.phone.noCountryFound', 'No country found')}\n </Command.Empty>\n {popularRows.length > 0 ? (\n <Command.Group\n heading={\n <span className={pickerGroupHeadingClasses}>\n {t('inputs.phone.popularCountries', 'Popular')}\n </span>\n }\n >\n {popularRows.map(renderRow)}\n </Command.Group>\n ) : null}\n <Command.Group\n heading={\n popularRows.length > 0 ? (\n <span className={pickerGroupHeadingClasses}>\n {t('inputs.phone.allCountries', 'All countries')}\n </span>\n ) : undefined\n }\n >\n {remainingRows.map(renderRow)}\n </Command.Group>\n </Command.List>\n </Command>\n </Popover.Content>\n </Popover.Portal>\n </Popover.Root>\n )}\n <input\n ref={composedInputRef}\n id={inputId}\n name={postsE164 ? undefined : name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel-national\"\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={readOnly}\n required={effectiveRequired}\n aria-label={ariaLabel}\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onChange={handleInputChange}\n className={phoneNumberInputVariants({ size })}\n />\n {postsE164 ? (\n <input\n type=\"hidden\"\n name={name}\n value={e164Value}\n disabled={effectiveDisabled}\n />\n ) : null}\n </div>\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport {\n phoneInputWrapperVariants,\n countryTriggerVariants,\n phoneNumberInputVariants,\n};\n"],"names":["phoneInputAgent","handle","args","phoneInputWrapperVariants","cva","countryTriggerVariants","phoneNumberInputVariants","pickerContentClasses","pickerSearchClasses","pickerListClasses","pickerItemClasses","MENU_ROW_HIGHLIGHT","pickerGroupHeadingClasses","pickerEmptyClasses","chevronSizeBySize","flagSizeBySize","countDigitsBefore","str","position","digits","i","positionAfterDigits","targetDigits","count","resolveDefaultCountry","explicit","supported","detectBrowser","locale","allowedList","allowed","ok","code","fromNavigator","match","candidate","region","buildCountryRows","countries","displayNames","rows","getCountryCallingCode","collator","a","b","PhoneInput","forwardRef","value","defaultValue","defaultCountry","detectBrowserCountry","onChange","size","tone","disabled","readOnly","placeholder","popularCountries","allowedCountries","className","id","name","nameFormat","required","onBlur","ariaLabel","ref","t","i18n","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","supportedCountries","useMemo","getCountries","seen","filtered","isCountryFixed","initialState","resolvedCountry","raw","parsed","parsePhoneNumberFromString","AsYouType","country","setCountry","useState","displayValue","setDisplayValue","pickerOpen","setPickerOpen","pickerSearch","setPickerSearch","isControlled","lastEmittedRef","useRef","pendingCaretRef","userSelectedCountryRef","inputRef","composedInputRef","composeRefs","syncDisplay","useDomValue","wrapperRef","pickerContentRef","useEffect","next","prev","current","useIsomorphicLayoutEffect","pos","node","emit","useCallback","nextDisplay","nextCountry","e164","controlId","useFormFieldControlId","inputId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","onBlurRef","focusInsideRef","pressInsideRef","isInside","_a","_b","leave","handleFocus","handleBlur","event","listensForBlur","check","onPointerDown","onPointerUp","postsE164","e164Value","handleInputChange","target","caret","digitsBefore","formatted","lastEmittedRefForHandle","agentHandle","useAgentRegistration","exitOnTab","useNonModalTabExit","findPopoverTrigger","handleCountrySelect","formatter","reformatted","countryRows","popularRows","byCode","row","popularCodes","remainingRows","selected","selectedDialCode","selectedName","triggerLabel","triggerAccessibleName","filterFn","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","renderRow","accessibleLabel","jsxs","Command","jsx","Flag","Popover","ChevronDown"],"mappings":";;;;;;;;;;;;;;;;;AASO,MAAMA,KAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,SAAS;AAAA,MACP,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,eAAe;AAAA,IAAA;AAAA,EAC1C;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,UAAU;AAAA,QACR,EAAE,MAAM,EAAE,OAAO,gBAAA,GAAmB,MAAM,yBAAA;AAAA,MAAyB;AAAA,MAErE,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACD,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb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AAW1K,IACd,UAAAuD,EAAE,6BAA6B,eAAe,EAAA,CACjD,IACE;AAAA,gCAGL,UAAAiG,GAAc,IAAIc,EAAS;AAAA,8BAAA;AAAA,4BAAA;AAAA,0BAC9B;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACF;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA,EACF,CACF;AAAA,UAAA,GACF;AAAA,UAEF,gBAAAI;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAKhF;AAAA,cACL,IAAIoB;AAAA,cACJ,MAAMqB,KAAY,SAAYlF;AAAA,cAC9B,MAAK;AAAA,cACL,WAAU;AAAA,cACV,cAAa;AAAA,cACb,aAAamE;AAAA,cACb,UAAUL;AAAA,cACV,UAAApE;AAAA,cACA,UAAUqE;AAAA,cACV,cAAY3D;AAAA,cACZ,oBAAkB8D;AAAA,cAClB,gBAAcF,MAAoB;AAAA,cAClC,UAAUoB;AAAA,cACV,WAAW3I,GAAyB,EAAE,MAAA8C,EAAA,CAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAE7C2F,KACC,gBAAAuC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAAzH;AAAA,cACA,OAAOmF;AAAA,cACP,UAAUrB;AAAA,YAAA;AAAA,UAAA,IAEV;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA9E,GAAW,cAAc;"}
|
|
@@ -7,7 +7,7 @@ import { A as Le } from "./avatar-BPiPL7ND.js";
|
|
|
7
7
|
import { B as te } from "./button-DohK_Ak_.js";
|
|
8
8
|
import { D as V } from "./dropdown-menu-D1we7oAY.js";
|
|
9
9
|
import { E as ct } from "./empty-state-DwJ5YNzz.js";
|
|
10
|
-
import { M as dt } from "./map-view-
|
|
10
|
+
import { M as dt } from "./map-view-Bvi06RVh.js";
|
|
11
11
|
import { R as Pe } from "./rating-CGYpg5dj.js";
|
|
12
12
|
import { S as I } from "./sheet-uZZXaO_S.js";
|
|
13
13
|
import { S as ut } from "./skeleton-tTWJpvAq.js";
|
|
@@ -1849,4 +1849,4 @@ export {
|
|
|
1849
1849
|
Ut as P,
|
|
1850
1850
|
wt as p
|
|
1851
1851
|
};
|
|
1852
|
-
//# sourceMappingURL=practice-results-
|
|
1852
|
+
//# sourceMappingURL=practice-results-B61krlwu.js.map
|