@ttoss/react-wizard 0.4.10 → 0.4.12
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/index.cjs +19 -19
- package/dist/index.mjs +19 -19
- package/package.json +9 -9
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,7 @@ let _chakra_ui_react = require("@chakra-ui/react");
|
|
|
38
38
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
39
39
|
|
|
40
40
|
//#region src/Wizard.styles.ts
|
|
41
|
-
|
|
41
|
+
var gradientFlow = (0, _ttoss_ui.keyframes)({
|
|
42
42
|
"0%": {
|
|
43
43
|
backgroundPosition: "0% 50%"
|
|
44
44
|
},
|
|
@@ -49,19 +49,19 @@ const gradientFlow = (0, _ttoss_ui.keyframes)({
|
|
|
49
49
|
backgroundPosition: "0% 50%"
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
|
|
52
|
+
var getAccentGradientBackground = t => {
|
|
53
53
|
const theme = t;
|
|
54
54
|
const start = theme.colors?.action?.background?.accent?.default || theme.colors?.input?.background?.accent?.default;
|
|
55
55
|
if (!start) return void 0;
|
|
56
56
|
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.accent?.active || theme.colors?.input?.background?.accent?.active || start}, ${start})`;
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
var getPrimaryGradientBackground = t => {
|
|
59
59
|
const theme = t;
|
|
60
60
|
const start = theme.colors?.action?.background?.primary?.default;
|
|
61
61
|
if (!start) return void 0;
|
|
62
62
|
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.secondary?.default || start}, ${start})`;
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
var getVariantStyles = (variantType = "spotlight-accent") => {
|
|
65
65
|
const variants = {
|
|
66
66
|
"spotlight-accent": {
|
|
67
67
|
accentColor: "action.background.accent.default",
|
|
@@ -98,7 +98,7 @@ const getVariantStyles = (variantType = "spotlight-accent") => {
|
|
|
98
98
|
};
|
|
99
99
|
return variants[variantType] ?? variants["spotlight-accent"];
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
var getWizardShellSx = (variant = "spotlight-accent") => {
|
|
102
102
|
return {
|
|
103
103
|
width: "100%",
|
|
104
104
|
minHeight: "300px",
|
|
@@ -108,7 +108,7 @@ const getWizardShellSx = (variant = "spotlight-accent") => {
|
|
|
108
108
|
overflow: "hidden"
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
|
|
111
|
+
var getWizardStepListSx = ({
|
|
112
112
|
layout,
|
|
113
113
|
variant = "spotlight-accent"
|
|
114
114
|
}) => {
|
|
@@ -131,7 +131,7 @@ const getWizardStepListSx = ({
|
|
|
131
131
|
})
|
|
132
132
|
};
|
|
133
133
|
};
|
|
134
|
-
|
|
134
|
+
var getWizardStepIndicatorSx = ({
|
|
135
135
|
status,
|
|
136
136
|
variant = "spotlight-accent",
|
|
137
137
|
isClickable
|
|
@@ -152,7 +152,7 @@ const getWizardStepIndicatorSx = ({
|
|
|
152
152
|
} : {})
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
var getWizardStepSeparatorSx = ({
|
|
156
156
|
isCompleted,
|
|
157
157
|
variant = "spotlight-accent"
|
|
158
158
|
}) => {
|
|
@@ -161,7 +161,7 @@ const getWizardStepSeparatorSx = ({
|
|
|
161
161
|
opacity: isCompleted ? 1 : .4
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
|
-
|
|
164
|
+
var getWizardStepTitleSx = ({
|
|
165
165
|
status,
|
|
166
166
|
variant = "spotlight-accent"
|
|
167
167
|
}) => {
|
|
@@ -172,7 +172,7 @@ const getWizardStepTitleSx = ({
|
|
|
172
172
|
opacity: status === "upcoming" ? .4 : 1
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
|
-
|
|
175
|
+
var getWizardStepDescriptionSx = ({
|
|
176
176
|
status,
|
|
177
177
|
variant = "spotlight-accent"
|
|
178
178
|
}) => {
|
|
@@ -182,25 +182,25 @@ const getWizardStepDescriptionSx = ({
|
|
|
182
182
|
opacity: status === "upcoming" ? .4 : 1
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
var WizardStepDescriptionFlexSx = {
|
|
186
186
|
flexDirection: "row",
|
|
187
187
|
alignItems: "center",
|
|
188
188
|
justifyContent: "center"
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
var WizardStepTextWrapperSx = {
|
|
191
191
|
textAlign: "center"
|
|
192
192
|
};
|
|
193
|
-
|
|
193
|
+
var getWizardPrimaryButtonVariant = (variant = "spotlight-accent") => {
|
|
194
194
|
return getVariantStyles(variant).primaryButtonVariant;
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
//#endregion
|
|
198
198
|
//#region src/WizardContext.ts
|
|
199
|
-
|
|
199
|
+
var WizardContext = react$1.createContext(null);
|
|
200
200
|
/**
|
|
201
201
|
* Hook to access the wizard context from within step content.
|
|
202
202
|
*/
|
|
203
|
-
|
|
203
|
+
var useWizard = () => {
|
|
204
204
|
const context = react$1.useContext(WizardContext);
|
|
205
205
|
if (!context) throw new Error("useWizard must be used within a Wizard component.");
|
|
206
206
|
return context;
|
|
@@ -208,7 +208,7 @@ const useWizard = () => {
|
|
|
208
208
|
|
|
209
209
|
//#endregion
|
|
210
210
|
//#region src/WizardStepList.tsx
|
|
211
|
-
|
|
211
|
+
var WizardStepList = ({
|
|
212
212
|
steps,
|
|
213
213
|
currentStep,
|
|
214
214
|
layout,
|
|
@@ -310,7 +310,7 @@ const WizardStepList = ({
|
|
|
310
310
|
|
|
311
311
|
//#endregion
|
|
312
312
|
//#region src/Wizard.tsx
|
|
313
|
-
|
|
313
|
+
var messages = (0, _ttoss_react_i18n.defineMessages)({
|
|
314
314
|
previous: {
|
|
315
315
|
defaultMessage: "Previous",
|
|
316
316
|
description: "Label for the previous step button in the wizard."
|
|
@@ -328,7 +328,7 @@ const messages = (0, _ttoss_react_i18n.defineMessages)({
|
|
|
328
328
|
description: "Label for the cancel button in the wizard."
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
|
-
|
|
331
|
+
var getFlexDirection = layout => {
|
|
332
332
|
switch (layout) {
|
|
333
333
|
case "top":
|
|
334
334
|
return "column";
|
|
@@ -350,7 +350,7 @@ const getFlexDirection = layout => {
|
|
|
350
350
|
* @param props.onCancel - Called when the user cancels the wizard.
|
|
351
351
|
* @param props.onStepChange - Called when the current step changes.
|
|
352
352
|
*/
|
|
353
|
-
|
|
353
|
+
var Wizard = ({
|
|
354
354
|
steps,
|
|
355
355
|
layout = "top",
|
|
356
356
|
variant = "spotlight-accent",
|
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { Steps } from "@chakra-ui/react";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/Wizard.styles.ts
|
|
9
|
-
|
|
9
|
+
var gradientFlow = keyframes({
|
|
10
10
|
"0%": {
|
|
11
11
|
backgroundPosition: "0% 50%"
|
|
12
12
|
},
|
|
@@ -17,19 +17,19 @@ const gradientFlow = keyframes({
|
|
|
17
17
|
backgroundPosition: "0% 50%"
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
|
|
20
|
+
var getAccentGradientBackground = t => {
|
|
21
21
|
const theme = t;
|
|
22
22
|
const start = theme.colors?.action?.background?.accent?.default || theme.colors?.input?.background?.accent?.default;
|
|
23
23
|
if (!start) return void 0;
|
|
24
24
|
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.accent?.active || theme.colors?.input?.background?.accent?.active || start}, ${start})`;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
var getPrimaryGradientBackground = t => {
|
|
27
27
|
const theme = t;
|
|
28
28
|
const start = theme.colors?.action?.background?.primary?.default;
|
|
29
29
|
if (!start) return void 0;
|
|
30
30
|
return `linear-gradient(270deg, ${start}, ${theme.colors?.action?.background?.secondary?.default || start}, ${start})`;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
var getVariantStyles = (variantType = "spotlight-accent") => {
|
|
33
33
|
const variants = {
|
|
34
34
|
"spotlight-accent": {
|
|
35
35
|
accentColor: "action.background.accent.default",
|
|
@@ -66,7 +66,7 @@ const getVariantStyles = (variantType = "spotlight-accent") => {
|
|
|
66
66
|
};
|
|
67
67
|
return variants[variantType] ?? variants["spotlight-accent"];
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
var getWizardShellSx = (variant = "spotlight-accent") => {
|
|
70
70
|
return {
|
|
71
71
|
width: "100%",
|
|
72
72
|
minHeight: "300px",
|
|
@@ -76,7 +76,7 @@ const getWizardShellSx = (variant = "spotlight-accent") => {
|
|
|
76
76
|
overflow: "hidden"
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
var getWizardStepListSx = ({
|
|
80
80
|
layout,
|
|
81
81
|
variant = "spotlight-accent"
|
|
82
82
|
}) => {
|
|
@@ -99,7 +99,7 @@ const getWizardStepListSx = ({
|
|
|
99
99
|
})
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
|
-
|
|
102
|
+
var getWizardStepIndicatorSx = ({
|
|
103
103
|
status,
|
|
104
104
|
variant = "spotlight-accent",
|
|
105
105
|
isClickable
|
|
@@ -120,7 +120,7 @@ const getWizardStepIndicatorSx = ({
|
|
|
120
120
|
} : {})
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
|
-
|
|
123
|
+
var getWizardStepSeparatorSx = ({
|
|
124
124
|
isCompleted,
|
|
125
125
|
variant = "spotlight-accent"
|
|
126
126
|
}) => {
|
|
@@ -129,7 +129,7 @@ const getWizardStepSeparatorSx = ({
|
|
|
129
129
|
opacity: isCompleted ? 1 : .4
|
|
130
130
|
};
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
var getWizardStepTitleSx = ({
|
|
133
133
|
status,
|
|
134
134
|
variant = "spotlight-accent"
|
|
135
135
|
}) => {
|
|
@@ -140,7 +140,7 @@ const getWizardStepTitleSx = ({
|
|
|
140
140
|
opacity: status === "upcoming" ? .4 : 1
|
|
141
141
|
};
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
var getWizardStepDescriptionSx = ({
|
|
144
144
|
status,
|
|
145
145
|
variant = "spotlight-accent"
|
|
146
146
|
}) => {
|
|
@@ -150,25 +150,25 @@ const getWizardStepDescriptionSx = ({
|
|
|
150
150
|
opacity: status === "upcoming" ? .4 : 1
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
var WizardStepDescriptionFlexSx = {
|
|
154
154
|
flexDirection: "row",
|
|
155
155
|
alignItems: "center",
|
|
156
156
|
justifyContent: "center"
|
|
157
157
|
};
|
|
158
|
-
|
|
158
|
+
var WizardStepTextWrapperSx = {
|
|
159
159
|
textAlign: "center"
|
|
160
160
|
};
|
|
161
|
-
|
|
161
|
+
var getWizardPrimaryButtonVariant = (variant = "spotlight-accent") => {
|
|
162
162
|
return getVariantStyles(variant).primaryButtonVariant;
|
|
163
163
|
};
|
|
164
164
|
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region src/WizardContext.ts
|
|
167
|
-
|
|
167
|
+
var WizardContext = React.createContext(null);
|
|
168
168
|
/**
|
|
169
169
|
* Hook to access the wizard context from within step content.
|
|
170
170
|
*/
|
|
171
|
-
|
|
171
|
+
var useWizard = () => {
|
|
172
172
|
const context = React.useContext(WizardContext);
|
|
173
173
|
if (!context) throw new Error("useWizard must be used within a Wizard component.");
|
|
174
174
|
return context;
|
|
@@ -176,7 +176,7 @@ const useWizard = () => {
|
|
|
176
176
|
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/WizardStepList.tsx
|
|
179
|
-
|
|
179
|
+
var WizardStepList = ({
|
|
180
180
|
steps,
|
|
181
181
|
currentStep,
|
|
182
182
|
layout,
|
|
@@ -278,7 +278,7 @@ const WizardStepList = ({
|
|
|
278
278
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region src/Wizard.tsx
|
|
281
|
-
|
|
281
|
+
var messages = defineMessages({
|
|
282
282
|
previous: {
|
|
283
283
|
id: "60eH0J",
|
|
284
284
|
defaultMessage: [{
|
|
@@ -308,7 +308,7 @@ const messages = defineMessages({
|
|
|
308
308
|
}]
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
|
-
|
|
311
|
+
var getFlexDirection = layout => {
|
|
312
312
|
switch (layout) {
|
|
313
313
|
case "top":
|
|
314
314
|
return "column";
|
|
@@ -330,7 +330,7 @@ const getFlexDirection = layout => {
|
|
|
330
330
|
* @param props.onCancel - Called when the user cancels the wizard.
|
|
331
331
|
* @param props.onStepChange - Called when the current step changes.
|
|
332
332
|
*/
|
|
333
|
-
|
|
333
|
+
var Wizard = ({
|
|
334
334
|
steps,
|
|
335
335
|
layout = "top",
|
|
336
336
|
variant = "spotlight-accent",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-wizard",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "A React wizard component for guiding users through multi-step flows with configurable step list layouts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"React",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"jest": "^30.3.0",
|
|
37
37
|
"react": "^19.2.6",
|
|
38
38
|
"tsdown": "^0.22.0",
|
|
39
|
-
"@ttoss/config": "^1.37.
|
|
40
|
-
"@ttoss/
|
|
41
|
-
"@ttoss/
|
|
42
|
-
"@ttoss/
|
|
43
|
-
"@ttoss/
|
|
44
|
-
"@ttoss/test-utils": "^4.2.
|
|
39
|
+
"@ttoss/config": "^1.37.15",
|
|
40
|
+
"@ttoss/i18n-cli": "^0.8.15",
|
|
41
|
+
"@ttoss/forms": "^0.43.28",
|
|
42
|
+
"@ttoss/ui": "^6.9.23",
|
|
43
|
+
"@ttoss/react-i18n": "^2.2.17",
|
|
44
|
+
"@ttoss/test-utils": "^4.2.15"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@chakra-ui/react": "^3",
|
|
48
48
|
"react": ">=16.8.0",
|
|
49
49
|
"react-icons": "^5",
|
|
50
|
-
"@ttoss/react-i18n": "^2.2.
|
|
51
|
-
"@ttoss/ui": "^6.9.
|
|
50
|
+
"@ttoss/react-i18n": "^2.2.17",
|
|
51
|
+
"@ttoss/ui": "^6.9.23"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public",
|