@homebound/beam 3.70.0 → 3.71.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.d.cts CHANGED
@@ -9944,7 +9944,26 @@ type StepperTabProps = {
9944
9944
  };
9945
9945
  declare function StepperTab(props: StepperTabProps): JSX.Element;
9946
9946
 
9947
- type StepperTabsStep = Pick<StepperTabProps, "label" | "value" | "completed" | "disabled">;
9947
+ type WorkflowActionsProps = {
9948
+ isFirstStep: boolean;
9949
+ isLastStep: boolean;
9950
+ isMobile: boolean;
9951
+ onBack: () => void;
9952
+ /** Leaves the workflow without saving. Always shown. */
9953
+ onCancel: (e: PressEvent) => void;
9954
+ /** Saves partial progress and exits. Used whenever canExitEarly is true. */
9955
+ onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
9956
+ /** Label for the completion button shown on the last step. */
9957
+ completeLabel: "Create" | "Save";
9958
+ /** Called when the completion button is clicked. Only shown on the last step. */
9959
+ onComplete: (e: PressEvent) => void | Promise<void>;
9960
+ /** Runs before continuing to the next step. Return `false` to stay put, like when the save failed. */
9961
+ onContinue: () => boolean | void | Promise<boolean | void>;
9962
+ /** Disables whichever of Continue/Complete is currently shown, e.g. while the active step is invalid. */
9963
+ primaryDisabled?: boolean;
9964
+ };
9965
+
9966
+ type StepperTabsStep = Pick<StepperTabProps, "label" | "value" | "completed" | "disabled"> & Partial<Pick<WorkflowActionsProps, "onContinue">>;
9948
9967
  type StepperTabsProps = {
9949
9968
  steps: StepperTabsStep[];
9950
9969
  currentStep: StepperTabsStep["value"];
@@ -10237,24 +10256,6 @@ type PageHeaderLayoutProps<V extends string, X> = {
10237
10256
  /** Page header + body shell with auto-hide chrome. Contract: `docs/layouts.md`. */
10238
10257
  declare function PageHeaderLayout<V extends string, X extends Only<TabsContentXss, X>>(props: PageHeaderLayoutProps<V, X>): JSX.Element;
10239
10258
 
10240
- type WorkflowActionsProps = {
10241
- isFirstStep: boolean;
10242
- isLastStep: boolean;
10243
- isMobile: boolean;
10244
- onBack: () => void;
10245
- /** Leaves the workflow without saving. Always shown. */
10246
- onCancel: (e: PressEvent) => void;
10247
- /** Saves partial progress and exits. Used whenever canExitEarly is true. */
10248
- onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
10249
- /** Label for the completion button shown on the last step. */
10250
- completeLabel: "Create" | "Save";
10251
- /** Called when the completion button is clicked. Only shown on the last step. */
10252
- onComplete: (e: PressEvent) => void | Promise<void>;
10253
- onContinue: () => void;
10254
- /** Disables whichever of Continue/Complete is currently shown, e.g. while the active step is invalid. */
10255
- primaryDisabled?: boolean;
10256
- };
10257
-
10258
10259
  /** A `WorkflowLayout` step: a `StepperTabsStep` (minus `value`, which is derived from `label`) plus the page content rendered while it's active — `completed` also gates the Continue/Complete CTA when this is the active step. */
10259
10260
  type WorkflowLayoutStep = Omit<StepperTabsStep, "value"> & {
10260
10261
  /** Rendered as the page body while this is the active step. */
package/dist/index.d.ts CHANGED
@@ -9944,7 +9944,26 @@ type StepperTabProps = {
9944
9944
  };
9945
9945
  declare function StepperTab(props: StepperTabProps): JSX.Element;
9946
9946
 
9947
- type StepperTabsStep = Pick<StepperTabProps, "label" | "value" | "completed" | "disabled">;
9947
+ type WorkflowActionsProps = {
9948
+ isFirstStep: boolean;
9949
+ isLastStep: boolean;
9950
+ isMobile: boolean;
9951
+ onBack: () => void;
9952
+ /** Leaves the workflow without saving. Always shown. */
9953
+ onCancel: (e: PressEvent) => void;
9954
+ /** Saves partial progress and exits. Used whenever canExitEarly is true. */
9955
+ onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
9956
+ /** Label for the completion button shown on the last step. */
9957
+ completeLabel: "Create" | "Save";
9958
+ /** Called when the completion button is clicked. Only shown on the last step. */
9959
+ onComplete: (e: PressEvent) => void | Promise<void>;
9960
+ /** Runs before continuing to the next step. Return `false` to stay put, like when the save failed. */
9961
+ onContinue: () => boolean | void | Promise<boolean | void>;
9962
+ /** Disables whichever of Continue/Complete is currently shown, e.g. while the active step is invalid. */
9963
+ primaryDisabled?: boolean;
9964
+ };
9965
+
9966
+ type StepperTabsStep = Pick<StepperTabProps, "label" | "value" | "completed" | "disabled"> & Partial<Pick<WorkflowActionsProps, "onContinue">>;
9948
9967
  type StepperTabsProps = {
9949
9968
  steps: StepperTabsStep[];
9950
9969
  currentStep: StepperTabsStep["value"];
@@ -10237,24 +10256,6 @@ type PageHeaderLayoutProps<V extends string, X> = {
10237
10256
  /** Page header + body shell with auto-hide chrome. Contract: `docs/layouts.md`. */
10238
10257
  declare function PageHeaderLayout<V extends string, X extends Only<TabsContentXss, X>>(props: PageHeaderLayoutProps<V, X>): JSX.Element;
10239
10258
 
10240
- type WorkflowActionsProps = {
10241
- isFirstStep: boolean;
10242
- isLastStep: boolean;
10243
- isMobile: boolean;
10244
- onBack: () => void;
10245
- /** Leaves the workflow without saving. Always shown. */
10246
- onCancel: (e: PressEvent) => void;
10247
- /** Saves partial progress and exits. Used whenever canExitEarly is true. */
10248
- onSaveAndExit?: (e: PressEvent) => void | Promise<void>;
10249
- /** Label for the completion button shown on the last step. */
10250
- completeLabel: "Create" | "Save";
10251
- /** Called when the completion button is clicked. Only shown on the last step. */
10252
- onComplete: (e: PressEvent) => void | Promise<void>;
10253
- onContinue: () => void;
10254
- /** Disables whichever of Continue/Complete is currently shown, e.g. while the active step is invalid. */
10255
- primaryDisabled?: boolean;
10256
- };
10257
-
10258
10259
  /** A `WorkflowLayout` step: a `StepperTabsStep` (minus `value`, which is derived from `label`) plus the page content rendered while it's active — `completed` also gates the Continue/Complete CTA when this is the active step. */
10259
10260
  type WorkflowLayoutStep = Omit<StepperTabsStep, "value"> & {
10260
10261
  /** Rendered as the page body while this is the active step. */
package/dist/index.js CHANGED
@@ -26594,7 +26594,14 @@ function WorkflowLayout(props) {
26594
26594
  const isFirstStep = currentIndex <= 0;
26595
26595
  const isLastStep = currentIndex === tabSteps.length - 1;
26596
26596
  const activeStep = tabSteps[currentIndex];
26597
- const buttons = /* @__PURE__ */ jsx218(WorkflowActions, { isFirstStep, isLastStep, isMobile, onBack: () => setCurrentStep(tabSteps[currentIndex - 1].value), onCancel: onCancelClick, onSaveAndExit, completeLabel, onComplete, primaryDisabled: !activeStep?.completed, onContinue: () => setCurrentStep(tabSteps[currentIndex + 1].value) });
26597
+ const buttons = /* @__PURE__ */ jsx218(WorkflowActions, { isFirstStep, isLastStep, isMobile, onBack: () => setCurrentStep(tabSteps[currentIndex - 1].value), onCancel: onCancelClick, onSaveAndExit, completeLabel, onComplete, primaryDisabled: !activeStep?.completed, onContinue: async () => {
26598
+ const onContinue = activeStep?.onContinue;
26599
+ if (onContinue) {
26600
+ const allowed = await onContinue();
26601
+ if (allowed === false) return;
26602
+ }
26603
+ setCurrentStep(tabSteps[currentIndex + 1].value);
26604
+ } });
26598
26605
  const showFooter = isMobile;
26599
26606
  useLayoutEffect10(() => {
26600
26607
  const root = document.documentElement;