@umituz/react-native-design-system 2.8.0 → 2.8.2
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.
|
|
3
|
+
"version": "2.8.2",
|
|
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",
|
|
@@ -37,3 +37,7 @@ export { useTabConfig, type UseTabConfigProps } from "./hooks/useTabConfig";
|
|
|
37
37
|
|
|
38
38
|
// Navigation Theme
|
|
39
39
|
export { createNavigationTheme } from "./utils/NavigationTheme";
|
|
40
|
+
|
|
41
|
+
// Screen Options
|
|
42
|
+
export { createScreenOptions } from "./utils/createScreenOptions";
|
|
43
|
+
export type { ScreenOptionsParams } from "./utils/createScreenOptions";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Screen Options Creator
|
|
3
|
+
* Creates React Navigation screen options with design tokens
|
|
4
|
+
* Used by all packages for consistent navigation headers
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { StackNavigationOptions } from '@react-navigation/stack';
|
|
8
|
+
|
|
9
|
+
export interface ScreenOptionsParams {
|
|
10
|
+
colors: {
|
|
11
|
+
surface: string;
|
|
12
|
+
textPrimary: string;
|
|
13
|
+
borderLight: string;
|
|
14
|
+
};
|
|
15
|
+
backTitle?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates standard screen options for React Navigation
|
|
20
|
+
* @param params - Design tokens and back title
|
|
21
|
+
* @returns React Navigation screen options
|
|
22
|
+
*/
|
|
23
|
+
export const createScreenOptions = (params: ScreenOptionsParams): StackNavigationOptions => {
|
|
24
|
+
const { colors, backTitle } = params;
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
headerStyle: {
|
|
28
|
+
backgroundColor: colors.surface,
|
|
29
|
+
borderBottomColor: colors.borderLight,
|
|
30
|
+
borderBottomWidth: 1,
|
|
31
|
+
},
|
|
32
|
+
headerTitleStyle: {
|
|
33
|
+
fontSize: 18,
|
|
34
|
+
fontWeight: '600',
|
|
35
|
+
color: colors.textPrimary,
|
|
36
|
+
},
|
|
37
|
+
headerTintColor: colors.textPrimary,
|
|
38
|
+
...(backTitle && {
|
|
39
|
+
headerBackTitle: backTitle,
|
|
40
|
+
headerBackTitleStyle: {
|
|
41
|
+
fontSize: 16,
|
|
42
|
+
color: colors.textPrimary,
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
};
|