@homebound/beam 3.102.0 → 3.103.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.cjs +183 -162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -15
- package/dist/index.d.ts +21 -15
- package/dist/index.js +169 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -28422,8 +28422,72 @@ function EnvironmentBannerLayout(props) {
|
|
|
28422
28422
|
}
|
|
28423
28423
|
|
|
28424
28424
|
// src/layouts/FormSectionLayout/FormSectionLayout.tsx
|
|
28425
|
+
var import_runtime148 = require("@homebound/truss/runtime");
|
|
28426
|
+
|
|
28427
|
+
// src/layouts/FormSectionLayout/JumpLinksRail.tsx
|
|
28425
28428
|
var import_runtime147 = require("@homebound/truss/runtime");
|
|
28426
28429
|
var import_jsx_runtime229 = require("react/jsx-runtime");
|
|
28430
|
+
var __maybeInc31 = (inc) => {
|
|
28431
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28432
|
+
};
|
|
28433
|
+
function JumpLinksRail(props) {
|
|
28434
|
+
const {
|
|
28435
|
+
links,
|
|
28436
|
+
activeId
|
|
28437
|
+
} = props;
|
|
28438
|
+
const tid = useTestIds(props, "jumpLinks");
|
|
28439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)("nav", { ...(0, import_runtime147.trussProps)({
|
|
28440
|
+
display: "df",
|
|
28441
|
+
flexDirection: "fdc",
|
|
28442
|
+
flexShrink: "fs0",
|
|
28443
|
+
width: ["w_var", {
|
|
28444
|
+
"--width": `${jumpLinksRailWidthPx}px`
|
|
28445
|
+
}],
|
|
28446
|
+
position: "sticky",
|
|
28447
|
+
alignSelf: "asfs",
|
|
28448
|
+
top: ["top_var", {
|
|
28449
|
+
"--top": (0, import_runtime147.maybeCssVar)(__maybeInc31(stickyNavAndHeaderOffset()))
|
|
28450
|
+
}]
|
|
28451
|
+
}), ...tid, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(JumpLink, { label: link.label, href: `#${link.id}`, active: link.id === activeId, ...tid.link }, link.id)) });
|
|
28452
|
+
}
|
|
28453
|
+
var jumpLinksRailWidthPx = 192;
|
|
28454
|
+
var railAndShellPx = centeredShellMaxPx.sm + jumpLinksRailWidthPx;
|
|
28455
|
+
var jumpLinksRailReservation = `clamp(0px, 100% - ${railAndShellPx}px, ${jumpLinksRailWidthPx}px)`;
|
|
28456
|
+
|
|
28457
|
+
// src/layouts/FormSectionLayout/useActiveJumpLink.ts
|
|
28458
|
+
var import_react158 = require("react");
|
|
28459
|
+
var activationLeadPx = 120;
|
|
28460
|
+
function useActiveJumpLink(sectionIds) {
|
|
28461
|
+
const idsKey = sectionIds.join("\0");
|
|
28462
|
+
const [activeId, setActiveId] = (0, import_react158.useState)(sectionIds[0]);
|
|
28463
|
+
(0, import_react158.useLayoutEffect)(() => {
|
|
28464
|
+
const ids = idsKey.length === 0 ? [] : idsKey.split("\0");
|
|
28465
|
+
if (ids.length === 0) return;
|
|
28466
|
+
const update = () => {
|
|
28467
|
+
const first = ids.map((id) => document.getElementById(id)).find((el) => el !== null);
|
|
28468
|
+
if (!first) return;
|
|
28469
|
+
const headerOffset = stickyNavAndHeaderOffsetPx(first);
|
|
28470
|
+
let current = ids[0];
|
|
28471
|
+
for (const id of ids) {
|
|
28472
|
+
const el = document.getElementById(id);
|
|
28473
|
+
if (el && el.getBoundingClientRect().top - headerOffset <= activationLeadPx) {
|
|
28474
|
+
current = id;
|
|
28475
|
+
}
|
|
28476
|
+
}
|
|
28477
|
+
setActiveId(current);
|
|
28478
|
+
};
|
|
28479
|
+
update();
|
|
28480
|
+
window.addEventListener("scroll", update, { passive: true });
|
|
28481
|
+
return () => window.removeEventListener("scroll", update);
|
|
28482
|
+
}, [idsKey]);
|
|
28483
|
+
return sectionIds.includes(activeId ?? "") ? activeId : sectionIds[0];
|
|
28484
|
+
}
|
|
28485
|
+
|
|
28486
|
+
// src/layouts/FormSectionLayout/FormSectionLayout.tsx
|
|
28487
|
+
var import_jsx_runtime230 = require("react/jsx-runtime");
|
|
28488
|
+
var __maybeInc32 = (inc) => {
|
|
28489
|
+
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28490
|
+
};
|
|
28427
28491
|
function FormSectionLayout(props) {
|
|
28428
28492
|
const {
|
|
28429
28493
|
title,
|
|
@@ -28432,10 +28496,23 @@ function FormSectionLayout(props) {
|
|
|
28432
28496
|
withAutoSave,
|
|
28433
28497
|
initialFields,
|
|
28434
28498
|
sections,
|
|
28435
|
-
aiMode = false
|
|
28499
|
+
aiMode = false,
|
|
28500
|
+
withJumpLinks = false
|
|
28436
28501
|
} = props;
|
|
28437
28502
|
const tid = useTestIds(props, "formSectionLayout");
|
|
28438
|
-
const
|
|
28503
|
+
const {
|
|
28504
|
+
sm: isMobile
|
|
28505
|
+
} = useBreakpoint();
|
|
28506
|
+
const jumpLinks = (sections ?? []).filter((section) => !section.excludeJumpLink).map((section) => {
|
|
28507
|
+
const id = defaultTestId(section.title);
|
|
28508
|
+
return {
|
|
28509
|
+
id,
|
|
28510
|
+
label: section.title
|
|
28511
|
+
};
|
|
28512
|
+
});
|
|
28513
|
+
const showRail = withJumpLinks && jumpLinks.length >= 2 && !isMobile;
|
|
28514
|
+
const activeId = useActiveJumpLink(showRail ? jumpLinks.map((link) => link.id) : []);
|
|
28515
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { ...(0, import_runtime148.trussProps)({
|
|
28439
28516
|
display: "df",
|
|
28440
28517
|
flexDirection: "fdc",
|
|
28441
28518
|
gap: "gap8",
|
|
@@ -28446,21 +28523,34 @@ function FormSectionLayout(props) {
|
|
|
28446
28523
|
paddingLeft: "pl3"
|
|
28447
28524
|
} : {}
|
|
28448
28525
|
}), children: [
|
|
28449
|
-
/* @__PURE__ */ (0,
|
|
28450
|
-
/* @__PURE__ */ (0,
|
|
28526
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "df fdc gap3", children: [
|
|
28527
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(ContentHeader, { ...tid, title, description, actions, withAutoSave, level: 2, aiMode }),
|
|
28451
28528
|
initialFields
|
|
28452
28529
|
] }),
|
|
28453
|
-
sections && /* @__PURE__ */ (0,
|
|
28530
|
+
sections && /* @__PURE__ */ (0, import_jsx_runtime230.jsx)("div", { className: "df fdc gap8", children: sections.map((section, i) => /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(FormSection, { ...section }, defaultTestId(section.title) || i)) })
|
|
28531
|
+
] });
|
|
28532
|
+
const form = /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(CenteredLayout, { size: "sm", children: aiMode ? /* @__PURE__ */ (0, import_jsx_runtime230.jsx)(AiCard, { size: "lg", ...tid, children: content }) : content });
|
|
28533
|
+
if (!showRail) {
|
|
28534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)("div", { className: "mb4", children: form });
|
|
28535
|
+
}
|
|
28536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime230.jsxs)("div", { className: "df w100 mb4", children: [
|
|
28537
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)(JumpLinksRail, { links: jumpLinks, activeId, ...tid.jumpLinks }),
|
|
28538
|
+
/* @__PURE__ */ (0, import_jsx_runtime230.jsx)("div", { ...(0, import_runtime148.trussProps)({
|
|
28539
|
+
flexGrow: "fg1",
|
|
28540
|
+
minWidth: "mw0",
|
|
28541
|
+
marginRight: ["mr_var", {
|
|
28542
|
+
"--marginRight": (0, import_runtime148.maybeCssVar)(__maybeInc32(jumpLinksRailReservation))
|
|
28543
|
+
}]
|
|
28544
|
+
}), ...tid.column, children: form })
|
|
28454
28545
|
] });
|
|
28455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(CenteredLayout, { size: "sm", children: aiMode ? /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(AiCard, { size: "lg", ...tid, children: content }) : content });
|
|
28456
28546
|
}
|
|
28457
28547
|
|
|
28458
28548
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
28459
|
-
var
|
|
28460
|
-
var
|
|
28549
|
+
var import_react162 = require("react");
|
|
28550
|
+
var import_runtime149 = require("@homebound/truss/runtime");
|
|
28461
28551
|
|
|
28462
28552
|
// src/layouts/useAutoHideOnScroll.ts
|
|
28463
|
-
var
|
|
28553
|
+
var import_react159 = require("react");
|
|
28464
28554
|
var THRESHOLD = 80;
|
|
28465
28555
|
function getInitialAutoHideState() {
|
|
28466
28556
|
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
@@ -28470,15 +28560,15 @@ function getInitialAutoHideState() {
|
|
|
28470
28560
|
}
|
|
28471
28561
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
28472
28562
|
const initial = getInitialAutoHideState();
|
|
28473
|
-
const [state, setState] = (0,
|
|
28474
|
-
const stateRef = (0,
|
|
28475
|
-
const [atTop, setAtTop] = (0,
|
|
28476
|
-
const atTopRef = (0,
|
|
28477
|
-
const getTopOffsetRef = (0,
|
|
28563
|
+
const [state, setState] = (0, import_react159.useState)(initial.state);
|
|
28564
|
+
const stateRef = (0, import_react159.useRef)(initial.state);
|
|
28565
|
+
const [atTop, setAtTop] = (0, import_react159.useState)(initial.atTop);
|
|
28566
|
+
const atTopRef = (0, import_react159.useRef)(initial.atTop);
|
|
28567
|
+
const getTopOffsetRef = (0, import_react159.useRef)(getTopOffset);
|
|
28478
28568
|
getTopOffsetRef.current = getTopOffset;
|
|
28479
|
-
const lastScrollY = (0,
|
|
28480
|
-
const lastScrollHeight = (0,
|
|
28481
|
-
(0,
|
|
28569
|
+
const lastScrollY = (0, import_react159.useRef)(Number.POSITIVE_INFINITY);
|
|
28570
|
+
const lastScrollHeight = (0, import_react159.useRef)(0);
|
|
28571
|
+
(0, import_react159.useLayoutEffect)(() => {
|
|
28482
28572
|
if (!enabled) {
|
|
28483
28573
|
stateRef.current = "static";
|
|
28484
28574
|
atTopRef.current = true;
|
|
@@ -28550,36 +28640,36 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
28550
28640
|
}
|
|
28551
28641
|
|
|
28552
28642
|
// src/layouts/useMeasuredHeight.ts
|
|
28553
|
-
var
|
|
28554
|
-
var
|
|
28643
|
+
var import_utils194 = require("@react-aria/utils");
|
|
28644
|
+
var import_react160 = require("react");
|
|
28555
28645
|
function useMeasuredHeight(ref, enabled) {
|
|
28556
|
-
const [height, setHeight] = (0,
|
|
28557
|
-
const syncElementHeight = (0,
|
|
28646
|
+
const [height, setHeight] = (0, import_react160.useState)(0);
|
|
28647
|
+
const syncElementHeight = (0, import_react160.useCallback)(() => {
|
|
28558
28648
|
const el = ref.current;
|
|
28559
28649
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
28560
28650
|
setHeight((prev) => prev === next ? prev : next);
|
|
28561
28651
|
}, [ref]);
|
|
28562
|
-
(0,
|
|
28563
|
-
(0,
|
|
28652
|
+
(0, import_utils194.useResizeObserver)({ ref, onResize: syncElementHeight });
|
|
28653
|
+
(0, import_react160.useLayoutEffect)(() => {
|
|
28564
28654
|
syncElementHeight();
|
|
28565
28655
|
}, [enabled, syncElementHeight]);
|
|
28566
28656
|
return height;
|
|
28567
28657
|
}
|
|
28568
28658
|
|
|
28569
28659
|
// src/layouts/NavbarLayout/NavbarLayoutHeightContext.tsx
|
|
28570
|
-
var
|
|
28571
|
-
var
|
|
28572
|
-
var NavbarLayoutHeightContext = (0,
|
|
28660
|
+
var import_react161 = require("react");
|
|
28661
|
+
var import_jsx_runtime231 = require("react/jsx-runtime");
|
|
28662
|
+
var NavbarLayoutHeightContext = (0, import_react161.createContext)(0);
|
|
28573
28663
|
function NavbarLayoutHeightProvider({ value, children }) {
|
|
28574
|
-
return /* @__PURE__ */ (0,
|
|
28664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(NavbarLayoutHeightContext.Provider, { value, children });
|
|
28575
28665
|
}
|
|
28576
28666
|
function useNavbarLayoutHeight() {
|
|
28577
|
-
return (0,
|
|
28667
|
+
return (0, import_react161.useContext)(NavbarLayoutHeightContext);
|
|
28578
28668
|
}
|
|
28579
28669
|
|
|
28580
28670
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
28581
|
-
var
|
|
28582
|
-
var
|
|
28671
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
28672
|
+
var __maybeInc33 = (inc) => {
|
|
28583
28673
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28584
28674
|
};
|
|
28585
28675
|
function NavbarLayout(props) {
|
|
@@ -28588,8 +28678,8 @@ function NavbarLayout(props) {
|
|
|
28588
28678
|
children
|
|
28589
28679
|
} = props;
|
|
28590
28680
|
const tid = useTestIds(props, "navbarLayout");
|
|
28591
|
-
const navMetricsRef = (0,
|
|
28592
|
-
const spacerRef = (0,
|
|
28681
|
+
const navMetricsRef = (0, import_react162.useRef)(null);
|
|
28682
|
+
const spacerRef = (0, import_react162.useRef)(null);
|
|
28593
28683
|
const navHeight = useMeasuredHeight(navMetricsRef, true);
|
|
28594
28684
|
const {
|
|
28595
28685
|
state: autoHideState,
|
|
@@ -28607,10 +28697,10 @@ function NavbarLayout(props) {
|
|
|
28607
28697
|
position: "sticky",
|
|
28608
28698
|
left: "left0",
|
|
28609
28699
|
zIndex: ["z_var", {
|
|
28610
|
-
"--zIndex": (0,
|
|
28700
|
+
"--zIndex": (0, import_runtime149.maybeCssVar)(zIndices.navbar)
|
|
28611
28701
|
}],
|
|
28612
28702
|
width: ["w_var", {
|
|
28613
|
-
"--width": (0,
|
|
28703
|
+
"--width": (0, import_runtime149.maybeCssVar)(__maybeInc33(innerWidth))
|
|
28614
28704
|
}]
|
|
28615
28705
|
}
|
|
28616
28706
|
) : (
|
|
@@ -28619,10 +28709,10 @@ function NavbarLayout(props) {
|
|
|
28619
28709
|
position: "fixed",
|
|
28620
28710
|
left: "left0",
|
|
28621
28711
|
zIndex: ["z_var", {
|
|
28622
|
-
"--zIndex": (0,
|
|
28712
|
+
"--zIndex": (0, import_runtime149.maybeCssVar)(zIndices.navbar)
|
|
28623
28713
|
}],
|
|
28624
28714
|
width: ["w_var", {
|
|
28625
|
-
"--width": (0,
|
|
28715
|
+
"--width": (0, import_runtime149.maybeCssVar)(__maybeInc33(innerWidth))
|
|
28626
28716
|
}],
|
|
28627
28717
|
transition: "transitionTop"
|
|
28628
28718
|
}
|
|
@@ -28631,29 +28721,29 @@ function NavbarLayout(props) {
|
|
|
28631
28721
|
const innerStyle = autoHideState !== "static" ? {
|
|
28632
28722
|
top: autoHideState === "revealed" ? bannerTop : `calc(${bannerTop} - ${navHeight}px)`
|
|
28633
28723
|
} : void 0;
|
|
28634
|
-
const navbarEl = (0,
|
|
28635
|
-
return /* @__PURE__ */ (0,
|
|
28724
|
+
const navbarEl = (0, import_react162.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(Navbar, { ...navbar }), [navbar]);
|
|
28725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(DocumentScrollLayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(NavbarLayoutHeightProvider, { value: navbarOffsetPx, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(MobileSubNavProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime232.jsxs)("div", { ...(0, import_runtime149.mergeProps)(void 0, cssVars, {
|
|
28636
28726
|
display: "df",
|
|
28637
28727
|
flexDirection: "fdc",
|
|
28638
28728
|
width: "wfc",
|
|
28639
28729
|
minWidth: "mw100"
|
|
28640
28730
|
}), ...tid, children: [
|
|
28641
|
-
/* @__PURE__ */ (0,
|
|
28731
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { ref: spacerRef, ...(0, import_runtime149.mergeProps)(void 0, {
|
|
28642
28732
|
height: navHeight
|
|
28643
28733
|
}, {
|
|
28644
28734
|
flexShrink: "fs0",
|
|
28645
28735
|
width: "w100"
|
|
28646
|
-
}), children: /* @__PURE__ */ (0,
|
|
28647
|
-
/* @__PURE__ */ (0,
|
|
28736
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { ref: navMetricsRef, ...(0, import_runtime149.mergeProps)(void 0, innerStyle, innerCss), ...tid.navbar, children: navbarEl }) }),
|
|
28737
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { className: "df fdc mh0 mw100 w100", ...tid.body, children })
|
|
28648
28738
|
] }) }) }) });
|
|
28649
28739
|
}
|
|
28650
28740
|
|
|
28651
28741
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
28652
|
-
var
|
|
28742
|
+
var import_react163 = require("react");
|
|
28653
28743
|
|
|
28654
28744
|
// src/components/Headers/BaseHeader.tsx
|
|
28655
|
-
var
|
|
28656
|
-
var
|
|
28745
|
+
var import_runtime150 = require("@homebound/truss/runtime");
|
|
28746
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
28657
28747
|
function BaseHeader(props) {
|
|
28658
28748
|
const {
|
|
28659
28749
|
title,
|
|
@@ -28665,7 +28755,7 @@ function BaseHeader(props) {
|
|
|
28665
28755
|
} = props;
|
|
28666
28756
|
const tid = useTestIds(otherProps, "header");
|
|
28667
28757
|
useDocumentTitle(title, documentTitleSuffix);
|
|
28668
|
-
return /* @__PURE__ */ (0,
|
|
28758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("header", { ...tid, ...(0, import_runtime150.trussProps)({
|
|
28669
28759
|
display: "df",
|
|
28670
28760
|
flexDirection: "fdc",
|
|
28671
28761
|
paddingTop: "pt3",
|
|
@@ -28679,7 +28769,7 @@ function BaseHeader(props) {
|
|
|
28679
28769
|
"--backgroundColor": "var(--b-surface)"
|
|
28680
28770
|
}]
|
|
28681
28771
|
}), children: [
|
|
28682
|
-
/* @__PURE__ */ (0,
|
|
28772
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { ...(0, import_runtime150.trussProps)({
|
|
28683
28773
|
...{
|
|
28684
28774
|
display: "df",
|
|
28685
28775
|
justifyContent: "jcsb",
|
|
@@ -28693,9 +28783,9 @@ function BaseHeader(props) {
|
|
|
28693
28783
|
} : {}
|
|
28694
28784
|
}
|
|
28695
28785
|
}), children: [
|
|
28696
|
-
/* @__PURE__ */ (0,
|
|
28697
|
-
breadcrumbs && /* @__PURE__ */ (0,
|
|
28698
|
-
/* @__PURE__ */ (0,
|
|
28786
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { className: "mw0", children: [
|
|
28787
|
+
breadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(Breadcrumbs, { ...breadcrumbs }),
|
|
28788
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("h1", { ...tid.title, ...(0, import_runtime150.trussProps)({
|
|
28699
28789
|
fontWeight: "fw6",
|
|
28700
28790
|
fontSize: "fz_20px",
|
|
28701
28791
|
lineHeight: "lh_28px",
|
|
@@ -28704,15 +28794,15 @@ function BaseHeader(props) {
|
|
|
28704
28794
|
}]
|
|
28705
28795
|
}), children: title })
|
|
28706
28796
|
] }),
|
|
28707
|
-
/* @__PURE__ */ (0,
|
|
28797
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("div", { className: "fs0", children: rightSlot })
|
|
28708
28798
|
] }),
|
|
28709
28799
|
bottomSlot
|
|
28710
28800
|
] });
|
|
28711
28801
|
}
|
|
28712
28802
|
|
|
28713
28803
|
// src/components/Headers/PageHeader.tsx
|
|
28714
|
-
var
|
|
28715
|
-
var
|
|
28804
|
+
var import_runtime151 = require("@homebound/truss/runtime");
|
|
28805
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
28716
28806
|
function PageHeader2(props) {
|
|
28717
28807
|
const {
|
|
28718
28808
|
tabs,
|
|
@@ -28721,10 +28811,10 @@ function PageHeader2(props) {
|
|
|
28721
28811
|
...otherProps
|
|
28722
28812
|
} = props;
|
|
28723
28813
|
const tid = useTestIds(otherProps, "header");
|
|
28724
|
-
return /* @__PURE__ */ (0,
|
|
28814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(BaseHeader, { ...otherProps, rightSlot: /* @__PURE__ */ (0, import_jsx_runtime234.jsxs)(import_jsx_runtime234.Fragment, { children: [
|
|
28725
28815
|
rightSlot,
|
|
28726
|
-
actions && actions.length > 0 && /* @__PURE__ */ (0,
|
|
28727
|
-
] }), bottomSlot: tabs && /* @__PURE__ */ (0,
|
|
28816
|
+
actions && actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(HeaderActions, { actions, collapseOnSm: true })
|
|
28817
|
+
] }), bottomSlot: tabs && /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { ...(0, import_runtime151.trussProps)(pageContentPaddingX), children: /* @__PURE__ */ (0, import_jsx_runtime234.jsx)(Tabs, { ...tabs, ...tid.tabs }) }) });
|
|
28728
28818
|
}
|
|
28729
28819
|
|
|
28730
28820
|
// src/layouts/useBannerAndNavbarHeight.ts
|
|
@@ -28733,9 +28823,9 @@ function useBannerAndNavbarHeight() {
|
|
|
28733
28823
|
}
|
|
28734
28824
|
|
|
28735
28825
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
28736
|
-
var
|
|
28737
|
-
var
|
|
28738
|
-
var
|
|
28826
|
+
var import_runtime152 = require("@homebound/truss/runtime");
|
|
28827
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
28828
|
+
var __maybeInc34 = (inc) => {
|
|
28739
28829
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28740
28830
|
};
|
|
28741
28831
|
function PageHeaderLayout(props) {
|
|
@@ -28745,11 +28835,11 @@ function PageHeaderLayout(props) {
|
|
|
28745
28835
|
} = props;
|
|
28746
28836
|
const tid = useTestIds(props, "pageHeaderLayout");
|
|
28747
28837
|
const bannerAndNavbarHeight = useBannerAndNavbarHeight();
|
|
28748
|
-
const bannerAndNavbarHeightRef = (0,
|
|
28838
|
+
const bannerAndNavbarHeightRef = (0, import_react163.useRef)(bannerAndNavbarHeight);
|
|
28749
28839
|
bannerAndNavbarHeightRef.current = bannerAndNavbarHeight;
|
|
28750
|
-
const getBannerAndNavbarHeight = (0,
|
|
28751
|
-
const headerMetricsRef = (0,
|
|
28752
|
-
const spacerRef = (0,
|
|
28840
|
+
const getBannerAndNavbarHeight = (0, import_react163.useCallback)(() => bannerAndNavbarHeightRef.current, []);
|
|
28841
|
+
const headerMetricsRef = (0, import_react163.useRef)(null);
|
|
28842
|
+
const spacerRef = (0, import_react163.useRef)(null);
|
|
28753
28843
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
28754
28844
|
const {
|
|
28755
28845
|
state: autoHideState,
|
|
@@ -28765,103 +28855,46 @@ function PageHeaderLayout(props) {
|
|
|
28765
28855
|
const innerCss = autoHideState === "static" ? {
|
|
28766
28856
|
position: "sticky",
|
|
28767
28857
|
left: ["left_var", {
|
|
28768
|
-
"--left": (0,
|
|
28858
|
+
"--left": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerLeft))
|
|
28769
28859
|
}],
|
|
28770
28860
|
width: ["w_var", {
|
|
28771
|
-
"--width": (0,
|
|
28861
|
+
"--width": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerWidth))
|
|
28772
28862
|
}],
|
|
28773
28863
|
zIndex: ["z_var", {
|
|
28774
|
-
"--zIndex": (0,
|
|
28864
|
+
"--zIndex": (0, import_runtime152.maybeCssVar)(zIndices.pageStickyHeader)
|
|
28775
28865
|
}]
|
|
28776
28866
|
} : {
|
|
28777
28867
|
position: "fixed",
|
|
28778
28868
|
left: ["left_var", {
|
|
28779
|
-
"--left": (0,
|
|
28869
|
+
"--left": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerLeft))
|
|
28780
28870
|
}],
|
|
28781
28871
|
width: ["w_var", {
|
|
28782
|
-
"--width": (0,
|
|
28872
|
+
"--width": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerWidth))
|
|
28783
28873
|
}],
|
|
28784
28874
|
zIndex: ["z_var", {
|
|
28785
|
-
"--zIndex": (0,
|
|
28875
|
+
"--zIndex": (0, import_runtime152.maybeCssVar)(zIndices.pageStickyHeader)
|
|
28786
28876
|
}],
|
|
28787
28877
|
transition: "transitionTop"
|
|
28788
28878
|
};
|
|
28789
28879
|
const innerStyle = autoHideState !== "static" ? {
|
|
28790
28880
|
top: autoHideState === "revealed" ? outerTop : `calc(${outerTop} - ${headerHeight}px)`
|
|
28791
28881
|
} : void 0;
|
|
28792
|
-
const pageHeaderEl = (0,
|
|
28793
|
-
return /* @__PURE__ */ (0,
|
|
28882
|
+
const pageHeaderEl = (0, import_react163.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(PageHeader2, { ...pageHeader }), [pageHeader]);
|
|
28883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(DocumentScrollLayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime235.jsxs)("div", { ...(0, import_runtime152.mergeProps)(void 0, cssVars, {
|
|
28794
28884
|
display: "df",
|
|
28795
28885
|
flexDirection: "fdc",
|
|
28796
28886
|
width: "w100"
|
|
28797
28887
|
}), ...tid, children: [
|
|
28798
|
-
/* @__PURE__ */ (0,
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { ref: spacerRef, ...(0, import_runtime152.mergeProps)(void 0, {
|
|
28799
28889
|
height: headerHeight
|
|
28800
28890
|
}, {
|
|
28801
28891
|
flexShrink: "fs0",
|
|
28802
28892
|
width: "w100"
|
|
28803
|
-
}), children: /* @__PURE__ */ (0,
|
|
28804
|
-
/* @__PURE__ */ (0,
|
|
28893
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { ref: headerMetricsRef, ...(0, import_runtime152.mergeProps)(void 0, innerStyle, innerCss), ...tid.pageHeader, children: pageHeaderEl }) }),
|
|
28894
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: "df fdc fg1 mh0 w100", ...tid.body, children })
|
|
28805
28895
|
] }) });
|
|
28806
28896
|
}
|
|
28807
28897
|
|
|
28808
|
-
// src/layouts/Workflow/JumpLinksRail.tsx
|
|
28809
|
-
var import_runtime152 = require("@homebound/truss/runtime");
|
|
28810
|
-
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
28811
|
-
var __maybeInc33 = (inc) => {
|
|
28812
|
-
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28813
|
-
};
|
|
28814
|
-
var jumpLinksRailWidthPx = 180;
|
|
28815
|
-
function JumpLinksRail(props) {
|
|
28816
|
-
const {
|
|
28817
|
-
links,
|
|
28818
|
-
activeId
|
|
28819
|
-
} = props;
|
|
28820
|
-
const tid = useTestIds(props, "jumpLinks");
|
|
28821
|
-
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("nav", { ...(0, import_runtime152.trussProps)({
|
|
28822
|
-
display: "df",
|
|
28823
|
-
flexDirection: "fdc",
|
|
28824
|
-
flexShrink: "fs0",
|
|
28825
|
-
width: ["w_var", {
|
|
28826
|
-
"--width": `${jumpLinksRailWidthPx}px`
|
|
28827
|
-
}],
|
|
28828
|
-
position: "sticky",
|
|
28829
|
-
alignSelf: "asfs",
|
|
28830
|
-
top: ["top_var", {
|
|
28831
|
-
"--top": (0, import_runtime152.maybeCssVar)(__maybeInc33(stickyNavAndHeaderOffset()))
|
|
28832
|
-
}]
|
|
28833
|
-
}), ...tid, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(JumpLink, { label: link.label, href: `#${link.id}`, active: link.id === activeId, ...tid.link }, link.id)) });
|
|
28834
|
-
}
|
|
28835
|
-
|
|
28836
|
-
// src/layouts/Workflow/useActiveJumpLink.ts
|
|
28837
|
-
var import_react163 = require("react");
|
|
28838
|
-
var activationLeadPx = 120;
|
|
28839
|
-
function useActiveJumpLink(sectionIds) {
|
|
28840
|
-
const idsKey = sectionIds.join("\0");
|
|
28841
|
-
const [activeId, setActiveId] = (0, import_react163.useState)(sectionIds[0]);
|
|
28842
|
-
(0, import_react163.useLayoutEffect)(() => {
|
|
28843
|
-
const ids = idsKey.length === 0 ? [] : idsKey.split("\0");
|
|
28844
|
-
if (ids.length === 0) return;
|
|
28845
|
-
const update = () => {
|
|
28846
|
-
const first = ids.map((id) => document.getElementById(id)).find((el) => el !== null);
|
|
28847
|
-
if (!first) return;
|
|
28848
|
-
const headerOffset = stickyNavAndHeaderOffsetPx(first);
|
|
28849
|
-
let current = ids[0];
|
|
28850
|
-
for (const id of ids) {
|
|
28851
|
-
const el = document.getElementById(id);
|
|
28852
|
-
if (el && el.getBoundingClientRect().top - headerOffset <= activationLeadPx) {
|
|
28853
|
-
current = id;
|
|
28854
|
-
}
|
|
28855
|
-
}
|
|
28856
|
-
setActiveId(current);
|
|
28857
|
-
};
|
|
28858
|
-
update();
|
|
28859
|
-
window.addEventListener("scroll", update, { passive: true });
|
|
28860
|
-
return () => window.removeEventListener("scroll", update);
|
|
28861
|
-
}, [idsKey]);
|
|
28862
|
-
return sectionIds.includes(activeId ?? "") ? activeId : sectionIds[0];
|
|
28863
|
-
}
|
|
28864
|
-
|
|
28865
28898
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
28866
28899
|
var import_react165 = require("react");
|
|
28867
28900
|
|
|
@@ -28958,7 +28991,7 @@ function WorkflowActions(props) {
|
|
|
28958
28991
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
28959
28992
|
var import_runtime153 = require("@homebound/truss/runtime");
|
|
28960
28993
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
28961
|
-
var
|
|
28994
|
+
var __maybeInc35 = (inc) => {
|
|
28962
28995
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28963
28996
|
};
|
|
28964
28997
|
var mobileFooterHeightPx = 80;
|
|
@@ -29016,13 +29049,13 @@ function WorkflowPageLayout(props) {
|
|
|
29016
29049
|
position: "sticky",
|
|
29017
29050
|
left: "left0",
|
|
29018
29051
|
width: ["w_var", {
|
|
29019
|
-
"--width": (0, import_runtime153.maybeCssVar)(
|
|
29052
|
+
"--width": (0, import_runtime153.maybeCssVar)(__maybeInc35(headerWidth))
|
|
29020
29053
|
}],
|
|
29021
29054
|
zIndex: ["z_var", {
|
|
29022
29055
|
"--zIndex": (0, import_runtime153.maybeCssVar)(zIndices.pageStickyHeader)
|
|
29023
29056
|
}],
|
|
29024
29057
|
top: ["top_var", {
|
|
29025
|
-
"--top": (0, import_runtime153.maybeCssVar)(
|
|
29058
|
+
"--top": (0, import_runtime153.maybeCssVar)(__maybeInc35(outerTop))
|
|
29026
29059
|
}]
|
|
29027
29060
|
}), ...tid.header, children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(WorkflowHeader, { title, documentTitleSuffix, breadcrumbs, rightSlot: isMobile ? void 0 : actions, stepperTabs }) }),
|
|
29028
29061
|
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)("div", { ...(0, import_runtime153.trussProps)({
|
|
@@ -29052,7 +29085,7 @@ function WorkflowPageLayout(props) {
|
|
|
29052
29085
|
position: "fixed",
|
|
29053
29086
|
bottom: "bottom0",
|
|
29054
29087
|
width: ["w_var", {
|
|
29055
|
-
"--width": (0, import_runtime153.maybeCssVar)(
|
|
29088
|
+
"--width": (0, import_runtime153.maybeCssVar)(__maybeInc35(headerWidth))
|
|
29056
29089
|
}],
|
|
29057
29090
|
height: ["h_var", {
|
|
29058
29091
|
"--height": `${mobileFooterHeightPx}px`
|
|
@@ -29083,35 +29116,23 @@ function WorkflowPageLayout(props) {
|
|
|
29083
29116
|
// src/layouts/Workflow/FocusedFormLayout.tsx
|
|
29084
29117
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
29085
29118
|
function FocusedFormLayout(props) {
|
|
29086
|
-
const {
|
|
29087
|
-
onCancel,
|
|
29088
|
-
completeLabel,
|
|
29089
|
-
onComplete,
|
|
29090
|
-
onSaveAndExit,
|
|
29091
|
-
isValid,
|
|
29092
|
-
isDirty,
|
|
29093
|
-
withJumpLinks = true,
|
|
29094
|
-
aiMode,
|
|
29095
|
-
form,
|
|
29096
|
-
...headerProps
|
|
29097
|
-
} = props;
|
|
29119
|
+
const { onCancel, completeLabel, onComplete, onSaveAndExit, isValid, isDirty, aiMode, children, ...headerProps } = props;
|
|
29098
29120
|
const tid = useTestIds(props, "focusedFormLayout");
|
|
29099
|
-
|
|
29100
|
-
|
|
29101
|
-
|
|
29102
|
-
|
|
29103
|
-
|
|
29104
|
-
|
|
29105
|
-
|
|
29106
|
-
|
|
29107
|
-
|
|
29108
|
-
|
|
29109
|
-
|
|
29110
|
-
|
|
29111
|
-
|
|
29112
|
-
|
|
29113
|
-
|
|
29114
|
-
] }) });
|
|
29121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(
|
|
29122
|
+
WorkflowPageLayout,
|
|
29123
|
+
{
|
|
29124
|
+
...tid,
|
|
29125
|
+
...headerProps,
|
|
29126
|
+
aiMode,
|
|
29127
|
+
isDirty,
|
|
29128
|
+
onCancel,
|
|
29129
|
+
onSaveAndExit,
|
|
29130
|
+
completeLabel,
|
|
29131
|
+
onComplete,
|
|
29132
|
+
primaryDisabled: !isValid,
|
|
29133
|
+
children
|
|
29134
|
+
}
|
|
29135
|
+
);
|
|
29115
29136
|
}
|
|
29116
29137
|
|
|
29117
29138
|
// src/layouts/Workflow/StepperLayout.tsx
|