@umituz/react-native-design-system 2.5.34 → 2.5.36

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.5.34",
3
+ "version": "2.5.36",
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",
@@ -10,9 +10,9 @@
10
10
  * ```
11
11
  */
12
12
 
13
- import { useCallback, useMemo } from 'react';
14
- import { useWindowDimensions } from 'react-native';
15
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
13
+ import { useCallback, useMemo } from "react";
14
+ import { useWindowDimensions } from "react-native";
15
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
16
16
  import {
17
17
  getResponsiveLogoSize,
18
18
  getResponsiveInputHeight,
@@ -33,7 +33,7 @@ import {
33
33
  type ResponsiveBottomSheetLayout,
34
34
  type ResponsiveDialogLayout,
35
35
  type ResponsiveTabBarConfig,
36
- } from './responsive';
36
+ } from "./responsive";
37
37
  import {
38
38
  isSmallPhone,
39
39
  isTablet,
@@ -41,8 +41,8 @@ import {
41
41
  getDeviceType,
42
42
  DeviceType,
43
43
  getSpacingMultiplier,
44
- } from '../device/detection';
45
- import { getMinTouchTarget } from './platformConstants';
44
+ } from "../device/detection";
45
+ import { getMinTouchTarget } from "./platformConstants";
46
46
 
47
47
  export interface UseResponsiveReturn {
48
48
  // Device info
@@ -84,8 +84,13 @@ export interface UseResponsiveReturn {
84
84
  bottomSheetLayout: ResponsiveBottomSheetLayout;
85
85
  dialogLayout: ResponsiveDialogLayout;
86
86
 
87
- // Tab bar configuration
88
- tabBarConfig: ResponsiveTabBarConfig;
87
+ // Onboarding specific responsive values
88
+ onboardingIconSize: number;
89
+ onboardingIconMarginTop: number;
90
+ onboardingIconMarginBottom: number;
91
+ onboardingTitleMarginBottom: number;
92
+ onboardingDescriptionMarginTop: number;
93
+ onboardingTextPadding: number;
89
94
 
90
95
  // Utility functions
91
96
  getLogoSize: (baseSize?: number) => number;
@@ -105,62 +110,87 @@ export const useResponsive = (): UseResponsiveReturn => {
105
110
  const insets = useSafeAreaInsets();
106
111
 
107
112
  // Memoize utility functions to prevent unnecessary re-renders
108
- const getLogoSize = useCallback((baseSize?: number) => getResponsiveLogoSize(baseSize), []);
109
- const getInputHeight = useCallback((baseHeight?: number) => getResponsiveInputHeight(baseHeight), []);
110
- const getIconSize = useCallback((baseSize?: number) => getResponsiveIconContainerSize(baseSize), []);
111
- const getMaxWidth = useCallback((baseWidth?: number) => getResponsiveMaxWidth(baseWidth), []);
112
- const getFontSize = useCallback((baseFontSize: number) => getResponsiveFontSize(baseFontSize), []);
113
- const getGridCols = useCallback((mobile?: number, tablet?: number) => getResponsiveGridColumns(mobile, tablet), []);
113
+ const getLogoSize = useCallback(
114
+ (baseSize?: number) => getResponsiveLogoSize(baseSize),
115
+ [],
116
+ );
117
+ const getInputHeight = useCallback(
118
+ (baseHeight?: number) => getResponsiveInputHeight(baseHeight),
119
+ [],
120
+ );
121
+ const getIconSize = useCallback(
122
+ (baseSize?: number) => getResponsiveIconContainerSize(baseSize),
123
+ [],
124
+ );
125
+ const getMaxWidth = useCallback(
126
+ (baseWidth?: number) => getResponsiveMaxWidth(baseWidth),
127
+ [],
128
+ );
129
+ const getFontSize = useCallback(
130
+ (baseFontSize: number) => getResponsiveFontSize(baseFontSize),
131
+ [],
132
+ );
133
+ const getGridCols = useCallback(
134
+ (mobile?: number, tablet?: number) =>
135
+ getResponsiveGridColumns(mobile, tablet),
136
+ [],
137
+ );
114
138
 
115
139
  // Memoize responsive values to prevent unnecessary recalculations
116
- const responsiveValues = useMemo(() => ({
117
- // Device info
118
- width,
119
- height,
120
- isSmallDevice: isSmallPhone(),
121
- isTabletDevice: isTablet(),
122
- isLandscapeDevice: isLandscape(),
123
- deviceType: getDeviceType(),
124
-
125
- // Safe area insets
126
- insets,
127
-
128
- // Responsive sizes (with default values)
129
- logoSize: getResponsiveLogoSize(),
130
- inputHeight: getResponsiveInputHeight(),
131
- iconContainerSize: getResponsiveIconContainerSize(),
132
- maxContentWidth: getResponsiveMaxWidth(),
133
- minTouchTarget: getMinTouchTarget(),
134
-
135
- // Responsive positioning
136
- horizontalPadding: getResponsiveHorizontalPadding(undefined, insets),
137
- bottomPosition: getResponsiveBottomPosition(undefined, insets),
138
- fabPosition: getResponsiveFABPosition(insets),
139
-
140
- // Responsive layout
141
- modalMaxHeight: getResponsiveModalMaxHeight(),
142
- modalMinHeight: getResponsiveMinModalHeight(),
143
- gridColumns: getResponsiveGridColumns(),
144
- spacingMultiplier: getSpacingMultiplier(),
145
-
146
- // Modal layouts (complete configurations)
147
- modalLayout: getResponsiveModalLayout(),
148
- bottomSheetLayout: getResponsiveBottomSheetLayout(),
149
- dialogLayout: getResponsiveDialogLayout(),
150
-
151
- // Tab bar configuration
152
- tabBarConfig: getResponsiveTabBarConfig(insets),
153
-
154
- // Utility functions (memoized)
155
- getLogoSize,
156
- getInputHeight,
157
- getIconSize,
158
- getMaxWidth,
159
- getFontSize,
160
- getGridCols,
161
- }), [width, height, insets]);
140
+ const responsiveValues = useMemo(
141
+ () => ({
142
+ // Device info
143
+ width,
144
+ height,
145
+ isSmallDevice: isSmallPhone(),
146
+ isTabletDevice: isTablet(),
147
+ isLandscapeDevice: isLandscape(),
148
+ deviceType: getDeviceType(),
149
+
150
+ // Safe area insets
151
+ insets,
152
+
153
+ // Responsive sizes (with default values)
154
+ logoSize: getResponsiveLogoSize(),
155
+ inputHeight: getResponsiveInputHeight(),
156
+ iconContainerSize: getResponsiveIconContainerSize(),
157
+ maxContentWidth: getResponsiveMaxWidth(),
158
+ minTouchTarget: getMinTouchTarget(),
159
+
160
+ // Responsive positioning
161
+ horizontalPadding: getResponsiveHorizontalPadding(undefined, insets),
162
+ bottomPosition: getResponsiveBottomPosition(undefined, insets),
163
+ fabPosition: getResponsiveFABPosition(insets),
164
+
165
+ // Responsive layout
166
+ modalMaxHeight: getResponsiveModalMaxHeight(),
167
+ modalMinHeight: getResponsiveMinModalHeight(),
168
+ gridColumns: getResponsiveGridColumns(),
169
+ spacingMultiplier: getSpacingMultiplier(),
170
+
171
+ // Modal layouts (complete configurations)
172
+ modalLayout: getResponsiveModalLayout(),
173
+ bottomSheetLayout: getResponsiveBottomSheetLayout(),
174
+ dialogLayout: getResponsiveDialogLayout(),
175
+
176
+ // Onboarding specific responsive values
177
+ onboardingIconSize: getIconSize(64),
178
+ onboardingIconMarginTop: getSpacingMultiplier() * 24,
179
+ onboardingIconMarginBottom: getSpacingMultiplier() * 16,
180
+ onboardingTitleMarginBottom: getSpacingMultiplier() * 16,
181
+ onboardingDescriptionMarginTop: getSpacingMultiplier() * 12,
182
+ onboardingTextPadding: getSpacingMultiplier() * 20,
183
+
184
+ // Utility functions
185
+ getLogoSize,
186
+ getInputHeight,
187
+ getIconSize,
188
+ getMaxWidth,
189
+ getFontSize,
190
+ getGridCols,
191
+ }),
192
+ [width, height, insets],
193
+ );
162
194
 
163
195
  return responsiveValues;
164
196
  };
165
-
166
-