@muraldevkit/ui-toolkit 4.36.0-dev-tJX9.1 → 4.36.1-dev-wCfI.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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Checks if a given HTML element is fully visible within the viewport or a scrollable parent.
3
+ *
4
+ * @param el - The HTML element to check.
5
+ * @param parent - The scrollable parent (HTMLElement or Window).
6
+ * @returns True if the element is fully visible within the parent, otherwise false.
7
+ */
8
+ export declare const isElementInViewport: (el: HTMLElement, parent: HTMLElement | Window) => boolean;
@@ -25,11 +25,3 @@ export declare const MrlTooltipDefaults: MrlTooltipDefaults;
25
25
  export type MrlTooltipVariant = 'default' | 'inverse';
26
26
  export type TooltipAlignment = 'start' | 'end' | 'center';
27
27
  export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
28
- export interface Alignment {
29
- align: TooltipAlignment;
30
- position: TooltipPosition;
31
- }
32
- export interface Position {
33
- top: number;
34
- left: number;
35
- }
@@ -1,16 +1,14 @@
1
1
  import { RefObject } from 'react';
2
2
  import { TooltipPlacement, Position } from './constants';
3
3
  /**
4
- * useTriggerPosition hook.
5
- *
6
- * Calculates the position of a menu element based on the alignment settings relative to a trigger element.
4
+ * A custom hook to calculate and manage the position of a tooltip element relative to its trigger element.
7
5
  *
8
6
  * @param {RefObject<HTMLElement>} triggerRef - Reference to the DOM element that triggers the menu.
9
7
  * @param {RefObject<HTMLElement>} elementRef - Reference to the DOM element that is the menu.
10
8
  * @param {TooltipPlacement} placement - The alignment configuration of the menu.
11
9
  * @param {boolean} isElementVisible - Tells the hook if the element is visible. If false, the hook will not calculate the position.
12
- * @param {number} menuOffset - The offset of the menu from the trigger element.
13
- * @param disable - Whether to disable the hook.
10
+ * @param {number} tooltipOffset - The offset of the menu from the trigger element.
11
+ * @param {boolean} disable - Whether to disable the hook.
14
12
  * @returns {Position} The calculated position of the menu element.
15
13
  */
16
- export declare const useTooltipPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, placement: TooltipPlacement, isElementVisible?: boolean, menuOffset?: number, disable?: boolean) => Position;
14
+ export declare const useTooltipPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, placement: TooltipPlacement, isElementVisible?: boolean, tooltipOffset?: number, disable?: boolean) => Position;