asterui 0.12.43 → 0.12.45
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/ContextMenu.d.ts +4 -4
- package/dist/components/ContextMenu.js +96 -89
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Dropdown.d.ts +7 -6
- package/dist/components/Dropdown.js +192 -186
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Menu.d.ts +7 -5
- package/dist/components/Menu.js +106 -99
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/Message.d.ts +20 -0
- package/dist/components/Message.js +56 -0
- package/dist/components/Message.js.map +1 -0
- package/dist/components/Notification.d.ts +8 -1
- package/dist/components/Notification.js +84 -60
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/Tabs.d.ts +0 -2
- package/dist/components/Tabs.js +46 -43
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Tour.d.ts +71 -9
- package/dist/components/Tour.js +361 -198
- package/dist/components/Tour.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +120 -117
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export type TourPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom' | 'center';
|
|
3
|
+
export type TourType = 'default' | 'primary';
|
|
4
|
+
export interface TourArrowConfig {
|
|
5
|
+
pointAtCenter?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TourMaskConfig {
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TourButtonProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
}
|
|
3
15
|
export interface TourStepProps {
|
|
4
16
|
/** Target element ref or function returning element */
|
|
5
17
|
target?: React.RefObject<HTMLElement | null> | (() => HTMLElement | null) | null;
|
|
@@ -11,14 +23,43 @@ export interface TourStepProps {
|
|
|
11
23
|
cover?: React.ReactNode;
|
|
12
24
|
/** Placement of popover relative to target */
|
|
13
25
|
placement?: TourPlacement;
|
|
26
|
+
/** Whether to show arrow (overrides Tour setting) */
|
|
27
|
+
arrow?: boolean | TourArrowConfig;
|
|
28
|
+
/** Custom close icon for this step */
|
|
29
|
+
closeIcon?: React.ReactNode;
|
|
30
|
+
/** Show mask overlay (overrides Tour setting) */
|
|
31
|
+
mask?: boolean | TourMaskConfig;
|
|
32
|
+
/** Type affects styling (overrides Tour setting) */
|
|
33
|
+
type?: TourType;
|
|
34
|
+
/** Scroll into view options (overrides Tour setting) */
|
|
35
|
+
scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
|
|
36
|
+
/** Next button props */
|
|
37
|
+
nextButtonProps?: TourButtonProps;
|
|
38
|
+
/** Previous button props */
|
|
39
|
+
prevButtonProps?: TourButtonProps;
|
|
14
40
|
/** Custom class for this step's popover */
|
|
15
41
|
className?: string;
|
|
42
|
+
/** Custom style for this step's popover */
|
|
43
|
+
style?: React.CSSProperties;
|
|
16
44
|
/** Called when this step becomes active */
|
|
17
|
-
onOpen?: () => void;
|
|
18
|
-
/** Called when leaving this step */
|
|
19
45
|
onClose?: () => void;
|
|
20
46
|
}
|
|
21
|
-
export
|
|
47
|
+
export type TourSemanticName = 'root' | 'mask' | 'popover' | 'header' | 'content' | 'footer' | 'indicator' | 'close';
|
|
48
|
+
export interface TourActionInfo {
|
|
49
|
+
current: number;
|
|
50
|
+
total: number;
|
|
51
|
+
}
|
|
52
|
+
export interface TourRef {
|
|
53
|
+
/** Go to a specific step */
|
|
54
|
+
goTo: (step: number) => void;
|
|
55
|
+
/** Go to the next step */
|
|
56
|
+
next: () => void;
|
|
57
|
+
/** Go to the previous step */
|
|
58
|
+
prev: () => void;
|
|
59
|
+
/** Close the tour */
|
|
60
|
+
close: () => void;
|
|
61
|
+
}
|
|
62
|
+
export interface TourProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
22
63
|
/** Whether tour is visible */
|
|
23
64
|
open?: boolean;
|
|
24
65
|
/** Callback when tour closes */
|
|
@@ -31,12 +72,21 @@ export interface TourProps {
|
|
|
31
72
|
current?: number;
|
|
32
73
|
/** Callback when step changes */
|
|
33
74
|
onChange?: (current: number) => void;
|
|
75
|
+
/** Whether to show arrow on popover */
|
|
76
|
+
arrow?: boolean | TourArrowConfig;
|
|
77
|
+
/** Custom close icon */
|
|
78
|
+
closeIcon?: React.ReactNode;
|
|
34
79
|
/** Show mask overlay */
|
|
35
|
-
mask?: boolean;
|
|
80
|
+
mask?: boolean | TourMaskConfig;
|
|
81
|
+
/** Disable interaction on highlighted area */
|
|
82
|
+
disabledInteraction?: boolean;
|
|
36
83
|
/** Type affects styling */
|
|
37
|
-
type?:
|
|
38
|
-
/** Gap between highlight and target
|
|
39
|
-
gap?:
|
|
84
|
+
type?: TourType;
|
|
85
|
+
/** Gap between highlight and target */
|
|
86
|
+
gap?: {
|
|
87
|
+
offset?: number | [number, number];
|
|
88
|
+
radius?: number;
|
|
89
|
+
};
|
|
40
90
|
/** Text for prev button */
|
|
41
91
|
prevButtonText?: React.ReactNode;
|
|
42
92
|
/** Text for next button */
|
|
@@ -54,8 +104,20 @@ export interface TourProps {
|
|
|
54
104
|
/** Close on escape key */
|
|
55
105
|
closeOnEscape?: boolean;
|
|
56
106
|
/** Scroll target into view */
|
|
57
|
-
|
|
107
|
+
scrollIntoViewOptions?: boolean | ScrollIntoViewOptions;
|
|
58
108
|
/** Z-index for tour overlay */
|
|
59
109
|
zIndex?: number;
|
|
110
|
+
/** Custom indicator renderer */
|
|
111
|
+
indicatorsRender?: (current: number, total: number) => React.ReactNode;
|
|
112
|
+
/** Custom action buttons renderer */
|
|
113
|
+
actionsRender?: (originNode: React.ReactNode, info: TourActionInfo) => React.ReactNode;
|
|
114
|
+
/** Rendering container for tour */
|
|
115
|
+
getPopupContainer?: (node: HTMLElement) => HTMLElement;
|
|
116
|
+
/** Semantic class names */
|
|
117
|
+
classNames?: Partial<Record<TourSemanticName, string>>;
|
|
118
|
+
/** Semantic styles */
|
|
119
|
+
styles?: Partial<Record<TourSemanticName, React.CSSProperties>>;
|
|
120
|
+
/** Test ID for testing */
|
|
121
|
+
'data-testid'?: string;
|
|
60
122
|
}
|
|
61
|
-
export declare const Tour: React.
|
|
123
|
+
export declare const Tour: React.ForwardRefExoticComponent<TourProps & React.RefAttributes<TourRef>>;
|