@stack-spot/portal-layout 0.0.65 → 1.0.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.
- package/dist/Layout.d.ts +58 -6
- package/dist/Layout.d.ts.map +1 -1
- package/dist/Layout.js +14 -7
- 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 +36 -0
- package/dist/components/Toaster.d.ts.map +1 -1
- package/dist/components/Toaster.js +31 -3
- 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 -2
- 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 +55 -8
- package/dist/toaster.d.ts.map +1 -1
- package/dist/toaster.js +34 -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 +16 -15
- package/readme.md +146 -0
- package/src/Layout.tsx +79 -30
- 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 +81 -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 +90 -13
- 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/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/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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutOverlayManager.js","sourceRoot":"","sources":["../src/LayoutOverlayManager.tsx"],"names":[],"mappings":";AAAA,+CAA+C;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAgB,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAiB,MAAM,qBAAqB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAuB,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,EAAkB,UAAU,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"LayoutOverlayManager.js","sourceRoot":"","sources":["../src/LayoutOverlayManager.tsx"],"names":[],"mappings":";AAAA,+CAA+C;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,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,CAAC,OAAoB;QAChC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAClD,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,OAAoB;QACrC,OAAO,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACvD,CAAC;IAmDD,WAAW,CAAC,OAAY;QACtB,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAClC,CAAC;CAOF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,35 +1,78 @@
|
|
|
1
1
|
import { ColorSchemeName } from '@stack-spot/portal-theme';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
interface Validation {
|
|
4
|
+
/**
|
|
5
|
+
* The expected value of the field.
|
|
6
|
+
*/
|
|
4
7
|
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* A custom label for the input field.
|
|
10
|
+
*/
|
|
5
11
|
label?: string | ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* A placeholder for the input field.
|
|
14
|
+
*/
|
|
6
15
|
placeholder?: string;
|
|
7
16
|
}
|
|
8
17
|
export interface DialogOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The dialog's title.
|
|
20
|
+
*/
|
|
9
21
|
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* The dialog's subtitle.
|
|
24
|
+
*/
|
|
10
25
|
subtitle?: string;
|
|
11
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The dialog's content.
|
|
28
|
+
*/
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* A text for the confirm button. If left blank, the confirm button won't render.
|
|
32
|
+
*/
|
|
12
33
|
confirm?: string;
|
|
34
|
+
/**
|
|
35
|
+
* A text for the cancel button. If left blank, the cancel button won't render.
|
|
36
|
+
*/
|
|
13
37
|
cancel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* A validation input field. If the validation is incorrect, the confirm button is disabled.
|
|
40
|
+
* If this is a string, the validation input's value must be equal to this string in order to enable the confirm button.
|
|
41
|
+
* If this is an object, a value, label and placeholder may be specified.
|
|
42
|
+
* Use false or undefined to not include a validation field.
|
|
43
|
+
*/
|
|
14
44
|
validation?: false | string | Validation;
|
|
15
45
|
/**
|
|
46
|
+
* If this is a modal or a rightPanel.
|
|
16
47
|
* @default modal
|
|
17
48
|
*/
|
|
18
49
|
type?: 'modal' | 'panel';
|
|
19
50
|
/**
|
|
20
|
-
*
|
|
51
|
+
* The placement for the confirm/cancel buttons.
|
|
52
|
+
* @default "left" if type is "panel", "right" otherwise.
|
|
21
53
|
*/
|
|
22
54
|
buttonPlacement?: 'left' | 'center' | 'right';
|
|
23
55
|
/**
|
|
24
56
|
* The color of the primary button.
|
|
25
|
-
* @default primary
|
|
57
|
+
* @default "primary"
|
|
26
58
|
*/
|
|
27
59
|
buttonColor?: ColorSchemeName;
|
|
28
60
|
}
|
|
29
|
-
interface Props extends DialogOptions {
|
|
61
|
+
interface Props extends Omit<DialogOptions, 'message'> {
|
|
62
|
+
/**
|
|
63
|
+
* Function to run when the confirm button is clicked.
|
|
64
|
+
*/
|
|
30
65
|
onConfirm: () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Function to run when the cancel button is clicked.
|
|
68
|
+
*/
|
|
31
69
|
onCancel: () => void;
|
|
32
70
|
}
|
|
33
|
-
|
|
71
|
+
/**
|
|
72
|
+
* A dialog, i.e. A UI with title, subtitle, close button, content and a set of buttons: cancel and confirm. May be placed under a Modal or
|
|
73
|
+
* RightPanel.
|
|
74
|
+
* @param props the React props of the component {@link Props}.
|
|
75
|
+
*/
|
|
76
|
+
export declare const Dialog: ({ children, title, subtitle, cancel, confirm, validation, onConfirm, onCancel, type, buttonPlacement, buttonColor, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
34
77
|
export {};
|
|
35
78
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAI3C,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,EAAE,SAAS,EAAY,MAAM,OAAO,CAAA;AAI3C,UAAU,UAAU;IAClB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,UAAU,CAAC;IACzC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC9C;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,UAAU,KAAM,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpD;;OAEG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAQD;;;;GAIG;AACH,eAAO,MAAM,MAAM,yHAYhB,KAAK,4CAsCP,CAAA"}
|
|
@@ -9,7 +9,12 @@ const justifyButtons = {
|
|
|
9
9
|
left: 'start',
|
|
10
10
|
right: 'end',
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* A dialog, i.e. A UI with title, subtitle, close button, content and a set of buttons: cancel and confirm. May be placed under a Modal or
|
|
14
|
+
* RightPanel.
|
|
15
|
+
* @param props the React props of the component {@link Props}.
|
|
16
|
+
*/
|
|
17
|
+
export const Dialog = ({ children, title, subtitle, cancel, confirm, validation, onConfirm, onCancel, type = 'modal', buttonPlacement = type === 'panel' ? 'left' : 'right', buttonColor = 'primary', }) => {
|
|
13
18
|
const t = useDictionary();
|
|
14
19
|
const [enabled, setEnabled] = useState(!validation);
|
|
15
20
|
function renderValidation() {
|
|
@@ -22,6 +27,6 @@ export const Dialog = ({ message, title, subtitle, cancel, confirm, validation,
|
|
|
22
27
|
const placeholder = typeof validation === 'object' ? validation.placeholder : undefined;
|
|
23
28
|
return (_jsxs("div", { style: { margin: '24px 0 16px' }, children: [_jsx(Label, { htmlFor: "input-validation", children: label }), _jsx(Input, { id: "input-validation", placeholder: placeholder, onChange: e => setEnabled(e.target.value === value), style: { marginTop: '10px' } })] }));
|
|
24
29
|
}
|
|
25
|
-
return (_jsxs(OverlayContent, { title: title, subtitle: subtitle, onClose: onCancel, type: type, children: [_jsxs(Flex, { flexDirection: "column", flex: 1, children: [
|
|
30
|
+
return (_jsxs(OverlayContent, { title: title, subtitle: subtitle, onClose: onCancel, type: type, children: [_jsxs(Flex, { flexDirection: "column", flex: 1, children: [children, renderValidation()] }), (cancel || confirm) && _jsxs(Flex, { gap: true, justifyContent: justifyButtons[buttonPlacement], alignItems: "center", sx: { mt: 6 }, children: [cancel && _jsx(Button, { appearance: "outlined", colorScheme: "inverse", onClick: onCancel, children: cancel }), confirm && _jsx(Button, { colorScheme: buttonColor, onClick: onConfirm, disabled: !enabled, children: confirm })] })] }));
|
|
26
31
|
};
|
|
27
32
|
//# sourceMappingURL=Dialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAyEjD,MAAM,cAAc,GAA8F;IAChH,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,KAAK;CACb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AAE,SAAS,EAAE,MAAM,EAAE,GAAI,IAC9B,CACP,CAAA;IACH,CAAC;IAED,OAAO,CACL,MAAC,cAAc,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,aAC7E,MAAC,IAAI,IAAC,aAAa,EAAC,QAAQ,EAAC,IAAI,EAAE,CAAC,aACjC,QAAQ,EACR,gBAAgB,EAAE,IACd,EACN,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,MAAC,IAAI,IAAC,GAAG,QAAC,cAAc,EAAE,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,aACjH,MAAM,IAAI,KAAC,MAAM,IAAC,UAAU,EAAC,UAAU,EAAC,WAAW,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,YAAG,MAAM,GAAU,EAClG,OAAO,IAAI,KAAC,MAAM,IAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,OAAO,YACjF,OAAO,GACD,IACJ,IACQ,CAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
+
import { SelectionListProps } from '@stack-spot/portal-components/SelectionList';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { PortalSwitcherProps } from './PortalSwitcher.js';
|
|
3
|
-
import { SelectionListProps } from './SelectionList.js';
|
|
4
4
|
export interface HeaderProps {
|
|
5
|
+
/**
|
|
6
|
+
* The logo to show in the header, if the portal switch feature is disabled.
|
|
7
|
+
*/
|
|
5
8
|
logo?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The url the logo links to, if the portal switch feature is disabled.
|
|
11
|
+
*/
|
|
6
12
|
logoHref?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The username to show in the user menu.
|
|
15
|
+
*/
|
|
7
16
|
userName?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The email to show in the user menu.
|
|
19
|
+
*/
|
|
8
20
|
email?: string;
|
|
21
|
+
/**
|
|
22
|
+
* A portal switch config. If not specified, disables the portal switch feature.
|
|
23
|
+
*/
|
|
9
24
|
portalSwitch?: PortalSwitcherProps['portals'];
|
|
25
|
+
/**
|
|
26
|
+
* The options to show in the user menu.
|
|
27
|
+
*/
|
|
10
28
|
options?: SelectionListProps['items'];
|
|
29
|
+
/**
|
|
30
|
+
* A custom React Node to show at the center of the header. This is a good place for a search field, for instance.
|
|
31
|
+
*/
|
|
11
32
|
center?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* A custom React Node to show at the right (end) of the header.
|
|
35
|
+
*/
|
|
12
36
|
right?: ReactNode;
|
|
13
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The page header.
|
|
40
|
+
* @param props the React props for the header {@link HeaderProps}.
|
|
41
|
+
*/
|
|
14
42
|
export declare const Header: ({ logo, logoHref, center, right, userName, email, options, portalSwitch }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
43
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAGtE,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC9C;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,8EAA+E,WAAW,4CAc5G,CAAA"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flex } from '@citric/core';
|
|
3
|
-
import { useAnchorTag } from '
|
|
4
|
-
import { Logo } from '
|
|
3
|
+
import { useAnchorTag } from '@stack-spot/portal-components/anchor';
|
|
4
|
+
import { Logo } from '@stack-spot/portal-components/svg';
|
|
5
5
|
import { PortalSwitcher } from './PortalSwitcher.js';
|
|
6
6
|
import { UserMenu } from './UserMenu.js';
|
|
7
|
+
/**
|
|
8
|
+
* The page header.
|
|
9
|
+
* @param props the React props for the header {@link HeaderProps}.
|
|
10
|
+
*/
|
|
7
11
|
export const Header = ({ logo, logoHref, center, right, userName, email, options, portalSwitch }) => {
|
|
8
12
|
const Link = useAnchorTag();
|
|
9
13
|
return (_jsxs(_Fragment, { children: [portalSwitch ?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAA;AAExD,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAqCrC;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAe,EAAE,EAAE;IAC/G,MAAM,IAAI,GAAG,YAAY,EAAE,CAAA;IAE3B,OAAO,CACL,8BACG,YAAY,CAAC,CAAC;gBACb,KAAC,cAAc,IAAC,OAAO,EAAE,YAAY,GAAI,CAAC,CAAC;gBAC3C,KAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,MAAM,YAAE,IAAI,IAAI,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAI,GAAQ,EAErF,KAAC,IAAI,IAAC,IAAI,EAAE,CAAC,YAAG,MAAM,GAAQ,EAC7B,KAAK,EACL,QAAQ,IAAI,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,IAC5E,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -2,15 +2,37 @@ import { WithStyle } from '@stack-spot/portal-theme';
|
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export declare const CLOSE_OVERLAY_ID = "close-overlay";
|
|
4
4
|
export interface OverlayContentProps extends WithStyle {
|
|
5
|
+
/**
|
|
6
|
+
* The title for the modal or right panel.
|
|
7
|
+
*/
|
|
5
8
|
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* The subtitle for the modal or right panel.
|
|
11
|
+
*/
|
|
6
12
|
subtitle?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The content for the modal or right panel.
|
|
15
|
+
*/
|
|
7
16
|
children: ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* A function to run when the close button is pressed.
|
|
19
|
+
*/
|
|
8
20
|
onClose?: () => void;
|
|
9
21
|
}
|
|
10
22
|
interface Props extends OverlayContentProps {
|
|
23
|
+
/**
|
|
24
|
+
* A function to run when the close button is pressed.
|
|
25
|
+
*/
|
|
11
26
|
onClose: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this is a modal or a right panel.
|
|
29
|
+
*/
|
|
12
30
|
type: 'modal' | 'panel';
|
|
13
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Renders a modal or right panel with title, subtitle, close button and content.
|
|
34
|
+
* @param props the React props for the component {@link Props}.
|
|
35
|
+
*/
|
|
14
36
|
export declare const OverlayContent: ({ children, title, subtitle, className, style, onClose, type }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
37
|
export {};
|
|
16
38
|
//# sourceMappingURL=OverlayContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContent.d.ts","sourceRoot":"","sources":["../../src/components/OverlayContent.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAsB,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,KAAM,SAAQ,mBAAmB;IACzC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;CACzB;AAuBD,eAAO,MAAM,cAAc,mEAAoE,KAAK,4CAcnG,CAAA"}
|
|
1
|
+
{"version":3,"file":"OverlayContent.d.ts","sourceRoot":"","sources":["../../src/components/OverlayContent.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAsB,MAAM,0BAA0B,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,UAAU,KAAM,SAAQ,mBAAmB;IACzC;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;CACzB;AAuBD;;;GAGG;AACH,eAAO,MAAM,cAAc,mEAAoE,KAAK,4CAcnG,CAAA"}
|
|
@@ -26,6 +26,10 @@ const ContentBox = styled.section `
|
|
|
26
26
|
margin-bottom: 1.25rem;
|
|
27
27
|
}
|
|
28
28
|
`;
|
|
29
|
+
/**
|
|
30
|
+
* Renders a modal or right panel with title, subtitle, close button and content.
|
|
31
|
+
* @param props the React props for the component {@link Props}.
|
|
32
|
+
*/
|
|
29
33
|
export const OverlayContent = ({ children, title, subtitle, className, style, onClose, type }) => {
|
|
30
34
|
const t = useDictionary();
|
|
31
35
|
return (_jsxs(ContentBox, { style: style, className: listToClass([className, type]), children: [_jsxs("header", { children: [_jsxs(Flex, { flexDirection: "column", flex: 1, children: [_jsx(Text, { as: "h2", appearance: type === 'modal' ? 'h3' : 'h4', children: title }), subtitle && _jsx(Text, { appearance: "body2", colorScheme: "light.700", children: subtitle })] }), _jsx(IconButton, { onClick: onClose, title: t.close, "aria-label": t.close, id: CLOSE_OVERLAY_ID, children: _jsx(TimesMini, {}) })] }), children] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayContent.js","sourceRoot":"","sources":["../../src/components/OverlayContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAa,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"OverlayContent.js","sourceRoot":"","sources":["../../src/components/OverlayContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAa,WAAW,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAA;AAgC/C,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAA;;;;sBAIX,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;CAe7C,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAS,EAAE,EAAE;IACtG,MAAM,CAAC,GAAG,aAAa,EAAE,CAAA;IACzB,OAAO,CACL,MAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,aACjE,6BACE,MAAC,IAAI,IAAC,aAAa,EAAC,QAAQ,EAAC,IAAI,EAAE,CAAC,aAClC,KAAC,IAAI,IAAC,EAAE,EAAC,IAAI,EAAC,UAAU,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,YAAG,KAAK,GAAQ,EACvE,QAAQ,IAAI,KAAC,IAAI,IAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,WAAW,YAAE,QAAQ,GAAQ,IAC1E,EACP,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,gBAAc,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,gBAAgB,YAAE,KAAC,SAAS,KAAG,GAAa,IAC5G,EACR,QAAQ,IACE,CACd,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { PortalAcronym } from './types.js';
|
|
2
2
|
export interface Portal {
|
|
3
|
+
/**
|
|
4
|
+
* A Stackspot Portal.
|
|
5
|
+
*/
|
|
3
6
|
acronym: PortalAcronym;
|
|
7
|
+
/**
|
|
8
|
+
* The URL to the Stackspot Portal.
|
|
9
|
+
*/
|
|
4
10
|
url: string;
|
|
5
11
|
}
|
|
6
12
|
export interface PortalSwitcherProps {
|
|
13
|
+
/**
|
|
14
|
+
* The Stackspot portals to show in the selector.
|
|
15
|
+
*/
|
|
7
16
|
portals?: Portal[];
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* A selector with different Stackspot portals.
|
|
20
|
+
* Each item contains a logo with a link to the portal.
|
|
21
|
+
* @param props the component Props {@link PortalSwitcherProps}.
|
|
22
|
+
*/
|
|
9
23
|
export declare const PortalSwitcher: ({ portals }: PortalSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
24
|
//# sourceMappingURL=PortalSwitcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PortalSwitcher.d.ts","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQvC,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AA0DD;;;;GAIG;AACH,eAAO,MAAM,cAAc,gBAAsB,mBAAmB,4CA8CnE,CAAA"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Flex, IconBox, Text } from '@citric/core';
|
|
3
3
|
import { ArrowRight, CheckCircleFill, Select } from '@citric/icons';
|
|
4
|
+
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
|
+
import { AI, EDP, HUB, Logo } from '@stack-spot/portal-components/svg';
|
|
4
6
|
import { theme } from '@stack-spot/portal-theme';
|
|
5
7
|
import { useTranslate } from '@stack-spot/portal-translate';
|
|
6
8
|
import { useState } from 'react';
|
|
7
9
|
import styled from 'styled-components';
|
|
8
|
-
import {
|
|
9
|
-
import { AI } from '../svg/AI.js';
|
|
10
|
-
import { EDP } from '../svg/EDP.js';
|
|
11
|
-
import { HUB } from '../svg/HUB.js';
|
|
12
|
-
import { Logo } from '../svg/Logo.js';
|
|
10
|
+
import { announce } from '../utils.js';
|
|
13
11
|
const Logos = {
|
|
14
12
|
'AI': _jsx(AI, {}),
|
|
15
13
|
'EDP': _jsx(EDP, {}),
|
|
@@ -70,6 +68,11 @@ const PortalSwitcherBox = styled(Flex) `
|
|
|
70
68
|
|
|
71
69
|
`;
|
|
72
70
|
const PORTAL_SWITCHER_ID = 'PortalSwitcher';
|
|
71
|
+
/**
|
|
72
|
+
* A selector with different Stackspot portals.
|
|
73
|
+
* Each item contains a logo with a link to the portal.
|
|
74
|
+
* @param props the component Props {@link PortalSwitcherProps}.
|
|
75
|
+
*/
|
|
73
76
|
export const PortalSwitcher = ({ portals = [] }) => {
|
|
74
77
|
const [visible, setVisible] = useState(false);
|
|
75
78
|
const t = useTranslate(translations);
|
|
@@ -102,7 +105,7 @@ const translations = {
|
|
|
102
105
|
pt: {
|
|
103
106
|
EDP: 'Soluções eficientes e seguras do código até a implantação em produção.',
|
|
104
107
|
AI: 'Acelere o desenvolvimento com sugestões eficientes e resultados de alta qualidade.',
|
|
105
|
-
HUB: 'Descubra AI Stacks,
|
|
108
|
+
HUB: 'Descubra AI Stacks, knowledge sources e quick commands, tudo em um hub simplificado.',
|
|
106
109
|
portalSwitcher: 'Seletor de portais',
|
|
107
110
|
selected: 'selecionado',
|
|
108
111
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortalSwitcher.js","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PortalSwitcher.js","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":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AAO,CAAC,EACtB,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAC,EAAE,EAAE,CAAC,EAAE,WAAW,EAAC,WAAW,YAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAQ,IAClF;qBACR;oBACD,MAAM,EAAE,OAAO;oBACf,IAAI,EAAE,MAAM,CAAC,GAAG;oBAChB,MAAM,EAAE,aAAa,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO;oBAChD,UAAU,EAAE,KAAC,eAAe,kBAAa,CAAC,CAAC,QAAQ,GAAI;oBACvD,SAAS,EAAE,MAAM,CAAC,OAAO,KAAK,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC,KAAC,UAAU,KAAG,CAAC,CAAC,CAAC,SAAS;iBAClF,CAAC,CAAC,EACH,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,OAAO,EACjB,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAI,IAClB,CAAA;AACvB,CAAC,CAAA;AAGD,MAAM,YAAY,GAAG;IACnB,EAAE,EAAE;QACF,GAAG,EAAE,oEAAoE;QACzE,EAAE,EAAE,sEAAsE;QAC1E,GAAG,EAAE,wFAAwF;QAC7F,cAAc,EAAE,iBAAiB;QACjC,QAAQ,EAAE,UAAU;KACrB;IACD,EAAE,EAAE;QACF,GAAG,EAAE,wEAAwE;QAC7E,EAAE,EAAE,oFAAoF;QACxF,GAAG,EAAE,sFAAsF;QAC3F,cAAc,EAAE,oBAAoB;QACpC,QAAQ,EAAE,aAAa;KACxB;CACF,CAAA"}
|
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import 'react-toastify/dist/ReactToastify.css';
|
|
3
|
+
export declare const TOASTER_CLOSE_BTN_CLASS = "btn-close";
|
|
4
|
+
/**
|
|
5
|
+
* Uses react-toastify to render a Toaster based on the Citric DS.
|
|
6
|
+
*/
|
|
2
7
|
export declare const Toaster: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export interface ToasterAction {
|
|
9
|
+
/**
|
|
10
|
+
* The button's label.
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* A function to run once the button is clicked.
|
|
15
|
+
*/
|
|
16
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
17
|
+
/**
|
|
18
|
+
* If this is set, instead of a button, an anchor is rendered with this href.
|
|
19
|
+
*/
|
|
20
|
+
href?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether or not to close the toaster once the button is clicked.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
closeOnClick?: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface ToasterContentProps {
|
|
28
|
+
id: number | string;
|
|
29
|
+
actions?: ToasterAction[];
|
|
30
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
31
|
+
title?: string;
|
|
32
|
+
message: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renders a toaster with the default layout for toasters.
|
|
36
|
+
*/
|
|
37
|
+
export declare const ToasterContent: ({ id, message, actions, onClick, title }: ToasterContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
3
39
|
//# sourceMappingURL=Toaster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../src/components/Toaster.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toaster.d.ts","sourceRoot":"","sources":["../../src/components/Toaster.tsx"],"names":[],"mappings":";AAOA,OAAO,uCAAuC,CAAA;AAK9C,eAAO,MAAM,uBAAuB,cAAc,CAAA;AAWlD;;GAEG;AACH,eAAO,MAAM,OAAO,+CAAqD,CAAA;AAEzE,MAAM,WAAW,aAAa;IAC5B;;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,UAAU,mBAAmB;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAYD;;GAEG;AACH,eAAO,MAAM,cAAc,6CAA8C,mBAAmB,4CAyB3F,CAAA"}
|
|
@@ -1,12 +1,40 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Flex, Text } from '@citric/core';
|
|
2
3
|
import { TimesMini } from '@citric/icons';
|
|
3
4
|
import { IconButton } from '@citric/ui';
|
|
4
|
-
import {
|
|
5
|
+
import { useAnchorTag } from '@stack-spot/portal-components/anchor';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { ToastContainer, toast } from 'react-toastify';
|
|
5
8
|
import 'react-toastify/dist/ReactToastify.css';
|
|
6
9
|
import { useDictionary } from '../dictionary.js';
|
|
10
|
+
export const TOASTER_CLOSE_BTN_CLASS = 'btn-close';
|
|
7
11
|
const CloseButton = ({ closeToast }) => {
|
|
8
12
|
const t = useDictionary();
|
|
9
|
-
return (_jsx(IconButton, {
|
|
13
|
+
return (_jsx(IconButton, { className: TOASTER_CLOSE_BTN_CLASS, onClick: closeToast, title: t.dismiss, children: _jsx(TimesMini, {}) }));
|
|
10
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Uses react-toastify to render a Toaster based on the Citric DS.
|
|
17
|
+
*/
|
|
11
18
|
export const Toaster = () => _jsx(ToastContainer, { closeButton: CloseButton });
|
|
19
|
+
const actionStyle = {
|
|
20
|
+
background: 'transparent',
|
|
21
|
+
border: 'none',
|
|
22
|
+
padding: 0,
|
|
23
|
+
color: 'inherit',
|
|
24
|
+
font: 'inherit',
|
|
25
|
+
fontWeight: 500,
|
|
26
|
+
cursor: 'pointer',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Renders a toaster with the default layout for toasters.
|
|
30
|
+
*/
|
|
31
|
+
export const ToasterContent = ({ id, message, actions, onClick, title }) => {
|
|
32
|
+
const Link = useAnchorTag();
|
|
33
|
+
const buttons = useMemo(() => actions?.map(({ label, href, onClick, closeOnClick = true }) => (_jsx(Text, { as: href ? Link : 'button', href: href, style: actionStyle, onClick: (event) => {
|
|
34
|
+
onClick?.(event);
|
|
35
|
+
if (closeOnClick)
|
|
36
|
+
toast.dismiss(id);
|
|
37
|
+
}, children: label }, label))), [actions]);
|
|
38
|
+
return (_jsxs("div", { onClick: onClick, children: [_jsx("h1", { style: { textTransform: 'capitalize' }, children: title }), typeof message === 'string' ? _jsx("p", { children: message }) : message, buttons?.length ? _jsx(Flex, { style: { gap: '12px', marginTop: '12px' }, children: buttons }) : null] }));
|
|
39
|
+
};
|
|
12
40
|
//# sourceMappingURL=Toaster.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../src/components/Toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../src/components/Toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,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,GAAG,IAAI,EAAE,EAAE,EAAE,CAAC,CACjD,KAAC,IAAI,IAEH,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,CAAC,KAAuB,EAAE,EAAE;YACnC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAA;YAChB,IAAI,YAAY;gBAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QACrC,CAAC,YAEA,KAAK,IATD,KAAK,CAUL,CACR,CACF,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IACb,OAAO,CACL,eAAK,OAAO,EAAE,OAAO,aACnB,aAAI,KAAK,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,YAAG,KAAK,GAAM,EACvD,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,sBAAI,OAAO,GAAK,CAAC,CAAC,CAAC,OAAO,EACxD,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAG,OAAO,GAAQ,CAAC,CAAC,CAAC,IAAI,IACvF,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { SelectionListProps } from '
|
|
1
|
+
import { SelectionListProps } from '@stack-spot/portal-components/SelectionList';
|
|
2
2
|
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* The user name.
|
|
5
|
+
*/
|
|
3
6
|
userName: string;
|
|
7
|
+
/**
|
|
8
|
+
* The user email.
|
|
9
|
+
*/
|
|
4
10
|
email?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The menu options.
|
|
13
|
+
*/
|
|
5
14
|
options?: SelectionListProps['items'];
|
|
6
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders the user menu.
|
|
18
|
+
* @param props the component's props {@link Props}.
|
|
19
|
+
*/
|
|
7
20
|
export declare const UserMenu: ({ userName, email, options }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
21
|
export {};
|
|
9
22
|
//# sourceMappingURL=UserMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAM/F,UAAU,KAAK;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CACvC;AAsDD;;;GAGG;AACH,eAAO,MAAM,QAAQ,iCAAkC,KAAK,4CAkC3D,CAAA"}
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Flex, IconBox, LinkBox, Text } from '@citric/core';
|
|
3
3
|
import { ChevronDown } from '@citric/icons';
|
|
4
4
|
import { Avatar } from '@citric/ui';
|
|
5
|
+
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
6
|
import { theme } from '@stack-spot/portal-theme';
|
|
6
7
|
import { interpolate, useTranslate } from '@stack-spot/portal-translate';
|
|
7
8
|
import { useState } from 'react';
|
|
8
9
|
import { styled } from 'styled-components';
|
|
9
|
-
import { SelectionList } from './SelectionList.js';
|
|
10
10
|
const USER_MENU_ID = 'userMenu';
|
|
11
11
|
const UserMenuBox = styled.div `
|
|
12
12
|
.user-menu-header {
|
|
@@ -50,6 +50,10 @@ const UserMenuBox = styled.div `
|
|
|
50
50
|
}
|
|
51
51
|
`;
|
|
52
52
|
const UserMenuHeader = ({ userName, email }) => (_jsxs("div", { className: "user-menu-header", children: [_jsx(Avatar, { size: "xs", children: userName }), _jsx(Text, { appearance: "body1", className: "username", children: userName }), email && _jsx(Text, { appearance: "microtext1", className: "email", colorScheme: "light.700", children: email })] }));
|
|
53
|
+
/**
|
|
54
|
+
* Renders the user menu.
|
|
55
|
+
* @param props the component's props {@link Props}.
|
|
56
|
+
*/
|
|
53
57
|
export const UserMenu = ({ userName, email, options }) => {
|
|
54
58
|
const t = useTranslate(dictionary);
|
|
55
59
|
const [visible, setVisible] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAc,WAAW,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/components/UserMenu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,aAAa,EAAsB,MAAM,6CAA6C,CAAA;AAC/F,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0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CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,mBACnB,YAAY,mBACZ,OAAO,gBACV,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,YAElD,MAAC,IAAI,IAAC,UAAU,EAAC,QAAQ,aACvB,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,gBAAa,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,YAAG,QAAQ,GAAU,EACzF,KAAC,OAAO,IAAC,SAAS,EAAC,aAAa,EAAC,SAAS,EAAC,SAAS,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,SAAS,YAC/G,KAAC,WAAW,KAAG,GACP,IACL,GACC,EAET,OAAO,EAAE,MAAM;gBACd,CAAC,CAAC,KAAC,aAAa,IACd,EAAE,EAAE,YAAY,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,KAAC,cAAc,IAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAI,EAC5D,KAAK,EAAE,OAAQ,EACf,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAC/B,SAAS,EAAC,OAAO,GACjB;gBACF,CAAC,CAAC,IAAI,IAEI,CACf,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,WAAW,EAAE,oBAAoB;KAClC;IACD,EAAE,EAAE;QACF,WAAW,EAAE,mBAAmB;KACjC;CACmB,CAAA"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import { ErrorDescription } from '@stack-spot/portal-components/ErrorFeedback';
|
|
1
2
|
import { Component } from 'react';
|
|
2
|
-
import { ErrorDescription } from './ErrorManager.js';
|
|
3
3
|
interface State extends ErrorDescription {
|
|
4
4
|
hasError: boolean;
|
|
5
5
|
}
|
|
6
6
|
interface Props {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* An Error Boundary that renders an ErrorFeedback instead of its content if any of its children throws.
|
|
11
|
+
*
|
|
12
|
+
* To customize what properties are passed to the ErrorFeedback component, setup an error descriptor for the ErrorManager class. If you're
|
|
13
|
+
* using the component `Layout` or `RawLayout`, you can use the property `errorDescriptor`.
|
|
14
|
+
*
|
|
15
|
+
* To run an error handler every time an error is catch by this boundary, setup an error handler for the ErrorManager class. If you're
|
|
16
|
+
* using the component `Layout` or `RawLayout`, you can use the property `onError`.
|
|
17
|
+
*/
|
|
9
18
|
export declare class ErrorBoundary extends Component<Props, State> {
|
|
10
19
|
constructor(props: Props);
|
|
11
20
|
static getDerivedStateFromError(error: any): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,6CAA6C,CAAA;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGjC,UAAU,KAAM,SAAQ,gBAAgB;IACtC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG;;;;;;IAI1C,iBAAiB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG;IAM5C,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC;IAI7C,MAAM;CAKP"}
|