@umituz/react-native-design-system 4.25.84 → 4.25.85

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.25.84",
3
+ "version": "4.25.85",
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",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -60,6 +60,4 @@ export {
60
60
  useScreenWidth,
61
61
  useScreenHeight,
62
62
  useScreenDimensions,
63
- FALLBACK_SCREEN_WIDTH,
64
- FALLBACK_SCREEN_HEIGHT,
65
63
  } from './useScreenDimensions';
@@ -2,24 +2,18 @@
2
2
  * Screen dimension hooks — single source of truth for screen width/height.
3
3
  *
4
4
  * Always import from here instead of calling useWindowDimensions() inline
5
- * or Dimensions.get() at module level (which is static and never updates).
5
+ * or Dimensions.get() at module level (which is static and never updates on
6
+ * orientation change, iPad Split View, or Stage Manager).
6
7
  */
7
8
 
8
9
  import { useWindowDimensions } from 'react-native';
9
10
 
10
- /** Fallback width used when the native bridge hasn't reported dimensions yet. */
11
- export const FALLBACK_SCREEN_WIDTH = 375;
12
-
13
- /** Fallback height used when the native bridge hasn't reported dimensions yet. */
14
- export const FALLBACK_SCREEN_HEIGHT = 812;
15
-
16
11
  /**
17
12
  * Returns the current window width (reactive — updates on orientation change).
18
13
  * Use inside React components / hooks instead of Dimensions.get("window").width.
19
14
  */
20
15
  export function useScreenWidth(): number {
21
- const { width } = useWindowDimensions();
22
- return width > 0 ? width : FALLBACK_SCREEN_WIDTH;
16
+ return useWindowDimensions().width;
23
17
  }
24
18
 
25
19
  /**
@@ -27,8 +21,7 @@ export function useScreenWidth(): number {
27
21
  * Use inside React components / hooks instead of Dimensions.get("window").height.
28
22
  */
29
23
  export function useScreenHeight(): number {
30
- const { height } = useWindowDimensions();
31
- return height > 0 ? height : FALLBACK_SCREEN_HEIGHT;
24
+ return useWindowDimensions().height;
32
25
  }
33
26
 
34
27
  /**
@@ -37,8 +30,5 @@ export function useScreenHeight(): number {
37
30
  */
38
31
  export function useScreenDimensions(): { width: number; height: number } {
39
32
  const { width, height } = useWindowDimensions();
40
- return {
41
- width: width > 0 ? width : FALLBACK_SCREEN_WIDTH,
42
- height: height > 0 ? height : FALLBACK_SCREEN_HEIGHT,
43
- };
33
+ return { width, height };
44
34
  }