@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.js CHANGED
@@ -7,7 +7,7 @@ import ReactDOM from 'react-dom';
7
7
  import camelCase2 from 'lodash.camelcase';
8
8
  import mapKeys from 'lodash.mapkeys';
9
9
  import { jsx } from 'react/jsx-runtime';
10
- import { CheckboxField, CheckboxButton, TextField, Input, ListBoxItem, Dialog, OverlayTriggerStateContext, ModalOverlay, Modal, SearchField, Group, RadioGroup as RadioGroup$1, Button, DropZone as DropZone$1, FileTrigger, useSlottedContext, PopoverContext, Popover, CollectionRendererContext, DefaultCollectionRenderer, ListBox, Autocomplete, RadioField, RadioButton, CheckboxGroup as CheckboxGroup$1, I18nProvider, DatePicker as DatePicker$1, Select, VisuallyHidden, NumberField, TimeField, SelectValue, CalendarCell, Calendar as Calendar$1, CalendarMonthPicker, CalendarYearPicker, CalendarGrid, DatePickerStateContext, DateInput as DateInput$1, DateSegment, TimeFieldStateContext, ToggleButton, ToggleButtonGroup, Text as Text$1, ProgressBar, ComboBox, DialogTrigger, TextArea as TextArea$1, ComboBoxStateContext } from 'react-aria-components';
10
+ import { CheckboxField, CheckboxButton, TextField, Input, ListBoxItem, Dialog, OverlayTriggerStateContext, ModalOverlay, Modal, SearchField, Group, RadioGroup as RadioGroup$1, Button, DropZone as DropZone$1, FileTrigger, useSlottedContext, PopoverContext, Popover, CollectionRendererContext, DefaultCollectionRenderer, ListBox, Autocomplete, RadioField, RadioButton, CheckboxGroup as CheckboxGroup$1, I18nProvider, DatePicker as DatePicker$1, VisuallyHidden, Select, NumberField, TimeField, SelectValue, CalendarCell, Calendar as Calendar$1, CalendarMonthPicker, CalendarYearPicker, CalendarGrid, DatePickerStateContext, DateInput as DateInput$1, DateSegment, TimeFieldStateContext, ToggleButton, ToggleButtonGroup, Text as Text$1, ProgressBar, ComboBox, DialogTrigger, TextArea as TextArea$1, ComboBoxStateContext } from 'react-aria-components';
11
11
 
12
12
  var __create = Object.create;
13
13
  var __defProp = Object.defineProperty;
@@ -55793,6 +55793,8 @@ var Dropdown = ({ children }) => {
55793
55793
  const [container, setContainer] = useState(null);
55794
55794
  const selectedValue = value && options.some((option2) => (option2.value ?? option2.label) === value) ? value : defaultValue || null;
55795
55795
  const { labelId } = useFieldAttributes();
55796
+ const { t } = useTranslation2();
55797
+ const requiredLabelId = `${labelId}-required`;
55796
55798
  const handleChange = useCallback((selectedValue2) => {
55797
55799
  if (!readOnly) {
55798
55800
  onChange(typeof selectedValue2 === "string" ? selectedValue2 : null);
@@ -55818,10 +55820,12 @@ var Dropdown = ({ children }) => {
55818
55820
  style: {
55819
55821
  display: "contents"
55820
55822
  }
55821
- }), /* @__PURE__ */ React172.createElement($72abaeab4d80592f$export$78efe591171d7d45, {
55823
+ }), required ? /* @__PURE__ */ React172.createElement(VisuallyHidden, {
55824
+ id: requiredLabelId
55825
+ }, t("settings.required-indicator-text")) : null, /* @__PURE__ */ React172.createElement($72abaeab4d80592f$export$78efe591171d7d45, {
55822
55826
  getContainer: () => container
55823
55827
  }, /* @__PURE__ */ React172.createElement(Select, {
55824
- "aria-labelledby": labelId,
55828
+ "aria-labelledby": required ? `${labelId} ${requiredLabelId}` : labelId,
55825
55829
  value: selectedValue,
55826
55830
  isOpen: isForcedOpen || isOpen && !disabled && !readOnly,
55827
55831
  onOpenChange: isForcedOpen ? void 0 : handleOpenChange,