@homebound/beam 2.275.0 → 2.275.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.
@@ -30,10 +30,10 @@ function ScrollShadows(props) {
30
30
  setShowStartShadow(start > 0);
31
31
  setShowEndShadow(start + boxSize < end);
32
32
  }, []);
33
- // Initially set the state dimensions on render to put the shadows in the correct position
34
- (0, utils_1.useLayoutEffect)(() => {
35
- scrollRef.current && updateScrollProps(scrollRef.current);
36
- }, []);
33
+ // Use a ResizeObserver to update the scroll props to determine if the shadows should be shown.
34
+ // This executes on render and subsequent resizes which could be due to content/`children` changes (such as responses from APIs).
35
+ const onResize = (0, react_1.useCallback)(() => scrollRef.current && updateScrollProps(scrollRef.current), []);
36
+ (0, utils_1.useResizeObserver)({ ref: scrollRef, onResize });
37
37
  return ((0, jsx_runtime_1.jsxs)("div", { css: src_1.Css.relative.overflowHidden
38
38
  .h(height)
39
39
  .w(width)
@@ -27,6 +27,7 @@ export * from "./Modal/useModal";
27
27
  export { NavLink } from "./NavLink";
28
28
  export * from "./Pagination";
29
29
  export { PresentationProvider } from "./PresentationContext";
30
+ export * from "./ScrollShadows";
30
31
  export * from "./Snackbar";
31
32
  export * from "./Stepper";
32
33
  export type { Step, StepperProps } from "./Stepper";
@@ -51,6 +51,7 @@ Object.defineProperty(exports, "NavLink", { enumerable: true, get: function () {
51
51
  __exportStar(require("./Pagination"), exports);
52
52
  var PresentationContext_1 = require("./PresentationContext");
53
53
  Object.defineProperty(exports, "PresentationProvider", { enumerable: true, get: function () { return PresentationContext_1.PresentationProvider; } });
54
+ __exportStar(require("./ScrollShadows"), exports);
54
55
  __exportStar(require("./Snackbar"), exports);
55
56
  __exportStar(require("./Stepper"), exports);
56
57
  __exportStar(require("./SuperDrawer"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.275.0",
3
+ "version": "2.275.2",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",