react-magma-dom 4.9.0-next.5 → 4.9.0-next.6
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.
- package/dist/components/Popover/Popover.d.ts +102 -0
- package/dist/components/Popover/PopoverContent.d.ts +12 -0
- package/dist/components/Popover/PopoverSection.d.ts +13 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +37 -0
- package/dist/components/Popover/index.d.ts +4 -0
- package/dist/esm/index.js +1156 -24
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/properties.json +627 -4
- package/dist/react-magma-dom.cjs.development.js +490 -18
- package/dist/react-magma-dom.cjs.development.js.map +1 -1
- package/dist/react-magma-dom.cjs.production.min.js +1 -1
- package/dist/react-magma-dom.cjs.production.min.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReferenceType } from '@floating-ui/react-dom';
|
|
3
|
+
export declare enum PopoverPosition {
|
|
4
|
+
bottom = "bottom",
|
|
5
|
+
top = "top"
|
|
6
|
+
}
|
|
7
|
+
export interface PopoverApi {
|
|
8
|
+
closePopoverManually(event: any): void;
|
|
9
|
+
}
|
|
10
|
+
export interface PopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/**
|
|
12
|
+
* Function called when closing the popover menu
|
|
13
|
+
*/
|
|
14
|
+
onClose?: (event: React.SyntheticEvent) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Function called when opening the popover menu
|
|
17
|
+
*/
|
|
18
|
+
onOpen?: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
testId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Determines the position of the popover relative to its trigger.
|
|
25
|
+
* @default PopoverPosition.bottom
|
|
26
|
+
*/
|
|
27
|
+
position?: PopoverPosition;
|
|
28
|
+
/**
|
|
29
|
+
* Sets the maximum height of the popover content.
|
|
30
|
+
* @default 100%
|
|
31
|
+
*/
|
|
32
|
+
maxHeight?: string | number;
|
|
33
|
+
/**
|
|
34
|
+
* Sets the width of the popover.
|
|
35
|
+
* @default Width of longest menu item
|
|
36
|
+
*/
|
|
37
|
+
width?: string | number;
|
|
38
|
+
/**
|
|
39
|
+
* If true, the popover will remain open when hovered over.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
hoverable?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If true, the component will have inverse styling to better appear on a dark background
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
isInverse?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If true, the popover will be disabled and cannot be opened.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
isDisabled?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* If true, a pointer (arrow) is displayed pointing towards the trigger element.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
hasPointer?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* If true, the popover is open by default when the component is first rendered.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
openByDefault?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The ref object that allows Popover manipulation.
|
|
65
|
+
* Actions available:
|
|
66
|
+
* closePopoverManually(event): void - Closes the popover manually.
|
|
67
|
+
*/
|
|
68
|
+
apiRef?: React.MutableRefObject<PopoverApi | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* If true, the focus will be trapped within the popover, preventing focus from moving outside.
|
|
71
|
+
* This is recommended when using interactive elements inside the popover to improve accessibility.
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
focusTrap?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface PopoverContextInterface {
|
|
77
|
+
floatingStyles?: React.CSSProperties;
|
|
78
|
+
position?: PopoverPosition;
|
|
79
|
+
closePopover?: (event: React.SyntheticEvent | React.KeyboardEvent) => void;
|
|
80
|
+
popoverTriggerId?: React.MutableRefObject<string>;
|
|
81
|
+
popoverContentId?: React.MutableRefObject<string>;
|
|
82
|
+
openPopover?: () => void;
|
|
83
|
+
isInverse?: boolean;
|
|
84
|
+
isOpen: boolean;
|
|
85
|
+
maxHeight?: string;
|
|
86
|
+
width?: string;
|
|
87
|
+
contentRef?: any;
|
|
88
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
89
|
+
setFloating?: (node: ReferenceType) => void;
|
|
90
|
+
setReference?: (node: ReferenceType) => void;
|
|
91
|
+
arrowRef?: React.MutableRefObject<any>;
|
|
92
|
+
arrowContext?: any;
|
|
93
|
+
toggleRef?: any;
|
|
94
|
+
isDisabled?: boolean;
|
|
95
|
+
hoverable?: boolean;
|
|
96
|
+
hasPointer?: boolean;
|
|
97
|
+
focusTrap?: boolean;
|
|
98
|
+
hasActiveElements?: boolean;
|
|
99
|
+
}
|
|
100
|
+
export declare const PopoverContext: React.Context<PopoverContextInterface>;
|
|
101
|
+
export declare function hasActiveElementsChecker(ref: any): boolean;
|
|
102
|
+
export declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
testId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @children required
|
|
9
|
+
*/
|
|
10
|
+
children: React.ReactChild | React.ReactChild[];
|
|
11
|
+
}
|
|
12
|
+
export declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PopoverSectionProps {
|
|
3
|
+
/**
|
|
4
|
+
* @children required
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactChild | React.ReactChild[];
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
export declare const PopoverHeader: ({ children, style, ...other }: PopoverSectionProps) => JSX.Element;
|
|
13
|
+
export declare const PopoverFooter: ({ children, style, ...other }: PopoverSectionProps) => JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconProps } from 'react-magma-icons';
|
|
3
|
+
import { Omit, XOR } from '../../utils';
|
|
4
|
+
import { ButtonProps } from '../Button';
|
|
5
|
+
interface IconOnlyPopoverTriggerProps extends Omit<ButtonProps, 'children'> {
|
|
6
|
+
/**
|
|
7
|
+
* Icon to display within the component
|
|
8
|
+
*/
|
|
9
|
+
icon?: React.ReactElement<IconProps>;
|
|
10
|
+
/**
|
|
11
|
+
* The text the screen reader will announce. Required for icon-only buttons
|
|
12
|
+
*/
|
|
13
|
+
'aria-label': string;
|
|
14
|
+
/**
|
|
15
|
+
* The tab order of the component when navigating with a keyboard
|
|
16
|
+
*/
|
|
17
|
+
tabIndex?: number;
|
|
18
|
+
}
|
|
19
|
+
interface IconTextPopoverTriggerProps extends ButtonProps {
|
|
20
|
+
/**
|
|
21
|
+
* Icon to display within the component
|
|
22
|
+
*/
|
|
23
|
+
icon?: React.ReactElement<IconProps>;
|
|
24
|
+
/**
|
|
25
|
+
* The content of the component
|
|
26
|
+
*/
|
|
27
|
+
children: React.ReactChild | React.ReactChild[] | string;
|
|
28
|
+
/**
|
|
29
|
+
* The tab order of the component when navigating with a keyboard
|
|
30
|
+
*/
|
|
31
|
+
tabIndex?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare type PopoverTriggerProps = XOR<IconOnlyPopoverTriggerProps, IconTextPopoverTriggerProps>;
|
|
34
|
+
export declare const PopoverTrigger: React.ForwardRefExoticComponent<({} & IconTextPopoverTriggerProps & React.RefAttributes<HTMLButtonElement>) | ({
|
|
35
|
+
children?: never;
|
|
36
|
+
} & IconOnlyPopoverTriggerProps & React.RefAttributes<HTMLButtonElement>)>;
|
|
37
|
+
export {};
|