@umituz/react-native-onboarding 3.3.1 → 3.3.2
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 +1 -1
- package/src/presentation/components/questions/MultipleChoiceQuestion.tsx +12 -8
- package/src/presentation/components/questions/RatingQuestion.tsx +7 -2
- package/src/presentation/components/questions/SingleChoiceQuestion.tsx +10 -6
- package/src/presentation/components/questions/TextInputQuestion.tsx +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-onboarding",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Advanced onboarding flow for React Native apps with personalization questions, theme-aware colors, animations, and customizable slides. SOLID, DRY, KISS principles applied.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
9
9
|
import { AtomicIcon } from "@umituz/react-native-design-system-atoms";
|
|
10
|
-
import {
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
import type { OnboardingQuestion, QuestionOption } from "../../../domain/entities/OnboardingQuestion";
|
|
12
12
|
|
|
13
13
|
export interface MultipleChoiceQuestionProps {
|
|
@@ -21,8 +21,12 @@ export const MultipleChoiceQuestion: React.FC<MultipleChoiceQuestionProps> = ({
|
|
|
21
21
|
value = [],
|
|
22
22
|
onChange,
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const tokens = useAppDesignTokens();
|
|
25
|
+
|
|
26
|
+
if (!tokens) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
const isEmoji = (icon: string) =>
|
|
27
31
|
/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/u.test(icon);
|
|
28
32
|
|
|
@@ -66,22 +70,22 @@ export const MultipleChoiceQuestion: React.FC<MultipleChoiceQuestionProps> = ({
|
|
|
66
70
|
</View>
|
|
67
71
|
)}
|
|
68
72
|
<Text style={[
|
|
69
|
-
styles.optionLabel,
|
|
73
|
+
styles.optionLabel,
|
|
70
74
|
isSelected && styles.optionLabelSelected,
|
|
71
75
|
{ color: isSelected ? tokens.colors.textPrimary : tokens.colors.textSecondary }
|
|
72
76
|
]}>
|
|
73
77
|
{option.label}
|
|
74
78
|
</Text>
|
|
75
79
|
<View style={[
|
|
76
|
-
styles.checkbox,
|
|
80
|
+
styles.checkbox,
|
|
77
81
|
isSelected && { borderWidth: 3 },
|
|
78
|
-
{
|
|
79
|
-
borderColor: isSelected ? tokens.colors.
|
|
82
|
+
{
|
|
83
|
+
borderColor: isSelected ? tokens.colors.primary : tokens.colors.border,
|
|
80
84
|
backgroundColor: isSelected ? tokens.colors.backgroundSecondary : 'transparent'
|
|
81
85
|
}
|
|
82
86
|
]}>
|
|
83
87
|
{isSelected && (
|
|
84
|
-
<AtomicIcon name="Check" customSize={16} customColor={tokens.colors.
|
|
88
|
+
<AtomicIcon name="Check" customSize={16} customColor={tokens.colors.primary} />
|
|
85
89
|
)}
|
|
86
90
|
</View>
|
|
87
91
|
</TouchableOpacity>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
9
9
|
import { AtomicIcon } from "@umituz/react-native-design-system-atoms";
|
|
10
|
-
import {
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
import type { OnboardingQuestion } from "../../../domain/entities/OnboardingQuestion";
|
|
12
12
|
|
|
13
13
|
export interface RatingQuestionProps {
|
|
@@ -21,7 +21,12 @@ export const RatingQuestion: React.FC<RatingQuestionProps> = ({
|
|
|
21
21
|
value = 0,
|
|
22
22
|
onChange,
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
24
|
+
const tokens = useAppDesignTokens();
|
|
25
|
+
|
|
26
|
+
if (!tokens) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
const { validation } = question;
|
|
26
31
|
const max = validation?.max ?? 5;
|
|
27
32
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
9
9
|
import { AtomicIcon } from "@umituz/react-native-design-system-atoms";
|
|
10
|
-
import {
|
|
10
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
11
11
|
import type { OnboardingQuestion, QuestionOption } from "../../../domain/entities/OnboardingQuestion";
|
|
12
12
|
|
|
13
13
|
export interface SingleChoiceQuestionProps {
|
|
@@ -21,8 +21,12 @@ export const SingleChoiceQuestion: React.FC<SingleChoiceQuestionProps> = ({
|
|
|
21
21
|
value,
|
|
22
22
|
onChange,
|
|
23
23
|
}) => {
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const tokens = useAppDesignTokens();
|
|
25
|
+
|
|
26
|
+
if (!tokens) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
const isEmoji = (icon: string) =>
|
|
27
31
|
/[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/u.test(icon);
|
|
28
32
|
|
|
@@ -50,16 +54,16 @@ export const SingleChoiceQuestion: React.FC<SingleChoiceQuestionProps> = ({
|
|
|
50
54
|
</View>
|
|
51
55
|
)}
|
|
52
56
|
<Text style={[
|
|
53
|
-
styles.optionLabel,
|
|
57
|
+
styles.optionLabel,
|
|
54
58
|
isSelected && styles.optionLabelSelected,
|
|
55
59
|
{ color: isSelected ? tokens.colors.textPrimary : tokens.colors.textSecondary }
|
|
56
60
|
]}>
|
|
57
61
|
{option.label}
|
|
58
62
|
</Text>
|
|
59
63
|
<View style={[
|
|
60
|
-
styles.radio,
|
|
64
|
+
styles.radio,
|
|
61
65
|
isSelected && { borderWidth: 3 },
|
|
62
|
-
{ borderColor: isSelected ? tokens.colors.
|
|
66
|
+
{ borderColor: isSelected ? tokens.colors.primary : tokens.colors.border }
|
|
63
67
|
]}>
|
|
64
68
|
{isSelected && <View style={[styles.radioInner, { backgroundColor: tokens.colors.textPrimary }]} />}
|
|
65
69
|
</View>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from "react";
|
|
8
8
|
import { View, TextInput, StyleSheet, Text } from "react-native";
|
|
9
|
-
import {
|
|
9
|
+
import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
|
|
10
10
|
import type { OnboardingQuestion } from "../../../domain/entities/OnboardingQuestion";
|
|
11
11
|
|
|
12
12
|
export interface TextInputQuestionProps {
|
|
@@ -20,7 +20,7 @@ export const TextInputQuestion: React.FC<TextInputQuestionProps> = ({
|
|
|
20
20
|
value = "",
|
|
21
21
|
onChange,
|
|
22
22
|
}) => {
|
|
23
|
-
const
|
|
23
|
+
const tokens = useAppDesignTokens();
|
|
24
24
|
const { validation } = question;
|
|
25
25
|
|
|
26
26
|
return (
|
|
@@ -30,7 +30,7 @@ export const TextInputQuestion: React.FC<TextInputQuestionProps> = ({
|
|
|
30
30
|
styles.input,
|
|
31
31
|
{
|
|
32
32
|
backgroundColor: tokens.colors.backgroundSecondary,
|
|
33
|
-
borderColor: tokens.colors.
|
|
33
|
+
borderColor: tokens.colors.border,
|
|
34
34
|
color: tokens.colors.textPrimary,
|
|
35
35
|
}
|
|
36
36
|
]}
|