@homebound/beam 3.101.1 → 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 +229 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -18
- package/dist/index.d.ts +30 -18
- package/dist/index.js +221 -153
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -21981,9 +21981,20 @@ var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
|
21981
21981
|
function HeaderActions(props) {
|
|
21982
21982
|
const {
|
|
21983
21983
|
actions,
|
|
21984
|
+
collapseOnSm = false,
|
|
21984
21985
|
...otherProps
|
|
21985
21986
|
} = props;
|
|
21986
21987
|
const tid = useTestIds(otherProps, "headerActions");
|
|
21988
|
+
const {
|
|
21989
|
+
sm
|
|
21990
|
+
} = useBreakpoint();
|
|
21991
|
+
const collapse = collapseOnSm && sm && actions.length > 1;
|
|
21992
|
+
if (collapse) {
|
|
21993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "df aic gap1 fs0", ...tid, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(ButtonMenu, { trigger: {
|
|
21994
|
+
icon: "verticalDots",
|
|
21995
|
+
variant: "outline"
|
|
21996
|
+
}, items: toMenuItems(actions) }) });
|
|
21997
|
+
}
|
|
21987
21998
|
return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("div", { className: "df aic gap1 fs0", ...tid, children: actions.map((action, i) => {
|
|
21988
21999
|
const key = headerActionKey(action, i);
|
|
21989
22000
|
if (action.kind === "icon") {
|
|
@@ -22003,7 +22014,38 @@ function HeaderActions(props) {
|
|
|
22003
22014
|
function headerActionKey(action, index) {
|
|
22004
22015
|
if (action.kind === "icon") return `${action.icon}-${index}`;
|
|
22005
22016
|
if (action.kind === "menu") return `menu-${index}`;
|
|
22006
|
-
return `${
|
|
22017
|
+
return `${action.label}-${index}`;
|
|
22018
|
+
}
|
|
22019
|
+
function toMenuItems(actions) {
|
|
22020
|
+
return actions.flatMap((action) => {
|
|
22021
|
+
if (action.kind === "menu") return action.items;
|
|
22022
|
+
const {
|
|
22023
|
+
label,
|
|
22024
|
+
onClick,
|
|
22025
|
+
disabled
|
|
22026
|
+
} = action;
|
|
22027
|
+
const itemOnClick = typeof onClick === "string" ? onClick : () => void onClick({});
|
|
22028
|
+
if (action.kind === "icon") {
|
|
22029
|
+
return [{
|
|
22030
|
+
label,
|
|
22031
|
+
onClick: itemOnClick,
|
|
22032
|
+
disabled,
|
|
22033
|
+
icon: action.icon
|
|
22034
|
+
}];
|
|
22035
|
+
}
|
|
22036
|
+
return [{
|
|
22037
|
+
label,
|
|
22038
|
+
onClick: itemOnClick,
|
|
22039
|
+
disabled,
|
|
22040
|
+
// Buttons can opt out of their default icon with `icon: null`, which menu items can't render.
|
|
22041
|
+
...action.icon ? {
|
|
22042
|
+
icon: action.icon
|
|
22043
|
+
} : {},
|
|
22044
|
+
...action.variant === "danger" ? {
|
|
22045
|
+
destructive: true
|
|
22046
|
+
} : {}
|
|
22047
|
+
}];
|
|
22048
|
+
});
|
|
22007
22049
|
}
|
|
22008
22050
|
|
|
22009
22051
|
// src/components/Headers/ContentHeader.tsx
|
|
@@ -28380,8 +28422,72 @@ function EnvironmentBannerLayout(props) {
|
|
|
28380
28422
|
}
|
|
28381
28423
|
|
|
28382
28424
|
// src/layouts/FormSectionLayout/FormSectionLayout.tsx
|
|
28425
|
+
var import_runtime148 = require("@homebound/truss/runtime");
|
|
28426
|
+
|
|
28427
|
+
// src/layouts/FormSectionLayout/JumpLinksRail.tsx
|
|
28383
28428
|
var import_runtime147 = require("@homebound/truss/runtime");
|
|
28384
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
|
+
};
|
|
28385
28491
|
function FormSectionLayout(props) {
|
|
28386
28492
|
const {
|
|
28387
28493
|
title,
|
|
@@ -28390,10 +28496,23 @@ function FormSectionLayout(props) {
|
|
|
28390
28496
|
withAutoSave,
|
|
28391
28497
|
initialFields,
|
|
28392
28498
|
sections,
|
|
28393
|
-
aiMode = false
|
|
28499
|
+
aiMode = false,
|
|
28500
|
+
withJumpLinks = false
|
|
28394
28501
|
} = props;
|
|
28395
28502
|
const tid = useTestIds(props, "formSectionLayout");
|
|
28396
|
-
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)({
|
|
28397
28516
|
display: "df",
|
|
28398
28517
|
flexDirection: "fdc",
|
|
28399
28518
|
gap: "gap8",
|
|
@@ -28404,21 +28523,34 @@ function FormSectionLayout(props) {
|
|
|
28404
28523
|
paddingLeft: "pl3"
|
|
28405
28524
|
} : {}
|
|
28406
28525
|
}), children: [
|
|
28407
|
-
/* @__PURE__ */ (0,
|
|
28408
|
-
/* @__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 }),
|
|
28409
28528
|
initialFields
|
|
28410
28529
|
] }),
|
|
28411
|
-
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 })
|
|
28412
28545
|
] });
|
|
28413
|
-
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 });
|
|
28414
28546
|
}
|
|
28415
28547
|
|
|
28416
28548
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
28417
|
-
var
|
|
28418
|
-
var
|
|
28549
|
+
var import_react162 = require("react");
|
|
28550
|
+
var import_runtime149 = require("@homebound/truss/runtime");
|
|
28419
28551
|
|
|
28420
28552
|
// src/layouts/useAutoHideOnScroll.ts
|
|
28421
|
-
var
|
|
28553
|
+
var import_react159 = require("react");
|
|
28422
28554
|
var THRESHOLD = 80;
|
|
28423
28555
|
function getInitialAutoHideState() {
|
|
28424
28556
|
if (typeof window === "undefined" || window.scrollY <= 0) {
|
|
@@ -28428,15 +28560,15 @@ function getInitialAutoHideState() {
|
|
|
28428
28560
|
}
|
|
28429
28561
|
function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
28430
28562
|
const initial = getInitialAutoHideState();
|
|
28431
|
-
const [state, setState] = (0,
|
|
28432
|
-
const stateRef = (0,
|
|
28433
|
-
const [atTop, setAtTop] = (0,
|
|
28434
|
-
const atTopRef = (0,
|
|
28435
|
-
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);
|
|
28436
28568
|
getTopOffsetRef.current = getTopOffset;
|
|
28437
|
-
const lastScrollY = (0,
|
|
28438
|
-
const lastScrollHeight = (0,
|
|
28439
|
-
(0,
|
|
28569
|
+
const lastScrollY = (0, import_react159.useRef)(Number.POSITIVE_INFINITY);
|
|
28570
|
+
const lastScrollHeight = (0, import_react159.useRef)(0);
|
|
28571
|
+
(0, import_react159.useLayoutEffect)(() => {
|
|
28440
28572
|
if (!enabled) {
|
|
28441
28573
|
stateRef.current = "static";
|
|
28442
28574
|
atTopRef.current = true;
|
|
@@ -28508,36 +28640,36 @@ function useAutoHideOnScroll(spacerRef, enabled, getTopOffset) {
|
|
|
28508
28640
|
}
|
|
28509
28641
|
|
|
28510
28642
|
// src/layouts/useMeasuredHeight.ts
|
|
28511
|
-
var
|
|
28512
|
-
var
|
|
28643
|
+
var import_utils194 = require("@react-aria/utils");
|
|
28644
|
+
var import_react160 = require("react");
|
|
28513
28645
|
function useMeasuredHeight(ref, enabled) {
|
|
28514
|
-
const [height, setHeight] = (0,
|
|
28515
|
-
const syncElementHeight = (0,
|
|
28646
|
+
const [height, setHeight] = (0, import_react160.useState)(0);
|
|
28647
|
+
const syncElementHeight = (0, import_react160.useCallback)(() => {
|
|
28516
28648
|
const el = ref.current;
|
|
28517
28649
|
const next = el ? Math.round(el.getBoundingClientRect().height) : 0;
|
|
28518
28650
|
setHeight((prev) => prev === next ? prev : next);
|
|
28519
28651
|
}, [ref]);
|
|
28520
|
-
(0,
|
|
28521
|
-
(0,
|
|
28652
|
+
(0, import_utils194.useResizeObserver)({ ref, onResize: syncElementHeight });
|
|
28653
|
+
(0, import_react160.useLayoutEffect)(() => {
|
|
28522
28654
|
syncElementHeight();
|
|
28523
28655
|
}, [enabled, syncElementHeight]);
|
|
28524
28656
|
return height;
|
|
28525
28657
|
}
|
|
28526
28658
|
|
|
28527
28659
|
// src/layouts/NavbarLayout/NavbarLayoutHeightContext.tsx
|
|
28528
|
-
var
|
|
28529
|
-
var
|
|
28530
|
-
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);
|
|
28531
28663
|
function NavbarLayoutHeightProvider({ value, children }) {
|
|
28532
|
-
return /* @__PURE__ */ (0,
|
|
28664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)(NavbarLayoutHeightContext.Provider, { value, children });
|
|
28533
28665
|
}
|
|
28534
28666
|
function useNavbarLayoutHeight() {
|
|
28535
|
-
return (0,
|
|
28667
|
+
return (0, import_react161.useContext)(NavbarLayoutHeightContext);
|
|
28536
28668
|
}
|
|
28537
28669
|
|
|
28538
28670
|
// src/layouts/NavbarLayout/NavbarLayout.tsx
|
|
28539
|
-
var
|
|
28540
|
-
var
|
|
28671
|
+
var import_jsx_runtime232 = require("react/jsx-runtime");
|
|
28672
|
+
var __maybeInc33 = (inc) => {
|
|
28541
28673
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28542
28674
|
};
|
|
28543
28675
|
function NavbarLayout(props) {
|
|
@@ -28546,8 +28678,8 @@ function NavbarLayout(props) {
|
|
|
28546
28678
|
children
|
|
28547
28679
|
} = props;
|
|
28548
28680
|
const tid = useTestIds(props, "navbarLayout");
|
|
28549
|
-
const navMetricsRef = (0,
|
|
28550
|
-
const spacerRef = (0,
|
|
28681
|
+
const navMetricsRef = (0, import_react162.useRef)(null);
|
|
28682
|
+
const spacerRef = (0, import_react162.useRef)(null);
|
|
28551
28683
|
const navHeight = useMeasuredHeight(navMetricsRef, true);
|
|
28552
28684
|
const {
|
|
28553
28685
|
state: autoHideState,
|
|
@@ -28565,10 +28697,10 @@ function NavbarLayout(props) {
|
|
|
28565
28697
|
position: "sticky",
|
|
28566
28698
|
left: "left0",
|
|
28567
28699
|
zIndex: ["z_var", {
|
|
28568
|
-
"--zIndex": (0,
|
|
28700
|
+
"--zIndex": (0, import_runtime149.maybeCssVar)(zIndices.navbar)
|
|
28569
28701
|
}],
|
|
28570
28702
|
width: ["w_var", {
|
|
28571
|
-
"--width": (0,
|
|
28703
|
+
"--width": (0, import_runtime149.maybeCssVar)(__maybeInc33(innerWidth))
|
|
28572
28704
|
}]
|
|
28573
28705
|
}
|
|
28574
28706
|
) : (
|
|
@@ -28577,10 +28709,10 @@ function NavbarLayout(props) {
|
|
|
28577
28709
|
position: "fixed",
|
|
28578
28710
|
left: "left0",
|
|
28579
28711
|
zIndex: ["z_var", {
|
|
28580
|
-
"--zIndex": (0,
|
|
28712
|
+
"--zIndex": (0, import_runtime149.maybeCssVar)(zIndices.navbar)
|
|
28581
28713
|
}],
|
|
28582
28714
|
width: ["w_var", {
|
|
28583
|
-
"--width": (0,
|
|
28715
|
+
"--width": (0, import_runtime149.maybeCssVar)(__maybeInc33(innerWidth))
|
|
28584
28716
|
}],
|
|
28585
28717
|
transition: "transitionTop"
|
|
28586
28718
|
}
|
|
@@ -28589,29 +28721,29 @@ function NavbarLayout(props) {
|
|
|
28589
28721
|
const innerStyle = autoHideState !== "static" ? {
|
|
28590
28722
|
top: autoHideState === "revealed" ? bannerTop : `calc(${bannerTop} - ${navHeight}px)`
|
|
28591
28723
|
} : void 0;
|
|
28592
|
-
const navbarEl = (0,
|
|
28593
|
-
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, {
|
|
28594
28726
|
display: "df",
|
|
28595
28727
|
flexDirection: "fdc",
|
|
28596
28728
|
width: "wfc",
|
|
28597
28729
|
minWidth: "mw100"
|
|
28598
28730
|
}), ...tid, children: [
|
|
28599
|
-
/* @__PURE__ */ (0,
|
|
28731
|
+
/* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { ref: spacerRef, ...(0, import_runtime149.mergeProps)(void 0, {
|
|
28600
28732
|
height: navHeight
|
|
28601
28733
|
}, {
|
|
28602
28734
|
flexShrink: "fs0",
|
|
28603
28735
|
width: "w100"
|
|
28604
|
-
}), children: /* @__PURE__ */ (0,
|
|
28605
|
-
/* @__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 })
|
|
28606
28738
|
] }) }) }) });
|
|
28607
28739
|
}
|
|
28608
28740
|
|
|
28609
28741
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
28610
|
-
var
|
|
28742
|
+
var import_react163 = require("react");
|
|
28611
28743
|
|
|
28612
28744
|
// src/components/Headers/BaseHeader.tsx
|
|
28613
|
-
var
|
|
28614
|
-
var
|
|
28745
|
+
var import_runtime150 = require("@homebound/truss/runtime");
|
|
28746
|
+
var import_jsx_runtime233 = require("react/jsx-runtime");
|
|
28615
28747
|
function BaseHeader(props) {
|
|
28616
28748
|
const {
|
|
28617
28749
|
title,
|
|
@@ -28623,7 +28755,7 @@ function BaseHeader(props) {
|
|
|
28623
28755
|
} = props;
|
|
28624
28756
|
const tid = useTestIds(otherProps, "header");
|
|
28625
28757
|
useDocumentTitle(title, documentTitleSuffix);
|
|
28626
|
-
return /* @__PURE__ */ (0,
|
|
28758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("header", { ...tid, ...(0, import_runtime150.trussProps)({
|
|
28627
28759
|
display: "df",
|
|
28628
28760
|
flexDirection: "fdc",
|
|
28629
28761
|
paddingTop: "pt3",
|
|
@@ -28637,7 +28769,7 @@ function BaseHeader(props) {
|
|
|
28637
28769
|
"--backgroundColor": "var(--b-surface)"
|
|
28638
28770
|
}]
|
|
28639
28771
|
}), children: [
|
|
28640
|
-
/* @__PURE__ */ (0,
|
|
28772
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsxs)("div", { ...(0, import_runtime150.trussProps)({
|
|
28641
28773
|
...{
|
|
28642
28774
|
display: "df",
|
|
28643
28775
|
justifyContent: "jcsb",
|
|
@@ -28651,9 +28783,9 @@ function BaseHeader(props) {
|
|
|
28651
28783
|
} : {}
|
|
28652
28784
|
}
|
|
28653
28785
|
}), children: [
|
|
28654
|
-
/* @__PURE__ */ (0,
|
|
28655
|
-
breadcrumbs && /* @__PURE__ */ (0,
|
|
28656
|
-
/* @__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)({
|
|
28657
28789
|
fontWeight: "fw6",
|
|
28658
28790
|
fontSize: "fz_20px",
|
|
28659
28791
|
lineHeight: "lh_28px",
|
|
@@ -28662,22 +28794,27 @@ function BaseHeader(props) {
|
|
|
28662
28794
|
}]
|
|
28663
28795
|
}), children: title })
|
|
28664
28796
|
] }),
|
|
28665
|
-
/* @__PURE__ */ (0,
|
|
28797
|
+
/* @__PURE__ */ (0, import_jsx_runtime233.jsx)("div", { className: "fs0", children: rightSlot })
|
|
28666
28798
|
] }),
|
|
28667
28799
|
bottomSlot
|
|
28668
28800
|
] });
|
|
28669
28801
|
}
|
|
28670
28802
|
|
|
28671
28803
|
// src/components/Headers/PageHeader.tsx
|
|
28672
|
-
var
|
|
28673
|
-
var
|
|
28804
|
+
var import_runtime151 = require("@homebound/truss/runtime");
|
|
28805
|
+
var import_jsx_runtime234 = require("react/jsx-runtime");
|
|
28674
28806
|
function PageHeader2(props) {
|
|
28675
28807
|
const {
|
|
28676
28808
|
tabs,
|
|
28809
|
+
actions,
|
|
28810
|
+
rightSlot,
|
|
28677
28811
|
...otherProps
|
|
28678
28812
|
} = props;
|
|
28679
28813
|
const tid = useTestIds(otherProps, "header");
|
|
28680
|
-
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: [
|
|
28815
|
+
rightSlot,
|
|
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 }) }) });
|
|
28681
28818
|
}
|
|
28682
28819
|
|
|
28683
28820
|
// src/layouts/useBannerAndNavbarHeight.ts
|
|
@@ -28686,9 +28823,9 @@ function useBannerAndNavbarHeight() {
|
|
|
28686
28823
|
}
|
|
28687
28824
|
|
|
28688
28825
|
// src/layouts/PageHeaderLayout/PageHeaderLayout.tsx
|
|
28689
|
-
var
|
|
28690
|
-
var
|
|
28691
|
-
var
|
|
28826
|
+
var import_runtime152 = require("@homebound/truss/runtime");
|
|
28827
|
+
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
28828
|
+
var __maybeInc34 = (inc) => {
|
|
28692
28829
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28693
28830
|
};
|
|
28694
28831
|
function PageHeaderLayout(props) {
|
|
@@ -28698,11 +28835,11 @@ function PageHeaderLayout(props) {
|
|
|
28698
28835
|
} = props;
|
|
28699
28836
|
const tid = useTestIds(props, "pageHeaderLayout");
|
|
28700
28837
|
const bannerAndNavbarHeight = useBannerAndNavbarHeight();
|
|
28701
|
-
const bannerAndNavbarHeightRef = (0,
|
|
28838
|
+
const bannerAndNavbarHeightRef = (0, import_react163.useRef)(bannerAndNavbarHeight);
|
|
28702
28839
|
bannerAndNavbarHeightRef.current = bannerAndNavbarHeight;
|
|
28703
|
-
const getBannerAndNavbarHeight = (0,
|
|
28704
|
-
const headerMetricsRef = (0,
|
|
28705
|
-
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);
|
|
28706
28843
|
const headerHeight = useMeasuredHeight(headerMetricsRef, true);
|
|
28707
28844
|
const {
|
|
28708
28845
|
state: autoHideState,
|
|
@@ -28718,103 +28855,46 @@ function PageHeaderLayout(props) {
|
|
|
28718
28855
|
const innerCss = autoHideState === "static" ? {
|
|
28719
28856
|
position: "sticky",
|
|
28720
28857
|
left: ["left_var", {
|
|
28721
|
-
"--left": (0,
|
|
28858
|
+
"--left": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerLeft))
|
|
28722
28859
|
}],
|
|
28723
28860
|
width: ["w_var", {
|
|
28724
|
-
"--width": (0,
|
|
28861
|
+
"--width": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerWidth))
|
|
28725
28862
|
}],
|
|
28726
28863
|
zIndex: ["z_var", {
|
|
28727
|
-
"--zIndex": (0,
|
|
28864
|
+
"--zIndex": (0, import_runtime152.maybeCssVar)(zIndices.pageStickyHeader)
|
|
28728
28865
|
}]
|
|
28729
28866
|
} : {
|
|
28730
28867
|
position: "fixed",
|
|
28731
28868
|
left: ["left_var", {
|
|
28732
|
-
"--left": (0,
|
|
28869
|
+
"--left": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerLeft))
|
|
28733
28870
|
}],
|
|
28734
28871
|
width: ["w_var", {
|
|
28735
|
-
"--width": (0,
|
|
28872
|
+
"--width": (0, import_runtime152.maybeCssVar)(__maybeInc34(headerWidth))
|
|
28736
28873
|
}],
|
|
28737
28874
|
zIndex: ["z_var", {
|
|
28738
|
-
"--zIndex": (0,
|
|
28875
|
+
"--zIndex": (0, import_runtime152.maybeCssVar)(zIndices.pageStickyHeader)
|
|
28739
28876
|
}],
|
|
28740
28877
|
transition: "transitionTop"
|
|
28741
28878
|
};
|
|
28742
28879
|
const innerStyle = autoHideState !== "static" ? {
|
|
28743
28880
|
top: autoHideState === "revealed" ? outerTop : `calc(${outerTop} - ${headerHeight}px)`
|
|
28744
28881
|
} : void 0;
|
|
28745
|
-
const pageHeaderEl = (0,
|
|
28746
|
-
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, {
|
|
28747
28884
|
display: "df",
|
|
28748
28885
|
flexDirection: "fdc",
|
|
28749
28886
|
width: "w100"
|
|
28750
28887
|
}), ...tid, children: [
|
|
28751
|
-
/* @__PURE__ */ (0,
|
|
28888
|
+
/* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { ref: spacerRef, ...(0, import_runtime152.mergeProps)(void 0, {
|
|
28752
28889
|
height: headerHeight
|
|
28753
28890
|
}, {
|
|
28754
28891
|
flexShrink: "fs0",
|
|
28755
28892
|
width: "w100"
|
|
28756
|
-
}), children: /* @__PURE__ */ (0,
|
|
28757
|
-
/* @__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 })
|
|
28758
28895
|
] }) });
|
|
28759
28896
|
}
|
|
28760
28897
|
|
|
28761
|
-
// src/layouts/Workflow/JumpLinksRail.tsx
|
|
28762
|
-
var import_runtime152 = require("@homebound/truss/runtime");
|
|
28763
|
-
var import_jsx_runtime235 = require("react/jsx-runtime");
|
|
28764
|
-
var __maybeInc33 = (inc) => {
|
|
28765
|
-
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28766
|
-
};
|
|
28767
|
-
var jumpLinksRailWidthPx = 180;
|
|
28768
|
-
function JumpLinksRail(props) {
|
|
28769
|
-
const {
|
|
28770
|
-
links,
|
|
28771
|
-
activeId
|
|
28772
|
-
} = props;
|
|
28773
|
-
const tid = useTestIds(props, "jumpLinks");
|
|
28774
|
-
return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("nav", { ...(0, import_runtime152.trussProps)({
|
|
28775
|
-
display: "df",
|
|
28776
|
-
flexDirection: "fdc",
|
|
28777
|
-
flexShrink: "fs0",
|
|
28778
|
-
width: ["w_var", {
|
|
28779
|
-
"--width": `${jumpLinksRailWidthPx}px`
|
|
28780
|
-
}],
|
|
28781
|
-
position: "sticky",
|
|
28782
|
-
alignSelf: "asfs",
|
|
28783
|
-
top: ["top_var", {
|
|
28784
|
-
"--top": (0, import_runtime152.maybeCssVar)(__maybeInc33(stickyNavAndHeaderOffset()))
|
|
28785
|
-
}]
|
|
28786
|
-
}), ...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)) });
|
|
28787
|
-
}
|
|
28788
|
-
|
|
28789
|
-
// src/layouts/Workflow/useActiveJumpLink.ts
|
|
28790
|
-
var import_react163 = require("react");
|
|
28791
|
-
var activationLeadPx = 120;
|
|
28792
|
-
function useActiveJumpLink(sectionIds) {
|
|
28793
|
-
const idsKey = sectionIds.join("\0");
|
|
28794
|
-
const [activeId, setActiveId] = (0, import_react163.useState)(sectionIds[0]);
|
|
28795
|
-
(0, import_react163.useLayoutEffect)(() => {
|
|
28796
|
-
const ids = idsKey.length === 0 ? [] : idsKey.split("\0");
|
|
28797
|
-
if (ids.length === 0) return;
|
|
28798
|
-
const update = () => {
|
|
28799
|
-
const first = ids.map((id) => document.getElementById(id)).find((el) => el !== null);
|
|
28800
|
-
if (!first) return;
|
|
28801
|
-
const headerOffset = stickyNavAndHeaderOffsetPx(first);
|
|
28802
|
-
let current = ids[0];
|
|
28803
|
-
for (const id of ids) {
|
|
28804
|
-
const el = document.getElementById(id);
|
|
28805
|
-
if (el && el.getBoundingClientRect().top - headerOffset <= activationLeadPx) {
|
|
28806
|
-
current = id;
|
|
28807
|
-
}
|
|
28808
|
-
}
|
|
28809
|
-
setActiveId(current);
|
|
28810
|
-
};
|
|
28811
|
-
update();
|
|
28812
|
-
window.addEventListener("scroll", update, { passive: true });
|
|
28813
|
-
return () => window.removeEventListener("scroll", update);
|
|
28814
|
-
}, [idsKey]);
|
|
28815
|
-
return sectionIds.includes(activeId ?? "") ? activeId : sectionIds[0];
|
|
28816
|
-
}
|
|
28817
|
-
|
|
28818
28898
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
28819
28899
|
var import_react165 = require("react");
|
|
28820
28900
|
|
|
@@ -28911,7 +28991,7 @@ function WorkflowActions(props) {
|
|
|
28911
28991
|
// src/layouts/Workflow/WorkflowPageLayout.tsx
|
|
28912
28992
|
var import_runtime153 = require("@homebound/truss/runtime");
|
|
28913
28993
|
var import_jsx_runtime239 = require("react/jsx-runtime");
|
|
28914
|
-
var
|
|
28994
|
+
var __maybeInc35 = (inc) => {
|
|
28915
28995
|
return typeof inc === "string" ? inc : `calc(var(--t-spacing) * ${inc})`;
|
|
28916
28996
|
};
|
|
28917
28997
|
var mobileFooterHeightPx = 80;
|
|
@@ -28969,13 +29049,13 @@ function WorkflowPageLayout(props) {
|
|
|
28969
29049
|
position: "sticky",
|
|
28970
29050
|
left: "left0",
|
|
28971
29051
|
width: ["w_var", {
|
|
28972
|
-
"--width": (0, import_runtime153.maybeCssVar)(
|
|
29052
|
+
"--width": (0, import_runtime153.maybeCssVar)(__maybeInc35(headerWidth))
|
|
28973
29053
|
}],
|
|
28974
29054
|
zIndex: ["z_var", {
|
|
28975
29055
|
"--zIndex": (0, import_runtime153.maybeCssVar)(zIndices.pageStickyHeader)
|
|
28976
29056
|
}],
|
|
28977
29057
|
top: ["top_var", {
|
|
28978
|
-
"--top": (0, import_runtime153.maybeCssVar)(
|
|
29058
|
+
"--top": (0, import_runtime153.maybeCssVar)(__maybeInc35(outerTop))
|
|
28979
29059
|
}]
|
|
28980
29060
|
}), ...tid.header, children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(WorkflowHeader, { title, documentTitleSuffix, breadcrumbs, rightSlot: isMobile ? void 0 : actions, stepperTabs }) }),
|
|
28981
29061
|
/* @__PURE__ */ (0, import_jsx_runtime239.jsx)("div", { ...(0, import_runtime153.trussProps)({
|
|
@@ -29005,7 +29085,7 @@ function WorkflowPageLayout(props) {
|
|
|
29005
29085
|
position: "fixed",
|
|
29006
29086
|
bottom: "bottom0",
|
|
29007
29087
|
width: ["w_var", {
|
|
29008
|
-
"--width": (0, import_runtime153.maybeCssVar)(
|
|
29088
|
+
"--width": (0, import_runtime153.maybeCssVar)(__maybeInc35(headerWidth))
|
|
29009
29089
|
}],
|
|
29010
29090
|
height: ["h_var", {
|
|
29011
29091
|
"--height": `${mobileFooterHeightPx}px`
|
|
@@ -29036,35 +29116,23 @@ function WorkflowPageLayout(props) {
|
|
|
29036
29116
|
// src/layouts/Workflow/FocusedFormLayout.tsx
|
|
29037
29117
|
var import_jsx_runtime240 = require("react/jsx-runtime");
|
|
29038
29118
|
function FocusedFormLayout(props) {
|
|
29039
|
-
const {
|
|
29040
|
-
onCancel,
|
|
29041
|
-
completeLabel,
|
|
29042
|
-
onComplete,
|
|
29043
|
-
onSaveAndExit,
|
|
29044
|
-
isValid,
|
|
29045
|
-
isDirty,
|
|
29046
|
-
withJumpLinks = true,
|
|
29047
|
-
aiMode,
|
|
29048
|
-
form,
|
|
29049
|
-
...headerProps
|
|
29050
|
-
} = props;
|
|
29119
|
+
const { onCancel, completeLabel, onComplete, onSaveAndExit, isValid, isDirty, aiMode, children, ...headerProps } = props;
|
|
29051
29120
|
const tid = useTestIds(props, "focusedFormLayout");
|
|
29052
|
-
|
|
29053
|
-
|
|
29054
|
-
|
|
29055
|
-
|
|
29056
|
-
|
|
29057
|
-
|
|
29058
|
-
|
|
29059
|
-
|
|
29060
|
-
|
|
29061
|
-
|
|
29062
|
-
|
|
29063
|
-
|
|
29064
|
-
|
|
29065
|
-
|
|
29066
|
-
|
|
29067
|
-
] }) });
|
|
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
|
+
);
|
|
29068
29136
|
}
|
|
29069
29137
|
|
|
29070
29138
|
// src/layouts/Workflow/StepperLayout.tsx
|