@wix/editor-react-components 1.2289.0 → 1.2290.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 (136) hide show
  1. package/dist/site/components/AccordionComponent/component.js +1 -1
  2. package/dist/site/components/AccordionComponent/manifest.js +1 -1
  3. package/dist/site/components/AnimatedIcon/manifest.js +1 -1
  4. package/dist/site/components/AudioPlayer/component.js +12 -10
  5. package/dist/site/components/AudioPlayer/manifest.js +1 -1
  6. package/dist/site/components/BoxContainer/component.js +1 -1
  7. package/dist/site/components/BoxContainer/manifest.js +1 -1
  8. package/dist/site/components/Breadcrumbs/component.js +2 -2
  9. package/dist/site/components/Breadcrumbs/manifest.js +1 -1
  10. package/dist/site/components/Button/manifest.js +1 -1
  11. package/dist/site/components/CollapsibleText/component.js +1 -1
  12. package/dist/site/components/CollapsibleText/manifest.js +1 -1
  13. package/dist/site/components/DatePicker/component.js +3290 -9827
  14. package/dist/site/components/DatePicker/manifest.js +1 -1
  15. package/dist/site/components/Dropdown/component.js +1 -1
  16. package/dist/site/components/Dropdown/manifest.js +1 -1
  17. package/dist/site/components/HTMLComponent/component.js +1 -1
  18. package/dist/site/components/HipaaIcon/component.js +1 -1
  19. package/dist/site/components/HipaaIcon/manifest.js +1 -1
  20. package/dist/site/components/LinkBar/component.js +1 -1
  21. package/dist/site/components/LinkBar/manifest.js +1 -1
  22. package/dist/site/components/Logo/component.js +1 -1
  23. package/dist/site/components/Logo/manifest.js +1 -1
  24. package/dist/site/components/Logo/sdk.js +1 -1
  25. package/dist/site/components/Lottie/component.js +1 -1
  26. package/dist/site/components/Lottie/manifest.js +1 -1
  27. package/dist/site/components/Menu/component.js +1 -1
  28. package/dist/site/components/Menu/manifest.js +1 -1
  29. package/dist/site/components/MultiStateBox/component.js +1 -1
  30. package/dist/site/components/MultiStateBox/manifest.js +1 -1
  31. package/dist/site/components/ProgressBar/component.js +1 -1
  32. package/dist/site/components/ProgressBar/manifest.js +1 -1
  33. package/dist/site/components/ProgressBar/sdk.js +1 -1
  34. package/dist/site/components/Repeater/component.js +1 -1
  35. package/dist/site/components/Repeater/manifest.js +1 -1
  36. package/dist/site/components/ShareButtons/component.js +1 -1
  37. package/dist/site/components/ShareButtons/manifest.js +1 -1
  38. package/dist/site/components/Tabs/component.js +1 -1
  39. package/dist/site/components/Tabs/manifest.js +1 -1
  40. package/dist/site/components/TextBox/component.js +1 -1
  41. package/dist/site/components/TextBox/manifest.js +1 -1
  42. package/dist/site/components/TextEffects3d/component.js +1 -1
  43. package/dist/site/components/TextEffects3d/manifest.js +1 -1
  44. package/dist/site/components/TextEffectsBauhaus/component.js +1 -1
  45. package/dist/site/components/TextEffectsBauhaus/manifest.js +1 -1
  46. package/dist/site/components/TextEffectsGlass/component.js +1 -1
  47. package/dist/site/components/TextEffectsGlass/manifest.js +1 -1
  48. package/dist/site/components/TextEffectsGlitch/component.js +1 -1
  49. package/dist/site/components/TextEffectsGlitch/manifest.js +1 -1
  50. package/dist/site/components/TextEffectsLetterPress/component.js +1 -1
  51. package/dist/site/components/TextEffectsLetterPress/manifest.js +1 -1
  52. package/dist/site/components/TextEffectsMatrix/component.js +1 -1
  53. package/dist/site/components/TextEffectsMatrix/manifest.js +1 -1
  54. package/dist/site/components/TextEffectsNeonSign/component.js +1 -1
  55. package/dist/site/components/TextEffectsNeonSign/manifest.js +1 -1
  56. package/dist/site/components/TextEffectsNoisy/component.js +1 -1
  57. package/dist/site/components/TextEffectsNoisy/manifest.js +1 -1
  58. package/dist/site/components/TextEffectsOutlineOut/component.js +2 -2
  59. package/dist/site/components/TextEffectsOutlineOut/manifest.js +1 -1
  60. package/dist/site/components/TextEffectsRetro/component.js +1 -1
  61. package/dist/site/components/TextEffectsRetro/manifest.js +1 -1
  62. package/dist/site/components/TextEffectsShook/component.js +1 -1
  63. package/dist/site/components/TextEffectsShook/manifest.js +1 -1
  64. package/dist/site/components/TextEffectsSticker/component.js +1 -1
  65. package/dist/site/components/TextEffectsSticker/manifest.js +2 -2
  66. package/dist/site/components/TextEffectsStriped/component.js +1 -1
  67. package/dist/site/components/TextEffectsStriped/manifest.js +1 -1
  68. package/dist/site/components/TextInput/component.js +171 -170
  69. package/dist/site/components/TextInput/manifest.js +1 -1
  70. package/dist/site/components/TimePicker/TimePicker.d.ts +3 -0
  71. package/dist/site/components/TimePicker/TimePicker.types.d.ts +29 -0
  72. package/dist/site/components/TimePicker/component.d.ts +2 -0
  73. package/dist/site/components/TimePicker/component.js +146 -0
  74. package/dist/site/components/TimePicker/component.preview.d.ts +2 -0
  75. package/dist/site/components/TimePicker/components/TimePickerField.d.ts +4 -0
  76. package/dist/site/components/TimePicker/constants.d.ts +32 -0
  77. package/dist/site/components/TimePicker/css.css +64 -0
  78. package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +10 -0
  79. package/dist/site/components/TimePicker/index.d.ts +2 -0
  80. package/dist/site/components/TimePicker/index.js +6 -0
  81. package/dist/site/components/TimePicker/manifest.d.ts +5 -0
  82. package/dist/site/components/TimePicker/manifest.js +113 -0
  83. package/dist/site/components/TimePicker/timePickerUtils.d.ts +15 -0
  84. package/dist/site/components/chunks/AnimatedIcon.js +1 -1
  85. package/dist/site/components/chunks/Button.js +1 -1
  86. package/dist/site/components/chunks/Button2.js +10 -829
  87. package/dist/site/components/chunks/DateField.js +6763 -0
  88. package/dist/site/components/chunks/Group.js +42 -155
  89. package/dist/site/components/chunks/I18nProvider.js +3 -3
  90. package/dist/site/components/chunks/Input.js +5 -5
  91. package/dist/site/components/chunks/Patterns.js +1 -1
  92. package/dist/site/components/chunks/TextEffectsShared.js +1 -1
  93. package/dist/site/components/chunks/constants10.js +14 -12
  94. package/dist/site/components/chunks/constants11.js +9 -9
  95. package/dist/site/components/chunks/constants12.js +10 -8
  96. package/dist/site/components/chunks/constants13.js +9 -13
  97. package/dist/site/components/chunks/constants14.js +14 -17
  98. package/dist/site/components/chunks/constants15.js +17 -12
  99. package/dist/site/components/chunks/constants16.js +11 -13
  100. package/dist/site/components/chunks/constants17.js +20 -66
  101. package/dist/site/components/chunks/constants18.js +67 -17
  102. package/dist/site/components/chunks/constants19.js +15 -50
  103. package/dist/site/components/chunks/constants2.js +30 -50
  104. package/dist/site/components/chunks/constants20.js +43 -45
  105. package/dist/site/components/chunks/constants21.js +48 -297
  106. package/dist/site/components/chunks/constants22.js +299 -41
  107. package/dist/site/components/chunks/constants23.js +44 -29
  108. package/dist/site/components/chunks/constants24.js +32 -17
  109. package/dist/site/components/chunks/constants25.js +16 -402
  110. package/dist/site/components/chunks/constants26.js +393 -73
  111. package/dist/site/components/chunks/constants27.js +80 -15
  112. package/dist/site/components/chunks/constants28.js +11 -42
  113. package/dist/site/components/chunks/constants29.js +44 -23
  114. package/dist/site/components/chunks/constants3.js +49 -14
  115. package/dist/site/components/chunks/constants30.js +28 -10
  116. package/dist/site/components/chunks/constants31.js +10 -132
  117. package/dist/site/components/chunks/constants32.js +112 -147
  118. package/dist/site/components/chunks/constants33.js +152 -49
  119. package/dist/site/components/chunks/constants34.js +53 -71
  120. package/dist/site/components/chunks/constants35.js +73 -77
  121. package/dist/site/components/chunks/constants36.js +76 -57
  122. package/dist/site/components/chunks/constants37.js +72 -0
  123. package/dist/site/components/chunks/constants4.js +10 -19
  124. package/dist/site/components/chunks/constants5.js +14 -14
  125. package/dist/site/components/chunks/constants6.js +11 -10
  126. package/dist/site/components/chunks/constants7.js +14 -14
  127. package/dist/site/components/chunks/constants8.js +22 -65
  128. package/dist/site/components/chunks/constants9.js +65 -20
  129. package/dist/site/components/chunks/filterDOMProps.js +7 -7
  130. package/dist/site/components/chunks/manifestBase.js +1 -1
  131. package/dist/site/components/chunks/useFocusable.js +118 -0
  132. package/dist/site/components/chunks/useLocalizedStringFormatter.js +1 -1
  133. package/dist/site/components/chunks/usePress.js +825 -0
  134. package/dist/site/components/chunks/utils.js +1 -1
  135. package/dist/site/components/extensions.js +9 -4
  136. package/package.json +3 -3
@@ -1,17 +1,185 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import React__default, { Component, createElement, createContext, Suspense, useContext, useState, useRef, useCallback } from "react";
3
+ import React__default, { createContext, useState, useRef, useCallback, Component, createElement, Suspense, useContext } from "react";
4
4
  import { c as clsx } from "../chunks/clsx.js";
5
5
  import { E as EnvironmentDefinition } from "../chunks/index2.js";
6
6
  import { b as getAccessibilityAttributes, H as HAS_CUSTOM_FOCUS_CLASSNAME } from "../chunks/a11y.js";
7
7
  import { a as getDataAttributes } from "../chunks/dataUtils.js";
8
- import { s as selectors } from "../chunks/constants2.js";
8
+ import { s as selectors } from "../chunks/constants3.js";
9
9
  import { useService } from "@wix/services-manager-react";
10
10
  import { T as TranslationsDefinition } from "../chunks/index5.js";
11
11
  import { $ as $fd2148440a13ec26$export$fc1a364ae1f3ff10, a as $191c9b6d48a0a4e2$export$294aa081a6c6f55d, b as $860f7da480e22816$export$b8473d3665f3a75a, c as $d3e0e05bdfcf66bd$export$c24727297075ec6a, d as $3985021b0ad6602f$export$37fb8590cf2c088c, e as $514c0188e459b4c0$export$9afb8bc826b033ea, f as $ee014567cb39d3f0$export$ff05c3ac10437e03, g as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../chunks/Input.js";
12
- import { $ as $3e6197669829fe11$export$40bfa8c7b0832715, a as $d1116acdf220c2da$export$4c014de7c8940b4c, b as $3274bf1495747a7b$export$5add1d006293d136, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, d as $23f2114a1b82827e$export$e58f029f0fbfdb29, e as $01b77f81d0f07f68$export$75b6ee27786ba447, f as $a049562f99e7db0e$export$f9c6924e160136d1, g as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../chunks/Group.js";
12
+ import { a as $3e6197669829fe11$export$40bfa8c7b0832715, b as $3274bf1495747a7b$export$5add1d006293d136, c as $bbaa08b3cd72f041$export$9d1611c77c2fe928, d as $23f2114a1b82827e$export$e58f029f0fbfdb29, e as $01b77f81d0f07f68$export$75b6ee27786ba447, f as $a049562f99e7db0e$export$f9c6924e160136d1, g as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../chunks/Group.js";
13
13
  import { $ as $8e9d2fae0ecb9001$export$457c3d6518dd4c6f, a as $f39a9eba43920ace$export$86427a43e3e48ebb, b as $64fa3d84918910a7$export$29f1550f4b0d4415, c as $64fa3d84918910a7$export$fabf2dc03a41866e, d as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, e as $64fa3d84918910a7$export$ef03459518577ad4, f as $64fa3d84918910a7$export$4d86445c2cf5e3, g as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, h as $64fa3d84918910a7$export$2881499e37b75b9a } from "../chunks/filterDOMProps.js";
14
+ import { $ as $d1116acdf220c2da$export$4c014de7c8940b4c } from "../chunks/useFocusable.js";
14
15
  import { S as SdkStateDefinition } from "../chunks/index6.js";
16
+ const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
17
+ function $054f71d2330da2e3$export$712718f7aec83d5(props, ref) {
18
+ let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, type = "text", validationBehavior = "aria" } = props;
19
+ let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || "", props.onChange);
20
+ let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
21
+ let validationState = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
22
+ ...props,
23
+ value
24
+ });
25
+ let { isInvalid, validationErrors, validationDetails } = validationState.displayValidation;
26
+ let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
27
+ ...props,
28
+ isInvalid,
29
+ errorMessage: props.errorMessage || validationErrors
30
+ });
31
+ let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
32
+ labelable: true
33
+ });
34
+ const inputOnlyProps = {
35
+ type,
36
+ pattern: props.pattern
37
+ };
38
+ let [initialValue] = useState(value);
39
+ $3274bf1495747a7b$export$5add1d006293d136(ref, props.defaultValue ?? initialValue, setValue);
40
+ $860f7da480e22816$export$b8473d3665f3a75a(props, validationState, ref);
41
+ return {
42
+ labelProps,
43
+ inputProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, inputElementType === "input" ? inputOnlyProps : void 0, {
44
+ disabled: isDisabled,
45
+ readOnly: isReadOnly,
46
+ required: isRequired && validationBehavior === "native",
47
+ "aria-required": isRequired && validationBehavior === "aria" || void 0,
48
+ "aria-invalid": isInvalid || void 0,
49
+ "aria-errormessage": props["aria-errormessage"],
50
+ "aria-activedescendant": props["aria-activedescendant"],
51
+ "aria-autocomplete": props["aria-autocomplete"],
52
+ "aria-haspopup": props["aria-haspopup"],
53
+ "aria-controls": props["aria-controls"],
54
+ value,
55
+ onChange: (e) => setValue($23f2114a1b82827e$export$e58f029f0fbfdb29(e).value),
56
+ autoComplete: props.autoComplete,
57
+ autoCapitalize: props.autoCapitalize,
58
+ maxLength: props.maxLength,
59
+ minLength: props.minLength,
60
+ name: props.name,
61
+ form: props.form,
62
+ placeholder: props.placeholder,
63
+ inputMode: props.inputMode,
64
+ autoCorrect: props.autoCorrect,
65
+ spellCheck: props.spellCheck,
66
+ [parseInt(React__default.version, 10) >= 17 ? "enterKeyHint" : "enterkeyhint"]: props.enterKeyHint,
67
+ // Clipboard events
68
+ onCopy: props.onCopy,
69
+ onCut: props.onCut,
70
+ onPaste: props.onPaste,
71
+ // Composition events
72
+ onCompositionEnd: props.onCompositionEnd,
73
+ onCompositionStart: props.onCompositionStart,
74
+ onCompositionUpdate: props.onCompositionUpdate,
75
+ // Selection events
76
+ onSelect: props.onSelect,
77
+ // Input events
78
+ onBeforeInput: props.onBeforeInput,
79
+ onInput: props.onInput,
80
+ ...focusableProps,
81
+ ...fieldProps
82
+ }),
83
+ descriptionProps,
84
+ errorMessageProps,
85
+ isInvalid,
86
+ validationErrors,
87
+ validationDetails
88
+ };
89
+ }
90
+ const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
91
+ const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
92
+ const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
93
+ [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
94
+ let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
95
+ var _props_validationBehavior, _ref;
96
+ let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
97
+ let inputRef = useRef(null);
98
+ [props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
99
+ let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
100
+ let [inputElementType, setInputElementType] = useState("input");
101
+ let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $054f71d2330da2e3$export$712718f7aec83d5({
102
+ ...$64fa3d84918910a7$export$ef03459518577ad4(props),
103
+ inputElementType,
104
+ label: label2,
105
+ validationBehavior
106
+ }, inputRef);
107
+ let inputOrTextAreaRef = useCallback((el) => {
108
+ inputRef.current = el;
109
+ if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
110
+ }, [
111
+ inputRef
112
+ ]);
113
+ let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
114
+ ...props,
115
+ values: {
116
+ isDisabled: props.isDisabled || false,
117
+ isInvalid: validation.isInvalid,
118
+ isReadOnly: props.isReadOnly || false,
119
+ isRequired: props.isRequired || false
120
+ },
121
+ defaultClassName: "react-aria-TextField"
122
+ });
123
+ let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
124
+ global: true
125
+ });
126
+ delete DOMProps.id;
127
+ return /* @__PURE__ */ React__default.createElement("div", {
128
+ ...DOMProps,
129
+ ...renderProps,
130
+ ref,
131
+ slot: props.slot || void 0,
132
+ "data-disabled": props.isDisabled || void 0,
133
+ "data-invalid": validation.isInvalid || void 0,
134
+ "data-readonly": props.isReadOnly || void 0,
135
+ "data-required": props.isRequired || void 0
136
+ }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
137
+ values: [
138
+ [
139
+ $01b77f81d0f07f68$export$75b6ee27786ba447,
140
+ {
141
+ ...labelProps,
142
+ ref: labelRef
143
+ }
144
+ ],
145
+ [
146
+ $3985021b0ad6602f$export$37fb8590cf2c088c,
147
+ {
148
+ ...inputProps,
149
+ ref: inputOrTextAreaRef
150
+ }
151
+ ],
152
+ [
153
+ $216918bed6669f72$export$2dc6166a7e65358c,
154
+ {
155
+ ...inputProps,
156
+ ref: inputOrTextAreaRef
157
+ }
158
+ ],
159
+ [
160
+ $a049562f99e7db0e$export$f9c6924e160136d1,
161
+ {
162
+ role: "presentation",
163
+ isInvalid: validation.isInvalid,
164
+ isDisabled: props.isDisabled || false
165
+ }
166
+ ],
167
+ [
168
+ $514c0188e459b4c0$export$9afb8bc826b033ea,
169
+ {
170
+ slots: {
171
+ description: descriptionProps,
172
+ errorMessage: errorMessageProps
173
+ }
174
+ }
175
+ ],
176
+ [
177
+ $ee014567cb39d3f0$export$ff05c3ac10437e03,
178
+ validation
179
+ ]
180
+ ]
181
+ }, renderProps.children));
182
+ });
15
183
  const ABORT_SIGNAL_TIMEOUT = 5e3;
16
184
  function createTimeoutSignal(timeout) {
17
185
  if (typeof AbortSignal.timeout === "function") {
@@ -395,173 +563,6 @@ const getPhoneFormatLengthValidationError = (phoneFormat, phoneFormatLengthValid
395
563
  "{digits}",
396
564
  `${phoneFormat ? phoneFormat.replace(/-/g, "").length : 0}`
397
565
  );
398
- const $8e6cc465cc68f603$export$698f465ec27e93df = /* @__PURE__ */ createContext(null);
399
- function $054f71d2330da2e3$export$712718f7aec83d5(props, ref) {
400
- let { inputElementType = "input", isDisabled = false, isRequired = false, isReadOnly = false, type = "text", validationBehavior = "aria" } = props;
401
- let [value, setValue] = $3e6197669829fe11$export$40bfa8c7b0832715(props.value, props.defaultValue || "", props.onChange);
402
- let { focusableProps } = $d1116acdf220c2da$export$4c014de7c8940b4c(props, ref);
403
- let validationState = $fd2148440a13ec26$export$fc1a364ae1f3ff10({
404
- ...props,
405
- value
406
- });
407
- let { isInvalid, validationErrors, validationDetails } = validationState.displayValidation;
408
- let { labelProps, fieldProps, descriptionProps, errorMessageProps } = $191c9b6d48a0a4e2$export$294aa081a6c6f55d({
409
- ...props,
410
- isInvalid,
411
- errorMessage: props.errorMessage || validationErrors
412
- });
413
- let domProps = $8e9d2fae0ecb9001$export$457c3d6518dd4c6f(props, {
414
- labelable: true
415
- });
416
- const inputOnlyProps = {
417
- type,
418
- pattern: props.pattern
419
- };
420
- let [initialValue] = useState(value);
421
- $3274bf1495747a7b$export$5add1d006293d136(ref, props.defaultValue ?? initialValue, setValue);
422
- $860f7da480e22816$export$b8473d3665f3a75a(props, validationState, ref);
423
- return {
424
- labelProps,
425
- inputProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(domProps, inputElementType === "input" ? inputOnlyProps : void 0, {
426
- disabled: isDisabled,
427
- readOnly: isReadOnly,
428
- required: isRequired && validationBehavior === "native",
429
- "aria-required": isRequired && validationBehavior === "aria" || void 0,
430
- "aria-invalid": isInvalid || void 0,
431
- "aria-errormessage": props["aria-errormessage"],
432
- "aria-activedescendant": props["aria-activedescendant"],
433
- "aria-autocomplete": props["aria-autocomplete"],
434
- "aria-haspopup": props["aria-haspopup"],
435
- "aria-controls": props["aria-controls"],
436
- value,
437
- onChange: (e) => setValue($23f2114a1b82827e$export$e58f029f0fbfdb29(e).value),
438
- autoComplete: props.autoComplete,
439
- autoCapitalize: props.autoCapitalize,
440
- maxLength: props.maxLength,
441
- minLength: props.minLength,
442
- name: props.name,
443
- form: props.form,
444
- placeholder: props.placeholder,
445
- inputMode: props.inputMode,
446
- autoCorrect: props.autoCorrect,
447
- spellCheck: props.spellCheck,
448
- [parseInt(React__default.version, 10) >= 17 ? "enterKeyHint" : "enterkeyhint"]: props.enterKeyHint,
449
- // Clipboard events
450
- onCopy: props.onCopy,
451
- onCut: props.onCut,
452
- onPaste: props.onPaste,
453
- // Composition events
454
- onCompositionEnd: props.onCompositionEnd,
455
- onCompositionStart: props.onCompositionStart,
456
- onCompositionUpdate: props.onCompositionUpdate,
457
- // Selection events
458
- onSelect: props.onSelect,
459
- // Input events
460
- onBeforeInput: props.onBeforeInput,
461
- onInput: props.onInput,
462
- ...focusableProps,
463
- ...fieldProps
464
- }),
465
- descriptionProps,
466
- errorMessageProps,
467
- isInvalid,
468
- validationErrors,
469
- validationDetails
470
- };
471
- }
472
- const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
473
- const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
474
- const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
475
- [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
476
- let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
477
- var _props_validationBehavior, _ref;
478
- let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
479
- let inputRef = useRef(null);
480
- [props, inputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, inputRef, $8e6cc465cc68f603$export$698f465ec27e93df);
481
- let [labelRef, label2] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
482
- let [inputElementType, setInputElementType] = useState("input");
483
- let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $054f71d2330da2e3$export$712718f7aec83d5({
484
- ...$64fa3d84918910a7$export$ef03459518577ad4(props),
485
- inputElementType,
486
- label: label2,
487
- validationBehavior
488
- }, inputRef);
489
- let inputOrTextAreaRef = useCallback((el) => {
490
- inputRef.current = el;
491
- if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
492
- }, [
493
- inputRef
494
- ]);
495
- let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
496
- ...props,
497
- values: {
498
- isDisabled: props.isDisabled || false,
499
- isInvalid: validation.isInvalid,
500
- isReadOnly: props.isReadOnly || false,
501
- isRequired: props.isRequired || false
502
- },
503
- defaultClassName: "react-aria-TextField"
504
- });
505
- let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, {
506
- global: true
507
- });
508
- delete DOMProps.id;
509
- return /* @__PURE__ */ React__default.createElement("div", {
510
- ...DOMProps,
511
- ...renderProps,
512
- ref,
513
- slot: props.slot || void 0,
514
- "data-disabled": props.isDisabled || void 0,
515
- "data-invalid": validation.isInvalid || void 0,
516
- "data-readonly": props.isReadOnly || void 0,
517
- "data-required": props.isRequired || void 0
518
- }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
519
- values: [
520
- [
521
- $01b77f81d0f07f68$export$75b6ee27786ba447,
522
- {
523
- ...labelProps,
524
- ref: labelRef
525
- }
526
- ],
527
- [
528
- $3985021b0ad6602f$export$37fb8590cf2c088c,
529
- {
530
- ...inputProps,
531
- ref: inputOrTextAreaRef
532
- }
533
- ],
534
- [
535
- $216918bed6669f72$export$2dc6166a7e65358c,
536
- {
537
- ...inputProps,
538
- ref: inputOrTextAreaRef
539
- }
540
- ],
541
- [
542
- $a049562f99e7db0e$export$f9c6924e160136d1,
543
- {
544
- role: "presentation",
545
- isInvalid: validation.isInvalid,
546
- isDisabled: props.isDisabled || false
547
- }
548
- ],
549
- [
550
- $514c0188e459b4c0$export$9afb8bc826b033ea,
551
- {
552
- slots: {
553
- description: descriptionProps,
554
- errorMessage: errorMessageProps
555
- }
556
- }
557
- ],
558
- [
559
- $ee014567cb39d3f0$export$ff05c3ac10437e03,
560
- validation
561
- ]
562
- ]
563
- }, renderProps.children));
564
- });
565
566
  const useSdkState = (componentId, key, defaultValue) => {
566
567
  const $sig = useService(SdkStateDefinition).for(componentId).getSignal(key, defaultValue);
567
568
  return [$sig.get(), (value) => $sig.set(value)];
@@ -1,5 +1,5 @@
1
1
  import { I as INTERACTIONS, D as DATA, C as CSS_PROPERTIES, b as DISPLAY_GROUPS, L as LAYOUT, A as Archetype } from "../chunks/chunk-JPMZBG44.js";
2
- import { D as DisplayNames, s as selectors } from "../chunks/constants2.js";
2
+ import { D as DisplayNames, s as selectors } from "../chunks/constants3.js";
3
3
  import { g as getSelector } from "../chunks/manifest.js";
4
4
  const manifest = {
5
5
  id: "b8f7e3d2-4a5c-4e8f-9b2d-1c3e5f7a9b4d",
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ import { TimePickerProps } from './TimePicker.types';
3
+ export default function TimePicker(props: TimePickerProps): React.JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { A11y, Direction } from '@wix/editor-react-types';
2
+ import { SdkFunctionChangeableProps, SdkFunctionFocusableProps } from '../../../utils/functions/sdkFunctionCallbackProps';
3
+ import { TranslationKeys } from './constants';
4
+ /** A viewer-facing translatable string key. */
5
+ export type TranslationKey = keyof typeof TranslationKeys;
6
+ /** Smallest editable time unit (React Aria `granularity`). */
7
+ export type TimePickerGranularity = 'hour' | 'minute' | 'second';
8
+ export type TimePickerProps = Omit<SdkFunctionChangeableProps, 'onChange'> & SdkFunctionFocusableProps & {
9
+ /** Fires with the selected ISO time string (`HH:MM[:SS]`), or `''` when cleared. */
10
+ onChange?: (value: string) => void;
11
+ /** DOM `id` on the root `.timePicker` wrapper. */
12
+ id: string;
13
+ /** Appended to the root `.timePicker`. Use this for CSS-variable and per-element overrides. */
14
+ className: string;
15
+ /**
16
+ * The selected time as an ISO 24h `HH:MM[:SS]` string. The empty string
17
+ * means no time is selected.
18
+ */
19
+ value: string;
20
+ /** Writing direction applied to the root. */
21
+ direction?: Direction;
22
+ /** Accessibility attributes. `ariaLabel` labels the time picker for assistive tech. */
23
+ a11y?: A11y;
24
+ /** Platform-provided props. */
25
+ wix?: {
26
+ /** Spread on the preset wrapper. */
27
+ presetsWrapperProps?: Record<string, unknown>;
28
+ };
29
+ };
@@ -0,0 +1,2 @@
1
+ import { default as TimePicker } from './TimePicker';
2
+ export default TimePicker;
@@ -0,0 +1,146 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { c as clsx } from "../chunks/clsx.js";
3
+ import { $ as $58246871e4652552$export$c9698ec7f05a07e1, a as $40825cdb76e74f70$export$7edc06cf1783b30f, b as $40825cdb76e74f70$export$336ab7fa954c4b5f, c as $40825cdb76e74f70$export$5eaee2322dd727eb } from "../chunks/DateField.js";
4
+ import { $ as $2eb8e6d23f3d0cb0$export$a54013f0d02a8f82 } from "../chunks/I18nProvider.js";
5
+ import { useService } from "@wix/services-manager-react";
6
+ import { E as EnvironmentDefinition } from "../chunks/index2.js";
7
+ import { T as TranslationsDefinition } from "../chunks/index5.js";
8
+ import { a as getDataAttributes } from "../chunks/dataUtils.js";
9
+ import { d as directionStyles } from "../chunks/direction.module.js";
10
+ import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
11
+ import { E as EMPTY_VALUE, T as TestIds, s as selectors, a as TRANSLATIONS_NAMESPACE, D as DefaultTranslations, b as TranslationKeys } from "../chunks/constants2.js";
12
+ import { useState } from "react";
13
+ import { $ as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4 } from "../chunks/Group.js";
14
+ const getTranslation = (translate, key, translationKeys, defaultTranslations) => {
15
+ const translationKey = translationKeys[key];
16
+ const translated = translate(translationKey);
17
+ return translated && translated !== translationKey ? translated : defaultTranslations[key];
18
+ };
19
+ const timePicker = "timePicker__j78My";
20
+ const root = "root__dzkbY";
21
+ const group = "group__6HZy7";
22
+ const field = "field__mnQwh";
23
+ const segment = "segment__OtazP";
24
+ const styles = {
25
+ timePicker,
26
+ root,
27
+ group,
28
+ field,
29
+ segment
30
+ };
31
+ const readString = (prop) => typeof prop === "string" ? prop : EMPTY_VALUE;
32
+ const toTimeValue = (iso) => {
33
+ if (!iso) {
34
+ return null;
35
+ }
36
+ try {
37
+ return $58246871e4652552$export$c9698ec7f05a07e1(iso);
38
+ } catch {
39
+ return null;
40
+ }
41
+ };
42
+ const pad = (n) => String(n).padStart(2, "0");
43
+ const toIso = (time, granularity) => {
44
+ if (!time) {
45
+ return EMPTY_VALUE;
46
+ }
47
+ const hoursAndMinutes = `${pad(time.hour)}:${pad(time.minute)}`;
48
+ return granularity === "second" ? `${hoursAndMinutes}:${pad(time.second)}` : hoursAndMinutes;
49
+ };
50
+ const useTimePickerValue = (params) => {
51
+ const { value, onChange } = params;
52
+ const valueStr = readString(value);
53
+ const [timeValue, setTimeValue] = useState(
54
+ () => toTimeValue(valueStr)
55
+ );
56
+ const [prevValueStr, setPrevValueStr] = useState(valueStr);
57
+ if (prevValueStr !== valueStr) {
58
+ setPrevValueStr(valueStr);
59
+ setTimeValue(toTimeValue(valueStr));
60
+ }
61
+ const handleChange = (next) => {
62
+ setTimeValue(next);
63
+ onChange(toIso(next, "minute"));
64
+ };
65
+ return {
66
+ timeValue,
67
+ handleChange,
68
+ hasValue: Boolean(valueStr)
69
+ };
70
+ };
71
+ const renderSegments = (segment2) => /* @__PURE__ */ jsx($40825cdb76e74f70$export$336ab7fa954c4b5f, { segment: segment2, className: styles.segment });
72
+ const TimePickerField = ({
73
+ clearButton
74
+ }) => /* @__PURE__ */ jsxs(
75
+ $a049562f99e7db0e$export$eb2fcfdbd7ba97d4,
76
+ {
77
+ className: clsx(styles.group, selectors.group),
78
+ "data-testid": TestIds.group,
79
+ children: [
80
+ /* @__PURE__ */ jsx($40825cdb76e74f70$export$7edc06cf1783b30f, { className: styles.field, "data-testid": TestIds.field, children: renderSegments }),
81
+ clearButton
82
+ ]
83
+ }
84
+ );
85
+ const noop = () => {
86
+ };
87
+ function TimePicker(props) {
88
+ const environmentService = useService(EnvironmentDefinition);
89
+ const { translate } = useService(TranslationsDefinition);
90
+ const translateByKey = translate(TRANSLATIONS_NAMESPACE);
91
+ const t = (key) => getTranslation(translateByKey, key, TranslationKeys, DefaultTranslations);
92
+ const {
93
+ id,
94
+ className = "",
95
+ direction,
96
+ a11y,
97
+ onChange = noop,
98
+ onFocus = noop,
99
+ onBlur = noop,
100
+ wix
101
+ } = props;
102
+ const { timeValue, handleChange } = useTimePickerValue({
103
+ value: props.value,
104
+ onChange
105
+ });
106
+ const locale = environmentService.language || "en-US";
107
+ const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || t("ariaLabel");
108
+ return /* @__PURE__ */ jsx(
109
+ "div",
110
+ {
111
+ className: presetWrapperStyles.presetWrapper,
112
+ ...(wix == null ? void 0 : wix.presetsWrapperProps) || {},
113
+ children: /* @__PURE__ */ jsx(
114
+ "div",
115
+ {
116
+ id,
117
+ ...getDataAttributes(props),
118
+ className: clsx(
119
+ className,
120
+ styles.root,
121
+ selectors.root,
122
+ !direction && directionStyles.fallbackDirection
123
+ ),
124
+ dir: direction || void 0,
125
+ lang: environmentService.language,
126
+ "data-testid": TestIds.root,
127
+ children: /* @__PURE__ */ jsx($2eb8e6d23f3d0cb0$export$a54013f0d02a8f82, { locale, children: /* @__PURE__ */ jsx(
128
+ $40825cdb76e74f70$export$5eaee2322dd727eb,
129
+ {
130
+ className: styles.timePicker,
131
+ value: timeValue,
132
+ onChange: handleChange,
133
+ "aria-label": ariaLabel,
134
+ onFocus,
135
+ onBlur,
136
+ children: /* @__PURE__ */ jsx(TimePickerField, { clearButton: null })
137
+ }
138
+ ) })
139
+ }
140
+ )
141
+ }
142
+ );
143
+ }
144
+ export {
145
+ TimePicker as default
146
+ };
@@ -0,0 +1,2 @@
1
+ import { default as TimePicker } from './TimePicker';
2
+ export default TimePicker;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ export declare const TimePickerField: ({ clearButton, }: {
3
+ clearButton: React.ReactNode;
4
+ }) => React.JSX.Element;
@@ -0,0 +1,32 @@
1
+ export declare const DisplayNames: {
2
+ root: {
3
+ elementDisplayName: string;
4
+ data: {
5
+ value: string;
6
+ };
7
+ elements: {
8
+ timeInput: string;
9
+ };
10
+ cssCustomProperties: {};
11
+ };
12
+ };
13
+ /** The value that represents "no time selected". */
14
+ export declare const EMPTY_VALUE = "";
15
+ export declare const TRANSLATIONS_NAMESPACE = "timePicker";
16
+ /** Viewer-facing string keys (translated via the Translations service). */
17
+ export declare const TranslationKeys: {
18
+ readonly ariaLabel: "timePicker_aria_label";
19
+ };
20
+ /** English fallbacks used when a translation is missing. */
21
+ export declare const DefaultTranslations: {
22
+ readonly ariaLabel: "Time picker";
23
+ };
24
+ export declare const TestIds: {
25
+ readonly root: "timepicker-root";
26
+ readonly group: "timepicker-group";
27
+ readonly field: "timepicker-field";
28
+ };
29
+ export declare const selectors: {
30
+ readonly root: "timePicker";
31
+ readonly group: "timePicker__group";
32
+ };
@@ -0,0 +1,64 @@
1
+ .timePicker__j78My {
2
+ --field-background-color: var(--wst-primary-background-color, #ffffff);
3
+ --borderColor: var(--wst-system-line-1-color, #dfe5eb);
4
+ --borderWidth: 1px;
5
+ --borderStartStartRadius: 6px;
6
+ --borderStartEndRadius: 6px;
7
+ --borderEndStartRadius: 6px;
8
+ --borderEndEndRadius: 6px;
9
+ }
10
+ .root__dzkbY {
11
+ box-sizing: border-box;
12
+ display: inline-flex;
13
+ flex-direction: column;
14
+ min-width: 120px;
15
+ max-width: 100%;
16
+ font: var(--font, normal normal normal 16px/1.5em madefor-text, helveticaneuew01-45ligh, helveticaneuew02-45ligh, helveticaneuew10-45ligh, sans-serif);
17
+ color: var(--color, #2b2b2b);
18
+ text-align: start;
19
+ }
20
+ .timePicker__j78My {
21
+ display: flex;
22
+ flex-direction: column;
23
+ }
24
+ .group__6HZy7 {
25
+ box-sizing: border-box;
26
+ display: flex;
27
+ align-items: center;
28
+ gap: 8px;
29
+ width: 100%;
30
+ padding: 8px 12px;
31
+ font: inherit;
32
+ color: inherit;
33
+ background: var(--field-background-color);
34
+ border-style: solid;
35
+ border-width: var(--borderWidth);
36
+ border-color: var(--borderColor);
37
+ border-start-start-radius: var(--borderStartStartRadius);
38
+ border-start-end-radius: var(--borderStartEndRadius);
39
+ border-end-start-radius: var(--borderEndStartRadius);
40
+ border-end-end-radius: var(--borderEndEndRadius);
41
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
42
+ }
43
+ .field__mnQwh {
44
+ display: inline-flex;
45
+ flex: 1;
46
+ min-width: 0;
47
+ gap: 1px;
48
+ font: inherit;
49
+ color: inherit;
50
+ white-space: nowrap;
51
+ }
52
+ .segment__OtazP {
53
+ padding: 0 2px;
54
+ border-radius: 3px;
55
+ font-variant-numeric: tabular-nums;
56
+ text-align: center;
57
+ outline: none;
58
+ }
59
+ .fallbackDirection__HeRgn:not([dir]) {
60
+ direction: var(--wix-opt-in-direction);
61
+ }
62
+ .presetWrapper__J1yzj {
63
+ display: contents;
64
+ }
@@ -0,0 +1,10 @@
1
+ import { TimeValue } from 'react-aria-components';
2
+ import { TimePickerProps } from '../TimePicker.types';
3
+ export declare const useTimePickerValue: (params: {
4
+ value: TimePickerProps["value"];
5
+ onChange: NonNullable<TimePickerProps["onChange"]>;
6
+ }) => {
7
+ timeValue: TimeValue | null;
8
+ handleChange: (next: TimeValue | null) => void;
9
+ hasValue: boolean;
10
+ };
@@ -0,0 +1,2 @@
1
+ export * from './component';
2
+ export { default, default as TimePicker } from './component';