@rubixscript/react-native-onboarding 1.0.0 → 1.1.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/LICENSE +21 -21
- package/README.md +383 -383
- package/dist/components/NavigationButtons.d.ts +23 -0
- package/dist/components/NavigationButtons.d.ts.map +1 -0
- package/dist/components/NavigationButtons.js +106 -0
- package/dist/components/Onboarding.d.ts +11 -0
- package/dist/components/Onboarding.d.ts.map +1 -0
- package/dist/components/Onboarding.js +219 -0
- package/dist/components/Pagination.d.ts +5 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +269 -0
- package/dist/components/SimpleOnboardingScreen.d.ts +54 -0
- package/dist/components/SimpleOnboardingScreen.d.ts.map +1 -0
- package/dist/components/SimpleOnboardingScreen.js +184 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/presets/index.d.ts +27 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +370 -0
- package/dist/slides/FormSlide.d.ts +12 -0
- package/dist/slides/FormSlide.d.ts.map +1 -0
- package/dist/slides/FormSlide.js +227 -0
- package/dist/slides/IconSlide.d.ts +10 -0
- package/dist/slides/IconSlide.d.ts.map +1 -0
- package/dist/slides/IconSlide.js +133 -0
- package/dist/slides/ImageSlide.d.ts +10 -0
- package/dist/slides/ImageSlide.d.ts.map +1 -0
- package/dist/slides/ImageSlide.js +99 -0
- package/dist/slides/VideoSlide.d.ts +10 -0
- package/dist/slides/VideoSlide.d.ts.map +1 -0
- package/dist/slides/VideoSlide.js +101 -0
- package/dist/slides/index.d.ts +14 -0
- package/dist/slides/index.d.ts.map +1 -0
- package/dist/slides/index.js +25 -0
- package/dist/themes/index.d.ts +35 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +547 -0
- package/dist/types/index.d.ts +191 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +73 -60
- package/src/components/NavigationButtons.tsx +198 -198
- package/src/components/Onboarding.tsx +337 -340
- package/src/components/Pagination.tsx +337 -337
- package/src/components/SimpleOnboardingScreen.tsx +266 -0
- package/src/components/index.ts +7 -5
- package/src/index.ts +69 -65
- package/src/presets/index.ts +391 -394
- package/src/slides/FormSlide.tsx +314 -314
- package/src/slides/IconSlide.tsx +166 -166
- package/src/slides/ImageSlide.tsx +132 -132
- package/src/slides/VideoSlide.tsx +146 -146
- package/src/slides/{index.ts → index.tsx} +37 -44
- package/src/themes/index.ts +576 -574
- package/src/types/index.ts +247 -247
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import Animated, { FadeInDown, withSpring, useSharedValue, useAnimatedStyle, withDelay } from 'react-native-reanimated';
|
|
4
|
+
import { Ionicons, MaterialIcons, MaterialCommunityIcons, FontAwesome, Octicons, Feather } from '@expo/vector-icons';
|
|
5
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
+
export const IconSlide = ({ data, theme, darkMode }) => {
|
|
7
|
+
const { icon, title, description, subtitle, gradientColors } = data;
|
|
8
|
+
const scale = useSharedValue(0);
|
|
9
|
+
const rotate = useSharedValue(0);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
scale.value = withSpring(1, { damping: 15, stiffness: 150 });
|
|
12
|
+
rotate.value = withDelay(200, withSpring(0, { damping: 20, stiffness: 100 }));
|
|
13
|
+
}, []);
|
|
14
|
+
const iconAnimatedStyle = useAnimatedStyle(() => ({
|
|
15
|
+
transform: [
|
|
16
|
+
{ scale: scale.value },
|
|
17
|
+
{ rotate: `${rotate.value}deg` },
|
|
18
|
+
],
|
|
19
|
+
}));
|
|
20
|
+
const containerStyle = useMemo(() => {
|
|
21
|
+
const styles = {
|
|
22
|
+
flex: 1,
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
padding: theme.spacing.lg,
|
|
26
|
+
};
|
|
27
|
+
if (data.backgroundColor) {
|
|
28
|
+
styles.backgroundColor = data.backgroundColor;
|
|
29
|
+
}
|
|
30
|
+
else if (gradientColors && gradientColors.length > 0) {
|
|
31
|
+
// Will use LinearGradient
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
styles.backgroundColor = theme.colors.background;
|
|
35
|
+
}
|
|
36
|
+
return styles;
|
|
37
|
+
}, [data, theme]);
|
|
38
|
+
const iconContainerStyle = useMemo(() => ({
|
|
39
|
+
width: icon.backgroundSize || 160,
|
|
40
|
+
height: icon.backgroundSize || 160,
|
|
41
|
+
borderRadius: (icon.backgroundSize || 160) / 2,
|
|
42
|
+
backgroundColor: icon.backgroundColor || theme.colors.primary,
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
marginBottom: theme.spacing.lg,
|
|
46
|
+
}), [icon, theme]);
|
|
47
|
+
const renderIcon = () => {
|
|
48
|
+
const iconProps = {
|
|
49
|
+
name: icon.name,
|
|
50
|
+
size: icon.size || 64,
|
|
51
|
+
color: icon.color || theme.colors.text.inverse,
|
|
52
|
+
};
|
|
53
|
+
switch (icon.type) {
|
|
54
|
+
case 'material':
|
|
55
|
+
return <MaterialIcons {...iconProps}/>;
|
|
56
|
+
case 'material-community':
|
|
57
|
+
return <MaterialCommunityIcons {...iconProps}/>;
|
|
58
|
+
case 'font-awesome':
|
|
59
|
+
return <FontAwesome {...iconProps}/>;
|
|
60
|
+
case 'octicons':
|
|
61
|
+
return <Octicons {...iconProps}/>;
|
|
62
|
+
case 'feather':
|
|
63
|
+
return <Feather {...iconProps}/>;
|
|
64
|
+
case 'ionicons':
|
|
65
|
+
default:
|
|
66
|
+
return <Ionicons {...iconProps}/>;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const titleStyle = useMemo(() => ({
|
|
70
|
+
...styles.title,
|
|
71
|
+
color: gradientColors?.length ? theme.colors.text.primary : theme.colors.text.primary,
|
|
72
|
+
}), [gradientColors, theme]);
|
|
73
|
+
const subtitleStyle = useMemo(() => ({
|
|
74
|
+
...styles.subtitle,
|
|
75
|
+
color: gradientColors?.length ? theme.colors.text.secondary : theme.colors.text.secondary,
|
|
76
|
+
}), [gradientColors, theme]);
|
|
77
|
+
const descriptionStyle = useMemo(() => ({
|
|
78
|
+
...styles.description,
|
|
79
|
+
color: gradientColors?.length ? theme.colors.text.secondary : theme.colors.text.secondary,
|
|
80
|
+
}), [gradientColors, theme]);
|
|
81
|
+
const content = (<>
|
|
82
|
+
{/* Icon */}
|
|
83
|
+
<Animated.View style={iconAnimatedStyle}>
|
|
84
|
+
<View style={iconContainerStyle}>
|
|
85
|
+
{renderIcon()}
|
|
86
|
+
</View>
|
|
87
|
+
</Animated.View>
|
|
88
|
+
|
|
89
|
+
{/* Title */}
|
|
90
|
+
{title && (<Animated.Text entering={FadeInDown.delay(100).springify()} style={titleStyle}>
|
|
91
|
+
{title}
|
|
92
|
+
</Animated.Text>)}
|
|
93
|
+
|
|
94
|
+
{/* Subtitle */}
|
|
95
|
+
{subtitle && (<Animated.Text entering={FadeInDown.delay(200).springify()} style={subtitleStyle}>
|
|
96
|
+
{subtitle}
|
|
97
|
+
</Animated.Text>)}
|
|
98
|
+
|
|
99
|
+
{/* Description */}
|
|
100
|
+
{description && (<Animated.Text entering={FadeInDown.delay(300).springify()} style={descriptionStyle}>
|
|
101
|
+
{description}
|
|
102
|
+
</Animated.Text>)}
|
|
103
|
+
</>);
|
|
104
|
+
if (gradientColors && gradientColors.length > 0) {
|
|
105
|
+
return (<LinearGradient colors={gradientColors} style={StyleSheet.absoluteFillObject}>
|
|
106
|
+
<View style={containerStyle}>{content}</View>
|
|
107
|
+
</LinearGradient>);
|
|
108
|
+
}
|
|
109
|
+
return <View style={containerStyle}>{content}</View>;
|
|
110
|
+
};
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
title: {
|
|
113
|
+
fontSize: 24,
|
|
114
|
+
fontWeight: '700',
|
|
115
|
+
textAlign: 'center',
|
|
116
|
+
marginBottom: 8,
|
|
117
|
+
paddingHorizontal: 20,
|
|
118
|
+
},
|
|
119
|
+
subtitle: {
|
|
120
|
+
fontSize: 18,
|
|
121
|
+
fontWeight: '600',
|
|
122
|
+
textAlign: 'center',
|
|
123
|
+
marginBottom: 12,
|
|
124
|
+
paddingHorizontal: 20,
|
|
125
|
+
},
|
|
126
|
+
description: {
|
|
127
|
+
fontSize: 15,
|
|
128
|
+
textAlign: 'center',
|
|
129
|
+
paddingHorizontal: 32,
|
|
130
|
+
lineHeight: 22,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
export default IconSlide;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ImageSlideData, OnboardingTheme } from '../types';
|
|
3
|
+
interface ImageSlideProps {
|
|
4
|
+
data: ImageSlideData;
|
|
5
|
+
theme: OnboardingTheme;
|
|
6
|
+
darkMode?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ImageSlide: React.FC<ImageSlideProps>;
|
|
9
|
+
export default ImageSlide;
|
|
10
|
+
//# sourceMappingURL=ImageSlide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageSlide.d.ts","sourceRoot":"","sources":["../../src/slides/ImageSlide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,eAAe;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAsFhD,CAAC;AA8BF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Image, StyleSheet, Dimensions } from 'react-native';
|
|
3
|
+
import Animated, { FadeIn, FadeInDown } from 'react-native-reanimated';
|
|
4
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
5
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
6
|
+
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
7
|
+
export const ImageSlide = ({ data, theme, darkMode }) => {
|
|
8
|
+
const { image, title, description, imageResizeMode = 'cover', imageStyle, overlayIcon, gradientColors } = data;
|
|
9
|
+
const containerStyle = useMemo(() => {
|
|
10
|
+
const styles = {
|
|
11
|
+
flex: 1,
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
padding: theme.spacing.lg,
|
|
15
|
+
};
|
|
16
|
+
if (data.backgroundColor) {
|
|
17
|
+
styles.backgroundColor = data.backgroundColor;
|
|
18
|
+
}
|
|
19
|
+
else if (gradientColors && gradientColors.length > 0) {
|
|
20
|
+
// Will use LinearGradient
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
styles.backgroundColor = theme.colors.background;
|
|
24
|
+
}
|
|
25
|
+
return styles;
|
|
26
|
+
}, [data, theme]);
|
|
27
|
+
const imageContainerStyle = useMemo(() => ({
|
|
28
|
+
...styles.imageContainer,
|
|
29
|
+
marginBottom: theme.spacing.lg,
|
|
30
|
+
}), [theme]);
|
|
31
|
+
const baseImageStyle = useMemo(() => ({
|
|
32
|
+
width: SCREEN_WIDTH - theme.spacing.xl * 2,
|
|
33
|
+
height: 280,
|
|
34
|
+
borderRadius: theme.borderRadius.lg,
|
|
35
|
+
resizeMode: imageResizeMode,
|
|
36
|
+
...imageStyle,
|
|
37
|
+
}), [theme, imageResizeMode, imageStyle]);
|
|
38
|
+
const titleStyle = useMemo(() => ({
|
|
39
|
+
...styles.title,
|
|
40
|
+
color: gradientColors?.length ? theme.colors.text.primary : theme.colors.text.primary,
|
|
41
|
+
}), [gradientColors, theme]);
|
|
42
|
+
const descriptionStyle = useMemo(() => ({
|
|
43
|
+
...styles.description,
|
|
44
|
+
color: gradientColors?.length ? theme.colors.text.secondary : theme.colors.text.secondary,
|
|
45
|
+
}), [gradientColors, theme]);
|
|
46
|
+
const content = (<>
|
|
47
|
+
{/* Image with optional overlay icon */}
|
|
48
|
+
<Animated.View entering={FadeIn.duration(400).springify()} style={imageContainerStyle}>
|
|
49
|
+
<Image source={image} style={baseImageStyle}/>
|
|
50
|
+
{overlayIcon && (<View style={styles.overlayIcon}>
|
|
51
|
+
<Ionicons name={overlayIcon.name} size={overlayIcon.size || 48} color={overlayIcon.color || '#FFFFFF'}/>
|
|
52
|
+
</View>)}
|
|
53
|
+
</Animated.View>
|
|
54
|
+
|
|
55
|
+
{/* Title */}
|
|
56
|
+
{title && (<Animated.Text entering={FadeInDown.delay(100).springify()} style={titleStyle}>
|
|
57
|
+
{title}
|
|
58
|
+
</Animated.Text>)}
|
|
59
|
+
|
|
60
|
+
{/* Description */}
|
|
61
|
+
{description && (<Animated.Text entering={FadeInDown.delay(200).springify()} style={descriptionStyle}>
|
|
62
|
+
{description}
|
|
63
|
+
</Animated.Text>)}
|
|
64
|
+
</>);
|
|
65
|
+
if (gradientColors && gradientColors.length > 0) {
|
|
66
|
+
return (<LinearGradient colors={gradientColors} style={StyleSheet.absoluteFillObject}>
|
|
67
|
+
<View style={containerStyle}>{content}</View>
|
|
68
|
+
</LinearGradient>);
|
|
69
|
+
}
|
|
70
|
+
return <View style={containerStyle}>{content}</View>;
|
|
71
|
+
};
|
|
72
|
+
const styles = StyleSheet.create({
|
|
73
|
+
imageContainer: {
|
|
74
|
+
width: '100%',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
},
|
|
77
|
+
overlayIcon: {
|
|
78
|
+
position: 'absolute',
|
|
79
|
+
top: 20,
|
|
80
|
+
right: 20,
|
|
81
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
82
|
+
borderRadius: 20,
|
|
83
|
+
padding: 8,
|
|
84
|
+
},
|
|
85
|
+
title: {
|
|
86
|
+
fontSize: 28,
|
|
87
|
+
fontWeight: '700',
|
|
88
|
+
textAlign: 'center',
|
|
89
|
+
marginBottom: 12,
|
|
90
|
+
paddingHorizontal: 20,
|
|
91
|
+
},
|
|
92
|
+
description: {
|
|
93
|
+
fontSize: 15,
|
|
94
|
+
textAlign: 'center',
|
|
95
|
+
paddingHorizontal: 32,
|
|
96
|
+
lineHeight: 22,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
export default ImageSlide;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VideoSlideData, OnboardingTheme } from '../types';
|
|
3
|
+
interface VideoSlideProps {
|
|
4
|
+
data: VideoSlideData;
|
|
5
|
+
theme: OnboardingTheme;
|
|
6
|
+
darkMode?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const VideoSlide: React.FC<VideoSlideProps>;
|
|
9
|
+
export default VideoSlide;
|
|
10
|
+
//# sourceMappingURL=VideoSlide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoSlide.d.ts","sourceRoot":"","sources":["../../src/slides/VideoSlide.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAKzD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3D,UAAU,eAAe;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAID,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA2GhD,CAAC;AAuBF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React, { useMemo, useState, useRef } from 'react';
|
|
2
|
+
import { View, StyleSheet, Dimensions } from 'react-native';
|
|
3
|
+
import { Video, ResizeMode } from 'expo-av';
|
|
4
|
+
import Animated, { FadeIn, FadeInDown } from 'react-native-reanimated';
|
|
5
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
+
const { width: SCREEN_WIDTH } = Dimensions.get('window');
|
|
7
|
+
export const VideoSlide = ({ data, theme, darkMode }) => {
|
|
8
|
+
const { videoSource, title, description, autoPlay = true, loop = true, muted = true, poster, gradientColors } = data;
|
|
9
|
+
const videoRef = useRef(null);
|
|
10
|
+
const [isReady, setIsReady] = useState(false);
|
|
11
|
+
const handleVideoLoad = (status) => {
|
|
12
|
+
if (status.isLoaded) {
|
|
13
|
+
setIsReady(true);
|
|
14
|
+
if (autoPlay) {
|
|
15
|
+
videoRef.current?.playAsync();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const containerStyle = useMemo(() => {
|
|
20
|
+
const styles = {
|
|
21
|
+
flex: 1,
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
padding: theme.spacing.lg,
|
|
25
|
+
};
|
|
26
|
+
if (data.backgroundColor) {
|
|
27
|
+
styles.backgroundColor = data.backgroundColor;
|
|
28
|
+
}
|
|
29
|
+
else if (gradientColors && gradientColors.length > 0) {
|
|
30
|
+
// Will use LinearGradient
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
styles.backgroundColor = theme.colors.background;
|
|
34
|
+
}
|
|
35
|
+
return styles;
|
|
36
|
+
}, [data, theme]);
|
|
37
|
+
const videoContainerStyle = useMemo(() => ({
|
|
38
|
+
...styles.videoContainer,
|
|
39
|
+
marginBottom: theme.spacing.lg,
|
|
40
|
+
}), [theme]);
|
|
41
|
+
const videoStyle = {
|
|
42
|
+
width: SCREEN_WIDTH - theme.spacing.xl * 2,
|
|
43
|
+
height: (SCREEN_WIDTH - theme.spacing.xl * 2) * (9 / 16),
|
|
44
|
+
borderRadius: theme.borderRadius.lg,
|
|
45
|
+
};
|
|
46
|
+
const titleStyle = useMemo(() => ({
|
|
47
|
+
...styles.title,
|
|
48
|
+
color: gradientColors?.length ? theme.colors.text.primary : theme.colors.text.primary,
|
|
49
|
+
}), [gradientColors, theme]);
|
|
50
|
+
const descriptionStyle = useMemo(() => ({
|
|
51
|
+
...styles.description,
|
|
52
|
+
color: gradientColors?.length ? theme.colors.text.secondary : theme.colors.text.secondary,
|
|
53
|
+
}), [gradientColors, theme]);
|
|
54
|
+
const videoSourceUri = typeof videoSource === 'string' ? { uri: videoSource } : videoSource;
|
|
55
|
+
const content = (<>
|
|
56
|
+
{/* Video */}
|
|
57
|
+
<Animated.View entering={FadeIn.duration(400)} style={videoContainerStyle}>
|
|
58
|
+
<View style={videoStyle}>
|
|
59
|
+
<Video ref={videoRef} source={videoSourceUri} style={StyleSheet.absoluteFillObject} useNativeControls={false} resizeMode={ResizeMode.CONTAIN} shouldPlay={autoPlay} isLooping={loop} isMuted={muted} onLoad={handleVideoLoad}/>
|
|
60
|
+
{!isReady && poster && (<Animated.Image source={poster} style={StyleSheet.absoluteFillObject} resizeMode="cover"/>)}
|
|
61
|
+
</View>
|
|
62
|
+
</Animated.View>
|
|
63
|
+
|
|
64
|
+
{/* Title */}
|
|
65
|
+
{title && (<Animated.Text entering={FadeInDown.delay(100).springify()} style={titleStyle}>
|
|
66
|
+
{title}
|
|
67
|
+
</Animated.Text>)}
|
|
68
|
+
|
|
69
|
+
{/* Description */}
|
|
70
|
+
{description && (<Animated.Text entering={FadeInDown.delay(200).springify()} style={descriptionStyle}>
|
|
71
|
+
{description}
|
|
72
|
+
</Animated.Text>)}
|
|
73
|
+
</>);
|
|
74
|
+
if (gradientColors && gradientColors.length > 0) {
|
|
75
|
+
return (<LinearGradient colors={gradientColors} style={StyleSheet.absoluteFillObject}>
|
|
76
|
+
<View style={containerStyle}>{content}</View>
|
|
77
|
+
</LinearGradient>);
|
|
78
|
+
}
|
|
79
|
+
return <View style={containerStyle}>{content}</View>;
|
|
80
|
+
};
|
|
81
|
+
const styles = StyleSheet.create({
|
|
82
|
+
videoContainer: {
|
|
83
|
+
width: '100%',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
overflow: 'hidden',
|
|
86
|
+
},
|
|
87
|
+
title: {
|
|
88
|
+
fontSize: 28,
|
|
89
|
+
fontWeight: '700',
|
|
90
|
+
textAlign: 'center',
|
|
91
|
+
marginBottom: 12,
|
|
92
|
+
paddingHorizontal: 20,
|
|
93
|
+
},
|
|
94
|
+
description: {
|
|
95
|
+
fontSize: 15,
|
|
96
|
+
textAlign: 'center',
|
|
97
|
+
paddingHorizontal: 32,
|
|
98
|
+
lineHeight: 22,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
export default VideoSlide;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { ImageSlide } from './ImageSlide';
|
|
2
|
+
export { IconSlide } from './IconSlide';
|
|
3
|
+
export { FormSlide } from './FormSlide';
|
|
4
|
+
export { VideoSlide } from './VideoSlide';
|
|
5
|
+
import { SlideData, OnboardingTheme } from '../types';
|
|
6
|
+
interface SlideRendererProps {
|
|
7
|
+
data: SlideData;
|
|
8
|
+
theme: OnboardingTheme;
|
|
9
|
+
darkMode?: boolean;
|
|
10
|
+
onSubmit?: (data: Record<string, any>) => void;
|
|
11
|
+
isSubmitting?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const SlideRenderer: React.FC<SlideRendererProps>;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slides/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtD,UAAU,kBAAkB;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgBtD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { ImageSlide } from './ImageSlide';
|
|
2
|
+
export { IconSlide } from './IconSlide';
|
|
3
|
+
export { FormSlide } from './FormSlide';
|
|
4
|
+
export { VideoSlide } from './VideoSlide';
|
|
5
|
+
import { ImageSlide } from './ImageSlide';
|
|
6
|
+
import { IconSlide } from './IconSlide';
|
|
7
|
+
import { FormSlide } from './FormSlide';
|
|
8
|
+
import { VideoSlide } from './VideoSlide';
|
|
9
|
+
export const SlideRenderer = ({ data, theme, darkMode, onSubmit, isSubmitting }) => {
|
|
10
|
+
switch (data.type) {
|
|
11
|
+
case 'image':
|
|
12
|
+
return <ImageSlide data={data} theme={theme} darkMode={darkMode}/>;
|
|
13
|
+
case 'icon':
|
|
14
|
+
return <IconSlide data={data} theme={theme} darkMode={darkMode}/>;
|
|
15
|
+
case 'form':
|
|
16
|
+
return <FormSlide data={data} theme={theme} onSubmit={onSubmit || (() => { })} darkMode={darkMode} isSubmitting={isSubmitting}/>;
|
|
17
|
+
case 'video':
|
|
18
|
+
return <VideoSlide data={data} theme={theme} darkMode={darkMode}/>;
|
|
19
|
+
case 'custom':
|
|
20
|
+
const CustomComponent = data.component;
|
|
21
|
+
return <CustomComponent {...data.props} theme={theme} darkMode={darkMode}/>;
|
|
22
|
+
default:
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { OnboardingTheme, PresetConfig } from '../types';
|
|
2
|
+
export declare const onepageTheme: OnboardingTheme;
|
|
3
|
+
export declare const onepagePreset: PresetConfig;
|
|
4
|
+
export declare const zaprecipeTheme: OnboardingTheme;
|
|
5
|
+
export declare const zaprecipePreset: PresetConfig;
|
|
6
|
+
export declare const pomodoTheme: OnboardingTheme;
|
|
7
|
+
export declare const pomodoPreset: PresetConfig;
|
|
8
|
+
export declare const modernTheme: OnboardingTheme;
|
|
9
|
+
export declare const modernPreset: PresetConfig;
|
|
10
|
+
export declare const minimalTheme: OnboardingTheme;
|
|
11
|
+
export declare const minimalPreset: PresetConfig;
|
|
12
|
+
export declare const gradientTheme: OnboardingTheme;
|
|
13
|
+
export declare const gradientPreset: PresetConfig;
|
|
14
|
+
export declare const getTheme: (preset: string) => OnboardingTheme;
|
|
15
|
+
export declare const getPreset: (preset: string) => PresetConfig;
|
|
16
|
+
export declare const mergeTheme: (base: OnboardingTheme, custom?: Partial<OnboardingTheme>) => OnboardingTheme;
|
|
17
|
+
declare const _default: {
|
|
18
|
+
onepageTheme: OnboardingTheme;
|
|
19
|
+
zaprecipeTheme: OnboardingTheme;
|
|
20
|
+
pomodoTheme: OnboardingTheme;
|
|
21
|
+
modernTheme: OnboardingTheme;
|
|
22
|
+
minimalTheme: OnboardingTheme;
|
|
23
|
+
gradientTheme: OnboardingTheme;
|
|
24
|
+
onepagePreset: PresetConfig;
|
|
25
|
+
zaprecipePreset: PresetConfig;
|
|
26
|
+
pomodoPreset: PresetConfig;
|
|
27
|
+
modernPreset: PresetConfig;
|
|
28
|
+
minimalPreset: PresetConfig;
|
|
29
|
+
gradientPreset: PresetConfig;
|
|
30
|
+
getTheme: (preset: string) => OnboardingTheme;
|
|
31
|
+
getPreset: (preset: string) => PresetConfig;
|
|
32
|
+
mergeTheme: (base: OnboardingTheme, custom?: Partial<OnboardingTheme>) => OnboardingTheme;
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAsEzD,eAAO,MAAM,YAAY,EAAE,eAuC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YAmC3B,CAAC;AAMF,eAAO,MAAM,cAAc,EAAE,eAuC5B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,YAmC7B,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,eAkCzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YAsC1B,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,eAkCzB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,YA2B1B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,eAiC1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,YA0B3B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,eAkC3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,YA8B5B,CAAC;AAMF,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,KAAG,eAUzC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,KAAG,YAU1C,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,eAAe,EAAE,SAAS,OAAO,CAAC,eAAe,CAAC,KAAG,eAUrF,CAAC;;;;;;;;;;;;;;uBAlC+B,MAAM,KAAG,eAAe;wBAYvB,MAAM,KAAG,YAAY;uBAYtB,eAAe,WAAW,OAAO,CAAC,eAAe,CAAC,KAAG,eAAe;;AAYrG,wBAgBE"}
|