@wix/form-elements 1.128.0 → 1.129.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 (111) hide show
  1. package/dist/component/{appointment-rac-S9z3s23G.js → appointment-rac-BFrtR9Kx.js} +4 -4
  2. package/dist/component/{bookings-address-rac-B7wL2TjQ.js → bookings-address-rac-BiOaHkHb.js} +1 -1
  3. package/dist/component/{bookings-email-rac-T2lFRGpg.js → bookings-email-rac-AWVBomja.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-BBrENRBf.js → bookings-first-name-rac-BVxrEBSC.js} +1 -1
  5. package/dist/component/{bookings-header-rac-CWGMiMQz.js → bookings-header-rac-DZWoWz45.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-BQWvH_gm.js → bookings-last-name-rac-wsOIAERt.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-tFs0Vioz.js → bookings-login-bar-rac-BEFZtTeh.js} +1 -1
  8. package/dist/component/{bookings-phone-rac-BV_BTfAh.js → bookings-phone-rac-DClujcXK.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-8cD6QJBZ.js → bookings-rich-text-rac-ghEjDW-p.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-YmG26i31.js → checkbox-field-rac-DvsNu9Rv.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-CE8sEjZj.js → checkbox-group-field-headless-C9-35Ull.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-CSuJRyk1.js → checkbox-group-field-rac-Cj09BgU-.js} +4 -4
  13. package/dist/component/{checkbox-group-rac-VDezm9js.js → checkbox-group-rac-Buxfb0mq.js} +1 -1
  14. package/dist/component/{checkbox-rac-DoC1ZqAq.js → checkbox-rac-DiHUcWo3.js} +1 -1
  15. package/dist/component/{contacts-address-rac-10AZNzhI.js → contacts-address-rac-P0OBiw6-.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-C7YDiyg2.js → contacts-birthdate-rac-IDz3KjEo.js} +1 -1
  17. package/dist/component/{contacts-company-rac-xQEtJ_-m.js → contacts-company-rac-CC_USKNp.js} +1 -1
  18. package/dist/component/{contacts-email-rac-Bryw_aCU.js → contacts-email-rac-BcRvtene.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-BXmuuhfG.js → contacts-first-name-rac-DsybqPgd.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-CVWVZO8I.js → contacts-last-name-rac-BOKeJmHo.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-C-KSwisV.js → contacts-phone-rac-Dc_3ZdY_.js} +1 -1
  22. package/dist/component/{contacts-position-rac-od-5Gie5.js → contacts-position-rac-Bn5kybDQ.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-CCh9JcQx.js → contacts-subscribe-rac-BouQEOeS.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-DOM7TPQz.js → contacts-tax-id-rac-DJFrxRyu.js} +1 -1
  25. package/dist/component/{date-availability-G5IwqtRi.js → date-availability-CWfQIoX1.js} +1 -1
  26. package/dist/component/{date-input-field-rac-BpBqS7LG.js → date-input-field-rac-CP15ihpI.js} +86 -86
  27. package/dist/component/{date-input-rac-CQyqRqZK.js → date-input-rac-Bf0H1oiA.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-BsR_0eAW.js → date-picker-field-rac-SOddu2Zu.js} +92 -91
  29. package/dist/component/{date-picker-rac-Bl2k363u.js → date-picker-rac-BdRbAhSB.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-Bj_uDj6E.js +427 -0
  31. package/dist/component/{date-time-input-rac-CInfYWxN.js → date-time-input-rac-Mv_mEil2.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-E36LjEfn.js → dext-checkbox-group-rac-8kR2EZfL.js} +2 -2
  33. package/dist/component/{dext-checkbox-rac-DkMAv7aY.js → dext-checkbox-rac-B5CWQuVt.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-BNkJPlYo.js → dext-date-picker-rac-D_hbdOUB.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-BH3Q0pwI.js → dext-date-time-input-rac-DJa6HIBI.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-DkF_DD08.js → dext-dropdown-rac-rUST_4lA.js} +1 -1
  37. package/dist/component/{dext-email-rac-0x_DN0_O.js → dext-email-rac-BN1-DKDv.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-UiIENkK3.js → dext-number-input-rac-CjoV2Zr-.js} +1 -1
  39. package/dist/component/{dext-phone-rac-BZFK4Uq7.js → dext-phone-rac-BZK-MfUB.js} +1 -1
  40. package/dist/component/{dext-radio-group-rac-CBAdO7kt.js → dext-radio-group-rac-CdSOS1sE.js} +2 -2
  41. package/dist/component/{dext-rating-input-rac-fqR1sriq.js → dext-rating-input-rac-DAZjknQn.js} +1 -1
  42. package/dist/component/{dext-tags-rac-mDuiUs9L.js → dext-tags-rac-ButsCV5O.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-C-8jKWpK.js → dext-text-area-rac-TKwYp5Cp.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-CCBAM9YO.js → dext-text-input-rac-Clcifgwu.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-C4_8Yk0p.js → dext-url-input-rac-1oQFTxHV.js} +1 -1
  46. package/dist/component/{donation-rac-BwDHypVJ.js → donation-rac-Bh_D5aEJ.js} +5 -5
  47. package/dist/component/dropdown-field-headless-C-rtyAEo.js +91 -0
  48. package/dist/component/{dropdown-field-rac-DduQJ9rO.js → dropdown-field-rac-Bo3lqJDR.js} +4 -4
  49. package/dist/component/{dropdown-rac-BhhECLoH.js → dropdown-rac-C29h60zI.js} +1 -1
  50. package/dist/component/{ecom-address-rac-BJ1nnEVL.js → ecom-address-rac-gs7OAQTj.js} +1 -1
  51. package/dist/component/{ecom-subscription-checkbox-rac-4m1XMTDY.js → ecom-subscription-checkbox-rac-CI9zbJqB.js} +2 -2
  52. package/dist/component/{email-input-field-rac-bPEcgidt.js → email-input-field-rac-D75vjW_1.js} +3 -3
  53. package/dist/component/{events-repeater-rac-CujTGEHx.js → events-repeater-rac-UgCJlo2O.js} +4 -4
  54. package/dist/component/{events-rsvp-rac-BPqr_aY9.js → events-rsvp-rac-D5YhJy0C.js} +3 -3
  55. package/dist/component/{field-error-headless-Bu_4Huhb.js → field-error-headless-44vAUpwr.js} +1 -1
  56. package/dist/component/{field-label-headless-DkDmQPFG.js → field-label-headless-Cfo9v3VS.js} +1 -1
  57. package/dist/component/{file-upload-rac-DmOQrGe8.js → file-upload-rac-B-rYIzhu.js} +4 -4
  58. package/dist/component/{fixed-payment-rac-CDsddKrV.js → fixed-payment-rac-CkbmX7hl.js} +3 -3
  59. package/dist/component/{form-BpJ4Lqbe.js → form-tScYihAT.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-Cr1FVQdq.js → header-field-rac-BtKN5X7s.js} +2 -2
  63. package/dist/component/{header-rac-CvAZsqDL.js → header-rac-pmryP48d.js} +1 -1
  64. package/dist/component/{image-choice-rac-D_EKrD73.js → image-choice-rac-ByBjTccP.js} +4 -4
  65. package/dist/component/{index-DxsHfkik.js → index-DXsujvrm.js} +4 -4
  66. package/dist/component/{index-Tnke1N8m.js → index-Dyso3MNS.js} +2 -2
  67. package/dist/component/{isObjectLike-CMWsWjX8.js → isObjectLike-CUj2YjST.js} +1 -1
  68. package/dist/component/{multiline-address-field-rac-BMeMP7J6.js → multiline-address-field-rac-CkifK7lO.js} +7 -7
  69. package/dist/component/{multiline-address-rac-CFprfFXm.js → multiline-address-rac-DfnDSoTY.js} +1 -1
  70. package/dist/component/non-modal-popover-D-u13tmp.js +64 -0
  71. package/dist/component/{number-input-field-rac-CaHySxYH.js → number-input-field-rac-BG8cRLXY.js} +4 -4
  72. package/dist/component/{number-input-rac-BezfoU8h.js → number-input-rac-Byuz2Nub.js} +1 -1
  73. package/dist/component/{password-rac-_wwZFd67.js → password-rac-BOus-ku5.js} +4 -4
  74. package/dist/component/{payment-input-rac-CWrSvBDp.js → payment-input-rac-D-CZ6cKL.js} +4 -4
  75. package/dist/component/{phone-input-field-rac-R3LYdPIs.js → phone-input-field-rac-DCfc-MrP.js} +7 -7
  76. package/dist/component/{phone-rac-D6uILVRw.js → phone-rac-1J-t9-Og.js} +1 -1
  77. package/dist/component/{product-list-rac-D3WTfC9k.js → product-list-rac-CJ1YZvV9.js} +4 -4
  78. package/dist/component/{quiz-radio-group-rac-B6T7eedk.js → quiz-radio-group-rac-C_JnWUd3.js} +1 -1
  79. package/dist/component/{radio-button-module-classes-D8Jm-Q6u.js → radio-button-module-classes-DWh_AiLg.js} +3 -3
  80. package/dist/component/{radio-group-field-rac-R5onZzJd.js → radio-group-field-rac-Cp48ayde.js} +4 -4
  81. package/dist/component/{radio-group-rac-DUPHR4tK.js → radio-group-rac-B7jR2Rb-.js} +1 -1
  82. package/dist/component/{rating-input-field-rac-C9GpwuRO.js → rating-input-field-rac-CHEWLp0k.js} +4 -4
  83. package/dist/component/{rating-input-rac-Iv_2PVqP.js → rating-input-rac-BX4osXZU.js} +1 -1
  84. package/dist/component/{rich-content-rac.module-Det3BKrI.js → rich-content-rac.module-Ce08oqQ9.js} +1 -1
  85. package/dist/component/{rich-text-field-rac-DnBtp2d_.js → rich-text-field-rac-Bi1SDfiU.js} +2 -2
  86. package/dist/component/{rich-text-rac-CXzxap1G.js → rich-text-rac-DdT8jmAf.js} +1 -1
  87. package/dist/component/{service-dropdown-rac-CVyd2HYC.js → service-dropdown-rac-DPeHyyz_.js} +5 -5
  88. package/dist/component/{services-multi-choice-rac-BY-W0xIt.js → services-multi-choice-rac-CKdjXJR8.js} +5 -5
  89. package/dist/component/{signature-rac-BojdPJhg.js → signature-rac-ffVbFXfs.js} +4 -4
  90. package/dist/component/{submit-button-rac-Q7KKQbiL.js → submit-button-rac-C55AG9QQ.js} +2 -2
  91. package/dist/component/{tags-field-rac-CbmR6gi4.js → tags-field-rac-BO2-TOy4.js} +5 -5
  92. package/dist/component/{tags-rac-hJo0tMVR.js → tags-rac-BkCC7NCe.js} +1 -1
  93. package/dist/component/{text-area-field-rac-DHQqkqtu.js → text-area-field-rac-BwYibo91.js} +4 -4
  94. package/dist/component/{text-area-rac-BTXxfWyK.js → text-area-rac-DZdY4txw.js} +1 -1
  95. package/dist/component/{text-input-field-rac-BVTBYjMM.js → text-input-field-rac-WiCBhW6i.js} +3 -3
  96. package/dist/component/{text-input-headless-Dk_0y9U-.js → text-input-headless-B3KeulEf.js} +3 -3
  97. package/dist/component/{text-input-rac-DIwGn0WI.js → text-input-rac-BIyCqBJv.js} +1 -1
  98. package/dist/component/{time-input-rac-ClyPOKOH.js → time-input-rac-CC4UwoED.js} +65 -64
  99. package/dist/component/{url-input-field-rac-BhPzHWTI.js → url-input-field-rac-OppUVl3A.js} +4 -4
  100. package/dist/component/{url-input-rac-COD7T5wo.js → url-input-rac-B5_eh6hN.js} +1 -1
  101. package/dist/component/{use-dropdown-option-class-name-CTDQ4YIC.js → use-dropdown-option-class-name-Bgp-eVle.js} +2 -2
  102. package/dist/component/{use-dropdown-trigger-class-name-DapDPNX0.js → use-dropdown-trigger-class-name-BjjdE7MT.js} +2 -2
  103. package/dist/component/{use-element-state-class-name-BU86oHkX.js → use-element-state-class-name-BXqvGrEm.js} +1 -1
  104. package/dist/component/{use-hoverable-input-class-name-DWkmQfPd.js → use-hoverable-input-class-name-CFgJ095f.js} +2 -2
  105. package/dist/component/{use-service-options-base-jkecu8jY.js → use-service-options-base-Cspzf1ks.js} +1 -1
  106. package/dist/component/use-text-input-class-name-DUHXnnCn.js +6 -0
  107. package/package.json +2 -2
  108. package/dist/component/date-time-input-field-rac-C5TC2nsm.js +0 -426
  109. package/dist/component/dropdown-field-headless-CspX2zV_.js +0 -91
  110. package/dist/component/non-modal-popover-DtIMXHbe.js +0 -63
  111. package/dist/component/use-text-input-class-name-CNTXVb7N.js +0 -6
@@ -1,426 +0,0 @@
1
- import { RicosViewer as se } from "@wix/ricos/viewer";
2
- import h from "classnames";
3
- import t, { useMemo as T, useState as G, useCallback as H, useRef as U, useContext as oe } from "react";
4
- import { parseTime as le } from "@internationalized/date";
5
- import { UNSAFE_PortalProvider as ie } from "react-aria";
6
- import { ListBoxItem as ce, Select as me, TextField as Q, TimeField as de, SelectValue as ue, Input as J, DateInput as pe, DateSegment as x, TimeFieldStateContext as Ee } from "react-aria-components";
7
- import { bh as f, be as W, b9 as $, aO as X, a$ as Z, aB as d, br as C, b3 as K, aQ as he, aI as fe, b6 as be, aK as j, bj as z, I as R, U as ge, K as Ie, v as Ne, p as De } from "./form-BpJ4Lqbe.js";
8
- import { f as u, a as P } from "./find-child-C60k4CxG.js";
9
- import { g as ye } from "./helpers-HmkkXrh2.js";
10
- import { D as _e, E as Oe } from "./field-error-headless-Bu_4Huhb.js";
11
- import { L as Te } from "./field-label-headless-DkDmQPFG.js";
12
- import { F as Ce } from "./fieldset-headless-CD3fds9J.js";
13
- import { N as Fe, S as Le } from "./non-modal-popover-DtIMXHbe.js";
14
- import { a as Pe, u as Me } from "./use-dropdown-trigger-class-name-DapDPNX0.js";
15
- import { V as Se, u as Re } from "./use-dropdown-option-class-name-CTDQ4YIC.js";
16
- import { C as Ae } from "./chevron-down-icon-CcpVm6B-.js";
17
- import { E as Ve } from "./error-icon-hZxQ6DEy.js";
18
- import { H as w } from "./custom-focus-class-_483Pkwp.js";
19
- import { s as g } from "./field-rac.module-BIBNQEOK.js";
20
- import { u as k } from "./use-text-input-class-name-CNTXVb7N.js";
21
- const l = ({ children: e, className: a }) => {
22
- const { id: n, required: s, onBlur: o, onFocus: r, FieldLayout: i } = f(), { inputId: m, labelId: c, ariaDescribedBy: b } = W(), { regionalFormat: p } = $(), y = T(() => X(p).filter(Z).map((S) => S.toUpperCase()), [
23
- p
24
- ]), M = u(e, l.Label), v = u(e, l.Description), N = u(e, l.Error), D = {
25
- [d.MONTH]: u(e, l.Month),
26
- [d.DAY]: u(e, l.Day),
27
- [d.YEAR]: u(e, l.Year)
28
- }, _ = u(e, l.Time);
29
- return /* @__PURE__ */ t.createElement(i, {
30
- fieldId: n,
31
- renderLabel: () => P(M, {
32
- as: "div"
33
- }),
34
- renderInput: () => /* @__PURE__ */ t.createElement(Ce, {
35
- id: m,
36
- ariaLabelledBy: c,
37
- ariaDescribedBy: b,
38
- required: s,
39
- onBlur: o,
40
- onFocus: r,
41
- className: a
42
- }, D[y[0]], D[y[1]], D[y[2]], _),
43
- renderDescription: () => /* @__PURE__ */ t.createElement(t.Fragment, null, N, v)
44
- });
45
- }, F = ({ children: e, className: a }) => {
46
- const { id: n, disabled: s, readOnly: o, showDateLabels: r, hidePlaceholder: i } = f(), { labelId: m } = O(d.MONTH), { partValue: c, partError: b, onPartChange: p } = L(d.MONTH), { t: y } = C(), [M, v] = G(!1), N = Pe(n), [D, _] = G(null), S = i ? void 0 : y("field.date.placeholder.month"), ee = H((Y) => {
47
- o || p(typeof Y == "string" ? Y : "");
48
- }, [
49
- p,
50
- o
51
- ]), te = H((Y) => {
52
- v(Y && !o);
53
- }, [
54
- o
55
- ]), ae = u(e, F.Label), ne = u(e, F.Trigger), re = u(e, F.Options);
56
- return /* @__PURE__ */ t.createElement("div", {
57
- className: a,
58
- "data-date-field": !0
59
- }, r ? ae : null, /* @__PURE__ */ t.createElement("div", {
60
- ref: _,
61
- style: {
62
- display: "contents"
63
- }
64
- }), /* @__PURE__ */ t.createElement(ie, {
65
- getContainer: () => D
66
- }, /* @__PURE__ */ t.createElement(me, {
67
- "aria-labelledby": r ? m : void 0,
68
- value: c || null,
69
- onChange: ee,
70
- isDisabled: s,
71
- isInvalid: b,
72
- placeholder: S,
73
- isOpen: N || M,
74
- onOpenChange: N ? void 0 : te
75
- }, ne, P(re, {
76
- isForcedOpen: N
77
- }))));
78
- }, ve = ({ className: e }) => /* @__PURE__ */ t.createElement(q, {
79
- datePart: d.MONTH,
80
- className: e
81
- }), Ye = ({ children: e, className: a }) => {
82
- const { id: n, readOnly: s } = f(), { inputId: o } = O(d.MONTH), { partError: r, isFirstPart: i } = L(d.MONTH), m = U(null);
83
- return z(() => {
84
- var c;
85
- i && ((c = m.current) == null || c.focus());
86
- }, n), /* @__PURE__ */ t.createElement(Le, {
87
- ref: m,
88
- id: o,
89
- className: a,
90
- "data-hook": d.MONTH,
91
- "data-invalid": r || void 0,
92
- "data-readonly": s || void 0
93
- }, /* @__PURE__ */ t.createElement(ue, null), e);
94
- }, B = ({ children: e, className: a, ...n }) => {
95
- const { isForcedOpen: s } = n, { language: o } = $(), r = T(() => ye(o), [
96
- o
97
- ]), i = u(e, B.Option) ?? /* @__PURE__ */ t.createElement(B.Option, null);
98
- return /* @__PURE__ */ t.createElement(Fe, {
99
- className: a,
100
- containerPadding: 0,
101
- offset: 0
102
- }, /* @__PURE__ */ t.createElement(Se, {
103
- isForcedOpen: s,
104
- autoFocus: s ? !1 : void 0
105
- }, r.map((m, c) => P(i, {
106
- key: String(c + 1),
107
- value: String(c + 1),
108
- label: m
109
- }))));
110
- }, we = ({ className: e, ...a }) => {
111
- const { value: n, label: s } = a;
112
- return /* @__PURE__ */ t.createElement(ce, {
113
- className: e,
114
- id: n,
115
- textValue: s
116
- }, s);
117
- };
118
- F.Label = ve;
119
- F.Trigger = Ye;
120
- F.Options = B;
121
- B.Option = we;
122
- const A = ({ children: e, className: a }) => {
123
- const { disabled: n, readOnly: s, showDateLabels: o } = f(), { labelId: r } = O(d.DAY), { partValue: i, partError: m, onPartChange: c } = L(d.DAY), b = u(e, A.Label), p = u(e, A.Input);
124
- return /* @__PURE__ */ t.createElement("div", {
125
- className: a,
126
- "data-date-field": !0
127
- }, o && b, /* @__PURE__ */ t.createElement(Q, {
128
- "aria-labelledby": o ? r : void 0,
129
- value: i,
130
- onChange: c,
131
- isDisabled: n,
132
- isReadOnly: s,
133
- isInvalid: m
134
- }, p));
135
- }, He = ({ className: e }) => /* @__PURE__ */ t.createElement(q, {
136
- datePart: d.DAY,
137
- className: e
138
- }), Be = ({ className: e }) => {
139
- const { id: a, hidePlaceholder: n } = f(), { inputId: s } = O(d.DAY), { isFirstPart: o } = L(d.DAY), { t: r } = C(), i = U(null), m = n ? void 0 : r("field.date.placeholder.day");
140
- return z(() => {
141
- var c;
142
- o && ((c = i.current) == null || c.focus());
143
- }, a), /* @__PURE__ */ t.createElement(J, {
144
- ref: i,
145
- id: s,
146
- className: e,
147
- placeholder: m,
148
- maxLength: 2,
149
- inputMode: "numeric",
150
- "data-hook": d.DAY
151
- });
152
- };
153
- A.Label = He;
154
- A.Input = Be;
155
- const V = ({ children: e, className: a }) => {
156
- const { disabled: n, readOnly: s, showDateLabels: o } = f(), { labelId: r } = O(d.YEAR), { partValue: i, partError: m, onPartChange: c } = L(d.YEAR), b = u(e, V.Label), p = u(e, V.Input);
157
- return /* @__PURE__ */ t.createElement("div", {
158
- className: a,
159
- "data-date-field": !0
160
- }, o && b, /* @__PURE__ */ t.createElement(Q, {
161
- "aria-labelledby": o ? r : void 0,
162
- value: i,
163
- onChange: c,
164
- isDisabled: n,
165
- isReadOnly: s,
166
- isInvalid: m
167
- }, p));
168
- }, xe = ({ className: e }) => /* @__PURE__ */ t.createElement(q, {
169
- datePart: d.YEAR,
170
- className: e
171
- }), ke = ({ className: e }) => {
172
- const { id: a, hidePlaceholder: n } = f(), { inputId: s } = O(d.YEAR), { isFirstPart: o } = L(d.YEAR), { t: r } = C(), i = U(null), m = n ? void 0 : r("field.date.placeholder.year");
173
- return z(() => {
174
- var c;
175
- o && ((c = i.current) == null || c.focus());
176
- }, a), /* @__PURE__ */ t.createElement(J, {
177
- ref: i,
178
- id: s,
179
- className: e,
180
- placeholder: m,
181
- maxLength: 4,
182
- inputMode: "numeric",
183
- "data-hook": d.YEAR
184
- });
185
- };
186
- V.Label = xe;
187
- V.Input = ke;
188
- const I = ({ children: e, className: a }) => {
189
- const { disabled: n, readOnly: s, use24HourFormat: o, showDateLabels: r } = f(), { labelId: i } = O("time"), { partValue: m, partError: c, onPartChange: b } = L("time"), p = u(e, I.Label), y = u(e, I.Input);
190
- return /* @__PURE__ */ t.createElement("div", {
191
- className: a,
192
- "data-date-field": !0
193
- }, r && p, /* @__PURE__ */ t.createElement(de, {
194
- "aria-labelledby": r ? i : void 0,
195
- value: m,
196
- onChange: b,
197
- isDisabled: n,
198
- isReadOnly: s,
199
- isInvalid: c,
200
- hourCycle: o ? 24 : 12
201
- }, y));
202
- }, Ue = ({ className: e }) => {
203
- const { inputId: a, labelId: n } = O("time"), { t: s } = C(), o = s("field.date.label.time");
204
- return /* @__PURE__ */ t.createElement("label", {
205
- id: n,
206
- htmlFor: a,
207
- className: e
208
- }, o);
209
- }, $e = ({ children: e, className: a }) => {
210
- const n = u(e, I.Hour), s = u(e, I.Minute), o = u(e, I.Period);
211
- return /* @__PURE__ */ t.createElement(pe, {
212
- className: a,
213
- "data-hook": "time"
214
- }, (r) => {
215
- switch (r.type) {
216
- case "hour":
217
- return P(n, {
218
- segment: r
219
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
220
- case "minute":
221
- return P(s, {
222
- segment: r
223
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
224
- case "dayPeriod":
225
- return P(o, {
226
- segment: r
227
- }) || /* @__PURE__ */ t.createElement(t.Fragment, null);
228
- case "literal":
229
- return /* @__PURE__ */ t.createElement(x, {
230
- segment: r
231
- });
232
- default:
233
- return /* @__PURE__ */ t.createElement(t.Fragment, null);
234
- }
235
- });
236
- }, ze = ({ className: e, ...a }) => {
237
- const { hidePlaceholder: n } = f(), { segment: s } = a, { t: o } = C(), r = n ? void 0 : o("field.date.placeholder.hour");
238
- return /* @__PURE__ */ t.createElement(x, {
239
- segment: s,
240
- className: e,
241
- ...r && {
242
- placeholder: r
243
- }
244
- });
245
- }, qe = ({ className: e, ...a }) => {
246
- const { hidePlaceholder: n } = f(), { segment: s } = a, { t: o } = C(), r = n ? void 0 : o("field.date.placeholder.minute");
247
- return /* @__PURE__ */ t.createElement(x, {
248
- segment: s,
249
- className: e,
250
- ...r && {
251
- placeholder: r
252
- }
253
- });
254
- }, Ge = ({ className: e, ...a }) => {
255
- const { hidePlaceholder: n } = f(), { segment: s } = a, { t: o } = C(), r = oe(Ee), i = n ? void 0 : o("field.date.placeholder.period"), m = () => r == null ? void 0 : r.increment("dayPeriod");
256
- return /* @__PURE__ */ t.createElement(x, {
257
- segment: s,
258
- className: e,
259
- onClick: m,
260
- ...i && {
261
- placeholder: i
262
- }
263
- });
264
- };
265
- I.Label = Ue;
266
- I.Input = $e;
267
- I.Hour = ze;
268
- I.Minute = qe;
269
- I.Period = Ge;
270
- l.Label = Te;
271
- l.Month = F;
272
- l.Day = A;
273
- l.Year = V;
274
- l.Time = I;
275
- l.Description = _e;
276
- l.Error = Oe;
277
- function O(e) {
278
- const { inputId: a } = W();
279
- return T(() => {
280
- const n = e.toLowerCase();
281
- return {
282
- inputId: `${a}-${n}-input`,
283
- labelId: `${a}-${n}-label`
284
- };
285
- }, [
286
- a,
287
- e
288
- ]);
289
- }
290
- function L(e) {
291
- const { value: a, onChange: n, hasError: s = !1 } = f(), { regionalFormat: o } = $(), [r, i] = T(() => K(a ?? ""), [
292
- a
293
- ]), m = T(() => he(s, a ?? ""), [
294
- a,
295
- s
296
- ]), c = T(() => fe(r), [
297
- r
298
- ]), b = T(() => Ke(i), [
299
- i
300
- ]), p = H((N) => {
301
- const D = je(N), _ = j(r, D);
302
- n(_);
303
- }, [
304
- n,
305
- r
306
- ]), y = H((N) => {
307
- const [, D] = K(a ?? ""), _ = be(N, e, c), S = j(_, D);
308
- n(S);
309
- }, [
310
- n,
311
- a,
312
- c,
313
- e
314
- ]), M = T(() => e === "time" ? !1 : X(o).filter(Z).map((_) => _.toUpperCase())[0] === e, [
315
- o,
316
- e
317
- ]);
318
- return e === "time" ? {
319
- partValue: b,
320
- partError: m.TIME,
321
- onPartChange: p,
322
- isFirstPart: !1
323
- } : {
324
- partValue: c[e] || "",
325
- partError: m[e],
326
- onPartChange: y,
327
- isFirstPart: M
328
- };
329
- }
330
- function q({ datePart: e, className: a }) {
331
- const { inputId: n, labelId: s } = O(e), { t: o } = C(), r = `field.date.label.${e.toLowerCase()}`, i = o(r);
332
- return /* @__PURE__ */ t.createElement("label", {
333
- id: s,
334
- htmlFor: n,
335
- className: a
336
- }, i);
337
- }
338
- function Ke(e) {
339
- if (!e)
340
- return null;
341
- try {
342
- return le(e);
343
- } catch {
344
- return null;
345
- }
346
- }
347
- function je(e) {
348
- if (!e)
349
- return null;
350
- const a = String(e.hour).padStart(2, "0"), n = String(e.minute).padStart(2, "0"), s = String(e.second).padStart(2, "0");
351
- return [
352
- a,
353
- n,
354
- s
355
- ].join(":");
356
- }
357
- const Qe = "_fields_h99r9_1", Je = "_month_h99r9_10", We = "_day_h99r9_11", Xe = "_year_h99r9_12", Ze = "_timeGroup_h99r9_13", et = "_dayInput_h99r9_34", tt = "_yearInput_h99r9_35", at = "_monthTrigger_h99r9_39", nt = "_monthOption_h99r9_59", rt = "_time_h99r9_13", st = "_hour_h99r9_78", ot = "_minute_h99r9_79", lt = "_period_h99r9_80", E = {
358
- fields: Qe,
359
- month: Je,
360
- day: We,
361
- year: Xe,
362
- timeGroup: Ze,
363
- dayInput: et,
364
- yearInput: tt,
365
- monthTrigger: at,
366
- monthOption: nt,
367
- time: rt,
368
- hour: st,
369
- minute: ot,
370
- period: lt
371
- }, it = ({ content: e, locale: a }) => /* @__PURE__ */ t.createElement(se, {
372
- content: e,
373
- locale: a
374
- }), Pt = () => {
375
- const e = Me(E.monthTrigger), a = Re(E.monthOption, w), n = k(E.dayInput), s = k(E.yearInput), o = k(E.time);
376
- return /* @__PURE__ */ t.createElement(l, {
377
- className: E.fields
378
- }, /* @__PURE__ */ t.createElement(l.Label, {
379
- className: h(R, g.label)
380
- }, /* @__PURE__ */ t.createElement(l.Label.Required, {
381
- className: h(ge, g.requiredMark)
382
- })), /* @__PURE__ */ t.createElement(l.Month, {
383
- className: E.month
384
- }, /* @__PURE__ */ t.createElement(l.Month.Label, {
385
- className: h(R, g.label)
386
- }), /* @__PURE__ */ t.createElement(l.Month.Trigger, {
387
- className: e
388
- }, /* @__PURE__ */ t.createElement(Ae, {
389
- className: g.dropdownIcon
390
- })), /* @__PURE__ */ t.createElement(l.Month.Options, {
391
- className: h(Ie, g.selectPopover, g.dropdownPopover)
392
- }, /* @__PURE__ */ t.createElement(l.Month.Options.Option, {
393
- className: a
394
- }))), /* @__PURE__ */ t.createElement(l.Day, {
395
- className: E.day
396
- }, /* @__PURE__ */ t.createElement(l.Day.Label, {
397
- className: h(R, g.label)
398
- }), /* @__PURE__ */ t.createElement(l.Day.Input, {
399
- className: n
400
- })), /* @__PURE__ */ t.createElement(l.Year, {
401
- className: E.year
402
- }, /* @__PURE__ */ t.createElement(l.Year.Label, {
403
- className: h(R, g.label)
404
- }), /* @__PURE__ */ t.createElement(l.Year.Input, {
405
- className: s
406
- })), /* @__PURE__ */ t.createElement(l.Time, {
407
- className: E.timeGroup
408
- }, /* @__PURE__ */ t.createElement(l.Time.Label, {
409
- className: h(R, g.label)
410
- }), /* @__PURE__ */ t.createElement(l.Time.Input, {
411
- className: o
412
- }, /* @__PURE__ */ t.createElement(l.Time.Hour, {
413
- className: h(E.hour, w)
414
- }), /* @__PURE__ */ t.createElement(l.Time.Minute, {
415
- className: h(E.minute, w)
416
- }), /* @__PURE__ */ t.createElement(l.Time.Period, {
417
- className: h(E.period, w)
418
- }))), /* @__PURE__ */ t.createElement(l.Error, {
419
- className: h(Ne, g.error)
420
- }, /* @__PURE__ */ t.createElement(Ve, null), /* @__PURE__ */ t.createElement(l.Error.Text, null)), /* @__PURE__ */ t.createElement(l.Description, {
421
- className: h(De, g.description)
422
- }, it));
423
- };
424
- export {
425
- Pt as D
426
- };
@@ -1,91 +0,0 @@
1
- import e, { useState as E, useCallback as g, useRef as A } from "react";
2
- import { UNSAFE_PortalProvider as j } from "react-aria";
3
- import { Select as M, SelectValue as U, ListBoxItem as _ } from "react-aria-components";
4
- import { bh as f, be as O, bj as z } from "./form-BpJ4Lqbe.js";
5
- import { f as d, a as F } from "./find-child-C60k4CxG.js";
6
- import { D as G, E as H } from "./field-error-headless-Bu_4Huhb.js";
7
- import { L as J } from "./field-label-headless-DkDmQPFG.js";
8
- import { S as K, N as Q } from "./non-modal-popover-DtIMXHbe.js";
9
- import { a as W } from "./use-dropdown-trigger-class-name-DapDPNX0.js";
10
- import { V as X } from "./use-dropdown-option-class-name-CTDQ4YIC.js";
11
- const r = ({ children: n }) => {
12
- const { id: l, value: o, defaultValue: a, options: u = [], readOnly: s, onChange: t, placeholder: m, disabled: i, required: v, onBlur: y, onFocus: D, FieldLayout: h, hasError: C } = f(), [I, L] = E(!1), p = W(l), [B, N] = E(null), P = o && u.some((c) => (c.value ?? c.label) === o) ? o : a || null, { labelId: S } = O(), V = g((c) => {
13
- s || t(typeof c == "string" ? c : null);
14
- }, [
15
- t,
16
- s
17
- ]), T = g((c) => L(c && !i && !s), [
18
- i,
19
- s
20
- ]), x = d(n, r.Label), R = d(n, r.Trigger), w = d(n, r.Options), k = d(n, r.Description), q = d(n, r.Error);
21
- return /* @__PURE__ */ e.createElement(h, {
22
- fieldId: l,
23
- renderLabel: () => x,
24
- renderInput: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
25
- ref: N,
26
- style: {
27
- display: "contents"
28
- }
29
- }), /* @__PURE__ */ e.createElement(j, {
30
- getContainer: () => B
31
- }, /* @__PURE__ */ e.createElement(M, {
32
- "aria-labelledby": S,
33
- value: P,
34
- isOpen: p || I && !i && !s,
35
- onOpenChange: p ? void 0 : T,
36
- onChange: V,
37
- isDisabled: i,
38
- isInvalid: C,
39
- isRequired: v,
40
- placeholder: m,
41
- onBlur: y,
42
- onFocus: D
43
- }, R, F(w, {
44
- isForcedOpen: p
45
- })))),
46
- renderDescription: () => /* @__PURE__ */ e.createElement(e.Fragment, null, q, k)
47
- });
48
- }, Y = ({ children: n, className: l }) => {
49
- const { inputId: o, ariaDescribedBy: a } = O(), { id: u, hasError: s, isLoading: t } = f(), m = A(null);
50
- return z(() => {
51
- var i;
52
- (i = m.current) == null || i.focus();
53
- }, u), /* @__PURE__ */ e.createElement(K, {
54
- ref: m,
55
- id: o,
56
- "aria-describedby": a,
57
- className: l,
58
- "data-invalid": s || void 0,
59
- "data-loading": t || void 0
60
- }, /* @__PURE__ */ e.createElement(U, null), n);
61
- }, b = ({ children: n, className: l, ...o }) => {
62
- const { isForcedOpen: a } = o, { options: u = [] } = f(), s = d(n, b.Option);
63
- return /* @__PURE__ */ e.createElement(Q, {
64
- className: l,
65
- containerPadding: 0,
66
- offset: 0
67
- }, /* @__PURE__ */ e.createElement(X, {
68
- isForcedOpen: a,
69
- autoFocus: a ? !1 : void 0
70
- }, u.map((t) => F(s, {
71
- key: t.value ?? t.label,
72
- value: t.value ?? t.label,
73
- label: t.label
74
- }))));
75
- }, Z = ({ className: n, ...l }) => {
76
- const { value: o, label: a } = l;
77
- return /* @__PURE__ */ e.createElement(_, {
78
- className: n,
79
- id: o,
80
- textValue: a
81
- }, a);
82
- };
83
- b.Option = Z;
84
- r.Label = J;
85
- r.Trigger = Y;
86
- r.Options = b;
87
- r.Description = G;
88
- r.Error = H;
89
- export {
90
- r as D
91
- };
@@ -1,63 +0,0 @@
1
- import u, { forwardRef as f, useContext as i, useRef as p, useEffect as R, createContext as B } from "react";
2
- import { useObjectRef as D, useInteractOutside as I } from "react-aria";
3
- import { OverlayTriggerStateContext as P, useSlottedContext as S, PopoverContext as b, Popover as N, Button as T } from "react-aria-components";
4
- const x = /* @__PURE__ */ B(null), k = (e) => e != null && e.matches("[aria-haspopup]") ? e : e == null ? void 0 : e.querySelector("[aria-haspopup]"), m = /* @__PURE__ */ f((e, r) => {
5
- var l;
6
- const t = D(r), n = i(P), o = (l = S(b)) == null ? void 0 : l.triggerRef, s = i(x), c = p(0), O = p(!1), a = n == null ? void 0 : n.isOpen;
7
- R(() => {
8
- if (!(!a || !t.current || !s))
9
- return s.current += 1, () => {
10
- s.current -= 1;
11
- };
12
- }, [
13
- a,
14
- t,
15
- s
16
- ]);
17
- const h = (d) => {
18
- var C;
19
- return !((C = k(o == null ? void 0 : o.current)) != null && C.contains(d));
20
- };
21
- return I({
22
- ref: t,
23
- isDisabled: !a,
24
- onInteractOutsideStart: () => {
25
- O.current = c.current > 0;
26
- },
27
- onInteractOutside: (d) => {
28
- !O.current && h(d.target) && (n == null || n.close());
29
- }
30
- }), /* @__PURE__ */ u.createElement(x.Provider, {
31
- value: c
32
- }, /* @__PURE__ */ u.createElement(N, {
33
- ...e,
34
- ref: t,
35
- isNonModal: !0,
36
- shouldCloseOnInteractOutside: h
37
- }));
38
- }), q = /* @__PURE__ */ f((e, r) => {
39
- const t = i(P), n = (o) => {
40
- var c;
41
- (c = e.onPressStart) == null || c.call(e, o), o.pointerType !== "touch" && o.pointerType !== "keyboard" && (t != null && t.isOpen) && t.close();
42
- };
43
- return /* @__PURE__ */ u.createElement(T, {
44
- ...e,
45
- ref: r,
46
- onPressStart: n
47
- });
48
- }), v = /* @__PURE__ */ f((e, r) => {
49
- const t = i(P), n = (o) => {
50
- var s;
51
- (s = e.onPress) == null || s.call(e, o), t != null && t.isOpen && t.close();
52
- };
53
- return /* @__PURE__ */ u.createElement(T, {
54
- ...e,
55
- ref: r,
56
- onPress: n
57
- });
58
- });
59
- export {
60
- v as D,
61
- m as N,
62
- q as S
63
- };
@@ -1,6 +0,0 @@
1
- import { a5 as a } from "./form-BpJ4Lqbe.js";
2
- import { u as e } from "./use-hoverable-input-class-name-DWkmQfPd.js";
3
- const m = (...s) => e(a, s);
4
- export {
5
- m as u
6
- };