@wix/editor-react-components 1.2775.0 → 1.2776.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 (37) hide show
  1. package/dist/site/components/AudioPlayer/component.js +5 -4
  2. package/dist/site/components/Breadcrumbs/component.js +1 -1
  3. package/dist/site/components/Button/component.js +1 -1
  4. package/dist/site/components/Checkbox/component.js +1 -1
  5. package/dist/site/components/CheckboxGroup/component.js +1 -1
  6. package/dist/site/components/CollapsibleText/component.js +1 -1
  7. package/dist/site/components/DatePicker/component.js +622 -7
  8. package/dist/site/components/Lottie/component.js +1 -1
  9. package/dist/site/components/Menu/component.js +1 -1
  10. package/dist/site/components/RadioButtons/component.js +1 -1
  11. package/dist/site/components/Slideshow/component.js +1 -1
  12. package/dist/site/components/TextBox/component.js +1 -1
  13. package/dist/site/components/TextInput/component.js +3 -2
  14. package/dist/site/components/TextMarquee/component.js +6 -6
  15. package/dist/site/components/TimePicker/TimePicker.types.d.ts +14 -39
  16. package/dist/site/components/TimePicker/component.js +81 -547
  17. package/dist/site/components/TimePicker/component.preview.d.ts +7 -2
  18. package/dist/site/components/TimePicker/components/TimePickerField.d.ts +1 -2
  19. package/dist/site/components/TimePicker/constants.d.ts +35 -68
  20. package/dist/site/components/TimePicker/css.css +17 -169
  21. package/dist/site/components/TimePicker/hooks/useTimePickerValue.d.ts +3 -5
  22. package/dist/site/components/TimePicker/manifest.js +246 -152
  23. package/dist/site/components/TimePicker/timePickerUtils.d.ts +8 -8
  24. package/dist/site/components/chunks/Button.js +466 -1055
  25. package/dist/site/components/chunks/Button2.js +284 -471
  26. package/dist/site/components/chunks/DateField.js +51 -673
  27. package/dist/site/components/chunks/Group.js +46 -160
  28. package/dist/site/components/chunks/I18nProvider.js +1 -1
  29. package/dist/site/components/chunks/Input.js +2 -2
  30. package/dist/site/components/chunks/constants2.js +40 -70
  31. package/dist/site/components/chunks/filterDOMProps.js +13 -13
  32. package/dist/site/components/chunks/useFocusable.js +70 -0
  33. package/dist/site/components/chunks/usePress.js +825 -0
  34. package/package.json +2 -2
  35. package/dist/site/components/TimePicker/hooks/useTimeConstraints.d.ts +0 -8
  36. package/dist/site/components/chunks/VisuallyHidden.js +0 -47
  37. package/dist/site/components/chunks/{RequiredIndicator.js → useValidatedField.js} +19 -19
@@ -1,2 +1,7 @@
1
- import { default as TimePicker } from './TimePicker';
2
- export default TimePicker;
1
+ import { default as React } from 'react';
2
+ import { TimePickerProps } from './TimePicker.types';
3
+ type TimePickerPreviewProps = TimePickerProps & {
4
+ previewError?: boolean;
5
+ };
6
+ export default function TimePickerPreview({ previewError, ...props }: TimePickerPreviewProps): React.JSX.Element;
7
+ export {};
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { TimePickerElementProps } from '../TimePicker.types';
3
- export declare const TimePickerField: ({ clearButton, elementProps, }: {
4
- clearButton: React.ReactNode;
3
+ export declare const TimePickerField: ({ elementProps, }: {
5
4
  elementProps?: TimePickerElementProps;
6
5
  }) => React.JSX.Element;
@@ -1,76 +1,48 @@
1
+ export declare const TEXT_PROP_STATIC_VALUE_MAX_LENGTH = 400;
1
2
  export declare const DisplayNames: {
2
3
  root: {
3
4
  elementDisplayName: string;
4
5
  data: {
5
6
  value: string;
6
- defaultValue: string;
7
- granularity: {
8
- displayName: string;
9
- options: {
10
- hour: string;
11
- minute: string;
12
- second: string;
13
- };
14
- };
15
- hourCycle: {
16
- displayName: string;
17
- options: {
18
- auto: string;
19
- h12: string;
20
- h24: string;
21
- };
22
- };
23
- shouldForceLeadingZeros: string;
24
- tooltip: string;
7
+ onValueChange: string;
25
8
  label: string;
26
- description: string;
27
- minTime: string;
28
- maxTime: string;
29
- required: string;
9
+ helperText: string;
10
+ errorMessage: string;
30
11
  readOnly: string;
31
12
  disabled: string;
32
- clearable: string;
13
+ };
14
+ parameters: {
15
+ value: string;
33
16
  };
34
17
  designStates: {
35
18
  hover: string;
36
19
  focus: string;
20
+ error: string;
37
21
  disabled: string;
38
22
  };
39
23
  elements: {
40
24
  label: string;
41
25
  timeInput: string;
42
- description: string;
26
+ helperText: string;
27
+ errorMessage: string;
43
28
  segment: string;
44
29
  };
45
- cssCustomProperties: {
46
- labelSpacing: string;
30
+ presets: {
31
+ baseTimePicker: string;
47
32
  };
48
33
  };
49
34
  };
50
- export declare const defaultValues: {
51
- readonly granularity: "minute";
52
- readonly hourCycle: "auto";
53
- readonly shouldForceLeadingZeros: false;
54
- readonly tooltip: "";
55
- readonly label: "";
56
- readonly description: "";
57
- readonly required: false;
58
- readonly readOnly: false;
59
- readonly disabled: false;
60
- readonly clearable: false;
35
+ export declare const Descriptions: {
36
+ component: string;
37
+ root: {
38
+ data: {
39
+ value: string;
40
+ helperText: string;
41
+ errorMessage: string;
42
+ };
43
+ };
61
44
  };
62
- /** React Aria `granularity`: the smallest editable time unit. */
63
- export declare const enum GranularityValues {
64
- Hour = "hour",
65
- Minute = "minute",
66
- Second = "second"
67
- }
68
- /** `auto` defers to the locale; `12`/`24` force the hour cycle. */
69
- export declare const enum HourCycleValues {
70
- Auto = "auto",
71
- H12 = "12",
72
- H24 = "24"
73
- }
45
+ export declare const PREVIEW_ERROR_MESSAGE = "Error message";
74
46
  export declare const DesignStates: {
75
47
  timeInput: {
76
48
  hover: {
@@ -81,9 +53,16 @@ export declare const DesignStates: {
81
53
  displayName: string;
82
54
  className: string;
83
55
  };
56
+ error: {
57
+ displayName: string;
58
+ className: string;
59
+ };
84
60
  disabled: {
85
61
  displayName: string;
86
62
  className: string;
63
+ props: {
64
+ disabled: boolean;
65
+ };
87
66
  };
88
67
  };
89
68
  segment: {
@@ -93,36 +72,24 @@ export declare const DesignStates: {
93
72
  };
94
73
  };
95
74
  };
96
- /** The value that represents "no time selected". */
97
- export declare const EMPTY_VALUE = "";
98
- export declare const TRANSLATIONS_NAMESPACE = "timePicker";
99
- /** Viewer-facing string keys (translated via the Translations service). */
100
- export declare const TranslationKeys: {
101
- readonly ariaLabel: "timePicker_aria_label";
102
- readonly clearButton: "timePicker_clear_button";
103
- };
104
- /** English fallbacks used when a translation is missing. */
105
- export declare const DefaultTranslations: {
106
- readonly ariaLabel: "Time picker";
107
- readonly clearButton: "Clear";
75
+ export declare const AriaLabels: {
76
+ readonly root: {
77
+ readonly key: "TimePicker_AriaLabel";
78
+ readonly default: "Time picker";
79
+ };
108
80
  };
81
+ export declare const DEFAULT_LOCALE = "en-US";
109
82
  export declare const TestIds: {
110
83
  readonly root: "timepicker-root";
111
84
  readonly group: "timepicker-group";
112
85
  readonly field: "timepicker-field";
113
- readonly clearButton: "timepicker-clear-button";
114
- readonly tooltipButton: "timepicker-tooltip-button";
115
86
  readonly errorMessage: "timepicker-error-message";
116
- readonly requiredIndicator: "timepicker-required-indicator";
117
87
  };
118
88
  export declare const selectors: {
119
89
  readonly root: "timePicker";
120
90
  readonly label: "timePicker__label";
121
- readonly requiredIndicator: "timePicker__required-indicator";
122
91
  readonly group: "timePicker__group";
123
92
  readonly description: "timePicker__description";
124
93
  readonly segment: "timePicker__segment";
125
94
  readonly errorMessage: "timePicker__error-message";
126
95
  };
127
- /** Intrinsic `required` failure message (pre-resolved; i18n is a shared TODO). */
128
- export declare const VALUE_MISSING_MESSAGE = "This field is required";
@@ -1,167 +1,51 @@
1
- /* :global() required: this file is @import'ed into the .module.scss; without it the vars scope to the module hash and shadow the editor's root overrides. */
2
- .timePicker {
3
- --labelFont: var(
4
- --wst-paragraph-2-font,
5
- normal normal normal 14px/1.4em madefor-text,
6
- helveticaneuew01-45ligh,
7
- helveticaneuew02-45ligh,
8
- helveticaneuew10-45ligh,
9
- sans-serif
10
- );
11
- --label-text-color: var(--wst-paragraph-2-color, #2b2b2b);
12
-
13
- --borderColor: var(--wst-system-line-1-color, #dfe5eb);
14
-
15
- --label-spacing: 6px;
16
-
17
- --accent-color: var(--wst-links-and-actions-color, #116dff);
18
-
19
- --tooltip-font: var(
20
- --wst-paragraph-2-font,
21
- normal normal normal 12px/1.4em madefor-text,
22
- helveticaneuew01-45ligh,
23
- helveticaneuew02-45ligh,
24
- helveticaneuew10-45ligh,
25
- sans-serif
26
- );
27
- --tooltip-text-color: var(--wst-primary-background-color, #ffffff);
28
- --tooltip-background-color: var(--wst-paragraph-2-color, #2b2b2b);
29
-
30
- --descriptionFont: var(
31
- --wst-paragraph-3-font,
32
- normal normal normal 12px/1.4em madefor-text,
33
- helveticaneuew01-45ligh,
34
- helveticaneuew02-45ligh,
35
- helveticaneuew10-45ligh,
36
- sans-serif
37
- );
38
- --description-text-color: var(--wst-paragraph-2-color, #6b6b6b);
39
- }
40
1
  .root__dzkbY {
41
2
  box-sizing: border-box;
42
3
  display: inline-flex;
43
4
  flex-direction: column;
44
- min-width: 120px;
5
+ min-width: min-content !important;
45
6
  max-width: 100%;
46
- font: var(--font, normal normal normal 16px/1.5em madefor-text, helveticaneuew01-45ligh, helveticaneuew02-45ligh, helveticaneuew10-45ligh, sans-serif);
47
- color: var(--color, #2b2b2b);
48
- text-align: start;
49
7
  }
8
+
50
9
  .timePicker__j78My {
51
10
  display: flex;
52
11
  flex-direction: column;
53
- row-gap: var(--label-spacing, 6px);
54
- }
55
- .labelRow__qoC8g {
56
- display: flex;
57
- align-items: flex-start;
58
- gap: 6px;
59
- margin: 0;
60
12
  min-width: 0;
61
13
  }
62
- .label__THO5j {
63
- margin: 0;
14
+
15
+ .label__THO5j,
16
+ .description__ePprf,
17
+ .errorMessage__zxbOJ {
18
+ display: -webkit-box;
19
+ -webkit-box-orient: vertical;
20
+ -webkit-line-clamp: 2;
21
+ line-clamp: 2;
22
+ overflow: hidden;
64
23
  min-width: 0;
65
24
  max-width: 100%;
66
- font: var(--labelFont);
67
- color: var(--label-text-color);
68
25
  overflow-wrap: break-word;
69
26
  word-break: break-word;
70
27
  }
71
- .tooltipButton__ISWIR {
72
- flex: none;
73
- box-sizing: border-box;
74
- display: inline-flex;
75
- align-items: center;
76
- justify-content: center;
77
- width: 16px;
78
- height: 16px;
79
- margin: 0;
80
- padding: 0;
81
- border: none;
82
- background: transparent;
83
- color: var(--label-text-color);
84
- cursor: pointer;
85
- opacity: 0.65;
86
- }
87
- .tooltipButton__ISWIR[data-hovered], .tooltipButton__ISWIR[data-focus-visible] {
88
- opacity: 1;
89
- }
90
- .tooltipButton__ISWIR[data-focus-visible] {
91
- border-radius: 50%;
92
- box-shadow: 0 0 0 2px var(--accent-color);
93
- }
94
- .tooltipButton__ISWIR svg {
95
- width: 16px;
96
- height: 16px;
97
- }
98
- .tooltip__FTZhM {
99
- max-width: 220px;
100
- padding: 6px 10px;
101
- font: var(--tooltip-font);
102
- color: var(--tooltip-text-color);
103
- background: var(--tooltip-background-color);
104
- border-radius: 6px;
105
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
106
- }
28
+
107
29
  .group__6HZy7 {
108
30
  box-sizing: border-box;
109
- display: flex;
110
- align-items: center;
31
+ display: block;
111
32
  width: 100%;
112
- column-gap: 8px;
113
- padding-top: 8px;
114
- padding-bottom: 8px;
115
- padding-inline-start: 12px;
116
- padding-inline-end: 12px;
117
- font: inherit;
118
- color: inherit;
119
- background: var(--wst-primary-background-color, #ffffff);
120
- box-shadow: none;
121
- border-top: 1px solid var(--borderColor);
122
- border-bottom: 1px solid var(--borderColor);
123
- border-inline-start: 1px solid var(--borderColor);
124
- border-inline-end: 1px solid var(--borderColor);
125
- border-start-start-radius: 6px;
126
- border-start-end-radius: 6px;
127
- border-end-start-radius: 6px;
128
- border-end-end-radius: 6px;
129
33
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
130
34
  }
131
- .group__6HZy7:focus-within, .group__6HZy7.timePicker__group--focus {
132
- border-color: var(--accent-color);
133
- box-shadow: 0 0 0 1px var(--accent-color);
134
- }
135
- .group__6HZy7:hover:not(:focus-within), .group__6HZy7.timePicker__group--hover {
136
- border-color: color-mix(in srgb, var(--accent-color) 45%, transparent);
137
- }
138
- .group__6HZy7[data-disabled], .group__6HZy7.timePicker__group--disabled {
139
- opacity: 0.55;
140
- cursor: not-allowed;
141
- }
35
+
142
36
  .field__mnQwh {
143
37
  display: inline-flex;
144
- flex: 1;
145
38
  min-width: 0;
146
39
  gap: 1px;
147
40
  font: inherit;
148
41
  color: inherit;
42
+ text-decoration-line: inherit;
149
43
  white-space: nowrap;
150
44
  }
151
- .description__ePprf {
152
- font: var(--descriptionFont);
153
- color: var(--description-text-color);
154
- }
155
- .errorMessage__zxbOJ {
156
- margin-top: 4px;
157
- font-size: 12px;
158
- color: var(--errorColor, var(--wst-error-color, #e21c21));
159
- }
45
+
160
46
  .segment__OtazP {
161
- padding: 0 2px;
162
- border-radius: 3px;
163
47
  font-variant-numeric: tabular-nums;
164
- text-align: center;
48
+ text-decoration-line: inherit;
165
49
  outline: none;
166
50
  }
167
51
  .segment__OtazP[data-type=literal] {
@@ -171,45 +55,9 @@
171
55
  .segment__OtazP[data-placeholder] {
172
56
  color: color-mix(in srgb, currentColor 45%, transparent);
173
57
  }
174
- .segment__OtazP[data-focused], .segment__OtazP.timePicker__segment--focus {
175
- background: var(--wst-links-and-actions-color, #116dff);
176
- color: var(--wst-primary-background-color, #ffffff);
177
- }
178
- .clearButton__Bto7s {
179
- flex: none;
180
- box-sizing: border-box;
181
- display: inline-flex;
182
- align-items: center;
183
- justify-content: center;
184
- width: 24px;
185
- height: 24px;
186
- margin: 0;
187
- padding: 0;
188
- border: none;
189
- border-radius: 6px;
190
- background: transparent;
191
- color: inherit;
192
- cursor: pointer;
193
- transition: background 0.15s ease;
194
- }
195
- .clearButton__Bto7s:hover {
196
- background: color-mix(in srgb, currentColor 12%, transparent);
197
- }
198
- .clearIcon__x11eI {
199
- width: 18px;
200
- height: 18px;
201
- }
202
58
  .fallbackDirection__HeRgn:not([dir]) {
203
59
  direction: var(--wix-opt-in-direction);
204
60
  }
205
61
  .presetWrapper__J1yzj {
206
62
  display: contents;
207
- }
208
- .requiredIndicator__j5mIH {
209
- display: inline-block;
210
- width: 0.6em;
211
- height: 0.6em;
212
- margin-inline-start: 0.2em;
213
- vertical-align: super;
214
- color: inherit;
215
63
  }
@@ -1,11 +1,9 @@
1
1
  import { TimeValue } from 'react-aria-components';
2
- import { TimePickerGranularity, TimePickerProps } from '../TimePicker.types';
2
+ import { TimePickerProps } from '../TimePicker.types';
3
3
  export declare const useTimePickerValue: (params: {
4
- value: TimePickerProps["value"] | undefined;
5
- onChange: NonNullable<TimePickerProps["onChange"]>;
6
- granularity: TimePickerGranularity;
4
+ value: TimePickerProps["value"];
5
+ onValueChange: NonNullable<TimePickerProps["onValueChange"]>;
7
6
  }) => {
8
7
  timeValue: TimeValue | null;
9
8
  handleChange: (next: TimeValue | null) => void;
10
- hasValue: boolean;
11
9
  };