@stack-spot/portal-layout 2.21.0 → 2.21.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/CHANGELOG.md +8 -0
- package/dist/components/tour/StepContainer.d.ts +11 -3
- package/dist/components/tour/StepContainer.d.ts.map +1 -1
- package/dist/components/tour/StepContainer.js +7 -8
- package/dist/components/tour/StepContainer.js.map +1 -1
- package/dist/components/tour/StepTitle.d.ts.map +1 -1
- package/dist/components/tour/StepTitle.js +3 -2
- package/dist/components/tour/StepTitle.js.map +1 -1
- package/dist/components/tour/utils.d.ts +17 -1
- package/dist/components/tour/utils.d.ts.map +1 -1
- package/dist/components/tour/utils.js +2 -2
- package/dist/components/tour/utils.js.map +1 -1
- package/dist/layout.css +0 -10
- package/package.json +1 -1
- package/src/components/tour/StepContainer.tsx +25 -16
- package/src/components/tour/StepTitle.tsx +5 -4
- package/src/components/tour/utils.tsx +20 -1
- package/src/layout.css +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.21.1](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.21.0...portal-layout@v2.21.1) (2024-12-27)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* layout tour guided ([#606](https://github.com/stack-spot/portal-commons/issues/606)) ([c9bf51f](https://github.com/stack-spot/portal-commons/commit/c9bf51fa51c21f940df3c9f839bf303f3a1512fc))
|
|
9
|
+
* remove banner css ([#619](https://github.com/stack-spot/portal-commons/issues/619)) ([d4d8432](https://github.com/stack-spot/portal-commons/commit/d4d843239f3fbba3b9d69f2abee3b23fd297d581))
|
|
10
|
+
|
|
3
11
|
## [2.21.0](https://github.com/stack-spot/portal-commons/compare/portal-layout@v2.20.1...portal-layout@v2.21.0) (2024-12-27)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NavigationProps } from './StepNavigation.js';
|
|
3
3
|
interface StepContainerProps {
|
|
4
4
|
children: ReactNode;
|
|
@@ -13,7 +13,15 @@ interface StepContainerProps {
|
|
|
13
13
|
/**
|
|
14
14
|
* The position of the tour overlay related to the content being explained.
|
|
15
15
|
*/
|
|
16
|
-
position
|
|
16
|
+
position?: PointingArrowPosition;
|
|
17
|
+
/**
|
|
18
|
+
* The CSS 'right' property to adjust the horizontal position of the overlay.
|
|
19
|
+
*/
|
|
20
|
+
right?: React.CSSProperties['right'];
|
|
21
|
+
/**
|
|
22
|
+
* The CSS 'top' property to adjust the vertical position of the overlay.
|
|
23
|
+
*/
|
|
24
|
+
top?: React.CSSProperties['top'];
|
|
17
25
|
/**
|
|
18
26
|
* A customizable set of buttons for navigating the tour steps.
|
|
19
27
|
*/
|
|
@@ -23,7 +31,7 @@ interface StepContainerProps {
|
|
|
23
31
|
* Tutorial: the overlay component for showing a step on React Tour.
|
|
24
32
|
* @param props the react props for the component {@link StepContainerProps}.
|
|
25
33
|
*/
|
|
26
|
-
export declare const StepContainer: ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const StepContainer: ({ title, stepKey, customNavigation, position, top, right, children }: StepContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
35
|
export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom';
|
|
28
36
|
export {};
|
|
29
37
|
//# sourceMappingURL=StepContainer.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"StepContainer.d.ts","sourceRoot":"","sources":["../../../src/components/tour/StepContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,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,CAAC,EAAE,qBAAqB,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,yEAAqF,kBAAkB,4CAShI,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA"}
|
|
@@ -8,9 +8,9 @@ import { useTour } from './hook.js';
|
|
|
8
8
|
* Tutorial: the overlay component for showing a step on React Tour.
|
|
9
9
|
* @param props the react props for the component {@link StepContainerProps}.
|
|
10
10
|
*/
|
|
11
|
-
export const StepContainer = ({ title, stepKey, customNavigation, position, children }) => {
|
|
11
|
+
export const StepContainer = ({ title, stepKey, customNavigation, position = 'bottom', top, right, children }) => {
|
|
12
12
|
const { closeTour } = useTour();
|
|
13
|
-
return _jsxs(BoxWithPointingArrow, { "$position": position, children: [_jsx(StepTitle, { title: title, onClose: () => closeTour() }), children, _jsx(StepNavigation, { stepKey: stepKey, ...(customNavigation || {}) })] });
|
|
13
|
+
return (_jsxs(BoxWithPointingArrow, { "$position": position, "$top": top, "$right": right, children: [_jsx(StepTitle, { title: title, onClose: () => closeTour() }), children, _jsx(StepNavigation, { stepKey: stepKey, ...(customNavigation || {}) })] }));
|
|
14
14
|
};
|
|
15
15
|
const BoxWithPointingArrow = styled.div `
|
|
16
16
|
position: relative;
|
|
@@ -22,28 +22,27 @@ const BoxWithPointingArrow = styled.div `
|
|
|
22
22
|
border-width: 10px;
|
|
23
23
|
border-style: solid;
|
|
24
24
|
border-color: transparent;
|
|
25
|
-
margin-top: -5px;
|
|
26
25
|
border-right-color: ${theme.color.inverse[500]};
|
|
27
26
|
${({ $position, $top }) => $position === 'right' ?
|
|
28
27
|
`
|
|
29
28
|
top: ${$top || '16px'};
|
|
30
|
-
|
|
29
|
+
right: 100%;
|
|
31
30
|
` : ''}
|
|
32
31
|
${({ $position, $right }) => $position === 'top' ?
|
|
33
32
|
`
|
|
34
|
-
|
|
33
|
+
top: 100%;
|
|
35
34
|
right: ${$right || '16px'};
|
|
36
|
-
transform: rotate(90deg);
|
|
35
|
+
transform: rotate(-90deg);
|
|
37
36
|
` : ''}
|
|
38
37
|
${({ $position, $top }) => $position === 'left' ?
|
|
39
38
|
`
|
|
40
39
|
top: ${$top || '16px'};
|
|
41
|
-
|
|
40
|
+
left: 100%;
|
|
42
41
|
transform: rotate(180deg);
|
|
43
42
|
` : ''}
|
|
44
43
|
${({ $position, $right }) => $position === 'bottom' ?
|
|
45
44
|
`
|
|
46
|
-
|
|
45
|
+
bottom: 100%;
|
|
47
46
|
right: ${$right || '16px'};
|
|
48
47
|
transform: rotate(90deg);
|
|
49
48
|
` : ''}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepContainer.js","sourceRoot":"","sources":["../../../src/components/tour/StepContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAmB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa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tB,CAAC,CAAC,CAAC,EAAE;MACJ,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC;IAClD;;aAES,MAAM,IAAI,MAAM;;KAExB,CAAC,CAAC,CAAC,EAAE;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepTitle.d.ts","sourceRoot":"","sources":["../../../src/components/tour/StepTitle.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StepTitle.d.ts","sourceRoot":"","sources":["../../../src/components/tour/StepTitle.tsx"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,uBAAwB,cAAc,4CAQnD,CAAA"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Flex, IconBox, Text } from '@citric/core';
|
|
3
3
|
import { TimesMini } from '@citric/icons';
|
|
4
|
+
import { IconButton } from '@citric/ui';
|
|
4
5
|
/**
|
|
5
6
|
* Tutorial: the component in a React Tour overlay that renders the title.
|
|
6
7
|
* @param props the react props for the component {@link StepTitleProps}.
|
|
7
8
|
*/
|
|
8
|
-
export const StepTitle = ({ title, onClose }) => _jsxs(Flex, { w: 12,
|
|
9
|
+
export const StepTitle = ({ title, onClose }) => _jsxs(Flex, { w: 12, px: 5, py: 3, flexWrap: "nowrap", justifyContent: "space-between", alignItems: "center", children: [_jsxs(Text, { appearance: "body2", colorScheme: "inverse.contrastText", weight: "medium", children: [" ", title, " "] }), _jsx(IconButton, { onClick: onClose, sx: { r: 'full', p: 0 }, children: _jsx(IconBox, { size: "xs", colorIcon: "inverse.contrastText", children: _jsx(TimesMini, {}) }) })] });
|
|
9
10
|
//# sourceMappingURL=StepTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepTitle.js","sourceRoot":"","sources":["../../../src/components/tour/StepTitle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StepTitle.js","sourceRoot":"","sources":["../../../src/components/tour/StepTitle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAavC;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAkB,EAAE,EAAE,CAC9D,MAAC,IAAI,IAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAC,QAAQ,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aAC7F,MAAC,IAAI,IAAC,UAAU,EAAC,OAAO,EAAC,WAAW,EAAC,sBAAsB,EAAC,MAAM,EAAC,QAAQ,kBAAG,KAAK,SAAS,EAC5F,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,YACnD,KAAC,OAAO,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,sBAAsB,YACjD,KAAC,SAAS,KAAG,GACL,GACC,IACR,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ReactourStep } from 'reactour';
|
|
3
|
+
import { PointingArrowPosition } from './StepContainer.js';
|
|
3
4
|
import { NavigationProps } from './StepNavigation.js';
|
|
4
5
|
/**
|
|
5
6
|
* Tutorial: marks the tour step as finished. This sets a cookie, preventing the tour from showing again.
|
|
@@ -36,6 +37,21 @@ export interface StackspotTourStep extends ReactourStep {
|
|
|
36
37
|
* The step's content.
|
|
37
38
|
*/
|
|
38
39
|
content: ReactNode;
|
|
40
|
+
/**
|
|
41
|
+
* The position of the tour overlay related to the content being explained.
|
|
42
|
+
*/
|
|
43
|
+
position?: PointingArrowPosition;
|
|
44
|
+
/**
|
|
45
|
+
* The CSS 'right' property to adjust the horizontal position of the overlay.
|
|
46
|
+
*/
|
|
47
|
+
right?: React.CSSProperties['right'];
|
|
48
|
+
/**
|
|
49
|
+
* The CSS 'top' property to adjust the vertical position of the overlay.
|
|
50
|
+
*/
|
|
51
|
+
top?: React.CSSProperties['top'];
|
|
52
|
+
/**
|
|
53
|
+
* A customizable set of buttons for navigating the tour steps.
|
|
54
|
+
*/
|
|
39
55
|
/**
|
|
40
56
|
* A set of properties for customizing the next and previous buttons.
|
|
41
57
|
*/
|
|
@@ -46,5 +62,5 @@ export interface StackspotTourStep extends ReactourStep {
|
|
|
46
62
|
* @param options the options for building the step: {@link StackspotTourStep}.
|
|
47
63
|
* @returns the React Tour step.
|
|
48
64
|
*/
|
|
49
|
-
export declare const tourStepBuilder: ({ selector, position, title, content, style, customNavigation, ...rest }: StackspotTourStep) => ReactourStep;
|
|
65
|
+
export declare const tourStepBuilder: ({ selector, position, title, content, style, right, top, customNavigation, ...rest }: StackspotTourStep) => ReactourStep;
|
|
50
66
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/tour/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/tour/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAiB,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAYlD;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAS,MAAM,SAIzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAAU,YAAY,YAA6C,CAAA;AAE7F;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,QAAS,MAAM,YAG9C,CAAA;AAED,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrC;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACjC;;OAEG;IACH;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAC;CACpC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,yFAUzB,iBAAiB,KAAG,YAoBrB,CAAA"}
|
|
@@ -44,9 +44,9 @@ export const hasFinishedTourStep = (key) => {
|
|
|
44
44
|
* @param options the options for building the step: {@link StackspotTourStep}.
|
|
45
45
|
* @returns the React Tour step.
|
|
46
46
|
*/
|
|
47
|
-
export const tourStepBuilder = ({ selector, position, title, content, style, customNavigation, ...rest }) => ({
|
|
47
|
+
export const tourStepBuilder = ({ selector, position, title, content, style, right, top, customNavigation, ...rest }) => ({
|
|
48
48
|
selector,
|
|
49
|
-
content: (_jsx(StepContainer, { stepKey: selector, position: position, title: title, customNavigation: customNavigation, children: content })),
|
|
49
|
+
content: (_jsx(StepContainer, { stepKey: selector, position: position, right: right, top: top, title: title, customNavigation: customNavigation, children: content })),
|
|
50
50
|
position,
|
|
51
51
|
style: {
|
|
52
52
|
backgroundColor: theme.color.inverse[500],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/tour/utils.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAGhD,OAAO,EAAyB,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGtE,MAAM,WAAW,GAAG,oBAAoB,CAAA;AAExC,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAA;AACjC,cAAc,CAAC,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAA;AAExD,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,MAAM,iBAAiB,GAAG,SAAS,CAAC,WAAW,CAAC,CAAA;IAChD,OAAO,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AAC9D,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE;IAC5C,M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OAAO,GACM,CAAC;IACjB,QAAQ;IACR,KAAK,EAAE;QACL,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACzC,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,CAAC;QACV,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAiC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG;QACjF,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB;IACD,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;CAChB,CAAC,CAAA"}
|
package/dist/layout.css
CHANGED
|
@@ -94,16 +94,6 @@ body {
|
|
|
94
94
|
transition: left ease-in-out var(--menu-animation-duration);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
#page.home-banner-visible {
|
|
98
|
-
padding: 0 !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
#banner-warning {
|
|
102
|
-
width: 90.7vw;
|
|
103
|
-
margin-left: calc(-0.6 * var(--menu-sections-width));
|
|
104
|
-
margin-right: 0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
97
|
#layout.menu-content-visible #page {
|
|
108
98
|
left: calc(var(--menu-sections-width) + var(--menu-content-width));
|
|
109
99
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { theme } from '@stack-spot/portal-theme'
|
|
2
|
-
import { ReactNode } from 'react'
|
|
2
|
+
import React, { ReactNode } from 'react'
|
|
3
3
|
import { styled } from 'styled-components'
|
|
4
4
|
import { NavigationProps, StepNavigation } from './StepNavigation'
|
|
5
5
|
import { StepTitle } from './StepTitle'
|
|
@@ -18,7 +18,15 @@ interface StepContainerProps {
|
|
|
18
18
|
/**
|
|
19
19
|
* The position of the tour overlay related to the content being explained.
|
|
20
20
|
*/
|
|
21
|
-
position
|
|
21
|
+
position?: PointingArrowPosition,
|
|
22
|
+
/**
|
|
23
|
+
* The CSS 'right' property to adjust the horizontal position of the overlay.
|
|
24
|
+
*/
|
|
25
|
+
right?: React.CSSProperties['right'],
|
|
26
|
+
/**
|
|
27
|
+
* The CSS 'top' property to adjust the vertical position of the overlay.
|
|
28
|
+
*/
|
|
29
|
+
top?: React.CSSProperties['top'],
|
|
22
30
|
/**
|
|
23
31
|
* A customizable set of buttons for navigating the tour steps.
|
|
24
32
|
*/
|
|
@@ -29,21 +37,23 @@ interface StepContainerProps {
|
|
|
29
37
|
* Tutorial: the overlay component for showing a step on React Tour.
|
|
30
38
|
* @param props the react props for the component {@link StepContainerProps}.
|
|
31
39
|
*/
|
|
32
|
-
export const StepContainer = ({ title, stepKey, customNavigation, position, children }: StepContainerProps) => {
|
|
40
|
+
export const StepContainer = ({ title, stepKey, customNavigation, position = 'bottom', top, right, children }: StepContainerProps) => {
|
|
33
41
|
const { closeTour } = useTour()
|
|
34
|
-
return
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
return (
|
|
43
|
+
<BoxWithPointingArrow $position={position} $top={top} $right={right}>
|
|
44
|
+
<StepTitle title={title} onClose={() => closeTour()} />
|
|
45
|
+
{children}
|
|
46
|
+
<StepNavigation stepKey={stepKey} {...(customNavigation || {})} />
|
|
47
|
+
</BoxWithPointingArrow>
|
|
48
|
+
)
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
export type PointingArrowPosition = 'right' | 'top' | 'left' | 'bottom'
|
|
42
52
|
|
|
43
53
|
const BoxWithPointingArrow = styled.div < {
|
|
44
54
|
$position: PointingArrowPosition,
|
|
45
|
-
$top?:
|
|
46
|
-
$right?:
|
|
55
|
+
$top?: React.CSSProperties['top'],
|
|
56
|
+
$right?: React.CSSProperties['right'],
|
|
47
57
|
} > `
|
|
48
58
|
position: relative;
|
|
49
59
|
width: 100%;
|
|
@@ -54,28 +64,27 @@ const BoxWithPointingArrow = styled.div < {
|
|
|
54
64
|
border-width: 10px;
|
|
55
65
|
border-style: solid;
|
|
56
66
|
border-color: transparent;
|
|
57
|
-
margin-top: -5px;
|
|
58
67
|
border-right-color: ${theme.color.inverse[500]};
|
|
59
68
|
${({ $position, $top }) => $position === 'right' ?
|
|
60
69
|
`
|
|
61
70
|
top: ${$top || '16px'};
|
|
62
|
-
|
|
71
|
+
right: 100%;
|
|
63
72
|
` : ''}
|
|
64
73
|
${({ $position, $right }) => $position === 'top' ?
|
|
65
74
|
`
|
|
66
|
-
|
|
75
|
+
top: 100%;
|
|
67
76
|
right: ${$right || '16px'};
|
|
68
|
-
transform: rotate(90deg);
|
|
77
|
+
transform: rotate(-90deg);
|
|
69
78
|
` : ''}
|
|
70
79
|
${({ $position, $top }) => $position === 'left' ?
|
|
71
80
|
`
|
|
72
81
|
top: ${$top || '16px'};
|
|
73
|
-
|
|
82
|
+
left: 100%;
|
|
74
83
|
transform: rotate(180deg);
|
|
75
84
|
` : ''}
|
|
76
85
|
${({ $position, $right }) => $position === 'bottom' ?
|
|
77
86
|
`
|
|
78
|
-
|
|
87
|
+
bottom: 100%;
|
|
79
88
|
right: ${$right || '16px'};
|
|
80
89
|
transform: rotate(90deg);
|
|
81
90
|
` : ''}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Flex, IconBox, Text } from '@citric/core'
|
|
2
2
|
import { TimesMini } from '@citric/icons'
|
|
3
|
+
import { IconButton } from '@citric/ui'
|
|
3
4
|
|
|
4
5
|
interface StepTitleProps {
|
|
5
6
|
/**
|
|
@@ -17,11 +18,11 @@ interface StepTitleProps {
|
|
|
17
18
|
* @param props the react props for the component {@link StepTitleProps}.
|
|
18
19
|
*/
|
|
19
20
|
export const StepTitle = ({ title, onClose }: StepTitleProps) =>
|
|
20
|
-
<Flex w={12}
|
|
21
|
+
<Flex w={12} px={5} py={3} flexWrap="nowrap" justifyContent="space-between" alignItems="center">
|
|
21
22
|
<Text appearance="body2" colorScheme="inverse.contrastText" weight="medium"> {title} </Text>
|
|
22
|
-
<
|
|
23
|
+
<IconButton onClick={onClose} sx={{ r: 'full', p: 0 }} >
|
|
23
24
|
<IconBox size="xs" colorIcon="inverse.contrastText">
|
|
24
25
|
<TimesMini />
|
|
25
26
|
</IconBox>
|
|
26
|
-
</
|
|
27
|
+
</IconButton>
|
|
27
28
|
</Flex>
|
|
@@ -60,6 +60,21 @@ export interface StackspotTourStep extends ReactourStep {
|
|
|
60
60
|
* The step's content.
|
|
61
61
|
*/
|
|
62
62
|
content: ReactNode,
|
|
63
|
+
/**
|
|
64
|
+
* The position of the tour overlay related to the content being explained.
|
|
65
|
+
*/
|
|
66
|
+
position?: PointingArrowPosition,
|
|
67
|
+
/**
|
|
68
|
+
* The CSS 'right' property to adjust the horizontal position of the overlay.
|
|
69
|
+
*/
|
|
70
|
+
right?: React.CSSProperties['right'],
|
|
71
|
+
/**
|
|
72
|
+
* The CSS 'top' property to adjust the vertical position of the overlay.
|
|
73
|
+
*/
|
|
74
|
+
top?: React.CSSProperties['top'],
|
|
75
|
+
/**
|
|
76
|
+
* A customizable set of buttons for navigating the tour steps.
|
|
77
|
+
*/
|
|
63
78
|
/**
|
|
64
79
|
* A set of properties for customizing the next and previous buttons.
|
|
65
80
|
*/
|
|
@@ -77,13 +92,17 @@ export const tourStepBuilder = ({
|
|
|
77
92
|
title,
|
|
78
93
|
content,
|
|
79
94
|
style,
|
|
95
|
+
right,
|
|
96
|
+
top,
|
|
80
97
|
customNavigation,
|
|
81
98
|
...rest
|
|
82
99
|
}: StackspotTourStep): ReactourStep => ({
|
|
83
100
|
selector,
|
|
84
101
|
content: (<StepContainer
|
|
85
102
|
stepKey={selector}
|
|
86
|
-
position={position
|
|
103
|
+
position={position}
|
|
104
|
+
right={right}
|
|
105
|
+
top={top}
|
|
87
106
|
title={title}
|
|
88
107
|
customNavigation={customNavigation}>
|
|
89
108
|
{content}
|
package/src/layout.css
CHANGED
|
@@ -94,16 +94,6 @@ body {
|
|
|
94
94
|
transition: left ease-in-out var(--menu-animation-duration);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
#page.home-banner-visible {
|
|
98
|
-
padding: 0 !important;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
#banner-warning {
|
|
102
|
-
width: 90.7vw;
|
|
103
|
-
margin-left: calc(-0.6 * var(--menu-sections-width));
|
|
104
|
-
margin-right: 0;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
97
|
#layout.menu-content-visible #page {
|
|
108
98
|
left: calc(var(--menu-sections-width) + var(--menu-content-width));
|
|
109
99
|
}
|