@wix/form-public 0.541.0 → 0.542.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/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -55803,6 +55803,8 @@ var Dropdown = ({ children }) => {
|
|
|
55803
55803
|
const [container, setContainer] = React172.useState(null);
|
|
55804
55804
|
const selectedValue = value && options.some((option2) => (option2.value ?? option2.label) === value) ? value : defaultValue || null;
|
|
55805
55805
|
const { labelId } = useFieldAttributes();
|
|
55806
|
+
const { t } = useTranslation2();
|
|
55807
|
+
const requiredLabelId = `${labelId}-required`;
|
|
55806
55808
|
const handleChange = React172.useCallback((selectedValue2) => {
|
|
55807
55809
|
if (!readOnly) {
|
|
55808
55810
|
onChange(typeof selectedValue2 === "string" ? selectedValue2 : null);
|
|
@@ -55828,10 +55830,12 @@ var Dropdown = ({ children }) => {
|
|
|
55828
55830
|
style: {
|
|
55829
55831
|
display: "contents"
|
|
55830
55832
|
}
|
|
55831
|
-
}), /* @__PURE__ */ React172__default.default.createElement(
|
|
55833
|
+
}), required ? /* @__PURE__ */ React172__default.default.createElement(reactAriaComponents.VisuallyHidden, {
|
|
55834
|
+
id: requiredLabelId
|
|
55835
|
+
}, t("settings.required-indicator-text")) : null, /* @__PURE__ */ React172__default.default.createElement($72abaeab4d80592f$export$78efe591171d7d45, {
|
|
55832
55836
|
getContainer: () => container
|
|
55833
55837
|
}, /* @__PURE__ */ React172__default.default.createElement(reactAriaComponents.Select, {
|
|
55834
|
-
"aria-labelledby": labelId,
|
|
55838
|
+
"aria-labelledby": required ? `${labelId} ${requiredLabelId}` : labelId,
|
|
55835
55839
|
value: selectedValue,
|
|
55836
55840
|
isOpen: isForcedOpen || isOpen && !disabled && !readOnly,
|
|
55837
55841
|
onOpenChange: isForcedOpen ? void 0 : handleOpenChange,
|