@wix/form-public 0.499.0 → 0.501.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
@@ -925,7 +925,7 @@ var require_codegen = __commonJS({
925
925
  return `${this.lhs} ${this.op}= ${this.rhs};` + _n2;
926
926
  }
927
927
  };
928
- var Label2 = class extends Node2 {
928
+ var Label3 = class extends Node2 {
929
929
  constructor(label) {
930
930
  super();
931
931
  this.label = label;
@@ -1356,7 +1356,7 @@ var require_codegen = __commonJS({
1356
1356
  }
1357
1357
  // `label` statement
1358
1358
  label(label) {
1359
- return this._leafNode(new Label2(label));
1359
+ return this._leafNode(new Label3(label));
1360
1360
  }
1361
1361
  // `break` statement
1362
1362
  break(label) {
@@ -27085,7 +27085,7 @@ var init_fullscreen_modal = __esm({
27085
27085
  onToggleFullscreen,
27086
27086
  t
27087
27087
  }) => {
27088
- const Icon = isInFullscreen ? ShrinkIcon : ExpandIcon;
27088
+ const Icon2 = isInFullscreen ? ShrinkIcon : ExpandIcon;
27089
27089
  return /* @__PURE__ */ React172.createElement(
27090
27090
  "button",
27091
27091
  {
@@ -27095,7 +27095,7 @@ var init_fullscreen_modal = __esm({
27095
27095
  "aria-label": isInFullscreen ? t("Fullscreen_Shrink_Button_AriaLabel") : t("Fullscreen_Expand_Button_AriaLabel"),
27096
27096
  "data-hook": FULLSCREEN_TOGGLE_BUTTON
27097
27097
  },
27098
- /* @__PURE__ */ React172.createElement(Icon, { backgroundColor, foregroundColor })
27098
+ /* @__PURE__ */ React172.createElement(Icon2, { backgroundColor, foregroundColor })
27099
27099
  );
27100
27100
  };
27101
27101
  pauseChildNodesVideos = (element) => Array.from(element?.getElementsByTagName("video") || []).forEach((video) => video.pause());
@@ -51067,7 +51067,7 @@ Label.Image = LabelImage;
51067
51067
 
51068
51068
  // ../form-fields/dist/esm/headless/styled/shared/use-element-state-class-name.js
51069
51069
  __toESM(require_classnames());
51070
- createContext({});
51070
+ createContext(void 0);
51071
51071
  function useFocus({ onBlur, onFocus }) {
51072
51072
  const containerRef = useRef(null);
51073
51073
  const isFocused = useRef(false);
@@ -61557,26 +61557,40 @@ var NextButton = ({ className }) => {
61557
61557
  onPress: onNextClick
61558
61558
  }, nextText);
61559
61559
  };
61560
- var SubmitButtonComponent = ({ className, children }) => {
61560
+ var SubmitButtonComponent = ({ className, onHoverStart, onHoverEnd, children }) => {
61561
61561
  const { showSubmitButton, onSubmitClick, submitText, isDisabled, isInProgress, isSubmitting } = useFieldPropsV2();
61562
61562
  if (!showSubmitButton) {
61563
61563
  return null;
61564
61564
  }
61565
+ const labelElement = findChildOfType(children, SubmitButtonComponent.Label);
61566
+ const iconElement = findChildOfType(children, SubmitButtonComponent.Icon);
61565
61567
  const loaderElement = findChildOfType(children, SubmitButtonComponent.Loader);
61566
61568
  const isBusy = isSubmitting || isInProgress;
61567
61569
  return /* @__PURE__ */ React172.createElement(Button, {
61568
61570
  className,
61571
+ "aria-label": submitText,
61569
61572
  onPress: isBusy ? void 0 : onSubmitClick,
61573
+ onHoverStart,
61574
+ onHoverEnd,
61570
61575
  isDisabled: isDisabled && !isBusy,
61571
61576
  "aria-disabled": isBusy || void 0,
61572
61577
  "data-in-progress": isInProgress
61573
- }, isInProgress && loaderElement ? loaderElement : submitText);
61578
+ }, isInProgress && loaderElement ? loaderElement : /* @__PURE__ */ React172.createElement(React172.Fragment, null, labelElement ?? /* @__PURE__ */ React172.createElement(Label2, null), iconElement));
61579
+ };
61580
+ var Label2 = ({ className }) => {
61581
+ const { submitText } = useFieldPropsV2();
61582
+ return /* @__PURE__ */ React172.createElement("span", {
61583
+ className
61584
+ }, submitText);
61574
61585
  };
61586
+ var Icon = ({ children }) => /* @__PURE__ */ React172.createElement(React172.Fragment, null, children);
61575
61587
  var Loader2 = ({ className }) => {
61576
61588
  return /* @__PURE__ */ React172.createElement("span", {
61577
61589
  className
61578
61590
  }, /* @__PURE__ */ React172.createElement(ProgressCircle, null));
61579
61591
  };
61592
+ SubmitButtonComponent.Label = Label2;
61593
+ SubmitButtonComponent.Icon = Icon;
61580
61594
  SubmitButtonComponent.Loader = Loader2;
61581
61595
  ButtonsContainer.PreviousButton = PreviousButton;
61582
61596
  ButtonsContainer.NextButton = NextButton;