@wix/form-public 0.483.0 → 0.485.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
@@ -51761,10 +51761,11 @@ var Options = ({ children, className }) => {
51761
51761
  isOther: true
51762
51762
  }));
51763
51763
  };
51764
- var OptionInput = ({ className }) => {
51764
+ var OptionInput = ({ className, ...internal }) => {
51765
+ const renderProps = internal;
51765
51766
  return /* @__PURE__ */ React171.createElement("div", {
51766
51767
  "aria-hidden": "true",
51767
- className
51768
+ className: typeof className === "function" ? className(renderProps) : className
51768
51769
  });
51769
51770
  };
51770
51771
  var OptionLabel = ({ className, ...internal }) => {
@@ -51829,9 +51830,12 @@ var Checkbox2 = ({ children, className, ...internal }) => {
51829
51830
  ref: checkboxRef,
51830
51831
  className,
51831
51832
  "data-hook": `checkbox-${label}`
51832
- }, inputElement, applyInternalProps(labelElement, {
51833
+ }, ({ isSelected, isHovered }) => /* @__PURE__ */ React171.createElement(React171.Fragment, null, applyInternalProps(inputElement, {
51834
+ isSelected,
51835
+ isHovered
51836
+ }), applyInternalProps(labelElement, {
51833
51837
  label
51834
- })));
51838
+ }))));
51835
51839
  };
51836
51840
  Checkbox2.Label = OptionLabel;
51837
51841
  Checkbox2.Input = OptionInput;
@@ -54944,11 +54948,23 @@ var Control3 = ({ children, className, ...internal }) => {
54944
54948
  className,
54945
54949
  "data-invalid": hasError
54946
54950
  }, optionsElement ? applyInternalProps(optionsElement, {
54947
- productsById,
54948
- addOther,
54949
- customAmountProductId,
54950
- t
54951
- }) : null, otherInputElement && addOther ? applyInternalProps(otherInputElement, {
54951
+ productsById
54952
+ }) : null, addOther && customAmountProductId && /* @__PURE__ */ React171.createElement(RadioField, {
54953
+ value: customAmountProductId,
54954
+ style: {
54955
+ position: "absolute",
54956
+ width: "1px",
54957
+ height: "1px",
54958
+ padding: "0",
54959
+ margin: "-1px",
54960
+ overflow: "hidden",
54961
+ clip: "rect(0, 0, 0, 0)",
54962
+ whiteSpace: "nowrap",
54963
+ border: "0"
54964
+ }
54965
+ }, /* @__PURE__ */ React171.createElement(RadioButton, {
54966
+ "aria-label": t("donation.other-option.label", "Custom amount")
54967
+ }, t("donation.other-option.label", "Custom amount"))), otherInputElement && addOther ? applyInternalProps(otherInputElement, {
54952
54968
  customAmount,
54953
54969
  onCustomAmountInputChange,
54954
54970
  currency,
@@ -54959,7 +54975,7 @@ var Control3 = ({ children, className, ...internal }) => {
54959
54975
  }) : null);
54960
54976
  };
54961
54977
  var Options2 = ({ children, className, ...internal }) => {
54962
- const { productsById, addOther, customAmountProductId, t } = internal;
54978
+ const { productsById } = internal;
54963
54979
  const { options, numberOfColumns } = useFieldPropsV2();
54964
54980
  const { isMobile: isMobile2 } = useConfig();
54965
54981
  const optionElement = findChildOfType(children, Options2.Option);
@@ -54975,22 +54991,7 @@ var Options2 = ({ children, className, ...internal }) => {
54975
54991
  value: option2.value,
54976
54992
  price: price || "0"
54977
54993
  });
54978
- }), addOther && customAmountProductId && /* @__PURE__ */ React171.createElement(RadioField, {
54979
- value: customAmountProductId,
54980
- style: {
54981
- position: "absolute",
54982
- width: "1px",
54983
- height: "1px",
54984
- padding: "0",
54985
- margin: "-1px",
54986
- overflow: "hidden",
54987
- clip: "rect(0, 0, 0, 0)",
54988
- whiteSpace: "nowrap",
54989
- border: "0"
54990
- }
54991
- }, /* @__PURE__ */ React171.createElement(RadioButton, {
54992
- "aria-label": t("donation.other-option.label", "Custom amount")
54993
- }, t("donation.other-option.label", "Custom amount"))));
54994
+ }));
54994
54995
  };
54995
54996
  var Option2 = ({ children, className, ...internal }) => {
54996
54997
  const { value, price } = internal;
@@ -55058,23 +55059,24 @@ var OtherInput2 = ({ children, className, ...internal }) => {
55058
55059
  }, [
55059
55060
  onFocusCustomInput
55060
55061
  ]);
55061
- const hasValue = customAmount && customAmount.trim() !== "";
55062
55062
  return /* @__PURE__ */ React171.createElement(TextField, {
55063
55063
  "aria-labelledby": `${labelId} ${prefixId}`,
55064
55064
  value: customAmount,
55065
55065
  onChange: handleChange,
55066
55066
  onFocus: handleFocus,
55067
55067
  isDisabled: disabled,
55068
- isInvalid: hasError,
55068
+ isInvalid: hasError
55069
+ }, /* @__PURE__ */ React171.createElement(Group, {
55069
55070
  className,
55070
- "data-selected": hasValue ? "true" : void 0
55071
+ isDisabled: disabled,
55072
+ isInvalid: hasError
55071
55073
  }, customAmount && currency && currencyElement ? applyInternalProps(currencyElement, {
55072
55074
  currency,
55073
55075
  t
55074
55076
  }) : null, valueElement ? applyInternalProps(valueElement, {
55075
55077
  placeholder,
55076
55078
  customAmountProductId
55077
- }) : null);
55079
+ }) : null));
55078
55080
  };
55079
55081
  var OtherInputCurrency = ({ className, ...internal }) => {
55080
55082
  const { currency, t } = internal;