@wix/form-public 0.509.0 → 0.511.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
@@ -51720,15 +51720,6 @@ function r(r3, e, n) {
51720
51720
  }, d;
51721
51721
  }
51722
51722
 
51723
- // ../form-fields/dist/esm/ui/options-layout/options-layout-constants.js
51724
- var NUMBER_OF_COLUMNS = /* @__PURE__ */ (function(NUMBER_OF_COLUMNS2) {
51725
- NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["FREE_FLOW"] = 0] = "FREE_FLOW";
51726
- NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["ONE"] = 1] = "ONE";
51727
- NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["TWO"] = 2] = "TWO";
51728
- NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["THREE"] = 3] = "THREE";
51729
- return NUMBER_OF_COLUMNS2;
51730
- })({});
51731
-
51732
51723
  // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-utils.js
51733
51724
  var OTHER_ID = "Other";
51734
51725
  var getValueIncludesOther = (value, optionsNames) => value.some((_value) => !optionsNames.includes(_value));
@@ -51746,7 +51737,7 @@ var getOtherValue = (value, addOtherLabel) => {
51746
51737
  var getOptionsValues = (options) => options.map((option2) => option2.value ?? option2.label);
51747
51738
 
51748
51739
  // ../form-fields/dist/esm/ui/checkbox-group-field/checkbox-group-field-headless.js
51749
- var CheckboxGroup = ({ children }) => {
51740
+ var CheckboxGroup = ({ children, className }) => {
51750
51741
  const props2 = useFieldPropsV2();
51751
51742
  const { id: id6, value, onChange, disabled, required, onBlur, onFocus, hasError, FieldLayout } = props2;
51752
51743
  const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
@@ -51773,6 +51764,7 @@ var CheckboxGroup = ({ children }) => {
51773
51764
  onBlur,
51774
51765
  onFocus
51775
51766
  }, /* @__PURE__ */ React172.createElement(CheckboxGroup$1, {
51767
+ className,
51776
51768
  "aria-labelledby": labelId,
51777
51769
  value: _value,
51778
51770
  onChange: handleChange,
@@ -51787,13 +51779,11 @@ var Options = ({ children, className }) => {
51787
51779
  const props2 = useFieldPropsV2();
51788
51780
  const { id: id6, options, addOther, addOtherLabel, numberOfColumns } = props2;
51789
51781
  const { t } = useTranslation2();
51790
- const { isMobile: isMobile2 } = useConfig();
51791
51782
  const optionElement = findChildOfType(children, Options.Option);
51792
51783
  const otherLabel = getOtherLabel(addOtherLabel, t);
51793
- const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
51794
51784
  return /* @__PURE__ */ React172.createElement("div", {
51795
51785
  className,
51796
- "data-columns": columns
51786
+ "data-columns": numberOfColumns
51797
51787
  }, options?.map((option2, index2) => {
51798
51788
  const checkboxValue = option2.value ?? option2.label;
51799
51789
  return applyInternalProps(optionElement, {
@@ -54210,7 +54200,7 @@ var Trigger = ({ children, className }) => {
54210
54200
  };
54211
54201
  var Calendar = ({ children, className, ...internal }) => {
54212
54202
  const { isForcedOpen } = internal;
54213
- const { regionalFormat, isMobile: isMobile2 } = useConfig();
54203
+ const { regionalFormat } = useConfig();
54214
54204
  const { availability } = useFieldPropsV2();
54215
54205
  const firstDayOfWeek = useMemo(() => getFirstDayOfTheWeek(regionalFormat), [
54216
54206
  regionalFormat
@@ -54252,7 +54242,7 @@ var Calendar = ({ children, className, ...internal }) => {
54252
54242
  items: aria.items,
54253
54243
  popoverClassName: className
54254
54244
  })), nextTriggerElement), /* @__PURE__ */ React172.createElement(CalendarGrid, {
54255
- weekdayStyle: isMobile2 ? "narrow" : "short"
54245
+ weekdayStyle: "short"
54256
54246
  }, (date) => applyInternalProps(dayElement, {
54257
54247
  date
54258
54248
  })))));
@@ -55089,12 +55079,10 @@ var Control3 = ({ children, className, ...internal }) => {
55089
55079
  var Options2 = ({ children, className, ...internal }) => {
55090
55080
  const { productsById } = internal;
55091
55081
  const { options, numberOfColumns } = useFieldPropsV2();
55092
- const { isMobile: isMobile2 } = useConfig();
55093
55082
  const optionElement = findChildOfType(children, Options2.Option);
55094
- const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
55095
55083
  return /* @__PURE__ */ React172.createElement("div", {
55096
55084
  className,
55097
- "data-columns": columns
55085
+ "data-columns": numberOfColumns
55098
55086
  }, options.map((option2) => {
55099
55087
  const product = productsById[option2.value];
55100
55088
  const price = product?.fixedPriceOptions?.price;
@@ -55512,7 +55500,7 @@ var getOtherValue2 = (value, addOtherLabel) => {
55512
55500
  };
55513
55501
 
55514
55502
  // ../form-fields/dist/esm/ui/radio-group-field/radio-group-field-headless.js
55515
- var RadioGroup = ({ children }) => {
55503
+ var RadioGroup = ({ children, className }) => {
55516
55504
  const { id: id6, value, onChange, disabled, readOnly, required, onBlur, onFocus, hasError, FieldLayout, options } = useFieldPropsV2();
55517
55505
  const { inputId, labelId, ariaDescribedBy } = useFieldAttributes();
55518
55506
  const labelElement = findChildOfType(children, RadioGroup.Label);
@@ -55527,6 +55515,7 @@ var RadioGroup = ({ children }) => {
55527
55515
  }),
55528
55516
  renderInput: () => /* @__PURE__ */ React172.createElement(RadioGroup$1, {
55529
55517
  id: inputId,
55518
+ className,
55530
55519
  "aria-labelledby": labelId,
55531
55520
  "aria-describedby": ariaDescribedBy,
55532
55521
  value: groupValue,
@@ -55544,17 +55533,15 @@ var RadioGroup = ({ children }) => {
55544
55533
  var Options4 = ({ children, className }) => {
55545
55534
  const { options, addOther, addOtherLabel, id: id6, numberOfColumns, hasError } = useFieldPropsV2();
55546
55535
  const { t } = useTranslation2();
55547
- const { isMobile: isMobile2 } = useConfig();
55548
55536
  const optionElement = findChildOfType(children, RadioGroup.Option);
55549
55537
  const firstRadioRef = useRef(null);
55550
55538
  const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID2;
55551
- const columns = isMobile2 ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
55552
55539
  useFocusFieldEvent(() => {
55553
55540
  firstRadioRef.current?.focus();
55554
55541
  }, id6);
55555
55542
  return /* @__PURE__ */ React172.createElement("div", {
55556
55543
  className,
55557
- "data-columns": columns,
55544
+ "data-columns": numberOfColumns,
55558
55545
  "data-invalid": hasError
55559
55546
  }, options.map((option2, index2) => applyInternalProps(optionElement, {
55560
55547
  key: option2.value ?? option2.label,
@@ -56198,12 +56185,11 @@ FixedPayment.Amount = Amount;
56198
56185
  FixedPayment.Description = Description;
56199
56186
  FixedPayment.Error = Error2;
56200
56187
  var Options5 = ({ children, className }) => {
56201
- const { isMobile: isMobile2 } = useConfig();
56202
56188
  const { id: id6, options, numberOfColumns } = useFieldPropsV2();
56203
56189
  const optionElement = findChildOfType(children, Options5.Option);
56204
56190
  return /* @__PURE__ */ React172.createElement("div", {
56205
56191
  className,
56206
- "data-columns": isMobile2 ? 1 : numberOfColumns
56192
+ "data-columns": numberOfColumns
56207
56193
  }, options?.map((option2, index2) => applyInternalProps(optionElement, {
56208
56194
  key: option2.id || option2.label,
56209
56195
  option: option2,
@@ -61738,6 +61724,15 @@ ButtonsContainer.NextButton = NextButton;
61738
61724
  ButtonsContainer.SubmitButton = SubmitButtonComponent;
61739
61725
  SubmitButton.SubmitButton = ButtonsContainer;
61740
61726
 
61727
+ // ../form-fields/dist/esm/ui/options-layout/options-layout-constants.js
61728
+ var NUMBER_OF_COLUMNS = /* @__PURE__ */ (function(NUMBER_OF_COLUMNS2) {
61729
+ NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["FREE_FLOW"] = 0] = "FREE_FLOW";
61730
+ NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["ONE"] = 1] = "ONE";
61731
+ NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["TWO"] = 2] = "TWO";
61732
+ NUMBER_OF_COLUMNS2[NUMBER_OF_COLUMNS2["THREE"] = 3] = "THREE";
61733
+ return NUMBER_OF_COLUMNS2;
61734
+ })({});
61735
+
61741
61736
  // ../form-fields/dist/esm/ui/tags-field/tags-field-utils.js
61742
61737
  var OTHER_ID3 = "Other";
61743
61738
  var getOtherValue3 = (value, addOtherLabel) => {
@@ -61855,9 +61850,7 @@ var Option12 = ({ children, className, ...internal }) => {
61855
61850
  };
61856
61851
  var Options12 = ({ children, className }) => {
61857
61852
  const { options, addOther, addOtherLabel, numberOfColumns = NUMBER_OF_COLUMNS.FREE_FLOW } = useFieldPropsV2();
61858
- const { isMobile: isMobile2 } = useConfig();
61859
61853
  const { t } = useTranslation2();
61860
- const columns = isMobile2 && numberOfColumns !== NUMBER_OF_COLUMNS.FREE_FLOW ? NUMBER_OF_COLUMNS.ONE : numberOfColumns;
61861
61854
  const otherLabel = addOtherLabel || t("add-other.default-other-option-label") || OTHER_ID3;
61862
61855
  const optionElement = findChildOfType(children, Option12);
61863
61856
  const allOptions = useMemo(() => {
@@ -61883,7 +61876,7 @@ var Options12 = ({ children, className }) => {
61883
61876
  }
61884
61877
  return /* @__PURE__ */ React172.createElement("div", {
61885
61878
  className,
61886
- "data-columns": columns
61879
+ "data-columns": numberOfColumns
61887
61880
  }, allOptions.map((option2, index2) => {
61888
61881
  const optionValue = option2.value ?? option2.label;
61889
61882
  return applyInternalProps(optionElement, {