@wix/form-public 0.528.0 → 0.529.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 CHANGED
@@ -51802,6 +51802,7 @@ var FIELDSET_RESET_STYLE = {
51802
51802
  };
51803
51803
  var AppointmentSlotPickerContext = React173.createContext(void 0);
51804
51804
  var getTimezoneNoteId = (inputId) => `${inputId}-timezone-note`;
51805
+ var getDateTitleId = (inputId) => `${inputId}-date-title`;
51805
51806
  var useAppointmentSlotPickerContext = () => {
51806
51807
  const context = React173.useContext(AppointmentSlotPickerContext);
51807
51808
  if (typeof context === "undefined") {
@@ -51930,15 +51931,13 @@ Dates.NextWeek = NextWeek;
51930
51931
  Dates.Day = Day;
51931
51932
  var RADIO_INPUT_SELECTOR = 'input[type="radio"]';
51932
51933
  var Slots = ({ children, className, ...internal }) => {
51933
- const { hasTimezoneNote } = internal;
51934
+ const { hasTimezoneNote, hasDateTitle } = internal;
51934
51935
  const { slots, selectedSlotKey, selectSlot, selectedDateLabel, isReloadingSlots, timezoneLabel, pendingFocusIndex, consumePendingFocusIndex } = useAppointmentSlotPickerContext();
51935
51936
  const { id: fieldId, disabled, readOnly, required, hasError } = useFieldPropsV2();
51936
51937
  const { inputId, labelId: fieldLabelId, ariaDescribedBy } = useFieldAttributes();
51937
51938
  const groupRef = React173.useRef(null);
51938
- const slotsLabelId = `${inputId}-slots-label`;
51939
- const labelElement = findChildOfType(children, Slots.Label);
51940
51939
  const slotElement = findChildOfType(children, Slots.Slot) ?? /* @__PURE__ */ React173__default.default.createElement(Slots.Slot, null);
51941
- const hasSlotsLabel = !!labelElement && !!selectedDateLabel;
51940
+ const isLabelledByDateTitle = !!hasDateTitle && !!selectedDateLabel;
51942
51941
  const describedBy = [
51943
51942
  ariaDescribedBy,
51944
51943
  hasTimezoneNote && timezoneLabel ? getTimezoneNoteId(inputId) : void 0
@@ -51978,29 +51977,14 @@ var Slots = ({ children, className, ...internal }) => {
51978
51977
  isReadOnly: readOnly,
51979
51978
  isRequired: required,
51980
51979
  isInvalid: hasError,
51981
- "aria-labelledby": hasSlotsLabel ? slotsLabelId : fieldLabelId,
51980
+ "aria-labelledby": isLabelledByDateTitle ? getDateTitleId(inputId) : fieldLabelId,
51982
51981
  "aria-describedby": describedBy,
51983
51982
  "data-refetch": isReloadingSlots || void 0
51984
- }, applyInternalProps(labelElement, {
51985
- labelId: slotsLabelId
51986
- }), slots.map((slot) => applyInternalProps(slotElement, {
51983
+ }, slots.map((slot) => applyInternalProps(slotElement, {
51987
51984
  key: slot.key,
51988
51985
  slot
51989
51986
  }))));
51990
51987
  };
51991
- var SlotsLabel = ({ children, className, ...internal }) => {
51992
- const { selectedDateLabel } = useAppointmentSlotPickerContext();
51993
- const { labelId } = internal;
51994
- if (!selectedDateLabel) {
51995
- return null;
51996
- }
51997
- return /* @__PURE__ */ React173__default.default.createElement("div", {
51998
- id: labelId,
51999
- className
52000
- }, children ? children({
52001
- label: selectedDateLabel
52002
- }) : selectedDateLabel);
52003
- };
52004
51988
  var Slot = ({ children, className, ...internal }) => {
52005
51989
  const { slot } = internal;
52006
51990
  return /* @__PURE__ */ React173__default.default.createElement(reactAriaComponents.RadioField, {
@@ -52010,7 +51994,6 @@ var Slot = ({ children, className, ...internal }) => {
52010
51994
  className
52011
51995
  }, children ? children(slot) : slot.timeRange));
52012
51996
  };
52013
- Slots.Label = SlotsLabel;
52014
51997
  Slots.Slot = Slot;
52015
51998
  var import_cloneDeep = __toESM(require_cloneDeep());
52016
51999
  var createIndicatorNode = (requiredIndicatorType, t, className) => {