@homebound/beam 3.75.0 → 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/Css.json CHANGED
@@ -906,7 +906,7 @@
906
906
  "br24": {"kind":"static","defs":{"borderRadius":"24px"}},
907
907
  "brt4": {"kind":"static","defs":{"borderTopRightRadius":"4px","borderTopLeftRadius":"4px"}},
908
908
  "brb4": {"kind":"static","defs":{"borderBottomRightRadius":"4px","borderBottomLeftRadius":"4px"}},
909
- "layoutContainer": {"kind":"static","defs":{"width":"calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px))","left":"var(--beam-side-nav-layout-width, 0px)","position":"sticky","paddingLeft":"24px","paddingRight":"24px"}},
909
+ "layoutContainer": {"kind":"static","defs":{"width":"min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))","left":"var(--beam-side-nav-layout-width, 0px)","position":"sticky"}},
910
910
  "transition": {"kind":"static","defs":{"transition":"background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
911
911
  "transitionWidth": {"kind":"static","defs":{"transition":"width 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
912
912
  "transitionOpacity": {"kind":"static","defs":{"transition":"opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"}},
package/dist/index.cjs CHANGED
@@ -4228,12 +4228,12 @@ var CssBuilder = class _CssBuilder {
4228
4228
  return this.add("fontFamily", value);
4229
4229
  }
4230
4230
  // layoutContainer
4231
- /** Sets `width: "calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px))"; left: "var(--beam-side-nav-layout-width, 0px)"; position: "sticky"; paddingLeft: "24px"; paddingRight: "24px"`. */
4231
+ /** Sets `width: "min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))"; left: "var(--beam-side-nav-layout-width, 0px)"; position: "sticky"`. */
4232
4232
  get layoutContainer() {
4233
- return this.add("width", "calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px))").add("left", "var(--beam-side-nav-layout-width, 0px)").add("position", "sticky").add("paddingLeft", "24px").add(
4234
- "paddingRight",
4235
- "24px"
4236
- );
4233
+ return this.add(
4234
+ "width",
4235
+ "min(100%, calc(var(--beam-layout-viewport-width, 100vw) - var(--beam-side-nav-layout-width, 0px)))"
4236
+ ).add("left", "var(--beam-side-nav-layout-width, 0px)").add("position", "sticky");
4237
4237
  }
4238
4238
  // animation
4239
4239
  /** Sets `transition: "background-color 200ms cubic-bezier(0.4, 0, 0.2, 1), border-color 200ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1), left 200ms cubic-bezier(0.4, 0, 0.2, 1), right 200ms cubic-bezier(0.4, 0, 0.2, 1), margin 200ms cubic-bezier(0.4, 0, 0.2, 1), width 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1)"`. */
@@ -24501,11 +24501,9 @@ function ContentHeader(props) {
24501
24501
  display: "df",
24502
24502
  flexDirection: "fdc",
24503
24503
  gap: "gap_12px",
24504
- width: "w_calc_var_beam_layout_viewport_width_100vw_var_beam_side_nav_layout_width_0px",
24504
+ width: "w_min_100_calc_var_beam_layout_viewport_width_100vw_var_beam_side_nav_layout_width_0px",
24505
24505
  left: "l_var_beam_side_nav_layout_width_0px",
24506
24506
  position: "sticky",
24507
- paddingLeft: "pl_24px",
24508
- paddingRight: "pr_24px",
24509
24507
  backgroundColor: ["bgColor_var", {
24510
24508
  "--backgroundColor": "var(--b-surface)"
24511
24509
  }]
@@ -27227,7 +27225,7 @@ function PageHeaderLayout(props) {
27227
27225
  }
27228
27226
 
27229
27227
  // src/layouts/WorkflowLayout/WorkflowLayout.tsx
27230
- var import_react159 = require("react");
27228
+ var import_react158 = require("react");
27231
27229
 
27232
27230
  // src/components/Headers/WorkflowHeader.tsx
27233
27231
  var import_jsx_runtime218 = require("react/jsx-runtime");
@@ -27237,67 +27235,16 @@ function WorkflowHeader(props) {
27237
27235
  return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(BaseHeader, { ...otherProps, bottomSlot: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)(StepperTabs, { ...stepperTabs, ...tid.stepperTabs }) });
27238
27236
  }
27239
27237
 
27240
- // src/layouts/useScrollCollapse.ts
27241
- var import_react157 = require("react");
27242
- function useScrollCollapse(enabled, restingOffset) {
27243
- const [collapsed, setCollapsed] = (0, import_react157.useState)(() => typeof window !== "undefined" && window.scrollY > 0);
27244
- const collapsedRef = (0, import_react157.useRef)(collapsed);
27245
- collapsedRef.current = collapsed;
27246
- const restingOffsetRef = (0, import_react157.useRef)(restingOffset);
27247
- restingOffsetRef.current = restingOffset;
27248
- const lastScrollYRef = (0, import_react157.useRef)(Number.POSITIVE_INFINITY);
27249
- const lastScrollHeightRef = (0, import_react157.useRef)(0);
27250
- (0, import_react157.useLayoutEffect)(() => {
27251
- lastScrollHeightRef.current = document.documentElement.scrollHeight;
27252
- }, [restingOffset]);
27253
- (0, import_react157.useLayoutEffect)(() => {
27254
- if (!enabled) return;
27255
- const commit = (next) => {
27256
- if (next !== collapsedRef.current) {
27257
- collapsedRef.current = next;
27258
- setCollapsed(next);
27259
- }
27260
- };
27261
- const updateCollapsed = () => {
27262
- const doc = document.documentElement;
27263
- const currentY = window.scrollY;
27264
- if (currentY <= 0) {
27265
- lastScrollYRef.current = 0;
27266
- lastScrollHeightRef.current = doc.scrollHeight;
27267
- commit(false);
27268
- return;
27269
- }
27270
- const currentScrollHeight = doc.scrollHeight;
27271
- const scrollHeightChanged = lastScrollHeightRef.current !== 0 && currentScrollHeight !== lastScrollHeightRef.current;
27272
- const dy = currentY - lastScrollYRef.current;
27273
- lastScrollYRef.current = currentY;
27274
- lastScrollHeightRef.current = currentScrollHeight;
27275
- if (currentY <= restingOffsetRef.current) return;
27276
- if (scrollHeightChanged) {
27277
- commit(true);
27278
- return;
27279
- }
27280
- const atBottom = currentY >= doc.scrollHeight - doc.clientHeight;
27281
- if (dy > 0) commit(true);
27282
- else if (dy < 0 && !atBottom) commit(false);
27283
- };
27284
- updateCollapsed();
27285
- window.addEventListener("scroll", updateCollapsed, { passive: true });
27286
- return () => window.removeEventListener("scroll", updateCollapsed);
27287
- }, [enabled]);
27288
- return collapsed;
27289
- }
27290
-
27291
27238
  // src/layouts/WorkflowLayout/useUnsavedChangesGuard.tsx
27292
- var import_react158 = require("react");
27239
+ var import_react157 = require("react");
27293
27240
  var import_react_router_dom9 = require("react-router-dom");
27294
27241
  var import_jsx_runtime219 = require("react/jsx-runtime");
27295
27242
  function useUnsavedChangesGuard(options) {
27296
27243
  const { isDirty, onCancel } = options;
27297
27244
  const { openModal } = useModal();
27298
- const isDirtyRef = (0, import_react158.useRef)(isDirty);
27245
+ const isDirtyRef = (0, import_react157.useRef)(isDirty);
27299
27246
  isDirtyRef.current = isDirty;
27300
- (0, import_react158.useEffect)(() => {
27247
+ (0, import_react157.useEffect)(() => {
27301
27248
  const onBeforeUnload = (e) => {
27302
27249
  if (isDirtyRef.current?.()) {
27303
27250
  e.preventDefault();
@@ -27323,7 +27270,7 @@ function useUnsavedChangesGuard(options) {
27323
27270
  function UnsavedChangesNavigationModal(props) {
27324
27271
  const { proceed, cancelNavigation } = props;
27325
27272
  const { openModal, closeModal } = useModal();
27326
- (0, import_react158.useEffect)(() => {
27273
+ (0, import_react157.useEffect)(() => {
27327
27274
  openModal({
27328
27275
  allowClosing: false,
27329
27276
  content: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(ConfirmCloseModal, { title: "Leave page?", onClose: proceed, onContinue: cancelNavigation })
@@ -27379,7 +27326,7 @@ function WorkflowLayout(props) {
27379
27326
  ...step,
27380
27327
  value: defaultTestId(step.label)
27381
27328
  }));
27382
- const [currentStep, setCurrentStep] = (0, import_react159.useState)(() => getInitialStep(stepTabs, defaultStep));
27329
+ const [currentStep, setCurrentStep] = (0, import_react158.useState)(() => getInitialStep(stepTabs, defaultStep));
27383
27330
  const tid = useTestIds(props, "workflowLayout");
27384
27331
  const {
27385
27332
  sm: isMobile
@@ -27391,11 +27338,8 @@ function WorkflowLayout(props) {
27391
27338
  isDirty,
27392
27339
  onCancel
27393
27340
  });
27394
- const bannerAndNavbarHeight = useBannerAndNavbarHeight();
27395
- const headerMetricsRef = (0, import_react159.useRef)(null);
27341
+ const headerMetricsRef = (0, import_react158.useRef)(null);
27396
27342
  const headerHeight = useMeasuredHeight(headerMetricsRef, true);
27397
- const scrollCollapsed = useScrollCollapse(!isMobile, bannerAndNavbarHeight + headerHeight);
27398
- const collapsed = isMobile || scrollCollapsed;
27399
27343
  const headerWidth = documentScrollChromeWidth();
27400
27344
  const outerTop = bannerAndNavbarChromeTop();
27401
27345
  const cssVars = headerHeight > 0 ? {
@@ -27414,7 +27358,7 @@ function WorkflowLayout(props) {
27414
27358
  setCurrentStep(stepTabs[currentIndex + 1].value);
27415
27359
  } });
27416
27360
  const showFooter = isMobile;
27417
- (0, import_react159.useLayoutEffect)(() => {
27361
+ (0, import_react158.useLayoutEffect)(() => {
27418
27362
  const root = document.documentElement;
27419
27363
  const previous = root.style.getPropertyValue(beamWorkflowLayoutFooterHeightVar);
27420
27364
  root.style.setProperty(beamWorkflowLayoutFooterHeightVar, showFooter ? `${mobileFooterHeightPx}px` : "0px");
@@ -27426,12 +27370,19 @@ function WorkflowLayout(props) {
27426
27370
  }
27427
27371
  };
27428
27372
  }, [showFooter]);
27429
- const headerEl = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(WorkflowHeader, { ...headerProps, rightSlot: isMobile ? void 0 : buttons, stepperTabs: {
27430
- steps: stepTabs,
27431
- currentStep,
27432
- onChange: setCurrentStep,
27433
- collapsed
27434
- } });
27373
+ const headerEl = /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(
27374
+ WorkflowHeader,
27375
+ {
27376
+ ...headerProps,
27377
+ rightSlot: isMobile ? void 0 : buttons,
27378
+ stepperTabs: {
27379
+ steps: stepTabs,
27380
+ currentStep,
27381
+ onChange: setCurrentStep,
27382
+ collapsed: isMobile
27383
+ }
27384
+ }
27385
+ );
27435
27386
  return /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)(DocumentScrollLayoutProvider, { children: [
27436
27387
  /* @__PURE__ */ (0, import_jsx_runtime221.jsxs)("div", { ...(0, import_runtime138.mergeProps)(void 0, cssVars, {
27437
27388
  display: "df",