@wix/editor-react-components 1.2642.0 → 1.2644.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.
- package/dist/site/components/Checkbox/component.js +12 -1
- package/dist/site/components/Checkbox/css.css +11 -0
- package/dist/site/components/CheckboxGroup/component.js +11 -4
- package/dist/site/components/CheckboxGroup/css.css +4 -0
- package/dist/site/components/Dropdown/component.js +13 -2
- package/dist/site/components/Dropdown/css.css +11 -0
- package/dist/site/components/RadioButtons/component.js +12 -1
- package/dist/site/components/RadioButtons/css.css +17 -0
- package/dist/site/components/TextBox/component.js +12 -1
- package/dist/site/components/TextBox/css.css +11 -0
- package/dist/site/components/TextInput/TextInput.types.d.ts +2 -1
- package/dist/site/components/TextInput/component.js +30 -8
- package/dist/site/components/TextInput/css.css +11 -0
- package/dist/site/components/chunks/accessibility.module.js +7 -0
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
|
9
9
|
import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
|
|
10
10
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
11
11
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
12
|
+
import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
|
|
12
13
|
import { d as defaultValues, V as VALUE_MISSING_MESSAGE, s as selectors, T as TestIds, a as semanticClassNames } from "../chunks/constants40.js";
|
|
13
14
|
import { I as InfoCircleSmall_default } from "../chunks/InfoCircleSmall.js";
|
|
14
15
|
const root = "root__0DpH8";
|
|
@@ -87,7 +88,8 @@ function CheckboxComponent(props) {
|
|
|
87
88
|
onBlur(event);
|
|
88
89
|
handleValidationBlur();
|
|
89
90
|
};
|
|
90
|
-
const ariaLabel =
|
|
91
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || void 0;
|
|
92
|
+
const customAccessibleNameId = label2 && ariaLabel ? `${id}-accessible-name` : void 0;
|
|
91
93
|
const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
|
|
92
94
|
const rootClassName = clsx(
|
|
93
95
|
className,
|
|
@@ -113,6 +115,14 @@ function CheckboxComponent(props) {
|
|
|
113
115
|
formatClassNames(semanticClassNames.root)
|
|
114
116
|
),
|
|
115
117
|
children: [
|
|
118
|
+
customAccessibleNameId && /* @__PURE__ */ jsx(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
id: customAccessibleNameId,
|
|
122
|
+
className: accessibilityStyles.visuallyHidden,
|
|
123
|
+
children: ariaLabel
|
|
124
|
+
}
|
|
125
|
+
),
|
|
116
126
|
/* @__PURE__ */ jsx(
|
|
117
127
|
Checkbox.Root,
|
|
118
128
|
{
|
|
@@ -128,6 +138,7 @@ function CheckboxComponent(props) {
|
|
|
128
138
|
),
|
|
129
139
|
"data-testid": TestIds.control,
|
|
130
140
|
"aria-label": ariaLabel,
|
|
141
|
+
"aria-labelledby": customAccessibleNameId,
|
|
131
142
|
onFocus,
|
|
132
143
|
onBlur: handleBlur,
|
|
133
144
|
children: /* @__PURE__ */ jsx(
|
|
@@ -216,4 +216,15 @@
|
|
|
216
216
|
}
|
|
217
217
|
.presetWrapper__J1yzj {
|
|
218
218
|
display: contents;
|
|
219
|
+
}
|
|
220
|
+
.visuallyHidden__Md84p {
|
|
221
|
+
position: absolute;
|
|
222
|
+
width: 1px;
|
|
223
|
+
height: 1px;
|
|
224
|
+
padding: 0;
|
|
225
|
+
margin: -1px;
|
|
226
|
+
overflow: hidden;
|
|
227
|
+
clip-path: inset(50%);
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
border: 0;
|
|
219
230
|
}
|
|
@@ -18,6 +18,7 @@ const groupLabel = "groupLabel__gW0O8";
|
|
|
18
18
|
const tooltipButton = "tooltipButton__9ySi3";
|
|
19
19
|
const tooltip = "tooltip__xXd2k";
|
|
20
20
|
const group = "group__5et8j";
|
|
21
|
+
const list = "list__PAzjO";
|
|
21
22
|
const option = "option__mUn-C";
|
|
22
23
|
const control = "control__MMIkR";
|
|
23
24
|
const indicator = "indicator__mDg93";
|
|
@@ -32,6 +33,7 @@ const styles = {
|
|
|
32
33
|
tooltipButton,
|
|
33
34
|
tooltip,
|
|
34
35
|
group,
|
|
36
|
+
list,
|
|
35
37
|
option,
|
|
36
38
|
control,
|
|
37
39
|
indicator,
|
|
@@ -130,7 +132,8 @@ function CheckboxGroupComponent(props) {
|
|
|
130
132
|
};
|
|
131
133
|
const hasLegend = displayLabel && !!label2;
|
|
132
134
|
const showLabelRow = hasLegend || !!tooltip2;
|
|
133
|
-
const ariaLabel =
|
|
135
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || void 0;
|
|
136
|
+
const legendId = hasLegend ? `${id}-legend` : void 0;
|
|
134
137
|
const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
|
|
135
138
|
const rootClassName = clsx(
|
|
136
139
|
className,
|
|
@@ -188,6 +191,7 @@ function CheckboxGroupComponent(props) {
|
|
|
188
191
|
hasLegend && /* @__PURE__ */ jsxs(
|
|
189
192
|
Fieldset.Legend,
|
|
190
193
|
{
|
|
194
|
+
id: legendId,
|
|
191
195
|
className: clsx(
|
|
192
196
|
styles.groupLabel,
|
|
193
197
|
selectors.groupLabel,
|
|
@@ -223,7 +227,7 @@ function CheckboxGroupComponent(props) {
|
|
|
223
227
|
/* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsx(Tooltip.Positioner, { sideOffset: 6, children: /* @__PURE__ */ jsx(Tooltip.Popup, { className: styles.tooltip, children: tooltip2 }) }) })
|
|
224
228
|
] }) })
|
|
225
229
|
] }),
|
|
226
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
227
231
|
CheckboxGroup_CheckboxGroup_CheckboxGroup,
|
|
228
232
|
{
|
|
229
233
|
...valueProps,
|
|
@@ -234,14 +238,16 @@ function CheckboxGroupComponent(props) {
|
|
|
234
238
|
"aria-invalid": isInvalid || void 0,
|
|
235
239
|
"aria-describedby": showErrorMessage ? errorId : void 0,
|
|
236
240
|
"aria-label": ariaLabel,
|
|
241
|
+
"aria-labelledby": ariaLabel ? void 0 : legendId,
|
|
237
242
|
className: styles.group,
|
|
238
243
|
"data-testid": TestIds.group,
|
|
239
244
|
onFocus,
|
|
240
245
|
onBlur: handleBlur,
|
|
241
|
-
children: [
|
|
246
|
+
children: /* @__PURE__ */ jsxs("div", { role: "list", className: styles.list, children: [
|
|
242
247
|
selectAll && /* @__PURE__ */ jsxs(
|
|
243
248
|
"label",
|
|
244
249
|
{
|
|
250
|
+
role: "listitem",
|
|
245
251
|
className: clsx(
|
|
246
252
|
styles.option,
|
|
247
253
|
formatClassNames(semanticClassNames.option)
|
|
@@ -267,6 +273,7 @@ function CheckboxGroupComponent(props) {
|
|
|
267
273
|
options.map((option2, index) => /* @__PURE__ */ jsxs(
|
|
268
274
|
"label",
|
|
269
275
|
{
|
|
276
|
+
role: "listitem",
|
|
270
277
|
className: clsx(
|
|
271
278
|
styles.option,
|
|
272
279
|
formatClassNames(semanticClassNames.option)
|
|
@@ -294,7 +301,7 @@ function CheckboxGroupComponent(props) {
|
|
|
294
301
|
},
|
|
295
302
|
option2.value || index
|
|
296
303
|
))
|
|
297
|
-
]
|
|
304
|
+
] })
|
|
298
305
|
}
|
|
299
306
|
),
|
|
300
307
|
showErrorMessage && /* @__PURE__ */ jsxs(
|
|
@@ -11,6 +11,7 @@ import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
|
11
11
|
import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
|
|
12
12
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
13
13
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
14
|
+
import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
|
|
14
15
|
import { A as ALL_VALUE, s as selectors, a as semanticClassNames, T as TestIds, d as defaultValues, b as TriggerModeValues, c as ARIA_LABEL_NAMESPACE, e as AriaLabels, V as VALUE_MISSING_MESSAGE } from "../chunks/constants36.js";
|
|
15
16
|
import { u as useResizeObserver } from "../chunks/useResizeObserver.js";
|
|
16
17
|
import { D as DismissSmall_default } from "../chunks/DismissSmall.js";
|
|
@@ -529,6 +530,7 @@ const DropdownTrigger = ({
|
|
|
529
530
|
className: triggerClassName,
|
|
530
531
|
"data-testid": TestIds.trigger,
|
|
531
532
|
"aria-label": ariaLabel,
|
|
533
|
+
"aria-labelledby": labelId,
|
|
532
534
|
"aria-describedby": describedById,
|
|
533
535
|
"aria-invalid": isInvalid || void 0,
|
|
534
536
|
onFocus,
|
|
@@ -700,7 +702,7 @@ function Dropdown(props) {
|
|
|
700
702
|
inline
|
|
701
703
|
});
|
|
702
704
|
const t = translate(ARIA_LABEL_NAMESPACE);
|
|
703
|
-
const ariaLabel =
|
|
705
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || (label2 ? void 0 : t(AriaLabels.root.key) || AriaLabels.root.default);
|
|
704
706
|
const clearLabel = t(AriaLabels.clear.key) || AriaLabels.clear.default;
|
|
705
707
|
const removeItemLabel = t(AriaLabels.removeItem.key) || AriaLabels.removeItem.default;
|
|
706
708
|
const selectedItemValues = selectedItems.map((item) => item.value).filter((value2) => value2 !== "");
|
|
@@ -736,6 +738,7 @@ function Dropdown(props) {
|
|
|
736
738
|
const labelId = label2 ? `${comboboxId}-label` : void 0;
|
|
737
739
|
const fieldName = name || void 0;
|
|
738
740
|
const hasInput = isMultiple || isSearchable;
|
|
741
|
+
const customAccessibleNameId = label2 && ariaLabel && !hasInput ? `${id}-accessible-name` : void 0;
|
|
739
742
|
const popupOpen = previewList === true || (isMultiple || !isSearchable ? isOpen : isOpen && hasQuery);
|
|
740
743
|
const triggerRegion = /* @__PURE__ */ jsx(
|
|
741
744
|
DropdownTrigger,
|
|
@@ -747,7 +750,7 @@ function Dropdown(props) {
|
|
|
747
750
|
selectedItems,
|
|
748
751
|
placeholder,
|
|
749
752
|
ariaLabel,
|
|
750
|
-
labelId,
|
|
753
|
+
labelId: customAccessibleNameId ?? (ariaLabel ? void 0 : labelId),
|
|
751
754
|
clearLabel,
|
|
752
755
|
removeItemLabel,
|
|
753
756
|
describedById: descriptionId,
|
|
@@ -808,6 +811,14 @@ function Dropdown(props) {
|
|
|
808
811
|
...inline ? {} : { open: popupOpen, onOpenChange: setIsOpen },
|
|
809
812
|
...isSearchable ? { inputValue, onInputValueChange: handleInputValueChange } : {},
|
|
810
813
|
children: [
|
|
814
|
+
customAccessibleNameId && /* @__PURE__ */ jsx(
|
|
815
|
+
"span",
|
|
816
|
+
{
|
|
817
|
+
id: customAccessibleNameId,
|
|
818
|
+
className: accessibilityStyles.visuallyHidden,
|
|
819
|
+
children: ariaLabel
|
|
820
|
+
}
|
|
821
|
+
),
|
|
811
822
|
label2 && /* @__PURE__ */ jsxs(
|
|
812
823
|
Combobox.Label,
|
|
813
824
|
{
|
|
@@ -450,4 +450,15 @@ div.group-XazO1A {
|
|
|
450
450
|
}
|
|
451
451
|
.presetWrapper__J1yzj {
|
|
452
452
|
display: contents;
|
|
453
|
+
}
|
|
454
|
+
.visuallyHidden__Md84p {
|
|
455
|
+
position: absolute;
|
|
456
|
+
width: 1px;
|
|
457
|
+
height: 1px;
|
|
458
|
+
padding: 0;
|
|
459
|
+
margin: -1px;
|
|
460
|
+
overflow: hidden;
|
|
461
|
+
clip-path: inset(50%);
|
|
462
|
+
white-space: nowrap;
|
|
463
|
+
border: 0;
|
|
453
464
|
}
|
|
@@ -9,6 +9,7 @@ import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
|
9
9
|
import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
|
|
10
10
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
11
11
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
12
|
+
import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
|
|
12
13
|
import { d as defaultValues, a as defaultOptions, V as VALUE_MISSING_MESSAGE, s as selectors, T as TestIds, b as semanticClassNames } from "../chunks/constants24.js";
|
|
13
14
|
import { I as InfoCircleSmall_default } from "../chunks/InfoCircleSmall.js";
|
|
14
15
|
const root = "root__4SkBh";
|
|
@@ -103,7 +104,8 @@ function RadioButtonsComponent(props) {
|
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
106
|
const hasLegend = !!label2;
|
|
106
|
-
const ariaLabel =
|
|
107
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || void 0;
|
|
108
|
+
const customAccessibleNameId = hasLegend && ariaLabel ? `${id}-accessible-name` : void 0;
|
|
107
109
|
const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
|
|
108
110
|
const rootClassName = clsx(
|
|
109
111
|
className,
|
|
@@ -121,6 +123,14 @@ function RadioButtonsComponent(props) {
|
|
|
121
123
|
lang: environmentService.language,
|
|
122
124
|
"data-testid": TestIds.root,
|
|
123
125
|
children: /* @__PURE__ */ jsxs(Fieldset.Root, { className: styles.fieldset, children: [
|
|
126
|
+
customAccessibleNameId && /* @__PURE__ */ jsx(
|
|
127
|
+
"span",
|
|
128
|
+
{
|
|
129
|
+
id: customAccessibleNameId,
|
|
130
|
+
className: accessibilityStyles.visuallyHidden,
|
|
131
|
+
children: ariaLabel
|
|
132
|
+
}
|
|
133
|
+
),
|
|
124
134
|
(hasLegend || tooltip2) && /* @__PURE__ */ jsxs("div", { className: styles.labelRow, children: [
|
|
125
135
|
hasLegend && /* @__PURE__ */ jsxs(
|
|
126
136
|
Fieldset.Legend,
|
|
@@ -171,6 +181,7 @@ function RadioButtonsComponent(props) {
|
|
|
171
181
|
"aria-invalid": isInvalid || void 0,
|
|
172
182
|
"aria-describedby": isInvalid && validity.validationMessage ? errorId : void 0,
|
|
173
183
|
"aria-label": ariaLabel,
|
|
184
|
+
"aria-labelledby": customAccessibleNameId,
|
|
174
185
|
className: styles.group,
|
|
175
186
|
"data-testid": TestIds.group,
|
|
176
187
|
onFocus,
|
|
@@ -126,6 +126,12 @@
|
|
|
126
126
|
--radio-border: var(--unselectedBorderColor, #000);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
.control__w6l6-:focus-visible,
|
|
130
|
+
.control__w6l6-:has(:focus-visible) {
|
|
131
|
+
outline: 2px solid #116dff;
|
|
132
|
+
outline-offset: 2px;
|
|
133
|
+
}
|
|
134
|
+
|
|
129
135
|
.control__w6l6-[data-checked] {
|
|
130
136
|
--radio-bg: var(--selectedBackgroundColor, #fff);
|
|
131
137
|
--radio-border: var(--selectedBorderColor, #116dff);
|
|
@@ -193,4 +199,15 @@
|
|
|
193
199
|
}
|
|
194
200
|
.presetWrapper__J1yzj {
|
|
195
201
|
display: contents;
|
|
202
|
+
}
|
|
203
|
+
.visuallyHidden__Md84p {
|
|
204
|
+
position: absolute;
|
|
205
|
+
width: 1px;
|
|
206
|
+
height: 1px;
|
|
207
|
+
padding: 0;
|
|
208
|
+
margin: -1px;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
clip-path: inset(50%);
|
|
211
|
+
white-space: nowrap;
|
|
212
|
+
border: 0;
|
|
196
213
|
}
|
|
@@ -9,6 +9,7 @@ import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
|
9
9
|
import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
|
|
10
10
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
11
11
|
import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
|
|
12
|
+
import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
|
|
12
13
|
import { d as defaultValues, s as selectors, T as TestIds, V as VALIDATION_MESSAGES, a as semanticClassNames } from "../chunks/constants18.js";
|
|
13
14
|
import { I as InfoCircleSmall_default } from "../chunks/InfoCircleSmall.js";
|
|
14
15
|
const root = "root__dlp5n";
|
|
@@ -108,7 +109,8 @@ function TextBoxComponent(props) {
|
|
|
108
109
|
};
|
|
109
110
|
const hasLabel = !!label2;
|
|
110
111
|
const hasTooltip = !!tooltip2;
|
|
111
|
-
const ariaLabel =
|
|
112
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || void 0;
|
|
113
|
+
const customAccessibleNameId = hasLabel && ariaLabel ? `${id}-accessible-name` : void 0;
|
|
112
114
|
const presetsWrapperProps = (wix == null ? void 0 : wix.presetsWrapperProps) || {};
|
|
113
115
|
const rootClassName = clsx(
|
|
114
116
|
className,
|
|
@@ -132,6 +134,14 @@ function TextBoxComponent(props) {
|
|
|
132
134
|
disabled,
|
|
133
135
|
invalid: isInvalid,
|
|
134
136
|
children: [
|
|
137
|
+
customAccessibleNameId && /* @__PURE__ */ jsx(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
id: customAccessibleNameId,
|
|
141
|
+
className: accessibilityStyles.visuallyHidden,
|
|
142
|
+
children: ariaLabel
|
|
143
|
+
}
|
|
144
|
+
),
|
|
135
145
|
(hasLabel || hasTooltip) && /* @__PURE__ */ jsxs("div", { className: styles.labelRow, children: [
|
|
136
146
|
hasLabel && /* @__PURE__ */ jsxs(
|
|
137
147
|
Field.Label,
|
|
@@ -189,6 +199,7 @@ function TextBoxComponent(props) {
|
|
|
189
199
|
minLength: minLength ?? void 0,
|
|
190
200
|
maxLength: maxLength ?? void 0,
|
|
191
201
|
"aria-label": ariaLabel,
|
|
202
|
+
"aria-labelledby": customAccessibleNameId,
|
|
192
203
|
"data-testid": TestIds.input,
|
|
193
204
|
onFocus,
|
|
194
205
|
onBlur: handleBlur
|
|
@@ -158,4 +158,15 @@
|
|
|
158
158
|
}
|
|
159
159
|
.presetWrapper__J1yzj {
|
|
160
160
|
display: contents;
|
|
161
|
+
}
|
|
162
|
+
.visuallyHidden__Md84p {
|
|
163
|
+
position: absolute;
|
|
164
|
+
width: 1px;
|
|
165
|
+
height: 1px;
|
|
166
|
+
padding: 0;
|
|
167
|
+
margin: -1px;
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
clip-path: inset(50%);
|
|
170
|
+
white-space: nowrap;
|
|
171
|
+
border: 0;
|
|
161
172
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Direction } from '@wix/editor-react-types';
|
|
1
|
+
import { A11y, Direction } from '@wix/editor-react-types';
|
|
2
2
|
import { CorvidTypes } from '../../../types/vendored/editor-elements-types-corvid';
|
|
3
3
|
import { DefaultCompPlatformProps } from '../../../types/vendored/editor-elements-types-thunderbolt';
|
|
4
4
|
import { IReadOnlyPropSDK } from '../../../common/sdk/props-factories/readOnlyPropsSDKFactory';
|
|
@@ -27,6 +27,7 @@ type Spx = {
|
|
|
27
27
|
};
|
|
28
28
|
export type ITextInputImperativeActions = IFocusPropsImperativeActions & IValidationPropsImperativeActions;
|
|
29
29
|
export type ITextInputProps = ITextInputMapperProps & DefaultCompPlatformProps & IValidationPropSDKProps & FieldValidationProps<string> & IChangePropsSDKActions<HTMLInputElement> & Partial<ITextInputPropsSDKActions<HTMLInputElement>> & Partial<IFocusPropsSDKActions> & Partial<IClickPropsSDKActions> & Partial<IValidationPropsSDKActions<ITextInputProps>> & Partial<IElementPropsSDKActions> & Partial<HydrationSDKAction> & ITextInputControllerProps & IAccessibilityPropSDKProps & {
|
|
30
|
+
a11y?: Pick<A11y, 'ariaLabel'>;
|
|
30
31
|
ref?: React.Ref<ITextInputImperativeActions>;
|
|
31
32
|
autoFocus?: boolean;
|
|
32
33
|
className?: string;
|
|
@@ -7,6 +7,7 @@ import { b as getAccessibilityAttributes, H as HAS_CUSTOM_FOCUS_CLASSNAME } from
|
|
|
7
7
|
import { a as getDataAttributes } from "../chunks/dataUtils.js";
|
|
8
8
|
import { u as useValidatedField, R as RequiredIndicator } from "../chunks/RequiredIndicator.js";
|
|
9
9
|
import { d as directionStyles } from "../chunks/direction.module.js";
|
|
10
|
+
import { a as accessibilityStyles } from "../chunks/accessibility.module.js";
|
|
10
11
|
import { s as selectors, T as TestIds, V as VALUE_MISSING_MESSAGE } from "../chunks/constants3.js";
|
|
11
12
|
import { useService } from "@wix/services-manager-react";
|
|
12
13
|
import { T as TranslationsDefinition } from "../chunks/index6.js";
|
|
@@ -448,6 +449,7 @@ const style$1 = {
|
|
|
448
449
|
};
|
|
449
450
|
const errorMessageFallbackText = "Error text displays here.";
|
|
450
451
|
const InlineErrorMessage = ({
|
|
452
|
+
id,
|
|
451
453
|
errorMessage,
|
|
452
454
|
errorMessageType,
|
|
453
455
|
shouldShowValidityIndication,
|
|
@@ -467,7 +469,7 @@ const InlineErrorMessage = ({
|
|
|
467
469
|
className: style$1.inlineErrorIndication,
|
|
468
470
|
children: [
|
|
469
471
|
/* @__PURE__ */ jsx(StatusAlertSmall_default, { className: style$1.iconErrorMessage }),
|
|
470
|
-
/* @__PURE__ */ jsx("span", { className: style$1.txtErrMsg, children: errorMessageText })
|
|
472
|
+
/* @__PURE__ */ jsx("span", { id, className: style$1.txtErrMsg, children: errorMessageText })
|
|
471
473
|
]
|
|
472
474
|
}
|
|
473
475
|
) : null;
|
|
@@ -627,6 +629,7 @@ const TextInput = (props, ref) => {
|
|
|
627
629
|
onMouseEnter = noop,
|
|
628
630
|
onMouseLeave = noop,
|
|
629
631
|
onHydrationComplete = noop,
|
|
632
|
+
a11y,
|
|
630
633
|
ariaAttributes,
|
|
631
634
|
contentRef
|
|
632
635
|
} = props;
|
|
@@ -850,10 +853,20 @@ const TextInput = (props, ref) => {
|
|
|
850
853
|
};
|
|
851
854
|
const getMinLength = () => activePhoneFormat ? activePhoneFormat.length : minLength ?? void 0;
|
|
852
855
|
const {
|
|
853
|
-
ariaAttributes: { "aria-label":
|
|
856
|
+
ariaAttributes: { "aria-label": sdkAriaLabel, ...restAriaAttributes }
|
|
854
857
|
} = getAccessibilityAttributes({ ariaAttributes });
|
|
858
|
+
const ariaLabel = (a11y == null ? void 0 : a11y.ariaLabel) || sdkAriaLabel;
|
|
859
|
+
const explicitLabelledBy = restAriaAttributes["aria-labelledby"];
|
|
860
|
+
const customAccessibleNameId = label2 && ariaLabel && !explicitLabelledBy ? `${id}-accessible-name` : void 0;
|
|
861
|
+
const componentViewMode = (getPreviewMode == null ? void 0 : getPreviewMode()) ? "preview" : "editor";
|
|
855
862
|
const hasFocus = () => !!inputRef.current && inputRef.current === document.activeElement;
|
|
856
863
|
const descriptionId = description ? `description_${id}` : void 0;
|
|
864
|
+
const errorId = `${id}-error`;
|
|
865
|
+
const describedByIds = [
|
|
866
|
+
restAriaAttributes["aria-describedby"],
|
|
867
|
+
descriptionId,
|
|
868
|
+
errorMessageType === "inline" && showErrorIndication && (componentViewMode === "editor" || errorMessageToShow) ? errorId : void 0
|
|
869
|
+
].filter(Boolean);
|
|
857
870
|
const inputClasses = clsx(
|
|
858
871
|
style.input,
|
|
859
872
|
selectors.input,
|
|
@@ -900,11 +913,11 @@ const TextInput = (props, ref) => {
|
|
|
900
913
|
...ariaLabel && { "aria-label": ariaLabel },
|
|
901
914
|
...!required && { "aria-required": false },
|
|
902
915
|
...restAriaAttributes,
|
|
903
|
-
...
|
|
904
|
-
"aria-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
916
|
+
...customAccessibleNameId && {
|
|
917
|
+
"aria-labelledby": customAccessibleNameId
|
|
918
|
+
},
|
|
919
|
+
...describedByIds.length ? {
|
|
920
|
+
"aria-describedby": describedByIds.join(" ")
|
|
908
921
|
} : {}
|
|
909
922
|
};
|
|
910
923
|
return /* @__PURE__ */ jsx(
|
|
@@ -922,6 +935,14 @@ const TextInput = (props, ref) => {
|
|
|
922
935
|
onMouseLeave: _onMouseLeave,
|
|
923
936
|
lang: language,
|
|
924
937
|
children: /* @__PURE__ */ jsxs($bcdf0525bf22703d$export$2c73285ae9390cec, { ...textFieldProps, children: [
|
|
938
|
+
customAccessibleNameId && /* @__PURE__ */ jsx(
|
|
939
|
+
"span",
|
|
940
|
+
{
|
|
941
|
+
id: customAccessibleNameId,
|
|
942
|
+
className: accessibilityStyles.visuallyHidden,
|
|
943
|
+
children: ariaLabel
|
|
944
|
+
}
|
|
945
|
+
),
|
|
925
946
|
(label2 || tooltip2) && /* @__PURE__ */ jsxs("div", { className: style.labelRow, children: [
|
|
926
947
|
label2 && /* @__PURE__ */ jsxs(
|
|
927
948
|
$01b77f81d0f07f68$export$b04be29aa201d4f5,
|
|
@@ -980,11 +1001,12 @@ const TextInput = (props, ref) => {
|
|
|
980
1001
|
/* @__PURE__ */ jsx(
|
|
981
1002
|
InlineErrorMessage,
|
|
982
1003
|
{
|
|
1004
|
+
id: errorId,
|
|
983
1005
|
errorMessageType,
|
|
984
1006
|
errorMessage: errorMessageToShow,
|
|
985
1007
|
shouldShowValidityIndication: showErrorIndication,
|
|
986
1008
|
translations,
|
|
987
|
-
componentViewMode
|
|
1009
|
+
componentViewMode
|
|
988
1010
|
}
|
|
989
1011
|
)
|
|
990
1012
|
] })
|
|
@@ -245,4 +245,15 @@
|
|
|
245
245
|
}
|
|
246
246
|
.fallbackDirection__HeRgn:not([dir]) {
|
|
247
247
|
direction: var(--wix-opt-in-direction);
|
|
248
|
+
}
|
|
249
|
+
.visuallyHidden__Md84p {
|
|
250
|
+
position: absolute;
|
|
251
|
+
width: 1px;
|
|
252
|
+
height: 1px;
|
|
253
|
+
padding: 0;
|
|
254
|
+
margin: -1px;
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
clip-path: inset(50%);
|
|
257
|
+
white-space: nowrap;
|
|
258
|
+
border: 0;
|
|
248
259
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/editor-react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2644.0",
|
|
4
4
|
"description": "React components for the Wix Editor",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -199,5 +199,5 @@
|
|
|
199
199
|
"registry": "https://registry.npmjs.org/",
|
|
200
200
|
"access": "public"
|
|
201
201
|
},
|
|
202
|
-
"falconPackageHash": "
|
|
202
|
+
"falconPackageHash": "4ba57de011d631522ee555c6f7edfe20ac94137c9555adfc101d0228"
|
|
203
203
|
}
|