@wix/form-elements 1.83.0 → 1.84.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 (105) hide show
  1. package/dist/component/{appointment-rac-ky2cE6hE.js → appointment-rac-BSy3u0GK.js} +4 -4
  2. package/dist/component/{bookings-address-rac-Bxc6H9Pb.js → bookings-address-rac-CL7Bh1yH.js} +1 -1
  3. package/dist/component/{bookings-email-rac-Dw1Xttdx.js → bookings-email-rac-Bw9tj_tv.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-dgHOrJaJ.js → bookings-first-name-rac-BOOu_AXM.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Bl9RYGWo.js → bookings-header-rac-3kBei7GF.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-BeqYpbZq.js → bookings-last-name-rac-CUKbu22q.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-C1k6o0A5.js → bookings-login-bar-rac-CLrUhdX2.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-ByhaJrwE.js → bookings-phone-rac-7DViellg.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-Mw5-ZiIn.js → bookings-rich-text-rac-CIUZX--G.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-CMEI5t4Y.js → checkbox-field-rac-C_jth3RK.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-CP21R7_s.js → checkbox-group-field-headless-D-c9Kyj8.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-DGOZjSIY.js → checkbox-group-field-rac-MgGUuYII.js} +3 -3
  13. package/dist/component/{checkbox-group-rac-CEGtshrl.js → checkbox-group-rac-rr1mN2EJ.js} +1 -1
  14. package/dist/component/{checkbox-rac-DCnRh1WF.js → checkbox-rac-CRsLQKhN.js} +1 -1
  15. package/dist/component/{contacts-address-rac-CZb_5N5o.js → contacts-address-rac-BFlNbQKh.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-DZlwSyp5.js → contacts-birthdate-rac-D7Ww3iAz.js} +1 -1
  17. package/dist/component/{contacts-company-rac-BNEF6LjB.js → contacts-company-rac-DLl4nqH-.js} +1 -1
  18. package/dist/component/{contacts-email-rac-CAgk_zfN.js → contacts-email-rac-K8fCs8qS.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-DyTVcmrX.js → contacts-first-name-rac-BOTxHl3m.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-DrFcDcGr.js → contacts-last-name-rac-bFnG-7Hm.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-UAPALlFx.js → contacts-phone-rac-B4teqDIV.js} +1 -1
  22. package/dist/component/{contacts-position-rac-CJ1M4kJJ.js → contacts-position-rac-CnWoXO5h.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-1cEd5s1l.js → contacts-subscribe-rac-Bco722BU.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-CqnO__fd.js → contacts-tax-id-rac-QQsKhAx3.js} +1 -1
  25. package/dist/component/{date-availability-COM2EaRy.js → date-availability-DMbyb1GZ.js} +1 -1
  26. package/dist/component/{date-input-field-rac-CuuWbw42.js → date-input-field-rac-CVRjO19U.js} +4 -4
  27. package/dist/component/{date-input-rac-DfVmj9Gc.js → date-input-rac-zi7AQ8Ai.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-BFCZik9T.js → date-picker-field-rac-5H10gH9D.js} +4 -4
  29. package/dist/component/{date-picker-rac-C2vajJpb.js → date-picker-rac-CxWNDsyJ.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-CDa-nyf8.js +423 -0
  31. package/dist/component/{date-time-input-rac-D4FEieQz.js → date-time-input-rac-DglwFYb0.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-BDBBTNNo.js → dext-checkbox-group-rac-BBB652Uy.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-DAAhNboR.js → dext-checkbox-rac-BVtiGV3w.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-me7XbR5z.js → dext-date-picker-rac-Di4x6sI_.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-DLsUl2Eg.js → dext-date-time-input-rac-agWHwUo7.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-C3vVIRir.js → dext-dropdown-rac-U3FZTA2-.js} +1 -1
  37. package/dist/component/{dext-email-rac-a8qXYTLP.js → dext-email-rac-CZ9AQw_k.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-DdDnL_fX.js → dext-number-input-rac-DFr_9ZX5.js} +1 -1
  39. package/dist/component/{dext-phone-rac-ByaxbHpO.js → dext-phone-rac-BYsfNwXn.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-Bzubt7Uy.js → dext-radio-group-rac-B_jm5YAT.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-BZ1EvOkG.js → dext-rating-input-rac-CNlhMKt-.js} +1 -1
  42. package/dist/component/{dext-tags-rac-C_R89noV.js → dext-tags-rac-y9x8Fg54.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-DRpYeQ-K.js → dext-text-area-rac-BgRxIpn9.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-D_RtbQQ-.js → dext-text-input-rac-CdzgUZ38.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-BSSjSbIo.js → dext-url-input-rac-Cg1TYyNV.js} +1 -1
  46. package/dist/component/{donation-rac-De0KyyGR.js → donation-rac-Deiw7Tl9.js} +5 -5
  47. package/dist/component/{dropdown-field-headless-DNhnTDlD.js → dropdown-field-headless-BKj2rdy9.js} +3 -3
  48. package/dist/component/{dropdown-field-rac-Bq_FNv9a.js → dropdown-field-rac-CIdC2_O3.js} +1 -1
  49. package/dist/component/{dropdown-rac-0UIyqF15.js → dropdown-rac-CYxaJrXP.js} +1 -1
  50. package/dist/component/{ecom-address-rac-7IVbvs3J.js → ecom-address-rac-Crr3A_iU.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-DilgIpiG.js → ecom-subscription-checkbox-rac-DdXAex4c.js} +2 -2
  52. package/dist/component/{email-input-field-rac-CHJ6RSGy.js → email-input-field-rac-C516Fm0v.js} +3 -3
  53. package/dist/component/{events-repeater-rac-v18FFLC7.js → events-repeater-rac-DL49KaIU.js} +3 -3
  54. package/dist/component/{events-rsvp-rac-BpGLrxsf.js → events-rsvp-rac-B5EvAP8x.js} +2 -2
  55. package/dist/component/{field-error-headless-DAy-1oAQ.js → field-error-headless-D2CJ4Qk7.js} +1 -1
  56. package/dist/component/{field-label-headless-BWxHmO0c.js → field-label-headless-D2-WvVKT.js} +1 -1
  57. package/dist/component/{file-upload-rac-BfWN27JT.js → file-upload-rac-BG3msdbn.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-Bha61SB4.js → fixed-payment-rac-3bI_h_W0.js} +3 -3
  59. package/dist/component/{form-D0eeH0lX.js → form-B3KiRFhB.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-uNzfDMbv.js → header-field-rac-Bp7hStrt.js} +2 -2
  63. package/dist/component/{header-rac-B91q4fHl.js → header-rac-yVYId2B_.js} +1 -1
  64. package/dist/component/{image-choice-rac-BKcnNGPp.js → image-choice-rac-D1mqJfcn.js} +4 -4
  65. package/dist/component/{index-BvzLLTKc.js → index-B0PANcv8.js} +4 -4
  66. package/dist/component/{index-BWHymomM.js → index-LrdDmlej.js} +2 -2
  67. package/dist/component/{isObjectLike-D7Mkqoju.js → isObjectLike-DH7T0Txd.js} +1 -1
  68. package/dist/component/{multiline-address-field-rac-Avd9Vlv1.js → multiline-address-field-rac-C-gtuNCU.js} +5 -5
  69. package/dist/component/{multiline-address-rac-BwQOoejw.js → multiline-address-rac-B3ixmNqi.js} +1 -1
  70. package/dist/component/{number-input-field-rac-CRqPXDl0.js → number-input-field-rac-BNPMYFay.js} +4 -4
  71. package/dist/component/{number-input-rac-0Y8K4e6K.js → number-input-rac-BaEBt2uf.js} +1 -1
  72. package/dist/component/{password-rac-C7F6sEB3.js → password-rac-B0H_ILkt.js} +4 -4
  73. package/dist/component/{payment-input-rac-CTJr4QTK.js → payment-input-rac-LIk9MP5a.js} +4 -4
  74. package/dist/component/{phone-input-field-rac-jjSmYCI1.js → phone-input-field-rac-CUUAacDK.js} +3 -3
  75. package/dist/component/{phone-rac-BwSnmgYF.js → phone-rac-BYqYOw60.js} +1 -1
  76. package/dist/component/{product-list-rac-CTN2wvHE.js → product-list-rac-CvoI6ajr.js} +4 -4
  77. package/dist/component/{quiz-radio-group-rac-CZHEDJxr.js → quiz-radio-group-rac-D0IJGSh0.js} +1 -1
  78. package/dist/component/{radio-button-module-classes-DCz6XS1X.js → radio-button-module-classes-CWfSY9kQ.js} +3 -3
  79. package/dist/component/{radio-group-field-rac-60MF_9DO.js → radio-group-field-rac-DisEhh0b.js} +3 -3
  80. package/dist/component/{radio-group-rac-Dqo-Earp.js → radio-group-rac-DrwjFNWh.js} +1 -1
  81. package/dist/component/{rating-input-field-rac-CzWTwWT8.js → rating-input-field-rac-BLMQWT7z.js} +4 -4
  82. package/dist/component/{rating-input-rac-Nq4tll2Z.js → rating-input-rac-CGJY2HSO.js} +1 -1
  83. package/dist/component/{rich-content-rac.module-sUUSbcSy.js → rich-content-rac.module-C9cKdumu.js} +1 -1
  84. package/dist/component/{rich-text-field-rac-BvLfS4I5.js → rich-text-field-rac-DTSRvaTK.js} +2 -2
  85. package/dist/component/{rich-text-rac-BWkTbWk3.js → rich-text-rac-Blk3neHN.js} +1 -1
  86. package/dist/component/{service-dropdown-rac-DZ3USe7_.js → service-dropdown-rac-C9P5IWrV.js} +3 -3
  87. package/dist/component/{services-multi-choice-rac-D-og7fMo.js → services-multi-choice-rac-Cnhwy1a9.js} +4 -4
  88. package/dist/component/{signature-rac-D3c4fnvN.js → signature-rac-Benar-ci.js} +3 -3
  89. package/dist/component/{submit-button-rac-Dn_BGt1n.js → submit-button-rac-BDJQsZC3.js} +1 -1
  90. package/dist/component/{tags-field-rac-DXmZBcpO.js → tags-field-rac-wA_0ZinI.js} +5 -5
  91. package/dist/component/{tags-rac-CoXWx42D.js → tags-rac-BcVGekA6.js} +1 -1
  92. package/dist/component/{text-area-field-rac-Cy0Mr29Z.js → text-area-field-rac-VpuojNac.js} +4 -4
  93. package/dist/component/{text-area-rac-C3Mjmgpa.js → text-area-rac-DDvi8u5M.js} +1 -1
  94. package/dist/component/{text-input-field-rac-D1TB9B_M.js → text-input-field-rac-C6LohBtn.js} +2 -2
  95. package/dist/component/{text-input-headless-BUa59Rgn.js → text-input-headless-5yKhWpLD.js} +3 -3
  96. package/dist/component/{text-input-rac-BQ3Z9ws4.js → text-input-rac-C8hsNUp6.js} +1 -1
  97. package/dist/component/time-input-rac-fOT-pjju.js +159 -0
  98. package/dist/component/{url-input-field-rac-DINXfZdf.js → url-input-field-rac-DxR6Hymf.js} +4 -4
  99. package/dist/component/{url-input-rac-Ch9eTIF_.js → url-input-rac-B928R10o.js} +1 -1
  100. package/dist/component/{use-element-state-class-name-j8W1zbdG.js → use-element-state-class-name-CBjBYCW5.js} +1 -1
  101. package/dist/component/{use-service-options-base-BJZhzDyO.js → use-service-options-base-UyJmT2P6.js} +1 -1
  102. package/dist/component/{use-text-input-class-name-8gMUWeCb.js → use-text-input-class-name-Qk2v8a6-.js} +2 -2
  103. package/package.json +2 -2
  104. package/dist/component/date-time-input-field-rac-B7ne2emo.js +0 -423
  105. package/dist/component/time-input-rac-Wi0oD5YF.js +0 -155
@@ -1,423 +0,0 @@
1
- import { RicosViewer as re } from "@wix/ricos/viewer";
2
- import p from "classnames";
3
- import t, { useMemo as L, useState as q, useCallback as H, useRef as U, useContext as oe } from "react";
4
- import { ai as g, af as Q, ab as w, J as W, a1 as X, r as d, as as O, a5 as G, O as le, x as se, a8 as ie, y as j, ak as z } from "./form-D0eeH0lX.js";
5
- import { parseTime as ce } from "@internationalized/date";
6
- import { UNSAFE_PortalProvider as me } from "react-aria";
7
- import { ListBoxItem as de, ListBox as ue, Select as pe, TextField as Z, TimeField as Ee, SelectValue as he, Input as ee, DateInput as fe, DateSegment as B, TimeFieldStateContext as be } from "react-aria-components";
8
- import { f as u, a as R } from "./find-child-C60k4CxG.js";
9
- import { g as ge } from "./helpers-HmkkXrh2.js";
10
- import { D as Ie, E as _e } from "./field-error-headless-DAy-1oAQ.js";
11
- import { L as ye } from "./field-label-headless-BWxHmO0c.js";
12
- import { F as De } from "./fieldset-headless-CD3fds9J.js";
13
- import { N as Ne, S as Te } from "./non-modal-popover-DtIMXHbe.js";
14
- import { C as Le } from "./chevron-down-icon-CcpVm6B-.js";
15
- import { E as Oe } from "./error-icon-hZxQ6DEy.js";
16
- import { H as Y } from "./custom-focus-class-_483Pkwp.js";
17
- import { s as E } from "./field-rac.module-D06m9T9x.js";
18
- import { y as S, O as Fe, x as J, A as Ce, o as Pe, i as Me } from "./form-element-classes-Ct1UaxuQ.js";
19
- import { u as K } from "./use-text-input-class-name-8gMUWeCb.js";
20
- const l = ({ children: e, className: a }) => {
21
- const { id: n, required: o, onBlur: s, onFocus: r, FieldLayout: i } = g(), { inputId: m, labelId: c, ariaDescribedBy: f } = Q(), { regionalFormat: b } = w(), y = L(() => W(b).filter(X).map((M) => M.toUpperCase()), [
22
- b
23
- ]), P = u(e, l.Label), v = u(e, l.Description), T = u(e, l.Error), _ = {
24
- [d.MONTH]: u(e, l.Month),
25
- [d.DAY]: u(e, l.Day),
26
- [d.YEAR]: u(e, l.Year)
27
- }, D = u(e, l.Time);
28
- return /* @__PURE__ */ t.createElement(i, {
29
- fieldId: n,
30
- renderLabel: () => R(P, {
31
- as: "div"
32
- }),
33
- renderInput: () => /* @__PURE__ */ t.createElement(De, {
34
- id: m,
35
- ariaLabelledBy: c,
36
- ariaDescribedBy: f,
37
- required: o,
38
- onBlur: s,
39
- onFocus: r,
40
- className: a
41
- }, _[y[0]], _[y[1]], _[y[2]], D),
42
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, T, v)
43
- });
44
- }, F = ({ children: e, className: a }) => {
45
- const { disabled: n, readOnly: o, showDateLabels: s, hidePlaceholder: r } = g(), { labelId: i } = N(d.MONTH), { partValue: m, partError: c, onPartChange: f } = C(d.MONTH), { t: b } = O(), [y, P] = q(!1), [v, T] = q(null), _ = r ? void 0 : b("field.date.placeholder.month"), D = H((V) => {
46
- o || f(typeof V == "string" ? V : "");
47
- }, [
48
- f,
49
- o
50
- ]), M = H((V) => {
51
- P(V && !o);
52
- }, [
53
- o
54
- ]), te = u(e, F.Label), ae = u(e, F.Trigger), ne = u(e, F.Options);
55
- return /* @__PURE__ */ t.createElement("div", {
56
- className: a,
57
- "data-date-field": !0
58
- }, s ? te : null, /* @__PURE__ */ t.createElement("div", {
59
- ref: T,
60
- style: {
61
- display: "contents"
62
- }
63
- }), /* @__PURE__ */ t.createElement(me, {
64
- getContainer: () => v
65
- }, /* @__PURE__ */ t.createElement(pe, {
66
- "aria-labelledby": s ? i : void 0,
67
- value: m || null,
68
- onChange: D,
69
- isDisabled: n,
70
- isInvalid: c,
71
- placeholder: _,
72
- isOpen: y,
73
- onOpenChange: M
74
- }, ae, ne)));
75
- }, Se = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
76
- datePart: d.MONTH,
77
- className: e
78
- }), Re = ({ children: e, className: a }) => {
79
- const { id: n, readOnly: o } = g(), { inputId: s } = N(d.MONTH), { partError: r, isFirstPart: i } = C(d.MONTH), m = U(null);
80
- return z(() => {
81
- var c;
82
- i && ((c = m.current) == null || c.focus());
83
- }, n), /* @__PURE__ */ t.createElement(Te, {
84
- ref: m,
85
- id: s,
86
- className: a,
87
- "data-hook": d.MONTH,
88
- "data-invalid": r || void 0,
89
- "data-readonly": o || void 0
90
- }, /* @__PURE__ */ t.createElement(he, null), e);
91
- }, x = ({ children: e, className: a }) => {
92
- const { language: n } = w(), o = L(() => ge(n), [
93
- n
94
- ]), s = u(e, x.Option) ?? /* @__PURE__ */ t.createElement(x.Option, null);
95
- return /* @__PURE__ */ t.createElement(Ne, {
96
- className: a,
97
- containerPadding: 0,
98
- offset: 0
99
- }, /* @__PURE__ */ t.createElement(ue, null, o.map((r, i) => R(s, {
100
- key: String(i + 1),
101
- value: String(i + 1),
102
- label: r
103
- }))));
104
- }, Ae = ({ className: e, ...a }) => {
105
- const { value: n, label: o } = a;
106
- return /* @__PURE__ */ t.createElement(de, {
107
- className: e,
108
- id: n,
109
- textValue: o
110
- }, o);
111
- };
112
- F.Label = Se;
113
- F.Trigger = Re;
114
- F.Options = x;
115
- x.Option = Ae;
116
- const A = ({ children: e, className: a }) => {
117
- const { disabled: n, readOnly: o, showDateLabels: s } = g(), { labelId: r } = N(d.DAY), { partValue: i, partError: m, onPartChange: c } = C(d.DAY), f = u(e, A.Label), b = u(e, A.Input);
118
- return /* @__PURE__ */ t.createElement("div", {
119
- className: a,
120
- "data-date-field": !0
121
- }, s && f, /* @__PURE__ */ t.createElement(Z, {
122
- "aria-labelledby": s ? r : void 0,
123
- value: i,
124
- onChange: c,
125
- isDisabled: n,
126
- isReadOnly: o,
127
- isInvalid: m
128
- }, b));
129
- }, ke = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
130
- datePart: d.DAY,
131
- className: e
132
- }), ve = ({ className: e }) => {
133
- const { id: a, hidePlaceholder: n } = g(), { inputId: o } = N(d.DAY), { isFirstPart: s } = C(d.DAY), { t: r } = O(), i = U(null), m = n ? void 0 : r("field.date.placeholder.day");
134
- return z(() => {
135
- var c;
136
- s && ((c = i.current) == null || c.focus());
137
- }, a), /* @__PURE__ */ t.createElement(ee, {
138
- ref: i,
139
- id: o,
140
- className: e,
141
- placeholder: m,
142
- maxLength: 2,
143
- inputMode: "numeric",
144
- "data-hook": d.DAY
145
- });
146
- };
147
- A.Label = ke;
148
- A.Input = ve;
149
- const k = ({ children: e, className: a }) => {
150
- const { disabled: n, readOnly: o, showDateLabels: s } = g(), { labelId: r } = N(d.YEAR), { partValue: i, partError: m, onPartChange: c } = C(d.YEAR), f = u(e, k.Label), b = u(e, k.Input);
151
- return /* @__PURE__ */ t.createElement("div", {
152
- className: a,
153
- "data-date-field": !0
154
- }, s && f, /* @__PURE__ */ t.createElement(Z, {
155
- "aria-labelledby": s ? r : void 0,
156
- value: i,
157
- onChange: c,
158
- isDisabled: n,
159
- isReadOnly: o,
160
- isInvalid: m
161
- }, b));
162
- }, Ve = ({ className: e }) => /* @__PURE__ */ t.createElement($, {
163
- datePart: d.YEAR,
164
- className: e
165
- }), Ye = ({ className: e }) => {
166
- const { id: a, hidePlaceholder: n } = g(), { inputId: o } = N(d.YEAR), { isFirstPart: s } = C(d.YEAR), { t: r } = O(), i = U(null), m = n ? void 0 : r("field.date.placeholder.year");
167
- return z(() => {
168
- var c;
169
- s && ((c = i.current) == null || c.focus());
170
- }, a), /* @__PURE__ */ t.createElement(ee, {
171
- ref: i,
172
- id: o,
173
- className: e,
174
- placeholder: m,
175
- maxLength: 4,
176
- inputMode: "numeric",
177
- "data-hook": d.YEAR
178
- });
179
- };
180
- k.Label = Ve;
181
- k.Input = Ye;
182
- const I = ({ children: e, className: a }) => {
183
- const { disabled: n, readOnly: o, use24HourFormat: s, showDateLabels: r } = g(), { labelId: i } = N("time"), { partValue: m, partError: c, onPartChange: f } = C("time"), b = u(e, I.Label), y = u(e, I.Input);
184
- return /* @__PURE__ */ t.createElement("div", {
185
- className: a,
186
- "data-date-field": !0
187
- }, r && b, /* @__PURE__ */ t.createElement(Ee, {
188
- "aria-labelledby": r ? i : void 0,
189
- value: m,
190
- onChange: f,
191
- isDisabled: n,
192
- isReadOnly: o,
193
- isInvalid: c,
194
- hourCycle: s ? 24 : 12
195
- }, y));
196
- }, He = ({ className: e }) => {
197
- const { inputId: a, labelId: n } = N("time"), { t: o } = O(), s = o("field.date.label.time");
198
- return /* @__PURE__ */ t.createElement("label", {
199
- id: n,
200
- htmlFor: a,
201
- className: e
202
- }, s);
203
- }, xe = ({ children: e, className: a }) => {
204
- const n = u(e, I.Hour), o = u(e, I.Minute), s = u(e, I.Period);
205
- return /* @__PURE__ */ t.createElement(fe, {
206
- className: a,
207
- "data-hook": "time"
208
- }, (r) => {
209
- switch (r.type) {
210
- case "hour":
211
- return R(n, {
212
- segment: r
213
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
214
- case "minute":
215
- return R(o, {
216
- segment: r
217
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
218
- case "dayPeriod":
219
- return R(s, {
220
- segment: r
221
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
222
- case "literal":
223
- return /* @__PURE__ */ t.createElement(B, {
224
- segment: r
225
- });
226
- default:
227
- return /* @__PURE__ */ t.createElement(t.Fragment, null);
228
- }
229
- });
230
- }, we = ({ className: e, ...a }) => {
231
- const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = n ? void 0 : s("field.date.placeholder.hour");
232
- return /* @__PURE__ */ t.createElement(B, {
233
- segment: o,
234
- className: e,
235
- ...r && {
236
- placeholder: r
237
- }
238
- });
239
- }, Be = ({ className: e, ...a }) => {
240
- const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = n ? void 0 : s("field.date.placeholder.minute");
241
- return /* @__PURE__ */ t.createElement(B, {
242
- segment: o,
243
- className: e,
244
- ...r && {
245
- placeholder: r
246
- }
247
- });
248
- }, Ue = ({ className: e, ...a }) => {
249
- const { hidePlaceholder: n } = g(), { segment: o } = a, { t: s } = O(), r = oe(be), i = n ? void 0 : s("field.date.placeholder.period"), m = () => r == null ? void 0 : r.increment("dayPeriod");
250
- return /* @__PURE__ */ t.createElement(B, {
251
- segment: o,
252
- className: e,
253
- onClick: m,
254
- ...i && {
255
- placeholder: i
256
- }
257
- });
258
- };
259
- I.Label = He;
260
- I.Input = xe;
261
- I.Hour = we;
262
- I.Minute = Be;
263
- I.Period = Ue;
264
- l.Label = ye;
265
- l.Month = F;
266
- l.Day = A;
267
- l.Year = k;
268
- l.Time = I;
269
- l.Description = Ie;
270
- l.Error = _e;
271
- function N(e) {
272
- const { inputId: a } = Q();
273
- return L(() => {
274
- const n = e.toLowerCase();
275
- return {
276
- inputId: `${a}-${n}-input`,
277
- labelId: `${a}-${n}-label`
278
- };
279
- }, [
280
- a,
281
- e
282
- ]);
283
- }
284
- function C(e) {
285
- const { value: a, onChange: n, hasError: o = !1 } = g(), { regionalFormat: s } = w(), [r, i] = L(() => G(a ?? ""), [
286
- a
287
- ]), m = L(() => le(o, a ?? ""), [
288
- a,
289
- o
290
- ]), c = L(() => se(r), [
291
- r
292
- ]), f = L(() => ze(i), [
293
- i
294
- ]), b = H((T) => {
295
- const _ = $e(T), D = j(r, _);
296
- n(D);
297
- }, [
298
- n,
299
- r
300
- ]), y = H((T) => {
301
- const [, _] = G(a ?? ""), D = ie(T, e, c), M = j(D, _);
302
- n(M);
303
- }, [
304
- n,
305
- a,
306
- c,
307
- e
308
- ]), P = L(() => e === "time" ? !1 : W(s).filter(X).map((D) => D.toUpperCase())[0] === e, [
309
- s,
310
- e
311
- ]);
312
- return e === "time" ? {
313
- partValue: f,
314
- partError: m.TIME,
315
- onPartChange: b,
316
- isFirstPart: !1
317
- } : {
318
- partValue: c[e] || "",
319
- partError: m[e],
320
- onPartChange: y,
321
- isFirstPart: P
322
- };
323
- }
324
- function $({ datePart: e, className: a }) {
325
- const { inputId: n, labelId: o } = N(e), { t: s } = O(), r = `field.date.label.${e.toLowerCase()}`, i = s(r);
326
- return /* @__PURE__ */ t.createElement("label", {
327
- id: o,
328
- htmlFor: n,
329
- className: a
330
- }, i);
331
- }
332
- function ze(e) {
333
- if (!e)
334
- return null;
335
- try {
336
- return ce(e);
337
- } catch {
338
- return null;
339
- }
340
- }
341
- function $e(e) {
342
- if (!e)
343
- return null;
344
- const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), o = String(e.second).padStart(2, "0");
345
- return [
346
- a,
347
- n,
348
- o
349
- ].join(":");
350
- }
351
- const qe = "_fields_1khoa_1", Ge = "_month_1khoa_10", je = "_day_1khoa_11", Je = "_year_1khoa_12", Ke = "_timeGroup_1khoa_13", Qe = "_mobile_1khoa_32", We = "_dayInput_1khoa_45", Xe = "_yearInput_1khoa_46", Ze = "_monthTrigger_1khoa_50", et = "_monthOption_1khoa_70", tt = "_time_1khoa_13", at = "_hour_1khoa_89", nt = "_minute_1khoa_90", rt = "_period_1khoa_91", h = {
352
- fields: qe,
353
- month: Ge,
354
- day: je,
355
- year: Je,
356
- timeGroup: Ke,
357
- mobile: Qe,
358
- dayInput: We,
359
- yearInput: Xe,
360
- monthTrigger: Ze,
361
- monthOption: et,
362
- time: tt,
363
- hour: at,
364
- minute: nt,
365
- period: rt
366
- }, ot = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(re, {
367
- content: e,
368
- locale: a
369
- }), Lt = () => {
370
- const { isMobile: e } = w(), a = K(h.dayInput), n = K(h.yearInput);
371
- return /* @__PURE__ */ t.createElement(l, {
372
- className: p(h.fields, {
373
- [h.mobile]: e
374
- })
375
- }, /* @__PURE__ */ t.createElement(l.Label, {
376
- className: p(S, E.label)
377
- }, /* @__PURE__ */ t.createElement(l.Label.Required, {
378
- className: p(Fe, E.requiredMark)
379
- })), /* @__PURE__ */ t.createElement(l.Month, {
380
- className: h.month
381
- }, /* @__PURE__ */ t.createElement(l.Month.Label, {
382
- className: p(S, E.label)
383
- }), /* @__PURE__ */ t.createElement(l.Month.Trigger, {
384
- className: p(J, E.input, h.monthTrigger)
385
- }, /* @__PURE__ */ t.createElement(Le, {
386
- className: E.dropdownIcon
387
- })), /* @__PURE__ */ t.createElement(l.Month.Options, {
388
- className: p(Ce, E.selectPopover, E.dropdownPopover)
389
- }, /* @__PURE__ */ t.createElement(l.Month.Options.Option, {
390
- className: p(E.selectOption, h.monthOption, Y)
391
- }))), /* @__PURE__ */ t.createElement(l.Day, {
392
- className: h.day
393
- }, /* @__PURE__ */ t.createElement(l.Day.Label, {
394
- className: p(S, E.label)
395
- }), /* @__PURE__ */ t.createElement(l.Day.Input, {
396
- className: a
397
- })), /* @__PURE__ */ t.createElement(l.Year, {
398
- className: h.year
399
- }, /* @__PURE__ */ t.createElement(l.Year.Label, {
400
- className: p(S, E.label)
401
- }), /* @__PURE__ */ t.createElement(l.Year.Input, {
402
- className: n
403
- })), /* @__PURE__ */ t.createElement(l.Time, {
404
- className: h.timeGroup
405
- }, /* @__PURE__ */ t.createElement(l.Time.Label, {
406
- className: p(S, E.label)
407
- }), /* @__PURE__ */ t.createElement(l.Time.Input, {
408
- className: p(J, E.input, h.time)
409
- }, /* @__PURE__ */ t.createElement(l.Time.Hour, {
410
- className: p(h.hour, Y)
411
- }), /* @__PURE__ */ t.createElement(l.Time.Minute, {
412
- className: p(h.minute, Y)
413
- }), /* @__PURE__ */ t.createElement(l.Time.Period, {
414
- className: p(h.period, Y)
415
- }))), /* @__PURE__ */ t.createElement(l.Error, {
416
- className: p(Pe, E.error)
417
- }, /* @__PURE__ */ t.createElement(Oe, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)), /* @__PURE__ */ t.createElement(l.Description, {
418
- className: p(Me, E.description)
419
- }, ot));
420
- };
421
- export {
422
- Lt as D
423
- };
@@ -1,155 +0,0 @@
1
- import e, { useCallback as H, useRef as V, useContext as x } from "react";
2
- import { RicosViewer as k } from "@wix/ricos/viewer";
3
- import c from "classnames";
4
- import { parseTime as q } from "@internationalized/date";
5
- import { TimeField as v, DateInput as B, DateSegment as h, TimeFieldStateContext as U } from "react-aria-components";
6
- import { ai as p, af as j, as as T, ak as Q } from "./form-D0eeH0lX.js";
7
- import { f as m, a as F } from "./find-child-C60k4CxG.js";
8
- import { D as z, E as G } from "./field-error-headless-DAy-1oAQ.js";
9
- import { L as J } from "./field-label-headless-BWxHmO0c.js";
10
- import { E as K } from "./error-icon-hZxQ6DEy.js";
11
- import { H as S } from "./custom-focus-class-_483Pkwp.js";
12
- import { s as E } from "./field-rac.module-D06m9T9x.js";
13
- import { y as W, O as X, x as Y, o as Z, i as $ } from "./form-element-classes-Ct1UaxuQ.js";
14
- const r = ({ children: t }) => {
15
- const { id: n, value: l, onChange: o, disabled: i, readOnly: s, required: a, onBlur: d, onFocus: f, use24HourFormat: b, FieldLayout: I, hasError: C } = p(), { inputId: L, ariaDescribedBy: g, labelId: D } = j(), R = H((M) => {
16
- const w = ae(M);
17
- o(w);
18
- }, [
19
- o
20
- ]), y = m(t, r.Label), N = m(t, r.Time), O = m(t, r.Description), P = m(t, r.Error), A = ne(l);
21
- return /* @__PURE__ */ e.createElement(I, {
22
- fieldId: n,
23
- renderLabel: () => y,
24
- renderInput: () => /* @__PURE__ */ e.createElement(v, {
25
- "aria-labelledby": D,
26
- id: L,
27
- "aria-describedby": g,
28
- value: A,
29
- onChange: R,
30
- isDisabled: i,
31
- isReadOnly: s,
32
- isInvalid: C,
33
- isRequired: a,
34
- onBlur: d,
35
- onFocus: f,
36
- hourCycle: b ? 24 : 12
37
- }, N),
38
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, P, O)
39
- });
40
- }, u = ({ children: t, className: n }) => {
41
- const { hasError: l } = p(), o = m(t, u.Hour), i = m(t, u.Minute), s = m(t, u.Period);
42
- return /* @__PURE__ */ e.createElement(B, {
43
- className: n,
44
- "data-invalid": l || void 0
45
- }, (a) => {
46
- switch (a.type) {
47
- case "hour":
48
- return F(o, {
49
- segment: a
50
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
51
- case "minute":
52
- return F(i, {
53
- segment: a
54
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
55
- case "dayPeriod":
56
- return F(s, {
57
- segment: a
58
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
59
- case "literal":
60
- return /* @__PURE__ */ e.createElement(h, {
61
- segment: a
62
- });
63
- default:
64
- return /* @__PURE__ */ e.createElement(e.Fragment, null);
65
- }
66
- });
67
- }, ee = ({ className: t, ...n }) => {
68
- const { id: l, hidePlaceholder: o } = p(), { segment: i } = n, { t: s } = T(), a = V(null);
69
- Q(() => {
70
- var f;
71
- (f = a.current) == null || f.focus();
72
- }, l);
73
- const d = o ? void 0 : s("field.date.placeholder.hour");
74
- return /* @__PURE__ */ e.createElement(h, {
75
- ref: a,
76
- segment: i,
77
- className: t,
78
- ...d && {
79
- placeholder: d
80
- }
81
- });
82
- }, te = ({ className: t, ...n }) => {
83
- const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = T(), s = l ? void 0 : i("field.date.placeholder.minute");
84
- return /* @__PURE__ */ e.createElement(h, {
85
- segment: o,
86
- className: t,
87
- ...s && {
88
- placeholder: s
89
- }
90
- });
91
- }, re = ({ className: t, ...n }) => {
92
- const { hidePlaceholder: l } = p(), { segment: o } = n, { t: i } = T(), s = x(U), a = l ? void 0 : i("field.date.placeholder.period"), d = () => s == null ? void 0 : s.increment("dayPeriod");
93
- return /* @__PURE__ */ e.createElement(h, {
94
- segment: o,
95
- className: t,
96
- onClick: d,
97
- ...a && {
98
- placeholder: a
99
- }
100
- });
101
- };
102
- u.Hour = ee;
103
- u.Minute = te;
104
- u.Period = re;
105
- r.Label = J;
106
- r.Time = u;
107
- r.Description = z;
108
- r.Error = G;
109
- function ne(t) {
110
- if (!t)
111
- return null;
112
- try {
113
- return q(t);
114
- } catch {
115
- return null;
116
- }
117
- }
118
- function ae(t) {
119
- if (!t)
120
- return null;
121
- const n = String(t.hour).padStart(2, "0"), l = String(t.minute).padStart(2, "0"), o = String(t.second).padStart(2, "0");
122
- return [
123
- n,
124
- l,
125
- o
126
- ].join(":");
127
- }
128
- const oe = "_time_1wbmw_1", se = "_hour_1wbmw_14", le = "_minute_1wbmw_15", ie = "_period_1wbmw_16", _ = {
129
- time: oe,
130
- hour: se,
131
- minute: le,
132
- period: ie
133
- }, ce = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(k, {
134
- content: t,
135
- locale: n
136
- }), me = () => /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
137
- className: c(W, E.label)
138
- }, /* @__PURE__ */ e.createElement(r.Label.Required, {
139
- className: c(X, E.requiredMark)
140
- })), /* @__PURE__ */ e.createElement(r.Time, {
141
- className: c(Y, E.input, _.time)
142
- }, /* @__PURE__ */ e.createElement(r.Time.Hour, {
143
- className: c(_.hour, S)
144
- }), /* @__PURE__ */ e.createElement(r.Time.Minute, {
145
- className: c(_.minute, S)
146
- }), /* @__PURE__ */ e.createElement(r.Time.Period, {
147
- className: c(_.period, S)
148
- })), /* @__PURE__ */ e.createElement(r.Error, {
149
- className: c(Z, E.error)
150
- }, /* @__PURE__ */ e.createElement(K, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
151
- className: c($, E.description)
152
- }, ce)), Le = () => /* @__PURE__ */ e.createElement(me, null);
153
- export {
154
- Le as TimeInputRAC
155
- };