@muraldevkit/ui-toolkit 4.38.0-dev-qOWj.1 → 4.39.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.
@@ -30,6 +30,12 @@ export interface MrlMenuProps {
30
30
  * with opening/closing the menu.
31
31
  */
32
32
  disableArrowOpen?: boolean;
33
+ /**
34
+ * Disable flipping of the menu when it goes off the screen
35
+ *
36
+ * @default false
37
+ */
38
+ disableFlipping?: boolean;
33
39
  /** Unique identifier for the menu */
34
40
  id?: string;
35
41
  /**
@@ -118,7 +124,7 @@ export interface MrlMenuProps {
118
124
  * @param {MrlMenuProps} props - The props for the MrlMenu component
119
125
  * @returns {Element} - rendered MrlMenu component
120
126
  */
121
- export declare function MrlMenu({ actionState, alignment, children, closeOnScroll, closeParent, customPosition, clickOutsideEvent, disableArrowOpen, id, isInternal, isSubMenu, spacing, menuOffset, portalProps, position, triggerStopPropagation, onClose, triggerRef, ...remainingProps }: MrlMenuProps): JSX.Element;
127
+ export declare function MrlMenu({ actionState, alignment, children, closeOnScroll, closeParent, customPosition, clickOutsideEvent, disableArrowOpen, disableFlipping, id, isInternal, isSubMenu, spacing, menuOffset, portalProps, position, triggerStopPropagation, onClose, triggerRef, ...remainingProps }: MrlMenuProps): JSX.Element;
122
128
  export declare namespace MrlMenu {
123
129
  var componentType: string;
124
130
  }
@@ -33,6 +33,12 @@ export interface MrlPopoverProps {
33
33
  * Example usage: MrlCallout component should not close when clicking outside, so it's set to true
34
34
  */
35
35
  disableClickOutside?: boolean;
36
+ /**
37
+ * Disable flipping of the popover when it goes off the screen
38
+ *
39
+ * @default false
40
+ */
41
+ disableFlipping?: boolean;
36
42
  /**
37
43
  * If the popover should disable focus trap
38
44
  *
@@ -125,7 +131,7 @@ export interface MrlPopoverProps {
125
131
  * @param {MrlPopoverProps} props - The props for the MrlPopover component
126
132
  * @returns {Element} - rendered MrlPopover component
127
133
  */
128
- export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, className, customPosition, disableClickToOpen, disableClickOutside, disableFocusTrap, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, portalProps, kind, offset, onClose, onOpen, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
134
+ export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, className, customPosition, disableClickToOpen, disableClickOutside, disableFlipping, disableFocusTrap, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, portalProps, kind, offset, onClose, onOpen, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
129
135
  export declare namespace MrlPopover {
130
136
  var componentType: string;
131
137
  }
@@ -3,6 +3,8 @@ import { NavLinkProps } from 'react-router-dom';
3
3
  export interface MrlTabLinkProps extends NavLinkProps {
4
4
  /** Class to be applied to the NavLink element of the MrlTabLink */
5
5
  className?: string;
6
+ /** Children to be rendered within the text component */
7
+ children?: React.ReactNode;
6
8
  icon?: React.ReactElement;
7
9
  /**
8
10
  * The id that will be passed to the MrlTabContext to set the active state.
@@ -11,7 +13,11 @@ export interface MrlTabLinkProps extends NavLinkProps {
11
13
  id: string;
12
14
  /** An addition function to call when clicking on a tab */
13
15
  hookClick?: () => void;
14
- text: string;
16
+ /**
17
+ * Textual content when it's a static string; if you have nested elements,
18
+ * use children to provide content
19
+ */
20
+ text?: string;
15
21
  }
16
22
  /**
17
23
  * Renders a tab component
@@ -19,4 +25,4 @@ export interface MrlTabLinkProps extends NavLinkProps {
19
25
  * @param {MrlTabLinkProps} props the props for your MrlTabLink
20
26
  * @returns {React.ReactElement} an a element containing the text you pass
21
27
  */
22
- export declare const MrlTabLink: ({ className, icon, id, hookClick, text, to, ...remainingProps }: MrlTabLinkProps) => React.ReactElement;
28
+ export declare const MrlTabLink: ({ className, children, icon, id, hookClick, text, to, ...remainingProps }: MrlTabLinkProps) => React.ReactElement;
@@ -11,6 +11,7 @@ import { Alignment, Position } from './constants';
11
11
  * @param {boolean} isElementVisible - Tells the hook if the element is visible. If false, the hook will not calculate the position.
12
12
  * @param {number} menuOffset - The offset of the menu from the trigger element.
13
13
  * @param disable - Whether to disable the hook.
14
+ * @param disableFlipping - Whether to disable flipping logic when the menu overflows the screen.
14
15
  * @returns {Position} The calculated position of the menu element.
15
16
  */
16
- export declare const useTriggerPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean) => Position;
17
+ export declare const useTriggerPosition: (triggerRef: RefObject<HTMLElement> | undefined, elementRef: RefObject<HTMLElement>, menuAlign: Alignment, isElementVisible?: boolean, menuOffset?: number, disable?: boolean, disableFlipping?: boolean) => Position;
@@ -6,6 +6,7 @@ import { Alignment, Position } from './constants';
6
6
  * @param {number} offset - The offset distance between the menu and the trigger.
7
7
  * @param {DOMRect} elementRect - The bounding rectangle of the menu element.
8
8
  * @param {DOMRect} [triggerRect] - The bounding rectangle of the trigger element.
9
+ * @param {boolean} [disableFlipping] - If true, prevents flipping to the opposite side when overflowing.
9
10
  * @returns {Position} The calculated position of the menu.
10
11
  */
11
- export declare const getPosition: (menuAlign: Alignment, offset: number, elementRect: DOMRect, triggerRect?: DOMRect) => Position;
12
+ export declare const getPosition: (menuAlign: Alignment, offset: number, elementRect: DOMRect, triggerRect?: DOMRect, disableFlipping?: boolean) => Position;