@umituz/react-native-design-system 2.6.95 → 2.6.96
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.96",
|
|
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",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { AtomicText } from '../../../atoms';
|
|
4
|
+
import { AtomicIcon } from '../../../atoms';
|
|
5
|
+
import { useAppDesignTokens } from '../../../theme';
|
|
6
|
+
import { useSafeAreaInsets } from '../../../safe-area';
|
|
7
|
+
|
|
8
|
+
export interface NavigationHeaderProps {
|
|
9
|
+
title: string;
|
|
10
|
+
onBackPress?: () => void;
|
|
11
|
+
rightElement?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const NavigationHeader: React.FC<NavigationHeaderProps> = ({
|
|
15
|
+
title,
|
|
16
|
+
onBackPress,
|
|
17
|
+
rightElement,
|
|
18
|
+
}) => {
|
|
19
|
+
const tokens = useAppDesignTokens();
|
|
20
|
+
const insets = useSafeAreaInsets();
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
container: {
|
|
24
|
+
paddingTop: insets.top,
|
|
25
|
+
paddingHorizontal: tokens.spacing.md,
|
|
26
|
+
paddingBottom: tokens.spacing.sm,
|
|
27
|
+
backgroundColor: tokens.colors.backgroundPrimary,
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
borderBottomWidth: 1,
|
|
31
|
+
borderBottomColor: tokens.colors.outlineVariant,
|
|
32
|
+
zIndex: 100,
|
|
33
|
+
},
|
|
34
|
+
backButton: {
|
|
35
|
+
marginRight: tokens.spacing.md,
|
|
36
|
+
width: 40,
|
|
37
|
+
height: 40,
|
|
38
|
+
borderRadius: tokens.borders.radius.full,
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center',
|
|
41
|
+
backgroundColor: tokens.colors.surfaceVariant,
|
|
42
|
+
},
|
|
43
|
+
title: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
textAlign: 'left',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<View style={styles.container}>
|
|
51
|
+
{onBackPress && (
|
|
52
|
+
<TouchableOpacity onPress={onBackPress} style={styles.backButton}>
|
|
53
|
+
<AtomicIcon
|
|
54
|
+
name="arrow-back"
|
|
55
|
+
size="md"
|
|
56
|
+
color="textPrimary"
|
|
57
|
+
/>
|
|
58
|
+
</TouchableOpacity>
|
|
59
|
+
)}
|
|
60
|
+
|
|
61
|
+
<AtomicText
|
|
62
|
+
type="titleMedium"
|
|
63
|
+
color="textPrimary"
|
|
64
|
+
numberOfLines={1}
|
|
65
|
+
style={styles.title}
|
|
66
|
+
>
|
|
67
|
+
{title}
|
|
68
|
+
</AtomicText>
|
|
69
|
+
|
|
70
|
+
{rightElement && (
|
|
71
|
+
<View>
|
|
72
|
+
{rightElement}
|
|
73
|
+
</View>
|
|
74
|
+
)}
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
@@ -31,6 +31,7 @@ export type { StackNavigationOptions } from "@react-navigation/stack";
|
|
|
31
31
|
// Navigation Utilities
|
|
32
32
|
export { AppNavigation } from "./utils/AppNavigation";
|
|
33
33
|
export { TabLabel, type TabLabelProps } from "./components/TabLabel";
|
|
34
|
+
export * from './components/NavigationHeader';
|
|
34
35
|
export { useTabBarStyles, type TabBarConfig } from "./hooks/useTabBarStyles";
|
|
35
36
|
export { useTabConfig, type UseTabConfigProps } from "./hooks/useTabConfig";
|
|
36
37
|
|