@umituz/react-native-design-system 4.28.21 → 4.28.22

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.28.21",
3
+ "version": "4.28.22",
4
4
  "description": "Universal design system for React Native apps with safe navigation hooks - updated SKILL.md with navigation documentation",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./dist/index.d.ts",
@@ -62,11 +62,12 @@ export const AtomicFab: React.FC<AtomicFabProps> = ({
62
62
  const iconSize = useMemo(() => getFabIconSize(size as 'sm' | 'md' | 'lg') * tokens.spacingMultiplier, [size, tokens.spacingMultiplier]);
63
63
 
64
64
  const fabStyle = useMemo(() => {
65
- const baseSizeConfig = FAB_SIZES[size as 'sm' | 'md' | 'lg'];
65
+ const baseSize = FAB_SIZES[size as 'sm' | 'md' | 'lg'];
66
+ const borderRadius = size === 'sm' ? 12 : size === 'md' ? 16 : 20;
66
67
  const sizeConfig = {
67
- width: baseSizeConfig.width * tokens.spacingMultiplier,
68
- height: baseSizeConfig.height * tokens.spacingMultiplier,
69
- borderRadius: baseSizeConfig.borderRadius * tokens.spacingMultiplier,
68
+ width: baseSize * tokens.spacingMultiplier,
69
+ height: baseSize * tokens.spacingMultiplier,
70
+ borderRadius: borderRadius * tokens.spacingMultiplier,
70
71
  };
71
72
 
72
73
  return StyleSheet.flatten([
@@ -10,6 +10,9 @@ import type { FabSizeConfig, FabVariantConfig } from '../types';
10
10
  import { FAB_SIZES as BASE_FAB_SIZES } from '../../../constants';
11
11
  import { calculateResponsiveSize } from '../../../responsive';
12
12
 
13
+ // Re-export FAB_SIZES for convenience
14
+ export const FAB_SIZES = BASE_FAB_SIZES;
15
+
13
16
  /**
14
17
  * Get responsive FAB sizes based on spacing multiplier
15
18
  * @param spacingMultiplier - Spacing multiplier from design tokens
@@ -1,9 +1,34 @@
1
1
  /**
2
2
  * useSafeAreaInsets Hook
3
- * Get safe area insets
3
+ * Get safe area insets with fallback for race conditions
4
+ *
5
+ * This wrapper catches the case where the hook is called before
6
+ * SafeAreaProvider is fully initialized, returning safe default values
7
+ * instead of throwing an error.
4
8
  */
5
9
 
6
10
  import { useSafeAreaInsets as useNativeSafeAreaInsets } from 'react-native-safe-area-context';
11
+ import type { EdgeInsets } from 'react-native-safe-area-context';
7
12
 
8
- export const useSafeAreaInsets = useNativeSafeAreaInsets;
13
+ const DEFAULT_INSETS: EdgeInsets = {
14
+ top: 0,
15
+ right: 0,
16
+ bottom: 0,
17
+ left: 0,
18
+ };
19
+
20
+ export const useSafeAreaInsets = (): EdgeInsets => {
21
+ try {
22
+ return useNativeSafeAreaInsets();
23
+ } catch (error) {
24
+ // Log in development only to help debugging
25
+ if (__DEV__) {
26
+ console.warn(
27
+ '[useSafeAreaInsets] SafeAreaProvider not available yet. Using default values (all zeros). ' +
28
+ 'This is likely due to a timing issue during initialization and should resolve quickly.'
29
+ );
30
+ }
31
+ return DEFAULT_INSETS;
32
+ }
33
+ };
9
34