@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.cjs CHANGED
@@ -51771,10 +51771,11 @@ var Options = ({ children, className }) => {
51771
51771
  isOther: true
51772
51772
  }));
51773
51773
  };
51774
- var OptionInput = ({ className }) => {
51774
+ var OptionInput = ({ className, ...internal }) => {
51775
+ const renderProps = internal;
51775
51776
  return /* @__PURE__ */ React171__default.default.createElement("div", {
51776
51777
  "aria-hidden": "true",
51777
- className
51778
+ className: typeof className === "function" ? className(renderProps) : className
51778
51779
  });
51779
51780
  };
51780
51781
  var OptionLabel = ({ className, ...internal }) => {
@@ -51839,9 +51840,12 @@ var Checkbox2 = ({ children, className, ...internal }) => {
51839
51840
  ref: checkboxRef,
51840
51841
  className,
51841
51842
  "data-hook": `checkbox-${label}`
51842
- }, inputElement, applyInternalProps(labelElement, {
51843
+ }, ({ isSelected, isHovered }) => /* @__PURE__ */ React171__default.default.createElement(React171__default.default.Fragment, null, applyInternalProps(inputElement, {
51844
+ isSelected,
51845
+ isHovered
51846
+ }), applyInternalProps(labelElement, {
51843
51847
  label
51844
- })));
51848
+ }))));
51845
51849
  };
51846
51850
  Checkbox2.Label = OptionLabel;
51847
51851
  Checkbox2.Input = OptionInput;
@@ -54954,11 +54958,23 @@ var Control3 = ({ children, className, ...internal }) => {
54954
54958
  className,
54955
54959
  "data-invalid": hasError
54956
54960
  }, optionsElement ? applyInternalProps(optionsElement, {
54957
- productsById,
54958
- addOther,
54959
- customAmountProductId,
54960
- t
54961
- }) : null, otherInputElement && addOther ? applyInternalProps(otherInputElement, {
54961
+ productsById
54962
+ }) : null, addOther && customAmountProductId && /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.RadioField, {
54963
+ value: customAmountProductId,
54964
+ style: {
54965
+ position: "absolute",
54966
+ width: "1px",
54967
+ height: "1px",
54968
+ padding: "0",
54969
+ margin: "-1px",
54970
+ overflow: "hidden",
54971
+ clip: "rect(0, 0, 0, 0)",
54972
+ whiteSpace: "nowrap",
54973
+ border: "0"
54974
+ }
54975
+ }, /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.RadioButton, {
54976
+ "aria-label": t("donation.other-option.label", "Custom amount")
54977
+ }, t("donation.other-option.label", "Custom amount"))), otherInputElement && addOther ? applyInternalProps(otherInputElement, {
54962
54978
  customAmount,
54963
54979
  onCustomAmountInputChange,
54964
54980
  currency,
@@ -54969,7 +54985,7 @@ var Control3 = ({ children, className, ...internal }) => {
54969
54985
  }) : null);
54970
54986
  };
54971
54987
  var Options2 = ({ children, className, ...internal }) => {
54972
- const { productsById, addOther, customAmountProductId, t } = internal;
54988
+ const { productsById } = internal;
54973
54989
  const { options, numberOfColumns } = useFieldPropsV2();
54974
54990
  const { isMobile: isMobile2 } = useConfig();
54975
54991
  const optionElement = findChildOfType(children, Options2.Option);
@@ -54985,22 +55001,7 @@ var Options2 = ({ children, className, ...internal }) => {
54985
55001
  value: option2.value,
54986
55002
  price: price || "0"
54987
55003
  });
54988
- }), addOther && customAmountProductId && /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.RadioField, {
54989
- value: customAmountProductId,
54990
- style: {
54991
- position: "absolute",
54992
- width: "1px",
54993
- height: "1px",
54994
- padding: "0",
54995
- margin: "-1px",
54996
- overflow: "hidden",
54997
- clip: "rect(0, 0, 0, 0)",
54998
- whiteSpace: "nowrap",
54999
- border: "0"
55000
- }
55001
- }, /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.RadioButton, {
55002
- "aria-label": t("donation.other-option.label", "Custom amount")
55003
- }, t("donation.other-option.label", "Custom amount"))));
55004
+ }));
55004
55005
  };
55005
55006
  var Option2 = ({ children, className, ...internal }) => {
55006
55007
  const { value, price } = internal;
@@ -55068,23 +55069,24 @@ var OtherInput2 = ({ children, className, ...internal }) => {
55068
55069
  }, [
55069
55070
  onFocusCustomInput
55070
55071
  ]);
55071
- const hasValue = customAmount && customAmount.trim() !== "";
55072
55072
  return /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.TextField, {
55073
55073
  "aria-labelledby": `${labelId} ${prefixId}`,
55074
55074
  value: customAmount,
55075
55075
  onChange: handleChange,
55076
55076
  onFocus: handleFocus,
55077
55077
  isDisabled: disabled,
55078
- isInvalid: hasError,
55078
+ isInvalid: hasError
55079
+ }, /* @__PURE__ */ React171__default.default.createElement(reactAriaComponents.Group, {
55079
55080
  className,
55080
- "data-selected": hasValue ? "true" : void 0
55081
+ isDisabled: disabled,
55082
+ isInvalid: hasError
55081
55083
  }, customAmount && currency && currencyElement ? applyInternalProps(currencyElement, {
55082
55084
  currency,
55083
55085
  t
55084
55086
  }) : null, valueElement ? applyInternalProps(valueElement, {
55085
55087
  placeholder,
55086
55088
  customAmountProductId
55087
- }) : null);
55089
+ }) : null));
55088
55090
  };
55089
55091
  var OtherInputCurrency = ({ className, ...internal }) => {
55090
55092
  const { currency, t } = internal;