@wix/form-elements 1.227.0 → 1.229.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/component/{appointment-rac-C2ClvRys.js → appointment-rac-GPiMmJxP.js} +100 -100
- package/dist/component/{bookings-address-rac-CPQjosbZ.js → bookings-address-rac-_6H0cpOX.js} +1 -1
- package/dist/component/{bookings-email-rac-DWvVUcBN.js → bookings-email-rac-BXu7vlfv.js} +1 -1
- package/dist/component/{bookings-first-name-rac-_iG2xJiA.js → bookings-first-name-rac-B5EFteC7.js} +1 -1
- package/dist/component/{bookings-header-rac-BbGm_Z8W.js → bookings-header-rac-BNpHdVDM.js} +1 -1
- package/dist/component/{bookings-last-name-rac-77Z29aHO.js → bookings-last-name-rac-39_YaErh.js} +1 -1
- package/dist/component/{bookings-login-bar-rac-DfqRpARE.js → bookings-login-bar-rac-C2HiveJf.js} +1 -1
- package/dist/component/{bookings-phone-rac-BKoU7X0X.js → bookings-phone-rac-DUDjc-hx.js} +1 -1
- package/dist/component/{bookings-rich-text-rac-DgSN4_f0.js → bookings-rich-text-rac-C3gHsHqM.js} +1 -1
- package/dist/component/{checkbox-field-rac-BLJ3Xb7C.js → checkbox-field-rac-B1boTUAd.js} +4 -4
- package/dist/component/{checkbox-group-field-headless-BeU8DG0A.js → checkbox-group-field-headless-Bult4ASq.js} +3 -3
- package/dist/component/{checkbox-group-field-rac-ClRi6Ljp.js → checkbox-group-field-rac-C8X3HPwE.js} +4 -4
- package/dist/component/{checkbox-group-rac--cM57qqw.js → checkbox-group-rac-7Lqjo_yR.js} +1 -1
- package/dist/component/{checkbox-rac-DnslW6as.js → checkbox-rac-syMEVhI-.js} +1 -1
- package/dist/component/{contacts-address-rac-Bpq_0vvi.js → contacts-address-rac-C0-tMLNC.js} +1 -1
- package/dist/component/{contacts-birthdate-rac-CB1h6kRm.js → contacts-birthdate-rac-1cDTvHzJ.js} +1 -1
- package/dist/component/{contacts-company-rac-DvYX4SLX.js → contacts-company-rac-jBk0H-Px.js} +1 -1
- package/dist/component/{contacts-email-rac-sxbgKBUR.js → contacts-email-rac-CoYOGP1q.js} +1 -1
- package/dist/component/{contacts-first-name-rac-C4_o2nwv.js → contacts-first-name-rac-D3j38Wak.js} +1 -1
- package/dist/component/{contacts-last-name-rac-B3s96wWt.js → contacts-last-name-rac-BONsoL5A.js} +1 -1
- package/dist/component/{contacts-phone-rac-B5NZeYaI.js → contacts-phone-rac-DEFAfwFw.js} +1 -1
- package/dist/component/{contacts-position-rac-CO4Bo4jG.js → contacts-position-rac-KN_26yxw.js} +1 -1
- package/dist/component/{contacts-subscribe-rac-CWmo3C6c.js → contacts-subscribe-rac-BLCx2wUt.js} +1 -1
- package/dist/component/{contacts-tax-id-rac-pi_bJeA7.js → contacts-tax-id-rac-DeEskHYJ.js} +1 -1
- package/dist/component/{date-availability-DL8Xboob.js → date-availability-Dt_ccalt.js} +1 -1
- package/dist/component/{date-input-field-rac-Di2pwVW7.js → date-input-field-rac-B-CpcccZ.js} +8 -8
- package/dist/component/{date-input-rac-C5xC7fbz.js → date-input-rac-C1m26mdc.js} +1 -1
- package/dist/component/{date-picker-field-rac-DyPkuVVe.js → date-picker-field-rac-BIUDi3_7.js} +8 -8
- package/dist/component/{date-picker-rac-CKNlOGZG.js → date-picker-rac-7-tC9pvJ.js} +1 -1
- package/dist/component/{date-time-input-field-rac-Dk15pWyb.js → date-time-input-field-rac-5pVViPTl.js} +8 -8
- package/dist/component/{date-time-input-rac-oOUelldq.js → date-time-input-rac-CJVXFHSK.js} +1 -1
- package/dist/component/{dext-checkbox-group-rac--jmNDOV2.js → dext-checkbox-group-rac-CQ95cLrs.js} +2 -2
- package/dist/component/{dext-checkbox-rac-BOjbBRrg.js → dext-checkbox-rac-Cv3-fvFw.js} +1 -1
- package/dist/component/{dext-date-picker-rac-CHi5TisB.js → dext-date-picker-rac-Dgbzkk-Q.js} +1 -1
- package/dist/component/{dext-date-time-input-rac-CcF4ocHx.js → dext-date-time-input-rac-7vt7qkXQ.js} +1 -1
- package/dist/component/{dext-dropdown-rac-LLYhuGt_.js → dext-dropdown-rac-COYjf4Uk.js} +1 -1
- package/dist/component/{dext-email-rac-CbC1crzT.js → dext-email-rac-BO6Yskyl.js} +1 -1
- package/dist/component/{dext-number-input-rac-3-U9Hxre.js → dext-number-input-rac-BuJsFHQD.js} +1 -1
- package/dist/component/{dext-phone-rac-CdMFXUNf.js → dext-phone-rac-DRhEZS0m.js} +1 -1
- package/dist/component/{dext-radio-group-rac-Bg33r95T.js → dext-radio-group-rac-B-SA0ITv.js} +2 -2
- package/dist/component/{dext-rating-input-rac-DV8jA90b.js → dext-rating-input-rac-BcpLyQSP.js} +1 -1
- package/dist/component/{dext-tags-rac-B-hpvZgE.js → dext-tags-rac-B1WsqTOk.js} +2 -2
- package/dist/component/{dext-text-area-rac-kBBc0Xjo.js → dext-text-area-rac-CKmb1-ax.js} +1 -1
- package/dist/component/{dext-text-input-rac-CImXblhX.js → dext-text-input-rac-BuaASOlx.js} +1 -1
- package/dist/component/{dext-url-input-rac-J-7QABnD.js → dext-url-input-rac-CfgYYrVy.js} +1 -1
- package/dist/component/{dismiss-icon-Bw_zbdk_.js → dismiss-icon-D3_Zzj5l.js} +1 -1
- package/dist/component/{donation-rac-CvWwng6S.js → donation-rac-V5cUDRDx.js} +5 -5
- package/dist/component/{dropdown-field-rac-Dm9Qs8bh.js → dropdown-field-rac-CONU5tZT.js} +3 -3
- package/dist/component/{dropdown-rac-BHqeUIje.js → dropdown-rac-C-cZX6Xk.js} +1 -1
- package/dist/component/{ecom-address-rac-NtuG7Q_T.js → ecom-address-rac-Tyicsyps.js} +1 -1
- package/dist/component/{ecom-subscription-checkbox-rac-DAJnX_RJ.js → ecom-subscription-checkbox-rac-CbDEpoPe.js} +2 -2
- package/dist/component/{email-input-field-rac-ompvaCLM.js → email-input-field-rac-XB5amz6S.js} +3 -3
- package/dist/component/{events-repeater-rac-kHEFBH7l.js → events-repeater-rac-BJFbVm9p.js} +4 -4
- package/dist/component/{events-rsvp-rac-R4F9aw6y.js → events-rsvp-rac-D4cdZGgV.js} +3 -3
- package/dist/component/{field-error-headless-o2u5ldAp.js → field-error-headless-BsV6YLEM.js} +1 -1
- package/dist/component/{field-label-headless-DvNWYzXc.js → field-label-headless-D-kBcceK.js} +1 -1
- package/dist/component/{file-upload-rac-DlE4dp0D.js → file-upload-rac-C43lnrDd.js} +4 -4
- package/dist/component/{fixed-payment-rac-BxsFHhXP.js → fixed-payment-rac-CEUGUzXs.js} +3 -3
- package/dist/component/{form-Co7SkMqj.js → form-CX77qB-O.js} +106 -106
- package/dist/component/form.css +1 -1
- package/dist/component/form.js +1 -1
- package/dist/component/{header-field-rac-D56CKAtM.js → header-field-rac-DMRhxDkn.js} +2 -2
- package/dist/component/{header-rac-DdYSBcq1.js → header-rac-CH6Japn4.js} +1 -1
- package/dist/component/{image-choice-rac-g23R5qLL.js → image-choice-rac-D7B03yyE.js} +4 -4
- package/dist/component/{index-BmOwghzn.js → index-K1Qe5Lva.js} +2 -2
- package/dist/component/{index-C0yPsVXz.js → index-bEqqR2UB.js} +4 -4
- package/dist/component/{isObjectLike-mlNAmhLJ.js → isObjectLike-B3s7YV-O.js} +1 -1
- package/dist/component/{messages_ar-Dhf97hZN.js → messages_ar-B6uCTgcN.js} +1 -0
- package/dist/component/{messages_bg-BeJMZnb1.js → messages_bg-BFuS7TPj.js} +1 -0
- package/dist/component/{messages_ca-FzoGNoi6.js → messages_ca-CvVD9mIv.js} +1 -0
- package/dist/component/{messages_cs-dJg-S-VV.js → messages_cs-CWmB4Kz9.js} +1 -0
- package/dist/component/{messages_da-C2-Fog1K.js → messages_da-B9s-tqCO.js} +1 -0
- package/dist/component/{messages_de-CrJmBBnw.js → messages_de-BY27LmJ4.js} +1 -0
- package/dist/component/{messages_el-C-h7hh9l.js → messages_el-J5LMcTZs.js} +1 -0
- package/dist/component/{messages_en-BoLHYzfk.js → messages_en-DDof8mV7.js} +1 -0
- package/dist/component/{messages_es-Bqncgrm3.js → messages_es-DKrlHNYT.js} +1 -0
- package/dist/component/{messages_fi-m9PtcTFj.js → messages_fi-CXk1cPhB.js} +1 -0
- package/dist/component/{messages_fr-DfJ58fol.js → messages_fr-C_lxUyul.js} +1 -0
- package/dist/component/{messages_he-CoclVWwo.js → messages_he-hc43rTsV.js} +1 -0
- package/dist/component/{messages_hi-Darb2Wre.js → messages_hi-ZrTPuaQM.js} +1 -0
- package/dist/component/{messages_hr-DCj--HTl.js → messages_hr-CroIWJjw.js} +1 -0
- package/dist/component/{messages_hu-_bnixMGc.js → messages_hu-CIPloTUq.js} +1 -0
- package/dist/component/{messages_id-yes_fXE1.js → messages_id-MozJSkHs.js} +1 -0
- package/dist/component/{messages_it-BudI37gU.js → messages_it-eBibvIY6.js} +1 -0
- package/dist/component/{messages_ja-CJTuWnh9.js → messages_ja-DiMta9AM.js} +1 -0
- package/dist/component/{messages_ko-DEaDT3oj.js → messages_ko-kaXc3Nbs.js} +1 -0
- package/dist/component/{messages_lt-BvUk2JkF.js → messages_lt-cCevoO30.js} +1 -0
- package/dist/component/{messages_lv-DCiE-_f6.js → messages_lv-BeNCa5qQ.js} +1 -0
- package/dist/component/{messages_ms-DvPCPAKs.js → messages_ms-xEnRDKOZ.js} +1 -0
- package/dist/component/{messages_nl-D65liJio.js → messages_nl-D6_hXFvr.js} +1 -0
- package/dist/component/{messages_no-Pe1StTZy.js → messages_no-BVaDEh--.js} +1 -0
- package/dist/component/{messages_pl-BNLtxXCG.js → messages_pl-C0exvdXI.js} +1 -0
- package/dist/component/{messages_pt-SO-GIQyK.js → messages_pt-Dkla49UJ.js} +1 -0
- package/dist/component/{messages_ro-JcT63Xu7.js → messages_ro-BpvEyVQv.js} +1 -0
- package/dist/component/{messages_ru-CPvSPih6.js → messages_ru-BT14xpfy.js} +1 -0
- package/dist/component/{messages_sk--ehi9Nro.js → messages_sk-wHlAmpoI.js} +1 -0
- package/dist/component/{messages_sl-B9P4YEyY.js → messages_sl-DGaP8nJp.js} +1 -0
- package/dist/component/{messages_sv-Bc10MHfh.js → messages_sv-XA33BRUx.js} +1 -0
- package/dist/component/{messages_th-CQ51IfmH.js → messages_th-B_INKeJ7.js} +1 -0
- package/dist/component/{messages_tl-B5dCLtFs.js → messages_tl-BK7JuHIh.js} +1 -0
- package/dist/component/{messages_tr-WJiUU0ct.js → messages_tr-C7dImceu.js} +1 -0
- package/dist/component/{messages_uk-Dg4znI3c.js → messages_uk-VTWRJdy2.js} +1 -0
- package/dist/component/{messages_vi-CUnl67kQ.js → messages_vi-C1M6Yv8J.js} +1 -0
- package/dist/component/{messages_zh-CV-gVrcI.js → messages_zh-Bi5Wx-Fv.js} +1 -0
- package/dist/component/multiline-address-field-rac-kV04oJUn.js +1828 -0
- package/dist/component/{multiline-address-rac-tdENoXBT.js → multiline-address-rac-CLrhCkDN.js} +1 -1
- package/dist/component/{number-input-field-rac-CCIuPPeP.js → number-input-field-rac-9p3pjh_D.js} +4 -4
- package/dist/component/{number-input-rac-DxodjaRb.js → number-input-rac-BRWBLJxB.js} +1 -1
- package/dist/component/{password-rac-h9U6siGg.js → password-rac-DVGgr_Mk.js} +4 -4
- package/dist/component/{payment-input-rac-YFXgnLS6.js → payment-input-rac-BX0d3hQr.js} +4 -4
- package/dist/component/phone-input-field-rac-BmZgXCpn.js +603 -0
- package/dist/component/{phone-rac-B1Q9HXAB.js → phone-rac-B2RRuoqK.js} +1 -1
- package/dist/component/{product-list-rac-D63k_IAW.js → product-list-rac-D6c1IsnT.js} +4 -4
- package/dist/component/{quiz-radio-group-rac-Bl6DYjmg.js → quiz-radio-group-rac-RnpAxtzg.js} +1 -1
- package/dist/component/{radio-button-module-classes-BRHKk6XZ.js → radio-button-module-classes-bz-Ns1Ze.js} +3 -3
- package/dist/component/{radio-group-field-rac-B8yEmx79.js → radio-group-field-rac-D_GV6yUr.js} +4 -4
- package/dist/component/{radio-group-rac-xX_sfxL0.js → radio-group-rac-Cd8Qs8ot.js} +1 -1
- package/dist/component/{rating-input-field-rac-_p1u5oCL.js → rating-input-field-rac-BtkAsxnV.js} +4 -4
- package/dist/component/{rating-input-rac-C_i6Nwdz.js → rating-input-rac-BRbonnej.js} +1 -1
- package/dist/component/{rich-content-rac.module-BlHWoitq.js → rich-content-rac.module-pbp1zCM5.js} +1 -1
- package/dist/component/{rich-text-field-rac-EiH-NdJm.js → rich-text-field-rac-1L72ZPhI.js} +2 -2
- package/dist/component/{rich-text-rac-eZvghmFV.js → rich-text-rac-DobfXm_8.js} +1 -1
- package/dist/component/{service-dropdown-rac-bujnhWyl.js → service-dropdown-rac-BMhCmTAX.js} +4 -4
- package/dist/component/{services-multi-choice-rac-FXrJOBdY.js → services-multi-choice-rac-D7lRSVJl.js} +5 -5
- package/dist/component/{signature-rac-CoVHMOpK.js → signature-rac-Bco76ERn.js} +4 -4
- package/dist/component/{submit-button-rac-B8w753Be.js → submit-button-rac-DQ17YXxg.js} +2 -2
- package/dist/component/{tags-field-rac-iitBlZ8l.js → tags-field-rac-C1yKETDx.js} +5 -5
- package/dist/component/{tags-rac-DJSUQlkc.js → tags-rac-BcCspqlQ.js} +1 -1
- package/dist/component/{text-area-field-rac-CePWfCbx.js → text-area-field-rac-C3XojWXx.js} +4 -4
- package/dist/component/{text-area-rac-m18L6Zwk.js → text-area-rac-C0JcRjAe.js} +1 -1
- package/dist/component/{text-input-field-rac-BSo_dbkm.js → text-input-field-rac-CHTVRczd.js} +3 -3
- package/dist/component/{text-input-headless-D-o9wyGb.js → text-input-headless-B2tCTuxV.js} +3 -3
- package/dist/component/{text-input-rac-CcGgoWaF.js → text-input-rac-CfTBffAi.js} +1 -1
- package/dist/component/{time-input-rac-DRIFM107.js → time-input-rac-BWE01iMt.js} +6 -6
- package/dist/component/{url-input-field-rac-Dpn9-sDD.js → url-input-field-rac-C-8qKrsK.js} +4 -4
- package/dist/component/{url-input-rac-CDSl1LX1.js → url-input-rac-C0638Rq7.js} +1 -1
- package/dist/component/{use-dropdown-option-class-name-CHg44uaJ.js → use-dropdown-option-class-name-CpJ8B7ag.js} +2 -2
- package/dist/component/{use-dropdown-trigger-class-name-Dpwl6OCY.js → use-dropdown-trigger-class-name-yVvlOwvq.js} +7 -7
- package/dist/component/{use-element-state-class-name-BUu6zq-d.js → use-element-state-class-name-Dn2rGGPS.js} +1 -1
- package/dist/component/{use-hoverable-input-class-name-B1V7zCNe.js → use-hoverable-input-class-name-P-qLEa8M.js} +2 -2
- package/dist/component/{use-is-forced-open-dropdown-BbHOZTaj.js → use-is-forced-open-dropdown-COLJ2DzU.js} +1 -1
- package/dist/component/{use-native-mobile-input-Ct8ysLL3.js → use-native-mobile-input-CFCIHZiu.js} +1 -1
- package/dist/component/{use-service-options-base-u-WCeJHQ.js → use-service-options-base-D8BHHfgi.js} +1 -1
- package/dist/component/use-text-input-class-name-D7eW2Lkq.js +6 -0
- package/package.json +2 -2
- package/dist/component/multiline-address-field-rac-ApBLSWB_.js +0 -1818
- package/dist/component/phone-input-field-rac-B9PUQJUP.js +0 -558
- package/dist/component/use-text-input-class-name-DfNU2oQf.js +0 -6
package/dist/component/{number-input-field-rac-CCIuPPeP.js → number-input-field-rac-9p3pjh_D.js}
RENAMED
|
@@ -2,15 +2,15 @@ import { RicosViewer as U } from "@wix/ricos/viewer";
|
|
|
2
2
|
import d from "classnames";
|
|
3
3
|
import t, { useState as W, useCallback as X, useEffect as Y, useRef as $ } from "react";
|
|
4
4
|
import { NumberField as j, Input as v } from "react-aria-components";
|
|
5
|
-
import { bN as _, bK as S, bY as z, bP as G, bW as H, X as J, am as Z, M as w, I as ee } from "./form-
|
|
5
|
+
import { bN as _, bK as S, bY as z, bP as G, bW as H, X as J, am as Z, M as w, I as ee } from "./form-CX77qB-O.js";
|
|
6
6
|
import { c as y, g as x } from "./numeric-input-utils-CuBMi4-a.js";
|
|
7
7
|
import { f as p } from "./find-child-C60k4CxG.js";
|
|
8
|
-
import { D as re, E as te } from "./field-error-headless-
|
|
9
|
-
import { L as ne } from "./field-label-headless-
|
|
8
|
+
import { D as re, E as te } from "./field-error-headless-BsV6YLEM.js";
|
|
9
|
+
import { L as ne } from "./field-label-headless-D-kBcceK.js";
|
|
10
10
|
import { u as se } from "./use-invoke-callback-UH73A_J3.js";
|
|
11
11
|
import { E as ae } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { s as b } from "./field-rac.module-D0QzJXUv.js";
|
|
13
|
-
import { u as me } from "./use-text-input-class-name-
|
|
13
|
+
import { u as me } from "./use-text-input-class-name-D7eW2Lkq.js";
|
|
14
14
|
const le = (r, { validation: s }) => {
|
|
15
15
|
const a = y(r.value.trim());
|
|
16
16
|
if (a === void 0)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import e, { useState as S, useRef as x } from "react";
|
|
2
2
|
import { RicosViewer as O } from "@wix/ricos/viewer";
|
|
3
3
|
import d from "classnames";
|
|
4
|
-
import { bN as E, bK as I, bP as A, bW as B, bY as P, X as V, am as v, M, I as k } from "./form-
|
|
4
|
+
import { bN as E, bK as I, bP as A, bW as B, bY as P, X as V, am as v, M, I as k } from "./form-CX77qB-O.js";
|
|
5
5
|
import { TextField as q, Group as U, Input as W, Button as j } from "react-aria-components";
|
|
6
6
|
import { f as u, a as b } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as H, E as K } from "./field-error-headless-
|
|
8
|
-
import { L as Z } from "./field-label-headless-
|
|
7
|
+
import { D as H, E as K } from "./field-error-headless-BsV6YLEM.js";
|
|
8
|
+
import { L as Z } from "./field-label-headless-D-kBcceK.js";
|
|
9
9
|
import { E as G } from "./error-icon-hZxQ6DEy.js";
|
|
10
10
|
import { H as Q } from "./custom-focus-class-_483Pkwp.js";
|
|
11
11
|
import { s as p } from "./field-rac.module-D0QzJXUv.js";
|
|
12
|
-
import { u as X } from "./use-text-input-class-name-
|
|
12
|
+
import { u as X } from "./use-text-input-class-name-D7eW2Lkq.js";
|
|
13
13
|
const t = ({ children: o, className: r }) => {
|
|
14
14
|
const { id: l, value: s, onChange: c, disabled: n, readOnly: m, required: a, hasError: i, onBlur: f, onFocus: C, autoComplete: y, FieldLayout: _ } = E(), { labelId: R } = I(), [D, F] = S(!1), L = u(o, t.Label), T = u(o, t.Control), h = u(o, t.Description), w = u(o, t.Error);
|
|
15
15
|
return /* @__PURE__ */ e.createElement(_, {
|
|
@@ -2,16 +2,16 @@ import r, { useCallback as V, useRef as Q } from "react";
|
|
|
2
2
|
import { RicosViewer as X } from "@wix/ricos/viewer";
|
|
3
3
|
import p from "classnames";
|
|
4
4
|
import { TextField as Y, Group as j, Input as w } from "react-aria-components";
|
|
5
|
-
import { bN as R, bK as D, bF as M, bY as z, bP as J, X as W, am as Z, M as ee, I as re } from "./form-
|
|
5
|
+
import { bN as R, bK as D, bF as M, bY as z, bP as J, X as W, am as Z, M as ee, I as re } from "./form-CX77qB-O.js";
|
|
6
6
|
import { f as i } from "./find-child-C60k4CxG.js";
|
|
7
|
-
import { D as te, E as ne } from "./field-error-headless-
|
|
8
|
-
import { L as ae } from "./field-label-headless-
|
|
7
|
+
import { D as te, E as ne } from "./field-error-headless-BsV6YLEM.js";
|
|
8
|
+
import { L as ae } from "./field-label-headless-D-kBcceK.js";
|
|
9
9
|
import { f as L, g as se } from "./payment-field-utils-DobiK5Xh.js";
|
|
10
10
|
import { u as oe } from "./use-synced-display-value-DcAxdn3M.js";
|
|
11
11
|
import { E as le } from "./error-icon-hZxQ6DEy.js";
|
|
12
12
|
import { H as ce } from "./custom-focus-class-_483Pkwp.js";
|
|
13
13
|
import { s as d } from "./field-rac.module-D0QzJXUv.js";
|
|
14
|
-
import { u as ie } from "./use-text-input-class-name-
|
|
14
|
+
import { u as ie } from "./use-text-input-class-name-D7eW2Lkq.js";
|
|
15
15
|
function ue(e, t) {
|
|
16
16
|
return {
|
|
17
17
|
productId: e.id,
|
|
@@ -0,0 +1,603 @@
|
|
|
1
|
+
import { RicosViewer as ge } from "@wix/ricos/viewer";
|
|
2
|
+
import g from "classnames";
|
|
3
|
+
import n, { useMemo as M, useState as w, useRef as S, useEffect as k, useCallback as U, createContext as ae, useContext as j, useId as se } from "react";
|
|
4
|
+
import { bv as be, bY as L, bF as ce, bX as Ne, bN as F, bK as Q, bP as Oe, bW as _e, X as ve, am as Se, a3 as ne, M as Le, I as Ie, a5 as Pe, a4 as Fe, a2 as De } from "./form-CX77qB-O.js";
|
|
5
|
+
import { UNSAFE_PortalProvider as Be } from "react-aria";
|
|
6
|
+
import { VisuallyHidden as le, Dialog as ue, OverlayTriggerStateContext as Re, ModalOverlay as xe, Modal as Me, SearchField as we, Group as H, ListBoxItem as Te, DialogTrigger as $e, Select as Ae, Input as ie, Autocomplete as Ve } from "react-aria-components";
|
|
7
|
+
import de, { AsYouType as ke, isValidPhoneNumber as He, isSupportedCountry as qe } from "libphonenumber-js";
|
|
8
|
+
import "libphonenumber-js/metadata.min.json";
|
|
9
|
+
import { f as E, a as P } from "./find-child-C60k4CxG.js";
|
|
10
|
+
import { D as Ue, E as Ke } from "./field-error-headless-BsV6YLEM.js";
|
|
11
|
+
import { L as Ye } from "./field-label-headless-D-kBcceK.js";
|
|
12
|
+
import { N as Ge, u as ze } from "./use-native-mobile-input-CFCIHZiu.js";
|
|
13
|
+
import { N as We } from "./native-select-BbxBpe3S.js";
|
|
14
|
+
import { N as Xe, S as Ze } from "./non-modal-popover-D-u13tmp.js";
|
|
15
|
+
import { u as je } from "./use-invoke-callback-UH73A_J3.js";
|
|
16
|
+
import { d as Qe } from "./use-is-forced-open-dropdown-COLJ2DzU.js";
|
|
17
|
+
import { V as Je, a as et } from "./use-dropdown-option-class-name-CpJ8B7ag.js";
|
|
18
|
+
import { C as oe } from "./calling-country-codes-PyWuOTmF.js";
|
|
19
|
+
import { C as tt } from "./chevron-down-icon-CcpVm6B-.js";
|
|
20
|
+
import { E as nt } from "./error-icon-hZxQ6DEy.js";
|
|
21
|
+
import { H as z } from "./custom-focus-class-_483Pkwp.js";
|
|
22
|
+
import { s as O } from "./field-rac.module-D0QzJXUv.js";
|
|
23
|
+
import { u as re } from "./use-hoverable-input-class-name-P-qLEa8M.js";
|
|
24
|
+
function X(e) {
|
|
25
|
+
const t = e ? de(e) : void 0, r = t == null ? void 0 : t.country;
|
|
26
|
+
if (r)
|
|
27
|
+
return r;
|
|
28
|
+
const o = new ke();
|
|
29
|
+
return e && o.input(e), o.getCountry();
|
|
30
|
+
}
|
|
31
|
+
function K(e) {
|
|
32
|
+
var t;
|
|
33
|
+
return e && ((t = be.getCountryByKey(e)) == null ? void 0 : t.dialCode);
|
|
34
|
+
}
|
|
35
|
+
function q(e) {
|
|
36
|
+
return e === null ? null : e.replace(/[^0-9+]/g, "") || e;
|
|
37
|
+
}
|
|
38
|
+
function Z(e, t) {
|
|
39
|
+
if (e && t)
|
|
40
|
+
try {
|
|
41
|
+
const r = de(e, t), o = r == null ? void 0 : r.formatInternational();
|
|
42
|
+
if (o && He(o))
|
|
43
|
+
return o.replace(/\s+/g, "");
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
return e;
|
|
47
|
+
}
|
|
48
|
+
const ot = (e, t) => {
|
|
49
|
+
var u, i;
|
|
50
|
+
const r = e.value;
|
|
51
|
+
if (!r)
|
|
52
|
+
return;
|
|
53
|
+
const { defaultCountry: o, validation: a } = t, s = (i = (u = a == null ? void 0 : a.string) == null ? void 0 : u.phoneOptions) == null ? void 0 : i.allowedCountryCodes, c = X(r) || o || ((s == null ? void 0 : s.length) === 1 ? s[0] : void 0);
|
|
54
|
+
return q(Z(r, c)) ?? void 0;
|
|
55
|
+
};
|
|
56
|
+
function rt() {
|
|
57
|
+
const { t: e } = L(), { language: t } = ce();
|
|
58
|
+
return M(() => Object.keys(oe).reduce((o, a) => {
|
|
59
|
+
const s = oe[a], c = K(s), u = e(`locale-dataset.countries.${s.toUpperCase()}`);
|
|
60
|
+
return c && qe(a) && o.push({
|
|
61
|
+
countryName: u,
|
|
62
|
+
longCountryCode: s,
|
|
63
|
+
shortCountryCode: a,
|
|
64
|
+
callingCode: c
|
|
65
|
+
}), o;
|
|
66
|
+
}, []).sort((o, a) => o.countryName.localeCompare(a.countryName, t)), [
|
|
67
|
+
e,
|
|
68
|
+
t
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
function at(e, t) {
|
|
72
|
+
return e.filter((r) => t && t.length > 0 ? t.includes(r.shortCountryCode) : !0);
|
|
73
|
+
}
|
|
74
|
+
function st(e, t) {
|
|
75
|
+
const { countryName: r, callingCode: o, shortCountryCode: a } = e;
|
|
76
|
+
return !!(W(r, t) || W(o, t) || W(a, t));
|
|
77
|
+
}
|
|
78
|
+
function W(e, t) {
|
|
79
|
+
return e.toLowerCase().includes(t.toLowerCase());
|
|
80
|
+
}
|
|
81
|
+
function ct({ currentValue: e, selectedCountryCode: t, handlePhoneChange: r, handleCountryCodeChange: o }) {
|
|
82
|
+
const [a, s] = w(), c = S(!1), u = S(t);
|
|
83
|
+
k(() => {
|
|
84
|
+
if (!e) {
|
|
85
|
+
c.current = !1, u.current = t, s(void 0);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!c.current) {
|
|
89
|
+
u.current = t;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const C = setTimeout(() => {
|
|
93
|
+
u.current !== t && (u.current = t, s(t));
|
|
94
|
+
});
|
|
95
|
+
return () => clearTimeout(C);
|
|
96
|
+
}, [
|
|
97
|
+
e,
|
|
98
|
+
t
|
|
99
|
+
]);
|
|
100
|
+
const i = U((C) => {
|
|
101
|
+
c.current = !0, r(C);
|
|
102
|
+
}, [
|
|
103
|
+
r
|
|
104
|
+
]), d = U((C) => {
|
|
105
|
+
c.current = !1, s(void 0), o(C);
|
|
106
|
+
}, [
|
|
107
|
+
o
|
|
108
|
+
]);
|
|
109
|
+
return {
|
|
110
|
+
detectedCountryCode: a,
|
|
111
|
+
handlePhoneChange: i,
|
|
112
|
+
handleCountryCodeChange: d
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function lt({ value: e, defaultCountryCode: t, allowedCountryCodes: r, onChange: o }) {
|
|
116
|
+
const [a, s] = w(e || ""), c = S(q(e ?? null) ?? ""), [u, i] = w(t);
|
|
117
|
+
Ne(() => {
|
|
118
|
+
s(""), c.current = "", i(t), o("");
|
|
119
|
+
});
|
|
120
|
+
const d = M(() => X(a), [
|
|
121
|
+
a
|
|
122
|
+
]);
|
|
123
|
+
k(() => {
|
|
124
|
+
const m = e ?? "";
|
|
125
|
+
m !== c.current && (s(m), c.current = m);
|
|
126
|
+
}, [
|
|
127
|
+
e
|
|
128
|
+
]), k(() => {
|
|
129
|
+
t && !u && i(t);
|
|
130
|
+
}, [
|
|
131
|
+
t,
|
|
132
|
+
u
|
|
133
|
+
]), k(() => {
|
|
134
|
+
i(t ?? d);
|
|
135
|
+
}, [
|
|
136
|
+
d,
|
|
137
|
+
t
|
|
138
|
+
]);
|
|
139
|
+
const C = U((m) => {
|
|
140
|
+
if (s(m), !m) {
|
|
141
|
+
c.current = "", o(null);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const f = X(m);
|
|
145
|
+
i((p) => {
|
|
146
|
+
const _ = f || p || ((r == null ? void 0 : r.length) === 1 ? r[0] : void 0), I = q(Z(m, _));
|
|
147
|
+
return c.current = I ?? "", o(I), f || p;
|
|
148
|
+
});
|
|
149
|
+
}, [
|
|
150
|
+
r,
|
|
151
|
+
o
|
|
152
|
+
]), y = U((m) => {
|
|
153
|
+
i(m), s((f) => {
|
|
154
|
+
const p = q(Z(f, m));
|
|
155
|
+
return c.current = p ?? "", o(p), f;
|
|
156
|
+
});
|
|
157
|
+
}, [
|
|
158
|
+
o
|
|
159
|
+
]);
|
|
160
|
+
return {
|
|
161
|
+
currentValue: a,
|
|
162
|
+
selectedCountryCode: u,
|
|
163
|
+
handlePhoneChange: C,
|
|
164
|
+
handleCountryCodeChange: y
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
const me = /* @__PURE__ */ ae(null), N = () => {
|
|
168
|
+
const e = j(me);
|
|
169
|
+
if (!e)
|
|
170
|
+
throw new Error("Phone input components must be used within PhoneInput component");
|
|
171
|
+
return e;
|
|
172
|
+
}, Ce = /* @__PURE__ */ ae(null), J = () => {
|
|
173
|
+
const e = j(Ce);
|
|
174
|
+
if (!e)
|
|
175
|
+
throw new Error("Option sub-components must be used within Option component");
|
|
176
|
+
return e;
|
|
177
|
+
}, ee = ({ longCountryCode: e, className: t }) => {
|
|
178
|
+
function r(s, c) {
|
|
179
|
+
const u = "https://static.parastorage.com/services/linguist-flags/1.1005.0/assets/flags/square/", d = `${s}${c === "2x" ? "_2x" : ""}.png`;
|
|
180
|
+
return `${u}${d}`;
|
|
181
|
+
}
|
|
182
|
+
const o = r(e, "1x"), a = r(e, "2x");
|
|
183
|
+
return /* @__PURE__ */ n.createElement("img", {
|
|
184
|
+
src: o,
|
|
185
|
+
srcSet: `${o} 1x, ${a} 2x`,
|
|
186
|
+
alt: "",
|
|
187
|
+
"aria-hidden": "true",
|
|
188
|
+
loading: "lazy",
|
|
189
|
+
className: t
|
|
190
|
+
});
|
|
191
|
+
}, l = ({ children: e }) => {
|
|
192
|
+
var v, x;
|
|
193
|
+
const { id: t, value: r, onChange: o, FieldLayout: a, defaultCountry: s, validation: c } = F(), [u, i] = w(null), d = (x = (v = c == null ? void 0 : c.string) == null ? void 0 : v.phoneOptions) == null ? void 0 : x.allowedCountryCodes, C = rt(), y = M(() => at(C, d), [
|
|
194
|
+
C,
|
|
195
|
+
d
|
|
196
|
+
]), m = M(() => y.map((V) => V.shortCountryCode), [
|
|
197
|
+
y
|
|
198
|
+
]), f = lt({
|
|
199
|
+
value: r,
|
|
200
|
+
defaultCountryCode: s,
|
|
201
|
+
allowedCountryCodes: m,
|
|
202
|
+
onChange: o
|
|
203
|
+
}), { currentValue: p, selectedCountryCode: _ } = f, { detectedCountryCode: I, handlePhoneChange: G, handleCountryCodeChange: T } = ct(f), $ = E(e, l.Label), D = E(e, l.Control), A = E(e, l.Description), B = E(e, l.Error), R = {
|
|
204
|
+
currentValue: p,
|
|
205
|
+
selectedCountryCode: _,
|
|
206
|
+
handlePhoneChange: G,
|
|
207
|
+
handleCountryCodeChange: T,
|
|
208
|
+
countryCodes: m,
|
|
209
|
+
countries: y,
|
|
210
|
+
popoverContainer: u
|
|
211
|
+
};
|
|
212
|
+
return /* @__PURE__ */ n.createElement(me.Provider, {
|
|
213
|
+
value: R
|
|
214
|
+
}, /* @__PURE__ */ n.createElement(a, {
|
|
215
|
+
fieldId: t,
|
|
216
|
+
renderLabel: () => $,
|
|
217
|
+
renderInput: () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("div", {
|
|
218
|
+
ref: i,
|
|
219
|
+
style: {
|
|
220
|
+
display: "contents"
|
|
221
|
+
}
|
|
222
|
+
}), D, /* @__PURE__ */ n.createElement(ut, {
|
|
223
|
+
countryCode: I
|
|
224
|
+
})),
|
|
225
|
+
renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, B, A)
|
|
226
|
+
}));
|
|
227
|
+
}, ut = ({ countryCode: e }) => {
|
|
228
|
+
const { t } = L(), { countries: r } = N(), o = r.find((a) => a.shortCountryCode === e);
|
|
229
|
+
return /* @__PURE__ */ n.createElement(le, {
|
|
230
|
+
role: "status",
|
|
231
|
+
"aria-live": "polite",
|
|
232
|
+
"aria-atomic": "true"
|
|
233
|
+
}, o && t("field.phone.country-detected.announcement", {
|
|
234
|
+
countryName: o.countryName
|
|
235
|
+
}));
|
|
236
|
+
}, te = ({ children: e, className: t }) => {
|
|
237
|
+
const { labelId: r } = Q(), { hasError: o, disabled: a, readOnly: s } = F(), { t: c } = L(), { selectedCountryCode: u, countries: i } = N(), d = se(), C = u ? i.find((p) => p.shortCountryCode === u) : void 0, y = C && K(C.longCountryCode) || "", m = c("field.phone.country-code.aria-label"), f = C ? `${m}, ${C.countryName}, ${y}` : m;
|
|
238
|
+
return /* @__PURE__ */ n.createElement(Ze, {
|
|
239
|
+
isDisabled: a || s,
|
|
240
|
+
id: d,
|
|
241
|
+
"aria-label": f,
|
|
242
|
+
"aria-labelledby": r ? `${r} ${d}` : void 0,
|
|
243
|
+
className: t,
|
|
244
|
+
"data-invalid": o || void 0
|
|
245
|
+
}, e);
|
|
246
|
+
}, it = ({ className: e }) => {
|
|
247
|
+
const { selectedCountryCode: t, countries: r } = N(), o = r.find((a) => a.shortCountryCode === t);
|
|
248
|
+
return o ? /* @__PURE__ */ n.createElement(ee, {
|
|
249
|
+
className: e,
|
|
250
|
+
longCountryCode: o.longCountryCode
|
|
251
|
+
}) : null;
|
|
252
|
+
}, dt = ({ children: e, className: t }) => {
|
|
253
|
+
const { selectedCountryCode: r, countries: o } = N();
|
|
254
|
+
return o.some((s) => s.shortCountryCode === r) ? null : /* @__PURE__ */ n.createElement("span", {
|
|
255
|
+
className: t
|
|
256
|
+
}, e);
|
|
257
|
+
};
|
|
258
|
+
te.Flag = it;
|
|
259
|
+
te.EmptyState = dt;
|
|
260
|
+
const b = ({ children: e, className: t, "aria-label": r, placement: o, offset: a, ...s }) => {
|
|
261
|
+
const { triggerRef: c, optionsRef: u, isForcedOpen: i, isOpen: d } = s, { popoverContainer: C } = N(), y = E(e, b.Search);
|
|
262
|
+
if (!d)
|
|
263
|
+
return null;
|
|
264
|
+
const m = /* @__PURE__ */ n.createElement(pe, {
|
|
265
|
+
isForcedOpen: i
|
|
266
|
+
}, e);
|
|
267
|
+
return /* @__PURE__ */ n.createElement(Be, {
|
|
268
|
+
getContainer: () => C
|
|
269
|
+
}, /* @__PURE__ */ n.createElement(Xe, {
|
|
270
|
+
ref: u,
|
|
271
|
+
triggerRef: c,
|
|
272
|
+
className: t,
|
|
273
|
+
placement: o,
|
|
274
|
+
offset: a,
|
|
275
|
+
containerPadding: 0
|
|
276
|
+
}, y && !i ? /* @__PURE__ */ n.createElement(ue, {
|
|
277
|
+
"aria-label": r
|
|
278
|
+
}, m) : m));
|
|
279
|
+
}, mt = ({ children: e, className: t, overlayClassName: r, "aria-label": o, portalContainer: a = n.Fragment, ...s }) => {
|
|
280
|
+
const { optionsRef: c } = s, { selectedCountryCode: u, handleCountryCodeChange: i } = N(), d = j(Re);
|
|
281
|
+
return /* @__PURE__ */ n.createElement(xe, {
|
|
282
|
+
className: r,
|
|
283
|
+
isDismissable: !0
|
|
284
|
+
}, /* @__PURE__ */ n.createElement(a, null, /* @__PURE__ */ n.createElement(Me, {
|
|
285
|
+
ref: c,
|
|
286
|
+
className: t
|
|
287
|
+
}, /* @__PURE__ */ n.createElement(ue, {
|
|
288
|
+
"aria-label": o
|
|
289
|
+
}, /* @__PURE__ */ n.createElement(pe, {
|
|
290
|
+
listBoxProps: {
|
|
291
|
+
"aria-label": o,
|
|
292
|
+
selectionMode: "single",
|
|
293
|
+
selectedKeys: u ? [
|
|
294
|
+
u
|
|
295
|
+
] : [],
|
|
296
|
+
onSelectionChange: (C) => {
|
|
297
|
+
const [y] = C === "all" ? [] : C;
|
|
298
|
+
y && i(y), d == null || d.close();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}, e)))));
|
|
302
|
+
}, pe = ({ children: e, listBoxProps: t, isForcedOpen: r }) => {
|
|
303
|
+
const { countries: o } = N(), a = E(e, b.Option), s = E(e, b.Search), c = E(e, b.EmptyState), u = /* @__PURE__ */ n.createElement(Je, {
|
|
304
|
+
isForcedOpen: r === !0,
|
|
305
|
+
...t,
|
|
306
|
+
renderEmptyState: c ? () => c : void 0
|
|
307
|
+
}, o.map((i) => {
|
|
308
|
+
const d = K(i.longCountryCode) || "";
|
|
309
|
+
return P(a, {
|
|
310
|
+
key: i.shortCountryCode,
|
|
311
|
+
countryCode: i.shortCountryCode,
|
|
312
|
+
dialingCode: d,
|
|
313
|
+
countryName: i.countryName,
|
|
314
|
+
longCountryCode: i.longCountryCode
|
|
315
|
+
});
|
|
316
|
+
}));
|
|
317
|
+
return s ? /* @__PURE__ */ n.createElement(Ve, {
|
|
318
|
+
filter: (i, d, C) => {
|
|
319
|
+
const y = o.find((m) => m.shortCountryCode === C.key);
|
|
320
|
+
return !!y && st(y, d);
|
|
321
|
+
}
|
|
322
|
+
}, r ? P(s, {
|
|
323
|
+
autoFocus: !1
|
|
324
|
+
}) : s, u) : u;
|
|
325
|
+
};
|
|
326
|
+
b.Popover = b;
|
|
327
|
+
b.Modal = mt;
|
|
328
|
+
const ye = ({ className: e, children: t, "aria-label": r, ...o }) => {
|
|
329
|
+
const { autoFocus: a = !0 } = o;
|
|
330
|
+
return /* @__PURE__ */ n.createElement(we, {
|
|
331
|
+
"aria-label": r,
|
|
332
|
+
autoFocus: a
|
|
333
|
+
}, /* @__PURE__ */ n.createElement(H, {
|
|
334
|
+
className: e
|
|
335
|
+
}, t));
|
|
336
|
+
}, Ct = ({ className: e, placeholder: t }) => /* @__PURE__ */ n.createElement(ie, {
|
|
337
|
+
className: e,
|
|
338
|
+
placeholder: t
|
|
339
|
+
});
|
|
340
|
+
ye.Input = Ct;
|
|
341
|
+
b.Search = ye;
|
|
342
|
+
const pt = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement("div", {
|
|
343
|
+
className: t
|
|
344
|
+
}, e);
|
|
345
|
+
b.EmptyState = pt;
|
|
346
|
+
const Y = ({ children: e, className: t, ...r }) => {
|
|
347
|
+
const { countryCode: o, dialingCode: a, countryName: s, longCountryCode: c } = r, u = {
|
|
348
|
+
countryCode: o,
|
|
349
|
+
dialingCode: a,
|
|
350
|
+
countryName: s,
|
|
351
|
+
longCountryCode: c
|
|
352
|
+
}, i = e || /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(fe, null), /* @__PURE__ */ n.createElement(he, null), /* @__PURE__ */ n.createElement(Ee, null));
|
|
353
|
+
return /* @__PURE__ */ n.createElement(Te, {
|
|
354
|
+
className: t,
|
|
355
|
+
id: o,
|
|
356
|
+
textValue: `${s} ${a}`
|
|
357
|
+
}, /* @__PURE__ */ n.createElement(Ce.Provider, {
|
|
358
|
+
value: u
|
|
359
|
+
}, i));
|
|
360
|
+
}, fe = ({ className: e }) => {
|
|
361
|
+
const { longCountryCode: t } = J();
|
|
362
|
+
return /* @__PURE__ */ n.createElement(ee, {
|
|
363
|
+
className: e,
|
|
364
|
+
longCountryCode: t
|
|
365
|
+
});
|
|
366
|
+
}, he = ({ className: e }) => {
|
|
367
|
+
const { countryName: t } = J();
|
|
368
|
+
return /* @__PURE__ */ n.createElement("span", {
|
|
369
|
+
className: e
|
|
370
|
+
}, t);
|
|
371
|
+
}, Ee = ({ className: e }) => {
|
|
372
|
+
const { dialingCode: t } = J();
|
|
373
|
+
return /* @__PURE__ */ n.createElement("span", {
|
|
374
|
+
className: e
|
|
375
|
+
}, t);
|
|
376
|
+
};
|
|
377
|
+
Y.Flag = fe;
|
|
378
|
+
Y.Name = he;
|
|
379
|
+
Y.Code = Ee;
|
|
380
|
+
b.Option = Y;
|
|
381
|
+
const yt = ({ className: e }) => {
|
|
382
|
+
const { t } = L(), { inputId: r, ariaDescribedBy: o } = Q(), { id: a, placeholder: s, disabled: c, readOnly: u, required: i, label: d, hasError: C } = F(), { currentValue: y, handlePhoneChange: m } = N(), f = S(null);
|
|
383
|
+
return Oe(() => {
|
|
384
|
+
var p;
|
|
385
|
+
(p = f.current) == null || p.focus({
|
|
386
|
+
preventScroll: !0
|
|
387
|
+
});
|
|
388
|
+
}, a), _e(f, ot), /* @__PURE__ */ n.createElement(ie, {
|
|
389
|
+
ref: f,
|
|
390
|
+
id: r,
|
|
391
|
+
type: "tel",
|
|
392
|
+
autoComplete: "tel",
|
|
393
|
+
value: y,
|
|
394
|
+
onChange: (p) => m(p.target.value),
|
|
395
|
+
disabled: c,
|
|
396
|
+
readOnly: u,
|
|
397
|
+
required: i,
|
|
398
|
+
"aria-label": `${d}. ${t("field.phone.aria-label")}`,
|
|
399
|
+
"aria-describedby": o,
|
|
400
|
+
"aria-invalid": C,
|
|
401
|
+
placeholder: s,
|
|
402
|
+
className: e
|
|
403
|
+
});
|
|
404
|
+
}, ft = ({ children: e, ...t }) => {
|
|
405
|
+
const r = t, { isForcedOpen: o } = r, { disabled: a, readOnly: s, required: c, hasError: u } = F(), [i, d] = w(!1), { t: C } = L(), { selectedCountryCode: y, handleCountryCodeChange: m } = N(), f = o || i && !a && !s;
|
|
406
|
+
return /* @__PURE__ */ n.createElement(Ae, {
|
|
407
|
+
"aria-label": C("field.phone.country-code.aria-label"),
|
|
408
|
+
value: y ?? null,
|
|
409
|
+
onChange: (p) => m(p),
|
|
410
|
+
isDisabled: a || s,
|
|
411
|
+
isInvalid: u,
|
|
412
|
+
isRequired: c,
|
|
413
|
+
placeholder: "",
|
|
414
|
+
isOpen: f,
|
|
415
|
+
allowsEmptyCollection: !0,
|
|
416
|
+
onOpenChange: o ? void 0 : d
|
|
417
|
+
}, E(e, l.CountryButton), P(E(e, l.CountryOptions.Popover), {
|
|
418
|
+
...r,
|
|
419
|
+
isOpen: f
|
|
420
|
+
}));
|
|
421
|
+
}, ht = ({ children: e, ...t }) => {
|
|
422
|
+
const r = t;
|
|
423
|
+
return /* @__PURE__ */ n.createElement($e, null, E(e, l.CountryButton), P(E(e, l.CountryOptions.Modal), r));
|
|
424
|
+
}, Et = ({ children: e, className: t }) => {
|
|
425
|
+
const r = S(null), o = S(null), a = S(!1), { id: s, disabled: c, hasError: u, showFlag: i, onFocus: d, onBlur: C } = F(), y = je(C), { countries: m } = N(), f = E(e, l.CountryDrawer), p = E(e, l.CountryPopover), _ = E(e, l.PhoneNumber), I = E(e, l.NativeCountrySelect), G = ze(), T = m.length > 1, $ = Qe(s) && !!p && T, D = typeof t == "function" ? ({ isHovered: R, isFocusWithin: v }) => t({
|
|
426
|
+
hasCountryOptions: T,
|
|
427
|
+
isHovered: R,
|
|
428
|
+
isFocusWithin: v
|
|
429
|
+
}) : t, A = {
|
|
430
|
+
triggerRef: r,
|
|
431
|
+
optionsRef: o,
|
|
432
|
+
isForcedOpen: $
|
|
433
|
+
}, B = {
|
|
434
|
+
onFocus: () => {
|
|
435
|
+
a.current || (a.current = !0, d == null || d());
|
|
436
|
+
},
|
|
437
|
+
onBlur: (R) => {
|
|
438
|
+
var x, V;
|
|
439
|
+
const v = R.relatedTarget;
|
|
440
|
+
!((x = r.current) != null && x.contains(v)) && !((V = o.current) != null && V.contains(v)) && (a.current = !1, y());
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
return m.length === 1 ? /* @__PURE__ */ n.createElement(H, {
|
|
444
|
+
ref: r,
|
|
445
|
+
className: D,
|
|
446
|
+
isDisabled: c,
|
|
447
|
+
isInvalid: u,
|
|
448
|
+
...B
|
|
449
|
+
}, i && /* @__PURE__ */ n.createElement(ee, {
|
|
450
|
+
longCountryCode: m[0].longCountryCode
|
|
451
|
+
}), _) : G ? /* @__PURE__ */ n.createElement(H, {
|
|
452
|
+
ref: r,
|
|
453
|
+
className: D,
|
|
454
|
+
isDisabled: c,
|
|
455
|
+
isInvalid: u,
|
|
456
|
+
...B
|
|
457
|
+
}, I, _) : /* @__PURE__ */ n.createElement(H, {
|
|
458
|
+
ref: r,
|
|
459
|
+
className: D,
|
|
460
|
+
isDisabled: c,
|
|
461
|
+
isInvalid: u,
|
|
462
|
+
...B
|
|
463
|
+
}, !$ && P(f, A), P(p, A), _);
|
|
464
|
+
}, gt = ({ className: e, children: t }) => {
|
|
465
|
+
const { disabled: r, readOnly: o, required: a, hasError: s } = F(), { labelId: c } = Q(), { t: u } = L(), { countries: i, selectedCountryCode: d, handleCountryCodeChange: C } = N(), y = se(), m = u("field.phone.country-code.aria-label"), f = M(() => i.map((p) => ({
|
|
466
|
+
value: p.shortCountryCode,
|
|
467
|
+
label: `${p.countryName} ${K(p.longCountryCode) || ""}`.trim()
|
|
468
|
+
})), [
|
|
469
|
+
i
|
|
470
|
+
]);
|
|
471
|
+
return /* @__PURE__ */ n.createElement(Ge, null, /* @__PURE__ */ n.createElement(le, {
|
|
472
|
+
id: y,
|
|
473
|
+
"aria-hidden": "true"
|
|
474
|
+
}, m), /* @__PURE__ */ n.createElement(We, {
|
|
475
|
+
className: e,
|
|
476
|
+
"aria-labelledby": c ? `${c} ${y}` : y,
|
|
477
|
+
value: d,
|
|
478
|
+
options: f,
|
|
479
|
+
placeholder: m,
|
|
480
|
+
onChange: (p) => p && C(p),
|
|
481
|
+
"aria-required": a || void 0,
|
|
482
|
+
"aria-invalid": s || void 0,
|
|
483
|
+
disabled: r,
|
|
484
|
+
readOnly: o
|
|
485
|
+
}), t);
|
|
486
|
+
};
|
|
487
|
+
l.Label = Ye;
|
|
488
|
+
l.NativeCountrySelect = gt;
|
|
489
|
+
l.Control = Et;
|
|
490
|
+
l.CountryButton = te;
|
|
491
|
+
l.CountryDrawer = ht;
|
|
492
|
+
l.CountryPopover = ft;
|
|
493
|
+
l.CountryOptions = b;
|
|
494
|
+
l.PhoneNumber = yt;
|
|
495
|
+
l.Description = Ue;
|
|
496
|
+
l.Error = Ke;
|
|
497
|
+
const bt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
498
|
+
width: 24,
|
|
499
|
+
height: 24,
|
|
500
|
+
viewBox: "0 0 24 24",
|
|
501
|
+
fill: "currentColor",
|
|
502
|
+
"aria-hidden": "true",
|
|
503
|
+
...e
|
|
504
|
+
}, /* @__PURE__ */ n.createElement("path", {
|
|
505
|
+
fillRule: "evenodd",
|
|
506
|
+
d: "M11.5,19 C11.331,19 11.166,18.985 11,18.975 L11,16.5 C11,16.224 10.776,16 10.5,16 L9.5,16 C9.224,16 9,15.775 9,15.5 L9,12.5 C9,12.366 8.947,12.238 8.852,12.145 L4.804,8.14 C6.04,5.688 8.573,4 11.5,4 C12.76,4 13.946,4.315 14.989,4.866 L15,6.497 C15.001,6.631 14.949,6.757 14.855,6.853 C14.76,6.947 14.634,7 14.5,7 L12.339,7 C12.207,7 12.08,7.053 11.986,7.146 L10.146,8.983 C10.053,9.077 10,9.204 10,9.337 L10,10.5 C10,11.325 10.672,11.999 11.499,12 L15.293,12 L17,13.707 L17,16.582 C15.629,18.064 13.674,19 11.5,19 M4,11.5 C4,10.673 4.14,9.879 4.388,9.135 L8,12.709 L8,15.5 C8,16.327 8.673,17 9.5,17 L10,17 L10,18.849 C6.581,18.152 4,15.122 4,11.5 M19,11.5 C19,12.856 18.632,14.127 18,15.226 L18,13.5 C18,13.367 17.947,13.24 17.854,13.146 L15.854,11.146 C15.76,11.053 15.633,11 15.5,11 L11.5,11 C11.224,11 11,10.775 11,10.5 L11,9.544 L12.546,8 L14.5,8 C14.902,8 15.281,7.843 15.564,7.557 C15.848,7.271 16.003,6.892 16,6.49 L15.993,5.51 C17.814,6.879 19,9.051 19,11.5 M11.5,3 C6.813,3 3,6.813 3,11.5 C3,16.187 6.813,20 11.5,20 C16.187,20 20,16.187 20,11.5 C20,6.813 16.187,3 11.5,3"
|
|
507
|
+
})), Nt = (e) => /* @__PURE__ */ n.createElement("svg", {
|
|
508
|
+
width: 24,
|
|
509
|
+
height: 24,
|
|
510
|
+
viewBox: "0 0 24 24",
|
|
511
|
+
fill: "currentColor",
|
|
512
|
+
"aria-hidden": "true",
|
|
513
|
+
...e
|
|
514
|
+
}, /* @__PURE__ */ n.createElement("path", {
|
|
515
|
+
fillRule: "evenodd",
|
|
516
|
+
d: "M6.6108,14.3887 C5.5718,13.3497 4.9998,11.9687 4.9998,10.4997 C4.9998,9.0317 5.5718,7.6507 6.6108,6.6117 C7.6498,5.5727 9.0308,4.9997 10.4998,4.9997 C11.9688,4.9997 13.3498,5.5727 14.3888,6.6117 C15.4278,7.6507 15.9998,9.0317 15.9998,10.4997 C15.9998,11.9687 15.4278,13.3497 14.3888,14.3887 C13.3498,15.4277 11.9688,15.9997 10.4998,15.9997 C9.0308,15.9997 7.6498,15.4277 6.6108,14.3887 L6.6108,14.3887 Z M20.0028,19.2957 L15.4328,14.7247 C16.4438,13.5477 16.9998,12.0687 16.9998,10.4997 C16.9998,8.7637 16.3238,7.1317 15.0958,5.9047 C13.8688,4.6767 12.2358,3.9997 10.4998,3.9997 C8.7638,3.9997 7.1318,4.6767 5.9038,5.9047 C4.6758,7.1317 3.9998,8.7637 3.9998,10.4997 C3.9998,12.2367 4.6758,13.8677 5.9038,15.0957 C7.1318,16.3237 8.7638,16.9997 10.4998,16.9997 C12.0688,16.9997 13.5478,16.4437 14.7258,15.4317 L19.2958,20.0027 L20.0028,19.2957 Z"
|
|
517
|
+
})), Ot = "_control_1hd0f_1", _t = "_countryButton_1hd0f_9", vt = "_drawerButton_1hd0f_25", St = "_popoverButton_1hd0f_34", Lt = "_chevron_1hd0f_39", It = "_globeIcon_1hd0f_48", Pt = "_searchIcon_1hd0f_56", Ft = "_flag_1hd0f_61", Dt = "_option_1hd0f_67", Bt = "_nativeCountrySelect_1hd0f_80", Rt = "_nativeCountryDisplay_1hd0f_100", xt = "_phoneNumber_1hd0f_108", Mt = "_countryOptions_1hd0f_135", wt = "_countrySearch_1hd0f_152", Tt = "_mobileDrawer_1hd0f_160", $t = "_name_1hd0f_169", At = "_code_1hd0f_173", Vt = "_mobileOverlay_1hd0f_190", h = {
|
|
518
|
+
control: Ot,
|
|
519
|
+
countryButton: _t,
|
|
520
|
+
drawerButton: vt,
|
|
521
|
+
popoverButton: St,
|
|
522
|
+
chevron: Lt,
|
|
523
|
+
globeIcon: It,
|
|
524
|
+
searchIcon: Pt,
|
|
525
|
+
flag: Ft,
|
|
526
|
+
option: Dt,
|
|
527
|
+
nativeCountrySelect: Bt,
|
|
528
|
+
nativeCountryDisplay: Rt,
|
|
529
|
+
phoneNumber: xt,
|
|
530
|
+
countryOptions: Mt,
|
|
531
|
+
countrySearch: wt,
|
|
532
|
+
mobileDrawer: Tt,
|
|
533
|
+
name: $t,
|
|
534
|
+
code: At,
|
|
535
|
+
mobileOverlay: Vt
|
|
536
|
+
}, kt = ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(ge, {
|
|
537
|
+
content: e,
|
|
538
|
+
locale: t
|
|
539
|
+
}), Ht = () => /* @__PURE__ */ n.createElement("span", {
|
|
540
|
+
className: h.chevron,
|
|
541
|
+
"aria-hidden": "true"
|
|
542
|
+
}, /* @__PURE__ */ n.createElement(tt, null)), mn = () => {
|
|
543
|
+
const e = et(Fe, O.selectOptionWithoutFocusRing, h.option, z), t = re(De, [
|
|
544
|
+
h.control
|
|
545
|
+
]), r = re(Pe, [
|
|
546
|
+
h.countrySearch
|
|
547
|
+
]), { t: o } = L(), { PortalContainer: a } = ce(), s = /* @__PURE__ */ n.createElement(l.CountryOptions.Search, {
|
|
548
|
+
className: r,
|
|
549
|
+
"aria-label": o("field.phone.country-search-input.aria-label")
|
|
550
|
+
}, /* @__PURE__ */ n.createElement(Nt, {
|
|
551
|
+
className: h.searchIcon
|
|
552
|
+
}), /* @__PURE__ */ n.createElement(l.CountryOptions.Search.Input, {
|
|
553
|
+
className: g(O.innerInput, z),
|
|
554
|
+
placeholder: o("field.phone.country-search-input.placeholder")
|
|
555
|
+
})), c = /* @__PURE__ */ n.createElement(l.CountryOptions.EmptyState, null, o("field.phone.country-selector-dropdown.no-result")), u = /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(l.CountryButton.Flag, {
|
|
556
|
+
className: h.flag
|
|
557
|
+
}), /* @__PURE__ */ n.createElement(l.CountryButton.EmptyState, null, /* @__PURE__ */ n.createElement(bt, {
|
|
558
|
+
className: h.globeIcon
|
|
559
|
+
})), /* @__PURE__ */ n.createElement(Ht, null)), i = /* @__PURE__ */ n.createElement(l.CountryOptions.Option, {
|
|
560
|
+
className: e
|
|
561
|
+
}, /* @__PURE__ */ n.createElement(l.CountryOptions.Option.Flag, {
|
|
562
|
+
className: h.flag
|
|
563
|
+
}), /* @__PURE__ */ n.createElement(l.CountryOptions.Option.Name, {
|
|
564
|
+
className: h.name
|
|
565
|
+
}), /* @__PURE__ */ n.createElement(l.CountryOptions.Option.Code, {
|
|
566
|
+
className: h.code
|
|
567
|
+
}));
|
|
568
|
+
return /* @__PURE__ */ n.createElement(l, null, /* @__PURE__ */ n.createElement(l.Label, {
|
|
569
|
+
className: g(ve, O.label)
|
|
570
|
+
}, /* @__PURE__ */ n.createElement(l.Label.Required, {
|
|
571
|
+
className: g(Se, O.requiredMark)
|
|
572
|
+
})), /* @__PURE__ */ n.createElement(l.Control, {
|
|
573
|
+
className: ({ hasCountryOptions: d, ...C }) => t(C)
|
|
574
|
+
}, /* @__PURE__ */ n.createElement(l.CountryDrawer, null, /* @__PURE__ */ n.createElement(l.CountryButton, {
|
|
575
|
+
className: g(h.countryButton, h.drawerButton)
|
|
576
|
+
}, u), /* @__PURE__ */ n.createElement(l.CountryOptions.Modal, {
|
|
577
|
+
className: g(ne, O.selectPopover, h.mobileDrawer),
|
|
578
|
+
overlayClassName: h.mobileOverlay,
|
|
579
|
+
portalContainer: a,
|
|
580
|
+
"aria-label": o("field.phone.country-code.aria-label")
|
|
581
|
+
}, s, c, i)), /* @__PURE__ */ n.createElement(l.CountryPopover, null, /* @__PURE__ */ n.createElement(l.CountryButton, {
|
|
582
|
+
className: g(h.countryButton, h.popoverButton)
|
|
583
|
+
}, u), /* @__PURE__ */ n.createElement(l.CountryOptions.Popover, {
|
|
584
|
+
className: g(ne, O.selectPopover, h.countryOptions),
|
|
585
|
+
placement: "bottom start",
|
|
586
|
+
offset: 0,
|
|
587
|
+
"aria-label": o("field.phone.country-code.aria-label")
|
|
588
|
+
}, s, c, i)), /* @__PURE__ */ n.createElement(l.NativeCountrySelect, {
|
|
589
|
+
className: g(h.nativeCountrySelect, z)
|
|
590
|
+
}, /* @__PURE__ */ n.createElement("span", {
|
|
591
|
+
className: h.nativeCountryDisplay,
|
|
592
|
+
"aria-hidden": "true"
|
|
593
|
+
}, u)), /* @__PURE__ */ n.createElement(l.PhoneNumber, {
|
|
594
|
+
className: g(O.innerInput, h.phoneNumber)
|
|
595
|
+
})), /* @__PURE__ */ n.createElement(l.Error, {
|
|
596
|
+
className: g(Le, O.error)
|
|
597
|
+
}, /* @__PURE__ */ n.createElement(nt, null), /* @__PURE__ */ n.createElement(l.Error.Text, null)), /* @__PURE__ */ n.createElement(l.Description, {
|
|
598
|
+
className: g(Ie, O.description)
|
|
599
|
+
}, kt));
|
|
600
|
+
};
|
|
601
|
+
export {
|
|
602
|
+
mn as P
|
|
603
|
+
};
|