@stack-spot/portal-layout 1.1.1 → 2.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/CHANGELOG.md +22 -0
- package/dist/Layout.d.ts +2 -11
- package/dist/Layout.d.ts.map +1 -1
- package/dist/Layout.js +6 -13
- package/dist/Layout.js.map +1 -1
- package/dist/WelcomeTour.d.ts +2 -0
- package/dist/WelcomeTour.d.ts.map +1 -0
- package/dist/WelcomeTour.js +8 -0
- package/dist/WelcomeTour.js.map +1 -0
- package/dist/components/PortalSwitcher.d.ts +6 -0
- package/dist/components/PortalSwitcher.d.ts.map +1 -1
- package/dist/components/PortalSwitcher.js +34 -2
- package/dist/components/PortalSwitcher.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 +1 -1
- package/dist/components/error/ErrorBoundary.js.map +1 -1
- package/dist/components/error/ErrorManager.d.ts +1 -1
- package/dist/components/error/ErrorManager.d.ts.map +1 -1
- package/dist/components/error/SilentErrorBoundary.d.ts +10 -1
- package/dist/components/error/SilentErrorBoundary.d.ts.map +1 -1
- package/dist/components/menu/MenuSections.d.ts.map +1 -1
- package/dist/components/menu/MenuSections.js +2 -2
- package/dist/components/menu/MenuSections.js.map +1 -1
- package/dist/components/tour/StepContainer.d.ts +29 -0
- package/dist/components/tour/StepContainer.d.ts.map +1 -0
- package/dist/components/tour/StepContainer.js +52 -0
- package/dist/components/tour/StepContainer.js.map +1 -0
- package/dist/components/tour/StepNavigation.d.ts +29 -0
- package/dist/components/tour/StepNavigation.d.ts.map +1 -0
- package/dist/components/tour/StepNavigation.js +36 -0
- package/dist/components/tour/StepNavigation.js.map +1 -0
- package/dist/components/tour/StepTitle.d.ts +17 -0
- package/dist/components/tour/StepTitle.d.ts.map +1 -0
- package/dist/components/tour/StepTitle.js +9 -0
- package/dist/components/tour/StepTitle.js.map +1 -0
- package/dist/components/tour/hook.d.ts +3 -0
- package/dist/components/tour/hook.d.ts.map +1 -0
- package/dist/components/tour/hook.js +10 -0
- package/dist/components/tour/hook.js.map +1 -0
- package/dist/components/tour/index.d.ts +5 -0
- package/dist/components/tour/index.d.ts.map +1 -0
- package/dist/components/tour/index.js +5 -0
- package/dist/components/tour/index.js.map +1 -0
- package/dist/components/tour/manager.d.ts +32 -0
- package/dist/components/tour/manager.d.ts.map +1 -0
- package/dist/components/tour/manager.js +98 -0
- package/dist/components/tour/manager.js.map +1 -0
- package/dist/components/tour/utils.d.ts +50 -0
- package/dist/components/tour/utils.d.ts.map +1 -0
- package/dist/components/tour/utils.js +60 -0
- package/dist/components/tour/utils.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layout.css +0 -1
- package/package.json +7 -4
- package/readme.md +1 -0
- package/src/Layout.tsx +23 -41
- package/src/WelcomeTour.tsx +8 -0
- package/src/components/PortalSwitcher.tsx +42 -1
- package/src/components/error/ErrorBoundary.tsx +1 -1
- package/src/components/error/ErrorManager.ts +1 -1
- package/src/components/error/SilentErrorBoundary.tsx +1 -1
- package/src/components/menu/MenuSections.tsx +3 -4
- package/src/components/tour/StepContainer.tsx +83 -0
- package/src/components/tour/StepNavigation.tsx +70 -0
- package/src/components/tour/StepTitle.tsx +27 -0
- package/src/components/tour/hook.ts +12 -0
- package/src/components/tour/index.ts +6 -0
- package/src/components/tour/manager.tsx +111 -0
- package/src/components/tour/utils.tsx +100 -0
- package/src/index.ts +1 -0
- package/src/layout.css +0 -1
- package/dist/components/tour/PortalSwitcherStep.d.ts +0 -8
- package/dist/components/tour/PortalSwitcherStep.d.ts.map +0 -1
- package/dist/components/tour/PortalSwitcherStep.js +0 -34
- package/dist/components/tour/PortalSwitcherStep.js.map +0 -1
- package/src/components/tour/PortalSwitcherStep.tsx +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.0.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v1.1.2...portal-layout@v2.0.0) (2024-06-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **portal-components:** removed Tour related componets
|
|
9
|
+
* **portal-layout:** Adds a new reworked Tour structure compatible with module federation
|
|
10
|
+
* new Tour strategy
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* new Tour strategy ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
15
|
+
* **portal-components:** removed Tour related componets ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
16
|
+
* **portal-layout:** Adds a new reworked Tour structure compatible with module federation ([d6daf23](https://github.com/stack-spot/portal-commons/commit/d6daf238f9956e2c913a36773db9b34080fd17a5))
|
|
17
|
+
|
|
18
|
+
## [1.1.2](https://github.com/stack-spot/portal-commons/compare/portal-layout@v1.1.1...portal-layout@v1.1.2) (2024-06-26)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* accessibility adjustments in layout ([4ed784a](https://github.com/stack-spot/portal-commons/commit/4ed784a26edf3cb8369b3fd5b988570cf2873b3b))
|
|
24
|
+
|
|
3
25
|
## [1.1.1](https://github.com/stack-spot/portal-commons/compare/portal-components@v1.3.0...portal-components@v1.3.1) (2024-06-20)
|
|
4
26
|
|
|
5
27
|
### Bug Fixes
|
package/dist/Layout.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TourProps } from '@stack-spot/portal-components/Tour';
|
|
2
1
|
import { WithStyle } from '@stack-spot/portal-theme';
|
|
3
2
|
import '@stack-spot/portal-theme/dist/theme.css';
|
|
4
3
|
import { ReactElement, ReactNode } from 'react';
|
|
@@ -31,10 +30,6 @@ interface Props extends WithStyle {
|
|
|
31
30
|
* A function to run whenever an error is catch by an error boundary.
|
|
32
31
|
*/
|
|
33
32
|
onError?: ErrorHandler;
|
|
34
|
-
/**
|
|
35
|
-
* The options for the React Tour's tutorial.
|
|
36
|
-
*/
|
|
37
|
-
tourProps?: TourProps;
|
|
38
33
|
}
|
|
39
34
|
interface RawProps extends WithStyle {
|
|
40
35
|
/**
|
|
@@ -65,20 +60,16 @@ interface RawProps extends WithStyle {
|
|
|
65
60
|
* A function to run whenever an error is catch by an error boundary.
|
|
66
61
|
*/
|
|
67
62
|
onError?: ErrorHandler;
|
|
68
|
-
/**
|
|
69
|
-
* The options for the React Tour's tutorial.
|
|
70
|
-
*/
|
|
71
|
-
tourProps?: TourProps;
|
|
72
63
|
}
|
|
73
64
|
/**
|
|
74
65
|
* Renders the layout with the React elements passed in the props.
|
|
75
66
|
* @param props the component's props {@link RawProps}.
|
|
76
67
|
*/
|
|
77
|
-
export declare const RawLayout: ({ menuSections, menuContent, header, children,
|
|
68
|
+
export declare const RawLayout: ({ menuSections, menuContent, header, children, extra, errorDescriptor, onError, className, style }: RawProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
69
|
/**
|
|
79
70
|
* Renders the layout with a menu and header that follow the config objects passed as parameter.
|
|
80
71
|
* @param props the component's props {@link Props}.
|
|
81
72
|
*/
|
|
82
|
-
export declare const Layout: ({ menu, header, children, extra, errorDescriptor, onError, className, style
|
|
73
|
+
export declare const Layout: ({ menu, header, children, extra, errorDescriptor, onError, className, style }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
83
74
|
export {};
|
|
84
75
|
//# sourceMappingURL=Layout.d.ts.map
|
package/dist/Layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":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CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TourProvider, defaultTourConfig, isNewTourStep } from '@stack-spot/portal-components/Tour';
|
|
3
2
|
import { CSSToCitricAdapter, listToClass } from '@stack-spot/portal-theme';
|
|
4
3
|
import '@stack-spot/portal-theme/dist/theme.css';
|
|
5
4
|
import { useEffect } from 'react';
|
|
6
5
|
import { overlay } from './LayoutOverlayManager.js';
|
|
6
|
+
import { WelcomeTour } from './WelcomeTour.js';
|
|
7
7
|
import { Header } from './components/Header.js';
|
|
8
8
|
import { Toaster } from './components/Toaster.js';
|
|
9
9
|
import { ErrorBoundary } from './components/error/ErrorBoundary.js';
|
|
@@ -11,38 +11,31 @@ import { ErrorManager } from './components/error/ErrorManager.js';
|
|
|
11
11
|
import { SilentErrorBoundary } from './components/error/SilentErrorBoundary.js';
|
|
12
12
|
import { MenuContent } from './components/menu/MenuContent.js';
|
|
13
13
|
import { MenuSections } from './components/menu/MenuSections.js';
|
|
14
|
-
import { usePortalSwitcherStep } from './components/tour/PortalSwitcherStep.js';
|
|
15
14
|
import { elementIds, getLayoutElements } from './elements.js';
|
|
16
15
|
import './layout.css';
|
|
17
16
|
/**
|
|
18
17
|
* Renders the layout with the React elements passed in the props.
|
|
19
18
|
* @param props the component's props {@link RawProps}.
|
|
20
19
|
*/
|
|
21
|
-
export const RawLayout = ({ menuSections, menuContent, header, children,
|
|
20
|
+
export const RawLayout = ({ menuSections, menuContent, header, children, extra, errorDescriptor, onError, className, style }) => {
|
|
22
21
|
// @ts-ignore
|
|
23
22
|
const { bottomDialog, modal, rightPanel } = overlay.useOverlays();
|
|
24
23
|
const { layout } = getLayoutElements();
|
|
25
24
|
const isCompactedOnlyIcons = layout?.classList.contains('menu-compact');
|
|
26
|
-
const portalSwitcherStep = usePortalSwitcherStep();
|
|
27
25
|
const classes = [
|
|
28
26
|
menuContent && !isCompactedOnlyIcons ? 'menu-content-visible' : undefined,
|
|
29
27
|
menuSections ? undefined : 'no-menu-sections',
|
|
30
28
|
className,
|
|
31
29
|
isCompactedOnlyIcons ? 'menu-compact' : undefined,
|
|
32
30
|
];
|
|
33
|
-
const tourPropsWithDefaults = { ...defaultTourConfig, ...(tourProps || {}) };
|
|
34
|
-
tourPropsWithDefaults.steps = [
|
|
35
|
-
portalSwitcherStep,
|
|
36
|
-
...tourPropsWithDefaults.steps,
|
|
37
|
-
].filter(isNewTourStep);
|
|
38
31
|
useEffect(() => {
|
|
39
32
|
if (errorDescriptor)
|
|
40
33
|
ErrorManager.setDescriptionFunction(errorDescriptor);
|
|
41
34
|
if (onError)
|
|
42
35
|
ErrorManager.setErrorHandler(onError);
|
|
43
36
|
}, []);
|
|
44
|
-
return (
|
|
45
|
-
_jsx("nav", { role: "
|
|
37
|
+
return (_jsxs(CSSToCitricAdapter, { children: [_jsx(WelcomeTour, {}), _jsxs("div", { id: elementIds.layout, className: listToClass(classes), style: style, children: [header && _jsx("header", { id: elementIds.header, children: _jsx(SilentErrorBoundary, { children: header }) }), extra && _jsx(SilentErrorBoundary, { children: extra }), _jsxs("aside", { id: elementIds.menu, children: [_jsx("nav", { role: "menubar", id: elementIds.menuContent, children: _jsx(SilentErrorBoundary, { children: menuContent }) }), menuSections &&
|
|
38
|
+
_jsx("nav", { role: "menubar", id: elementIds.menuSections, children: _jsx(SilentErrorBoundary, { children: menuSections }) })] }), children && _jsx("div", { id: elementIds.page, children: _jsx("article", { id: elementIds.content, children: _jsx(ErrorBoundary, { children: children }) }) }), _jsx("div", { id: elementIds.bottomDialog, role: "dialog", children: _jsx(ErrorBoundary, { children: bottomDialog }) }), _jsxs("div", { id: elementIds.backdrop, children: [_jsx("div", { id: elementIds.rightPanel, "aria-modal": true, role: "dialog", children: _jsx(ErrorBoundary, { children: rightPanel }) }), _jsx("div", { id: elementIds.modal, "aria-modal": true, role: "dialog", children: _jsx(ErrorBoundary, { children: modal }) })] }), _jsx(Toaster, {}), _jsx("div", { id: elementIds.accessibilityAnnouncer, "aria-atomic": true, "aria-live": "assertive" })] })] }));
|
|
46
39
|
};
|
|
47
40
|
const MenuContentRenderer = ({ content }) => {
|
|
48
41
|
const menuContent = typeof content === 'function' ? content() : content;
|
|
@@ -52,7 +45,7 @@ const MenuContentRenderer = ({ content }) => {
|
|
|
52
45
|
* Renders the layout with a menu and header that follow the config objects passed as parameter.
|
|
53
46
|
* @param props the component's props {@link Props}.
|
|
54
47
|
*/
|
|
55
|
-
export const Layout = ({ menu, header, children, extra, errorDescriptor, onError, className, style
|
|
48
|
+
export const Layout = ({ menu, header, children, extra, errorDescriptor, onError, className, style }) => (_jsx(RawLayout, { header: _jsx(Header, { ...header }), menuSections: menu.sections ? _jsx(MenuSections, { ...menu }) : undefined, menuContent: menu.content
|
|
56
49
|
? _jsx(MenuContentRenderer, { content: menu.content }, 'contentKey' in menu ? menu.contentKey : undefined)
|
|
57
|
-
: undefined, errorDescriptor: errorDescriptor, onError: onError, extra: extra, className: className, style: style,
|
|
50
|
+
: undefined, errorDescriptor: errorDescriptor, onError: onError, extra: extra, className: className, style: style, children: children }));
|
|
58
51
|
//# sourceMappingURL=Layout.js.map
|
package/dist/Layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../src/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAa,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACrF,OAAO,yCAAyC,CAAA;AAChD,OAAO,EAA2B,SAAS,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAe,MAAM,qBAAqB,CAAA;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+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { WelcomeTour as WelcomeTourComponent, useTour } from './components/tour/index.js';
|
|
3
|
+
export const WelcomeTour = () => {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
const { currentStep, addStep, finishStep, ...tourConfig } = useTour();
|
|
6
|
+
return _jsx(WelcomeTourComponent, { ...tourConfig });
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=WelcomeTour.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeTour.js","sourceRoot":"","sources":["../src/WelcomeTour.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,6DAA6D;IAC7D,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,EAAE,CAAA;IAErE,OAAO,KAAC,oBAAoB,OAAK,UAAU,GAAI,CAAA;AACjD,CAAC,CAAA"}
|
|
@@ -21,4 +21,10 @@ export interface PortalSwitcherProps {
|
|
|
21
21
|
* @param props the component Props {@link PortalSwitcherProps}.
|
|
22
22
|
*/
|
|
23
23
|
export declare const PortalSwitcher: ({ portals }: PortalSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
26
|
+
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
27
|
+
* @returns the React Tour step for the PortalSwitcher.
|
|
28
|
+
*/
|
|
29
|
+
export declare const usePortalSwitcherTourStep: () => void;
|
|
24
30
|
//# 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":"AAUA,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,4CA+CnE,CAAA;AAqBD;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,YAkBrC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Flex, IconBox, Text } from '@citric/core';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Button, Flex, IconBox, Image, Text } from '@citric/core';
|
|
3
3
|
import { ArrowRight, CheckCircleFill, Select } from '@citric/icons';
|
|
4
4
|
import { SelectionList } from '@stack-spot/portal-components/SelectionList';
|
|
5
5
|
import { AI, EDP, HUB, Logo } from '@stack-spot/portal-components/svg';
|
|
@@ -8,6 +8,7 @@ import { useTranslate } from '@stack-spot/portal-translate';
|
|
|
8
8
|
import { useState } from 'react';
|
|
9
9
|
import styled from 'styled-components';
|
|
10
10
|
import { announce } from '../utils.js';
|
|
11
|
+
import { useTour } from './tour/index.js';
|
|
11
12
|
const Logos = {
|
|
12
13
|
'AI': _jsx(AI, {}),
|
|
13
14
|
'EDP': _jsx(EDP, {}),
|
|
@@ -77,6 +78,7 @@ export const PortalSwitcher = ({ portals = [] }) => {
|
|
|
77
78
|
const [visible, setVisible] = useState(false);
|
|
78
79
|
const t = useTranslate(translations);
|
|
79
80
|
const currentPortal = portals?.find(portal => location.href.startsWith(portal.url));
|
|
81
|
+
usePortalSwitcherTourStep();
|
|
80
82
|
return _jsxs(PortalSwitcherBox, { children: [currentPortal ?
|
|
81
83
|
_jsx(Button, { className: "current-portal", appearance: "text", colorScheme: "light", "aria-controls": PORTAL_SWITCHER_ID, "aria-expanded": visible, "aria-label": `${t.portalSwitcher}: ${currentPortal?.acronym} ${t.selected}`, onClick: () => {
|
|
82
84
|
setVisible(true);
|
|
@@ -110,4 +112,34 @@ const translations = {
|
|
|
110
112
|
selected: 'selecionado',
|
|
111
113
|
},
|
|
112
114
|
};
|
|
115
|
+
/**
|
|
116
|
+
* Tutorial: a React hook for retrieving the React Tour step that explains how the portal switcher works. The portal switcher is a component
|
|
117
|
+
* at the top left corner of the layout (header) that allows the user to switch between the different Stackspot portals.
|
|
118
|
+
* @returns the React Tour step for the PortalSwitcher.
|
|
119
|
+
*/
|
|
120
|
+
export const usePortalSwitcherTourStep = () => {
|
|
121
|
+
const t = useTranslate(tourTranslations);
|
|
122
|
+
const { addStep } = useTour();
|
|
123
|
+
addStep({
|
|
124
|
+
selector: '.portal-switcher',
|
|
125
|
+
title: t.title,
|
|
126
|
+
content: _jsxs(_Fragment, { children: [_jsx(Image, { src: "https://marketing.stackspot.com/switch-v2.gif", alt: t.imageAlt }), _jsx(Box, { px: 5, py: 3, children: _jsx(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: t.description }) })] }),
|
|
127
|
+
position: 'right',
|
|
128
|
+
style: {
|
|
129
|
+
width: '300px',
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const tourTranslations = {
|
|
134
|
+
en: {
|
|
135
|
+
title: 'Expand Your Horizons with Stackspot',
|
|
136
|
+
description: 'Easily switch between EDP and AI to enhance your projects. Access a wide range of resources with just one click and take your projects to a new level of efficiency. Start your journey now!',
|
|
137
|
+
imageAlt: 'GIF describing how to use product switcher and navigate between AI and EDP portals',
|
|
138
|
+
},
|
|
139
|
+
pt: {
|
|
140
|
+
title: 'Expanda Seus Horizontes com Stackspot',
|
|
141
|
+
description: 'Troque facilmente entre EDP e AI para aprimorar seus projetos. Acesse uma ampla gama de recursos com apenas um clique e leve seus projetos para um novo nível de eficiência. Comece sua jornada agora!',
|
|
142
|
+
imageAlt: 'GIF mostrando como usar o alternador de produtos e navegar entre os portais AI e EDP',
|
|
143
|
+
},
|
|
144
|
+
};
|
|
113
145
|
//# sourceMappingURL=PortalSwitcher.js.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"PortalSwitcher.js","sourceRoot":"","sources":["../../src/components/PortalSwitcher.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAA;AAC3E,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAa,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,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AE,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,4 +1,4 @@
|
|
|
1
|
-
import { ErrorDescription } from '@stack-spot/portal-components/
|
|
1
|
+
import { ErrorDescription } from '@stack-spot/portal-components/error';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
interface State extends ErrorDescription {
|
|
4
4
|
hasError: boolean;
|
|
@@ -21,6 +21,15 @@ export declare class ErrorBoundary extends Component<Props, State> {
|
|
|
21
21
|
code?: number | undefined;
|
|
22
22
|
message?: string | undefined;
|
|
23
23
|
debug?: boolean | undefined;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
help?: string | undefined;
|
|
27
|
+
action?: {
|
|
28
|
+
label: string;
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
} | undefined;
|
|
31
|
+
body?: import("react").ReactNode;
|
|
32
|
+
image?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
24
33
|
hasError: boolean;
|
|
25
34
|
};
|
|
26
35
|
componentDidCatch(error: any, errorInfo: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAiB,MAAM,qCAAqC,CAAA;AACrF,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ErrorFeedback } from '@stack-spot/portal-components/
|
|
2
|
+
import { ErrorFeedback } from '@stack-spot/portal-components/error';
|
|
3
3
|
import { Component } from 'react';
|
|
4
4
|
import { ErrorManager } from './ErrorManager.js';
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/components/error/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoB,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAU7C;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAc,SAAQ,SAAuB;IACxD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;IAClC,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAU;QACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAA;IAC5D,CAAC;IAED,iBAAiB,CAAC,KAAU,EAAE,SAAc;QAC1C,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QAC/B,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;IACrC,CAAC;IAED,kBAAkB,CAAC,SAA0B;QAC3C,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;IACpF,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ;YACxB,CAAC,CAAC,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAI;YAChG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;IACzB,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorDescription } from '@stack-spot/portal-components/
|
|
1
|
+
import { ErrorDescription } from '@stack-spot/portal-components/error';
|
|
2
2
|
export type DescriptionFn = (error: any) => ErrorDescription;
|
|
3
3
|
export type ErrorHandler = (error: any) => void;
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorManager.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ErrorManager.d.ts","sourceRoot":"","sources":["../../../src/components/error/ErrorManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAEtE,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,gBAAgB,CAAA;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;AAE/C;;GAEG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAEhC;IACF,OAAO,CAAC,MAAM,CAAC,YAAY,CAA0B;IAErD;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,EAAE,EAAE,aAAa;IAI/C;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY;IAI5C;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG;IAI1B;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,GAAG;CAGlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorDescription } from '@stack-spot/portal-components/
|
|
1
|
+
import { ErrorDescription } from '@stack-spot/portal-components/error';
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
interface State extends ErrorDescription {
|
|
4
4
|
hasError: boolean;
|
|
@@ -22,6 +22,15 @@ export declare class SilentErrorBoundary extends Component<Props, State> {
|
|
|
22
22
|
code?: number | undefined;
|
|
23
23
|
message?: string | undefined;
|
|
24
24
|
debug?: boolean | undefined;
|
|
25
|
+
title?: string | undefined;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
help?: string | undefined;
|
|
28
|
+
action?: {
|
|
29
|
+
label: string;
|
|
30
|
+
onClick: () => void;
|
|
31
|
+
} | undefined;
|
|
32
|
+
body?: import("react").ReactNode;
|
|
33
|
+
image?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
25
34
|
hasError: boolean;
|
|
26
35
|
};
|
|
27
36
|
componentDidCatch(error: any, errorInfo: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/SilentErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"SilentErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/components/error/SilentErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAEtE,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;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAClD,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;CAoBP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSections.d.ts","sourceRoot":"","sources":["../../../src/components/menu/MenuSections.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAA;AAwChD;;GAEG;AACH,wBAAgB,sBAAsB,SAOrC;
|
|
1
|
+
{"version":3,"file":"MenuSections.d.ts","sourceRoot":"","sources":["../../../src/components/menu/MenuSections.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAe,MAAM,SAAS,CAAA;AAwChD;;GAEG;AACH,wBAAgB,sBAAsB,SAOrC;AA8ID;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,2BAAiC,SAAS,4CAqGlE,CAAA"}
|
|
@@ -117,7 +117,7 @@ const Section = ({ icon, label, href, target, onClick, active, content, customCo
|
|
|
117
117
|
hideOverlayImmediately();
|
|
118
118
|
}
|
|
119
119
|
const labelText = typeof label === 'string' ? label : label.id;
|
|
120
|
-
return (_jsxs("li", { role: "menuitem", title: labelText, className: `section-submenu ${className || ''} ${active ? 'active' : ''}`,
|
|
120
|
+
return (_jsxs("li", { role: "menuitem", title: labelText, className: `section-submenu ${className || ''} ${active ? 'active' : ''}`, children: [_jsx(Link, { href: href, target: target, onClick: click, onMouseEnter: prepareShowOverlay, onMouseLeave: () => shouldShowOverlay() && hideOverlay(), title: labelText, "aria-label": labelText, onKeyDown: onClick ? e => e.key === 'Enter' && onClick() : undefined, ...(active ? { 'aria-current': 'page' } : undefined), ...(!href ? { 'tabIndex': 0 } : undefined), children: _jsxs(Flex, { alignItems: "center", justifyContent: "center", px: 5, children: [_jsx(IconBox, { children: icon }), typeof label === 'string' ? _jsx(Text, { appearance: "microtext1", className: "section-label", ml: 3, children: label }) : label.element] }) }), shouldShowOverlay() &&
|
|
121
121
|
_jsx(IconBox, { size: "sm", className: "section-submenu-icon", as: "button", "aria-label": interpolate(t.menuOptions, label), "aria-controls": MENU_OVERLAY_ID, "aria-expanded": false, onKeyDown: (event) => {
|
|
122
122
|
if (event.key === 'Enter') {
|
|
123
123
|
prepareShowOverlay(event);
|
|
@@ -210,7 +210,7 @@ export const MenuSections = ({ sections = [], ...props }) => {
|
|
|
210
210
|
? _jsx(OverlayRenderer, { content: props.content, customContent: props.customContent }, 'contentKey' in props ? props.contentKey : undefined)
|
|
211
211
|
: _jsx(OverlayRenderer, { content: sections[currentOverlay].content, customContent: sections[currentOverlay].customContent }, currentOverlay);
|
|
212
212
|
}
|
|
213
|
-
return (_jsxs(_Fragment, { children: [_jsx("ul", { children: sectionItems }), _jsxs(Flex, { mb: 7, alignItems: "center", children: [_jsxs("button", { className: "toggle sections-footer", onClick: () => toggleMenu(!!props.content || !!props.customContent), title: t.toggle, tabIndex: -1, children: [_jsxs(IconBox, { children: [_jsx(Expand, { className: "expand" }), _jsx(Collapse, { className: "collapse" })] }), _jsx(Text, { appearance: "microtext1", ml: 8, className: "collapse", colorScheme: "light.contrastText", children: t.hide })] }), (props.settings?.show) &&
|
|
213
|
+
return (_jsxs(_Fragment, { children: [_jsx("ul", { role: "menu", children: sectionItems }), _jsxs(Flex, { mb: 7, alignItems: "center", children: [_jsxs("button", { role: "menuitem", className: "toggle sections-footer", onClick: () => toggleMenu(!!props.content || !!props.customContent), title: t.toggle, tabIndex: -1, children: [_jsxs(IconBox, { children: [_jsx(Expand, { className: "expand" }), _jsx(Collapse, { className: "collapse" })] }), _jsx(Text, { appearance: "microtext1", ml: 8, className: "collapse", colorScheme: "light.contrastText", children: t.hide })] }), (props.settings?.show) &&
|
|
214
214
|
_jsxs(Link, { href: props.settings?.href, onClick: props.settings?.onClick, className: "sections-footer toggle", ...(props.settings.active ? { 'aria-current': 'page' } : undefined), children: [_jsx(IconBox, { "aria-label": t.settingsIcon, children: _jsx(Cog, {}) }), _jsx(Text, { appearance: "microtext1", ml: 8, className: "collapse", children: t.settings })] })] }), _jsx("div", { id: MENU_OVERLAY_ID, onMouseEnter: showOverlay, onMouseLeave: hideOverlay, ref: overlayRef, children: renderMenuOverlay() })] }));
|
|
215
215
|
};
|
|
216
216
|
const dictionary = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuSections.js","sourceRoot":"","sources":["../../../src/components/menu/MenuSections.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,C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,EACV,KAAC,IAAI,IAAC,UAAU,EAAC,YAAY,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,UAAU,YAAE,CAAC,CAAC,QAAQ,GAAQ,IACzE,IAEJ,EAEP,cAAK,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,YAC5F,iBAAiB,EAAE,GAChB,IACL,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,MAAM,EAAE,uBAAuB;QAC/B,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,UAAU;QACpB,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE,MAAM;KACb;IACD,EAAE,EAAE;QACF,MAAM,EAAE,+BAA+B;QACvC,WAAW,EAAE,8BAA8B;QAC3C,QAAQ,EAAE,eAAe;QACzB,YAAY,EAAE,wBAAwB;QACtC,IAAI,EAAE,UAAU;KACjB;CACmB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { NavigationProps } from './StepNavigation.js';
|
|
3
|
+
interface StepContainerProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier for the step.
|
|
7
|
+
*/
|
|
8
|
+
stepKey: string;
|
|
9
|
+
/**
|
|
10
|
+
* The title for the step.
|
|
11
|
+
*/
|
|
12
|
+
title: string;
|
|
13
|
+
/**
|
|
14
|
+
* The position of the tour overlay related to the content being explained.
|
|
15
|
+
*/
|
|
16
|
+
position: PointingArrowPosition;
|
|
17
|
+
/**
|
|
18
|
+
* A customizable set of buttons for navigating the tour steps.
|
|
19
|
+
*/
|
|
20
|
+
customNavigation?: Omit<NavigationProps, 'stepKey'>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Tutorial: the overlay component for showing a step on React Tour.
|
|
24
|
+
* @param props the react props for the component {@link StepContainerProps}.
|
|
25
|
+
*/
|
|
26
|
+
export declare const StepContainer: ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom';
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=StepContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepContainer.d.ts","sourceRoot":"","sources":["../../../src/components/tour/StepContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAE,eAAe,EAAkB,MAAM,kBAAkB,CAAA;AAIlE,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,qBAAqB,CAAC;IAChC;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,6DAA8D,kBAAkB,4CAOzG,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { theme } from '@stack-spot/portal-theme';
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
|
+
import { StepNavigation } from './StepNavigation.js';
|
|
5
|
+
import { StepTitle } from './StepTitle.js';
|
|
6
|
+
import { useTour } from './hook.js';
|
|
7
|
+
/**
|
|
8
|
+
* Tutorial: the overlay component for showing a step on React Tour.
|
|
9
|
+
* @param props the react props for the component {@link StepContainerProps}.
|
|
10
|
+
*/
|
|
11
|
+
export const StepContainer = ({ title, stepKey, customNavigation, position, children }) => {
|
|
12
|
+
const { finishStep } = useTour();
|
|
13
|
+
return _jsxs(BoxWithPointingArrow, { "$position": position, children: [_jsx(StepTitle, { title: title, onClose: () => finishStep(stepKey) }), children, _jsx(StepNavigation, { stepKey: stepKey, ...(customNavigation || {}) })] });
|
|
14
|
+
};
|
|
15
|
+
const BoxWithPointingArrow = styled.div `
|
|
16
|
+
position: relative;
|
|
17
|
+
width: 100%;
|
|
18
|
+
background-color: ${theme.color.inverse[500]};
|
|
19
|
+
&::after {
|
|
20
|
+
content: '';
|
|
21
|
+
position: absolute;
|
|
22
|
+
border-width: 10px;
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-color: transparent;
|
|
25
|
+
margin-top: -5px;
|
|
26
|
+
border-right-color: ${theme.color.inverse[500]};
|
|
27
|
+
${({ $position, $top }) => $position === 'right' ?
|
|
28
|
+
`
|
|
29
|
+
top: ${$top || '16px'};
|
|
30
|
+
left: -18px;
|
|
31
|
+
` : ''}
|
|
32
|
+
${({ $position, $right }) => $position === 'top' ?
|
|
33
|
+
`
|
|
34
|
+
bottom: 96%;
|
|
35
|
+
right: ${$right || '16px'};
|
|
36
|
+
transform: rotate(90deg);
|
|
37
|
+
` : ''}
|
|
38
|
+
${({ $position, $top }) => $position === 'left' ?
|
|
39
|
+
`
|
|
40
|
+
top: ${$top || '16px'};
|
|
41
|
+
right: -18px;
|
|
42
|
+
transform: rotate(180deg);
|
|
43
|
+
` : ''}
|
|
44
|
+
${({ $position, $right }) => $position === 'bottom' ?
|
|
45
|
+
`
|
|
46
|
+
top: -13px;
|
|
47
|
+
right: ${$right || '16px'};
|
|
48
|
+
transform: rotate(90deg);
|
|
49
|
+
` : ''}
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
//# sourceMappingURL=StepContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepContainer.js","sourceRoot":"","sources":["../../../src/components/tour/StepCont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MACJ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC;IACjD;aACS,IAAI,IAAI,MAAM;;;KAGtB,CAAC,CAAC,CAAC,EAAE;MACJ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;IACrD;;aAES,MAAM,IAAI,MAAM;;KAExB,CAAC,CAAC,CAAC,EAAE;;CAET,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import '@stack-spot/portal-theme/dist/theme.css';
|
|
2
|
+
interface CustomNavigationButton {
|
|
3
|
+
/**
|
|
4
|
+
* The text content to render.
|
|
5
|
+
*/
|
|
6
|
+
text: string;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface NavigationProps {
|
|
10
|
+
/**
|
|
11
|
+
* The unique identifier of the step.
|
|
12
|
+
*/
|
|
13
|
+
stepKey: string;
|
|
14
|
+
/**
|
|
15
|
+
* The text and click handler for the button "next".
|
|
16
|
+
*/
|
|
17
|
+
nextButton?: CustomNavigationButton;
|
|
18
|
+
/**
|
|
19
|
+
* The text and click handler for the button "previous".
|
|
20
|
+
*/
|
|
21
|
+
prevButton?: CustomNavigationButton;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
|
|
25
|
+
* @param props the react props for the component {@link NavigationProps}.
|
|
26
|
+
*/
|
|
27
|
+
export declare const StepNavigation: ({ stepKey, nextButton, prevButton }: NavigationProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=StepNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepNavigation.d.ts","sourceRoot":"","sources":["../../../src/components/tour/StepNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,yCAAyC,CAAA;AAIhD,UAAU,sBAAsB;IAC9B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,wCAAyC,eAAe,4CAsBlF,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Flex, Text } from '@citric/core';
|
|
3
|
+
import '@stack-spot/portal-theme/dist/theme.css';
|
|
4
|
+
import { useTranslate } from '@stack-spot/portal-translate';
|
|
5
|
+
import { useTour } from './hook.js';
|
|
6
|
+
/**
|
|
7
|
+
* Tutorial: the component in a React Tour overlay that shows the next and previous buttons (for step navigation).
|
|
8
|
+
* @param props the react props for the component {@link NavigationProps}.
|
|
9
|
+
*/
|
|
10
|
+
export const StepNavigation = ({ stepKey, nextButton, prevButton }) => {
|
|
11
|
+
const { currentStep, steps, prevStep, finishStep } = useTour();
|
|
12
|
+
const t = useTranslate(translations);
|
|
13
|
+
return _jsxs(Flex, { w: 12, px: 5, py: 2, mt: "-1px", bg: "inverse.500", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "microtext1", colorScheme: "inverse.contrastText", children: [currentStep + 1, " ", t.of, " ", steps.length] }), _jsxs(Flex, { sx: { gap: '8px' }, children: [currentStep >= 1 &&
|
|
14
|
+
_jsx(Button, { sx: { paddingInline: '20px' }, onClick: () => {
|
|
15
|
+
prevStep?.();
|
|
16
|
+
prevButton?.onClick?.();
|
|
17
|
+
}, size: "sm", appearance: "text", colorScheme: "light", children: prevButton?.text || t.back }), _jsx(Button, { sx: { paddingInline: '20px' }, onClick: () => {
|
|
18
|
+
nextButton?.onClick?.();
|
|
19
|
+
finishStep(stepKey);
|
|
20
|
+
}, size: "sm", colorScheme: "light", children: nextButton?.text || (currentStep < steps.length - 1 ? t.next : t.done) })] })] });
|
|
21
|
+
};
|
|
22
|
+
const translations = {
|
|
23
|
+
en: {
|
|
24
|
+
of: 'of',
|
|
25
|
+
back: 'Back',
|
|
26
|
+
next: 'Next',
|
|
27
|
+
done: 'Done',
|
|
28
|
+
},
|
|
29
|
+
pt: {
|
|
30
|
+
of: 'de',
|
|
31
|
+
back: 'Voltar',
|
|
32
|
+
next: 'Próximo',
|
|
33
|
+
done: 'Finalizado',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=StepNavigation.js.map
|