@umituz/react-native-design-system 4.27.25 → 4.27.27

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.27.25",
3
+ "version": "4.27.27",
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 - TanStack persistence and expo-image-manipulator now lazy loaded",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -56,10 +56,14 @@ export function getIPadScreenPadding(): number {
56
56
 
57
57
  /**
58
58
  * Get font scale for iPad
59
+ * Optimized for readability - Apple HIG recommends slightly larger fonts on iPad
60
+ * but not too large to avoid crowding
59
61
  */
60
62
  export function getIPadFontScale(): number {
61
- if (isIPadPro()) return 1.15;
62
- if (isIPad()) return IPAD_LAYOUT_CONFIG.FONT_SCALE;
63
+ // iPad Pro: Slightly larger fonts for larger screen
64
+ if (isIPadPro()) return 1.08;
65
+ // Standard iPad: Minimal scale to avoid crowding
66
+ if (isIPad()) return 1.03;
63
67
  return 1.0;
64
68
  }
65
69
 
@@ -65,7 +65,7 @@ export const SIZE_CONSTRAINTS = {
65
65
  ICON_MAX_TABLET: 180, // Maximum icon container for tablets
66
66
 
67
67
  // Content width constraints
68
- CONTENT_MAX_TABLET: 600, // Maximum content width for tablets
68
+ CONTENT_MAX_TABLET: 672, // Maximum content width for tablets (Apple HIG readable width)
69
69
 
70
70
  // Modal height constraints
71
71
  MODAL_MIN_SMALL: 250, // Minimum modal height for small devices
@@ -16,6 +16,8 @@ const TAB_BAR_CONSTANTS = {
16
16
  FAB_SIZE_TABLET: 72,
17
17
  FAB_OFFSET_Y_PHONE: -24,
18
18
  FAB_OFFSET_Y_TABLET: -28,
19
+ // iPad Home Indicator padding (iPadOS 15+)
20
+ HOME_INDICATOR_PADDING: 6,
19
21
  } as const;
20
22
 
21
23
  export interface ResponsiveTabBarConfig {
@@ -39,7 +41,9 @@ export const getResponsiveTabBarHeight = (
39
41
  ? TAB_BAR_CONSTANTS.BASE_HEIGHT_TABLET
40
42
  : TAB_BAR_CONSTANTS.BASE_HEIGHT_PHONE;
41
43
 
42
- const bottomPadding = Math.max(bottom, TAB_BAR_CONSTANTS.MIN_PADDING_BOTTOM);
44
+ // iPad: Add extra padding for home indicator (iPadOS 15+)
45
+ const extraPadding = isTabletDevice ? TAB_BAR_CONSTANTS.HOME_INDICATOR_PADDING : 0;
46
+ const bottomPadding = Math.max(bottom, TAB_BAR_CONSTANTS.MIN_PADDING_BOTTOM) + extraPadding;
43
47
 
44
48
  return baseHeight + bottomPadding;
45
49
  } catch {
@@ -59,7 +63,9 @@ export const getResponsiveTabBarConfig = (
59
63
  ? TAB_BAR_CONSTANTS.BASE_HEIGHT_TABLET
60
64
  : TAB_BAR_CONSTANTS.BASE_HEIGHT_PHONE;
61
65
 
62
- const paddingBottom = Math.max(bottom, TAB_BAR_CONSTANTS.MIN_PADDING_BOTTOM);
66
+ // iPad: Add extra padding for home indicator (iPadOS 15+)
67
+ const extraPadding = isTabletSize ? TAB_BAR_CONSTANTS.HOME_INDICATOR_PADDING : 0;
68
+ const paddingBottom = Math.max(bottom, TAB_BAR_CONSTANTS.MIN_PADDING_BOTTOM) + extraPadding;
63
69
 
64
70
  return {
65
71
  height: baseHeight + paddingBottom,
@@ -127,6 +127,27 @@ export {
127
127
  export { storageService } from './infrastructure/adapters/StorageService';
128
128
  export type { StateStorage } from './domain/types/Store';
129
129
 
130
+ // =============================================================================
131
+ // ZUSTAND STORAGE - Sync API for Zustand persist middleware
132
+ // =============================================================================
133
+
134
+ /**
135
+ * Zustand-compatible storage export
136
+ *
137
+ * AsyncStorage natively provides the Promise-based API that Zustand persist expects.
138
+ * This is a centralized export for all Zustand stores to use.
139
+ *
140
+ * @example
141
+ * import { createStore, zustandStorage } from '@umituz/react-native-design-system/storage';
142
+ *
143
+ * createStore({
144
+ * persist: true,
145
+ * storage: zustandStorage,
146
+ * ...
147
+ * });
148
+ */
149
+ export { zustandStorage } from './infrastructure/adapters/ZustandStorageAdapter';
150
+
130
151
  // =============================================================================
131
152
  // PRESENTATION LAYER - Hooks
132
153
  // =============================================================================
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Zustand Storage Adapter
3
+ *
4
+ * Provides AsyncStorage in a format compatible with Zustand persist middleware.
5
+ *
6
+ * AsyncStorage natively supports the Promise-based API that Zustand expects:
7
+ * - getItem: (key: string) => Promise<string | null>
8
+ * - setItem: (key: string, value: string) => Promise<void>
9
+ * - removeItem: (key: string) => Promise<void>
10
+ *
11
+ * This is a centralized export point for Zustand stores throughout the app.
12
+ *
13
+ * @example
14
+ * import { createStore, zustandStorage } from '@umituz/react-native-design-system/storage';
15
+ *
16
+ * const store = createStore({
17
+ * persist: true,
18
+ * storage: zustandStorage,
19
+ * ...
20
+ * });
21
+ */
22
+
23
+ import AsyncStorage from '@react-native-async-storage/async-storage';
24
+
25
+ /**
26
+ * Zustand-compatible storage export
27
+ *
28
+ * AsyncStorage instance that can be used directly with Zustand's persist middleware.
29
+ * No wrapping needed - AsyncStorage already provides the correct interface.
30
+ */
31
+ export const zustandStorage = AsyncStorage;