@wix/form-elements 1.159.0 → 1.160.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.
Files changed (116) hide show
  1. package/dist/component/{appointment-rac-CpiyUOXo.js → appointment-rac-BmHu56e5.js} +63 -63
  2. package/dist/component/{bookings-address-rac-BBEUV1t7.js → bookings-address-rac-DY9l2g0h.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DdfoeLFV.js → bookings-email-rac-B5vNSOsS.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-DH39yvQ-.js → bookings-first-name-rac-CJiefCNz.js} +1 -1
  5. package/dist/component/{bookings-header-rac-StLm7b4I.js → bookings-header-rac-BFu7Ko5w.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-DHZMPMOO.js → bookings-last-name-rac-DegMM13h.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DrHp1ojM.js → bookings-login-bar-rac-DrA-5tBH.js} +7 -7
  8. package/dist/component/{bookings-phone-rac-6aGjbavK.js → bookings-phone-rac-DsaeqxCI.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-DBlGZUM5.js → bookings-rich-text-rac-jRHiwqi8.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-Cna1Va1X.js → checkbox-field-rac-CyoBb6Yf.js} +43 -43
  11. package/dist/component/{checkbox-group-field-headless-m_-10Mdx.js → checkbox-group-field-headless-Bv1gU3oL.js} +54 -54
  12. package/dist/component/{checkbox-group-field-rac-BSCi5hmx.js → checkbox-group-field-rac-DasArcdV.js} +6 -6
  13. package/dist/component/{checkbox-group-rac-BWYQZmAI.js → checkbox-group-rac-CzmufV1U.js} +1 -1
  14. package/dist/component/{checkbox-rac-BsUTfSUf.js → checkbox-rac-6C7XoUoZ.js} +1 -1
  15. package/dist/component/{contacts-address-rac-DwCLW8rV.js → contacts-address-rac-BZobbFtz.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-DnNgxbKb.js → contacts-birthdate-rac-DIzf41DS.js} +1 -1
  17. package/dist/component/{contacts-company-rac-BQqXzpNl.js → contacts-company-rac-BiBDO28r.js} +1 -1
  18. package/dist/component/{contacts-email-rac-BINnZzxp.js → contacts-email-rac-5mqokCSD.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-DBWKFkIU.js → contacts-first-name-rac-BXe3_Nz5.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-D_-qrF7I.js → contacts-last-name-rac-Cfqgh7u1.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-7n7JkSDr.js → contacts-phone-rac-cmLUWnAc.js} +1 -1
  22. package/dist/component/{contacts-position-rac-DvXP8nvT.js → contacts-position-rac-DTyvklfN.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-DnLnV5Gm.js → contacts-subscribe-rac-D-ZEX1A3.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-BJVWhvYW.js → contacts-tax-id-rac-B4NYJwWt.js} +1 -1
  25. package/dist/component/{date-availability-Df807-eN.js → date-availability-Dach9aRC.js} +1 -1
  26. package/dist/component/date-input-field-rac-B72mHcya.js +309 -0
  27. package/dist/component/{date-input-rac-CSB3MWHW.js → date-input-rac-CYix11gT.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-CySThPfz.js → date-picker-field-rac-B8pvtPir.js} +86 -86
  29. package/dist/component/{date-picker-rac-Fp8_pxtf.js → date-picker-rac-D6cR0zH9.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-B7Y3Yf5l.js +441 -0
  31. package/dist/component/{date-time-input-rac-wctMR4uM.js → date-time-input-rac-DMN-noQX.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-erMPfwFL.js → dext-checkbox-group-rac-Kq0GnteP.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-DQSq9Lqd.js → dext-checkbox-rac-BY9GZ4n1.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-RCLcd1VV.js → dext-date-picker-rac-CXArIddp.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-DMolWzvy.js → dext-date-time-input-rac-B39TtxGq.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-wQ2GJL4V.js → dext-dropdown-rac-C3y0G8cS.js} +1 -1
  37. package/dist/component/{dext-email-rac-BtymBVTW.js → dext-email-rac-BIg3cq7Q.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-DHPiK0Z3.js → dext-number-input-rac-27sHJ7yN.js} +1 -1
  39. package/dist/component/{dext-phone-rac-C58vHEEe.js → dext-phone-rac-CcohoFQp.js} +1 -1
  40. package/dist/component/dext-radio-group-rac-eead3Gve.js +18 -0
  41. package/dist/component/{dext-rating-input-rac-DI0k3tVa.js → dext-rating-input-rac-B_E6OcBr.js} +1 -1
  42. package/dist/component/{dext-tags-rac-DmF6ctvQ.js → dext-tags-rac-Yd9aAtnF.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-Bv6ridbR.js → dext-text-area-rac-CMACri2C.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-DoTAdUgU.js → dext-text-input-rac-sNjSCfQ-.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-BuoMS6g2.js → dext-url-input-rac-DwhbzJty.js} +1 -1
  46. package/dist/component/{donation-rac-CjZalSgn.js → donation-rac-BVAN3kMk.js} +77 -77
  47. package/dist/component/{dropdown-field-rac-By_fpqhx.js → dropdown-field-rac-DdoGigWx.js} +14 -14
  48. package/dist/component/{dropdown-rac-BnIEC4RX.js → dropdown-rac-CRkt5w47.js} +1 -1
  49. package/dist/component/{ecom-address-rac-B6Usk1Ty.js → ecom-address-rac-C36hFHW0.js} +1 -1
  50. package/dist/component/{ecom-subscription-checkbox-rac-B4B0wzlC.js → ecom-subscription-checkbox-rac-BKfQ348w.js} +2 -2
  51. package/dist/component/{email-input-field-rac-Df3KI3_v.js → email-input-field-rac-MOaISYxa.js} +59 -59
  52. package/dist/component/{events-repeater-rac-B2iBk8lV.js → events-repeater-rac-D6p-NgE8.js} +20 -20
  53. package/dist/component/{events-rsvp-rac-xl_qCIh3.js → events-rsvp-rac-DVpgN8gm.js} +18 -18
  54. package/dist/component/{field-error-headless-DWc76YmY.js → field-error-headless-XNWmDH3E.js} +4 -4
  55. package/dist/component/{field-label-headless-DKBKqI2X.js → field-label-headless-CORRAJGt.js} +4 -4
  56. package/dist/component/{file-upload-rac-BVj4cRqe.js → file-upload-rac-DRMr7E4b.js} +89 -89
  57. package/dist/component/{fixed-payment-rac-BS1Hb4hg.js → fixed-payment-rac-BUXzNex9.js} +18 -18
  58. package/dist/component/{form-BTUoOcqB.js → form-DSpx-AO8.js} +785 -728
  59. package/dist/component/form.js +1 -1
  60. package/dist/component/{header-field-rac-DTJ_Us6u.js → header-field-rac-CiDXlNsa.js} +6 -6
  61. package/dist/component/{header-rac-CvYp0Jjo.js → header-rac-B5Rg-h8u.js} +1 -1
  62. package/dist/component/{image-choice-rac--qrYqKJl.js → image-choice-rac-CtoA_KDp.js} +22 -22
  63. package/dist/component/{index-DIl9BH2M.js → index-Bz7ZhQsF.js} +53 -53
  64. package/dist/component/{index-CoEV4QEy.js → index-CwruESwc.js} +5 -5
  65. package/dist/component/{isObjectLike-CLN09X5V.js → isObjectLike-C5dHxHP0.js} +11 -11
  66. package/dist/component/multiline-address-field-rac-Z-qF366L.js +1664 -0
  67. package/dist/component/{multiline-address-rac-DtaAJjbR.js → multiline-address-rac-CJIHTMw5.js} +1 -1
  68. package/dist/component/{number-input-field-rac-2gqDUlw9.js → number-input-field-rac-D4vf6I6N.js} +29 -29
  69. package/dist/component/{number-input-rac-BlciEPLN.js → number-input-rac-B2jW6JUQ.js} +1 -1
  70. package/dist/component/{password-rac-BvvQgafk.js → password-rac-DGRZ17Jl.js} +29 -29
  71. package/dist/component/{payment-input-rac-CSRyOPPr.js → payment-input-rac-BtD-tAKv.js} +27 -27
  72. package/dist/component/phone-input-field-rac-KD4-APhr.js +512 -0
  73. package/dist/component/{phone-rac-DMP1MoRs.js → phone-rac-Cw2yccgg.js} +1 -1
  74. package/dist/component/{product-list-rac-WQ9Qhzum.js → product-list-rac-XbzTDdbp.js} +33 -33
  75. package/dist/component/{quiz-radio-group-rac-DzrL3-gZ.js → quiz-radio-group-rac-BDw_mAw5.js} +1 -1
  76. package/dist/component/{radio-button-module-classes-CJk18LzO.js → radio-button-module-classes-CFGf0Hzh.js} +23 -23
  77. package/dist/component/{radio-group-field-rac-DGoMoSgo.js → radio-group-field-rac-CXN7tyVu.js} +6 -6
  78. package/dist/component/{radio-group-rac-DhAELVNV.js → radio-group-rac-COHzqjBh.js} +1 -1
  79. package/dist/component/{rating-input-field-rac-CFoesqmC.js → rating-input-field-rac-DCXNZgf1.js} +37 -37
  80. package/dist/component/{rating-input-rac-CFMIxche.js → rating-input-rac-DwQt9ML7.js} +1 -1
  81. package/dist/component/{rich-content-rac.module-xJ03MegT.js → rich-content-rac.module-B7rPwNns.js} +8 -8
  82. package/dist/component/{rich-text-field-rac-CBMY4JOB.js → rich-text-field-rac-DlER7NRD.js} +4 -4
  83. package/dist/component/{rich-text-rac-CvZ7s1Ct.js → rich-text-rac-CjicsHA7.js} +1 -1
  84. package/dist/component/service-dropdown-rac-B81LC_6_.js +145 -0
  85. package/dist/component/{services-multi-choice-rac-fXOov4K7.js → services-multi-choice-rac-BR6gZeHk.js} +16 -16
  86. package/dist/component/{signature-rac-CG_Q9Oxr.js → signature-rac-XFj7Ddtp.js} +69 -69
  87. package/dist/component/{submit-button-rac-DAsovEp2.js → submit-button-rac-Bz7zs_3W.js} +12 -12
  88. package/dist/component/{tags-field-rac-9mpOMPLm.js → tags-field-rac-DWWkNKqc.js} +22 -22
  89. package/dist/component/{tags-rac-CNBJ08wS.js → tags-rac-BXyiQ9i1.js} +1 -1
  90. package/dist/component/{text-area-field-rac-D4aTm7CM.js → text-area-field-rac-DsIRYi0d.js} +21 -21
  91. package/dist/component/{text-area-rac-DoKiH_Kv.js → text-area-rac-CF9pDP9d.js} +1 -1
  92. package/dist/component/{text-input-field-rac-BbvPB26b.js → text-input-field-rac-BwIDZACz.js} +5 -5
  93. package/dist/component/{text-input-headless-BGaBRrP1.js → text-input-headless-5kQs2_Xu.js} +14 -14
  94. package/dist/component/{text-input-rac-1ac1EKad.js → text-input-rac-CRmSuw1k.js} +1 -1
  95. package/dist/component/{time-input-rac-BS0rR-89.js → time-input-rac-BRMNpe51.js} +20 -20
  96. package/dist/component/{url-input-field-rac-DbO6ATng.js → url-input-field-rac-CKLS3QDk.js} +17 -17
  97. package/dist/component/{url-input-rac-DHuny3d-.js → url-input-rac-Dv-kp50D.js} +1 -1
  98. package/dist/component/use-dropdown-option-class-name-BQi_qE_-.js +116 -0
  99. package/dist/component/use-dropdown-trigger-class-name-bAK8aHiG.js +96 -0
  100. package/dist/component/{use-element-state-class-name-BUsFQfoW.js → use-element-state-class-name-rXM_lHug.js} +1 -1
  101. package/dist/component/{use-hoverable-input-class-name-C2l3G8gb.js → use-hoverable-input-class-name-BnV_uerV.js} +2 -2
  102. package/dist/component/use-is-forced-open-dropdown-Bp-5Xpmw.js +53 -0
  103. package/dist/component/{use-service-options-base-D_enm38a.js → use-service-options-base-CLeE9-Tx.js} +10 -10
  104. package/dist/component/use-text-input-class-name-DIKWvfkm.js +6 -0
  105. package/dist/form.d.ts +8 -0
  106. package/package.json +2 -2
  107. package/dist/component/date-input-field-rac-CEuPElMH.js +0 -303
  108. package/dist/component/date-time-input-field-rac-DG5KSBHe.js +0 -433
  109. package/dist/component/dext-radio-group-rac-Cp-I94HW.js +0 -18
  110. package/dist/component/dropdown-field-headless-BYEjiIUf.js +0 -93
  111. package/dist/component/multiline-address-field-rac-BjWzx-LH.js +0 -1659
  112. package/dist/component/phone-input-field-rac-BVWzH_TY.js +0 -508
  113. package/dist/component/service-dropdown-rac-B627AgPG.js +0 -145
  114. package/dist/component/use-dropdown-trigger-class-name-rcGBzxI1.js +0 -117
  115. package/dist/component/use-is-forced-open-dropdown-CoOk4W4i.js +0 -48
  116. package/dist/component/use-text-input-class-name-BLtPQoYE.js +0 -6
@@ -0,0 +1,116 @@
1
+ import d, { useContext as _, useRef as L, useState as m, Children as N, useLayoutEffect as p, useMemo as D } from "react";
2
+ import { CollectionRendererContext as g, DefaultCollectionRenderer as E, ListBox as M } from "react-aria-components";
3
+ import P from "classnames";
4
+ import { s as h } from "./field-rac.module-DP0lkkEv.js";
5
+ import { J as T } from "./form-DSpx-AO8.js";
6
+ import { u as H } from "./use-element-state-class-name-rXM_lHug.js";
7
+ const R = 1 / 0, I = {
8
+ position: "absolute",
9
+ width: 0,
10
+ height: "var(--popoverMaxHeight, 240px)",
11
+ visibility: "hidden",
12
+ pointerEvents: "none"
13
+ }, B = (e, n) => Object.create(e, {
14
+ [Symbol.iterator]: {
15
+ value: function* () {
16
+ let s = 0;
17
+ for (const t of e) {
18
+ if (s >= n)
19
+ return;
20
+ s += 1, yield t;
21
+ }
22
+ }
23
+ }
24
+ }), S = (e) => e.querySelector('[role="option"]') !== null, A = (e, n) => {
25
+ const s = e.getBoundingClientRect().top - e.scrollTop;
26
+ let t = 0;
27
+ for (const r of e.querySelectorAll('[role="option"]')) {
28
+ const f = r.getBoundingClientRect().top - s;
29
+ if (t > 0 && f >= n)
30
+ break;
31
+ t += 1;
32
+ }
33
+ return t;
34
+ }, X = ({ isForcedOpen: e, ...n }) => {
35
+ const s = _(g), t = L(null), [r, f] = m(null), [l, O] = m(R), [b, w] = m(0), x = N.count(n.children);
36
+ p(() => {
37
+ O(R);
38
+ }, [
39
+ r,
40
+ x,
41
+ b
42
+ ]), p(() => {
43
+ const o = t.current;
44
+ if (!r || !o || l !== R)
45
+ return;
46
+ const a = () => {
47
+ const c = r.getBoundingClientRect().height;
48
+ c > 0 && O(A(o, c));
49
+ };
50
+ if (S(o)) {
51
+ a();
52
+ return;
53
+ }
54
+ const i = new MutationObserver(() => {
55
+ S(o) && (i.disconnect(), a());
56
+ });
57
+ return i.observe(o, {
58
+ childList: !0,
59
+ subtree: !0
60
+ }), () => i.disconnect();
61
+ }, [
62
+ r,
63
+ l,
64
+ b
65
+ ]), p(() => {
66
+ const o = t.current;
67
+ if (!r || !o || typeof ResizeObserver > "u")
68
+ return;
69
+ const a = /* @__PURE__ */ new Map(), i = new ResizeObserver((c) => {
70
+ c.some(({ target: u, contentRect: v }) => {
71
+ const C = a.get(u);
72
+ return a.set(u, v.height), C !== void 0 && C !== v.height;
73
+ }) && w((u) => u + 1);
74
+ });
75
+ return i.observe(r), o.querySelectorAll('[role="option"]').forEach((c) => i.observe(c)), () => i.disconnect();
76
+ }, [
77
+ r,
78
+ l
79
+ ]);
80
+ const y = D(() => ({
81
+ ...E,
82
+ CollectionRoot: (o) => /* @__PURE__ */ d.createElement(E.CollectionRoot, {
83
+ ...o,
84
+ collection: B(o.collection, l)
85
+ })
86
+ }), [
87
+ l
88
+ ]);
89
+ return /* @__PURE__ */ d.createElement(g.Provider, {
90
+ value: e ? y : s
91
+ }, /* @__PURE__ */ d.createElement(M, {
92
+ ref: t,
93
+ ...n
94
+ }), e && /* @__PURE__ */ d.createElement("div", {
95
+ ref: f,
96
+ style: I
97
+ }));
98
+ }, V = {
99
+ base: h.selectOption,
100
+ selected: h.selectOptionSelected,
101
+ hover: h.selectOptionHover
102
+ }, q = ({ isSelected: e, isHovered: n, isFocused: s }) => ({
103
+ isSelected: e,
104
+ isHovered: (n || s) && !e
105
+ }), W = (e, ...n) => {
106
+ const s = H({
107
+ globalClasses: e,
108
+ moduleClasses: V
109
+ });
110
+ return (t) => P(s(q(t)), n);
111
+ }, Y = (...e) => W(T, ...e);
112
+ export {
113
+ X as V,
114
+ W as a,
115
+ Y as u
116
+ };
@@ -0,0 +1,96 @@
1
+ import n, { useState as b, useCallback as g, useRef as M } from "react";
2
+ import { UNSAFE_PortalProvider as k } from "react-aria";
3
+ import { Select as q, SelectValue as G, ListBoxItem as H } from "react-aria-components";
4
+ import { bz as E, bw as O, bB as z, K } from "./form-DSpx-AO8.js";
5
+ import { f as d, a as F } from "./find-child-C60k4CxG.js";
6
+ import { D as U, E as W } from "./field-error-headless-XNWmDH3E.js";
7
+ import { L as Y } from "./field-label-headless-CORRAJGt.js";
8
+ import { E as j, S as J, N as Q } from "./non-modal-popover-D-u13tmp.js";
9
+ import { a as X } from "./use-is-forced-open-dropdown-Bp-5Xpmw.js";
10
+ import { V as Z } from "./use-dropdown-option-class-name-BQi_qE_-.js";
11
+ import { u as $ } from "./use-hoverable-input-class-name-BnV_uerV.js";
12
+ const r = ({ children: e }) => {
13
+ const { id: l, value: a, defaultValue: o, options: u = [], readOnly: s, onChange: t, placeholder: m, disabled: i, required: v, onBlur: D, onFocus: C, FieldLayout: L, hasError: I } = E(), [y, N] = b(!1), p = X(l), [P, R] = b(null), T = a && u.some((c) => (c.value ?? c.label) === a) ? a : o || null, { labelId: h } = O(), S = g((c) => {
14
+ s || t(typeof c == "string" ? c : null);
15
+ }, [
16
+ t,
17
+ s
18
+ ]), B = g((c) => N(c && !i && !s), [
19
+ i,
20
+ s
21
+ ]), V = d(e, r.Label), _ = d(e, r.Trigger), w = d(e, r.Options), x = d(e, r.Description), A = d(e, r.Error);
22
+ return /* @__PURE__ */ n.createElement(L, {
23
+ fieldId: l,
24
+ renderLabel: () => V,
25
+ renderInput: () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement("div", {
26
+ ref: R,
27
+ style: {
28
+ display: "contents"
29
+ }
30
+ }), /* @__PURE__ */ n.createElement(k, {
31
+ getContainer: () => P
32
+ }, /* @__PURE__ */ n.createElement(q, {
33
+ "aria-labelledby": h,
34
+ value: T,
35
+ isOpen: p || y && !i && !s,
36
+ onOpenChange: p ? void 0 : B,
37
+ onChange: S,
38
+ isDisabled: i,
39
+ isInvalid: I,
40
+ isRequired: v,
41
+ placeholder: m || j,
42
+ onBlur: D,
43
+ onFocus: C
44
+ }, _, F(w, {
45
+ isForcedOpen: p
46
+ })))),
47
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, A, x)
48
+ });
49
+ }, ee = ({ children: e, className: l }) => {
50
+ const { inputId: a, ariaDescribedBy: o } = O(), { id: u, hasError: s, isLoading: t } = E(), m = M(null);
51
+ return z(() => {
52
+ var i;
53
+ (i = m.current) == null || i.focus({
54
+ preventScroll: !0
55
+ });
56
+ }, u), /* @__PURE__ */ n.createElement(J, {
57
+ ref: m,
58
+ id: a,
59
+ "aria-describedby": o,
60
+ className: l,
61
+ "data-invalid": s || void 0,
62
+ "data-loading": t || void 0
63
+ }, /* @__PURE__ */ n.createElement(G, null), e);
64
+ }, f = ({ children: e, className: l, ...a }) => {
65
+ const { isForcedOpen: o } = a, { options: u = [] } = E(), s = d(e, f.Option);
66
+ return /* @__PURE__ */ n.createElement(Q, {
67
+ className: l,
68
+ containerPadding: 0,
69
+ offset: 0
70
+ }, /* @__PURE__ */ n.createElement(Z, {
71
+ isForcedOpen: o,
72
+ autoFocus: o ? !1 : void 0
73
+ }, u.map((t) => F(s, {
74
+ key: t.value ?? t.label,
75
+ value: t.value ?? t.label,
76
+ label: t.label
77
+ }))));
78
+ }, ne = ({ className: e, ...l }) => {
79
+ const { value: a, label: o } = l;
80
+ return /* @__PURE__ */ n.createElement(H, {
81
+ className: e,
82
+ id: a,
83
+ textValue: o
84
+ }, o);
85
+ };
86
+ f.Option = ne;
87
+ r.Label = Y;
88
+ r.Trigger = ee;
89
+ r.Options = f;
90
+ r.Description = U;
91
+ r.Error = W;
92
+ const pe = (...e) => $(K, e);
93
+ export {
94
+ r as D,
95
+ pe as u
96
+ };
@@ -1,5 +1,5 @@
1
1
  import i from "classnames";
2
- import { bh as s, aQ as v } from "./form-BTUoOcqB.js";
2
+ import { bs as s, a$ as v } from "./form-DSpx-AO8.js";
3
3
  const x = ({ globalClasses: e, moduleClasses: r }) => {
4
4
  var d;
5
5
  const c = ((d = s(...v(e))) == null ? void 0 : d.split(/\s+/)) ?? [], o = [
@@ -1,6 +1,6 @@
1
- import { bo as n } from "./form-BTUoOcqB.js";
1
+ import { bz as n } from "./form-DSpx-AO8.js";
2
2
  import { s as e } from "./field-rac.module-DP0lkkEv.js";
3
- import { u } from "./use-element-state-class-name-BUsFQfoW.js";
3
+ import { u } from "./use-element-state-class-name-rXM_lHug.js";
4
4
  const b = (s, a) => {
5
5
  const { disabled: t, readOnly: o } = n(), r = u({
6
6
  globalClasses: s,
@@ -0,0 +1,53 @@
1
+ import { useContext as c, useMemo as i } from "react";
2
+ import { bt as r, aF as a, br as d, F as t } from "./form-DSpx-AO8.js";
3
+ const u = [
4
+ t.DROPDOWN,
5
+ t.DEXT_DROPDOWN,
6
+ t.SERVICES_DROPDOWN,
7
+ t.DATE_INPUT,
8
+ t.CONTACTS_BIRTHDATE,
9
+ t.DATE_TIME_INPUT,
10
+ t.DEXT_DATE_TIME_INPUT
11
+ ], T = [
12
+ t.DATE_PICKER,
13
+ t.DEXT_DATE_PICKER
14
+ ], O = [
15
+ t.PHONE,
16
+ t.CONTACTS_PHONE,
17
+ t.BOOKINGS_PHONE,
18
+ t.DEXT_PHONE
19
+ ], p = [
20
+ t.MULTILINE_ADDRESS,
21
+ t.BOOKINGS_ADDRESS,
22
+ t.ECOM_ADDRESS
23
+ ], _ = ({ properties: e }) => {
24
+ var n, o, s, D;
25
+ return ((D = (s = (o = (n = e.validation) == null ? void 0 : n.string) == null ? void 0 : o.phoneOptions) == null ? void 0 : s.allowedCountryCodes) == null ? void 0 : D.length) !== 1;
26
+ }, I = ({ properties: e }) => {
27
+ var n, o;
28
+ return ((o = (n = e.fieldSettings) == null ? void 0 : n.country) == null ? void 0 : o.show) !== !1;
29
+ }, P = (e, n) => O.includes(e.fieldType) && !n && _(e), l = (e) => p.includes(e.fieldType) ? I(e) : u.includes(e.fieldType), S = (e) => T.includes(e.fieldType), C = ({ properties: e }) => !e.disabled && !e.readOnly, E = (e) => {
30
+ const n = c(a), { isMobile: o = !1 } = d();
31
+ return i(() => !n || n.parentId ? [] : n.fields.filter((s) => e(s, o) && C(s)).map((s) => s.id), [
32
+ n,
33
+ o,
34
+ e
35
+ ]);
36
+ }, R = (e) => {
37
+ var s;
38
+ const n = ((s = r().dropdown) == null ? void 0 : s.open) === !0, o = E(l);
39
+ return n && o.includes(e);
40
+ }, F = (e) => {
41
+ var s;
42
+ const n = ((s = r().phone) == null ? void 0 : s.open) === !0, o = E(P);
43
+ return n && o.includes(e);
44
+ }, f = (e) => {
45
+ var s;
46
+ const n = ((s = r().datePicker) == null ? void 0 : s.open) === !0, o = E(S);
47
+ return n && o.includes(e);
48
+ };
49
+ export {
50
+ R as a,
51
+ F as b,
52
+ f as u
53
+ };
@@ -1,7 +1,7 @@
1
- import { useState as o, useCallback as y, useEffect as m, useMemo as D } from "react";
2
- import { bn as v } from "./form-BTUoOcqB.js";
1
+ import { useState as o, useCallback as b, useEffect as m, useMemo as D } from "react";
2
+ import { by as v } from "./form-DSpx-AO8.js";
3
3
  const k = (I) => {
4
- const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: n, onInitialDataLoaded: a } = I, [O, h] = o(!1), [g, p] = o([]), [E, u] = o(!1), [c, f] = o(!1), s = v(L), r = y((e) => {
4
+ const { fieldType: L, isEditor: t = !1, postProcessOptions: i, customFetchLogic: a, onInitialDataLoaded: n } = I, [O, h] = o(!1), [g, p] = o([]), [y, u] = o(!1), [c, f] = o(!1), s = v(L), r = b((e) => {
5
5
  let d = e.map((l) => ({
6
6
  value: l.id ?? "",
7
7
  label: l.name ?? "",
@@ -14,28 +14,28 @@ const k = (I) => {
14
14
  m(() => {
15
15
  if (s != null && s.services) {
16
16
  const e = r(s.services);
17
- p(e), u(e.length === 0), f(!0), a && a(e);
17
+ p(e), u(e.length === 0), f(!0), n && n(e);
18
18
  }
19
19
  }, [
20
20
  s,
21
21
  r,
22
- a
22
+ n
23
23
  ]), m(() => {
24
- n && !t && n();
24
+ a && !t && a();
25
25
  }, [
26
- n,
26
+ a,
27
27
  t
28
28
  ]);
29
- const b = D(() => t || c, [
29
+ const E = D(() => t || c, [
30
30
  t,
31
31
  c
32
32
  ]);
33
33
  return {
34
34
  isLoading: O,
35
35
  options: g,
36
- isEmpty: E,
36
+ isEmpty: y,
37
37
  hasInitialDataLoaded: c,
38
- shouldRender: b,
38
+ shouldRender: E,
39
39
  setIsLoading: h,
40
40
  setOptions: p,
41
41
  setIsEmpty: u,
@@ -0,0 +1,6 @@
1
+ import { an as a } from "./form-DSpx-AO8.js";
2
+ import { u as e } from "./use-hoverable-input-class-name-BnV_uerV.js";
3
+ const m = (...s) => e(a, s);
4
+ export {
5
+ m as u
6
+ };
package/dist/form.d.ts CHANGED
@@ -6992,6 +6992,14 @@ type ElementProps = ElementTree & {
6992
6992
  }> & {
6993
6993
  open?: boolean;
6994
6994
  };
6995
+ phone?: ElementEntry<{
6996
+ popover?: ElementEntry<{
6997
+ option?: LeafEntry;
6998
+ search?: LeafEntry;
6999
+ }>;
7000
+ }> & {
7001
+ open?: boolean;
7002
+ };
6995
7003
  signature?: ElementEntry<ElementTree & {
6996
7004
  dropZone?: ElementEntry<{
6997
7005
  uploadButton?: ElementEntry<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/form-elements",
3
- "version": "1.159.0",
3
+ "version": "1.160.0",
4
4
  "description": "The Wix Forms rendering element for Builder apps, loaded at runtime as @wix/form-elements/Form",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -156,5 +156,5 @@
156
156
  ]
157
157
  }
158
158
  },
159
- "falconPackageHash": "4949adcca161243b4961f0e9690e1fc3e117963c612e7e503e69ccc4"
159
+ "falconPackageHash": "4056ec8b67966e77ee233ab87cc12bb9411034a30bc372bf323425d1"
160
160
  }
@@ -1,303 +0,0 @@
1
- import { RicosViewer as ae } from "@wix/ricos/viewer";
2
- import D from "classnames";
3
- import t, { useMemo as N, useState as k, useCallback as Y, useRef as H } from "react";
4
- import { UNSAFE_PortalProvider as ne } from "react-aria";
5
- import { ListBoxItem as re, Select as oe, TextField as $, SelectValue as se, Input as z } from "react-aria-components";
6
- import { bo as y, bl as W, bg as w, aV as K, b6 as Q, aI as o, by as T, aP as le, aW as ce, bd as ie, bq as V, R as M, a0 as me, y as de, H as ue, v as pe } from "./form-BTUoOcqB.js";
7
- import { f as p, a as B } from "./find-child-C60k4CxG.js";
8
- import { g as Ee } from "./helpers-HmkkXrh2.js";
9
- import { D as fe, E as be } from "./field-error-headless-DWc76YmY.js";
10
- import { L as De } from "./field-label-headless-DKBKqI2X.js";
11
- import { F as he } from "./fieldset-headless-CD3fds9J.js";
12
- import { N as ye, E as Ie, S as Oe } from "./non-modal-popover-D-u13tmp.js";
13
- import { a as ge } from "./use-is-forced-open-dropdown-CoOk4W4i.js";
14
- import { V as Ne, a as Ce, u as _e } from "./use-dropdown-trigger-class-name-rcGBzxI1.js";
15
- import { C as Le } from "./chevron-down-icon-CcpVm6B-.js";
16
- import { E as Fe } from "./error-icon-hZxQ6DEy.js";
17
- import { H as Re } from "./custom-focus-class-_483Pkwp.js";
18
- import { s as f } from "./field-rac.module-DP0lkkEv.js";
19
- import { u as q } from "./use-text-input-class-name-BLtPQoYE.js";
20
- const Me = {
21
- [o.MONTH]: "bday-month",
22
- [o.DAY]: "bday-day",
23
- [o.YEAR]: "bday-year"
24
- }, x = (e, a) => e === "bday" ? Me[a] : void 0, n = ({ children: e, className: a }) => {
25
- const { id: r, required: s, onBlur: l, onFocus: c, FieldLayout: m } = y(), { inputId: i, labelId: d, ariaDescribedBy: u } = W(), { regionalFormat: E } = w(), b = N(() => K(E).filter(Q).map((S) => S.toUpperCase()), [
26
- E
27
- ]), _ = p(e, n.Label), v = p(e, n.Description), P = p(e, n.Error), I = {
28
- [o.MONTH]: p(e, n.Month),
29
- [o.DAY]: p(e, n.Day),
30
- [o.YEAR]: p(e, n.Year)
31
- };
32
- return /* @__PURE__ */ t.createElement(m, {
33
- fieldId: r,
34
- renderLabel: () => B(_, {
35
- as: "div"
36
- }),
37
- renderInput: () => /* @__PURE__ */ t.createElement(he, {
38
- id: i,
39
- ariaLabelledBy: d,
40
- ariaDescribedBy: u,
41
- required: s,
42
- onBlur: l,
43
- onFocus: c,
44
- className: a
45
- }, I[b[0]], I[b[1]], I[b[2]]),
46
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, P, v)
47
- });
48
- }, O = ({ children: e, className: a }) => {
49
- const { id: r, disabled: s, readOnly: l, showDateLabels: c, hidePlaceholder: m, autoComplete: i } = y(), { labelId: d } = g(o.MONTH), { partValue: u, partError: E, onPartChange: b } = C(o.MONTH), { t: _ } = T(), [v, P] = k(!1), I = ge(r), [S, j] = k(null), G = m ? Ie : _("field.date.placeholder.month"), J = Y((R) => {
50
- l || b(typeof R == "string" ? R : "");
51
- }, [
52
- b,
53
- l
54
- ]), X = Y((R) => {
55
- P(R && !l);
56
- }, [
57
- l
58
- ]), Z = p(e, O.Label), ee = p(e, O.Trigger), te = p(e, O.Options);
59
- return /* @__PURE__ */ t.createElement("div", {
60
- className: a,
61
- "data-date-field": !0
62
- }, c ? Z : null, /* @__PURE__ */ t.createElement("div", {
63
- ref: j,
64
- style: {
65
- display: "contents"
66
- }
67
- }), /* @__PURE__ */ t.createElement(ne, {
68
- getContainer: () => S
69
- }, /* @__PURE__ */ t.createElement(oe, {
70
- autoComplete: x(i, o.MONTH),
71
- "aria-labelledby": c ? d : void 0,
72
- value: u || null,
73
- onChange: J,
74
- isDisabled: s,
75
- isInvalid: E,
76
- placeholder: G,
77
- isOpen: I || v,
78
- onOpenChange: I ? void 0 : X
79
- }, ee, B(te, {
80
- isForcedOpen: I
81
- }))));
82
- }, Ae = ({ className: e }) => /* @__PURE__ */ t.createElement(U, {
83
- datePart: o.MONTH,
84
- className: e
85
- }), Te = ({ children: e, className: a }) => {
86
- const { id: r, readOnly: s } = y(), { inputId: l } = g(o.MONTH), { partError: c, isFirstPart: m } = C(o.MONTH), i = H(null);
87
- return V(() => {
88
- var d;
89
- m && ((d = i.current) == null || d.focus({
90
- preventScroll: !0
91
- }));
92
- }, r), /* @__PURE__ */ t.createElement(Oe, {
93
- ref: i,
94
- id: l,
95
- className: a,
96
- "data-hook": o.MONTH,
97
- "data-invalid": c || void 0,
98
- "data-readonly": s || void 0
99
- }, /* @__PURE__ */ t.createElement(se, null), e);
100
- }, A = ({ children: e, className: a, ...r }) => {
101
- const { isForcedOpen: s } = r, { language: l } = w(), c = N(() => Ee(l), [
102
- l
103
- ]), m = p(e, A.Option) ?? /* @__PURE__ */ t.createElement(A.Option, null);
104
- return /* @__PURE__ */ t.createElement(ye, {
105
- className: a,
106
- containerPadding: 0,
107
- offset: 0
108
- }, /* @__PURE__ */ t.createElement(Ne, {
109
- isForcedOpen: s,
110
- autoFocus: s ? !1 : void 0
111
- }, c.map((i, d) => B(m, {
112
- key: String(d + 1),
113
- value: String(d + 1),
114
- label: i
115
- }))));
116
- }, ve = ({ className: e, ...a }) => {
117
- const { value: r, label: s } = a;
118
- return /* @__PURE__ */ t.createElement(re, {
119
- className: e,
120
- id: r,
121
- textValue: s
122
- }, s);
123
- };
124
- O.Label = Ae;
125
- O.Trigger = Te;
126
- O.Options = A;
127
- A.Option = ve;
128
- const L = ({ children: e, className: a }) => {
129
- const { disabled: r, readOnly: s, showDateLabels: l } = y(), { labelId: c } = g(o.DAY), { partValue: m, partError: i, onPartChange: d } = C(o.DAY), u = p(e, L.Label), E = p(e, L.Input);
130
- return /* @__PURE__ */ t.createElement("div", {
131
- className: a,
132
- "data-date-field": !0
133
- }, l && u, /* @__PURE__ */ t.createElement($, {
134
- "aria-labelledby": l ? c : void 0,
135
- value: m,
136
- onChange: d,
137
- isDisabled: r,
138
- isReadOnly: s,
139
- isInvalid: i
140
- }, E));
141
- }, Pe = ({ className: e }) => /* @__PURE__ */ t.createElement(U, {
142
- datePart: o.DAY,
143
- className: e
144
- }), Se = ({ className: e }) => {
145
- const { id: a, hidePlaceholder: r, autoComplete: s } = y(), { inputId: l } = g(o.DAY), { isFirstPart: c } = C(o.DAY), { t: m } = T(), i = H(null), d = r ? void 0 : m("field.date.placeholder.day");
146
- return V(() => {
147
- var u;
148
- c && ((u = i.current) == null || u.focus({
149
- preventScroll: !0
150
- }));
151
- }, a), /* @__PURE__ */ t.createElement(z, {
152
- ref: i,
153
- id: l,
154
- className: e,
155
- placeholder: d,
156
- autoComplete: x(s, o.DAY),
157
- maxLength: 2,
158
- inputMode: "numeric",
159
- "data-hook": o.DAY
160
- });
161
- };
162
- L.Label = Pe;
163
- L.Input = Se;
164
- const F = ({ children: e, className: a }) => {
165
- const { disabled: r, readOnly: s, showDateLabels: l } = y(), { labelId: c } = g(o.YEAR), { partValue: m, partError: i, onPartChange: d } = C(o.YEAR), u = p(e, F.Label), E = p(e, F.Input);
166
- return /* @__PURE__ */ t.createElement("div", {
167
- className: a,
168
- "data-date-field": !0
169
- }, l && u, /* @__PURE__ */ t.createElement($, {
170
- "aria-labelledby": l ? c : void 0,
171
- value: m,
172
- onChange: d,
173
- isDisabled: r,
174
- isReadOnly: s,
175
- isInvalid: i
176
- }, E));
177
- }, Ye = ({ className: e }) => /* @__PURE__ */ t.createElement(U, {
178
- datePart: o.YEAR,
179
- className: e
180
- }), He = ({ className: e }) => {
181
- const { id: a, hidePlaceholder: r, autoComplete: s } = y(), { inputId: l } = g(o.YEAR), { isFirstPart: c } = C(o.YEAR), { t: m } = T(), i = H(null), d = r ? void 0 : m("field.date.placeholder.year");
182
- return V(() => {
183
- var u;
184
- c && ((u = i.current) == null || u.focus({
185
- preventScroll: !0
186
- }));
187
- }, a), /* @__PURE__ */ t.createElement(z, {
188
- ref: i,
189
- id: l,
190
- className: e,
191
- placeholder: d,
192
- autoComplete: x(s, o.YEAR),
193
- maxLength: 4,
194
- inputMode: "numeric",
195
- "data-hook": o.YEAR
196
- });
197
- };
198
- F.Label = Ye;
199
- F.Input = He;
200
- n.Label = De;
201
- n.Month = O;
202
- n.Day = L;
203
- n.Year = F;
204
- n.Description = fe;
205
- n.Error = be;
206
- function g(e) {
207
- const { inputId: a } = W();
208
- return N(() => {
209
- const r = e.toLowerCase();
210
- return {
211
- inputId: `${a}-${r}-input`,
212
- labelId: `${a}-${r}-label`
213
- };
214
- }, [
215
- a,
216
- e
217
- ]);
218
- }
219
- function C(e) {
220
- const { value: a, onChange: r, hasError: s = !1 } = y(), { regionalFormat: l } = w(), c = N(() => le(a ?? ""), [
221
- a
222
- ]), m = N(() => ce(s, a ?? ""), [
223
- a,
224
- s
225
- ]), i = c[e] || "", d = Y((E) => {
226
- const b = ie(E, e, c);
227
- r(b);
228
- }, [
229
- r,
230
- c,
231
- e
232
- ]), u = N(() => K(l).filter(Q).map((_) => _.toUpperCase())[0] === e, [
233
- l,
234
- e
235
- ]);
236
- return {
237
- partValue: i,
238
- partError: m[e],
239
- onPartChange: d,
240
- isFirstPart: u
241
- };
242
- }
243
- function U({ datePart: e, className: a }) {
244
- const { inputId: r, labelId: s } = g(e), { t: l } = T(), c = `field.date.label.${e.toLowerCase()}`, m = l(c);
245
- return /* @__PURE__ */ t.createElement("label", {
246
- id: s,
247
- htmlFor: r,
248
- className: a
249
- }, m);
250
- }
251
- const we = "_fields_1mv4t_1", Ve = "_month_1mv4t_10", Be = "_day_1mv4t_11", xe = "_year_1mv4t_12", Ue = "_dayInput_1mv4t_28", ke = "_yearInput_1mv4t_29", qe = "_monthTrigger_1mv4t_33", $e = "_monthOption_1mv4t_53", h = {
252
- fields: we,
253
- month: Ve,
254
- day: Be,
255
- year: xe,
256
- dayInput: Ue,
257
- yearInput: ke,
258
- monthTrigger: qe,
259
- monthOption: $e
260
- }, ze = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(ae, {
261
- content: e,
262
- locale: a
263
- }), dt = () => {
264
- const e = Ce(h.monthTrigger), a = _e(h.monthOption, Re), r = q(h.dayInput), s = q(h.yearInput);
265
- return /* @__PURE__ */ t.createElement(n, {
266
- className: h.fields
267
- }, /* @__PURE__ */ t.createElement(n.Label, {
268
- className: D(M, f.label)
269
- }, /* @__PURE__ */ t.createElement(n.Label.Required, {
270
- className: D(me, f.requiredMark)
271
- })), /* @__PURE__ */ t.createElement(n.Month, {
272
- className: h.month
273
- }, /* @__PURE__ */ t.createElement(n.Month.Label, {
274
- className: D(M, f.label)
275
- }), /* @__PURE__ */ t.createElement(n.Month.Trigger, {
276
- className: e
277
- }, /* @__PURE__ */ t.createElement(Le, {
278
- className: f.dropdownIcon
279
- })), /* @__PURE__ */ t.createElement(n.Month.Options, {
280
- className: D(de, f.selectPopover, f.dropdownPopover)
281
- }, /* @__PURE__ */ t.createElement(n.Month.Options.Option, {
282
- className: a
283
- }))), /* @__PURE__ */ t.createElement(n.Day, {
284
- className: h.day
285
- }, /* @__PURE__ */ t.createElement(n.Day.Label, {
286
- className: D(M, f.label)
287
- }), /* @__PURE__ */ t.createElement(n.Day.Input, {
288
- className: r
289
- })), /* @__PURE__ */ t.createElement(n.Year, {
290
- className: h.year
291
- }, /* @__PURE__ */ t.createElement(n.Year.Label, {
292
- className: D(M, f.label)
293
- }), /* @__PURE__ */ t.createElement(n.Year.Input, {
294
- className: s
295
- })), /* @__PURE__ */ t.createElement(n.Error, {
296
- className: D(ue, f.error)
297
- }, /* @__PURE__ */ t.createElement(Fe, null), /* @__PURE__ */ t.createElement(n.Error.Text, null)), /* @__PURE__ */ t.createElement(n.Description, {
298
- className: D(pe, f.description)
299
- }, ze));
300
- };
301
- export {
302
- dt as D
303
- };