@homebound/beam 3.68.0 → 3.69.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
@@ -7257,7 +7257,7 @@ declare enum SuperDrawerWidth {
7257
7257
  Normal = 1040
7258
7258
  }
7259
7259
 
7260
- interface OpenInDrawerOpts {
7260
+ type OpenInDrawerOpts = {
7261
7261
  /** Invokes left, disabled if undefined. */
7262
7262
  onPrevClick?: () => void;
7263
7263
  /** Invokes right, disabled if undefined. */
@@ -7267,10 +7267,10 @@ interface OpenInDrawerOpts {
7267
7267
  content: ReactNode;
7268
7268
  /** Adds the ability to change the SuperDrawer width based on some pre-defined values */
7269
7269
  width?: SuperDrawerWidth;
7270
- }
7271
- interface OpenDetailOpts {
7270
+ };
7271
+ type OpenDetailOpts = {
7272
7272
  content: ReactNode;
7273
- }
7273
+ };
7274
7274
  type ContentStack = {
7275
7275
  kind: "open";
7276
7276
  opts: OpenInDrawerOpts;
@@ -7279,7 +7279,7 @@ type ContentStack = {
7279
7279
  opts: OpenDetailOpts;
7280
7280
  };
7281
7281
  /** The public API for interacting with `useSuperDrawer`. */
7282
- interface UseSuperDrawerHook {
7282
+ type UseSuperDrawerHook = {
7283
7283
  /** Opens a new drawer, throwing away the current drawer is one exists. */
7284
7284
  openInDrawer: (opts: OpenInDrawerOpts) => void;
7285
7285
  /** Closes the entire drawer, returns false is the previous drawer can't be closed. */
@@ -7304,7 +7304,7 @@ interface UseSuperDrawerHook {
7304
7304
  * the action.
7305
7305
  */
7306
7306
  addCanCloseDrawerDetailCheck: (canCloseCheck: CanCloseCheck) => void;
7307
- }
7307
+ };
7308
7308
  declare function useSuperDrawer(): UseSuperDrawerHook;
7309
7309
 
7310
7310
  type BeamProviderProps = {
@@ -9746,6 +9746,18 @@ type MaxLinesProps = PropsWithChildren<{
9746
9746
  }>;
9747
9747
  declare function MaxLines({ maxLines, children }: MaxLinesProps): JSX.Element;
9748
9748
 
9749
+ type ConfirmCloseModalProps = {
9750
+ onClose: () => void;
9751
+ /** Called when the user chooses to stay (in addition to closing the modal). */
9752
+ onContinue?: () => void;
9753
+ title?: ReactNode;
9754
+ message?: ReactNode;
9755
+ discardText?: string;
9756
+ continueText?: string;
9757
+ };
9758
+ /** Modal content for discarding unsaved changes (SuperDrawer close, WorkflowLayout leave, etc.). */
9759
+ declare function ConfirmCloseModal(props: ConfirmCloseModalProps): JSX.Element;
9760
+
9749
9761
  interface OpenModalProps {
9750
9762
  /** The custom modal content to show. */
9751
9763
  children: JSX.Element;
@@ -9950,14 +9962,6 @@ interface SuperDrawerHeaderStructuredProps {
9950
9962
  }
9951
9963
  declare function SuperDrawerHeader(props: SuperDrawerHeaderProps | SuperDrawerHeaderStructuredProps): JSX.Element;
9952
9964
 
9953
- interface ConfirmCloseModalProps {
9954
- onClose: () => void;
9955
- discardText?: string;
9956
- continueText?: string;
9957
- }
9958
- /** Modal content to appear when a close checks fails */
9959
- declare function ConfirmCloseModal(props: ConfirmCloseModalProps): JSX.Element;
9960
-
9961
9965
  type SuperDrawerContentProps = {
9962
9966
  children: ReactNode;
9963
9967
  /**
@@ -10257,6 +10261,8 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
10257
10261
  steps: WorkflowLayoutStep[];
10258
10262
  /** The step shown initially (matched against `defaultTestId(step.label)`); falls back to the first step if omitted or if it doesn't match any step. Uncontrolled — the layout owns step navigation from here. */
10259
10263
  defaultStep?: string;
10264
+ /** When this returns true, Cancel / in-app route changes / tab close require confirmation. */
10265
+ isDirty?: () => boolean;
10260
10266
  };
10261
10267
  /**
10262
10268
  * Workflow-header + body shell with sticky (always-visible) chrome. Contract: `docs/layouts.md`.
@@ -10268,7 +10274,7 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
10268
10274
  *
10269
10275
  * Owns the workflow's fixed CTA set (Back/Cancel/Save & Exit/Continue-or-Complete) via `WorkflowActions`
10270
10276
  * so it can move them into a mobile footer at the `sm` breakpoint — `WorkflowHeader` itself is not part
10271
- * of the public API.
10277
+ * of the public API. Pass `isDirty` to confirm before Cancel, in-app navigation, or tab close.
10272
10278
  */
10273
10279
  declare function WorkflowLayout(props: WorkflowLayoutProps): JSX.Element;
10274
10280
 
@@ -10297,8 +10303,6 @@ declare const zIndices: {
10297
10303
  readonly tableActions: 45;
10298
10304
  readonly scrollToTop: 50;
10299
10305
  readonly scrollShadow: 50;
10300
- readonly superDrawerScrim: 55;
10301
- readonly modalUnderlay: 60;
10302
10306
  readonly pageStickyHeader: 70;
10303
10307
  readonly pageStickyFooter: 70;
10304
10308
  readonly dragHandle: 80;
@@ -10307,6 +10311,8 @@ declare const zIndices: {
10307
10311
  readonly navbarMobileMenuScrim: 124;
10308
10312
  readonly navbarMobileMenu: 125;
10309
10313
  readonly environmentBanner: 130;
10314
+ readonly superDrawerScrim: 140;
10315
+ readonly modalUnderlay: 150;
10310
10316
  readonly pageOverlay: 1000;
10311
10317
  readonly snackbar: 1100;
10312
10318
  };
package/dist/index.d.ts CHANGED
@@ -7257,7 +7257,7 @@ declare enum SuperDrawerWidth {
7257
7257
  Normal = 1040
7258
7258
  }
7259
7259
 
7260
- interface OpenInDrawerOpts {
7260
+ type OpenInDrawerOpts = {
7261
7261
  /** Invokes left, disabled if undefined. */
7262
7262
  onPrevClick?: () => void;
7263
7263
  /** Invokes right, disabled if undefined. */
@@ -7267,10 +7267,10 @@ interface OpenInDrawerOpts {
7267
7267
  content: ReactNode;
7268
7268
  /** Adds the ability to change the SuperDrawer width based on some pre-defined values */
7269
7269
  width?: SuperDrawerWidth;
7270
- }
7271
- interface OpenDetailOpts {
7270
+ };
7271
+ type OpenDetailOpts = {
7272
7272
  content: ReactNode;
7273
- }
7273
+ };
7274
7274
  type ContentStack = {
7275
7275
  kind: "open";
7276
7276
  opts: OpenInDrawerOpts;
@@ -7279,7 +7279,7 @@ type ContentStack = {
7279
7279
  opts: OpenDetailOpts;
7280
7280
  };
7281
7281
  /** The public API for interacting with `useSuperDrawer`. */
7282
- interface UseSuperDrawerHook {
7282
+ type UseSuperDrawerHook = {
7283
7283
  /** Opens a new drawer, throwing away the current drawer is one exists. */
7284
7284
  openInDrawer: (opts: OpenInDrawerOpts) => void;
7285
7285
  /** Closes the entire drawer, returns false is the previous drawer can't be closed. */
@@ -7304,7 +7304,7 @@ interface UseSuperDrawerHook {
7304
7304
  * the action.
7305
7305
  */
7306
7306
  addCanCloseDrawerDetailCheck: (canCloseCheck: CanCloseCheck) => void;
7307
- }
7307
+ };
7308
7308
  declare function useSuperDrawer(): UseSuperDrawerHook;
7309
7309
 
7310
7310
  type BeamProviderProps = {
@@ -9746,6 +9746,18 @@ type MaxLinesProps = PropsWithChildren<{
9746
9746
  }>;
9747
9747
  declare function MaxLines({ maxLines, children }: MaxLinesProps): JSX.Element;
9748
9748
 
9749
+ type ConfirmCloseModalProps = {
9750
+ onClose: () => void;
9751
+ /** Called when the user chooses to stay (in addition to closing the modal). */
9752
+ onContinue?: () => void;
9753
+ title?: ReactNode;
9754
+ message?: ReactNode;
9755
+ discardText?: string;
9756
+ continueText?: string;
9757
+ };
9758
+ /** Modal content for discarding unsaved changes (SuperDrawer close, WorkflowLayout leave, etc.). */
9759
+ declare function ConfirmCloseModal(props: ConfirmCloseModalProps): JSX.Element;
9760
+
9749
9761
  interface OpenModalProps {
9750
9762
  /** The custom modal content to show. */
9751
9763
  children: JSX.Element;
@@ -9950,14 +9962,6 @@ interface SuperDrawerHeaderStructuredProps {
9950
9962
  }
9951
9963
  declare function SuperDrawerHeader(props: SuperDrawerHeaderProps | SuperDrawerHeaderStructuredProps): JSX.Element;
9952
9964
 
9953
- interface ConfirmCloseModalProps {
9954
- onClose: () => void;
9955
- discardText?: string;
9956
- continueText?: string;
9957
- }
9958
- /** Modal content to appear when a close checks fails */
9959
- declare function ConfirmCloseModal(props: ConfirmCloseModalProps): JSX.Element;
9960
-
9961
9965
  type SuperDrawerContentProps = {
9962
9966
  children: ReactNode;
9963
9967
  /**
@@ -10257,6 +10261,8 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
10257
10261
  steps: WorkflowLayoutStep[];
10258
10262
  /** The step shown initially (matched against `defaultTestId(step.label)`); falls back to the first step if omitted or if it doesn't match any step. Uncontrolled — the layout owns step navigation from here. */
10259
10263
  defaultStep?: string;
10264
+ /** When this returns true, Cancel / in-app route changes / tab close require confirmation. */
10265
+ isDirty?: () => boolean;
10260
10266
  };
10261
10267
  /**
10262
10268
  * Workflow-header + body shell with sticky (always-visible) chrome. Contract: `docs/layouts.md`.
@@ -10268,7 +10274,7 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
10268
10274
  *
10269
10275
  * Owns the workflow's fixed CTA set (Back/Cancel/Save & Exit/Continue-or-Complete) via `WorkflowActions`
10270
10276
  * so it can move them into a mobile footer at the `sm` breakpoint — `WorkflowHeader` itself is not part
10271
- * of the public API.
10277
+ * of the public API. Pass `isDirty` to confirm before Cancel, in-app navigation, or tab close.
10272
10278
  */
10273
10279
  declare function WorkflowLayout(props: WorkflowLayoutProps): JSX.Element;
10274
10280
 
@@ -10297,8 +10303,6 @@ declare const zIndices: {
10297
10303
  readonly tableActions: 45;
10298
10304
  readonly scrollToTop: 50;
10299
10305
  readonly scrollShadow: 50;
10300
- readonly superDrawerScrim: 55;
10301
- readonly modalUnderlay: 60;
10302
10306
  readonly pageStickyHeader: 70;
10303
10307
  readonly pageStickyFooter: 70;
10304
10308
  readonly dragHandle: 80;
@@ -10307,6 +10311,8 @@ declare const zIndices: {
10307
10311
  readonly navbarMobileMenuScrim: 124;
10308
10312
  readonly navbarMobileMenu: 125;
10309
10313
  readonly environmentBanner: 130;
10314
+ readonly superDrawerScrim: 140;
10315
+ readonly modalUnderlay: 150;
10310
10316
  readonly pageOverlay: 1000;
10311
10317
  readonly snackbar: 1100;
10312
10318
  };