@wix/form-elements 1.54.0 → 1.56.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 (102) hide show
  1. package/dist/component/{appointment-rac-DlOqbFoi.js → appointment-rac-C4eIt70i.js} +3 -3
  2. package/dist/component/{bookings-address-rac-CvK-P3df.js → bookings-address-rac-t0aisR7y.js} +1 -1
  3. package/dist/component/{bookings-email-rac-9BEPTuox.js → bookings-email-rac-DtW0jE78.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-BrU-BtPp.js → bookings-first-name-rac-D7Uyb0SF.js} +1 -1
  5. package/dist/component/{bookings-header-rac-8NCL7fxp.js → bookings-header-rac-DLatN3nf.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-DgLqZ1nS.js → bookings-last-name-rac-HOfS2wMV.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-C2pzRMyt.js → bookings-login-bar-rac-DLJwEkcG.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-BrPBAo8B.js → bookings-phone-rac-rPiC36da.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-qpPsyIuc.js → bookings-rich-text-rac-J4W6jUQN.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-CaloY2Hs.js → checkbox-field-rac-D6eL7Hla.js} +2 -2
  11. package/dist/component/{checkbox-group-field-headless-4HlJmarB.js → checkbox-group-field-headless-BvjW7srN.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-B1tFZT3o.js → checkbox-group-field-rac-BVkCphC-.js} +1 -1
  13. package/dist/component/{checkbox-group-rac-C0SzN2Bx.js → checkbox-group-rac-DCaQQQEC.js} +1 -1
  14. package/dist/component/{checkbox-rac-ssJIVvZI.js → checkbox-rac-DSjAUtSU.js} +1 -1
  15. package/dist/component/{contacts-address-rac-Dwf4yrGq.js → contacts-address-rac-BVWVNios.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-C195rG5w.js → contacts-birthdate-rac-BHeT6Crl.js} +1 -1
  17. package/dist/component/{contacts-company-rac-BHX6xZU8.js → contacts-company-rac-B4XFkB6m.js} +1 -1
  18. package/dist/component/{contacts-email-rac-CFY-m-r2.js → contacts-email-rac-BtTRIanK.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-D23QFUGK.js → contacts-first-name-rac-CELeQqYU.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-COuQB15p.js → contacts-last-name-rac-Z2FdhQqE.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-BfhY_I7p.js → contacts-phone-rac-NPyCtPv5.js} +1 -1
  22. package/dist/component/{contacts-position-rac-D80_knc8.js → contacts-position-rac-CN0VSqvb.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac--NuPoBFm.js → contacts-subscribe-rac-UL4gzMer.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-BURE313k.js → contacts-tax-id-rac-BjrgdVoC.js} +1 -1
  25. package/dist/component/{date-availability-BQyNH-7j.js → date-availability-BGo0gnJ2.js} +1 -1
  26. package/dist/component/{date-input-field-rac-BnFvhqe1.js → date-input-field-rac-DSXXht8a.js} +3 -3
  27. package/dist/component/{date-input-rac-TLkITFRh.js → date-input-rac-DONIbFl5.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-BAFKYE1B.js → date-picker-field-rac-DDcW0nIL.js} +4 -4
  29. package/dist/component/{date-picker-rac-uBJQkALE.js → date-picker-rac-DMNw5bAQ.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-Bsq2zsYH.js +422 -0
  31. package/dist/component/{date-time-input-rac-BxbWyK23.js → date-time-input-rac-m8B_lgV4.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-DnifcsEZ.js → dext-checkbox-group-rac-BkVowgvt.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-D45Ok0J4.js → dext-checkbox-rac-DaHhUKnS.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-Cs47jywn.js → dext-date-picker-rac-BwexXquv.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-UPwXpk2g.js → dext-date-time-input-rac-Cd6RKAgP.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-D18mhUDU.js → dext-dropdown-rac-BH8T_z95.js} +1 -1
  37. package/dist/component/{dext-email-rac-B4frwTvA.js → dext-email-rac-BIhIzklL.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-CoS-Fk59.js → dext-number-input-rac-DE4n6pBo.js} +1 -1
  39. package/dist/component/{dext-phone-rac-DwR0JLia.js → dext-phone-rac-DkH0asto.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-DogWvoUg.js → dext-radio-group-rac-JRD2gH9f.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-C4NxeIto.js → dext-rating-input-rac-DpHo2Kmb.js} +1 -1
  42. package/dist/component/{dext-tags-rac-DsEenrft.js → dext-tags-rac-BAPquPx5.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-Du-FqTqW.js → dext-text-area-rac-dKvQA33d.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-DUE8JE9b.js → dext-text-input-rac-CIA_iu-r.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-Cn55pV9m.js → dext-url-input-rac-CA-mjuqh.js} +1 -1
  46. package/dist/component/{donation-rac-Cjk_hFm1.js → donation-rac-Jh_nNwme.js} +3 -3
  47. package/dist/component/{dropdown-field-headless-Dcy46MWj.js → dropdown-field-headless-cGvkxCIz.js} +3 -3
  48. package/dist/component/{dropdown-field-rac-rMMPzKxL.js → dropdown-field-rac-mbCaIlrI.js} +1 -1
  49. package/dist/component/{dropdown-rac-C6B8C8Yc.js → dropdown-rac-C7Be3hME.js} +1 -1
  50. package/dist/component/{ecom-address-rac-1wNixzip.js → ecom-address-rac-BKhZvf1-.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-C5z68KHa.js → ecom-subscription-checkbox-rac-DISu-Ufh.js} +2 -2
  52. package/dist/component/{email-input-field-rac-C7Wn2XVU.js → email-input-field-rac-BEju3_Wf.js} +2 -2
  53. package/dist/component/{events-repeater-rac-DTv4JD79.js → events-repeater-rac-jq7T62xZ.js} +2 -2
  54. package/dist/component/{events-rsvp-rac-cS7Mb04F.js → events-rsvp-rac-vunHhzu_.js} +1 -1
  55. package/dist/component/{field-error-headless-Dm5UCOBb.js → field-error-headless-31R9XKKV.js} +1 -1
  56. package/dist/component/{field-label-headless-C7mDzdLq.js → field-label-headless-DBs3Gwiz.js} +1 -1
  57. package/dist/component/{file-upload-rac-DeZvh7dy.js → file-upload-rac-BWXx9HgM.js} +3 -3
  58. package/dist/component/{fixed-payment-rac-D7t5DjVp.js → fixed-payment-rac-BOvDrXXp.js} +3 -3
  59. package/dist/component/{form-DaOKiR16.js → form-D_xuITMd.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-hJSXllPm.js → header-field-rac-CKg9LK5c.js} +2 -2
  63. package/dist/component/{header-rac-G_lsddOd.js → header-rac-ColJJYXz.js} +1 -1
  64. package/dist/component/{image-choice-rac-BHyAKRDt.js → image-choice-rac-DPQCopA4.js} +3 -3
  65. package/dist/component/{index-CkCSQD3_.js → index-B83RLxoy.js} +4 -4
  66. package/dist/component/{index-CFW1VXFU.js → index-SGWDoqIr.js} +2 -2
  67. package/dist/component/{multiline-address-field-rac-CwLOzNF6.js → multiline-address-field-rac-D9YRBAkl.js} +3 -3
  68. package/dist/component/{multiline-address-rac-C4JXBlFC.js → multiline-address-rac-B1UaXPx-.js} +1 -1
  69. package/dist/component/{number-input-field-rac-BOeiugCV.js → number-input-field-rac-Cv5FMx5t.js} +3 -3
  70. package/dist/component/{number-input-rac-NqbFwW0d.js → number-input-rac-BCneWmh2.js} +1 -1
  71. package/dist/component/{password-rac-DxCYgvu_.js → password-rac-d_10jiJu.js} +3 -3
  72. package/dist/component/{payment-input-rac-C2aof0p0.js → payment-input-rac-DarTWRHc.js} +3 -3
  73. package/dist/component/{phone-input-field-rac-Cd7RFaoD.js → phone-input-field-rac-DP7hTDTZ.js} +3 -3
  74. package/dist/component/{phone-rac-4MQREqBG.js → phone-rac-CE71rDen.js} +1 -1
  75. package/dist/component/{product-list-rac-CjoepDQ_.js → product-list-rac-Dw64jUad.js} +3 -3
  76. package/dist/component/{quiz-radio-group-rac-CIwk7N3X.js → quiz-radio-group-rac-BVm7Z5xE.js} +1 -1
  77. package/dist/component/{radio-group-field-rac-DE2mnUHD.js → radio-group-field-rac-DU7SaFWp.js} +1 -1
  78. package/dist/component/{radio-group-field-rac.module-DEP9BCiX.js → radio-group-field-rac.module-GLJdPErb.js} +3 -3
  79. package/dist/component/{radio-group-rac-XE6CeGnp.js → radio-group-rac-Mq1tyU4h.js} +1 -1
  80. package/dist/component/{rating-input-field-rac-BzAAMipp.js → rating-input-field-rac--4Gj1m7I.js} +3 -3
  81. package/dist/component/{rating-input-rac-oIvpEVjK.js → rating-input-rac-BD1LX1lh.js} +1 -1
  82. package/dist/component/{rich-content-rac.module-cis7mx3M.js → rich-content-rac.module-CHVxu1Fe.js} +1 -1
  83. package/dist/component/{rich-text-field-rac-CqkM22CI.js → rich-text-field-rac-Bc0Ia1jl.js} +2 -2
  84. package/dist/component/{rich-text-rac-BKbz3TcX.js → rich-text-rac-BVDkj8fl.js} +1 -1
  85. package/dist/component/{service-dropdown-rac-CfCMbT9d.js → service-dropdown-rac-DKEEHNbq.js} +3 -3
  86. package/dist/component/{services-multi-choice-rac-F2h5gUOr.js → services-multi-choice-rac-CCp3Tybw.js} +3 -3
  87. package/dist/component/{signature-rac-CIRsmZhS.js → signature-rac-SsafjWxY.js} +3 -3
  88. package/dist/component/{submit-button-rac-BELGrClx.js → submit-button-rac-ClqcjS1o.js} +1 -1
  89. package/dist/component/{tags-field-rac-B6Hg2XOI.js → tags-field-rac-BcAUZftK.js} +3 -3
  90. package/dist/component/{tags-rac-Dfv8VP7J.js → tags-rac-CaYVLTOW.js} +1 -1
  91. package/dist/component/{text-area-field-rac-Bsd1V2Q3.js → text-area-field-rac-C-JFkhlU.js} +3 -3
  92. package/dist/component/{text-area-rac-BNVdI-Gq.js → text-area-rac-B_yoEavR.js} +1 -1
  93. package/dist/component/{text-input-field-rac-DF9dD_KW.js → text-input-field-rac-BvoyuAQA.js} +1 -1
  94. package/dist/component/{text-input-headless-Dlao2R8f.js → text-input-headless-C-y42fCc.js} +3 -3
  95. package/dist/component/{text-input-rac-C2p7E01b.js → text-input-rac-B4hCrFc4.js} +1 -1
  96. package/dist/component/time-input-rac-BTKqEeWa.js +155 -0
  97. package/dist/component/{url-input-field-rac-bCEOlctr.js → url-input-field-rac-Cv1_Ve6h.js} +3 -3
  98. package/dist/component/{url-input-rac-D5o8b9gx.js → url-input-rac-CVcW80LT.js} +1 -1
  99. package/dist/component/{use-service-options-base-DO5hy6mn.js → use-service-options-base-wU5O8FFI.js} +1 -1
  100. package/package.json +19 -19
  101. package/dist/component/date-time-input-field-rac-DnOkBj7w.js +0 -421
  102. package/dist/component/time-input-rac-90mLBZsX.js +0 -152
@@ -1,421 +0,0 @@
1
- import { RicosViewer as ae } from "@wix/ricos/viewer";
2
- import E from "classnames";
3
- import t, { useMemo as T, useState as $, useCallback as H, useRef as U } from "react";
4
- import { ag as g, ad as j, aa as B, H as Q, a0 as J, r as m, aq as O, a4 as G, K as ne, w as re, a7 as le, x as K, ai as q } from "./form-DaOKiR16.js";
5
- import { parseTime as oe } from "@internationalized/date";
6
- import { UNSAFE_PortalProvider as se } from "react-aria";
7
- import { ListBoxItem as ie, ListBox as ce, Select as me, TextField as W, TimeField as de, SelectValue as ue, Input as X, DateInput as pe, DateSegment as k } from "react-aria-components";
8
- import { f as d, a as R } from "./find-child-C60k4CxG.js";
9
- import { g as Ee } from "./helpers-HmkkXrh2.js";
10
- import { D as fe, E as he } from "./field-error-headless-Dm5UCOBb.js";
11
- import { L as be } from "./field-label-headless-C7mDzdLq.js";
12
- import { F as ge } from "./fieldset-headless-CD3fds9J.js";
13
- import { N as Ie, S as _e } from "./non-modal-popover-DtIMXHbe.js";
14
- import { C as De } from "./chevron-down-icon-CcpVm6B-.js";
15
- import { E as ye } from "./error-icon-hZxQ6DEy.js";
16
- import { H as Ne } from "./custom-focus-class-_483Pkwp.js";
17
- import { s as p } from "./field-rac.module-DAPTqFDM.js";
18
- import { r as S, H as Le, q as Y, u as Te, l as Oe, h as Fe } from "./form-element-classes-Bi-nNM8q.js";
19
- const o = ({ children: e, className: a }) => {
20
- const { id: n, required: r, onBlur: s, onFocus: l, FieldLayout: i } = g(), { inputId: u, labelId: c, ariaDescribedBy: h } = j(), { regionalFormat: b } = B(), D = T(() => Q(b).filter(J).map((M) => M.toUpperCase()), [
21
- b
22
- ]), C = d(e, o.Label), V = d(e, o.Description), L = d(e, o.Error), _ = {
23
- [m.MONTH]: d(e, o.Month),
24
- [m.DAY]: d(e, o.Day),
25
- [m.YEAR]: d(e, o.Year)
26
- }, y = d(e, o.Time);
27
- return /* @__PURE__ */ t.createElement(i, {
28
- fieldId: n,
29
- renderLabel: () => R(C, {
30
- as: "div"
31
- }),
32
- renderInput: () => /* @__PURE__ */ t.createElement(ge, {
33
- id: u,
34
- ariaLabelledBy: c,
35
- ariaDescribedBy: h,
36
- required: r,
37
- onBlur: s,
38
- onFocus: l,
39
- className: a
40
- }, _[D[0]], _[D[1]], _[D[2]], y),
41
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, L, V)
42
- });
43
- }, F = ({ children: e, className: a }) => {
44
- const { disabled: n, readOnly: r, showDateLabels: s, hidePlaceholder: l } = g(), { labelId: i } = N(m.MONTH), { partValue: u, partError: c, onPartChange: h } = P(m.MONTH), { t: b } = O(), [D, C] = $(!1), [V, L] = $(null), _ = l ? void 0 : b("field.date.placeholder.month"), y = H((x) => {
45
- r || h(typeof x == "string" ? x : "");
46
- }, [
47
- h,
48
- r
49
- ]), M = H((x) => {
50
- C(x && !r);
51
- }, [
52
- r
53
- ]), Z = d(e, F.Label), ee = d(e, F.Trigger), te = d(e, F.Options);
54
- return /* @__PURE__ */ t.createElement("div", {
55
- className: a,
56
- "data-date-field": !0
57
- }, s ? Z : null, /* @__PURE__ */ t.createElement("div", {
58
- ref: L,
59
- style: {
60
- display: "contents"
61
- }
62
- }), /* @__PURE__ */ t.createElement(se, {
63
- getContainer: () => V
64
- }, /* @__PURE__ */ t.createElement(me, {
65
- "aria-labelledby": s ? i : void 0,
66
- value: u || null,
67
- onChange: y,
68
- isDisabled: n,
69
- isInvalid: c,
70
- placeholder: _,
71
- isOpen: D,
72
- onOpenChange: M
73
- }, ee, te)));
74
- }, Pe = ({ className: e }) => /* @__PURE__ */ t.createElement(z, {
75
- datePart: m.MONTH,
76
- className: e
77
- }), Ce = ({ children: e, className: a }) => {
78
- const { id: n, readOnly: r } = g(), { inputId: s } = N(m.MONTH), { partError: l, isFirstPart: i } = P(m.MONTH), u = U(null);
79
- return q(() => {
80
- var c;
81
- i && ((c = u.current) == null || c.focus());
82
- }, n), /* @__PURE__ */ t.createElement(_e, {
83
- ref: u,
84
- id: s,
85
- className: a,
86
- "data-hook": m.MONTH,
87
- "data-invalid": l || void 0,
88
- "data-readonly": r || void 0
89
- }, /* @__PURE__ */ t.createElement(ue, null), e);
90
- }, w = ({ children: e, className: a }) => {
91
- const { language: n } = B(), r = T(() => Ee(n), [
92
- n
93
- ]), s = d(e, w.Option) ?? /* @__PURE__ */ t.createElement(w.Option, null);
94
- return /* @__PURE__ */ t.createElement(Ie, {
95
- className: a,
96
- containerPadding: 0,
97
- offset: 0
98
- }, /* @__PURE__ */ t.createElement(ce, null, r.map((l, i) => R(s, {
99
- key: String(i + 1),
100
- value: String(i + 1),
101
- label: l
102
- }))));
103
- }, Me = ({ className: e, ...a }) => {
104
- const { value: n, label: r } = a;
105
- return /* @__PURE__ */ t.createElement(ie, {
106
- className: e,
107
- id: n,
108
- textValue: r
109
- }, r);
110
- };
111
- F.Label = Pe;
112
- F.Trigger = Ce;
113
- F.Options = w;
114
- w.Option = Me;
115
- const A = ({ children: e, className: a }) => {
116
- const { disabled: n, readOnly: r, showDateLabels: s } = g(), { labelId: l } = N(m.DAY), { partValue: i, partError: u, onPartChange: c } = P(m.DAY), h = d(e, A.Label), b = d(e, A.Input);
117
- return /* @__PURE__ */ t.createElement("div", {
118
- className: a,
119
- "data-date-field": !0
120
- }, s && h, /* @__PURE__ */ t.createElement(W, {
121
- "aria-labelledby": s ? l : void 0,
122
- value: i,
123
- onChange: c,
124
- isDisabled: n,
125
- isReadOnly: r,
126
- isInvalid: u
127
- }, b));
128
- }, Se = ({ className: e }) => /* @__PURE__ */ t.createElement(z, {
129
- datePart: m.DAY,
130
- className: e
131
- }), Re = ({ className: e }) => {
132
- const { id: a, hidePlaceholder: n } = g(), { inputId: r } = N(m.DAY), { isFirstPart: s } = P(m.DAY), { t: l } = O(), i = U(null), u = n ? void 0 : l("field.date.placeholder.day");
133
- return q(() => {
134
- var c;
135
- s && ((c = i.current) == null || c.focus());
136
- }, a), /* @__PURE__ */ t.createElement(X, {
137
- ref: i,
138
- id: r,
139
- className: e,
140
- placeholder: u,
141
- maxLength: 2,
142
- inputMode: "numeric",
143
- "data-hook": m.DAY
144
- });
145
- };
146
- A.Label = Se;
147
- A.Input = Re;
148
- const v = ({ children: e, className: a }) => {
149
- const { disabled: n, readOnly: r, showDateLabels: s } = g(), { labelId: l } = N(m.YEAR), { partValue: i, partError: u, onPartChange: c } = P(m.YEAR), h = d(e, v.Label), b = d(e, v.Input);
150
- return /* @__PURE__ */ t.createElement("div", {
151
- className: a,
152
- "data-date-field": !0
153
- }, s && h, /* @__PURE__ */ t.createElement(W, {
154
- "aria-labelledby": s ? l : void 0,
155
- value: i,
156
- onChange: c,
157
- isDisabled: n,
158
- isReadOnly: r,
159
- isInvalid: u
160
- }, b));
161
- }, Ae = ({ className: e }) => /* @__PURE__ */ t.createElement(z, {
162
- datePart: m.YEAR,
163
- className: e
164
- }), ve = ({ className: e }) => {
165
- const { id: a, hidePlaceholder: n } = g(), { inputId: r } = N(m.YEAR), { isFirstPart: s } = P(m.YEAR), { t: l } = O(), i = U(null), u = n ? void 0 : l("field.date.placeholder.year");
166
- return q(() => {
167
- var c;
168
- s && ((c = i.current) == null || c.focus());
169
- }, a), /* @__PURE__ */ t.createElement(X, {
170
- ref: i,
171
- id: r,
172
- className: e,
173
- placeholder: u,
174
- maxLength: 4,
175
- inputMode: "numeric",
176
- "data-hook": m.YEAR
177
- });
178
- };
179
- v.Label = Ae;
180
- v.Input = ve;
181
- const I = ({ children: e, className: a }) => {
182
- const { disabled: n, readOnly: r, use24HourFormat: s, showDateLabels: l } = g(), { labelId: i } = N("time"), { partValue: u, partError: c, onPartChange: h } = P("time"), b = d(e, I.Label), D = d(e, I.Input);
183
- return /* @__PURE__ */ t.createElement("div", {
184
- className: a,
185
- "data-date-field": !0
186
- }, l && b, /* @__PURE__ */ t.createElement(de, {
187
- "aria-labelledby": l ? i : void 0,
188
- value: u,
189
- onChange: h,
190
- isDisabled: n,
191
- isReadOnly: r,
192
- isInvalid: c,
193
- hourCycle: s ? 24 : 12
194
- }, D));
195
- }, Ve = ({ className: e }) => {
196
- const { inputId: a, labelId: n } = N("time"), { t: r } = O(), s = r("field.date.label.time");
197
- return /* @__PURE__ */ t.createElement("label", {
198
- id: n,
199
- htmlFor: a,
200
- className: e
201
- }, s);
202
- }, xe = ({ children: e, className: a }) => {
203
- const n = d(e, I.Hour), r = d(e, I.Minute), s = d(e, I.Period);
204
- return /* @__PURE__ */ t.createElement(pe, {
205
- className: a,
206
- "data-hook": "time"
207
- }, (l) => {
208
- switch (l.type) {
209
- case "hour":
210
- return R(n, {
211
- segment: l
212
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
213
- case "minute":
214
- return R(r, {
215
- segment: l
216
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
217
- case "dayPeriod":
218
- return R(s, {
219
- segment: l
220
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
221
- case "literal":
222
- return /* @__PURE__ */ t.createElement(k, {
223
- segment: l
224
- });
225
- default:
226
- return /* @__PURE__ */ t.createElement(t.Fragment, null);
227
- }
228
- });
229
- }, Ye = ({ className: e, ...a }) => {
230
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: s } = O(), l = n ? void 0 : s("field.date.placeholder.hour");
231
- return /* @__PURE__ */ t.createElement(k, {
232
- segment: r,
233
- className: e,
234
- ...l && {
235
- placeholder: l
236
- }
237
- });
238
- }, He = ({ className: e, ...a }) => {
239
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: s } = O(), l = n ? void 0 : s("field.date.placeholder.minute");
240
- return /* @__PURE__ */ t.createElement(k, {
241
- segment: r,
242
- className: e,
243
- ...l && {
244
- placeholder: l
245
- }
246
- });
247
- }, we = ({ className: e, ...a }) => {
248
- const { hidePlaceholder: n } = g(), { segment: r } = a, { t: s } = O(), l = n ? void 0 : s("field.date.placeholder.period");
249
- return /* @__PURE__ */ t.createElement(k, {
250
- segment: r,
251
- className: e,
252
- ...l && {
253
- placeholder: l
254
- }
255
- });
256
- };
257
- I.Label = Ve;
258
- I.Input = xe;
259
- I.Hour = Ye;
260
- I.Minute = He;
261
- I.Period = we;
262
- o.Label = be;
263
- o.Month = F;
264
- o.Day = A;
265
- o.Year = v;
266
- o.Time = I;
267
- o.Description = fe;
268
- o.Error = he;
269
- function N(e) {
270
- const { inputId: a } = j();
271
- return T(() => {
272
- const n = e.toLowerCase();
273
- return {
274
- inputId: `${a}-${n}-input`,
275
- labelId: `${a}-${n}-label`
276
- };
277
- }, [
278
- a,
279
- e
280
- ]);
281
- }
282
- function P(e) {
283
- const { value: a, onChange: n, hasError: r = !1 } = g(), { regionalFormat: s } = B(), [l, i] = T(() => G(a ?? ""), [
284
- a
285
- ]), u = T(() => ne(r, a ?? ""), [
286
- a,
287
- r
288
- ]), c = T(() => re(l), [
289
- l
290
- ]), h = T(() => Be(i), [
291
- i
292
- ]), b = H((L) => {
293
- const _ = ke(L), y = K(l, _);
294
- n(y);
295
- }, [
296
- n,
297
- l
298
- ]), D = H((L) => {
299
- const [, _] = G(a ?? ""), y = le(L, e, c), M = K(y, _);
300
- n(M);
301
- }, [
302
- n,
303
- a,
304
- c,
305
- e
306
- ]), C = T(() => e === "time" ? !1 : Q(s).filter(J).map((y) => y.toUpperCase())[0] === e, [
307
- s,
308
- e
309
- ]);
310
- return e === "time" ? {
311
- partValue: h,
312
- partError: u.TIME,
313
- onPartChange: b,
314
- isFirstPart: !1
315
- } : {
316
- partValue: c[e] || "",
317
- partError: u[e],
318
- onPartChange: D,
319
- isFirstPart: C
320
- };
321
- }
322
- function z({ datePart: e, className: a }) {
323
- const { inputId: n, labelId: r } = N(e), { t: s } = O(), l = `field.date.label.${e.toLowerCase()}`, i = s(l);
324
- return /* @__PURE__ */ t.createElement("label", {
325
- id: r,
326
- htmlFor: n,
327
- className: a
328
- }, i);
329
- }
330
- function Be(e) {
331
- if (!e)
332
- return null;
333
- try {
334
- return oe(e);
335
- } catch {
336
- return null;
337
- }
338
- }
339
- function ke(e) {
340
- if (!e)
341
- return null;
342
- const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), r = String(e.second).padStart(2, "0");
343
- return [
344
- a,
345
- n,
346
- r
347
- ].join(":");
348
- }
349
- const Ue = "_fields_1x5em_1", qe = "_month_1x5em_10", ze = "_day_1x5em_11", $e = "_year_1x5em_12", Ge = "_timeGroup_1x5em_13", Ke = "_mobile_1x5em_32", je = "_dayInput_1x5em_45", Qe = "_yearInput_1x5em_46", Je = "_monthTrigger_1x5em_50", We = "_monthOption_1x5em_70", Xe = "_time_1x5em_13", Ze = "_hour_1x5em_89", et = "_minute_1x5em_90", tt = "_period_1x5em_91", f = {
350
- fields: Ue,
351
- month: qe,
352
- day: ze,
353
- year: $e,
354
- timeGroup: Ge,
355
- mobile: Ke,
356
- dayInput: je,
357
- yearInput: Qe,
358
- monthTrigger: Je,
359
- monthOption: We,
360
- time: Xe,
361
- hour: Ze,
362
- minute: et,
363
- period: tt
364
- }, at = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(ae, {
365
- content: e,
366
- locale: a
367
- }), Dt = () => {
368
- const { isMobile: e } = B();
369
- return /* @__PURE__ */ t.createElement(o, {
370
- className: E(f.fields, {
371
- [f.mobile]: e
372
- })
373
- }, /* @__PURE__ */ t.createElement(o.Label, {
374
- className: E(S, p.label)
375
- }, /* @__PURE__ */ t.createElement(o.Label.Required, {
376
- className: E(Le, p.requiredMark)
377
- })), /* @__PURE__ */ t.createElement(o.Month, {
378
- className: f.month
379
- }, /* @__PURE__ */ t.createElement(o.Month.Label, {
380
- className: E(S, p.label)
381
- }), /* @__PURE__ */ t.createElement(o.Month.Trigger, {
382
- className: E(Y, p.input, f.monthTrigger)
383
- }, /* @__PURE__ */ t.createElement(De, {
384
- className: p.dropdownIcon
385
- })), /* @__PURE__ */ t.createElement(o.Month.Options, {
386
- className: E(Te, p.selectPopover, p.dropdownPopover)
387
- }, /* @__PURE__ */ t.createElement(o.Month.Options.Option, {
388
- className: E(p.selectOption, f.monthOption, Ne)
389
- }))), /* @__PURE__ */ t.createElement(o.Day, {
390
- className: f.day
391
- }, /* @__PURE__ */ t.createElement(o.Day.Label, {
392
- className: E(S, p.label)
393
- }), /* @__PURE__ */ t.createElement(o.Day.Input, {
394
- className: E(Y, p.input, f.dayInput)
395
- })), /* @__PURE__ */ t.createElement(o.Year, {
396
- className: f.year
397
- }, /* @__PURE__ */ t.createElement(o.Year.Label, {
398
- className: E(S, p.label)
399
- }), /* @__PURE__ */ t.createElement(o.Year.Input, {
400
- className: E(Y, p.input, f.yearInput)
401
- })), /* @__PURE__ */ t.createElement(o.Time, {
402
- className: f.timeGroup
403
- }, /* @__PURE__ */ t.createElement(o.Time.Label, {
404
- className: E(S, p.label)
405
- }), /* @__PURE__ */ t.createElement(o.Time.Input, {
406
- className: E(Y, p.input, f.time)
407
- }, /* @__PURE__ */ t.createElement(o.Time.Hour, {
408
- className: f.hour
409
- }), /* @__PURE__ */ t.createElement(o.Time.Minute, {
410
- className: f.minute
411
- }), /* @__PURE__ */ t.createElement(o.Time.Period, {
412
- className: f.period
413
- }))), /* @__PURE__ */ t.createElement(o.Error, {
414
- className: E(Oe, p.error)
415
- }, /* @__PURE__ */ t.createElement(ye, null), /* @__PURE__ */ t.createElement(o.Error.Text, null)), /* @__PURE__ */ t.createElement(o.Description, {
416
- className: E(Fe, p.description)
417
- }, at));
418
- };
419
- export {
420
- Dt as D
421
- };
@@ -1,152 +0,0 @@
1
- import e, { useCallback as O, useRef as q } from "react";
2
- import { RicosViewer as x } from "@wix/ricos/viewer";
3
- import u from "classnames";
4
- import { parseTime as H } from "@internationalized/date";
5
- import { TimeField as V, DateInput as v, DateSegment as _ } from "react-aria-components";
6
- import { ag as E, ad as B, aq as I, ai as k } from "./form-DaOKiR16.js";
7
- import { f as c, a as F } from "./find-child-C60k4CxG.js";
8
- import { D as w, E as U } from "./field-error-headless-Dm5UCOBb.js";
9
- import { L as j } from "./field-label-headless-C7mDzdLq.js";
10
- import { E as Q } from "./error-icon-hZxQ6DEy.js";
11
- import { s as d } from "./field-rac.module-DAPTqFDM.js";
12
- import { r as z, H as G, q as J, l as K, h as W } from "./form-element-classes-Bi-nNM8q.js";
13
- const r = ({ children: t }) => {
14
- const { id: n, value: o, onChange: a, disabled: i, required: l, onBlur: s, onFocus: p, use24HourFormat: f, FieldLayout: T, hasError: D } = E(), { inputId: L, ariaDescribedBy: S, labelId: g } = B(), R = O((A) => {
15
- const M = ee(A);
16
- a(M);
17
- }, [
18
- a
19
- ]), b = c(t, r.Label), N = c(t, r.Time), C = c(t, r.Description), y = c(t, r.Error), P = $(o);
20
- return /* @__PURE__ */ e.createElement(T, {
21
- fieldId: n,
22
- renderLabel: () => b,
23
- renderInput: () => /* @__PURE__ */ e.createElement(V, {
24
- "aria-labelledby": g,
25
- id: L,
26
- "aria-describedby": S,
27
- value: P,
28
- onChange: R,
29
- isDisabled: i,
30
- isInvalid: D,
31
- isRequired: l,
32
- onBlur: s,
33
- onFocus: p,
34
- hourCycle: f ? 24 : 12
35
- }, N),
36
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, y, C)
37
- });
38
- }, m = ({ children: t, className: n }) => {
39
- const { hasError: o } = E(), a = c(t, m.Hour), i = c(t, m.Minute), l = c(t, m.Period);
40
- return /* @__PURE__ */ e.createElement(v, {
41
- className: n,
42
- "data-invalid": o || void 0
43
- }, (s) => {
44
- switch (s.type) {
45
- case "hour":
46
- return F(a, {
47
- segment: s
48
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
49
- case "minute":
50
- return F(i, {
51
- segment: s
52
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
53
- case "dayPeriod":
54
- return F(l, {
55
- segment: s
56
- }) || /* @__PURE__ */ e.createElement(e.Fragment, null);
57
- case "literal":
58
- return /* @__PURE__ */ e.createElement(_, {
59
- segment: s
60
- });
61
- default:
62
- return /* @__PURE__ */ e.createElement(e.Fragment, null);
63
- }
64
- });
65
- }, X = ({ className: t, ...n }) => {
66
- const { id: o, hidePlaceholder: a } = E(), { segment: i } = n, { t: l } = I(), s = q(null);
67
- k(() => {
68
- var f;
69
- (f = s.current) == null || f.focus();
70
- }, o);
71
- const p = a ? void 0 : l("field.date.placeholder.hour");
72
- return /* @__PURE__ */ e.createElement(_, {
73
- ref: s,
74
- segment: i,
75
- className: t,
76
- ...p && {
77
- placeholder: p
78
- }
79
- });
80
- }, Y = ({ className: t, ...n }) => {
81
- const { hidePlaceholder: o } = E(), { segment: a } = n, { t: i } = I(), l = o ? void 0 : i("field.date.placeholder.minute");
82
- return /* @__PURE__ */ e.createElement(_, {
83
- segment: a,
84
- className: t,
85
- ...l && {
86
- placeholder: l
87
- }
88
- });
89
- }, Z = ({ className: t, ...n }) => {
90
- const { hidePlaceholder: o } = E(), { segment: a } = n, { t: i } = I(), l = o ? void 0 : i("field.date.placeholder.period");
91
- return /* @__PURE__ */ e.createElement(_, {
92
- segment: a,
93
- className: t,
94
- ...l && {
95
- placeholder: l
96
- }
97
- });
98
- };
99
- m.Hour = X;
100
- m.Minute = Y;
101
- m.Period = Z;
102
- r.Label = j;
103
- r.Time = m;
104
- r.Description = w;
105
- r.Error = U;
106
- function $(t) {
107
- if (!t)
108
- return null;
109
- try {
110
- return H(t);
111
- } catch {
112
- return null;
113
- }
114
- }
115
- function ee(t) {
116
- if (!t)
117
- return null;
118
- const n = String(t.hour).padStart(2, "0"), o = String(t.minute).padStart(2, "0"), a = String(t.second).padStart(2, "0");
119
- return [
120
- n,
121
- o,
122
- a
123
- ].join(":");
124
- }
125
- const te = "_time_332x1_1", re = "_hour_332x1_14", ne = "_minute_332x1_15", ae = "_period_332x1_16", h = {
126
- time: te,
127
- hour: re,
128
- minute: ne,
129
- period: ae
130
- }, oe = ({ content: t, locale: n }) => /* @__PURE__ */ e.createElement(x, {
131
- content: t,
132
- locale: n
133
- }), le = () => /* @__PURE__ */ e.createElement(r, null, /* @__PURE__ */ e.createElement(r.Label, {
134
- className: u(z, d.label)
135
- }, /* @__PURE__ */ e.createElement(r.Label.Required, {
136
- className: u(G, d.requiredMark)
137
- })), /* @__PURE__ */ e.createElement(r.Time, {
138
- className: u(J, d.input, h.time)
139
- }, /* @__PURE__ */ e.createElement(r.Time.Hour, {
140
- className: h.hour
141
- }), /* @__PURE__ */ e.createElement(r.Time.Minute, {
142
- className: h.minute
143
- }), /* @__PURE__ */ e.createElement(r.Time.Period, {
144
- className: h.period
145
- })), /* @__PURE__ */ e.createElement(r.Error, {
146
- className: u(K, d.error)
147
- }, /* @__PURE__ */ e.createElement(Q, null), /* @__PURE__ */ e.createElement(r.Error.Text, null)), /* @__PURE__ */ e.createElement(r.Description, {
148
- className: u(W, d.description)
149
- }, oe)), Ie = () => /* @__PURE__ */ e.createElement(le, null);
150
- export {
151
- Ie as TimeInputRAC
152
- };