@umituz/react-native-design-system 2.8.44 → 2.8.45

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-design-system",
3
- "version": "2.8.44",
3
+ "version": "2.8.45",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, and onboarding utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -68,7 +68,7 @@ export {
68
68
  export { OnboardingScreen, type OnboardingScreenProps } from "./presentation/screens/OnboardingScreen";
69
69
  export { OnboardingHeader, type OnboardingHeaderProps } from "./presentation/components/OnboardingHeader";
70
70
  export { OnboardingFooter, type OnboardingFooterProps } from "./presentation/components/OnboardingFooter";
71
- export { OnboardingProvider, type OnboardingProviderProps, useOnboardingProvider } from "./presentation/providers/OnboardingProvider";
71
+ export { OnboardingProvider, type OnboardingProviderProps, type OnboardingTranslations, useOnboardingProvider } from "./presentation/providers/OnboardingProvider";
72
72
  export { BackgroundImageCollage, type CollageLayout, type BackgroundImageCollageProps } from "./presentation/components/BackgroundImageCollage";
73
73
  export type { OnboardingTheme, OnboardingColors } from "./presentation/types/OnboardingTheme";
74
74
 
@@ -1,7 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, StyleSheet, TouchableOpacity } from "react-native";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { useLocalization } from "@umituz/react-native-localization";
5
4
  import { AtomicText } from "../../../atoms/AtomicText";
6
5
  import { useOnboardingProvider } from "../providers/OnboardingProvider";
7
6
 
@@ -13,8 +12,6 @@ export interface OnboardingFooterProps {
13
12
  showProgressBar?: boolean;
14
13
  showDots?: boolean;
15
14
  showProgressText?: boolean;
16
- nextButtonText?: string;
17
- getStartedButtonText?: string;
18
15
  disabled?: boolean;
19
16
  }
20
17
 
@@ -26,19 +23,14 @@ export const OnboardingFooter = ({
26
23
  showProgressBar = true,
27
24
  showDots = true,
28
25
  showProgressText = true,
29
- nextButtonText,
30
- getStartedButtonText,
31
26
  disabled = false,
32
27
  }: OnboardingFooterProps) => {
33
28
  const insets = useSafeAreaInsets();
34
- const { t } = useLocalization();
35
- const {
36
- theme: { colors },
37
- } = useOnboardingProvider();
29
+ const { theme: { colors }, translations } = useOnboardingProvider();
38
30
 
39
31
  const buttonText = isLastSlide
40
- ? getStartedButtonText || t("onboarding.getStarted")
41
- : nextButtonText || t("general.continue");
32
+ ? translations.getStartedButton
33
+ : translations.nextButton;
42
34
 
43
35
  const progressPercent = ((currentIndex + 1) / totalSlides) * 100;
44
36
 
@@ -95,7 +87,7 @@ export const OnboardingFooter = ({
95
87
  type="labelSmall"
96
88
  style={[styles.progressText, { color: colors.progressTextColor }]}
97
89
  >
98
- {currentIndex + 1} {t("general.of")} {totalSlides}
90
+ {currentIndex + 1} {translations.of} {totalSlides}
99
91
  </AtomicText>
100
92
  )}
101
93
  </View>
@@ -127,8 +127,6 @@ export const OnboardingScreenContent = ({
127
127
  showProgressBar={showProgressBar}
128
128
  showDots={showDots}
129
129
  showProgressText={showProgressText}
130
- nextButtonText={nextButtonText}
131
- getStartedButtonText={getStartedButtonText}
132
130
  disabled={!isAnswerValid}
133
131
  />
134
132
  )}
@@ -8,8 +8,15 @@
8
8
  import React, { createContext, useContext, useMemo } from "react";
9
9
  import type { OnboardingTheme, OnboardingColors } from "../types/OnboardingTheme";
10
10
 
11
+ export interface OnboardingTranslations {
12
+ nextButton: string;
13
+ getStartedButton: string;
14
+ of: string;
15
+ }
16
+
11
17
  interface OnboardingProviderValue {
12
18
  theme: OnboardingTheme;
19
+ translations: OnboardingTranslations;
13
20
  }
14
21
 
15
22
  const OnboardingScope = createContext<OnboardingProviderValue | undefined>(undefined);
@@ -18,12 +25,14 @@ export interface OnboardingProviderProps {
18
25
  children: React.ReactNode;
19
26
  useCustomBackground: boolean;
20
27
  colors: OnboardingColors;
28
+ translations: OnboardingTranslations;
21
29
  }
22
30
 
23
31
  export const OnboardingProvider = ({
24
32
  children,
25
33
  useCustomBackground,
26
34
  colors,
35
+ translations,
27
36
  }: OnboardingProviderProps) => {
28
37
  const value = useMemo(
29
38
  () => ({
@@ -31,8 +40,9 @@ export const OnboardingProvider = ({
31
40
  colors,
32
41
  useCustomBackground,
33
42
  },
43
+ translations,
34
44
  }),
35
- [colors, useCustomBackground]
45
+ [colors, useCustomBackground, translations]
36
46
  );
37
47
 
38
48
  return (
@@ -13,7 +13,7 @@ import { useAppDesignTokens } from "../../../theme/hooks/useAppDesignTokens";
13
13
  import type { OnboardingOptions } from "../../domain/entities/OnboardingOptions";
14
14
  import { useOnboardingScreenState } from "../hooks/useOnboardingScreenState";
15
15
  import { OnboardingScreenContent } from "../components/OnboardingScreenContent";
16
- import { OnboardingProvider } from "../providers/OnboardingProvider";
16
+ import { OnboardingProvider, type OnboardingTranslations } from "../providers/OnboardingProvider";
17
17
  import type { OnboardingColors } from "../types/OnboardingTheme";
18
18
 
19
19
  export interface OnboardingScreenProps extends OnboardingOptions {
@@ -59,6 +59,11 @@ export interface OnboardingScreenProps extends OnboardingOptions {
59
59
  * Theme colors for the onboarding (Optional - will use design tokens if not provided)
60
60
  */
61
61
  themeColors?: OnboardingColors;
62
+
63
+ /**
64
+ * All translations for the onboarding (required)
65
+ */
66
+ translations: OnboardingTranslations;
62
67
  }
63
68
 
64
69
  export const OnboardingScreen = ({
@@ -82,6 +87,7 @@ export const OnboardingScreen = ({
82
87
  useCustomBackground: globalUseCustomBackground = false,
83
88
  themeVariant = "default",
84
89
  themeColors: providedThemeColors,
90
+ translations,
85
91
  }: OnboardingScreenProps) => {
86
92
  if (__DEV__) {
87
93
  console.log("[OnboardingScreen] Rendering with slides:", slides?.length);
@@ -147,7 +153,7 @@ export const OnboardingScreen = ({
147
153
  }
148
154
 
149
155
  return (
150
- <OnboardingProvider useCustomBackground={useCustomBackground} colors={themeColors}>
156
+ <OnboardingProvider useCustomBackground={useCustomBackground} colors={themeColors} translations={translations}>
151
157
  <OnboardingScreenContent
152
158
  containerStyle={[styles.container, containerStyle]}
153
159
  useCustomBackground={useCustomBackground}