@wix/editor-react-components 1.2836.0 → 1.2838.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 (36) hide show
  1. package/dist/site/components/AccordionComponent/manifest.js +1 -1
  2. package/dist/site/components/AudioPlayer/manifest.js +1 -1
  3. package/dist/site/components/Breadcrumbs/manifest.js +1 -1
  4. package/dist/site/components/Button/manifest.js +1 -1
  5. package/dist/site/components/Checkbox/Checkbox.types.d.ts +11 -11
  6. package/dist/site/components/Checkbox/component.js +67 -119
  7. package/dist/site/components/Checkbox/constants.d.ts +21 -24
  8. package/dist/site/components/Checkbox/css.css +48 -164
  9. package/dist/site/components/Checkbox/manifest.js +178 -89
  10. package/dist/site/components/CheckboxGroup/manifest.js +1 -1
  11. package/dist/site/components/CollapsibleText/manifest.js +1 -1
  12. package/dist/site/components/GoogleMap/manifest.js +1 -1
  13. package/dist/site/components/HTMLComponent/manifest.js +1 -1
  14. package/dist/site/components/LinkBar/manifest.js +1 -1
  15. package/dist/site/components/Lottie/manifest.js +1 -1
  16. package/dist/site/components/Menu/manifest.js +1 -1
  17. package/dist/site/components/MultiStateBox/manifest.js +1 -1
  18. package/dist/site/components/RadioButtons/manifest.js +1 -1
  19. package/dist/site/components/ShareButtons/manifest.js +1 -1
  20. package/dist/site/components/Slideshow/manifest.js +1 -1
  21. package/dist/site/components/Tabs/manifest.js +1 -1
  22. package/dist/site/components/TestComp/manifest.js +1 -1
  23. package/dist/site/components/TextBox/manifest.js +1 -1
  24. package/dist/site/components/TextInput/manifest.js +2 -16
  25. package/dist/site/components/VideoScrub/constants.d.ts +9 -4
  26. package/dist/site/components/VideoScrub/css.css +1 -0
  27. package/dist/site/components/VideoScrub/manifest.js +17 -14
  28. package/dist/site/components/VideoScrub/panels/videoScaling/extension.d.ts +4 -0
  29. package/dist/site/components/VideoScrub/panels/videoScaling/panel.d.ts +3 -0
  30. package/dist/site/components/VideoScrub/panels/videoScaling/translations/consts.d.ts +7 -0
  31. package/dist/site/components/chunks/constants40.js +29 -31
  32. package/dist/site/components/chunks/manifestSdkMixins.js +25 -7
  33. package/dist/site/components/chunks/types.js +3 -6
  34. package/dist/site/components/extensions.js +14 -0
  35. package/package.json +2 -2
  36. package/dist/site/components/Checkbox/component.preview.d.ts +0 -4
@@ -1,6 +1,6 @@
1
1
  import { C as CSS_PROPERTIES, b as DISPLAY_GROUPS, D as DATA, L as LAYOUT, c as ContainerType, a as ACTIONS, E as ELEMENTS, N as NativeStateType, A as Archetype } from "../chunks/chunk-LDITHLYN.js";
2
2
  import { b as DISPLAY_NAMES, c as accordionManifestDefaults, C as CONTAINER_INITIAL_HEIGHT, D as DesignStates } from "../chunks/constants44.js";
3
- import { a as manifestFocusable, c as manifestMouseHover, d as manifestClickable } from "../chunks/manifestSdkMixins.js";
3
+ import { b as manifestFocusable, d as manifestMouseHover, e as manifestClickable } from "../chunks/manifestSdkMixins.js";
4
4
  const options = [
5
5
  {
6
6
  value: "Start",
@@ -1,5 +1,5 @@
1
1
  import { b as DISPLAY_GROUPS, N as NativeStateType, C as CSS_PROPERTIES, E as ELEMENTS, D as DATA, I as INTERACTIONS, L as LAYOUT, A as Archetype } from "../chunks/chunk-LDITHLYN.js";
2
- import { c as manifestMouseHover, f as manifestMediaProgress, e as manifestPlayable } from "../chunks/manifestSdkMixins.js";
2
+ import { d as manifestMouseHover, g as manifestMediaProgress, f as manifestPlayable } from "../chunks/manifestSdkMixins.js";
3
3
  import { D as DisplayNames, a as DesignStates, s as selectors, b as borderDefaultValue } from "../chunks/constants43.js";
4
4
  import manifest$1 from "../Image3/manifest.js";
5
5
  const controlsConfig = {
@@ -2,7 +2,7 @@ import { L as LAYOUT, a as ACTIONS, b as DISPLAY_GROUPS, C as CSS_PROPERTIES, E
2
2
  import { g as getTranslationResources } from "../chunks/translationResources.js";
3
3
  import { g as getSelector } from "../chunks/manifest.js";
4
4
  import { a as DisplayNames, h as homepageModeValues, b as defaultStateValues, e as separatorValues, D as DesignStates, c as componentMetadata, s as semanticClassNames } from "../chunks/constants41.js";
5
- import { c as manifestMouseHover } from "../chunks/manifestSdkMixins.js";
5
+ import { d as manifestMouseHover } from "../chunks/manifestSdkMixins.js";
6
6
  const manifest = {
7
7
  id: componentMetadata.id,
8
8
  type: componentMetadata.type,
@@ -1,6 +1,6 @@
1
1
  import { a as ACTIONS, E as ELEMENTS, N as NativeStateType, C as CSS_PROPERTIES, I as INTERACTIONS, D as DATA, L as LAYOUT, A as Archetype } from "../chunks/chunk-LDITHLYN.js";
2
2
  import { D as DesignStates, b as DisplayNames, c as DEFAULT_ICON_POSITION, C as COMPONENT_TYPE } from "../chunks/constants21.js";
3
- import { a as manifestFocusable, c as manifestMouseHover, d as manifestClickable } from "../chunks/manifestSdkMixins.js";
3
+ import { b as manifestFocusable, d as manifestMouseHover, e as manifestClickable } from "../chunks/manifestSdkMixins.js";
4
4
  const displayConfig = {
5
5
  displayValues: ["none", "block"]
6
6
  };
@@ -1,20 +1,17 @@
1
1
  import { A11y, Direction } from '@wix/editor-react-types';
2
- import { SdkFunctionFocusableProps } from '../../../utils/functions/sdkFunctionCallbackProps';
3
- import { FieldValidationProps } from '../../../utils/validation/types';
4
- export type CheckboxProps = SdkFunctionFocusableProps & FieldValidationProps<boolean> & {
2
+ import { SdkFunctionFocusableProps, SdkFunctionKeyboardProps } from '../../../utils/functions/sdkFunctionCallbackProps';
3
+ export type CheckboxProps = SdkFunctionFocusableProps<HTMLElement> & SdkFunctionKeyboardProps<HTMLElement> & {
5
4
  id: string;
6
5
  className: string;
7
- label: string;
8
- tooltip?: string;
9
- checked?: boolean;
10
- defaultChecked?: boolean;
11
- required?: boolean;
6
+ label?: string;
7
+ errorMessage?: string;
12
8
  readOnly?: boolean;
13
9
  disabled?: boolean;
14
- indeterminate?: boolean;
15
- onChange?: (checked: boolean) => void;
16
- direction?: Direction;
10
+ checked?: boolean;
17
11
  a11y?: A11y;
12
+ direction?: Direction;
13
+ onCheckedChange?: (checked: boolean) => void;
14
+ previewError?: boolean;
18
15
  elementProps?: {
19
16
  indicator?: {
20
17
  className?: string;
@@ -22,6 +19,9 @@ export type CheckboxProps = SdkFunctionFocusableProps & FieldValidationProps<boo
22
19
  label?: {
23
20
  className?: string;
24
21
  };
22
+ errorMessage?: {
23
+ className?: string;
24
+ };
25
25
  };
26
26
  wix?: {
27
27
  presetsWrapperProps?: Record<string, unknown>;
@@ -1,91 +1,59 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import { F as Field, e as Checkbox } from "../chunks/index13.js";
3
+ import "react";
3
4
  import { c as clsx } from "../chunks/clsx.js";
4
- import { F as Field, e as Checkbox, T as Tooltip } from "../chunks/index13.js";
5
- import { u as useCurrentLanguage } from "../chunks/useCurrentLanguage.js";
6
- import { f as formatClassNames } from "../chunks/classNames.js";
7
- import { a as getDataAttributes } from "../chunks/dataUtils.js";
8
- import { u as useValidatedField, R as RequiredIndicator, I as InfoCircleSmall_default } from "../chunks/useValidatedField.js";
5
+ import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
9
6
  import { d as directionStyles } from "../chunks/direction.module.js";
10
7
  import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
11
- import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
12
- import { d as defaultValues, s as selectors, T as TestIds, V as VALUE_MISSING_MESSAGE, a as semanticClassNames } from "../chunks/constants40.js";
8
+ import { a as getDataAttributes } from "../chunks/dataUtils.js";
9
+ import { u as useCurrentLanguage } from "../chunks/useCurrentLanguage.js";
10
+ import { d as defaultValues, s as selectors, T as TestIds, D as DesignStates, E as ERROR_MESSAGE_PREVIEW_TEXT } from "../chunks/constants40.js";
13
11
  const root = "root__0DpH8";
14
12
  const field = "field__R0D8f";
15
13
  const item = "item__EzhwB";
16
- const control = "control__7-RJh";
17
14
  const indicator = "indicator__dzBy2";
15
+ const checkmarkWrapper = "checkmarkWrapper__DXeX5";
18
16
  const checkmark = "checkmark__SY2jU";
19
17
  const label = "label__Y3ciV";
20
18
  const errorMessage = "errorMessage__PtMqM";
21
- const tooltipButton = "tooltipButton__EXd4N";
22
- const tooltip = "tooltip__Eudyd";
23
19
  const styles = {
24
20
  root,
25
21
  field,
26
22
  item,
27
- control,
28
23
  indicator,
24
+ checkmarkWrapper,
29
25
  checkmark,
30
26
  label,
31
- errorMessage,
32
- tooltipButton,
33
- tooltip
34
- };
35
- const noop = () => {
27
+ errorMessage
36
28
  };
37
29
  function CheckboxComponent(props) {
38
- var _a, _b;
30
+ var _a, _b, _c;
39
31
  const { language } = useCurrentLanguage();
40
32
  const {
41
33
  id,
42
34
  className = "",
43
35
  label: label2 = defaultValues.label,
44
- tooltip: tooltip2 = defaultValues.tooltip,
45
- defaultChecked = defaultValues.defaultChecked,
36
+ errorMessage: errorMessage2,
46
37
  readOnly = defaultValues.readOnly,
47
- required = defaultValues.required,
48
38
  disabled = defaultValues.disabled,
49
- indeterminate = defaultValues.indeterminate,
50
- direction,
39
+ checked = false,
51
40
  a11y,
52
- onChange = noop,
53
- onFocus = noop,
54
- onBlur = noop,
55
- fieldValidity,
56
- showValidityIndication,
57
- onValidate,
58
- onValidityChange,
41
+ direction,
42
+ onCheckedChange,
43
+ onKeyDown,
44
+ onKeyUp,
45
+ onFocus,
46
+ onBlur,
47
+ previewError,
59
48
  wix,
60
49
  elementProps
61
50
  } = props;
62
- const isControlled = props.checked !== void 0;
63
- const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked);
64
- const checked = isControlled ? Boolean(props.checked) : uncontrolledChecked;
65
- const intrinsic = required && !checked && !disabled && !readOnly ? { valid: false, validationMessage: VALUE_MISSING_MESSAGE } : { valid: true, validationMessage: "" };
66
- const {
67
- validity,
68
- showValidityIndication: showIndication,
69
- handleBlur: handleValidationBlur
70
- } = useValidatedField({
71
- value: checked,
72
- intrinsic,
73
- fieldValidity,
74
- showValidityIndication,
75
- onValidate,
76
- onValidityChange
77
- });
78
- const isInvalid = showIndication && !validity.valid;
79
51
  const handleCheckedChange = (next) => {
80
- if (!isControlled) {
81
- setUncontrolledChecked(next);
82
- }
83
- onChange(next);
84
- };
85
- const handleBlur = (event) => {
86
- onBlur(event);
87
- handleValidationBlur();
52
+ onCheckedChange == null ? void 0 : onCheckedChange(next);
88
53
  };
54
+ const hasError = typeof errorMessage2 !== "undefined" && errorMessage2 !== "";
55
+ const inErrorState = hasError || Boolean(previewError);
56
+ const errorMessageId = inErrorState ? `${id}-error-message` : void 0;
89
57
  const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || void 0;
90
58
  const customAccessibleNameId = label2 && ariaLabel ? `${id}-accessible-name` : void 0;
91
59
  const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
@@ -104,51 +72,53 @@ function CheckboxComponent(props) {
104
72
  dir: direction,
105
73
  lang: language,
106
74
  "data-testid": TestIds.root,
107
- children: /* @__PURE__ */ jsxs(Field.Root, { className: styles.field, invalid: isInvalid, children: [
108
- /* @__PURE__ */ jsxs(
109
- Field.Item,
110
- {
111
- className: clsx(
112
- styles.item,
113
- formatClassNames(semanticClassNames.root)
114
- ),
115
- children: [
75
+ children: /* @__PURE__ */ jsxs(
76
+ Field.Root,
77
+ {
78
+ className: styles.field,
79
+ invalid: inErrorState,
80
+ disabled,
81
+ children: [
82
+ /* @__PURE__ */ jsxs(Field.Item, { className: styles.item, children: [
116
83
  customAccessibleNameId && /* @__PURE__ */ jsx(
117
84
  "span",
118
85
  {
119
86
  id: customAccessibleNameId,
120
87
  className: accessibilityStyles.visuallyHidden,
88
+ "aria-hidden": "true",
89
+ "data-testid": TestIds.accessibleName,
121
90
  children: ariaLabel
122
91
  }
123
92
  ),
124
93
  /* @__PURE__ */ jsx(
125
94
  Checkbox.Root,
126
95
  {
127
- ...isControlled ? { checked: props.checked } : { defaultChecked },
96
+ nativeButton: true,
97
+ render: /* @__PURE__ */ jsx("button", { type: "button" }),
98
+ checked,
128
99
  onCheckedChange: handleCheckedChange,
129
- required,
130
100
  readOnly,
131
101
  disabled,
132
- indeterminate,
133
102
  className: clsx(
134
- styles.control,
135
- formatClassNames(semanticClassNames.control)
103
+ styles.indicator,
104
+ selectors.indicator,
105
+ (_a = elementProps == null ? void 0 : elementProps.indicator) == null ? void 0 : _a.className,
106
+ inErrorState ? DesignStates.indicator.error.className : void 0
136
107
  ),
137
108
  "data-testid": TestIds.control,
138
109
  "aria-label": ariaLabel,
139
110
  "aria-labelledby": customAccessibleNameId,
111
+ "aria-describedby": errorMessageId,
112
+ "aria-invalid": inErrorState || void 0,
113
+ onKeyDown,
114
+ onKeyUp,
140
115
  onFocus,
141
- onBlur: handleBlur,
116
+ onBlur,
142
117
  children: /* @__PURE__ */ jsx(
143
118
  Checkbox.Indicator,
144
119
  {
145
120
  keepMounted: true,
146
- className: clsx(
147
- styles.indicator,
148
- selectors.indicator,
149
- formatClassNames(semanticClassNames.indicator),
150
- (_a = elementProps == null ? void 0 : elementProps.indicator) == null ? void 0 : _a.className
151
- ),
121
+ className: styles.checkmarkWrapper,
152
122
  "data-testid": TestIds.indicator,
153
123
  children: /* @__PURE__ */ jsx(
154
124
  "svg",
@@ -164,59 +134,37 @@ function CheckboxComponent(props) {
164
134
  )
165
135
  }
166
136
  ),
167
- label2 && /* @__PURE__ */ jsxs(
137
+ label2 && /* @__PURE__ */ jsx(
168
138
  Field.Label,
169
139
  {
170
140
  className: clsx(
171
141
  styles.label,
172
142
  selectors.label,
173
- formatClassNames(semanticClassNames.label),
174
143
  (_b = elementProps == null ? void 0 : elementProps.label) == null ? void 0 : _b.className
175
144
  ),
176
145
  "data-testid": TestIds.label,
177
- children: [
178
- label2,
179
- required && /* @__PURE__ */ jsx(
180
- RequiredIndicator,
181
- {
182
- className: formatClassNames(
183
- semanticClassNames.requiredIndicator
184
- ),
185
- "data-testid": TestIds.requiredIndicator
186
- }
187
- )
188
- ]
146
+ children: label2
189
147
  }
190
- ),
191
- tooltip2 && /* @__PURE__ */ jsx(Tooltip.Provider, { delay: 0, children: /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
192
- /* @__PURE__ */ jsx(
193
- Tooltip.Trigger,
194
- {
195
- type: "button",
196
- className: styles.tooltipButton,
197
- "data-testid": TestIds.tooltipButton,
198
- "aria-label": tooltip2,
199
- children: /* @__PURE__ */ jsx(InfoCircleSmall_default, { "aria-hidden": "true" })
200
- }
148
+ )
149
+ ] }),
150
+ inErrorState && /* @__PURE__ */ jsx(
151
+ Field.Error,
152
+ {
153
+ match: true,
154
+ role: "alert",
155
+ className: clsx(
156
+ styles.errorMessage,
157
+ selectors.errorMessage,
158
+ (_c = elementProps == null ? void 0 : elementProps.errorMessage) == null ? void 0 : _c.className
201
159
  ),
202
- /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { sideOffset: 6, children: /* @__PURE__ */ jsx(Tooltip.Popup, { className: styles.tooltip, children: tooltip2 }) }) })
203
- ] }) })
204
- ]
205
- }
206
- ),
207
- isInvalid && validity.validationMessage && /* @__PURE__ */ jsx(
208
- Field.Error,
209
- {
210
- match: true,
211
- className: clsx(
212
- styles.errorMessage,
213
- formatClassNames(semanticClassNames.errorMessage)
214
- ),
215
- "data-testid": TestIds.errorMessage,
216
- children: validity.validationMessage
217
- }
218
- )
219
- ] })
160
+ "data-testid": TestIds.errorMessage,
161
+ id: errorMessageId,
162
+ children: errorMessage2 || ERROR_MESSAGE_PREVIEW_TEXT
163
+ }
164
+ )
165
+ ]
166
+ }
167
+ )
220
168
  }
221
169
  ) });
222
170
  }
@@ -1,19 +1,23 @@
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
  checked: string;
6
- defaultChecked: string;
7
- required: string;
8
7
  readOnly: string;
9
8
  disabled: string;
10
- indeterminate: string;
11
9
  label: string;
12
- tooltip: string;
10
+ errorMessage: string;
11
+ };
12
+ descriptions: {
13
+ checked: string;
14
+ errorMessage: string;
13
15
  };
14
16
  cssCustomProperties: {
15
17
  gap: string;
16
- alignment: string;
18
+ };
19
+ presets: {
20
+ baseCheckbox: string;
17
21
  };
18
22
  };
19
23
  indicator: {
@@ -23,14 +27,16 @@ export declare const DisplayNames: {
23
27
  uncheckedBorderColor: string;
24
28
  checkedBackgroundColor: string;
25
29
  checkedBorderColor: string;
26
- borderWidth: string;
27
30
  checkmarkColor: string;
28
- size: string;
31
+ checkboxSize: string;
29
32
  };
30
33
  };
31
34
  label: {
32
35
  elementDisplayName: string;
33
36
  };
37
+ errorMessage: {
38
+ elementDisplayName: string;
39
+ };
34
40
  };
35
41
  export declare const DesignStates: {
36
42
  readonly indicator: {
@@ -46,42 +52,33 @@ export declare const DesignStates: {
46
52
  readonly displayName: "Disabled";
47
53
  readonly className: "checkbox__indicator--disabled";
48
54
  };
49
- readonly invalid: {
50
- readonly displayName: "Invalid";
51
- readonly className: "checkbox__indicator--invalid";
55
+ readonly error: {
56
+ readonly displayName: "Error";
57
+ readonly className: "checkbox__indicator--error";
52
58
  };
53
59
  };
54
60
  };
61
+ export declare const FunctionalStateKeys: {
62
+ readonly previewError: "previewError";
63
+ };
64
+ export declare const ERROR_MESSAGE_PREVIEW_TEXT = "Error message";
55
65
  export declare const defaultValues: {
56
66
  readonly label: "Label";
57
67
  readonly checked: false;
58
- readonly defaultChecked: false;
59
- readonly required: false;
60
68
  readonly readOnly: false;
61
69
  readonly disabled: false;
62
- readonly indeterminate: false;
63
- readonly tooltip: "";
64
70
  };
65
- export declare const VALUE_MISSING_MESSAGE = "This field is required";
66
71
  export declare const TestIds: {
67
72
  readonly root: "checkbox-root";
68
73
  readonly control: "checkbox-control";
69
74
  readonly indicator: "checkbox-indicator";
70
75
  readonly label: "checkbox-label";
71
- readonly requiredIndicator: "checkbox-required-indicator";
72
- readonly tooltipButton: "checkbox-tooltip-button";
73
76
  readonly errorMessage: "checkbox-error-message";
77
+ readonly accessibleName: "checkbox-accessible-name";
74
78
  };
75
79
  export declare const selectors: {
76
80
  readonly root: "checkbox";
77
81
  readonly indicator: "checkbox__indicator";
78
82
  readonly label: "checkbox__label";
79
- };
80
- export declare const semanticClassNames: {
81
- readonly root: "checkbox";
82
- readonly control: "checkbox__control";
83
- readonly indicator: "checkbox__indicator";
84
- readonly label: "checkbox__label";
85
- readonly requiredIndicator: "checkbox__required-indicator";
86
83
  readonly errorMessage: "checkbox__error-message";
87
84
  };