@stack-spot/portal-layout 0.0.64 → 1.0.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.
- package/dist/Layout.d.ts +57 -5
- package/dist/Layout.d.ts.map +1 -1
- package/dist/Layout.js +12 -5
- package/dist/Layout.js.map +1 -1
- package/dist/LayoutOverlayManager.d.ts +173 -6
- package/dist/LayoutOverlayManager.d.ts.map +1 -1
- package/dist/LayoutOverlayManager.js +118 -9
- package/dist/LayoutOverlayManager.js.map +1 -1
- package/dist/components/Dialog.d.ts +48 -5
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.js +7 -2
- package/dist/components/Dialog.js.map +1 -1
- package/dist/components/Header.d.ts +29 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +6 -2
- package/dist/components/Header.js.map +1 -1
- package/dist/components/OverlayContent.d.ts +22 -0
- package/dist/components/OverlayContent.d.ts.map +1 -1
- package/dist/components/OverlayContent.js +4 -0
- package/dist/components/OverlayContent.js.map +1 -1
- package/dist/components/PortalSwitcher.d.ts +14 -0
- package/dist/components/PortalSwitcher.d.ts.map +1 -1
- package/dist/components/PortalSwitcher.js +9 -6
- package/dist/components/PortalSwitcher.js.map +1 -1
- package/dist/components/Toaster.d.ts +4 -0
- package/dist/components/Toaster.d.ts.map +1 -1
- package/dist/components/Toaster.js +5 -1
- package/dist/components/Toaster.js.map +1 -1
- package/dist/components/UserMenu.d.ts +14 -1
- package/dist/components/UserMenu.d.ts.map +1 -1
- package/dist/components/UserMenu.js +5 -1
- package/dist/components/UserMenu.js.map +1 -1
- package/dist/components/error/ErrorBoundary.d.ts +10 -1
- package/dist/components/error/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/error/ErrorBoundary.js +10 -1
- package/dist/components/error/ErrorBoundary.js.map +1 -1
- package/dist/components/error/ErrorManager.d.ts +22 -6
- package/dist/components/error/ErrorManager.d.ts.map +1 -1
- package/dist/components/error/ErrorManager.js +21 -1
- package/dist/components/error/ErrorManager.js.map +1 -1
- package/dist/components/error/SilentErrorBoundary.d.ts +11 -2
- package/dist/components/error/SilentErrorBoundary.d.ts.map +1 -1
- package/dist/components/error/SilentErrorBoundary.js +10 -0
- package/dist/components/error/SilentErrorBoundary.js.map +1 -1
- package/dist/components/menu/MenuContent.d.ts +19 -545
- package/dist/components/menu/MenuContent.d.ts.map +1 -1
- package/dist/components/menu/MenuContent.js +33 -35
- package/dist/components/menu/MenuContent.js.map +1 -1
- package/dist/components/menu/MenuSections.d.ts +10 -0
- package/dist/components/menu/MenuSections.d.ts.map +1 -1
- package/dist/components/menu/MenuSections.js +70 -16
- package/dist/components/menu/MenuSections.js.map +1 -1
- package/dist/components/menu/PageSelector.d.ts +5 -0
- package/dist/components/menu/PageSelector.d.ts.map +1 -1
- package/dist/components/menu/PageSelector.js +8 -3
- package/dist/components/menu/PageSelector.js.map +1 -1
- package/dist/components/menu/types.d.ts +100 -7
- package/dist/components/menu/types.d.ts.map +1 -1
- package/dist/components/tour/PortalSwitcherStep.d.ts +6 -1
- package/dist/components/tour/PortalSwitcherStep.d.ts.map +1 -1
- package/dist/components/tour/PortalSwitcherStep.js +6 -1
- package/dist/components/tour/PortalSwitcherStep.js.map +1 -1
- package/dist/components/types.d.ts +0 -13
- package/dist/components/types.d.ts.map +1 -1
- package/dist/dictionary.d.ts +3 -0
- package/dist/dictionary.d.ts.map +1 -1
- package/dist/dictionary.js +3 -0
- package/dist/dictionary.js.map +1 -1
- package/dist/elements.d.ts +6 -0
- package/dist/elements.d.ts.map +1 -1
- package/dist/elements.js +6 -0
- package/dist/elements.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/layout.css +1 -5
- package/dist/toaster.d.ts +74 -9
- package/dist/toaster.d.ts.map +1 -1
- package/dist/toaster.js +32 -6
- package/dist/toaster.js.map +1 -1
- package/dist/utils.d.ts +6 -69
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +9 -130
- package/dist/utils.js.map +1 -1
- package/package.json +12 -11
- package/readme.md +146 -0
- package/src/Layout.tsx +78 -28
- package/src/LayoutOverlayManager.tsx +184 -9
- package/src/components/Dialog.tsx +49 -6
- package/src/components/Header.tsx +31 -3
- package/src/components/OverlayContent.tsx +22 -0
- package/src/components/PortalSwitcher.tsx +22 -8
- package/src/components/Toaster.tsx +10 -2
- package/src/components/UserMenu.tsx +14 -1
- package/src/components/error/ErrorBoundary.tsx +11 -2
- package/src/components/error/ErrorManager.ts +22 -6
- package/src/components/error/SilentErrorBoundary.tsx +12 -2
- package/src/components/menu/MenuContent.tsx +33 -52
- package/src/components/menu/MenuSections.tsx +99 -49
- package/src/components/menu/PageSelector.tsx +8 -3
- package/src/components/menu/types.ts +100 -8
- package/src/components/tour/PortalSwitcherStep.tsx +7 -4
- package/src/components/types.ts +0 -14
- package/src/dictionary.ts +3 -0
- package/src/elements.ts +6 -0
- package/src/index.ts +0 -3
- package/src/layout.css +1 -5
- package/src/toaster.tsx +125 -14
- package/src/utils.ts +9 -142
- package/dist/components/BottomNotification.d.ts +0 -1
- package/dist/components/BottomNotification.d.ts.map +0 -1
- package/dist/components/BottomNotification.js +0 -2
- package/dist/components/BottomNotification.js.map +0 -1
- package/dist/components/BottomPanel.d.ts +0 -1
- package/dist/components/BottomPanel.d.ts.map +0 -1
- package/dist/components/BottomPanel.js +0 -2
- package/dist/components/BottomPanel.js.map +0 -1
- package/dist/components/SelectionList.d.ts +0 -36
- package/dist/components/SelectionList.d.ts.map +0 -1
- package/dist/components/SelectionList.js +0 -140
- package/dist/components/SelectionList.js.map +0 -1
- package/dist/components/error/ErrorDescriptor.d.ts +0 -12
- package/dist/components/error/ErrorDescriptor.d.ts.map +0 -1
- package/dist/components/error/ErrorDescriptor.js +0 -17
- package/dist/components/error/ErrorDescriptor.js.map +0 -1
- package/dist/components/error/ErrorFeedback.d.ts +0 -3
- package/dist/components/error/ErrorFeedback.d.ts.map +0 -1
- package/dist/components/error/ErrorFeedback.js +0 -66
- package/dist/components/error/ErrorFeedback.js.map +0 -1
- package/dist/components/menu/use-check-text-overflow.d.ts +0 -6
- package/dist/components/menu/use-check-text-overflow.d.ts.map +0 -1
- package/dist/components/menu/use-check-text-overflow.js +0 -20
- package/dist/components/menu/use-check-text-overflow.js.map +0 -1
- package/dist/components/menu/use-keyboard-controls.d.ts +0 -23
- package/dist/components/menu/use-keyboard-controls.d.ts.map +0 -1
- package/dist/components/menu/use-keyboard-controls.js +0 -49
- package/dist/components/menu/use-keyboard-controls.js.map +0 -1
- package/dist/components/menu/useCheckTextOverflow.d.ts +0 -6
- package/dist/components/menu/useCheckTextOverflow.d.ts.map +0 -1
- package/dist/components/menu/useCheckTextOverflow.js +0 -20
- package/dist/components/menu/useCheckTextOverflow.js.map +0 -1
- package/dist/components/tour/Navigation.d.ts +0 -8
- package/dist/components/tour/Navigation.d.ts.map +0 -1
- package/dist/components/tour/Navigation.js +0 -15
- package/dist/components/tour/Navigation.js.map +0 -1
- package/dist/components/tour/config.d.ts +0 -3
- package/dist/components/tour/config.d.ts.map +0 -1
- package/dist/components/tour/config.js +0 -22
- package/dist/components/tour/config.js.map +0 -1
- package/dist/components/tour/steps/PortalSwitcherStep.d.ts +0 -3
- package/dist/components/tour/steps/PortalSwitcherStep.d.ts.map +0 -1
- package/dist/components/tour/steps/PortalSwitcherStep.js +0 -30
- package/dist/components/tour/steps/PortalSwitcherStep.js.map +0 -1
- package/dist/components/tour/utils.d.ts +0 -9
- package/dist/components/tour/utils.d.ts.map +0 -1
- package/dist/components/tour/utils.js +0 -48
- package/dist/components/tour/utils.js.map +0 -1
- package/dist/layout-context.d.ts +0 -10
- package/dist/layout-context.d.ts.map +0 -1
- package/dist/layout-context.js +0 -11
- package/dist/layout-context.js.map +0 -1
- package/dist/svg/AI.d.ts +0 -6
- package/dist/svg/AI.d.ts.map +0 -1
- package/dist/svg/AI.js +0 -9
- package/dist/svg/AI.js.map +0 -1
- package/dist/svg/EDP.d.ts +0 -6
- package/dist/svg/EDP.d.ts.map +0 -1
- package/dist/svg/EDP.js +0 -5
- package/dist/svg/EDP.js.map +0 -1
- package/dist/svg/Forbidden.d.ts +0 -6
- package/dist/svg/Forbidden.d.ts.map +0 -1
- package/dist/svg/Forbidden.js +0 -4
- package/dist/svg/Forbidden.js.map +0 -1
- package/dist/svg/HUB.d.ts +0 -6
- package/dist/svg/HUB.d.ts.map +0 -1
- package/dist/svg/HUB.js +0 -5
- package/dist/svg/HUB.js.map +0 -1
- package/dist/svg/Logo.d.ts +0 -2
- package/dist/svg/Logo.d.ts.map +0 -1
- package/dist/svg/Logo.js +0 -4
- package/dist/svg/Logo.js.map +0 -1
- package/dist/svg/NotFound.d.ts +0 -6
- package/dist/svg/NotFound.d.ts.map +0 -1
- package/dist/svg/NotFound.js +0 -4
- package/dist/svg/NotFound.js.map +0 -1
- package/dist/svg/ServerError.d.ts +0 -6
- package/dist/svg/ServerError.d.ts.map +0 -1
- package/dist/svg/ServerError.js +0 -4
- package/dist/svg/ServerError.js.map +0 -1
- package/dist/svg/Unauthenticated.d.ts +0 -6
- package/dist/svg/Unauthenticated.d.ts.map +0 -1
- package/dist/svg/Unauthenticated.js +0 -4
- package/dist/svg/Unauthenticated.js.map +0 -1
- package/src/components/BottomNotification.tsx +0 -0
- package/src/components/BottomPanel.tsx +0 -0
- package/src/components/SelectionList.tsx +0 -272
- package/src/components/error/ErrorFeedback.tsx +0 -114
- package/src/components/menu/use-check-text-overflow.tsx +0 -26
- package/src/components/menu/use-keyboard-controls.tsx +0 -70
- package/src/layout-context.tsx +0 -22
- package/src/svg/AI.tsx +0 -37
- package/src/svg/EDP.tsx +0 -35
- package/src/svg/Forbidden.tsx +0 -22
- package/src/svg/HUB.tsx +0 -35
- package/src/svg/Logo.tsx +0 -35
- package/src/svg/NotFound.tsx +0 -16
- package/src/svg/ServerError.tsx +0 -33
- package/src/svg/Unauthenticated.tsx +0 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Action } from '@stack-spot/portal-components/SelectionList';
|
|
1
2
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { Action } from '../types.js';
|
|
3
3
|
interface BaseMenuItem {
|
|
4
4
|
hidden?: boolean;
|
|
5
5
|
/**
|
|
@@ -17,40 +17,100 @@ interface BaseMenuItem {
|
|
|
17
17
|
overflow?: 'hidden' | 'wrap' | 'ellipsis';
|
|
18
18
|
}
|
|
19
19
|
export interface ItemGroup extends BaseMenuItem {
|
|
20
|
+
/**
|
|
21
|
+
* The label for this group.
|
|
22
|
+
*/
|
|
20
23
|
label: string;
|
|
24
|
+
/**
|
|
25
|
+
* The items in this group.
|
|
26
|
+
*/
|
|
21
27
|
children: MenuItem[];
|
|
28
|
+
/**
|
|
29
|
+
* Whether it should start opened or not.
|
|
30
|
+
*/
|
|
22
31
|
open?: boolean;
|
|
23
32
|
}
|
|
24
33
|
export interface MenuAction extends Action, BaseMenuItem {
|
|
34
|
+
/**
|
|
35
|
+
* Whether this menu item is currently active or not.
|
|
36
|
+
*/
|
|
25
37
|
active?: boolean;
|
|
26
38
|
}
|
|
27
39
|
export type MenuItem = ItemGroup | MenuAction;
|
|
28
|
-
export interface MenuButton extends Action {
|
|
29
|
-
icon?: ReactElement;
|
|
30
|
-
}
|
|
31
40
|
export interface SelectorItem extends Action {
|
|
41
|
+
/**
|
|
42
|
+
* A unique id for this item.
|
|
43
|
+
*/
|
|
32
44
|
key: string;
|
|
45
|
+
/**
|
|
46
|
+
* An icon to place at the left side of the item.
|
|
47
|
+
*/
|
|
33
48
|
icon?: ReactElement;
|
|
34
49
|
}
|
|
35
50
|
export interface Selector {
|
|
51
|
+
/**
|
|
52
|
+
* The current value. Must correspond to a `key` in `options`.
|
|
53
|
+
*/
|
|
36
54
|
value?: string;
|
|
55
|
+
/**
|
|
56
|
+
* A series of options to show in the selector.
|
|
57
|
+
*/
|
|
37
58
|
options: SelectorItem[];
|
|
59
|
+
/**
|
|
60
|
+
* An extra button to show after the list of options.
|
|
61
|
+
*/
|
|
38
62
|
button?: Action;
|
|
63
|
+
/**
|
|
64
|
+
* A title of this selector.
|
|
65
|
+
*/
|
|
39
66
|
title?: string;
|
|
67
|
+
/**
|
|
68
|
+
* A subtitle for this selector.
|
|
69
|
+
*/
|
|
40
70
|
subtitle?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Whether or not the options for this selector are loading.
|
|
73
|
+
*/
|
|
41
74
|
loading?: boolean;
|
|
42
75
|
}
|
|
43
76
|
export interface MenuSectionContent {
|
|
77
|
+
/**
|
|
78
|
+
* A link to go back.
|
|
79
|
+
*/
|
|
44
80
|
goBack?: Action;
|
|
81
|
+
/**
|
|
82
|
+
* A title for this menu.
|
|
83
|
+
*/
|
|
45
84
|
title?: string;
|
|
85
|
+
/**
|
|
86
|
+
* A subtitle for this menu.
|
|
87
|
+
*/
|
|
46
88
|
subtitle?: string;
|
|
89
|
+
/**
|
|
90
|
+
* A custom React Node to add right after the menu title.
|
|
91
|
+
*/
|
|
47
92
|
afterTitle?: React.ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* A page selector.
|
|
95
|
+
*/
|
|
48
96
|
pageSelector?: Selector;
|
|
97
|
+
/**
|
|
98
|
+
* The menu options, may contain subgroups.
|
|
99
|
+
*/
|
|
49
100
|
options?: MenuItem[];
|
|
101
|
+
/**
|
|
102
|
+
* Whether or not the options for this menu are loading.
|
|
103
|
+
*/
|
|
50
104
|
loading?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* An error to show instead of the menu.
|
|
107
|
+
*/
|
|
51
108
|
error?: string;
|
|
52
109
|
}
|
|
53
110
|
export interface MenuSection extends Action {
|
|
111
|
+
/**
|
|
112
|
+
* The icon for this section.
|
|
113
|
+
*/
|
|
54
114
|
icon: ReactElement;
|
|
55
115
|
/**
|
|
56
116
|
* The content or a function that creates the content.
|
|
@@ -65,29 +125,62 @@ export interface MenuSection extends Action {
|
|
|
65
125
|
* This should be used when the content you want to render is not the default content
|
|
66
126
|
*/
|
|
67
127
|
customContent?: ReactNode;
|
|
128
|
+
/**
|
|
129
|
+
* Whether or not this section is currently active.
|
|
130
|
+
*/
|
|
68
131
|
active?: boolean;
|
|
69
|
-
|
|
132
|
+
/**
|
|
133
|
+
* A css class to pass to the <li> tag.
|
|
134
|
+
*/
|
|
70
135
|
className?: string;
|
|
71
136
|
hidden?: boolean;
|
|
72
137
|
}
|
|
73
138
|
interface BaseMenuProps {
|
|
139
|
+
/**
|
|
140
|
+
* The sections of the menu.
|
|
141
|
+
*/
|
|
74
142
|
sections?: MenuSection[];
|
|
143
|
+
/**
|
|
144
|
+
* The content of the menu as a React Element. Use this to create anything you want as the menu content, but prefer using `content`
|
|
145
|
+
* instead, which is a predefined menu.
|
|
146
|
+
*/
|
|
75
147
|
customContent?: ReactNode;
|
|
148
|
+
/**
|
|
149
|
+
* Options for the settings button.
|
|
150
|
+
*/
|
|
76
151
|
settings?: {
|
|
152
|
+
/**
|
|
153
|
+
* Whether or not to show the settings button.
|
|
154
|
+
*/
|
|
77
155
|
show?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* A function to call when the button is clicked.
|
|
158
|
+
*/
|
|
78
159
|
onClick?: () => void;
|
|
160
|
+
/**
|
|
161
|
+
* A url to go to when the button is clicked.
|
|
162
|
+
*/
|
|
79
163
|
href?: string;
|
|
164
|
+
/**
|
|
165
|
+
* Whether or not this button represents the page currently active.
|
|
166
|
+
*/
|
|
80
167
|
active?: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* A css class to pass to the button.
|
|
170
|
+
*/
|
|
81
171
|
className?: string;
|
|
82
172
|
};
|
|
83
173
|
}
|
|
84
174
|
export interface MenuPropsWithStaticContent extends BaseMenuProps {
|
|
175
|
+
/**
|
|
176
|
+
* The config for creating the menu content.
|
|
177
|
+
*/
|
|
85
178
|
content?: MenuSectionContent;
|
|
86
179
|
}
|
|
87
180
|
export interface MenuPropsWithDynamicContent extends BaseMenuProps {
|
|
88
181
|
/**
|
|
89
|
-
* The function that creates
|
|
90
|
-
* be rendered.
|
|
182
|
+
* The function that creates a config to render a menu content. It will be called only when the content is rendered, i.e. only when the
|
|
183
|
+
* content really needs to be rendered.
|
|
91
184
|
*
|
|
92
185
|
* Tip: this function can be a React Hook.
|
|
93
186
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6CAA6C,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE/C,UAAU,YAAY;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CAC3C;AAED,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,UAAW,SAAQ,MAAM,EAAE,YAAY;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;AAE7C,MAAM,WAAW,YAAa,SAAQ,MAAM;IAC1C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,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,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACT;;WAEG;QACH,IAAI,CAAC,EAAE,OAAO,CAAC;QACf;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QACrB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,0BAA2B,SAAQ,aAAa;IAC/D;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE;;;;;OAKG;IACH,OAAO,EAAE,kBAAkB,GAAG,CAAC,MAAM,kBAAkB,CAAC,CAAC;IACzD;;OAEG;IACH,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC;CACvB;AAED,MAAM,MAAM,SAAS,GAAG,0BAA0B,GAAG,2BAA2B,CAAA"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import { TourStep } from '@stack-spot/portal-components';
|
|
1
|
+
import { TourStep } from '@stack-spot/portal-components/Tour';
|
|
2
|
+
/**
|
|
3
|
+
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
4
|
+
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
5
|
+
* @returns the React Tour step for the PortalSwitcher.
|
|
6
|
+
*/
|
|
2
7
|
export declare const usePortalSwitcherStep: () => TourStep;
|
|
3
8
|
//# sourceMappingURL=PortalSwitcherStep.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM
|
|
1
|
+
{"version":3,"file":"PortalSwitcherStep.d.ts","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAmB,MAAM,oCAAoC,CAAA;AAG9E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,QAgBxC,CAAA"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Image, Text } from '@citric/core';
|
|
3
|
-
import { tourStepBuilder } from '@stack-spot/portal-components';
|
|
3
|
+
import { tourStepBuilder } from '@stack-spot/portal-components/Tour';
|
|
4
4
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
5
|
+
/**
|
|
6
|
+
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
7
|
+
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
8
|
+
* @returns the React Tour step for the PortalSwitcher.
|
|
9
|
+
*/
|
|
5
10
|
export const usePortalSwitcherStep = () => {
|
|
6
11
|
const t = useTranslate(translations);
|
|
7
12
|
return tourStepBuilder({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAY,eAAe,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"PortalSwitcherStep.js","sourceRoot":"","sources":["../../../src/components/tour/PortalSwitcherStep.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAY,eAAe,EAAE,MAAM,oCAAoC,CAAA;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAE3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAa,EAAE;IAClD,MAAM,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;IACpC,OAAO,eAAe,CAAC;QACrB,QAAQ,EAAE,kBAAkB;QAC5B,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,OAAO,EAAE,8BACP,KAAC,KAAK,IAAC,GAAG,EAAC,+CAA+C,EAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,GAAI,EAC9E,KAAC,GAAG,IAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,WAAW,EAAC,sBAAsB,YAAE,CAAC,CAAC,WAAW,GAAQ,GACnF,IACL;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;SACf;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE;QACF,KAAK,EAAE,qCAAqC;QAC5C,WAAW,EAAE,8LAA8L;QAC3M,QAAQ,EAAE,oFAAoF;KAC/F;IACD,EAAE,EAAE;QACF,KAAK,EAAE,uCAAuC;QAC9C,WAAW,EAAE,wMAAwM;QACrN,QAAQ,EAAE,sFAAsF;KACjG;CACF,CAAA"}
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
interface CustomLabel {
|
|
3
|
-
id: string;
|
|
4
|
-
element: ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export interface Action {
|
|
7
|
-
label: string | CustomLabel;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
href?: string;
|
|
10
|
-
target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
|
|
11
|
-
iconActive?: React.ReactElement;
|
|
12
|
-
}
|
|
13
1
|
export type PortalAcronym = 'EDP' | 'AI' | 'HUB';
|
|
14
|
-
export {};
|
|
15
2
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,CAAA"}
|
package/dist/dictionary.d.ts
CHANGED
package/dist/dictionary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa,sFAAiC,CAAA;AAE3D,wBAAgB,aAAa;;;;;;;;;;;;EAG5B"}
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,eAAO,MAAM,aAAa,sFAAiC,CAAA;AAE3D,wBAAgB,aAAa;;;;;;;;;;;;EAG5B"}
|
package/dist/dictionary.js
CHANGED
package/dist/dictionary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEpF,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,kDAAkD;QACnE,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,4DAA4D;QAC7E,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;KACnB;CACmB,CAAA;AAEtB,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;AAE3D,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC"}
|
|
1
|
+
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAEpF,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,KAAK,EAAE,OAAO;QACd,eAAe,EAAE,kDAAkD;QACnE,OAAO,EAAE,SAAS;QAClB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,QAAQ;KACjB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,QAAQ;QACf,eAAe,EAAE,4DAA4D;QAC7E,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,UAAU;KACnB;CACmB,CAAA;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;AAE3D,MAAM,UAAU,aAAa;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;AAC7B,CAAC"}
|
package/dist/elements.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ids of the layout elements.
|
|
3
|
+
*/
|
|
1
4
|
export declare const elementIds: {
|
|
2
5
|
readonly layout: "layout";
|
|
3
6
|
readonly backdrop: "backdrop";
|
|
@@ -14,5 +17,8 @@ export declare const elementIds: {
|
|
|
14
17
|
};
|
|
15
18
|
export type LayoutElement = keyof typeof elementIds;
|
|
16
19
|
export type LayoutElements = Record<LayoutElement, HTMLElement | null>;
|
|
20
|
+
/**
|
|
21
|
+
* @returns an object with the html elements of the layout.
|
|
22
|
+
*/
|
|
17
23
|
export declare function getLayoutElements(): LayoutElements;
|
|
18
24
|
//# sourceMappingURL=elements.d.ts.map
|
package/dist/elements.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC,CAAA;AAEtE,wBAAgB,iBAAiB,mBAKhC"}
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAab,CAAA;AAEV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAA;AACnD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC,CAAA;AAEtE;;GAEG;AACH,wBAAgB,iBAAiB,mBAKhC"}
|
package/dist/elements.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ids of the layout elements.
|
|
3
|
+
*/
|
|
1
4
|
export const elementIds = {
|
|
2
5
|
layout: 'layout',
|
|
3
6
|
backdrop: 'backdrop',
|
|
@@ -12,6 +15,9 @@ export const elementIds = {
|
|
|
12
15
|
menuSections: 'menuSections',
|
|
13
16
|
accessibilityAnnouncer: 'accessibilityAnnouncer',
|
|
14
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* @returns an object with the html elements of the layout.
|
|
20
|
+
*/
|
|
15
21
|
export function getLayoutElements() {
|
|
16
22
|
return Object.keys(elementIds).reduce((result, id) => ({ ...result, [id]: document.getElementById(id) }), {});
|
|
17
23
|
}
|
package/dist/elements.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,sBAAsB,EAAE,wBAAwB;CACxC,CAAA;AAKV,MAAM,UAAU,iBAAiB;IAC/B,OAAQ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAqB,CAAC,MAAM,CACxD,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAClE,EAAoB,CACrB,CAAA;AACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,sBAAsB,EAAE,wBAAwB;CACxC,CAAA;AAKV;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAQ,MAAM,CAAC,IAAI,CAAC,UAAU,CAAqB,CAAC,MAAM,CACxD,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAClE,EAAoB,CACrB,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,14 +4,11 @@ export { Dialog } from './components/Dialog.js';
|
|
|
4
4
|
export { Header, HeaderProps } from './components/Header.js';
|
|
5
5
|
export { OverlayContent } from './components/OverlayContent.js';
|
|
6
6
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
7
|
-
export { ListAction, SelectionList, SelectionListProps } from './components/SelectionList.js';
|
|
8
|
-
export { Toaster } from './components/Toaster.js';
|
|
9
7
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
10
8
|
export { MenuSections } from './components/menu/MenuSections.js';
|
|
11
9
|
export * from './components/menu/types.js';
|
|
12
10
|
export * from './components/types.js';
|
|
13
11
|
export * from './elements.js';
|
|
14
12
|
export * from './errors.js';
|
|
15
|
-
export { Logo as StackspotLogo } from './svg/Logo.js';
|
|
16
13
|
export * from './utils.js';
|
|
17
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -4,14 +4,11 @@ export { Dialog } from './components/Dialog.js';
|
|
|
4
4
|
export { Header } from './components/Header.js';
|
|
5
5
|
export { OverlayContent } from './components/OverlayContent.js';
|
|
6
6
|
export { PortalSwitcher } from './components/PortalSwitcher.js';
|
|
7
|
-
export { SelectionList } from './components/SelectionList.js';
|
|
8
|
-
export { Toaster } from './components/Toaster.js';
|
|
9
7
|
export { ActionItem, MenuContent, MenuGroup, Title } from './components/menu/MenuContent.js';
|
|
10
8
|
export { MenuSections } from './components/menu/MenuSections.js';
|
|
11
9
|
export * from './components/menu/types.js';
|
|
12
10
|
export * from './components/types.js';
|
|
13
11
|
export * from './elements.js';
|
|
14
12
|
export * from './errors.js';
|
|
15
|
-
export { Logo as StackspotLogo } from './svg/Logo.js';
|
|
16
13
|
export * from './utils.js';
|
|
17
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
|
package/dist/layout.css
CHANGED
|
@@ -245,6 +245,7 @@ body {
|
|
|
245
245
|
pointer-events: none;
|
|
246
246
|
z-index: 1;
|
|
247
247
|
transition: opacity 0.3s;
|
|
248
|
+
overflow-y: auto;
|
|
248
249
|
}
|
|
249
250
|
|
|
250
251
|
#menuContentOverlay.visible {
|
|
@@ -252,11 +253,6 @@ body {
|
|
|
252
253
|
pointer-events: auto;
|
|
253
254
|
}
|
|
254
255
|
|
|
255
|
-
#menuContentOverlay > div {
|
|
256
|
-
flex: 1;
|
|
257
|
-
overflow: auto;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
256
|
#menuContent {
|
|
261
257
|
width: var(--menu-content-width);
|
|
262
258
|
transition: left ease-out var(--menu-animation-duration);
|
package/dist/toaster.d.ts
CHANGED
|
@@ -1,23 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import 'react-toastify/dist/ReactToastify.css';
|
|
3
3
|
type ToastType = 'error' | 'success' | 'warning' | 'info';
|
|
4
|
-
interface
|
|
4
|
+
interface BaseOptions {
|
|
5
|
+
/**
|
|
6
|
+
* An identifier for the toaster, if not provided, `Math.random()` will be used.
|
|
7
|
+
*
|
|
8
|
+
* The id can be used to programmatically control the toaster.
|
|
9
|
+
*/
|
|
10
|
+
id?: number | string;
|
|
11
|
+
/**
|
|
12
|
+
* The message to show.
|
|
13
|
+
* Can be either a string or a React element.
|
|
14
|
+
*/
|
|
15
|
+
message: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Level/severity of this message.
|
|
18
|
+
* @default 'info'
|
|
19
|
+
*/
|
|
5
20
|
type?: ToastType;
|
|
6
21
|
/**
|
|
7
22
|
* Seconds until auto-close or false to not auto-close.
|
|
8
|
-
* @default
|
|
23
|
+
* @default 3s for success toast and 10s for the others
|
|
9
24
|
*/
|
|
10
25
|
autoClose?: number | false;
|
|
26
|
+
/**
|
|
27
|
+
* If true, `message` must be a React Element and none of the default toaster UI is rendered (title, icon and close button).
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
custom?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not to close the toaster when the user clicks it.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
closeOnClick?: boolean;
|
|
11
36
|
}
|
|
12
|
-
interface
|
|
13
|
-
|
|
37
|
+
interface ToasterAction {
|
|
38
|
+
/**
|
|
39
|
+
* The button's label.
|
|
40
|
+
*/
|
|
41
|
+
label: string;
|
|
42
|
+
/**
|
|
43
|
+
* A function to run once the button is clicked.
|
|
44
|
+
*/
|
|
45
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
46
|
+
/**
|
|
47
|
+
* If this is set, instead of a button, an anchor is rendered with this href.
|
|
48
|
+
*/
|
|
49
|
+
href?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Whether or not to close the toaster once the button is clicked.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
closeOnClick?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface DefaultToasterOptions extends BaseOptions {
|
|
57
|
+
/**
|
|
58
|
+
* The title of the toaster.
|
|
59
|
+
*/
|
|
14
60
|
title?: string;
|
|
61
|
+
/**
|
|
62
|
+
* A function to call when the user clicks the toaster. By default, it closes the toaster.
|
|
63
|
+
*/
|
|
15
64
|
onClick?: () => void;
|
|
65
|
+
/**
|
|
66
|
+
* A set of buttons (or links/anchors) to show after the message.
|
|
67
|
+
*/
|
|
68
|
+
actions?: ToasterAction[];
|
|
69
|
+
custom?: false;
|
|
16
70
|
}
|
|
17
|
-
interface
|
|
18
|
-
|
|
71
|
+
export interface CustomToasterOptions extends BaseOptions {
|
|
72
|
+
/**
|
|
73
|
+
* The whole content to render inside the toaster.
|
|
74
|
+
*/
|
|
75
|
+
message: React.ReactElement;
|
|
76
|
+
custom: true;
|
|
77
|
+
/**
|
|
78
|
+
* A close button to render on the top right corner of the toaster. If not provided, a close button won't be rendered.
|
|
79
|
+
*/
|
|
80
|
+
closeButton?: React.ReactElement;
|
|
19
81
|
}
|
|
20
|
-
type
|
|
21
|
-
export declare function showToaster(
|
|
82
|
+
export type ToasterOptions = DefaultToasterOptions | CustomToasterOptions | React.ReactNode;
|
|
83
|
+
export declare function showToaster(defaultToasterConfig: DefaultToasterOptions): number | string;
|
|
84
|
+
export declare function showToaster(customToasterConfig: CustomToasterOptions): number | string;
|
|
85
|
+
export declare function showToaster(message: React.ReactNode): number | string;
|
|
86
|
+
export declare function closeReactToaster(id: number | string): void;
|
|
22
87
|
export {};
|
|
23
88
|
//# sourceMappingURL=toaster.d.ts.map
|
package/dist/toaster.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,uCAAuC,CAAA;AAE9C,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAEzD,UAAU,WAAW;IACnB;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,aAAa;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,MAAM,EAAE,IAAI,CAAC;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAClC;AAED,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAAA;AAyB3F,wBAAgB,WAAW,CAAC,oBAAoB,EAAE,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AACzF,wBAAgB,WAAW,CAAC,mBAAmB,EAAE,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAA;AACvF,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAmEtE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,QAEpD"}
|
package/dist/toaster.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconBox } from '@citric/core';
|
|
2
|
+
import { Flex, IconBox, Text } from '@citric/core';
|
|
3
3
|
import { CheckCircleFill, ExclamationCircleFill, ExclamationTriangleFill, InfoCircleFill } from '@citric/icons';
|
|
4
4
|
import { toast } from 'react-toastify';
|
|
5
5
|
import 'react-toastify/dist/ReactToastify.css';
|
|
@@ -25,22 +25,48 @@ const toasterConfig = {
|
|
|
25
25
|
duration: 10,
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
|
-
export function showToaster(
|
|
28
|
+
export function showToaster(options) {
|
|
29
|
+
const isToasterConfig = options && typeof options === 'object' && 'message' in options;
|
|
30
|
+
const { type = 'info', autoClose, ...opts } = isToasterConfig
|
|
31
|
+
? options
|
|
32
|
+
: { message: options };
|
|
29
33
|
const config = toasterConfig[type];
|
|
34
|
+
const id = opts.id ?? Math.random();
|
|
30
35
|
const closeTime = autoClose ? autoClose : config.duration;
|
|
31
36
|
const bg = `var(--${config.color}-500)`;
|
|
32
37
|
const bgDark = `var(--${config.color}-600)`;
|
|
33
38
|
const fg = `var(--${config.color}-contrastText)`;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
:
|
|
39
|
+
const actionStyle = {
|
|
40
|
+
background: 'transparent',
|
|
41
|
+
border: 'none',
|
|
42
|
+
padding: 0,
|
|
43
|
+
color: 'inherit',
|
|
44
|
+
font: 'inherit',
|
|
45
|
+
fontWeight: 500,
|
|
46
|
+
cursor: 'pointer',
|
|
47
|
+
};
|
|
48
|
+
const buttons = opts.custom ? null : opts.actions?.map(({ label, href, onClick, closeOnClick = true }) => (_jsx(Text, { as: href ? 'a' : 'button', href: href, style: actionStyle, onClick: (event) => {
|
|
49
|
+
onClick?.(event);
|
|
50
|
+
if (closeOnClick)
|
|
51
|
+
closeReactToaster(id);
|
|
52
|
+
}, children: label }, label)));
|
|
53
|
+
toast(opts.custom
|
|
54
|
+
? opts.message
|
|
55
|
+
: (_jsxs("div", { onClick: opts.onClick, children: [_jsx("h1", { style: { textTransform: 'capitalize' }, children: opts.title ?? type }), typeof opts.message === 'string' ? _jsx("p", { children: opts.message }) : opts.message, buttons?.length ? _jsx(Flex, { style: { gap: '12px', marginTop: '12px' }, children: buttons }) : null] })), {
|
|
56
|
+
toastId: id,
|
|
37
57
|
type,
|
|
38
58
|
autoClose: autoClose === false ? false : closeTime * 1000,
|
|
39
59
|
className: 'main-toaster',
|
|
40
60
|
style: { backgroundColor: bg, color: fg },
|
|
41
61
|
progressStyle: { background: bgDark },
|
|
42
62
|
bodyClassName: 'toast-body',
|
|
43
|
-
icon:
|
|
63
|
+
icon: opts.custom ? false : () => (_jsx(IconBox, { colorIcon: `${config.color}.contrastText`, size: "xs", children: config.element })),
|
|
64
|
+
closeOnClick: opts.closeOnClick ?? false,
|
|
65
|
+
closeButton: opts.custom ? (opts.closeButton ?? false) : undefined,
|
|
44
66
|
});
|
|
67
|
+
return id;
|
|
68
|
+
}
|
|
69
|
+
export function closeReactToaster(id) {
|
|
70
|
+
toast.dismiss(id);
|
|
45
71
|
}
|
|
46
72
|
//# sourceMappingURL=toaster.js.map
|
package/dist/toaster.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAiC,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../src/toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAiC,IAAI,EAAE,MAAM,cAAc,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE/G,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,uCAAuC,CAAA;AAwF9C,MAAM,aAAa,GAAwF;IACzG,KAAK,EAAE;QACL,OAAO,EAAE,KAAC,qBAAqB,KAAG;QAClC,KAAK,EAAE,QAAQ;QACf,QAAQ,EAAE,EAAE;KACb;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAC,eAAe,KAAG;QAC5B,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,CAAC;KACZ;IACD,OAAO,EAAE;QACP,OAAO,EAAE,KAAC,uBAAuB,KAAG;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