@homebound/beam 2.71.12 → 2.71.13

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.
@@ -3,4 +3,4 @@ import { ReactNode, ReactPortal } from "react";
3
3
  export declare function ScrollableContent({ children, virtualized, }: {
4
4
  children: ReactNode;
5
5
  virtualized?: boolean;
6
- }): ReactPortal;
6
+ }): ReactPortal | JSX.Element;
@@ -9,6 +9,10 @@ const Css_1 = require("../../Css");
9
9
  /** Helper component for placing scrollable content within a `NestedScrollProvider`. */
10
10
  function ScrollableContent({ children, virtualized = false, }) {
11
11
  const { scrollableEl, pl } = (0, ScrollableParent_1.useScrollableParent)();
12
+ // Escape hatch specifically for tests where a "ScrollableParent" context may not be present.
13
+ if (!scrollableEl) {
14
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }, void 0);
15
+ }
12
16
  return (0, react_dom_1.createPortal)(!virtualized ? (children) : (
13
17
  // To prevent Virtuoso's scrollbar from being set in based on the Layout's padding, we will use the FullBleed component w/o padding to push it back over
14
18
  (0, jsx_runtime_1.jsx)(FullBleed_1.FullBleed, Object.assign({ omitPadding: true }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.h100.pl(pl).$ }, { children: children }), void 0) }), void 0)), scrollableEl);
@@ -1,7 +1,7 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  import { Properties } from "../../Css";
3
3
  interface ScrollableParentContextProps {
4
- scrollableEl: HTMLElement;
4
+ scrollableEl: HTMLElement | null;
5
5
  pr: string | number;
6
6
  pl: string | number;
7
7
  }
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Css_1 = require("../../Css");
7
7
  const ScrollableParentContext = (0, react_1.createContext)({
8
- scrollableEl: document.createElement("div"),
8
+ scrollableEl: null,
9
9
  pr: 0,
10
10
  pl: 0,
11
11
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.71.12",
3
+ "version": "2.71.13",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",