@umituz/react-native-design-system 2.6.11 → 2.6.12
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.12",
|
|
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",
|
|
@@ -28,8 +28,9 @@ import { View, ScrollView, StyleSheet, type ViewStyle, RefreshControlProps } fro
|
|
|
28
28
|
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
29
29
|
import type { Edge } from 'react-native-safe-area-context';
|
|
30
30
|
import { useAppDesignTokens } from '../../theme';
|
|
31
|
-
import { getResponsiveMaxWidth } from '../../responsive/responsiveSizing';
|
|
32
31
|
import { getResponsiveHorizontalPadding } from '../../responsive/responsiveLayout';
|
|
32
|
+
import { getScreenDimensions } from '../../device/detection';
|
|
33
|
+
import { DEVICE_BREAKPOINTS } from '../../responsive/config';
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* NOTE: This component now works in conjunction with the SafeAreaProvider
|
|
@@ -161,8 +162,11 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
|
161
162
|
// Automatically uses current theme from global store
|
|
162
163
|
const tokens = useAppDesignTokens();
|
|
163
164
|
const insets = useSafeAreaInsets();
|
|
165
|
+
const { width: screenWidth } = getScreenDimensions();
|
|
166
|
+
const isTablet = screenWidth >= DEVICE_BREAKPOINTS.SMALL_TABLET;
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
// Only apply maxWidth for tablets - phones should fill full width
|
|
169
|
+
const finalMaxWidth = maxWidth || (responsiveEnabled && isTablet ? 600 : undefined);
|
|
166
170
|
const horizontalPadding = responsiveEnabled ? getResponsiveHorizontalPadding(tokens.spacing.md, insets) : tokens.spacing.md;
|
|
167
171
|
|
|
168
172
|
const styles = useMemo(() => StyleSheet.create({
|
|
@@ -172,8 +176,7 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
|
|
|
172
176
|
responsiveWrapper: {
|
|
173
177
|
flex: 1,
|
|
174
178
|
width: '100%',
|
|
175
|
-
maxWidth: finalMaxWidth,
|
|
176
|
-
alignSelf: 'flex-start',
|
|
179
|
+
...(finalMaxWidth ? { maxWidth: finalMaxWidth, alignSelf: 'center' as const } : {}),
|
|
177
180
|
},
|
|
178
181
|
content: {
|
|
179
182
|
flex: 1,
|