@umituz/react-native-design-system 2.6.2 → 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.
|
|
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",
|
package/src/atoms/index.ts
CHANGED
|
@@ -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
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Splash Screen Component
|
|
3
|
-
* Pure prop-driven component
|
|
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
|
|
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
|
-
/**
|
|
71
|
-
|
|
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[]];
|