@homebound/beam 3.75.1 → 3.75.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.cjs +21 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +19 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -9989,7 +9989,7 @@ type StepperTabsProps = {
|
|
|
9989
9989
|
steps: StepperTabsStep[];
|
|
9990
9990
|
currentStep: StepperTabsStep["value"];
|
|
9991
9991
|
onChange: (stepValue: string) => void;
|
|
9992
|
-
/** Forces the condensed look regardless of viewport width
|
|
9992
|
+
/** Forces the condensed look regardless of viewport width. OR'd with the mobile-breakpoint collapse. */
|
|
9993
9993
|
collapsed?: boolean;
|
|
9994
9994
|
};
|
|
9995
9995
|
declare function StepperTabs(props: StepperTabsProps): JSX.Element;
|
|
@@ -10327,9 +10327,8 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
|
|
|
10327
10327
|
*
|
|
10328
10328
|
* A standalone, full-page layout for step-based workflow pages — nest it directly under
|
|
10329
10329
|
* `EnvironmentBannerLayout`, never under `NavbarLayout`/`SideNavLayout`/`PageHeaderLayout`. Unlike
|
|
10330
|
-
* `PageHeaderLayout`, the header here never auto-hides. The stepper tabs
|
|
10331
|
-
* indicator bar on mobile
|
|
10332
|
-
* re-expanding on scroll-up (even before reaching the top).
|
|
10330
|
+
* `PageHeaderLayout`, the header here never auto-hides. The stepper tabs collapse to a condensed
|
|
10331
|
+
* indicator bar on mobile only.
|
|
10333
10332
|
*
|
|
10334
10333
|
* Owns the workflow's fixed CTA set (Back/Cancel/Save & Exit/Continue-or-Complete) via `WorkflowActions`
|
|
10335
10334
|
* so it can move them into a mobile footer at the `sm` breakpoint — `WorkflowHeader` itself is not part
|
package/dist/index.d.ts
CHANGED
|
@@ -9989,7 +9989,7 @@ type StepperTabsProps = {
|
|
|
9989
9989
|
steps: StepperTabsStep[];
|
|
9990
9990
|
currentStep: StepperTabsStep["value"];
|
|
9991
9991
|
onChange: (stepValue: string) => void;
|
|
9992
|
-
/** Forces the condensed look regardless of viewport width
|
|
9992
|
+
/** Forces the condensed look regardless of viewport width. OR'd with the mobile-breakpoint collapse. */
|
|
9993
9993
|
collapsed?: boolean;
|
|
9994
9994
|
};
|
|
9995
9995
|
declare function StepperTabs(props: StepperTabsProps): JSX.Element;
|
|
@@ -10327,9 +10327,8 @@ type WorkflowLayoutProps = Pick<BaseHeaderProps, "title" | "documentTitleSuffix"
|
|
|
10327
10327
|
*
|
|
10328
10328
|
* A standalone, full-page layout for step-based workflow pages — nest it directly under
|
|
10329
10329
|
* `EnvironmentBannerLayout`, never under `NavbarLayout`/`SideNavLayout`/`PageHeaderLayout`. Unlike
|
|
10330
|
-
* `PageHeaderLayout`, the header here never auto-hides. The stepper tabs
|
|
10331
|
-
* indicator bar on mobile
|
|
10332
|
-
* re-expanding on scroll-up (even before reaching the top).
|
|
10330
|
+
* `PageHeaderLayout`, the header here never auto-hides. The stepper tabs collapse to a condensed
|
|
10331
|
+
* indicator bar on mobile only.
|
|
10333
10332
|
*
|
|
10334
10333
|
* Owns the workflow's fixed CTA set (Back/Cancel/Save & Exit/Continue-or-Complete) via `WorkflowActions`
|
|
10335
10334
|
* so it can move them into a mobile footer at the `sm` breakpoint — `WorkflowHeader` itself is not part
|
package/dist/index.js
CHANGED
|
@@ -26751,7 +26751,7 @@ function PageHeaderLayout(props) {
|
|
|
26751
26751
|
}
|
|
26752
26752
|
|
|
26753
26753
|
// src/layouts/WorkflowLayout/WorkflowLayout.tsx
|
|
26754
|
-
import { useLayoutEffect as
|
|
26754
|
+
import { useLayoutEffect as useLayoutEffect11, useRef as useRef69, useState as useState59 } from "react";
|
|
26755
26755
|
|
|
26756
26756
|
// src/components/Headers/WorkflowHeader.tsx
|
|
26757
26757
|
import { jsx as jsx218 } from "react/jsx-runtime";
|
|
@@ -26761,65 +26761,14 @@ function WorkflowHeader(props) {
|
|
|
26761
26761
|
return /* @__PURE__ */ jsx218(BaseHeader, { ...otherProps, bottomSlot: /* @__PURE__ */ jsx218(StepperTabs, { ...stepperTabs, ...tid.stepperTabs }) });
|
|
26762
26762
|
}
|
|
26763
26763
|
|
|
26764
|
-
// src/layouts/useScrollCollapse.ts
|
|
26765
|
-
import { useLayoutEffect as useLayoutEffect11, useRef as useRef68, useState as useState59 } from "react";
|
|
26766
|
-
function useScrollCollapse(enabled, restingOffset) {
|
|
26767
|
-
const [collapsed, setCollapsed] = useState59(() => typeof window !== "undefined" && window.scrollY > 0);
|
|
26768
|
-
const collapsedRef = useRef68(collapsed);
|
|
26769
|
-
collapsedRef.current = collapsed;
|
|
26770
|
-
const restingOffsetRef = useRef68(restingOffset);
|
|
26771
|
-
restingOffsetRef.current = restingOffset;
|
|
26772
|
-
const lastScrollYRef = useRef68(Number.POSITIVE_INFINITY);
|
|
26773
|
-
const lastScrollHeightRef = useRef68(0);
|
|
26774
|
-
useLayoutEffect11(() => {
|
|
26775
|
-
lastScrollHeightRef.current = document.documentElement.scrollHeight;
|
|
26776
|
-
}, [restingOffset]);
|
|
26777
|
-
useLayoutEffect11(() => {
|
|
26778
|
-
if (!enabled) return;
|
|
26779
|
-
const commit = (next) => {
|
|
26780
|
-
if (next !== collapsedRef.current) {
|
|
26781
|
-
collapsedRef.current = next;
|
|
26782
|
-
setCollapsed(next);
|
|
26783
|
-
}
|
|
26784
|
-
};
|
|
26785
|
-
const updateCollapsed = () => {
|
|
26786
|
-
const doc = document.documentElement;
|
|
26787
|
-
const currentY = window.scrollY;
|
|
26788
|
-
if (currentY <= 0) {
|
|
26789
|
-
lastScrollYRef.current = 0;
|
|
26790
|
-
lastScrollHeightRef.current = doc.scrollHeight;
|
|
26791
|
-
commit(false);
|
|
26792
|
-
return;
|
|
26793
|
-
}
|
|
26794
|
-
const currentScrollHeight = doc.scrollHeight;
|
|
26795
|
-
const scrollHeightChanged = lastScrollHeightRef.current !== 0 && currentScrollHeight !== lastScrollHeightRef.current;
|
|
26796
|
-
const dy = currentY - lastScrollYRef.current;
|
|
26797
|
-
lastScrollYRef.current = currentY;
|
|
26798
|
-
lastScrollHeightRef.current = currentScrollHeight;
|
|
26799
|
-
if (currentY <= restingOffsetRef.current) return;
|
|
26800
|
-
if (scrollHeightChanged) {
|
|
26801
|
-
commit(true);
|
|
26802
|
-
return;
|
|
26803
|
-
}
|
|
26804
|
-
const atBottom = currentY >= doc.scrollHeight - doc.clientHeight;
|
|
26805
|
-
if (dy > 0) commit(true);
|
|
26806
|
-
else if (dy < 0 && !atBottom) commit(false);
|
|
26807
|
-
};
|
|
26808
|
-
updateCollapsed();
|
|
26809
|
-
window.addEventListener("scroll", updateCollapsed, { passive: true });
|
|
26810
|
-
return () => window.removeEventListener("scroll", updateCollapsed);
|
|
26811
|
-
}, [enabled]);
|
|
26812
|
-
return collapsed;
|
|
26813
|
-
}
|
|
26814
|
-
|
|
26815
26764
|
// src/layouts/WorkflowLayout/useUnsavedChangesGuard.tsx
|
|
26816
|
-
import { useEffect as useEffect39, useRef as
|
|
26765
|
+
import { useEffect as useEffect39, useRef as useRef68 } from "react";
|
|
26817
26766
|
import { useBlocker } from "react-router-dom";
|
|
26818
26767
|
import { jsx as jsx219 } from "react/jsx-runtime";
|
|
26819
26768
|
function useUnsavedChangesGuard(options) {
|
|
26820
26769
|
const { isDirty, onCancel } = options;
|
|
26821
26770
|
const { openModal } = useModal();
|
|
26822
|
-
const isDirtyRef =
|
|
26771
|
+
const isDirtyRef = useRef68(isDirty);
|
|
26823
26772
|
isDirtyRef.current = isDirty;
|
|
26824
26773
|
useEffect39(() => {
|
|
26825
26774
|
const onBeforeUnload = (e) => {
|
|
@@ -26903,7 +26852,7 @@ function WorkflowLayout(props) {
|
|
|
26903
26852
|
...step,
|
|
26904
26853
|
value: defaultTestId(step.label)
|
|
26905
26854
|
}));
|
|
26906
|
-
const [currentStep, setCurrentStep] =
|
|
26855
|
+
const [currentStep, setCurrentStep] = useState59(() => getInitialStep(stepTabs, defaultStep));
|
|
26907
26856
|
const tid = useTestIds(props, "workflowLayout");
|
|
26908
26857
|
const {
|
|
26909
26858
|
sm: isMobile
|
|
@@ -26915,11 +26864,8 @@ function WorkflowLayout(props) {
|
|
|
26915
26864
|
isDirty,
|
|
26916
26865
|
onCancel
|
|
26917
26866
|
});
|
|
26918
|
-
const
|
|
26919
|
-
const headerMetricsRef = useRef70(null);
|
|
26867
|
+
const headerMetricsRef = useRef69(null);
|
|
26920
26868
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
26921
|
-
const scrollCollapsed = useScrollCollapse(!isMobile, bannerAndNavbarHeight + headerHeight);
|
|
26922
|
-
const collapsed = isMobile || scrollCollapsed;
|
|
26923
26869
|
const headerWidth = documentScrollChromeWidth();
|
|
26924
26870
|
const outerTop = bannerAndNavbarChromeTop();
|
|
26925
26871
|
const cssVars = headerHeight > 0 ? {
|
|
@@ -26938,7 +26884,7 @@ function WorkflowLayout(props) {
|
|
|
26938
26884
|
setCurrentStep(stepTabs[currentIndex + 1].value);
|
|
26939
26885
|
} });
|
|
26940
26886
|
const showFooter = isMobile;
|
|
26941
|
-
|
|
26887
|
+
useLayoutEffect11(() => {
|
|
26942
26888
|
const root = document.documentElement;
|
|
26943
26889
|
const previous = root.style.getPropertyValue(beamWorkflowLayoutFooterHeightVar);
|
|
26944
26890
|
root.style.setProperty(beamWorkflowLayoutFooterHeightVar, showFooter ? `${mobileFooterHeightPx}px` : "0px");
|
|
@@ -26950,12 +26896,19 @@ function WorkflowLayout(props) {
|
|
|
26950
26896
|
}
|
|
26951
26897
|
};
|
|
26952
26898
|
}, [showFooter]);
|
|
26953
|
-
const headerEl = /* @__PURE__ */ jsx221(
|
|
26954
|
-
|
|
26955
|
-
|
|
26956
|
-
|
|
26957
|
-
|
|
26958
|
-
|
|
26899
|
+
const headerEl = /* @__PURE__ */ jsx221(
|
|
26900
|
+
WorkflowHeader,
|
|
26901
|
+
{
|
|
26902
|
+
...headerProps,
|
|
26903
|
+
rightSlot: isMobile ? void 0 : buttons,
|
|
26904
|
+
stepperTabs: {
|
|
26905
|
+
steps: stepTabs,
|
|
26906
|
+
currentStep,
|
|
26907
|
+
onChange: setCurrentStep,
|
|
26908
|
+
collapsed: isMobile
|
|
26909
|
+
}
|
|
26910
|
+
}
|
|
26911
|
+
);
|
|
26959
26912
|
return /* @__PURE__ */ jsxs114(DocumentScrollLayoutProvider, { children: [
|
|
26960
26913
|
/* @__PURE__ */ jsxs114("div", { ...mergeProps39(void 0, cssVars, {
|
|
26961
26914
|
display: "df",
|