@wix/form-elements 1.91.0 → 1.93.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 (110) hide show
  1. package/dist/component/{appointment-rac-CDZ0Gdin.js → appointment-rac-bw0pvoxP.js} +4 -4
  2. package/dist/component/{bookings-address-rac-pmQyMw-1.js → bookings-address-rac-DECq7eWR.js} +1 -1
  3. package/dist/component/{bookings-email-rac-CzDEYpBV.js → bookings-email-rac-DTLjh6Zw.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-qg7T37FZ.js → bookings-first-name-rac-DObRe-Gq.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Dmwmt_Cp.js → bookings-header-rac-DjpmYRJG.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-CXTtlnYI.js → bookings-last-name-rac-Ds3o0ABM.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DTs9s6hU.js → bookings-login-bar-rac-DPUL2jWj.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-C7AEVZA-.js → bookings-phone-rac-DIIHPxEP.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-CBGVMqOn.js → bookings-rich-text-rac-BrcQO9xx.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-BggtF6cZ.js → checkbox-field-rac-CD1MP1LT.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-O2ZsF7An.js → checkbox-group-field-headless-C0V6zq0u.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-OC3W4Taz.js → checkbox-group-field-rac-B-MYpz53.js} +3 -3
  13. package/dist/component/{checkbox-group-rac-CZuEXWgx.js → checkbox-group-rac-BejQjiO2.js} +1 -1
  14. package/dist/component/{checkbox-rac-W-a8Z0ht.js → checkbox-rac-B0YgCj29.js} +1 -1
  15. package/dist/component/{contacts-address-rac-DtG9NDgw.js → contacts-address-rac-B1QNl3Lb.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-DS7uNjKO.js → contacts-birthdate-rac-Cp-gh3P-.js} +1 -1
  17. package/dist/component/{contacts-company-rac-CQX5azvs.js → contacts-company-rac-CSCU7JGm.js} +1 -1
  18. package/dist/component/{contacts-email-rac-QgYLfH6e.js → contacts-email-rac-B1Oov6-3.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-BrlHl2Uj.js → contacts-first-name-rac-rsHIOcjr.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-ieDtRIbl.js → contacts-last-name-rac-Csgq53Wm.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-LTjC8k7e.js → contacts-phone-rac-r9SwjDZ4.js} +1 -1
  22. package/dist/component/{contacts-position-rac-CxbAUzIc.js → contacts-position-rac-D7VcCM7v.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-H0dNjYV8.js → contacts-subscribe-rac-8Nu9ncZW.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-uhTEMEwl.js → contacts-tax-id-rac-CL_JSl_W.js} +1 -1
  25. package/dist/component/{date-availability-eRjWauCz.js → date-availability-DLOKY9C4.js} +1 -1
  26. package/dist/component/date-input-field-rac-D23Al-Mr.js +292 -0
  27. package/dist/component/{date-input-rac-BBllT9pM.js → date-input-rac-B6zgkw-L.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-CSXVWmGL.js → date-picker-field-rac-BqdzPPzK.js} +4 -4
  29. package/dist/component/{date-picker-rac-CwEFOSSe.js → date-picker-rac-C7g6aceb.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-BENzf6gc.js +428 -0
  31. package/dist/component/{date-time-input-rac-DsGlyO8x.js → date-time-input-rac-CVpK3mgw.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-Bs9tVVXo.js → dext-checkbox-group-rac-CbEFDD3H.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-FEjZejl7.js → dext-checkbox-rac-BdtZvn6I.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-Mdbuq1mu.js → dext-date-picker-rac-BAhFvUEx.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-B4dRBObU.js → dext-date-time-input-rac-iXMKMwQY.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-QVngfb7K.js → dext-dropdown-rac-D-NPziZS.js} +1 -1
  37. package/dist/component/{dext-email-rac-cURI3VuR.js → dext-email-rac-DYSwyB80.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-CovkZ8Ey.js → dext-number-input-rac-DXx8hgFg.js} +1 -1
  39. package/dist/component/{dext-phone-rac-C8GjKZnH.js → dext-phone-rac-BtuLROzm.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-BlrJmIH3.js → dext-radio-group-rac-MdKNiJ2i.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-jIJisfdp.js → dext-rating-input-rac-d998xond.js} +1 -1
  42. package/dist/component/{dext-tags-rac-BXjCLX6y.js → dext-tags-rac-DnSpOM9T.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-CD_x4meg.js → dext-text-area-rac-KqjeDDWe.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-Du51Nj6q.js → dext-text-input-rac-CtCnClfX.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-_W6CW5hp.js → dext-url-input-rac-DSJQcLLr.js} +1 -1
  46. package/dist/component/{donation-rac-9njvq8HE.js → donation-rac-B_KGkBgo.js} +5 -5
  47. package/dist/component/dropdown-field-headless-BUilB8wZ.js +89 -0
  48. package/dist/component/{dropdown-field-rac-BYRb3VEI.js → dropdown-field-rac-COupYC1a.js} +2 -2
  49. package/dist/component/{dropdown-rac-BBrPWiSg.js → dropdown-rac-Dj0UZrE0.js} +1 -1
  50. package/dist/component/{ecom-address-rac-CDJ46mdt.js → ecom-address-rac-C0xnn86e.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-DItvmxzX.js → ecom-subscription-checkbox-rac-D-ekxwUE.js} +2 -2
  52. package/dist/component/{email-input-field-rac-aeRdkPOh.js → email-input-field-rac-DVj1qz_R.js} +3 -3
  53. package/dist/component/{events-repeater-rac-CzVycetd.js → events-repeater-rac-U0aq9Z4Q.js} +3 -3
  54. package/dist/component/{events-rsvp-rac-BhLYlH1V.js → events-rsvp-rac-C7J58_5q.js} +2 -2
  55. package/dist/component/{field-error-headless-T9JfqiMS.js → field-error-headless-2nYJ2792.js} +1 -1
  56. package/dist/component/{field-label-headless-bDWQszAb.js → field-label-headless-D97ACnmc.js} +1 -1
  57. package/dist/component/{file-upload-rac-Dk-delp2.js → file-upload-rac-BR7QpuPW.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-Bj8RMj1w.js → fixed-payment-rac-COl18wW1.js} +3 -3
  59. package/dist/component/{form-C7cB75mm.js → form-DKKTSAj1.js} +69 -69
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-RzI5owwx.js → header-field-rac-B6DyMG3U.js} +2 -2
  63. package/dist/component/{header-rac-DQgyaMDA.js → header-rac-x4H2qMky.js} +1 -1
  64. package/dist/component/{image-choice-rac-DOs1eI0_.js → image-choice-rac-BVgmKTKk.js} +4 -4
  65. package/dist/component/{index-DlPclNOa.js → index-C47UMGhd.js} +4 -4
  66. package/dist/component/{index-C90Q2rfK.js → index-DnpqBcg5.js} +2 -2
  67. package/dist/component/{isObjectLike-DLz0WtlZ.js → isObjectLike-BrrFBP4f.js} +1 -1
  68. package/dist/component/multiline-address-field-rac-B6ka-2Wy.js +1630 -0
  69. package/dist/component/{multiline-address-rac-7sUhPDFM.js → multiline-address-rac-Bh58qUEe.js} +1 -1
  70. package/dist/component/{number-input-field-rac-DMHSUbYN.js → number-input-field-rac-pAmxvk3A.js} +4 -4
  71. package/dist/component/{number-input-rac-CF5271QD.js → number-input-rac-mKA2njIU.js} +1 -1
  72. package/dist/component/{password-rac-CxQRcSEb.js → password-rac-BbD7PQXO.js} +4 -4
  73. package/dist/component/{payment-input-rac-C20HS9QN.js → payment-input-rac-UdkwC1ek.js} +4 -4
  74. package/dist/component/phone-input-field-rac-BVLVVDTq.js +487 -0
  75. package/dist/component/{phone-rac-pGbG3Cu0.js → phone-rac-LixcB9WV.js} +1 -1
  76. package/dist/component/{product-list-rac-CxyJaRQ6.js → product-list-rac-B_dL1Ov-.js} +4 -4
  77. package/dist/component/{quiz-radio-group-rac-CCddKnuf.js → quiz-radio-group-rac-Bj5XfqNf.js} +1 -1
  78. package/dist/component/{radio-button-module-classes-uyJAJMZn.js → radio-button-module-classes-y_PtsZPP.js} +3 -3
  79. package/dist/component/{radio-group-field-rac-VwR2FlNg.js → radio-group-field-rac-C8OElNAQ.js} +3 -3
  80. package/dist/component/{radio-group-rac-D8pzwSCS.js → radio-group-rac-BqJFboHE.js} +1 -1
  81. package/dist/component/{rating-input-field-rac-C4ohOgX0.js → rating-input-field-rac-C9_ITvEh.js} +4 -4
  82. package/dist/component/{rating-input-rac-NpCggSGK.js → rating-input-rac-CvTpEUoU.js} +1 -1
  83. package/dist/component/{rich-content-rac.module-B9HHqJL4.js → rich-content-rac.module-D4pEN-TY.js} +1 -1
  84. package/dist/component/{rich-text-field-rac-C3qKHitl.js → rich-text-field-rac-B8cqCmaf.js} +2 -2
  85. package/dist/component/{rich-text-rac-BJkS9CGE.js → rich-text-rac-C1o-tfXG.js} +1 -1
  86. package/dist/component/{service-dropdown-rac-BTdBTfeg.js → service-dropdown-rac-BOXqB2aq.js} +4 -4
  87. package/dist/component/{services-multi-choice-rac-Nl74A8jo.js → services-multi-choice-rac-Dk4rz-fw.js} +5 -5
  88. package/dist/component/{signature-rac-BAVXA-5Q.js → signature-rac-h9GWVdez.js} +3 -3
  89. package/dist/component/{submit-button-rac-DlmeZjy_.js → submit-button-rac-qNaTyCxd.js} +1 -1
  90. package/dist/component/{tags-field-rac-BFBSf5mt.js → tags-field-rac-NMRn0YnW.js} +5 -5
  91. package/dist/component/{tags-rac-S_GJQpwJ.js → tags-rac-DGx4KxEn.js} +1 -1
  92. package/dist/component/{text-area-field-rac-D1qLXh4K.js → text-area-field-rac-C7u0D4l3.js} +4 -4
  93. package/dist/component/{text-area-rac-DejqDYR0.js → text-area-rac-Yo-RIyLm.js} +1 -1
  94. package/dist/component/{text-input-field-rac-DwPTWyiR.js → text-input-field-rac-CvU-1clq.js} +2 -2
  95. package/dist/component/{text-input-headless-BUljrxVJ.js → text-input-headless-DLRwVmwf.js} +3 -3
  96. package/dist/component/{text-input-rac-CCWkAOVG.js → text-input-rac-CWh5xjZA.js} +1 -1
  97. package/dist/component/{time-input-rac-b09-o8Uw.js → time-input-rac-BZlso9qK.js} +4 -4
  98. package/dist/component/{url-input-field-rac-DYGAFldc.js → url-input-field-rac-Bax0TB4Q.js} +4 -4
  99. package/dist/component/{url-input-rac-CsAWnWt5.js → url-input-rac-Bw2nfybR.js} +1 -1
  100. package/dist/component/use-dropdown-option-class-name-vKSagp3b.js +57 -0
  101. package/dist/component/{use-element-state-class-name-DZhlOoWK.js → use-element-state-class-name-C0zLrsDR.js} +1 -1
  102. package/dist/component/{use-service-options-base-JNSCsxxz.js → use-service-options-base-Bkj6BSQL.js} +1 -1
  103. package/dist/component/{use-text-input-class-name-CgCYHOMw.js → use-text-input-class-name-Biu89Ma7.js} +2 -2
  104. package/package.json +2 -2
  105. package/dist/component/date-input-field-rac-BKb019gB.js +0 -288
  106. package/dist/component/date-time-input-field-rac-C4yIIebr.js +0 -424
  107. package/dist/component/dropdown-field-headless-BBc5oicg.js +0 -101
  108. package/dist/component/multiline-address-field-rac-DHYRZxtJ.js +0 -1618
  109. package/dist/component/phone-input-field-rac-BDF_4RJE.js +0 -474
  110. package/dist/component/use-dropdown-option-class-name-CruN_y12.js +0 -28
@@ -1,288 +0,0 @@
1
- import { RicosViewer as X } from "@wix/ricos/viewer";
2
- import f from "classnames";
3
- import t, { useMemo as N, useState as w, useCallback as B, useRef as H } from "react";
4
- import { ak as D, ah as k, ac as A, K as U, a2 as q, s as i, au as P, y as Z, O as ee, a9 as te, am as V } from "./form-C7cB75mm.js";
5
- import { UNSAFE_PortalProvider as ae } from "react-aria";
6
- import { ListBoxItem as ne, ListBox as re, Select as oe, TextField as $, SelectValue as se, Input as z } from "react-aria-components";
7
- import { f as u, a as K } from "./find-child-C60k4CxG.js";
8
- import { g as le } from "./helpers-HmkkXrh2.js";
9
- import { D as ce, E as ie } from "./field-error-headless-T9JfqiMS.js";
10
- import { L as me } from "./field-label-headless-bDWQszAb.js";
11
- import { F as de } from "./fieldset-headless-CD3fds9J.js";
12
- import { N as ue, S as pe } from "./non-modal-popover-DtIMXHbe.js";
13
- import { C as Ee } from "./chevron-down-icon-CcpVm6B-.js";
14
- import { E as be } from "./error-icon-hZxQ6DEy.js";
15
- import { H as fe } from "./custom-focus-class-_483Pkwp.js";
16
- import { s as E } from "./field-rac.module-BUvPquav.js";
17
- import { B as R, R as he, z as Ie, D as De, q as ge, i as ye } from "./form-element-classes-CLZXu-91.js";
18
- import { g as Ne } from "./use-dropdown-option-class-name-CruN_y12.js";
19
- import { u as x } from "./use-text-input-class-name-CgCYHOMw.js";
20
- const n = ({ children: e, className: a }) => {
21
- const { id: r, required: o, onBlur: s, onFocus: c, FieldLayout: l } = D(), { inputId: d, labelId: m, ariaDescribedBy: b } = k(), { regionalFormat: p } = A(), I = N(() => U(p).filter(q).map((v) => v.toUpperCase()), [
22
- p
23
- ]), O = u(e, n.Label), T = u(e, n.Description), Y = u(e, n.Error), L = {
24
- [i.MONTH]: u(e, n.Month),
25
- [i.DAY]: u(e, n.Day),
26
- [i.YEAR]: u(e, n.Year)
27
- };
28
- return /* @__PURE__ */ t.createElement(l, {
29
- fieldId: r,
30
- renderLabel: () => K(O, {
31
- as: "div"
32
- }),
33
- renderInput: () => /* @__PURE__ */ t.createElement(de, {
34
- id: d,
35
- ariaLabelledBy: m,
36
- ariaDescribedBy: b,
37
- required: o,
38
- onBlur: s,
39
- onFocus: c,
40
- className: a
41
- }, L[I[0]], L[I[1]], L[I[2]]),
42
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, Y, T)
43
- });
44
- }, g = ({ children: e, className: a }) => {
45
- const { disabled: r, readOnly: o, showDateLabels: s, hidePlaceholder: c } = D(), { labelId: l } = y(i.MONTH), { partValue: d, partError: m, onPartChange: b } = _(i.MONTH), { t: p } = P(), [I, O] = w(!1), [T, Y] = w(null), L = c ? void 0 : p("field.date.placeholder.month"), v = B((M) => {
46
- o || b(typeof M == "string" ? M : "");
47
- }, [
48
- b,
49
- o
50
- ]), Q = B((M) => {
51
- O(M && !o);
52
- }, [
53
- o
54
- ]), G = u(e, g.Label), J = u(e, g.Trigger), W = u(e, g.Options);
55
- return /* @__PURE__ */ t.createElement("div", {
56
- className: a,
57
- "data-date-field": !0
58
- }, s ? G : null, /* @__PURE__ */ t.createElement("div", {
59
- ref: Y,
60
- style: {
61
- display: "contents"
62
- }
63
- }), /* @__PURE__ */ t.createElement(ae, {
64
- getContainer: () => T
65
- }, /* @__PURE__ */ t.createElement(oe, {
66
- "aria-labelledby": s ? l : void 0,
67
- value: d || null,
68
- onChange: v,
69
- isDisabled: r,
70
- isInvalid: m,
71
- placeholder: L,
72
- isOpen: I,
73
- onOpenChange: Q
74
- }, J, W)));
75
- }, _e = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
76
- datePart: i.MONTH,
77
- className: e
78
- }), Oe = ({ children: e, className: a }) => {
79
- const { id: r, readOnly: o } = D(), { inputId: s } = y(i.MONTH), { partError: c, isFirstPart: l } = _(i.MONTH), d = H(null);
80
- return V(() => {
81
- var m;
82
- l && ((m = d.current) == null || m.focus());
83
- }, r), /* @__PURE__ */ t.createElement(pe, {
84
- ref: d,
85
- id: s,
86
- className: a,
87
- "data-hook": i.MONTH,
88
- "data-invalid": c || void 0,
89
- "data-readonly": o || void 0
90
- }, /* @__PURE__ */ t.createElement(se, null), e);
91
- }, S = ({ children: e, className: a }) => {
92
- const { language: r } = A(), o = N(() => le(r), [
93
- r
94
- ]), s = u(e, S.Option) ?? /* @__PURE__ */ t.createElement(S.Option, null);
95
- return /* @__PURE__ */ t.createElement(ue, {
96
- className: a,
97
- containerPadding: 0,
98
- offset: 0
99
- }, /* @__PURE__ */ t.createElement(re, null, o.map((c, l) => K(s, {
100
- key: String(l + 1),
101
- value: String(l + 1),
102
- label: c
103
- }))));
104
- }, Le = ({ className: e, ...a }) => {
105
- const { value: r, label: o } = a;
106
- return /* @__PURE__ */ t.createElement(ne, {
107
- className: e,
108
- id: r,
109
- textValue: o
110
- }, o);
111
- };
112
- g.Label = _e;
113
- g.Trigger = Oe;
114
- g.Options = S;
115
- S.Option = Le;
116
- const C = ({ children: e, className: a }) => {
117
- const { disabled: r, readOnly: o, showDateLabels: s } = D(), { labelId: c } = y(i.DAY), { partValue: l, partError: d, onPartChange: m } = _(i.DAY), b = u(e, C.Label), p = u(e, C.Input);
118
- return /* @__PURE__ */ t.createElement("div", {
119
- className: a,
120
- "data-date-field": !0
121
- }, s && b, /* @__PURE__ */ t.createElement($, {
122
- "aria-labelledby": s ? c : void 0,
123
- value: l,
124
- onChange: m,
125
- isDisabled: r,
126
- isReadOnly: o,
127
- isInvalid: d
128
- }, p));
129
- }, Ce = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
130
- datePart: i.DAY,
131
- className: e
132
- }), Fe = ({ className: e }) => {
133
- const { id: a, hidePlaceholder: r } = D(), { inputId: o } = y(i.DAY), { isFirstPart: s } = _(i.DAY), { t: c } = P(), l = H(null), d = r ? void 0 : c("field.date.placeholder.day");
134
- return V(() => {
135
- var m;
136
- s && ((m = l.current) == null || m.focus());
137
- }, a), /* @__PURE__ */ t.createElement(z, {
138
- ref: l,
139
- id: o,
140
- className: e,
141
- placeholder: d,
142
- maxLength: 2,
143
- inputMode: "numeric",
144
- "data-hook": i.DAY
145
- });
146
- };
147
- C.Label = Ce;
148
- C.Input = Fe;
149
- const F = ({ children: e, className: a }) => {
150
- const { disabled: r, readOnly: o, showDateLabels: s } = D(), { labelId: c } = y(i.YEAR), { partValue: l, partError: d, onPartChange: m } = _(i.YEAR), b = u(e, F.Label), p = u(e, F.Input);
151
- return /* @__PURE__ */ t.createElement("div", {
152
- className: a,
153
- "data-date-field": !0
154
- }, s && b, /* @__PURE__ */ t.createElement($, {
155
- "aria-labelledby": s ? c : void 0,
156
- value: l,
157
- onChange: m,
158
- isDisabled: r,
159
- isReadOnly: o,
160
- isInvalid: d
161
- }, p));
162
- }, Me = ({ className: e }) => /* @__PURE__ */ t.createElement(j, {
163
- datePart: i.YEAR,
164
- className: e
165
- }), Re = ({ className: e }) => {
166
- const { id: a, hidePlaceholder: r } = D(), { inputId: o } = y(i.YEAR), { isFirstPart: s } = _(i.YEAR), { t: c } = P(), l = H(null), d = r ? void 0 : c("field.date.placeholder.year");
167
- return V(() => {
168
- var m;
169
- s && ((m = l.current) == null || m.focus());
170
- }, a), /* @__PURE__ */ t.createElement(z, {
171
- ref: l,
172
- id: o,
173
- className: e,
174
- placeholder: d,
175
- maxLength: 4,
176
- inputMode: "numeric",
177
- "data-hook": i.YEAR
178
- });
179
- };
180
- F.Label = Me;
181
- F.Input = Re;
182
- n.Label = me;
183
- n.Month = g;
184
- n.Day = C;
185
- n.Year = F;
186
- n.Description = ce;
187
- n.Error = ie;
188
- function y(e) {
189
- const { inputId: a } = k();
190
- return N(() => {
191
- const r = e.toLowerCase();
192
- return {
193
- inputId: `${a}-${r}-input`,
194
- labelId: `${a}-${r}-label`
195
- };
196
- }, [
197
- a,
198
- e
199
- ]);
200
- }
201
- function _(e) {
202
- const { value: a, onChange: r, hasError: o = !1 } = D(), { regionalFormat: s } = A(), c = N(() => Z(a ?? ""), [
203
- a
204
- ]), l = N(() => ee(o, a ?? ""), [
205
- a,
206
- o
207
- ]), d = c[e] || "", m = B((p) => {
208
- const I = te(p, e, c);
209
- r(I);
210
- }, [
211
- r,
212
- c,
213
- e
214
- ]), b = N(() => U(s).filter(q).map((O) => O.toUpperCase())[0] === e, [
215
- s,
216
- e
217
- ]);
218
- return {
219
- partValue: d,
220
- partError: l[e],
221
- onPartChange: m,
222
- isFirstPart: b
223
- };
224
- }
225
- function j({ datePart: e, className: a }) {
226
- const { inputId: r, labelId: o } = y(e), { t: s } = P(), c = `field.date.label.${e.toLowerCase()}`, l = s(c);
227
- return /* @__PURE__ */ t.createElement("label", {
228
- id: o,
229
- htmlFor: r,
230
- className: a
231
- }, l);
232
- }
233
- const Se = "_fields_12ojb_1", Ae = "_month_12ojb_9", Pe = "_day_12ojb_10", Te = "_year_12ojb_11", Ye = "_mobile_12ojb_25", ve = "_dayInput_12ojb_37", Be = "_yearInput_12ojb_38", He = "_monthTrigger_12ojb_42", Ve = "_monthOption_12ojb_62", h = {
234
- fields: Se,
235
- month: Ae,
236
- day: Pe,
237
- year: Te,
238
- mobile: Ye,
239
- dayInput: ve,
240
- yearInput: Be,
241
- monthTrigger: He,
242
- monthOption: Ve
243
- }, je = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(X, {
244
- content: e,
245
- locale: a
246
- }), ot = () => {
247
- const e = Ne(h.monthOption, fe), { isMobile: a } = A(), r = x(h.dayInput), o = x(h.yearInput);
248
- return /* @__PURE__ */ t.createElement(n, {
249
- className: f(h.fields, {
250
- [h.mobile]: a
251
- })
252
- }, /* @__PURE__ */ t.createElement(n.Label, {
253
- className: f(R, E.label)
254
- }, /* @__PURE__ */ t.createElement(n.Label.Required, {
255
- className: f(he, E.requiredMark)
256
- })), /* @__PURE__ */ t.createElement(n.Month, {
257
- className: h.month
258
- }, /* @__PURE__ */ t.createElement(n.Month.Label, {
259
- className: f(R, E.label)
260
- }), /* @__PURE__ */ t.createElement(n.Month.Trigger, {
261
- className: f(Ie, E.input, h.monthTrigger)
262
- }, /* @__PURE__ */ t.createElement(Ee, {
263
- className: E.dropdownIcon
264
- })), /* @__PURE__ */ t.createElement(n.Month.Options, {
265
- className: f(De, E.selectPopover, E.dropdownPopover)
266
- }, /* @__PURE__ */ t.createElement(n.Month.Options.Option, {
267
- className: e
268
- }))), /* @__PURE__ */ t.createElement(n.Day, {
269
- className: h.day
270
- }, /* @__PURE__ */ t.createElement(n.Day.Label, {
271
- className: f(R, E.label)
272
- }), /* @__PURE__ */ t.createElement(n.Day.Input, {
273
- className: r
274
- })), /* @__PURE__ */ t.createElement(n.Year, {
275
- className: h.year
276
- }, /* @__PURE__ */ t.createElement(n.Year.Label, {
277
- className: f(R, E.label)
278
- }), /* @__PURE__ */ t.createElement(n.Year.Input, {
279
- className: o
280
- })), /* @__PURE__ */ t.createElement(n.Error, {
281
- className: f(ge, E.error)
282
- }, /* @__PURE__ */ t.createElement(be, null), /* @__PURE__ */ t.createElement(n.Error.Text, null)), /* @__PURE__ */ t.createElement(n.Description, {
283
- className: f(ye, E.description)
284
- }, je));
285
- };
286
- export {
287
- ot as D
288
- };
@@ -1,424 +0,0 @@
1
- import { RicosViewer as ne } from "@wix/ricos/viewer";
2
- import p from "classnames";
3
- import t, { useMemo as L, useState as G, useCallback as w, useRef as U, useContext as re } from "react";
4
- import { ak as g, ah as j, ac as x, K as J, a2 as W, s as d, au as O, a6 as K, Q as se, y as oe, a9 as le, z as Q, am as q } from "./form-C7cB75mm.js";
5
- import { parseTime as ie } from "@internationalized/date";
6
- import { UNSAFE_PortalProvider as ce } from "react-aria";
7
- import { ListBoxItem as me, ListBox as de, Select as ue, TextField as X, TimeField as pe, SelectValue as Ee, Input as Z, DateInput as fe, DateSegment as k, TimeFieldStateContext as he } from "react-aria-components";
8
- import { f as u, a as S } from "./find-child-C60k4CxG.js";
9
- import { g as be } from "./helpers-HmkkXrh2.js";
10
- import { D as ge, E as Ie } from "./field-error-headless-T9JfqiMS.js";
11
- import { L as _e } from "./field-label-headless-bDWQszAb.js";
12
- import { F as Ne } from "./fieldset-headless-CD3fds9J.js";
13
- import { N as De, S as ye } from "./non-modal-popover-DtIMXHbe.js";
14
- import { C as Te } from "./chevron-down-icon-CcpVm6B-.js";
15
- import { E as Le } from "./error-icon-hZxQ6DEy.js";
16
- import { H } from "./custom-focus-class-_483Pkwp.js";
17
- import { s as b } from "./field-rac.module-BUvPquav.js";
18
- import { B as v, R as Oe, z as Ce, D as Fe, q as Pe, i as Me } from "./form-element-classes-CLZXu-91.js";
19
- import { g as ve } from "./use-dropdown-option-class-name-CruN_y12.js";
20
- import { u as z } from "./use-text-input-class-name-CgCYHOMw.js";
21
- const l = ({ children: e, className: a }) => {
22
- const { id: n, required: r, onBlur: o, onFocus: s, FieldLayout: i } = g(), { inputId: m, labelId: c, ariaDescribedBy: f } = j(), { regionalFormat: h } = x(), N = L(() => J(h).filter(W).map((M) => M.toUpperCase()), [
23
- h
24
- ]), P = u(e, l.Label), V = u(e, l.Description), T = u(e, l.Error), _ = {
25
- [d.MONTH]: u(e, l.Month),
26
- [d.DAY]: u(e, l.Day),
27
- [d.YEAR]: u(e, l.Year)
28
- }, D = u(e, l.Time);
29
- return /* @__PURE__ */ t.createElement(i, {
30
- fieldId: n,
31
- renderLabel: () => S(P, {
32
- as: "div"
33
- }),
34
- renderInput: () => /* @__PURE__ */ t.createElement(Ne, {
35
- id: m,
36
- ariaLabelledBy: c,
37
- ariaDescribedBy: f,
38
- required: r,
39
- onBlur: o,
40
- onFocus: s,
41
- className: a
42
- }, _[N[0]], _[N[1]], _[N[2]], D),
43
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, T, V)
44
- });
45
- }, C = ({ children: e, className: a }) => {
46
- const { disabled: n, readOnly: r, showDateLabels: o, hidePlaceholder: s } = g(), { labelId: i } = y(d.MONTH), { partValue: m, partError: c, onPartChange: f } = F(d.MONTH), { t: h } = O(), [N, P] = G(!1), [V, T] = G(null), _ = s ? void 0 : h("field.date.placeholder.month"), D = w((Y) => {
47
- r || f(typeof Y == "string" ? Y : "");
48
- }, [
49
- f,
50
- r
51
- ]), M = w((Y) => {
52
- P(Y && !r);
53
- }, [
54
- r
55
- ]), ee = u(e, C.Label), te = u(e, C.Trigger), ae = u(e, C.Options);
56
- return /* @__PURE__ */ t.createElement("div", {
57
- className: a,
58
- "data-date-field": !0
59
- }, o ? ee : null, /* @__PURE__ */ t.createElement("div", {
60
- ref: T,
61
- style: {
62
- display: "contents"
63
- }
64
- }), /* @__PURE__ */ t.createElement(ce, {
65
- getContainer: () => V
66
- }, /* @__PURE__ */ t.createElement(ue, {
67
- "aria-labelledby": o ? i : void 0,
68
- value: m || null,
69
- onChange: D,
70
- isDisabled: n,
71
- isInvalid: c,
72
- placeholder: _,
73
- isOpen: N,
74
- onOpenChange: M
75
- }, te, ae)));
76
- }, Se = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
77
- datePart: d.MONTH,
78
- className: e
79
- }), Re = ({ children: e, className: a }) => {
80
- const { id: n, readOnly: r } = g(), { inputId: o } = y(d.MONTH), { partError: s, isFirstPart: i } = F(d.MONTH), m = U(null);
81
- return q(() => {
82
- var c;
83
- i && ((c = m.current) == null || c.focus());
84
- }, n), /* @__PURE__ */ t.createElement(ye, {
85
- ref: m,
86
- id: o,
87
- className: a,
88
- "data-hook": d.MONTH,
89
- "data-invalid": s || void 0,
90
- "data-readonly": r || void 0
91
- }, /* @__PURE__ */ t.createElement(Ee, null), e);
92
- }, B = ({ children: e, className: a }) => {
93
- const { language: n } = x(), r = L(() => be(n), [
94
- n
95
- ]), o = u(e, B.Option) ?? /* @__PURE__ */ t.createElement(B.Option, null);
96
- return /* @__PURE__ */ t.createElement(De, {
97
- className: a,
98
- containerPadding: 0,
99
- offset: 0
100
- }, /* @__PURE__ */ t.createElement(de, null, r.map((s, i) => S(o, {
101
- key: String(i + 1),
102
- value: String(i + 1),
103
- label: s
104
- }))));
105
- }, Ae = ({ className: e, ...a }) => {
106
- const { value: n, label: r } = a;
107
- return /* @__PURE__ */ t.createElement(me, {
108
- className: e,
109
- id: n,
110
- textValue: r
111
- }, r);
112
- };
113
- C.Label = Se;
114
- C.Trigger = Re;
115
- C.Options = B;
116
- B.Option = Ae;
117
- const R = ({ children: e, className: a }) => {
118
- const { disabled: n, readOnly: r, showDateLabels: o } = g(), { labelId: s } = y(d.DAY), { partValue: i, partError: m, onPartChange: c } = F(d.DAY), f = u(e, R.Label), h = u(e, R.Input);
119
- return /* @__PURE__ */ t.createElement("div", {
120
- className: a,
121
- "data-date-field": !0
122
- }, o && f, /* @__PURE__ */ t.createElement(X, {
123
- "aria-labelledby": o ? s : void 0,
124
- value: i,
125
- onChange: c,
126
- isDisabled: n,
127
- isReadOnly: r,
128
- isInvalid: m
129
- }, h));
130
- }, Ve = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
131
- datePart: d.DAY,
132
- className: e
133
- }), Ye = ({ className: e }) => {
134
- const { id: a, hidePlaceholder: n } = g(), { inputId: r } = y(d.DAY), { isFirstPart: o } = F(d.DAY), { t: s } = O(), i = U(null), m = n ? void 0 : s("field.date.placeholder.day");
135
- return q(() => {
136
- var c;
137
- o && ((c = i.current) == null || c.focus());
138
- }, a), /* @__PURE__ */ t.createElement(Z, {
139
- ref: i,
140
- id: r,
141
- className: e,
142
- placeholder: m,
143
- maxLength: 2,
144
- inputMode: "numeric",
145
- "data-hook": d.DAY
146
- });
147
- };
148
- R.Label = Ve;
149
- R.Input = Ye;
150
- const A = ({ children: e, className: a }) => {
151
- const { disabled: n, readOnly: r, showDateLabels: o } = g(), { labelId: s } = y(d.YEAR), { partValue: i, partError: m, onPartChange: c } = F(d.YEAR), f = u(e, A.Label), h = u(e, A.Input);
152
- return /* @__PURE__ */ t.createElement("div", {
153
- className: a,
154
- "data-date-field": !0
155
- }, o && f, /* @__PURE__ */ t.createElement(X, {
156
- "aria-labelledby": o ? s : void 0,
157
- value: i,
158
- onChange: c,
159
- isDisabled: n,
160
- isReadOnly: r,
161
- isInvalid: m
162
- }, h));
163
- }, He = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
164
- datePart: d.YEAR,
165
- className: e
166
- }), we = ({ className: e }) => {
167
- const { id: a, hidePlaceholder: n } = g(), { inputId: r } = y(d.YEAR), { isFirstPart: o } = F(d.YEAR), { t: s } = O(), i = U(null), m = n ? void 0 : s("field.date.placeholder.year");
168
- return q(() => {
169
- var c;
170
- o && ((c = i.current) == null || c.focus());
171
- }, a), /* @__PURE__ */ t.createElement(Z, {
172
- ref: i,
173
- id: r,
174
- className: e,
175
- placeholder: m,
176
- maxLength: 4,
177
- inputMode: "numeric",
178
- "data-hook": d.YEAR
179
- });
180
- };
181
- A.Label = He;
182
- A.Input = we;
183
- const I = ({ children: e, className: a }) => {
184
- const { disabled: n, readOnly: r, use24HourFormat: o, showDateLabels: s } = g(), { labelId: i } = y("time"), { partValue: m, partError: c, onPartChange: f } = F("time"), h = u(e, I.Label), N = u(e, I.Input);
185
- return /* @__PURE__ */ t.createElement("div", {
186
- className: a,
187
- "data-date-field": !0
188
- }, s && h, /* @__PURE__ */ t.createElement(pe, {
189
- "aria-labelledby": s ? i : void 0,
190
- value: m,
191
- onChange: f,
192
- isDisabled: n,
193
- isReadOnly: r,
194
- isInvalid: c,
195
- hourCycle: o ? 24 : 12
196
- }, N));
197
- }, Be = ({ className: e }) => {
198
- const { inputId: a, labelId: n } = y("time"), { t: r } = O(), o = r("field.date.label.time");
199
- return /* @__PURE__ */ t.createElement("label", {
200
- id: n,
201
- htmlFor: a,
202
- className: e
203
- }, o);
204
- }, xe = ({ children: e, className: a }) => {
205
- const n = u(e, I.Hour), r = u(e, I.Minute), o = u(e, I.Period);
206
- return /* @__PURE__ */ t.createElement(fe, {
207
- className: a,
208
- "data-hook": "time"
209
- }, (s) => {
210
- switch (s.type) {
211
- case "hour":
212
- return S(n, {
213
- segment: s
214
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
215
- case "minute":
216
- return S(r, {
217
- segment: s
218
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
219
- case "dayPeriod":
220
- return S(o, {
221
- segment: s
222
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
223
- case "literal":
224
- return /* @__PURE__ */ t.createElement(k, {
225
- segment: s
226
- });
227
- default:
228
- return /* @__PURE__ */ t.createElement(t.Fragment, null);
229
- }
230
- });
231
- }, ke = ({ className: e, ...a }) => {
232
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: o } = O(), s = n ? void 0 : o("field.date.placeholder.hour");
233
- return /* @__PURE__ */ t.createElement(k, {
234
- segment: r,
235
- className: e,
236
- ...s && {
237
- placeholder: s
238
- }
239
- });
240
- }, ze = ({ className: e, ...a }) => {
241
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: o } = O(), s = n ? void 0 : o("field.date.placeholder.minute");
242
- return /* @__PURE__ */ t.createElement(k, {
243
- segment: r,
244
- className: e,
245
- ...s && {
246
- placeholder: s
247
- }
248
- });
249
- }, Ue = ({ className: e, ...a }) => {
250
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: o } = O(), s = re(he), i = n ? void 0 : o("field.date.placeholder.period"), m = () => s == null ? void 0 : s.increment("dayPeriod");
251
- return /* @__PURE__ */ t.createElement(k, {
252
- segment: r,
253
- className: e,
254
- onClick: m,
255
- ...i && {
256
- placeholder: i
257
- }
258
- });
259
- };
260
- I.Label = Be;
261
- I.Input = xe;
262
- I.Hour = ke;
263
- I.Minute = ze;
264
- I.Period = Ue;
265
- l.Label = _e;
266
- l.Month = C;
267
- l.Day = R;
268
- l.Year = A;
269
- l.Time = I;
270
- l.Description = ge;
271
- l.Error = Ie;
272
- function y(e) {
273
- const { inputId: a } = j();
274
- return L(() => {
275
- const n = e.toLowerCase();
276
- return {
277
- inputId: `${a}-${n}-input`,
278
- labelId: `${a}-${n}-label`
279
- };
280
- }, [
281
- a,
282
- e
283
- ]);
284
- }
285
- function F(e) {
286
- const { value: a, onChange: n, hasError: r = !1 } = g(), { regionalFormat: o } = x(), [s, i] = L(() => K(a ?? ""), [
287
- a
288
- ]), m = L(() => se(r, a ?? ""), [
289
- a,
290
- r
291
- ]), c = L(() => oe(s), [
292
- s
293
- ]), f = L(() => qe(i), [
294
- i
295
- ]), h = w((T) => {
296
- const _ = $e(T), D = Q(s, _);
297
- n(D);
298
- }, [
299
- n,
300
- s
301
- ]), N = w((T) => {
302
- const [, _] = K(a ?? ""), D = le(T, e, c), M = Q(D, _);
303
- n(M);
304
- }, [
305
- n,
306
- a,
307
- c,
308
- e
309
- ]), P = L(() => e === "time" ? !1 : J(o).filter(W).map((D) => D.toUpperCase())[0] === e, [
310
- o,
311
- e
312
- ]);
313
- return e === "time" ? {
314
- partValue: f,
315
- partError: m.TIME,
316
- onPartChange: h,
317
- isFirstPart: !1
318
- } : {
319
- partValue: c[e] || "",
320
- partError: m[e],
321
- onPartChange: N,
322
- isFirstPart: P
323
- };
324
- }
325
- function $({ datePart: e, className: a }) {
326
- const { inputId: n, labelId: r } = y(e), { t: o } = O(), s = `field.date.label.${e.toLowerCase()}`, i = o(s);
327
- return /* @__PURE__ */ t.createElement("label", {
328
- id: r,
329
- htmlFor: n,
330
- className: a
331
- }, i);
332
- }
333
- function qe(e) {
334
- if (!e)
335
- return null;
336
- try {
337
- return ie(e);
338
- } catch {
339
- return null;
340
- }
341
- }
342
- function $e(e) {
343
- if (!e)
344
- return null;
345
- const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), r = String(e.second).padStart(2, "0");
346
- return [
347
- a,
348
- n,
349
- r
350
- ].join(":");
351
- }
352
- const Ge = "_fields_1svr5_1", Ke = "_month_1svr5_10", Qe = "_day_1svr5_11", je = "_year_1svr5_12", Je = "_timeGroup_1svr5_13", We = "_mobile_1svr5_32", Xe = "_dayInput_1svr5_45", Ze = "_yearInput_1svr5_46", et = "_monthTrigger_1svr5_50", tt = "_monthOption_1svr5_70", at = "_time_1svr5_13", nt = "_hour_1svr5_89", rt = "_minute_1svr5_90", st = "_period_1svr5_91", E = {
353
- fields: Ge,
354
- month: Ke,
355
- day: Qe,
356
- year: je,
357
- timeGroup: Je,
358
- mobile: We,
359
- dayInput: Xe,
360
- yearInput: Ze,
361
- monthTrigger: et,
362
- monthOption: tt,
363
- time: at,
364
- hour: nt,
365
- minute: rt,
366
- period: st
367
- }, ot = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(ne, {
368
- content: e,
369
- locale: a
370
- }), Ct = () => {
371
- const e = ve(E.monthOption, H), { isMobile: a } = x(), n = z(E.dayInput), r = z(E.yearInput), o = z(E.time);
372
- return /* @__PURE__ */ t.createElement(l, {
373
- className: p(E.fields, {
374
- [E.mobile]: a
375
- })
376
- }, /* @__PURE__ */ t.createElement(l.Label, {
377
- className: p(v, b.label)
378
- }, /* @__PURE__ */ t.createElement(l.Label.Required, {
379
- className: p(Oe, b.requiredMark)
380
- })), /* @__PURE__ */ t.createElement(l.Month, {
381
- className: E.month
382
- }, /* @__PURE__ */ t.createElement(l.Month.Label, {
383
- className: p(v, b.label)
384
- }), /* @__PURE__ */ t.createElement(l.Month.Trigger, {
385
- className: p(Ce, b.input, E.monthTrigger)
386
- }, /* @__PURE__ */ t.createElement(Te, {
387
- className: b.dropdownIcon
388
- })), /* @__PURE__ */ t.createElement(l.Month.Options, {
389
- className: p(Fe, b.selectPopover, b.dropdownPopover)
390
- }, /* @__PURE__ */ t.createElement(l.Month.Options.Option, {
391
- className: e
392
- }))), /* @__PURE__ */ t.createElement(l.Day, {
393
- className: E.day
394
- }, /* @__PURE__ */ t.createElement(l.Day.Label, {
395
- className: p(v, b.label)
396
- }), /* @__PURE__ */ t.createElement(l.Day.Input, {
397
- className: n
398
- })), /* @__PURE__ */ t.createElement(l.Year, {
399
- className: E.year
400
- }, /* @__PURE__ */ t.createElement(l.Year.Label, {
401
- className: p(v, b.label)
402
- }), /* @__PURE__ */ t.createElement(l.Year.Input, {
403
- className: r
404
- })), /* @__PURE__ */ t.createElement(l.Time, {
405
- className: E.timeGroup
406
- }, /* @__PURE__ */ t.createElement(l.Time.Label, {
407
- className: p(v, b.label)
408
- }), /* @__PURE__ */ t.createElement(l.Time.Input, {
409
- className: o
410
- }, /* @__PURE__ */ t.createElement(l.Time.Hour, {
411
- className: p(E.hour, H)
412
- }), /* @__PURE__ */ t.createElement(l.Time.Minute, {
413
- className: p(E.minute, H)
414
- }), /* @__PURE__ */ t.createElement(l.Time.Period, {
415
- className: p(E.period, H)
416
- }))), /* @__PURE__ */ t.createElement(l.Error, {
417
- className: p(Pe, b.error)
418
- }, /* @__PURE__ */ t.createElement(Le, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)), /* @__PURE__ */ t.createElement(l.Description, {
419
- className: p(Me, b.description)
420
- }, ot));
421
- };
422
- export {
423
- Ct as D
424
- };