@muraldevkit/ui-toolkit 2.52.1 → 2.52.2-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,32 @@
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
+ autoFocus?: boolean;
13
+ children: React.ReactElement;
14
+ disableClickOutside?: boolean;
15
+ description?: string | JSX.Element;
16
+ eyebrow?: string;
17
+ id?: string;
18
+ image?: JSX.Element;
19
+ renderWithPortal?: boolean;
20
+ show: boolean;
21
+ title?: string;
22
+ primaryCta?: MrlCalloutCTA;
23
+ secondaryCta?: MrlCalloutCTA;
24
+ }
25
+ /**
26
+ * MrlCallout component.
27
+ *
28
+ * @param props - The props.
29
+ * @returns {React.ReactElement} The MrlCallout component.
30
+ */
31
+ 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;
32
+ 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,31 @@
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;
23
+ /** If the popover should open when clicking the trigger */
24
+ disableClickToOpen?: boolean;
12
25
  /** If the popover should close when clicking outside of the menu */
13
26
  disableClickOutside?: boolean;
14
- /**
15
- * spacing of menu
16
- * - 'default' has 16px padding
17
- * - 'compact' has 12px padding
18
- */
19
- spacing?: 'default' | 'compact';
27
+ /** If the popover should disable focus trap */
28
+ disableFocusTrap?: boolean;
20
29
  /** Unique identifier for the menu */
21
30
  id?: string;
22
31
  /** If the menu is a submenu */
@@ -29,16 +38,6 @@ export interface MrlPopoverProps {
29
38
  * @default 'bottom'
30
39
  */
31
40
  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
41
  /**
43
42
  * Vertical and horizontal alignment of the popover relative to the position with the trigger
44
43
  * - 'left' and 'right' work with position 'top' and 'bottom'
@@ -48,6 +47,16 @@ export interface MrlPopoverProps {
48
47
  * This does not impact submenus
49
48
  */
50
49
  alignment?: MenuAlignment;
50
+ /**
51
+ * spacing of menu
52
+ * - 'default' has 16px padding
53
+ * - 'compact' has 12px padding
54
+ */
55
+ spacing?: 'default' | 'compact';
56
+ /**
57
+ * Reference to the DOM element that triggers this menu.
58
+ */
59
+ triggerRef?: RefObject<HTMLElement>;
51
60
  /**
52
61
  * If the menu should be rendered with the inverse theme
53
62
  *
@@ -60,12 +69,31 @@ export interface MrlPopoverProps {
60
69
  * @default false
61
70
  */
62
71
  point?: boolean;
72
+ /**
73
+ * Props for the portal component
74
+ */
75
+ portalProps?: Omit<PortalProps, 'children'>;
76
+ /**
77
+ * Offset in pixels for the popover
78
+ *
79
+ * The popover automatically calculates the proper offset based on the position and alignment
80
+ * this prop will override those values.
81
+ */
82
+ offset?: number;
83
+ /**
84
+ * Callback to be called when the menu is opened
85
+ */
86
+ onOpen?: () => void;
63
87
  /**
64
88
  * Callback to be called when the menu is closed
65
89
  *
66
90
  * @param type - type of close event
67
91
  */
68
92
  onClose?: (type?: string) => void;
93
+ /**
94
+ * data-qa attribute for the popover
95
+ */
96
+ ['data-qa']?: string;
69
97
  }
70
98
  /**
71
99
  * MrlPopover
@@ -75,7 +103,7 @@ export interface MrlPopoverProps {
75
103
  * @param {MrlPopoverProps} props - The props for the MrlPopover component
76
104
  * @returns {Element} - rendered MrlPopover component
77
105
  */
78
- export declare function MrlPopover({ alignment, ariaLabel, ariaLabelledBy, children, disableClickOutside, hasCloseButton, spacing, id, isSubMenu, actionState, position, point, kind, onClose, triggerRef, ...rest }: MrlPopoverProps): JSX.Element;
106
+ 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;
79
107
  export declare namespace MrlPopover {
80
108
  var componentType: string;
81
109
  }
@@ -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 {};