@muraldevkit/ui-toolkit 4.61.1-dev-lffA.1 → 4.61.2-dev-L2yg.1

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.
@@ -1,13 +1,8 @@
1
1
  import * as React from 'react';
2
- export type MrlPanelContextState = {
3
- hasScrollbar: boolean;
4
- scrollbarWidth: number;
5
- };
6
- export declare const initialState: {
7
- hasScrollbar: boolean;
8
- scrollbarWidth: number;
9
- };
10
- export declare const MrlPanelContext: React.Context<MrlPanelContextState>;
2
+ import { ScrollbarInfo } from '../../../hooks';
3
+ export type MrlPanelContextState = ScrollbarInfo;
4
+ export declare const initialState: MrlPanelContextState;
5
+ export declare const MrlPanelContext: React.Context<ScrollbarInfo>;
11
6
  /**
12
7
  * Returns the MrlPanelContext state.
13
8
  *
@@ -1,14 +1,24 @@
1
1
  import * as React from 'react';
2
- export type UseScrollbarInfoReturn<T extends HTMLElement> = {
2
+ export type ScrollbarInfo = {
3
+ /** Indicates if a horizontal scrollbar is present */
3
4
  hasHorizontalScrollbar: boolean;
5
+ /** Indicates if a vertical scrollbar is present */
4
6
  hasVerticalScrollbar: boolean;
7
+ /** Width in pixels of the vertical scrollbar (0 for overlay scrollbars) */
8
+ verticalScrollbarWidth: number;
9
+ /** Height in pixels of the horizontal scrollbar (0 for overlay scrollbars) */
10
+ horizontalScrollbarHeight: number;
11
+ };
12
+ /**
13
+ * Return type for the `useScrollbarInfo` hook.
14
+ */
15
+ export type UseScrollbarInfoReturn<T extends HTMLElement> = ScrollbarInfo & {
5
16
  scrollableContainerRef: React.MutableRefObject<T | null>;
6
- scrollbarWidth: number;
7
17
  };
8
18
  /**
9
- * Custom hook that provides information about the presence and width of scrollbars
19
+ * Custom hook that provides information about the presence and dimensions of vertical and horizontal scrollbars
10
20
  * in a scrollable container.
11
21
  *
12
- * @returns {UseScrollbarInfoReturn} hasHorizontalScrollbar, hasVerticalScrollbar and scrollbarWidth values.
22
+ * @returns {UseScrollbarInfoReturn} Returns the scrollbar information and a ref to attach to the scrollable container
13
23
  */
14
24
  export declare function useScrollbarInfo<T extends HTMLElement>(): UseScrollbarInfoReturn<T>;