@umituz/react-native-design-system 4.25.34 → 4.25.35

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": "4.25.34",
3
+ "version": "4.25.35",
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, onboarding, and loading utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,29 +1,41 @@
1
1
  /**
2
2
  * Onboarding Background Component
3
- * Handles rendering of video, image or solid backgrounds
3
+ * Handles rendering of video, image or solid backgrounds.
4
+ *
5
+ * expo-video is an OPTIONAL peer dependency.
6
+ * Pass a VideoComponent prop to enable video backgrounds.
7
+ * Without it the video slide type is silently skipped.
4
8
  */
5
9
 
6
10
  import React from "react";
7
11
  import { View, StyleSheet } from "react-native";
8
12
  import type { OnboardingSlide } from "../../domain/entities/OnboardingSlide";
9
- import { BackgroundVideo } from "./BackgroundVideo";
10
13
  import { BackgroundImageCollage } from "./BackgroundImageCollage";
11
14
  import { AtomicImage } from "../../../atoms/image/AtomicImage";
12
15
 
16
+ type VideoComponentType = React.ComponentType<{
17
+ source: unknown;
18
+ overlayOpacity?: number;
19
+ }>;
20
+
13
21
  interface BackgroundContentProps {
14
22
  slide: OnboardingSlide;
15
23
  useCustomBackground: boolean;
16
24
  overlayOpacity: number;
25
+ VideoComponent?: VideoComponentType;
17
26
  }
18
27
 
19
28
  const BackgroundContent: React.FC<BackgroundContentProps> = ({
20
29
  slide,
21
30
  useCustomBackground,
22
31
  overlayOpacity,
32
+ VideoComponent,
23
33
  }) => {
24
34
  if (slide.backgroundVideo) {
35
+ // Only render if the consuming app injected a VideoComponent (requires expo-video)
36
+ if (!VideoComponent) return null;
25
37
  return (
26
- <BackgroundVideo
38
+ <VideoComponent
27
39
  source={slide.backgroundVideo}
28
40
  overlayOpacity={overlayOpacity}
29
41
  />
@@ -68,11 +80,21 @@ const BackgroundContent: React.FC<BackgroundContentProps> = ({
68
80
  return null;
69
81
  };
70
82
 
71
- interface OnboardingBackgroundProps {
83
+ export interface OnboardingBackgroundProps {
72
84
  currentSlide: OnboardingSlide | undefined;
73
85
  useCustomBackground: boolean;
74
86
  showOverlay: boolean;
75
87
  overlayOpacity: number;
88
+ /**
89
+ * Optional video background component.
90
+ * Required only when slides use `backgroundVideo`.
91
+ * Import from `./BackgroundVideo` in apps that have expo-video installed.
92
+ *
93
+ * @example
94
+ * import { BackgroundVideo } from '@umituz/react-native-design-system/onboarding';
95
+ * <OnboardingScreen VideoComponent={BackgroundVideo} ... />
96
+ */
97
+ VideoComponent?: VideoComponentType;
76
98
  }
77
99
 
78
100
  export const OnboardingBackground: React.FC<OnboardingBackgroundProps> = ({
@@ -80,6 +102,7 @@ export const OnboardingBackground: React.FC<OnboardingBackgroundProps> = ({
80
102
  useCustomBackground,
81
103
  showOverlay,
82
104
  overlayOpacity,
105
+ VideoComponent,
83
106
  }) => {
84
107
  if (!currentSlide) return null;
85
108
 
@@ -89,6 +112,7 @@ export const OnboardingBackground: React.FC<OnboardingBackgroundProps> = ({
89
112
  slide={currentSlide}
90
113
  useCustomBackground={useCustomBackground}
91
114
  overlayOpacity={overlayOpacity}
115
+ VideoComponent={VideoComponent}
92
116
  />
93
117
  <View
94
118
  style={[
@@ -42,6 +42,7 @@ export const OnboardingScreenContent = ({
42
42
  onUpgrade,
43
43
  showPaywallOnComplete,
44
44
  variant = "default",
45
+ VideoComponent,
45
46
  }: OnboardingScreenContentProps) => {
46
47
  const { themeMode } = useTheme();
47
48
 
@@ -77,6 +78,7 @@ export const OnboardingScreenContent = ({
77
78
  useCustomBackground={useCustomBackground}
78
79
  showOverlay={showOverlay}
79
80
  overlayOpacity={overlayOpacity}
81
+ VideoComponent={VideoComponent}
80
82
  />
81
83
 
82
84
  {renderHeader ? (
@@ -64,6 +64,17 @@ export interface OnboardingScreenProps extends OnboardingOptions {
64
64
  * All translations for the onboarding (required)
65
65
  */
66
66
  translations: OnboardingTranslations;
67
+
68
+ /**
69
+ * Optional video background component.
70
+ * Required only when slides use `backgroundVideo`.
71
+ * Import from expo-video in apps that have it installed.
72
+ *
73
+ * @example
74
+ * import { BackgroundVideo } from '@umituz/react-native-design-system/onboarding';
75
+ * <OnboardingScreen VideoComponent={BackgroundVideo} ... />
76
+ */
77
+ VideoComponent?: React.ComponentType<{ source: unknown; overlayOpacity?: number }>;
67
78
  }
68
79
 
69
80
  export const OnboardingScreen = ({
@@ -88,6 +99,7 @@ export const OnboardingScreen = ({
88
99
  themeVariant = "default",
89
100
  themeColors: providedThemeColors,
90
101
  translations,
102
+ VideoComponent,
91
103
  }: OnboardingScreenProps) => {
92
104
  if (__DEV__) {
93
105
  }
@@ -180,6 +192,7 @@ export const OnboardingScreen = ({
180
192
  onUpgrade={onUpgrade}
181
193
  showPaywallOnComplete={showPaywallOnComplete}
182
194
  variant={themeVariant}
195
+ VideoComponent={VideoComponent}
183
196
  />
184
197
  </OnboardingProvider>
185
198
  );
@@ -2,6 +2,7 @@
2
2
  * Onboarding Screen Content Props
3
3
  */
4
4
 
5
+ import type React from "react";
5
6
  import type { StyleProp, ViewStyle } from "react-native";
6
7
  import type { OnboardingSlide } from "../../domain/entities/OnboardingSlide";
7
8
  import type { OnboardingAnswerValue } from "../../domain/entities/OnboardingQuestion";
@@ -45,4 +46,5 @@ export interface OnboardingScreenContentProps {
45
46
  onUpgrade?: () => void;
46
47
  showPaywallOnComplete?: boolean;
47
48
  variant?: "default" | "card" | "minimal" | "fullscreen";
49
+ VideoComponent?: React.ComponentType<{ source: unknown; overlayOpacity?: number }>;
48
50
  }