@homebound/beam 2.71.9 → 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.
- package/dist/components/Layout/ScrollableContent.d.ts +1 -1
- package/dist/components/Layout/ScrollableContent.js +4 -0
- package/dist/components/Layout/ScrollableParent.d.ts +3 -2
- package/dist/components/Layout/ScrollableParent.js +4 -3
- package/dist/components/NavLink.js +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/package.json +1 -1
|
@@ -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,13 +1,14 @@
|
|
|
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
|
}
|
|
8
8
|
interface ScrollableParentContextProviderProps {
|
|
9
9
|
xss?: Properties;
|
|
10
|
+
tagName?: keyof JSX.IntrinsicElements;
|
|
10
11
|
}
|
|
11
|
-
export declare function ScrollableParent(
|
|
12
|
+
export declare function ScrollableParent(props: PropsWithChildren<ScrollableParentContextProviderProps>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare function useScrollableParent(): ScrollableParentContextProps;
|
|
13
14
|
export {};
|
|
@@ -5,11 +5,12 @@ 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:
|
|
8
|
+
scrollableEl: null,
|
|
9
9
|
pr: 0,
|
|
10
10
|
pl: 0,
|
|
11
11
|
});
|
|
12
|
-
function ScrollableParent(
|
|
12
|
+
function ScrollableParent(props) {
|
|
13
|
+
const { children, xss, tagName: Tag = "div" } = props;
|
|
13
14
|
const scrollableEl = (0, react_1.useMemo)(() => {
|
|
14
15
|
const el = document.createElement("div");
|
|
15
16
|
// Ensure this wrapping div takes up the full height of its container
|
|
@@ -22,7 +23,7 @@ function ScrollableParent({ children, xss }) {
|
|
|
22
23
|
(0, react_1.useEffect)(() => {
|
|
23
24
|
scrollableRef.current.appendChild(scrollableEl);
|
|
24
25
|
}, [scrollableEl]);
|
|
25
|
-
return ((0, jsx_runtime_1.jsx)(ScrollableParentContext.Provider, Object.assign({ value: context }, { children: (0, jsx_runtime_1.jsxs)(
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(ScrollableParentContext.Provider, Object.assign({ value: context }, { children: (0, jsx_runtime_1.jsxs)(Tag, Object.assign({ css: { ...Css_1.Css.mh0.mw0.df.fdc.$, ...otherXss } }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ css: Css_1.Css.pl(context.pl).pr(context.pr).$ }, { children: children }), void 0), (0, jsx_runtime_1.jsx)("div", { css: Css_1.Css.fg1.overflowAuto.pl(context.pl).pr(context.pr).$, ref: scrollableRef }, void 0)] }), void 0) }), void 0));
|
|
26
27
|
}
|
|
27
28
|
exports.ScrollableParent = ScrollableParent;
|
|
28
29
|
function useScrollableParent() {
|
|
@@ -39,7 +39,7 @@ exports.getNavLinkStyles = getNavLinkStyles;
|
|
|
39
39
|
const baseStyles = Css_1.Css.df.aic.hPx(32).pyPx(6).px1.br4.smEm.outline0.$;
|
|
40
40
|
const navLinkVariantStyles = {
|
|
41
41
|
side: {
|
|
42
|
-
baseStyles: { ...baseStyles, ...Css_1.Css.
|
|
42
|
+
baseStyles: { ...baseStyles, ...Css_1.Css.gray700.$ },
|
|
43
43
|
activeStyles: Css_1.Css.lightBlue700.bgLightBlue50.$,
|
|
44
44
|
disabledStyles: Css_1.Css.gray400.cursorNotAllowed.$,
|
|
45
45
|
focusRingStyles: Css_1.Css.bgLightBlue50.bshFocus.$,
|
|
@@ -46,5 +46,5 @@ function Popper({ triggerRef, content, placement = "auto" }) {
|
|
|
46
46
|
],
|
|
47
47
|
placement,
|
|
48
48
|
});
|
|
49
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: popperRef, style:
|
|
49
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: popperRef, style: styles.popper }, attributes.popper, { css: Css_1.Css.maxw("320px").bgGray900.white.px1.py("4px").br4.xs.z999.$ }, { children: [(0, jsx_runtime_1.jsx)("div", { ref: setArrowRef, style: { ...styles.arrow }, id: "arrow" }, void 0), content] }), void 0), document.body);
|
|
50
50
|
}
|