@umituz/react-native-design-system 2.6.73 → 2.6.75

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.73",
3
+ "version": "2.6.75",
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",
@@ -81,9 +81,6 @@
81
81
  "@react-navigation/native": {
82
82
  "optional": true
83
83
  },
84
- "expo-device": {
85
- "optional": true
86
- },
87
84
  "expo-application": {
88
85
  "optional": true
89
86
  }
@@ -4,8 +4,7 @@ import { useAppDesignTokens } from '../theme';
4
4
  import { getTextColor, type TextStyleVariant, type ColorVariant } from '../typography';
5
5
 
6
6
  export interface AtomicTextProps extends Omit<TextProps, 'style'> {
7
- /** Typographic style variant from tokens (alias for 'type') */
8
- variant?: TextStyleVariant;
7
+
9
8
 
10
9
  /** Typographic style variant from tokens */
11
10
  type?: TextStyleVariant;
@@ -43,7 +42,6 @@ export interface AtomicTextProps extends Omit<TextProps, 'style'> {
43
42
  * ✅ SOLID, DRY, KISS
44
43
  */
45
44
  export const AtomicText = ({
46
- variant,
47
45
  type = 'bodyMedium',
48
46
  color = 'textPrimary',
49
47
  align,
@@ -57,11 +55,8 @@ export const AtomicText = ({
57
55
  }: AtomicTextProps) => {
58
56
  const tokens = useAppDesignTokens();
59
57
 
60
- // Support both 'variant' and 'type' props for backward compatibility
61
- const textType = variant || type;
62
-
63
58
  // Get typography style from tokens
64
- const typographyStyle = tokens.typography[textType as keyof typeof tokens.typography] as TextStyle & { responsiveFontSize?: number };
59
+ const typographyStyle = tokens.typography[type] as TextStyle & { responsiveFontSize?: number };
65
60
 
66
61
  // Use responsive font size if available
67
62
  const fontSize = typographyStyle?.responsiveFontSize || typographyStyle?.fontSize;
@@ -9,7 +9,7 @@ export {
9
9
  type AtomicButtonProps,
10
10
  type ButtonVariant,
11
11
  type ButtonSize,
12
- } from './AtomicButton';
12
+ } from './button';
13
13
 
14
14
  // Text
15
15
  export { AtomicText, type AtomicTextProps } from './AtomicText';
@@ -11,37 +11,10 @@
11
11
  */
12
12
 
13
13
  import { Dimensions } from 'react-native';
14
+ import * as Device from 'expo-device';
14
15
  import { DEVICE_BREAKPOINTS, LAYOUT_CONSTANTS } from '../../responsive/config';
15
16
  import { validateScreenDimensions } from '../../responsive/validation';
16
17
 
17
- // Safely try to import expo-device
18
- let Device: any = null;
19
- let ExpoDeviceType: any = null;
20
-
21
- try {
22
- // eslint-disable-next-line @typescript-eslint/no-require-imports
23
- const ExpoDevice = require('expo-device');
24
- Device = ExpoDevice;
25
- ExpoDeviceType = ExpoDevice.DeviceType;
26
- } catch {
27
- // Fallback if expo-device is not available
28
- console.warn('[Design System] expo-device not found, using screen dimensions for device detection');
29
- }
30
-
31
- /**
32
- * Helper function for device detection with fallback
33
- */
34
- const withDeviceDetectionFallback = <T>(
35
- operation: () => T,
36
- fallback: T
37
- ): T => {
38
- try {
39
- return operation();
40
- } catch {
41
- return fallback;
42
- }
43
- };
44
-
45
18
  /**
46
19
  * Device type enum for conditional rendering
47
20
  * Used for fine-grained phone size distinctions
@@ -72,10 +45,7 @@ export const getScreenDimensions = () => {
72
45
  * Uses expo-device for accurate system-level detection
73
46
  */
74
47
  export const isTablet = (): boolean => {
75
- return withDeviceDetectionFallback(
76
- () => Device.deviceType === ExpoDeviceType.TABLET,
77
- false
78
- );
48
+ return Device.deviceType === Device.DeviceType.TABLET;
79
49
  };
80
50
 
81
51
  /**
@@ -83,10 +53,7 @@ export const isTablet = (): boolean => {
83
53
  * Uses expo-device for accurate system-level detection
84
54
  */
85
55
  export const isPhone = (): boolean => {
86
- return withDeviceDetectionFallback(
87
- () => Device.deviceType === ExpoDeviceType.PHONE,
88
- true
89
- );
56
+ return Device.deviceType === Device.DeviceType.PHONE;
90
57
  };
91
58
 
92
59
  /**
@@ -94,14 +61,9 @@ export const isPhone = (): boolean => {
94
61
  * Uses width breakpoint within phone category
95
62
  */
96
63
  export const isSmallPhone = (): boolean => {
97
- return withDeviceDetectionFallback(
98
- () => {
99
- if (!isPhone()) return false;
100
- const { width } = getScreenDimensions();
101
- return width <= DEVICE_BREAKPOINTS.SMALL_PHONE;
102
- },
103
- false
104
- );
64
+ if (!isPhone()) return false;
65
+ const { width } = getScreenDimensions();
66
+ return width <= DEVICE_BREAKPOINTS.SMALL_PHONE;
105
67
  };
106
68
 
107
69
  /**
@@ -109,27 +71,17 @@ export const isSmallPhone = (): boolean => {
109
71
  * Uses width breakpoint within phone category
110
72
  */
111
73
  export const isLargePhone = (): boolean => {
112
- return withDeviceDetectionFallback(
113
- () => {
114
- if (!isPhone()) return false;
115
- const { width } = getScreenDimensions();
116
- return width >= DEVICE_BREAKPOINTS.MEDIUM_PHONE;
117
- },
118
- false
119
- );
74
+ if (!isPhone()) return false;
75
+ const { width } = getScreenDimensions();
76
+ return width >= DEVICE_BREAKPOINTS.MEDIUM_PHONE;
120
77
  };
121
78
 
122
79
  /**
123
80
  * Check if device is in landscape mode
124
81
  */
125
82
  export const isLandscape = (): boolean => {
126
- return withDeviceDetectionFallback(
127
- () => {
128
- const { width, height } = getScreenDimensions();
129
- return width > height;
130
- },
131
- false
132
- );
83
+ const { width, height } = getScreenDimensions();
84
+ return width > height;
133
85
  };
134
86
 
135
87
  /**
@@ -137,44 +89,34 @@ export const isLandscape = (): boolean => {
137
89
  * Uses expo-device for PHONE vs TABLET, width for phone size variants
138
90
  */
139
91
  export const getDeviceType = (): DeviceType => {
140
- return withDeviceDetectionFallback(
141
- () => {
142
- // Use expo-device for primary detection
143
- if (isTablet()) {
144
- return DeviceType.TABLET;
145
- }
146
-
147
- // For phones, use width for size variants
148
- const { width } = getScreenDimensions();
149
-
150
- if (width <= DEVICE_BREAKPOINTS.SMALL_PHONE) {
151
- return DeviceType.SMALL_PHONE;
152
- } else if (width <= DEVICE_BREAKPOINTS.MEDIUM_PHONE) {
153
- return DeviceType.MEDIUM_PHONE;
154
- }
155
-
156
- return DeviceType.LARGE_PHONE;
157
- },
158
- DeviceType.MEDIUM_PHONE
159
- );
92
+ // Use expo-device for primary detection
93
+ if (isTablet()) {
94
+ return DeviceType.TABLET;
95
+ }
96
+
97
+ // For phones, use width for size variants
98
+ const { width } = getScreenDimensions();
99
+
100
+ if (width <= DEVICE_BREAKPOINTS.SMALL_PHONE) {
101
+ return DeviceType.SMALL_PHONE;
102
+ } else if (width <= DEVICE_BREAKPOINTS.MEDIUM_PHONE) {
103
+ return DeviceType.MEDIUM_PHONE;
104
+ }
105
+
106
+ return DeviceType.LARGE_PHONE;
160
107
  };
161
108
 
162
109
  /**
163
110
  * Responsive spacing multiplier based on device type
164
111
  */
165
112
  export const getSpacingMultiplier = (): number => {
166
- return withDeviceDetectionFallback(
167
- () => {
168
- if (isTablet()) {
169
- return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_TABLET;
170
- }
171
-
172
- if (isSmallPhone()) {
173
- return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_SMALL;
174
- }
175
-
176
- return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_STANDARD;
177
- },
178
- LAYOUT_CONSTANTS.SPACING_MULTIPLIER_STANDARD
179
- );
113
+ if (isTablet()) {
114
+ return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_TABLET;
115
+ }
116
+
117
+ if (isSmallPhone()) {
118
+ return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_SMALL;
119
+ }
120
+
121
+ return LAYOUT_CONSTANTS.SPACING_MULTIPLIER_STANDARD;
180
122
  };
@@ -31,7 +31,7 @@ export {
31
31
  // Bottom Sheet
32
32
  BottomSheet,
33
33
  BottomSheetModal,
34
- SafeBottomSheetModalProvider,
34
+
35
35
  FilterBottomSheet,
36
36
  FilterSheet,
37
37
  useBottomSheet,
@@ -1,6 +1,6 @@
1
1
  export * from './components/BottomSheet';
2
2
  export * from './components/BottomSheetModal';
3
- export * from './components/SafeBottomSheetModalProvider';
3
+
4
4
  export * from './components/filter/FilterBottomSheet';
5
5
  export * from './components/filter/FilterSheet';
6
6
  export * from './hooks/useBottomSheet';
@@ -7,7 +7,7 @@ import { useDesignSystemTheme } from '../globalThemeStore';
7
7
  import type { CustomThemeColors } from '../../core/CustomColors';
8
8
  import { SplashScreen } from '../../../molecules/splash';
9
9
  import type { SplashScreenProps } from '../../../molecules/splash/types';
10
- import { SafeBottomSheetModalProvider } from '../../../molecules/bottom-sheet';
10
+
11
11
 
12
12
  declare const __DEV__: boolean;
13
13
 
@@ -30,33 +30,7 @@ interface DesignSystemProviderProps {
30
30
 
31
31
  /**
32
32
  * DesignSystemProvider
33
- *
34
33
  * Initializes theme store and applies custom colors.
35
- * Wrap your app with this provider to enable design system features.
36
- *
37
- * Features:
38
- * - Auto-initializes theme from storage
39
- * - Supports custom color overrides
40
- * - Optional loading state
41
- * - Error handling
42
- * - GestureHandlerRootView integration
43
- * - BottomSheetModalProvider integration
44
- *
45
- * Usage:
46
- * ```tsx
47
- * import { DesignSystemProvider } from '@umituz/react-native-design-system';
48
- *
49
- * export default function App() {
50
- * return (
51
- * <DesignSystemProvider
52
- * customColors={{ primary: '#FF6B6B' }}
53
- * showLoadingIndicator
54
- * >
55
- * <YourApp />
56
- * </DesignSystemProvider>
57
- * );
58
- * }
59
- * ```
60
34
  */
61
35
  export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
62
36
  children,
@@ -163,9 +137,7 @@ export const DesignSystemProvider: React.FC<DesignSystemProviderProps> = ({
163
137
  return (
164
138
  <GestureHandlerRootView style={{ flex: 1 }}>
165
139
  <SafeAreaProvider initialMetrics={initialWindowMetrics}>
166
- <SafeBottomSheetModalProvider>
167
140
  {renderContent()}
168
- </SafeBottomSheetModalProvider>
169
141
  </SafeAreaProvider>
170
142
  </GestureHandlerRootView>
171
143
  );
@@ -1,7 +0,0 @@
1
- /**
2
- * AtomicButton - Re-export from button module
3
- * Maintains backward compatibility
4
- */
5
-
6
- export { AtomicButton } from './button';
7
- export type { AtomicButtonProps, ButtonVariant, ButtonSize } from './button';
@@ -1,15 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
-
3
- export interface SafeBottomSheetModalProviderProps {
4
- children: ReactNode;
5
- }
6
-
7
- /**
8
- * SafeBottomSheetModalProvider
9
- *
10
- * Simple wrapper for backward compatibility.
11
- * No longer uses @gorhom/bottom-sheet provider.
12
- */
13
- export const SafeBottomSheetModalProvider = ({ children }: SafeBottomSheetModalProviderProps) => {
14
- return <>{children}</>;
15
- };