@campxdev/react-blueprint 1.0.7 → 1.0.9
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/package.json
CHANGED
|
@@ -8,6 +8,7 @@ export interface TutorialProps {
|
|
|
8
8
|
steps: Step[];
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
tourName: string;
|
|
11
|
+
showProgress?: boolean;
|
|
11
12
|
iconPosition?: "left" | "right";
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -16,6 +17,7 @@ export const Tutorial = ({
|
|
|
16
17
|
children,
|
|
17
18
|
tourName,
|
|
18
19
|
iconPosition = "right",
|
|
20
|
+
showProgress = true,
|
|
19
21
|
}: TutorialProps) => {
|
|
20
22
|
const [run, setRun] = useState(false);
|
|
21
23
|
const userTours = localStorage.getItem("userTours") || "[]";
|
|
@@ -33,7 +35,7 @@ export const Tutorial = ({
|
|
|
33
35
|
|
|
34
36
|
const handleJoyrideCallback = (data: CallBackProps) => {
|
|
35
37
|
console.log(data);
|
|
36
|
-
const { action, status, lifecycle, type } = data;
|
|
38
|
+
const { action, status, lifecycle, type, size } = data;
|
|
37
39
|
const reqData = {
|
|
38
40
|
tourName: tourName,
|
|
39
41
|
skipped: false,
|
|
@@ -46,11 +48,15 @@ export const Tutorial = ({
|
|
|
46
48
|
lifecycle === "complete" &&
|
|
47
49
|
type === "tour:end"
|
|
48
50
|
) {
|
|
51
|
+
console.log("Tour is skipped");
|
|
49
52
|
reqData.skipped = true;
|
|
53
|
+
} else if (action === ACTIONS.CLOSE) {
|
|
54
|
+
setRun(false);
|
|
50
55
|
} else if (action === ACTIONS.RESET) {
|
|
56
|
+
console.log("Tour is reset");
|
|
51
57
|
reqData.completed = true;
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
console.log(reqData);
|
|
54
60
|
if (reqData.skipped || reqData.completed) {
|
|
55
61
|
setRun(false); // Stop the tour
|
|
56
62
|
completeTour(reqData).catch((err) => {
|
|
@@ -97,22 +103,25 @@ export const Tutorial = ({
|
|
|
97
103
|
continuous
|
|
98
104
|
run={run}
|
|
99
105
|
showSkipButton
|
|
100
|
-
showProgress
|
|
106
|
+
showProgress={showProgress}
|
|
107
|
+
disableCloseOnEsc
|
|
108
|
+
disableOverlayClose
|
|
101
109
|
spotlightPadding={5}
|
|
102
110
|
locale={{
|
|
103
|
-
last: "
|
|
111
|
+
last: "Got it",
|
|
104
112
|
next: "Next",
|
|
105
113
|
skip: "Skip",
|
|
106
114
|
back: "Previous",
|
|
107
115
|
}}
|
|
108
116
|
styles={{
|
|
109
117
|
buttonNext: {
|
|
110
|
-
backgroundColor:
|
|
111
|
-
color:
|
|
118
|
+
backgroundColor: theme.palette.primary.main,
|
|
119
|
+
color: theme.palette.secondary.light,
|
|
120
|
+
border: "none",
|
|
112
121
|
height: "28px",
|
|
113
122
|
width: "100px",
|
|
114
123
|
padding: "0px",
|
|
115
|
-
fontFamily: "
|
|
124
|
+
fontFamily: "Heebo, sans-serif",
|
|
116
125
|
},
|
|
117
126
|
buttonBack: {
|
|
118
127
|
backgroundColor: "transparent",
|
|
@@ -124,8 +133,16 @@ export const Tutorial = ({
|
|
|
124
133
|
marginLeft: "5px",
|
|
125
134
|
padding: "0px",
|
|
126
135
|
border: "1px solid black",
|
|
127
|
-
fontFamily: "
|
|
136
|
+
fontFamily: "Heebo, sans-serif",
|
|
137
|
+
},
|
|
138
|
+
tooltip: {
|
|
139
|
+
padding: "10px",
|
|
128
140
|
},
|
|
141
|
+
tooltipContainer: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
backgroundColor: theme.palette.surface.paperBackground,
|
|
144
|
+
},
|
|
145
|
+
|
|
129
146
|
options: {},
|
|
130
147
|
}}
|
|
131
148
|
/>
|
|
@@ -50,7 +50,14 @@ export const AppHeader = ({
|
|
|
50
50
|
id="jiraIssueCollector"
|
|
51
51
|
className="reportAnIssue"
|
|
52
52
|
>
|
|
53
|
-
<Typography
|
|
53
|
+
<Typography
|
|
54
|
+
variant="button"
|
|
55
|
+
sx={{
|
|
56
|
+
fontWeight: "bold",
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
Report an Issue
|
|
60
|
+
</Typography>
|
|
54
61
|
</Button>
|
|
55
62
|
<UserBox
|
|
56
63
|
fullName={userFullName}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Tutorial } from "../../components/Feedback/Tutorial/Tutorial";
|
|
3
|
+
import { Typography } from "../../components/DataDisplay/Typography/Typography";
|
|
4
|
+
import { useTheme } from "@mui/material";
|
|
3
5
|
|
|
4
6
|
export default {
|
|
5
7
|
title: "Feedback/Tutorial",
|
|
@@ -42,15 +44,28 @@ export const PrimaryTutorial: StoryObj<typeof Tutorial> = {
|
|
|
42
44
|
),
|
|
43
45
|
args: {
|
|
44
46
|
tourName: "Active Batches",
|
|
47
|
+
showProgress: false,
|
|
45
48
|
steps: [
|
|
46
49
|
{
|
|
47
50
|
target: ".tutorial-target",
|
|
48
|
-
content:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
content: (
|
|
52
|
+
<>
|
|
53
|
+
<div>
|
|
54
|
+
<Typography variant="body2">
|
|
55
|
+
Click the button above 👆 to submit your feedback.
|
|
56
|
+
</Typography>
|
|
57
|
+
<Typography variant="caption" color="highlight">
|
|
58
|
+
Check the environment box to ensure detailed reporting.
|
|
59
|
+
</Typography>
|
|
60
|
+
</div>
|
|
61
|
+
</>
|
|
62
|
+
),
|
|
63
|
+
disableBeacon: true,
|
|
53
64
|
},
|
|
65
|
+
// {
|
|
66
|
+
// target: ".next-target",
|
|
67
|
+
// content: "This is the next step",
|
|
68
|
+
// },
|
|
54
69
|
],
|
|
55
70
|
},
|
|
56
71
|
};
|