@umituz/react-native-design-system 2.6.1 → 2.6.3

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.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -108,3 +108,6 @@ export { AtomicSwitch, type AtomicSwitchProps } from './AtomicSwitch';
108
108
 
109
109
  // Touchable
110
110
  export { AtomicTouchable, type AtomicTouchableProps } from './AtomicTouchable';
111
+
112
+ // StatusBar
113
+ export { AtomicStatusBar, type AtomicStatusBarProps } from './status-bar';
@@ -0,0 +1,37 @@
1
+ /**
2
+ * AtomicStatusBar Component
3
+ * Theme-aware status bar that automatically adjusts based on theme mode
4
+ */
5
+
6
+ import React from 'react';
7
+ import { StatusBar, StatusBarProps } from 'react-native';
8
+ import { useTheme } from '../../theme/hooks/useTheme';
9
+ import { useAppDesignTokens } from '../../theme/hooks/useAppDesignTokens';
10
+
11
+ export interface AtomicStatusBarProps extends Omit<StatusBarProps, 'barStyle' | 'backgroundColor'> {
12
+ barStyle?: 'auto' | 'light-content' | 'dark-content';
13
+ backgroundColor?: string;
14
+ }
15
+
16
+ export const AtomicStatusBar: React.FC<AtomicStatusBarProps> = ({
17
+ barStyle = 'auto',
18
+ backgroundColor,
19
+ ...props
20
+ }) => {
21
+ const { themeMode } = useTheme();
22
+ const tokens = useAppDesignTokens();
23
+
24
+ const resolvedBarStyle = barStyle === 'auto'
25
+ ? themeMode === 'dark' ? 'light-content' : 'dark-content'
26
+ : barStyle;
27
+
28
+ const resolvedBackgroundColor = backgroundColor || tokens.colors.backgroundPrimary;
29
+
30
+ return (
31
+ <StatusBar
32
+ barStyle={resolvedBarStyle}
33
+ backgroundColor={resolvedBackgroundColor}
34
+ {...props}
35
+ />
36
+ );
37
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Status Bar Exports
3
+ */
4
+
5
+ export { AtomicStatusBar } from './AtomicStatusBar';
6
+ export type { AtomicStatusBarProps } from './AtomicStatusBar';
@@ -1,14 +1,15 @@
1
1
  /**
2
2
  * Splash Screen Component
3
- * Pure prop-driven component, no context needed
3
+ * Pure prop-driven component with theme-aware defaults
4
4
  */
5
5
 
6
6
  import React, { useEffect, useState, useCallback } from "react";
7
- import { View, Image, StyleSheet } from "react-native";
7
+ import { View, Image, StyleSheet, ActivityIndicator } from "react-native";
8
8
  import { LinearGradient } from "expo-linear-gradient";
9
9
  import { useSafeAreaInsets } from "react-native-safe-area-context";
10
10
  import { AtomicText } from "../../../atoms";
11
- import type { SplashScreenProps } from "../types";
11
+ import { useAppDesignTokens } from "../../../theme";
12
+ import type { SplashScreenProps, SplashColors } from "../types";
12
13
  import { SPLASH_CONSTANTS } from "../constants";
13
14
 
14
15
  declare const __DEV__: boolean;
@@ -67,8 +67,25 @@ export interface SplashScreenProps {
67
67
  /** App icon/logo image source */
68
68
  icon?: ImageSourcePropType;
69
69
 
70
- /** Color configuration (required - must be provided by app) */
71
- colors: SplashColors;
70
+ /**
71
+ * Color configuration (optional - uses design tokens by default)
72
+ *
73
+ * If not provided, colors will be automatically derived from the current theme:
74
+ * - Light mode: dark text on light background
75
+ * - Dark mode: light text on dark background
76
+ *
77
+ * @example
78
+ * // Auto theme-aware (recommended)
79
+ * <SplashScreen appName="MyApp" icon={icon} />
80
+ *
81
+ * // Custom colors
82
+ * <SplashScreen
83
+ * appName="MyApp"
84
+ * icon={icon}
85
+ * colors={{ background: '#FF0000', text: '#FFFFFF' }}
86
+ * />
87
+ */
88
+ colors?: SplashColors;
72
89
 
73
90
  /** Optional gradient colors (overrides background color) */
74
91
  gradientColors?: readonly [string, string, ...string[]];
@@ -1,5 +1,6 @@
1
1
  import React, { useEffect, useState, ReactNode } from 'react';
2
2
  import { ActivityIndicator, View, StyleSheet } from 'react-native';
3
+ import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
3
4
  import { useThemeStore } from '../stores/themeStore';
4
5
  import { useDesignSystemTheme } from '../globalThemeStore';
5
6
  import type { CustomThemeColors } from '../../core/CustomColors';
@@ -89,25 +90,33 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
89
90
  });
90
91
  }, [initialize, customColors, setCustomColors, onInitialized, onError]);
91
92
 
92
- // Show loading indicator if requested and not yet initialized
93
- if (showLoadingIndicator && !isInitialized) {
94
- if (loadingComponent) {
95
- return <>{loadingComponent}</>;
96
- }
97
-
98
- // Use SplashScreen if config provided, otherwise fallback to ActivityIndicator
99
- if (splashConfig?.colors) {
100
- return <SplashScreen {...splashConfig} />;
93
+ const renderContent = () => {
94
+ // Show loading indicator if requested and not yet initialized
95
+ if (showLoadingIndicator && !isInitialized) {
96
+ if (loadingComponent) {
97
+ return <>{loadingComponent}</>;
98
+ }
99
+
100
+ // Use SplashScreen if config provided, otherwise fallback to ActivityIndicator
101
+ if (splashConfig?.colors) {
102
+ return <SplashScreen {...splashConfig} />;
103
+ }
104
+
105
+ return (
106
+ <View style={styles.loadingContainer}>
107
+ <ActivityIndicator size="large" />
108
+ </View>
109
+ );
101
110
  }
102
111
 
103
- return (
104
- <View style={styles.loadingContainer}>
105
- <ActivityIndicator size="large" />
106
- </View>
107
- );
108
- }
112
+ return <>{children}</>;
113
+ };
109
114
 
110
- return <>{children}</>;
115
+ return (
116
+ <SafeAreaProvider initialMetrics={initialWindowMetrics}>
117
+ {renderContent()}
118
+ </SafeAreaProvider>
119
+ );
111
120
  };
112
121
 
113
122
  const styles = StyleSheet.create({