@muraldevkit/ui-toolkit 4.36.0-dev-tJX9.1 → 4.36.0

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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "4.36.0-dev-tJX9.1",
3
+ "version": "4.36.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,18 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { MrlTooltipAnchor, MrlTooltipPosition } from '../constants';
3
- interface PositionStyle {
4
- top: number;
5
- left: number;
6
- }
7
- /**
8
- * Calculates and returns the position style for a tooltip based on the trigger element, tooltip element, position, and anchor.
9
- *
10
- * @param triggerRef - A reference to the trigger element that the tooltip is anchored to.
11
- * @param tooltipRef - A reference to the tooltip element whose position is being calculated.
12
- * @param position - The position of the tooltip relative to the trigger element (e.g., 'top', 'bottom', 'left', 'right').
13
- * @param anchor - The anchor point of the tooltip relative to the trigger element (e.g., 'start', 'center', 'end').
14
- * @param isVisible - A boolean indicating whether the tooltip is visible.
15
- * @returns An object containing the calculated `top` and `left` values for the tooltip's position.
16
- */
17
- export declare function useTooltipPosition(triggerRef: RefObject<HTMLElement>, tooltipRef: RefObject<HTMLElement>, position: MrlTooltipPosition, anchor: MrlTooltipAnchor, isVisible: boolean): PositionStyle;
18
- export {};