@umituz/react-native-design-system 4.25.42 → 4.25.43
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.
|
|
3
|
+
"version": "4.25.43",
|
|
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",
|
|
@@ -12,21 +12,22 @@ import { AtomicKeyboardAvoidingView } from '../../atoms';
|
|
|
12
12
|
import { getScreenLayoutStyles } from './styles/screenLayoutStyles';
|
|
13
13
|
import type { ScreenLayoutProps } from './types';
|
|
14
14
|
|
|
15
|
-
export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
export const ScreenLayout: React.FC<ScreenLayoutProps> = (props: ScreenLayoutProps) => {
|
|
16
|
+
const {
|
|
17
|
+
children,
|
|
18
|
+
scrollable = true,
|
|
19
|
+
edges = ['top', 'bottom', 'left', 'right'],
|
|
20
|
+
header,
|
|
21
|
+
footer,
|
|
22
|
+
backgroundColor,
|
|
23
|
+
containerStyle,
|
|
24
|
+
contentContainerStyle,
|
|
25
|
+
testID,
|
|
26
|
+
hideScrollIndicator = false,
|
|
27
|
+
keyboardAvoiding = false,
|
|
28
|
+
maxWidth,
|
|
29
|
+
refreshControl,
|
|
30
|
+
} = props;
|
|
30
31
|
const tokens = useAppDesignTokens();
|
|
31
32
|
const insets = useSafeAreaInsets();
|
|
32
33
|
|
|
@@ -49,13 +50,30 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
|
49
50
|
|
|
50
51
|
const bgColor = backgroundColor || tokens.colors.backgroundPrimary;
|
|
51
52
|
|
|
53
|
+
// Robust safe area handling
|
|
54
|
+
const paddingTop = edges.includes('top') ? insets.top : 0;
|
|
55
|
+
const paddingBottom = edges.includes('bottom') ? insets.bottom : 0;
|
|
56
|
+
const paddingLeft = edges.includes('left') ? insets.left : 0;
|
|
57
|
+
const paddingRight = edges.includes('right') ? insets.right : 0;
|
|
58
|
+
|
|
52
59
|
const content = (
|
|
53
|
-
<View style={
|
|
60
|
+
<View style={[
|
|
61
|
+
styles.responsiveWrapper,
|
|
62
|
+
{
|
|
63
|
+
paddingTop,
|
|
64
|
+
paddingBottom: footer ? 0 : paddingBottom,
|
|
65
|
+
paddingLeft,
|
|
66
|
+
paddingRight,
|
|
67
|
+
}
|
|
68
|
+
]}>
|
|
54
69
|
{header}
|
|
55
70
|
{scrollable ? (
|
|
56
71
|
<ScrollView
|
|
57
72
|
style={styles.scrollView}
|
|
58
|
-
contentContainerStyle={[
|
|
73
|
+
contentContainerStyle={[
|
|
74
|
+
styles.scrollContent,
|
|
75
|
+
contentContainerStyle,
|
|
76
|
+
]}
|
|
59
77
|
showsVerticalScrollIndicator={!hideScrollIndicator}
|
|
60
78
|
keyboardShouldPersistTaps={keyboardAvoiding ? 'handled' : 'never'}
|
|
61
79
|
refreshControl={refreshControl}
|
|
@@ -67,14 +85,17 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
|
67
85
|
{children}
|
|
68
86
|
</View>
|
|
69
87
|
)}
|
|
70
|
-
{footer
|
|
88
|
+
{footer && (
|
|
89
|
+
<View style={{ paddingBottom }}>
|
|
90
|
+
{footer}
|
|
91
|
+
</View>
|
|
92
|
+
)}
|
|
71
93
|
</View>
|
|
72
94
|
);
|
|
73
95
|
|
|
74
96
|
return (
|
|
75
|
-
<
|
|
97
|
+
<View
|
|
76
98
|
style={[styles.container, { backgroundColor: bgColor }, containerStyle]}
|
|
77
|
-
edges={edges}
|
|
78
99
|
testID={testID}
|
|
79
100
|
>
|
|
80
101
|
{keyboardAvoiding ? (
|
|
@@ -86,7 +107,7 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
|
86
107
|
{content}
|
|
87
108
|
</View>
|
|
88
109
|
)}
|
|
89
|
-
</
|
|
110
|
+
</View>
|
|
90
111
|
);
|
|
91
112
|
};
|
|
92
113
|
|
|
@@ -25,7 +25,7 @@ export const getScreenLayoutStyles = (
|
|
|
25
25
|
responsiveWrapper: {
|
|
26
26
|
flex: 1,
|
|
27
27
|
width: '100%',
|
|
28
|
-
...(maxWidth ? { maxWidth, alignSelf: '
|
|
28
|
+
...(maxWidth ? { maxWidth, alignSelf: 'center' as const } : {}),
|
|
29
29
|
},
|
|
30
30
|
content: {
|
|
31
31
|
flex: 1,
|
|
@@ -27,8 +27,8 @@ export const getResponsiveVerticalPadding = (
|
|
|
27
27
|
// Apply spacing multiplier for consistency
|
|
28
28
|
const adjustedPadding = basePadding * spacingMultiplier;
|
|
29
29
|
|
|
30
|
-
//
|
|
31
|
-
return
|
|
30
|
+
// We now return the base padding; safe areas are handled by ScreenLayout
|
|
31
|
+
return adjustedPadding;
|
|
32
32
|
} catch {
|
|
33
33
|
return LAYOUT_CONSTANTS.VERTICAL_PADDING_STANDARD;
|
|
34
34
|
}
|