@registrucentras/rc-ses-react-components 2.0.0-rc.8 → 2.0.0-rc.9

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.
@@ -13,9 +13,10 @@ export interface RcSesSideNavProps {
13
13
  title?: string;
14
14
  overflow?: RcSesSideNavOverflow;
15
15
  offset?: number;
16
+ onOverlayHeightChange?: (height: number) => void;
16
17
  sx?: SxProps<Theme>;
17
18
  }
18
- export type RcSesSideNavLayoutProps = Omit<RcSesSideNavProps, 'sx'> & {
19
+ export type RcSesSideNavLayoutProps = Omit<RcSesSideNavProps, 'sx' | 'onOverlayHeightChange'> & {
19
20
  children: ReactNode;
20
21
  sidebarWidth?: string;
21
22
  sx?: SxProps<Theme>;
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Rendered height of an element, in pixels.
4
+ *
5
+ * 0 while the element is absent or `display: none`, which is what makes this
6
+ * usable as a breakpoint test: the nav's mobile bar and desktop column are
7
+ * swapped by a media query, so measuring the one that is switched off yields 0
8
+ * without the hook having to know anything about breakpoints.
9
+ */
10
+ declare function useElementHeight(ref: RefObject<HTMLElement>): number;
11
+ export default useElementHeight;
@@ -1,4 +1,4 @@
1
1
  import { RcSesSideNavProps } from './SideNav.types';
2
- declare function RcSesSideNav({ items, activeItemId, onItemClick, title, overflow, offset, sx, }: RcSesSideNavProps): import("react").JSX.Element;
2
+ declare function RcSesSideNav({ items, activeItemId, onItemClick, title, overflow, offset, onOverlayHeightChange, sx, }: RcSesSideNavProps): import("react").JSX.Element;
3
3
  export default RcSesSideNav;
4
4
  export type { RcSesSideNavItem, RcSesSideNavOverflow, RcSesSideNavProps, } from './SideNav.types';