@muraldevkit/ui-toolkit 2.47.0 → 2.47.1-dev.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,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CustomMenuPosition } from '..';
|
|
3
|
+
import { MenuPosition, ActionState, MenuAlignment } from '../constants';
|
|
4
|
+
export interface MenuWithIconTriggerProps {
|
|
5
|
+
position?: MenuPosition;
|
|
6
|
+
spacing?: 'default' | 'compact';
|
|
7
|
+
alignment?: MenuAlignment;
|
|
8
|
+
actionState?: ActionState;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
customPosition?: CustomMenuPosition;
|
|
11
|
+
triggerAlignment?: 'left' | 'right' | 'center';
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Demo of a menu with a trigger for stories and testing
|
|
15
|
+
*
|
|
16
|
+
* @param {MenuWithTriggerProps} props - The props for the menu with trigger
|
|
17
|
+
* @returns {Element} The menu with trigger demo
|
|
18
|
+
*/
|
|
19
|
+
export declare const MenuWithIconTrigger: ({ alignment, position, spacing, actionState, customPosition, onClose, triggerAlignment }: MenuWithIconTriggerProps) => JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuPosition, ActionState, MenuAlignment } from '../../menu/constants';
|
|
3
|
+
interface PopoverWithIconButtonProps {
|
|
4
|
+
hasCloseButton?: boolean;
|
|
5
|
+
menuAlign?: MenuPosition;
|
|
6
|
+
spacing?: 'default' | 'compact';
|
|
7
|
+
alignment?: MenuAlignment;
|
|
8
|
+
actionState?: ActionState;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
triggerAlignment?: 'left' | 'right' | 'center';
|
|
11
|
+
kind?: 'inverse' | 'primary';
|
|
12
|
+
point?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Demo of a menu with a trigger for stories and testing
|
|
16
|
+
*
|
|
17
|
+
* @param {PopoverWithIconButtonProps} props - The props for the menu with trigger
|
|
18
|
+
* @returns {Element} The menu with trigger demo
|
|
19
|
+
*/
|
|
20
|
+
export declare const PopoverWithIconButton: ({ menuAlign, alignment, actionState, onClose, triggerAlignment, spacing, kind, point, hasCloseButton }: PopoverWithIconButtonProps) => JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
1
|
import { Alignment, Position } from './constants';
|
|
3
2
|
/**
|
|
4
3
|
* useTriggerPosition hook.
|
|
@@ -13,4 +12,4 @@ import { Alignment, Position } from './constants';
|
|
|
13
12
|
* @param disable - Whether to disable the hook.
|
|
14
13
|
* @returns {Position} The calculated position of the menu element.
|
|
15
14
|
*/
|
|
16
|
-
export declare const useTriggerPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean) => Position;
|
|
15
|
+
export declare const useTriggerPosition: (triggerRef: React.RefObject<HTMLElement> | undefined, elementRef: React.RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean) => Position;
|