@muraldevkit/ui-toolkit 2.49.0 → 2.51.0-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,31 @@
1
+ import React from 'react';
2
+ import { MrlPopoverProps } from '../../popover';
3
+ export type MrlCalloutPopoverProps = Omit<MrlPopoverProps, 'children' | 'actionState' | 'isSubMenu' | 'triggerRef'>;
4
+ interface MrlCalloutCTA {
5
+ onClick: () => void;
6
+ dataQa?: string;
7
+ text: string;
8
+ }
9
+ export interface MrlCalloutProps extends MrlCalloutPopoverProps {
10
+ /** a unique id that binds the callout content and the trigger for assistive technologies */
11
+ ariaControls?: string;
12
+ children: React.ReactElement;
13
+ disableClickOutside?: boolean;
14
+ description?: string | JSX.Element;
15
+ eyebrow?: string;
16
+ id: string;
17
+ image?: JSX.Element;
18
+ renderWithPortal?: boolean;
19
+ show: boolean;
20
+ title: string;
21
+ primaryCta?: MrlCalloutCTA;
22
+ secondaryCta?: MrlCalloutCTA;
23
+ }
24
+ /**
25
+ * MrlCallout component.
26
+ *
27
+ * @param props - The props.
28
+ * @returns {React.ReactElement} The MrlCallout component.
29
+ */
30
+ export declare const MrlCallout: ({ ariaControls, alignment, children, description, disableClickOutside, disableFocusTrap, eyebrow, hasCloseButton, id, image, kind, onOpen, onClose, point, position, primaryCta, secondaryCta, show, spacing, title }: MrlCalloutProps) => React.ReactElement;
31
+ export {};
@@ -0,0 +1 @@
1
+ export { MrlCallout } from './MrlCallout';
@@ -0,0 +1 @@
1
+ export declare const HELLO_WORLD = "hello world";
@@ -0,0 +1 @@
1
+ export * from './MrlCallout';
@@ -23,3 +23,4 @@ export * from './navigation-sidebar';
23
23
  export * from './skeleton';
24
24
  export * from './empty';
25
25
  export * from './live-region';
26
+ export * from './callout';
@@ -1,22 +1,29 @@
1
1
  import React, { RefObject } from 'react';
2
- import { MenuPosition, MenuAlignment, ActionState } from '../../menu/constants';
2
+ import { PortalProps } from '../../';
3
+ import { MenuPosition, MenuAlignment, ActionState, CustomMenuPosition } from '../../menu/constants';
3
4
  export interface MrlPopoverProps {
5
+ /**
6
+ * Set initial state of menu
7
+ *
8
+ * @default { actionType: null, isOpen: false }
9
+ */
10
+ actionState?: ActionState;
4
11
  /** Label for the popover */
5
12
  ariaLabel?: string;
6
13
  /** ID of element to associate a label */
7
14
  ariaLabelledBy?: string;
8
15
  /** Children to be rendered within the menu component*/
9
16
  children: React.ReactNode;
17
+ /** Custom class names for the popover */
18
+ className?: string;
19
+ /** Custom position for the menu */
20
+ customPosition?: CustomMenuPosition;
10
21
  /** If the popover should have a close button */
11
22
  hasCloseButton?: boolean;
12
23
  /** If the popover should close when clicking outside of the menu */
13
24
  disableClickOutside?: boolean;
14
- /**
15
- * spacing of menu
16
- * - 'default' has 16px padding
17
- * - 'compact' has 12px padding
18
- */
19
- spacing?: 'default' | 'compact';
25
+ /** If the popover should disable focus trap */
26
+ disableFocusTrap?: boolean;
20
27
  /** Unique identifier for the menu */
21
28
  id?: string;
22
29
  /** If the menu is a submenu */
@@ -29,16 +36,6 @@ export interface MrlPopoverProps {
29
36
  * @default 'bottom'
30
37
  */
31
38
  position?: MenuPosition;
32
- /**
33
- * Set initial state of menu
34
- *
35
- * @default { actionType: null, isOpen: false }
36
- */
37
- actionState?: ActionState;
38
- /**
39
- * Reference to the DOM element that triggers this menu.
40
- */
41
- triggerRef?: RefObject<HTMLButtonElement>;
42
39
  /**
43
40
  * Vertical and horizontal alignment of the popover relative to the position with the trigger
44
41
  * - 'left' and 'right' work with position 'top' and 'bottom'
@@ -48,6 +45,16 @@ export interface MrlPopoverProps {
48
45
  * This does not impact submenus
49
46
  */
50
47
  alignment?: MenuAlignment;
48
+ /**
49
+ * spacing of menu
50
+ * - 'default' has 16px padding
51
+ * - 'compact' has 12px padding
52
+ */
53
+ spacing?: 'default' | 'compact';
54
+ /**
55
+ * Reference to the DOM element that triggers this menu.
56
+ */
57
+ triggerRef?: RefObject<HTMLElement>;
51
58
  /**
52
59
  * If the menu should be rendered with the inverse theme
53
60
  *
@@ -60,6 +67,14 @@ export interface MrlPopoverProps {
60
67
  * @default false
61
68
  */
62
69
  point?: boolean;
70
+ /**
71
+ * Props for the portal component
72
+ */
73
+ portalProps?: Omit<PortalProps, 'children'>;
74
+ /**
75
+ * Callback to be called when the menu is opened
76
+ */
77
+ onOpen?: () => void;
63
78
  /**
64
79
  * Callback to be called when the menu is closed
65
80
  *
@@ -75,7 +90,7 @@ export interface MrlPopoverProps {
75
90
  * @param {MrlPopoverProps} props - The props for the MrlPopover component
76
91
  * @returns {Element} - rendered MrlPopover component
77
92
  */
78
- export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, disableClickOutside, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, kind, onClose, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
93
+ export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, className, customPosition, disableClickOutside, disableFocusTrap, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, portalProps, kind, onClose, onOpen, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
79
94
  export declare namespace MrlPopover {
80
95
  var componentType: string;
81
96
  }
@@ -2,7 +2,17 @@ import React from 'react';
2
2
  export interface PortalProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
+ dataQa?: string;
6
+ /**
7
+ * Provide a portalElementRef to create a portal as a sibling of the ref element
8
+ * within its parent container.
9
+ *
10
+ * This can be used to help manage z-indexing and stacking context of the portal
11
+ */
12
+ portalElementRef?: React.RefObject<HTMLElement>;
5
13
  id?: string;
14
+ uniquePortalId?: boolean;
15
+ ['data-qa']?: string;
6
16
  }
7
17
  export declare const MRL_PORTAL_ID = "mrl-root-portal";
8
18
  /**
@@ -12,4 +22,4 @@ export declare const MRL_PORTAL_ID = "mrl-root-portal";
12
22
  * @param PortalProps Portal only takes children. Contact the platform team if you need to extend this.
13
23
  * @returns MrlPortal component
14
24
  */
15
- export declare const MrlPortal: ({ children, className, id, ...remainingProps }: PortalProps) => React.ReactElement | null;
25
+ export declare const MrlPortal: ({ children, className, id, portalElementRef, ...props }: PortalProps) => React.ReactElement | null;
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
2
  import { AttrsObject } from '../../../utils';
3
3
  import { LevelType, HeadingHierarchies, HeadingSizes, TextSizes, HeadingKinds } from '../constants';
4
- interface MrlTextHeadingProps {
5
- /** Applies additional HTML attributes to the text element */
4
+ interface MrlTextHeadingProps extends React.ComponentPropsWithRef<'h1'> {
5
+ /**
6
+ * Applies additional HTML attributes to the text element
7
+ *
8
+ * @deprecated - use `attrs` instead
9
+ */
6
10
  attrs?: AttrsObject;
7
11
  /** Children to be rendered within the text heading component */
8
12
  children?: React.ReactNode;
@@ -30,5 +34,5 @@ interface MrlTextHeadingProps {
30
34
  * @param {MrlTextHeadingProps} props - MrlTextHeading component props
31
35
  * @returns a heading element
32
36
  */
33
- export declare function MrlTextHeading({ attrs, children, hierarchy, kind, level, size, text }: MrlTextHeadingProps): JSX.Element;
37
+ export declare function MrlTextHeading({ attrs, children, className, hierarchy, kind, level, size, text }: MrlTextHeadingProps): JSX.Element;
34
38
  export {};
@@ -32,6 +32,8 @@ interface MrlTooltipProps {
32
32
  disableScreenReaderText?: boolean;
33
33
  /** Whether to disable the tooltip hover action that keeps it open */
34
34
  disableTooltipHover?: boolean;
35
+ /** Whether to force hide the tooltip */
36
+ forceHideTooltip?: boolean;
35
37
  /** The kind of tooltip to be rendered */
36
38
  kind?: MrlTooltipVariant;
37
39
  /** The placement of the tooltip in relation to its trigger */