@umituz/react-native-onboarding 2.6.0 → 2.6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-onboarding",
3
- "version": "2.6.0",
3
+ "version": "2.6.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",
@@ -19,15 +19,17 @@ export interface QuestionSlideProps {
19
19
  slide: OnboardingSlide;
20
20
  value: any;
21
21
  onChange: (value: any) => void;
22
+ useGradient?: boolean;
22
23
  }
23
24
 
24
25
  export const QuestionSlide: React.FC<QuestionSlideProps> = ({
25
26
  slide,
26
27
  value,
27
28
  onChange,
29
+ useGradient = false,
28
30
  }) => {
29
31
  const tokens = useAppDesignTokens();
30
- const styles = useMemo(() => getStyles(tokens), [tokens]);
32
+ const styles = useMemo(() => getStyles(tokens, useGradient), [tokens, useGradient]);
31
33
  const { question } = slide;
32
34
 
33
35
  if (!question) {
@@ -98,7 +100,7 @@ export const QuestionSlide: React.FC<QuestionSlideProps> = ({
98
100
  <AtomicIcon
99
101
  name={slide.icon as any}
100
102
  customSize={48}
101
- customColor={tokens.colors.textPrimary}
103
+ customColor={useGradient ? "#FFFFFF" : tokens.colors.textPrimary}
102
104
  />
103
105
  )}
104
106
  </View>
@@ -123,7 +125,7 @@ export const QuestionSlide: React.FC<QuestionSlideProps> = ({
123
125
  );
124
126
  };
125
127
 
126
- const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
128
+ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>, useGradient: boolean) =>
127
129
  StyleSheet.create({
128
130
  content: {
129
131
  flexGrow: 1,
@@ -136,31 +138,35 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
136
138
  alignItems: "center",
137
139
  maxWidth: 500,
138
140
  width: "100%",
139
- // Add background for readability with theme colors
140
- backgroundColor: tokens.colors.surface,
141
+ // Gradient kullanıldığında tamamen şeffaf, değilse solid
142
+ backgroundColor: useGradient ? "transparent" : tokens.colors.surface,
141
143
  padding: 30,
142
144
  borderRadius: 24,
143
- borderWidth: 1,
144
- borderColor: tokens.colors.borderLight,
145
+ borderWidth: useGradient ? 0 : 1,
146
+ borderColor: useGradient ? "transparent" : tokens.colors.borderLight,
145
147
  shadowColor: tokens.colors.textPrimary,
146
148
  shadowOffset: {
147
149
  width: 0,
148
150
  height: 4,
149
151
  },
150
- shadowOpacity: 0.1,
152
+ shadowOpacity: useGradient ? 0 : 0.1,
151
153
  shadowRadius: 8,
152
- elevation: 4,
154
+ elevation: useGradient ? 0 : 4,
153
155
  },
154
156
  iconContainer: {
155
157
  width: 96,
156
158
  height: 96,
157
159
  borderRadius: 48,
158
- backgroundColor: withAlpha(tokens.colors.primary, 0.2),
160
+ backgroundColor: useGradient
161
+ ? "rgba(255, 255, 255, 0.25)"
162
+ : withAlpha(tokens.colors.primary, 0.2),
159
163
  alignItems: "center",
160
164
  justifyContent: "center",
161
165
  marginBottom: 24,
162
166
  borderWidth: 2,
163
- borderColor: withAlpha(tokens.colors.primary, 0.4),
167
+ borderColor: useGradient
168
+ ? "rgba(255, 255, 255, 0.4)"
169
+ : withAlpha(tokens.colors.primary, 0.4),
164
170
  },
165
171
  icon: {
166
172
  fontSize: 48,
@@ -168,13 +174,13 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
168
174
  title: {
169
175
  fontSize: 24,
170
176
  fontWeight: "bold",
171
- color: tokens.colors.textPrimary,
177
+ color: useGradient ? "#FFFFFF" : tokens.colors.textPrimary,
172
178
  textAlign: "center",
173
179
  marginBottom: 12,
174
180
  },
175
181
  description: {
176
182
  fontSize: 15,
177
- color: tokens.colors.textSecondary,
183
+ color: useGradient ? "rgba(255, 255, 255, 0.9)" : tokens.colors.textSecondary,
178
184
  textAlign: "center",
179
185
  lineHeight: 22,
180
186
  marginBottom: 24,
@@ -185,7 +191,7 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) =>
185
191
  },
186
192
  requiredHint: {
187
193
  fontSize: 13,
188
- color: tokens.colors.textSecondary,
194
+ color: useGradient ? "rgba(255, 255, 255, 0.8)" : tokens.colors.textSecondary,
189
195
  fontStyle: "italic",
190
196
  marginTop: 12,
191
197
  },
@@ -229,6 +229,7 @@ export const OnboardingScreen: React.FC<OnboardingScreenProps> = ({
229
229
  slide={currentSlide}
230
230
  value={currentAnswer}
231
231
  onChange={setCurrentAnswer}
232
+ useGradient={useGradient}
232
233
  />
233
234
  ) : (
234
235
  <OnboardingSlideComponent slide={currentSlide} />