@facter/ds-core 1.3.1 → 1.3.2

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.mjs CHANGED
@@ -6794,19 +6794,26 @@ function WizardNavigation({
6794
6794
  const {
6795
6795
  isFirstStep,
6796
6796
  isLastStep,
6797
+ currentStep,
6797
6798
  goToNextStep,
6798
6799
  goToPrevStep,
6799
6800
  form
6800
6801
  } = useWizardContext();
6801
6802
  const isSubmitting = form.formState.isSubmitting;
6802
6803
  const shouldShowCancel = showCancel ?? isFirstStep;
6803
- const handleNext = useCallback(async () => {
6804
+ const handleNext = useCallback(async (e) => {
6805
+ e.preventDefault();
6806
+ e.stopPropagation();
6804
6807
  await goToNextStep();
6805
6808
  }, [goToNextStep]);
6806
- const handlePrev = useCallback(() => {
6809
+ const handlePrev = useCallback((e) => {
6810
+ e.preventDefault();
6811
+ e.stopPropagation();
6807
6812
  goToPrevStep();
6808
6813
  }, [goToPrevStep]);
6809
- const handleCancel = useCallback(() => {
6814
+ const handleCancel = useCallback((e) => {
6815
+ e.preventDefault();
6816
+ e.stopPropagation();
6810
6817
  onCancel?.();
6811
6818
  }, [onCancel]);
6812
6819
  return /* @__PURE__ */ jsxs(
@@ -6826,7 +6833,8 @@ function WizardNavigation({
6826
6833
  disabled: isSubmitting,
6827
6834
  className: "w-full sm:w-auto",
6828
6835
  children: cancelLabel
6829
- }
6836
+ },
6837
+ "cancel"
6830
6838
  ) : !isFirstStep ? /* @__PURE__ */ jsx(
6831
6839
  Button,
6832
6840
  {
@@ -6836,7 +6844,8 @@ function WizardNavigation({
6836
6844
  disabled: isSubmitting,
6837
6845
  className: "w-full sm:w-auto",
6838
6846
  children: prevLabel
6839
- }
6847
+ },
6848
+ "prev-left"
6840
6849
  ) : /* @__PURE__ */ jsx("div", {}) }),
6841
6850
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6842
6851
  !isFirstStep && shouldShowCancel && /* @__PURE__ */ jsx(
@@ -6847,7 +6856,8 @@ function WizardNavigation({
6847
6856
  onClick: handlePrev,
6848
6857
  disabled: isSubmitting,
6849
6858
  children: prevLabel
6850
- }
6859
+ },
6860
+ "prev-right"
6851
6861
  ),
6852
6862
  isLastStep ? /* @__PURE__ */ jsx(
6853
6863
  Button,
@@ -6859,7 +6869,8 @@ function WizardNavigation({
6859
6869
  /* @__PURE__ */ jsx(Loader, { variant: "spinner" }),
6860
6870
  loadingLabel
6861
6871
  ] }) : submitLabel
6862
- }
6872
+ },
6873
+ `submit-step-${currentStep}`
6863
6874
  ) : /* @__PURE__ */ jsx(
6864
6875
  Button,
6865
6876
  {
@@ -6868,7 +6879,8 @@ function WizardNavigation({
6868
6879
  disabled: isSubmitting,
6869
6880
  className: "min-w-[120px]",
6870
6881
  children: nextLabel
6871
- }
6882
+ },
6883
+ `next-step-${currentStep}`
6872
6884
  )
6873
6885
  ] })
6874
6886
  ]