@umituz/react-native-design-system 2.4.7 → 2.4.9

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.4.7",
3
+ "version": "2.4.9",
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",
@@ -24,7 +24,7 @@
24
24
 
25
25
  import React, { useEffect } from 'react';
26
26
  import { View, StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
27
- import {
27
+ import Animated, {
28
28
  useSharedValue,
29
29
  useAnimatedStyle,
30
30
  withRepeat,
@@ -32,11 +32,12 @@ import {
32
32
  withTiming,
33
33
  Easing,
34
34
  } from 'react-native-reanimated';
35
- import Animated from 'react-native-reanimated';
36
35
  import { useAppDesignTokens } from '../../theme';
37
36
  import type { SkeletonPattern, SkeletonConfig } from './AtomicSkeleton.types';
38
37
  import { SKELETON_PATTERNS } from './AtomicSkeleton.types';
39
38
 
39
+ const AnimatedView = (Animated as any).createAnimatedComponent(View);
40
+
40
41
  const SHIMMER_DURATION = 1200;
41
42
 
42
43
  export interface AtomicSkeletonProps {
@@ -90,7 +91,7 @@ const SkeletonItem: React.FC<{
90
91
  }));
91
92
 
92
93
  return (
93
- <Animated.View
94
+ <AnimatedView
94
95
  style={[
95
96
  styles.skeleton,
96
97
  {
@@ -2,18 +2,22 @@
2
2
  * Device Domain - Core Entities
3
3
  *
4
4
  * This file defines core types and interfaces for device information.
5
- * Handles device details, app info using expo-device and expo-application.
5
+ * All types are self-contained - no external dependencies for types.
6
6
  *
7
7
  * @domain device
8
8
  * @layer domain/entities
9
9
  */
10
10
 
11
- import type * as DeviceModule from 'expo-device';
12
-
13
11
  /**
14
- * Re-export Device types from expo-device
12
+ * Device type enumeration (matches expo-device values)
15
13
  */
16
- export type DeviceType = DeviceModule.DeviceType;
14
+ export enum DeviceType {
15
+ UNKNOWN = 0,
16
+ PHONE = 1,
17
+ TABLET = 2,
18
+ DESKTOP = 3,
19
+ TV = 4,
20
+ }
17
21
 
18
22
  /**
19
23
  * Device information interface
@@ -20,11 +20,14 @@ export class ApplicationInfoService {
20
20
  */
21
21
  static async getApplicationInfo(): Promise<ApplicationInfo> {
22
22
  try {
23
- const [installTime, lastUpdateTime] = await Promise.all([
24
- withTimeout(() => Application.getInstallationTimeAsync(), 1000),
25
- withTimeout(() => Application.getLastUpdateTimeAsync(), 1000),
23
+ const [installTimeResult, lastUpdateTimeResult] = await Promise.all([
24
+ withTimeout<Date>(() => Application.getInstallationTimeAsync(), 1000),
25
+ withTimeout<Date>(() => Application.getLastUpdateTimeAsync(), 1000),
26
26
  ]);
27
27
 
28
+ const installTime: Date | null = installTimeResult ?? null;
29
+ const lastUpdateTime: Date | null = lastUpdateTimeResult ?? null;
30
+
28
31
  const applicationName = safeAccess(() => Application.applicationName, 'Unknown');
29
32
  const applicationId = safeAccess(() => Application.applicationId, 'Unknown');
30
33
  const nativeApplicationVersion = safeAccess(
@@ -5,10 +5,9 @@
5
5
  * Follows SOLID principles - only handles capability checks
6
6
  */
7
7
 
8
- import * as Device from 'expo-device';
9
8
  import { Platform } from 'react-native';
9
+ import { DeviceType } from '../../domain/entities/Device';
10
10
  import { DeviceInfoService } from './DeviceInfoService';
11
- import { safeAccess } from '../utils/nativeModuleUtils';
12
11
 
13
12
  /**
14
13
  * Service for checking device capabilities
@@ -27,7 +26,7 @@ export class DeviceCapabilityService {
27
26
 
28
27
  return {
29
28
  isDevice: info.isDevice,
30
- isTablet: info.deviceType === Device.DeviceType.TABLET,
29
+ isTablet: info.deviceType === DeviceType.TABLET,
31
30
  hasNotch: await this.hasNotch(),
32
31
  totalMemoryGB: info.totalMemory
33
32
  ? info.totalMemory / (1024 * 1024 * 1024)
@@ -44,7 +43,8 @@ export class DeviceCapabilityService {
44
43
  return false;
45
44
  }
46
45
 
47
- const modelName = safeAccess(() => Device.modelName?.toLowerCase() || '', '');
46
+ const info = await DeviceInfoService.getDeviceInfo();
47
+ const modelName = info.modelName?.toLowerCase() ?? '';
48
48
 
49
49
  // iPhone X and newer (with notch or dynamic island)
50
50
  return (
@@ -21,10 +21,11 @@ export class DeviceInfoService {
21
21
  */
22
22
  static async getDeviceInfo(): Promise<DeviceInfo> {
23
23
  try {
24
- const totalMemory = await withTimeout(
24
+ const totalMemoryResult = await withTimeout<number>(
25
25
  () => Device.getMaxMemoryAsync(),
26
26
  1000,
27
27
  );
28
+ const totalMemory: number | null = totalMemoryResult ?? null;
28
29
 
29
30
  const brand = safeAccess(() => Device.brand, null);
30
31
  const manufacturer = safeAccess(() => Device.manufacturer, null);
package/src/index.ts CHANGED
@@ -192,6 +192,7 @@ export {
192
192
  AtomicDatePicker,
193
193
  AtomicSkeleton,
194
194
  AtomicBadge,
195
+ AtomicSpinner,
195
196
  type IconName,
196
197
  type IconSize,
197
198
  type IconColor,
@@ -224,6 +225,9 @@ export {
224
225
  type AtomicBadgeProps,
225
226
  type BadgeVariant,
226
227
  type BadgeSize,
228
+ type AtomicSpinnerProps,
229
+ type SpinnerSize,
230
+ type SpinnerColor,
227
231
  } from './atoms';
228
232
 
229
233
  // =============================================================================
@@ -11,6 +11,8 @@ import Animated, { useAnimatedStyle, withTiming } from 'react-native-reanimated'
11
11
  import { useFireworks } from '../hooks/useFireworks';
12
12
  import type { FireworksConfig } from '../../domain/entities/Fireworks';
13
13
 
14
+ const AnimatedView = (Animated as any).createAnimatedComponent(View);
15
+
14
16
  export interface FireworksProps extends FireworksConfig {
15
17
  /**
16
18
  * X position to trigger fireworks (0-1, relative to container width)
@@ -55,7 +57,7 @@ const Particle: React.FC<{
55
57
  opacity: withTiming(opacity, { duration: 100 }),
56
58
  }));
57
59
 
58
- return <Animated.View style={animatedStyle} />;
60
+ return <AnimatedView style={animatedStyle} />;
59
61
  };
60
62
 
61
63
  /**
@@ -79,9 +79,7 @@ export const BottomSheetModal = forwardRef<BottomSheetModalRef, BottomSheetModal
79
79
  useImperativeHandle(ref, () => ({
80
80
  present: () => {
81
81
  if (__DEV__) {
82
- // eslint-disable-next-line no-console
83
82
  console.log('[BottomSheetModal] present() called');
84
- // eslint-disable-next-line no-console
85
83
  console.log('[BottomSheetModal] modalRef.current:', modalRef.current);
86
84
  }
87
85
  modalRef.current?.present();