@wix/form-elements 1.233.0 → 1.234.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/component/{appointment-rac-D-3m58lp.js → appointment-rac-DaJz8fBt.js} +4 -4
  2. package/dist/component/{bookings-address-rac-B-LoE2Qn.js → bookings-address-rac-lkvT2jFg.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DPZwdIFG.js → bookings-email-rac-B6yDIr7X.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-CsVsVcvr.js → bookings-first-name-rac-BdwaASKa.js} +1 -1
  5. package/dist/component/{bookings-header-rac-qNe2KRzE.js → bookings-header-rac-K_4D2edM.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-DQL_KMg2.js → bookings-last-name-rac-z1DsE6Te.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-COt6CmZt.js → bookings-login-bar-rac-DuDc27Sg.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-L07Dr5yv.js → bookings-phone-rac-D3I57XfO.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-DJaGIswi.js → bookings-rich-text-rac-Dva_0eJC.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-hshAPjuN.js → checkbox-field-rac-CcVXm9fo.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-Dz8ifQ1q.js → checkbox-group-field-headless-DIwGr5_m.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-BcmVG9V9.js → checkbox-group-field-rac-Di8eepGG.js} +4 -4
  13. package/dist/component/{checkbox-group-rac-Dxd3xSxY.js → checkbox-group-rac-uA3X1M2J.js} +1 -1
  14. package/dist/component/{checkbox-rac-BWtTYFl2.js → checkbox-rac-BSYp2Yim.js} +1 -1
  15. package/dist/component/{contacts-address-rac-Cgi9ARvL.js → contacts-address-rac-BmITc1pA.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-C5LiljQS.js → contacts-birthdate-rac-BbiTr6cp.js} +1 -1
  17. package/dist/component/{contacts-company-rac-DjVt6krD.js → contacts-company-rac-DUQ7fNTn.js} +1 -1
  18. package/dist/component/{contacts-email-rac-UUsDS-Hj.js → contacts-email-rac-CVqqMJbq.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-D0I06Uqj.js → contacts-first-name-rac-uv3ldXXw.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-DEg25NCh.js → contacts-last-name-rac-CimDHNgO.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-CGs7LCRx.js → contacts-phone-rac-BShfAZ5U.js} +1 -1
  22. package/dist/component/{contacts-position-rac-6uf20AOO.js → contacts-position-rac-BENXoFz5.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-OR1Tl4HS.js → contacts-subscribe-rac-CBBgFf9U.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-BogsWGs4.js → contacts-tax-id-rac-B4fcviNx.js} +1 -1
  25. package/dist/component/{date-availability-Dc4t2XCp.js → date-availability-BrxRBFHK.js} +1 -1
  26. package/dist/component/date-input-field-rac-BFDOSod0.js +382 -0
  27. package/dist/component/{date-input-rac-D9uou8Mx.js → date-input-rac-Cd6SHUjO.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-BKiq-iMW.js → date-picker-field-rac-BN2EjYXP.js} +8 -8
  29. package/dist/component/{date-picker-rac-CMroLRTz.js → date-picker-rac-BQWpqtZJ.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-BO_3H4NG.js +526 -0
  31. package/dist/component/{date-time-input-rac-DBqQrjE_.js → date-time-input-rac-wgKGtEcj.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-CyReMYPe.js → dext-checkbox-group-rac-DM20MEtm.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-C-Ax0coQ.js → dext-checkbox-rac-DvzEyVhG.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-BEjVuSbf.js → dext-date-picker-rac-cof0w9i_.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-xWnKBcPO.js → dext-date-time-input-rac-BiJqwZ-5.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-BupA5fTu.js → dext-dropdown-rac-DEq1gj7M.js} +1 -1
  37. package/dist/component/{dext-email-rac-D-PgibOQ.js → dext-email-rac-BDg2wBuO.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-YGeVY6EG.js → dext-number-input-rac-BBouksMP.js} +1 -1
  39. package/dist/component/{dext-phone-rac-LFs2NS4p.js → dext-phone-rac-DZASm4Ft.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-C9GUzkeB.js → dext-radio-group-rac-DqAZs7cq.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-Cl0HkVM2.js → dext-rating-input-rac-BUB6w2g3.js} +1 -1
  42. package/dist/component/{dext-tags-rac-BYkY96bj.js → dext-tags-rac-BH6azQiT.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-fz7UNRqD.js → dext-text-area-rac-Bm1Oi7pi.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-Dv9HTbCt.js → dext-text-input-rac-DBSxcYp8.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-FxdnSlVl.js → dext-url-input-rac-gJ_-qrzY.js} +1 -1
  46. package/dist/component/{dismiss-icon-DJmsu1VC.js → dismiss-icon-sdQDwRev.js} +1 -1
  47. package/dist/component/{donation-rac-Bu74Oogy.js → donation-rac-CJHcIOnk.js} +5 -5
  48. package/dist/component/{dropdown-field-rac-CzWkvn7h.js → dropdown-field-rac-D94vF6Um.js} +3 -3
  49. package/dist/component/{dropdown-rac-V6_Z9Wpm.js → dropdown-rac-EN7KMhtd.js} +1 -1
  50. package/dist/component/{ecom-address-rac-jXrbgGcR.js → ecom-address-rac-CYk1wXq3.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-eHaOfQ88.js → ecom-subscription-checkbox-rac--cLVBIUD.js} +2 -2
  52. package/dist/component/{email-input-field-rac-CWVKPe92.js → email-input-field-rac-DWTQUl88.js} +3 -3
  53. package/dist/component/{events-repeater-rac-DYOdULgb.js → events-repeater-rac-B-CAZJsO.js} +4 -4
  54. package/dist/component/{events-rsvp-rac-QVCrDFMy.js → events-rsvp-rac-CkLzjZe0.js} +3 -3
  55. package/dist/component/{field-error-headless-NewCzOB9.js → field-error-headless-Hpn7Cjyz.js} +1 -1
  56. package/dist/component/{field-label-headless-Deo9dGbv.js → field-label-headless-CZaQ-q22.js} +1 -1
  57. package/dist/component/{file-upload-rac-aXHlyxHi.js → file-upload-rac-DelhbRzX.js} +153 -150
  58. package/dist/component/{fixed-payment-rac-BSZpuGK5.js → fixed-payment-rac-CGee8oWb.js} +3 -3
  59. package/dist/component/{form-D6g5Lhie.js → form-CKPfFL3D.js} +2347 -2341
  60. package/dist/component/form.css +1 -1
  61. package/dist/component/form.js +1 -1
  62. package/dist/component/{header-field-rac-PG_d2DLi.js → header-field-rac-B6vzJnaW.js} +2 -2
  63. package/dist/component/{header-rac-DSdtCA23.js → header-rac-Bc4WxzR1.js} +1 -1
  64. package/dist/component/hidden-part-label-Dc5eP4S0.js +18 -0
  65. package/dist/component/{image-choice-rac-Dfcq_DDp.js → image-choice-rac-BuArZj5n.js} +4 -4
  66. package/dist/component/{index-D4MrV_sk.js → index-CmopQE1P.js} +2 -2
  67. package/dist/component/{index-zP5mfEf8.js → index-yqi4FTyq.js} +4 -4
  68. package/dist/component/{isObjectLike-DFFmMGos.js → isObjectLike-DO4jXs__.js} +1 -1
  69. package/dist/component/{multiline-address-field-rac-C_Xy1nWk.js → multiline-address-field-rac-CijPzBxU.js} +8 -8
  70. package/dist/component/{multiline-address-rac-BqpeM7C_.js → multiline-address-rac-CchEjTwl.js} +1 -1
  71. package/dist/component/{number-input-field-rac-BQyjLISj.js → number-input-field-rac-CdJstTE-.js} +4 -4
  72. package/dist/component/{number-input-rac-DrDlS1RB.js → number-input-rac-B0V7Xy0I.js} +1 -1
  73. package/dist/component/{password-rac-BT58ATdC.js → password-rac-BipcyWPk.js} +4 -4
  74. package/dist/component/{payment-input-rac-CWalYCZA.js → payment-input-rac-ClhUNxdL.js} +4 -4
  75. package/dist/component/{phone-input-field-rac-D_ayc1RA.js → phone-input-field-rac-CPNMdr70.js} +7 -7
  76. package/dist/component/{phone-rac-p5F-E8Qq.js → phone-rac-DL5pW-cK.js} +1 -1
  77. package/dist/component/{product-list-rac-CPr9bYu0.js → product-list-rac-Ii0qlyiq.js} +4 -4
  78. package/dist/component/{quiz-radio-group-rac-OW0sqesm.js → quiz-radio-group-rac-DtO0om99.js} +1 -1
  79. package/dist/component/radio-button-module-classes-CY-zH0im.js +152 -0
  80. package/dist/component/{radio-group-field-rac-BLCsoI-r.js → radio-group-field-rac-ViY8g4gL.js} +4 -4
  81. package/dist/component/{radio-group-rac-BgUpj2G5.js → radio-group-rac-CjCoPD-w.js} +1 -1
  82. package/dist/component/rating-input-field-rac-BMFXLqfg.js +145 -0
  83. package/dist/component/{rating-input-rac-DSpFTPOv.js → rating-input-rac-CWGGV3Fx.js} +1 -1
  84. package/dist/component/{rich-content-rac.module-CLu7GcMK.js → rich-content-rac.module-CTlkS2_O.js} +1 -1
  85. package/dist/component/{rich-text-field-rac-ZiI_nRWE.js → rich-text-field-rac-2SQn_URM.js} +2 -2
  86. package/dist/component/{rich-text-rac-BsgiN5d-.js → rich-text-rac-L3m09cVp.js} +1 -1
  87. package/dist/component/{service-dropdown-rac-DWyhRr97.js → service-dropdown-rac-uKz9PkBj.js} +4 -4
  88. package/dist/component/{services-multi-choice-rac-TPWCJXw4.js → services-multi-choice-rac-sOJlp6_l.js} +5 -5
  89. package/dist/component/{signature-rac-D67GGPog.js → signature-rac-B1O7Ivtg.js} +4 -4
  90. package/dist/component/{submit-button-rac-DnVE0X13.js → submit-button-rac-iYdJFSXy.js} +60 -60
  91. package/dist/component/{tags-field-rac-Cr1g3IQA.js → tags-field-rac-CFSrsxw9.js} +5 -5
  92. package/dist/component/{tags-rac-CVMs-yMu.js → tags-rac-KW_c8m3p.js} +1 -1
  93. package/dist/component/{text-area-field-rac-gTMH-0ED.js → text-area-field-rac-BJEAvqCy.js} +4 -4
  94. package/dist/component/{text-area-rac-_s4ZWY1w.js → text-area-rac-Bk9j2e4k.js} +1 -1
  95. package/dist/component/{text-input-field-rac-BkHvsCqC.js → text-input-field-rac-KlrY_3qp.js} +3 -3
  96. package/dist/component/{text-input-headless-9zV5V5ku.js → text-input-headless-B6gzsedE.js} +3 -3
  97. package/dist/component/{text-input-rac-DiKyTmgL.js → text-input-rac-CSO1g0rD.js} +1 -1
  98. package/dist/component/{time-input-rac-DI40cFEX.js → time-input-rac-jaYI3_XV.js} +6 -6
  99. package/dist/component/{url-input-field-rac-BksPlayI.js → url-input-field-rac-1t5d4VjM.js} +4 -4
  100. package/dist/component/{url-input-rac-D7JSf8Qb.js → url-input-rac-BTQOpun9.js} +1 -1
  101. package/dist/component/{use-dropdown-option-class-name-DSehgOmn.js → use-dropdown-option-class-name-DEBN31l5.js} +2 -2
  102. package/dist/component/{use-dropdown-trigger-class-name-Bn5-sN_y.js → use-dropdown-trigger-class-name-BpcEWMWj.js} +7 -7
  103. package/dist/component/{use-element-state-class-name-CPvOOc0S.js → use-element-state-class-name-B0muHOx4.js} +1 -1
  104. package/dist/component/{use-hoverable-input-class-name-CdTBtnwn.js → use-hoverable-input-class-name-CL0sOlNu.js} +2 -2
  105. package/dist/component/{use-is-forced-open-dropdown-BowzktO1.js → use-is-forced-open-dropdown-BhQKJWNc.js} +1 -1
  106. package/dist/component/{use-native-mobile-input-FJXRhGOj.js → use-native-mobile-input-W9CS9U3u.js} +1 -1
  107. package/dist/component/{use-service-options-base-BIAtzpWn.js → use-service-options-base-DUgTjbHR.js} +1 -1
  108. package/dist/component/use-text-input-class-name-Mm_0ULVk.js +6 -0
  109. package/dist/form.d.ts +81 -0
  110. package/package.json +2 -2
  111. package/dist/component/date-input-field-rac-D4OlWmZn.js +0 -365
  112. package/dist/component/date-time-input-field-rac-Bv2fVYpg.js +0 -507
  113. package/dist/component/helpers-HmkkXrh2.js +0 -12
  114. package/dist/component/radio-button-module-classes-BZ_Hel4e.js +0 -137
  115. package/dist/component/rating-input-field-rac-B_HyeaML.js +0 -139
  116. package/dist/component/use-text-input-class-name-ChjVNdVG.js +0 -6
@@ -1,507 +0,0 @@
1
- import { RicosViewer as me } from "@wix/ricos/viewer";
2
- import N from "classnames";
3
- import t, { useMemo as F, useRef as U, Children as ue, isValidElement as de, useState as re, useCallback as G, useContext as pe } from "react";
4
- import { bN as h, bK as ee, bF as te, bh as oe, bu as se, b4 as d, bP as X, bY as y, by as j, bd as Z, bj as Ee, bb as fe, bC as be, u as Ne, X as he, am as Ie, w as $, x as De, M as _e, I as ge, v as Te, y as Ce, z as q } from "./form-D6g5Lhie.js";
5
- import { parseTime as ye } from "@internationalized/date";
6
- import { mergeProps as Oe, UNSAFE_PortalProvider as Le } from "react-aria";
7
- import { ListBoxItem as Fe, Select as Pe, TextField as le, TimeField as ve, SelectValue as Me, Input as ie, DateInput as Se, DateSegment as Q, TimeFieldStateContext as Re } from "react-aria-components";
8
- import { f as u, a as M } from "./find-child-C60k4CxG.js";
9
- import { g as Ae } from "./helpers-HmkkXrh2.js";
10
- import { D as Ve, E as we } from "./field-error-headless-NewCzOB9.js";
11
- import { L as Ye } from "./field-label-headless-Deo9dGbv.js";
12
- import { F as He } from "./fieldset-headless-CD3fds9J.js";
13
- import { u as Be, a as Ue, N as xe, D as ke } from "./dismiss-icon-DJmsu1VC.js";
14
- import { u as $e, N as qe } from "./use-native-mobile-input-FJXRhGOj.js";
15
- import { N as ze, E as Ge, S as je } from "./non-modal-popover-D-u13tmp.js";
16
- import { t as Ke, C as We } from "./calendar-icon-DOeHn3jt.js";
17
- import { t as Xe } from "./to-native-time-Co_gOLkc.js";
18
- import { u as Qe } from "./use-is-forced-open-dropdown-BowzktO1.js";
19
- import { u as Je } from "./use-native-state-class-name-B0m2ghbS.js";
20
- import { V as Ze, a as et } from "./use-dropdown-option-class-name-DSehgOmn.js";
21
- import { C as tt } from "./chevron-down-icon-CcpVm6B-.js";
22
- import { E as at } from "./error-icon-hZxQ6DEy.js";
23
- import { H as z } from "./custom-focus-class-_483Pkwp.js";
24
- import { s as p } from "./field-rac.module-D0QzJXUv.js";
25
- import { u as B } from "./use-hoverable-input-class-name-CdTBtnwn.js";
26
- const l = ({ children: e, className: a }) => {
27
- const { id: n, required: o, onBlur: r, onFocus: s, FieldLayout: i } = h(), { inputId: m, labelId: c, ariaDescribedBy: I } = ee(), { regionalFormat: E } = te(), C = $e(), _ = F(() => oe(E).filter(se).map((H) => H.toUpperCase()), [
28
- E
29
- ]), P = u(e, l.Label), b = u(e, l.Description), g = u(e, l.Error), f = {
30
- [d.MONTH]: u(e, l.Month),
31
- [d.DAY]: u(e, l.Day),
32
- [d.YEAR]: u(e, l.Year)
33
- }, v = u(e, l.Time), V = u(e, l.NativeDateTime), w = C ? P : M(P, {
34
- as: "div"
35
- }), Y = C ? V : /* @__PURE__ */ t.createElement(He, {
36
- id: m,
37
- ariaLabelledBy: c,
38
- ariaDescribedBy: I,
39
- required: o,
40
- onBlur: r,
41
- onFocus: s,
42
- className: a
43
- }, f[_[0]], f[_[1]], f[_[2]], v);
44
- return /* @__PURE__ */ t.createElement(i, {
45
- fieldId: n,
46
- renderLabel: () => w,
47
- renderInput: () => Y,
48
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, g, b)
49
- });
50
- }, S = ({ children: e, className: a }) => {
51
- const { id: n, disabled: o, readOnly: r, showDateLabels: s, hidePlaceholder: i } = h(), { labelId: m } = O(d.MONTH), { partValue: c, partError: I, onPartChange: E } = R(d.MONTH), { t: C } = y(), [_, P] = re(!1), b = Qe(n), [g, f] = re(null), v = i ? Ge : C("field.date.placeholder.month"), V = G((A) => {
52
- r || E(typeof A == "string" ? A : "");
53
- }, [
54
- E,
55
- r
56
- ]), w = G((A) => {
57
- P(A && !r);
58
- }, [
59
- r
60
- ]), Y = u(e, S.Label), H = u(e, S.Trigger), J = u(e, S.Options);
61
- return /* @__PURE__ */ t.createElement("div", {
62
- className: a,
63
- "data-date-field": !0
64
- }, s ? Y : null, /* @__PURE__ */ t.createElement("div", {
65
- ref: f,
66
- style: {
67
- display: "contents"
68
- }
69
- }), /* @__PURE__ */ t.createElement(Le, {
70
- getContainer: () => g
71
- }, /* @__PURE__ */ t.createElement(Pe, {
72
- "aria-labelledby": s ? m : void 0,
73
- value: c || null,
74
- onChange: V,
75
- isDisabled: o,
76
- isInvalid: I,
77
- placeholder: v,
78
- isOpen: b || _,
79
- onOpenChange: b ? void 0 : w
80
- }, H, M(J, {
81
- isForcedOpen: b
82
- }))));
83
- }, nt = ({ className: e }) => /* @__PURE__ */ t.createElement(ae, {
84
- datePart: d.MONTH,
85
- className: e
86
- }), rt = ({ children: e, className: a }) => {
87
- const { id: n, readOnly: o } = h(), { inputId: r } = O(d.MONTH), { partError: s, isFirstPart: i } = R(d.MONTH), m = U(null);
88
- return X(() => {
89
- var c;
90
- i && ((c = m.current) == null || c.focus({
91
- preventScroll: !0
92
- }));
93
- }, n), /* @__PURE__ */ t.createElement(je, {
94
- ref: m,
95
- id: r,
96
- className: a,
97
- "data-hook": d.MONTH,
98
- "data-invalid": s || void 0,
99
- "data-readonly": o || void 0
100
- }, /* @__PURE__ */ t.createElement(Me, null), e);
101
- }, K = ({ children: e, className: a, ...n }) => {
102
- const { isForcedOpen: o } = n, { language: r } = te(), s = F(() => Ae(r), [
103
- r
104
- ]), i = u(e, K.Option) ?? /* @__PURE__ */ t.createElement(K.Option, null);
105
- return /* @__PURE__ */ t.createElement(ze, {
106
- className: a,
107
- containerPadding: 0,
108
- offset: 0
109
- }, /* @__PURE__ */ t.createElement(Ze, {
110
- isForcedOpen: o,
111
- autoFocus: o ? !1 : void 0
112
- }, s.map((m, c) => M(i, {
113
- key: String(c + 1),
114
- value: String(c + 1),
115
- label: m
116
- }))));
117
- }, ot = ({ className: e, ...a }) => {
118
- const { value: n, label: o } = a;
119
- return /* @__PURE__ */ t.createElement(Fe, {
120
- className: e,
121
- id: n,
122
- textValue: o
123
- }, o);
124
- };
125
- S.Label = nt;
126
- S.Trigger = rt;
127
- S.Options = K;
128
- K.Option = ot;
129
- const x = ({ children: e, className: a }) => {
130
- const { disabled: n, readOnly: o, showDateLabels: r } = h(), { labelId: s } = O(d.DAY), { partValue: i, partError: m, onPartChange: c } = R(d.DAY), I = u(e, x.Label), E = u(e, x.Input);
131
- return /* @__PURE__ */ t.createElement("div", {
132
- className: a,
133
- "data-date-field": !0
134
- }, r && I, /* @__PURE__ */ t.createElement(le, {
135
- "aria-labelledby": r ? s : void 0,
136
- value: i,
137
- onChange: c,
138
- isDisabled: n,
139
- isReadOnly: o,
140
- isInvalid: m
141
- }, E));
142
- }, st = ({ className: e }) => /* @__PURE__ */ t.createElement(ae, {
143
- datePart: d.DAY,
144
- className: e
145
- }), lt = ({ className: e }) => {
146
- const { id: a, hidePlaceholder: n } = h(), { inputId: o } = O(d.DAY), { isFirstPart: r } = R(d.DAY), { t: s } = y(), i = U(null), m = n ? void 0 : s("field.date.placeholder.day");
147
- return X(() => {
148
- var c;
149
- r && ((c = i.current) == null || c.focus({
150
- preventScroll: !0
151
- }));
152
- }, a), /* @__PURE__ */ t.createElement(ie, {
153
- ref: i,
154
- id: o,
155
- className: e,
156
- placeholder: m,
157
- maxLength: 2,
158
- inputMode: "numeric",
159
- "data-hook": d.DAY
160
- });
161
- };
162
- x.Label = st;
163
- x.Input = lt;
164
- const k = ({ children: e, className: a }) => {
165
- const { disabled: n, readOnly: o, showDateLabels: r } = h(), { labelId: s } = O(d.YEAR), { partValue: i, partError: m, onPartChange: c } = R(d.YEAR), I = u(e, k.Label), E = u(e, k.Input);
166
- return /* @__PURE__ */ t.createElement("div", {
167
- className: a,
168
- "data-date-field": !0
169
- }, r && I, /* @__PURE__ */ t.createElement(le, {
170
- "aria-labelledby": r ? s : void 0,
171
- value: i,
172
- onChange: c,
173
- isDisabled: n,
174
- isReadOnly: o,
175
- isInvalid: m
176
- }, E));
177
- }, it = ({ className: e }) => /* @__PURE__ */ t.createElement(ae, {
178
- datePart: d.YEAR,
179
- className: e
180
- }), ct = ({ className: e }) => {
181
- const { id: a, hidePlaceholder: n } = h(), { inputId: o } = O(d.YEAR), { isFirstPart: r } = R(d.YEAR), { t: s } = y(), i = U(null), m = n ? void 0 : s("field.date.placeholder.year");
182
- return X(() => {
183
- var c;
184
- r && ((c = i.current) == null || c.focus({
185
- preventScroll: !0
186
- }));
187
- }, a), /* @__PURE__ */ t.createElement(ie, {
188
- ref: i,
189
- id: o,
190
- className: e,
191
- placeholder: m,
192
- maxLength: 4,
193
- inputMode: "numeric",
194
- "data-hook": d.YEAR
195
- });
196
- };
197
- k.Label = it;
198
- k.Input = ct;
199
- const T = ({ children: e, className: a }) => {
200
- const { disabled: n, readOnly: o, use24HourFormat: r, showDateLabels: s } = h(), { labelId: i } = O("time"), { partValue: m, partError: c, onPartChange: I } = R("time"), E = u(e, T.Label), C = u(e, T.Input);
201
- return /* @__PURE__ */ t.createElement("div", {
202
- className: a,
203
- "data-date-field": !0
204
- }, s && E, /* @__PURE__ */ t.createElement(ve, {
205
- "aria-labelledby": s ? i : void 0,
206
- value: m,
207
- onChange: I,
208
- isDisabled: n,
209
- isReadOnly: o,
210
- isInvalid: c,
211
- hourCycle: r ? 24 : 12
212
- }, C));
213
- }, mt = ({ className: e }) => {
214
- const { inputId: a, labelId: n } = O("time"), { t: o } = y(), r = o("field.date.label.time");
215
- return /* @__PURE__ */ t.createElement("label", {
216
- id: n,
217
- htmlFor: a,
218
- className: e
219
- }, r);
220
- }, ut = ({ children: e, className: a }) => {
221
- const { hidePlaceholder: n } = h(), o = u(e, T.Hour), r = u(e, T.Minute), s = u(e, T.Period);
222
- return /* @__PURE__ */ t.createElement(Se, {
223
- className: a,
224
- "data-hook": "time",
225
- "data-placeholder-hidden": n || void 0
226
- }, (i) => {
227
- switch (i.type) {
228
- case "hour":
229
- return M(o, {
230
- segment: i
231
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
232
- case "minute":
233
- return M(r, {
234
- segment: i
235
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
236
- case "dayPeriod":
237
- return M(s, {
238
- segment: i
239
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
240
- case "literal":
241
- return /* @__PURE__ */ t.createElement(Q, {
242
- segment: i
243
- });
244
- default:
245
- return /* @__PURE__ */ t.createElement(t.Fragment, null);
246
- }
247
- });
248
- }, dt = ({ className: e, ...a }) => {
249
- const { hidePlaceholder: n } = h(), { segment: o } = a, { t: r } = y(), s = n ? void 0 : r("field.date.placeholder.hour");
250
- return /* @__PURE__ */ t.createElement(Q, {
251
- segment: o,
252
- className: e,
253
- ...s && {
254
- placeholder: s
255
- }
256
- });
257
- }, pt = ({ className: e, ...a }) => {
258
- const { hidePlaceholder: n } = h(), { segment: o } = a, { t: r } = y(), s = n ? void 0 : r("field.date.placeholder.minute");
259
- return /* @__PURE__ */ t.createElement(Q, {
260
- segment: o,
261
- className: e,
262
- ...s && {
263
- placeholder: s
264
- }
265
- });
266
- }, Et = ({ className: e, ...a }) => {
267
- const { hidePlaceholder: n } = h(), { segment: o } = a, { t: r } = y(), s = pe(Re), i = n ? void 0 : r("field.date.placeholder.period"), m = () => s == null ? void 0 : s.increment("dayPeriod");
268
- return /* @__PURE__ */ t.createElement(Q, {
269
- segment: o,
270
- className: e,
271
- onClick: m,
272
- ...i && {
273
- placeholder: i
274
- }
275
- });
276
- };
277
- T.Label = mt;
278
- T.Input = ut;
279
- T.Hour = dt;
280
- T.Minute = pt;
281
- T.Period = Et;
282
- const W = ({ className: e, children: a }) => {
283
- const { id: n, value: o, onChange: r, required: s, disabled: i, readOnly: m, hasError: c, onBlur: I, onFocus: E } = h(), { inputId: C, labelId: _, ariaDescribedBy: P } = ee(), b = U(null), g = U(null);
284
- X(() => {
285
- var L;
286
- (L = b.current) == null || L.focus({
287
- preventScroll: !0
288
- });
289
- }, n);
290
- const f = ft(o), { announcement: v, announceCleared: V } = Be(!!f), w = !!f && !s && !i && !m, Y = u(a, W.Clear), H = ue.map(a, (L) => /* @__PURE__ */ de(L) && L.type === W.Clear ? null : L), { className: J, stateProps: A } = Je(e);
291
- return /* @__PURE__ */ t.createElement(qe, {
292
- ref: g,
293
- groupLabelId: _,
294
- announcement: v
295
- }, /* @__PURE__ */ t.createElement(Ue, {
296
- ref: b,
297
- type: "datetime-local",
298
- id: C,
299
- className: J,
300
- ...Oe(A, {
301
- onFocus: E,
302
- onBlur: I
303
- }),
304
- "aria-labelledby": _,
305
- "aria-describedby": P,
306
- "aria-invalid": c || void 0,
307
- value: f,
308
- onChange: (L) => r(bt(L)),
309
- disabled: i,
310
- readOnly: m,
311
- required: s
312
- }), H, w ? M(Y, {
313
- input: b,
314
- control: g,
315
- labelId: _,
316
- onClear: () => {
317
- r(""), V();
318
- }
319
- }) : null);
320
- };
321
- W.Clear = xe;
322
- l.Label = Ye;
323
- l.NativeDateTime = W;
324
- l.Month = S;
325
- l.Day = x;
326
- l.Year = k;
327
- l.Time = T;
328
- l.Description = Ve;
329
- l.Error = we;
330
- function O(e) {
331
- const { inputId: a } = ee();
332
- return F(() => {
333
- const n = e.toLowerCase();
334
- return {
335
- inputId: `${a}-${n}-input`,
336
- labelId: `${a}-${n}-label`
337
- };
338
- }, [
339
- a,
340
- e
341
- ]);
342
- }
343
- function R(e) {
344
- const { value: a, onChange: n, hasError: o = !1 } = h(), { regionalFormat: r } = te(), [s, i] = F(() => j(a ?? ""), [
345
- a
346
- ]), m = F(() => Ee(o, a ?? ""), [
347
- a,
348
- o
349
- ]), c = F(() => fe(s), [
350
- s
351
- ]), I = F(() => ne(i), [
352
- i
353
- ]), E = G((b) => {
354
- const g = ce(b), f = Z(s, g);
355
- n(f);
356
- }, [
357
- n,
358
- s
359
- ]), C = G((b) => {
360
- const [, g] = j(a ?? ""), f = be(b, e, c), v = Z(f, g);
361
- n(v);
362
- }, [
363
- n,
364
- a,
365
- c,
366
- e
367
- ]), _ = F(() => e === "time" ? !1 : oe(r).filter(se).map((f) => f.toUpperCase())[0] === e, [
368
- r,
369
- e
370
- ]);
371
- return e === "time" ? {
372
- partValue: I,
373
- partError: m.TIME,
374
- onPartChange: E,
375
- isFirstPart: !1
376
- } : {
377
- partValue: c[e] || "",
378
- partError: m[e],
379
- onPartChange: C,
380
- isFirstPart: _
381
- };
382
- }
383
- function ae({ datePart: e, className: a }) {
384
- const { inputId: n, labelId: o } = O(e), { t: r } = y(), s = `field.date.label.${e.toLowerCase()}`, i = r(s);
385
- return /* @__PURE__ */ t.createElement("label", {
386
- id: o,
387
- htmlFor: n,
388
- className: a
389
- }, i);
390
- }
391
- function ft(e) {
392
- const [a, n] = j(e ?? ""), o = Ke(a), r = Xe(ne(n));
393
- return o && r ? `${o}T${r}` : "";
394
- }
395
- function bt(e) {
396
- if (!e)
397
- return "";
398
- const [a, n] = j(e);
399
- return Z(a, ce(ne(n)));
400
- }
401
- function ne(e) {
402
- if (!e)
403
- return null;
404
- try {
405
- return ye(e);
406
- } catch {
407
- return null;
408
- }
409
- }
410
- function ce(e) {
411
- if (!e)
412
- return null;
413
- const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), o = String(e.second).padStart(2, "0");
414
- return [
415
- a,
416
- n,
417
- o
418
- ].join(":");
419
- }
420
- const Nt = "_fields_1ofw4_1", ht = "_month_1ofw4_10", It = "_day_1ofw4_11", Dt = "_year_1ofw4_12", _t = "_timeGroup_1ofw4_13", gt = "_dayInput_1ofw4_34", Tt = "_yearInput_1ofw4_35", Ct = "_monthTrigger_1ofw4_39", yt = "_monthOption_1ofw4_59", Ot = "_time_1ofw4_13", Lt = "_hour_1ofw4_81", Ft = "_minute_1ofw4_82", Pt = "_period_1ofw4_83", D = {
421
- fields: Nt,
422
- month: ht,
423
- day: It,
424
- year: Dt,
425
- timeGroup: _t,
426
- dayInput: gt,
427
- yearInput: Tt,
428
- monthTrigger: Ct,
429
- monthOption: yt,
430
- time: Ot,
431
- hour: Lt,
432
- minute: Ft,
433
- period: Pt
434
- }, vt = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(me, {
435
- content: e,
436
- locale: a
437
- }), aa = () => {
438
- const { t: e } = y(), a = B(Te, [
439
- D.monthTrigger
440
- ]), n = et(Ce, D.monthOption, z), o = B(q, [
441
- D.dayInput
442
- ]), r = B(q, [
443
- D.yearInput
444
- ]), s = B(q, [
445
- D.time
446
- ]), i = B(q, [
447
- p.nativeInput,
448
- p.nativeWithLeadingIcon
449
- ]);
450
- return /* @__PURE__ */ t.createElement(l, {
451
- className: N(Ne, D.fields)
452
- }, /* @__PURE__ */ t.createElement(l.Label, {
453
- className: N(he, p.label)
454
- }, /* @__PURE__ */ t.createElement(l.Label.Required, {
455
- className: N(Ie, p.requiredMark)
456
- })), /* @__PURE__ */ t.createElement(l.Month, {
457
- className: D.month
458
- }, /* @__PURE__ */ t.createElement(l.Month.Label, {
459
- className: N($, p.label)
460
- }), /* @__PURE__ */ t.createElement(l.Month.Trigger, {
461
- className: a
462
- }, /* @__PURE__ */ t.createElement(tt, {
463
- className: p.dropdownIcon
464
- })), /* @__PURE__ */ t.createElement(l.Month.Options, {
465
- className: N(De, p.selectPopover, p.dropdownPopover)
466
- }, /* @__PURE__ */ t.createElement(l.Month.Options.Option, {
467
- className: n
468
- }))), /* @__PURE__ */ t.createElement(l.Day, {
469
- className: D.day
470
- }, /* @__PURE__ */ t.createElement(l.Day.Label, {
471
- className: N($, p.label)
472
- }), /* @__PURE__ */ t.createElement(l.Day.Input, {
473
- className: o
474
- })), /* @__PURE__ */ t.createElement(l.Year, {
475
- className: D.year
476
- }, /* @__PURE__ */ t.createElement(l.Year.Label, {
477
- className: N($, p.label)
478
- }), /* @__PURE__ */ t.createElement(l.Year.Input, {
479
- className: r
480
- })), /* @__PURE__ */ t.createElement(l.Time, {
481
- className: D.timeGroup
482
- }, /* @__PURE__ */ t.createElement(l.Time.Label, {
483
- className: N($, p.label)
484
- }), /* @__PURE__ */ t.createElement(l.Time.Input, {
485
- className: s
486
- }, /* @__PURE__ */ t.createElement(l.Time.Hour, {
487
- className: N(D.hour, z)
488
- }), /* @__PURE__ */ t.createElement(l.Time.Minute, {
489
- className: N(D.minute, z)
490
- }), /* @__PURE__ */ t.createElement(l.Time.Period, {
491
- className: N(D.period, z)
492
- }))), /* @__PURE__ */ t.createElement(l.NativeDateTime, {
493
- className: i
494
- }, /* @__PURE__ */ t.createElement(We, {
495
- className: N(p.nativeDecoration, p.nativeLeadingIcon)
496
- }), /* @__PURE__ */ t.createElement(l.NativeDateTime.Clear, {
497
- className: p.nativeClearButton,
498
- "aria-label": e("date-picker.a11y.clear-button")
499
- }, /* @__PURE__ */ t.createElement(ke, null))), /* @__PURE__ */ t.createElement(l.Error, {
500
- className: N(_e, p.error)
501
- }, /* @__PURE__ */ t.createElement(at, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)), /* @__PURE__ */ t.createElement(l.Description, {
502
- className: N(ge, p.description)
503
- }, vt));
504
- };
505
- export {
506
- aa as D
507
- };
@@ -1,12 +0,0 @@
1
- function o(t) {
2
- const n = new Intl.DateTimeFormat(t, {
3
- month: "long"
4
- });
5
- return Array.from(Array(12).keys()).map(r);
6
- function r(e) {
7
- return n.format(new Date(2023, e));
8
- }
9
- }
10
- export {
11
- o as g
12
- };
@@ -1,137 +0,0 @@
1
- import a, { useRef as S, useState as B, useEffect as H, useCallback as P } from "react";
2
- import { RadioGroup as k, RadioField as A, RadioButton as G, TextField as $, Input as q } from "react-aria-components";
3
- import { bN as g, bK as x, bW as K, bY as D, bP as U } from "./form-D6g5Lhie.js";
4
- import { f as u, a as L } from "./find-child-C60k4CxG.js";
5
- import { D as M, E as W } from "./field-error-headless-NewCzOB9.js";
6
- import { L as Y } from "./field-label-headless-Deo9dGbv.js";
7
- import { S as j } from "./selection-indicator-XQ8MYHUQ.js";
8
- const v = "Other", w = (e, t) => e == null ? void 0 : e.find((n) => (n.value ?? n.label) === t), F = (e, t) => !!t && !w(e, t), z = (e, t) => {
9
- const l = t ? t.length + 2 : 0;
10
- return e.slice(l);
11
- }, i = ({ children: e, className: t }) => {
12
- const { id: n, value: l, onChange: h, disabled: p, readOnly: O, required: m, onBlur: E, onFocus: b, hasError: r, FieldLayout: c, options: o } = g(), { inputId: f, labelId: C, ariaDescribedBy: I } = x(), s = S(null);
13
- K(s);
14
- const _ = u(e, i.Label), R = u(e, i.Options), N = u(e, i.Description), V = u(e, i.Error), T = F(o, l) ? v : l || null;
15
- return /* @__PURE__ */ a.createElement(c, {
16
- fieldId: n,
17
- renderLabel: () => L(_, {
18
- as: "div"
19
- }),
20
- renderInput: () => /* @__PURE__ */ a.createElement(k, {
21
- ref: s,
22
- id: f,
23
- className: t,
24
- "aria-labelledby": C,
25
- "aria-describedby": I,
26
- value: T,
27
- onChange: h,
28
- isDisabled: p,
29
- isReadOnly: O,
30
- isRequired: m,
31
- isInvalid: r,
32
- onBlur: E,
33
- onFocus: b
34
- }, R),
35
- renderDescription: () => /* @__PURE__ */ a.createElement(a.Fragment, null, V, N)
36
- });
37
- }, J = ({ children: e, className: t }) => {
38
- const { options: n, addOther: l, addOtherLabel: h, id: p, numberOfColumns: O, hasError: m } = g(), { t: E } = D(), b = u(e, i.Option), r = S(null), c = h || E("add-other.default-other-option-label") || v;
39
- return U(() => {
40
- var o;
41
- (o = r.current) == null || o.focus({
42
- preventScroll: !0
43
- });
44
- }, p), /* @__PURE__ */ a.createElement("div", {
45
- className: t,
46
- "data-columns": O,
47
- "data-invalid": m
48
- }, n.map((o, f) => L(b, {
49
- key: o.value ?? o.label,
50
- value: o.value ?? o.label,
51
- label: o.label,
52
- index: f,
53
- radioRef: f === 0 ? r : void 0
54
- })), l && L(b, {
55
- key: v,
56
- value: v,
57
- label: c,
58
- isOther: !0
59
- }));
60
- }, d = ({ children: e, className: t, ...n }) => {
61
- var I;
62
- const { value: l, label: h, isOther: p = !1, radioRef: O } = n, { value: m, options: E } = g(), b = u(e, d.Label), r = u(e, d.Input), c = u(e, d.Control), o = u(e, d.OtherInput), f = p ? F(E, m) : m === l, C = (I = r == null ? void 0 : r.props) == null ? void 0 : I.className;
63
- return /* @__PURE__ */ a.createElement("div", {
64
- className: t
65
- }, /* @__PURE__ */ a.createElement(A, {
66
- value: l
67
- }, /* @__PURE__ */ a.createElement(G, {
68
- ref: O,
69
- className: C
70
- }, ({ isSelected: s, isHovered: _, isFocused: R }) => /* @__PURE__ */ a.createElement(a.Fragment, null, L(c, {
71
- isSelected: s,
72
- isHovered: _,
73
- isFocused: R
74
- }), L(b, {
75
- label: h
76
- })))), p && f && o);
77
- }, Q = ({ className: e, ...t }) => {
78
- const { label: n } = t;
79
- return /* @__PURE__ */ a.createElement("span", {
80
- className: e
81
- }, n);
82
- }, X = (e) => null, Z = ({ className: e }) => {
83
- const { value: t, onChange: n, addOtherLabel: l, addOtherPlaceholder: h, otherInputCharacterLimit: p, disabled: O, readOnly: m, options: E } = g(), { t: b } = D(), r = S(null), c = F(E, t), o = l || b("add-other.default-other-option-label") || v, [f, C] = B(c && t ? z(t, l) : "");
84
- H(() => {
85
- var s;
86
- c && r.current && ((s = r.current) == null || s.focus());
87
- }, [
88
- c
89
- ]);
90
- const I = P((s) => {
91
- let _;
92
- s ? _ = `${l}: ${s}` : _ = o, n(_), C(s);
93
- }, [
94
- n,
95
- l,
96
- o
97
- ]);
98
- return /* @__PURE__ */ a.createElement($, {
99
- "aria-label": o,
100
- value: f,
101
- onChange: I,
102
- isDisabled: O,
103
- isReadOnly: m
104
- }, /* @__PURE__ */ a.createElement(q, {
105
- ref: r,
106
- className: e,
107
- placeholder: h,
108
- maxLength: p
109
- }));
110
- };
111
- d.Label = Q;
112
- d.Input = X;
113
- d.Control = j;
114
- d.OtherInput = Z;
115
- i.Label = Y;
116
- i.Options = J;
117
- i.Option = d;
118
- i.Description = M;
119
- i.Error = W;
120
- const ee = "_labelImage_1u9f2_1", te = "_option_1u9f2_26", oe = "_optionInput_1u9f2_32", ne = "_optionControl_1u9f2_50", le = "_optionControlHover_1u9f2_72", ae = "_optionControlSelected_1u9f2_90", re = "_optionLabel_1u9f2_137", y = {
121
- labelImage: ee,
122
- option: te,
123
- optionInput: oe,
124
- optionControl: ne,
125
- optionControlHover: le,
126
- optionControlSelected: ae,
127
- optionLabel: re
128
- }, be = {
129
- base: y.optionControl,
130
- selected: y.optionControlSelected,
131
- hover: y.optionControlHover
132
- };
133
- export {
134
- be as R,
135
- i as a,
136
- y as s
137
- };