@adriansteffan/reactive 0.1.20 → 0.1.22
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/{mod-BSkJXjbN.js → mod-BqHlEEiK.js} +1075 -1072
- package/dist/mod.d.ts +6 -2
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +27 -27
- package/dist/{web-CpudSS-g.js → web-DUk2Ckc5.js} +1 -1
- package/dist/{web-XQ140ulJ.js → web-Dg20aI02.js} +1 -1
- package/package.json +1 -1
- package/src/components/quest.tsx +7 -3
- package/src/components/tutorial.tsx +4 -1
package/package.json
CHANGED
package/src/components/quest.tsx
CHANGED
|
@@ -117,10 +117,14 @@ function Quest({
|
|
|
117
117
|
next,
|
|
118
118
|
surveyJson,
|
|
119
119
|
customQuestions = {},
|
|
120
|
+
theme,
|
|
121
|
+
containerClass,
|
|
120
122
|
}: {
|
|
121
123
|
next: (data: object) => void;
|
|
122
124
|
surveyJson: object;
|
|
123
125
|
customQuestions?: ComponentsMap;
|
|
126
|
+
theme?: any;
|
|
127
|
+
containerClass?: string;
|
|
124
128
|
}) {
|
|
125
129
|
Object.keys(customQuestions).forEach((name) => {
|
|
126
130
|
registerCustomQuestion(name, customQuestions[name]);
|
|
@@ -130,7 +134,7 @@ function Quest({
|
|
|
130
134
|
...surveyJson,
|
|
131
135
|
css: { ...defaultCss, root: 'sd-root-modern custom-root' },
|
|
132
136
|
});
|
|
133
|
-
survey.applyTheme(ContrastLight);
|
|
137
|
+
survey.applyTheme(theme ?? ContrastLight);
|
|
134
138
|
|
|
135
139
|
const saveResults = useCallback(
|
|
136
140
|
(sender: any) => {
|
|
@@ -142,8 +146,8 @@ function Quest({
|
|
|
142
146
|
survey.onComplete.add(saveResults);
|
|
143
147
|
|
|
144
148
|
return (
|
|
145
|
-
<div className=
|
|
146
|
-
<div className='absolute inset-0 -z-10 h-full w-full bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]' />
|
|
149
|
+
<div className={`max-w-4xl mx-auto px-4 ${containerClass ?? ''}`}>
|
|
150
|
+
{!containerClass && <div className='absolute inset-0 -z-10 h-full w-full bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]' />}
|
|
147
151
|
<Survey model={survey} />
|
|
148
152
|
</div>
|
|
149
153
|
);
|
|
@@ -69,6 +69,8 @@ export interface TutorialProps extends BaseComponentProps {
|
|
|
69
69
|
nextKey?: string | false;
|
|
70
70
|
/** Key to go back (default: 'ArrowLeft', set to false to disable) */
|
|
71
71
|
backKey?: string | false;
|
|
72
|
+
/** Slide-down + fade-in entrance animation (default: false) */
|
|
73
|
+
animate?: boolean;
|
|
72
74
|
/** Color mode for dot indicators (default: 'light') */
|
|
73
75
|
theme?: 'light' | 'dark';
|
|
74
76
|
}
|
|
@@ -86,6 +88,7 @@ export const Tutorial = ({
|
|
|
86
88
|
fadeDuration = 0.3,
|
|
87
89
|
finishText = 'Start',
|
|
88
90
|
containerClass,
|
|
91
|
+
animate = false,
|
|
89
92
|
nextKey = 'ArrowRight',
|
|
90
93
|
backKey = 'ArrowLeft',
|
|
91
94
|
theme = 'light',
|
|
@@ -159,7 +162,7 @@ export const Tutorial = ({
|
|
|
159
162
|
return (
|
|
160
163
|
<LayoutGroup>
|
|
161
164
|
<div
|
|
162
|
-
className={containerClass}
|
|
165
|
+
className={`${containerClass ?? ''} ${animate ? 'animate-slide-down opacity-0' : ''}`}
|
|
163
166
|
style={{
|
|
164
167
|
width: '100vw',
|
|
165
168
|
height: '100vh',
|