@umituz/react-native-onboarding 3.6.15 → 3.6.16

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": "3.6.15",
3
+ "version": "3.6.16",
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,8 +7,9 @@
7
7
  * This component only handles UI coordination - no business logic
8
8
  */
9
9
 
10
- import React from "react";
10
+ import React, { useMemo } from "react";
11
11
  import { StyleSheet } from "react-native";
12
+ import { useAppDesignTokens } from "@umituz/react-native-design-system";
12
13
  import type { OnboardingOptions } from "../../domain/entities/OnboardingOptions";
13
14
  import { useOnboardingScreenState } from "../hooks/useOnboardingScreenState";
14
15
  import { OnboardingScreenContent } from "../components/OnboardingScreenContent";
@@ -55,9 +56,9 @@ export interface OnboardingScreenProps extends OnboardingOptions {
55
56
  showPaywallOnComplete?: boolean;
56
57
 
57
58
  /**
58
- * Theme colors for the onboarding (Required to avoid hardcoded values)
59
+ * Theme colors for the onboarding (Optional - will use design tokens if not provided)
59
60
  */
60
- themeColors: OnboardingColors;
61
+ themeColors?: OnboardingColors;
61
62
  }
62
63
 
63
64
  export const OnboardingScreen = ({
@@ -81,12 +82,37 @@ export const OnboardingScreen = ({
81
82
  showPaywallOnComplete = false,
82
83
  useGradient: globalUseGradient = false,
83
84
  themeVariant = "default",
84
- themeColors,
85
+ themeColors: providedThemeColors,
85
86
  }: OnboardingScreenProps) => {
86
87
  if (__DEV__) {
87
88
  console.log("[OnboardingScreen] Rendering with slides:", slides?.length);
88
89
  }
89
90
 
91
+ const tokens = useAppDesignTokens();
92
+
93
+ const themeColors = useMemo(
94
+ () =>
95
+ providedThemeColors ?? {
96
+ iconColor: tokens.colors.primary,
97
+ textColor: tokens.colors.textPrimary,
98
+ subTextColor: tokens.colors.textSecondary,
99
+ buttonBg: tokens.colors.primary,
100
+ buttonTextColor: tokens.colors.onPrimary,
101
+ progressBarBg: tokens.colors.surfaceSecondary,
102
+ progressFillColor: tokens.colors.primary,
103
+ dotColor: tokens.colors.surfaceSecondary,
104
+ activeDotColor: tokens.colors.primary,
105
+ progressTextColor: tokens.colors.textSecondary,
106
+ headerButtonBg: tokens.colors.surface,
107
+ headerButtonBorder: tokens.colors.borderLight,
108
+ iconBg: tokens.colors.surfaceSecondary,
109
+ iconBorder: tokens.colors.borderLight,
110
+ errorColor: tokens.colors.error,
111
+ featureItemBg: tokens.colors.surfaceSecondary,
112
+ },
113
+ [providedThemeColors, tokens]
114
+ );
115
+
90
116
  const {
91
117
  filteredSlides,
92
118
  currentSlide,