@umituz/react-native-design-system 2.3.2 → 2.3.3
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 +1 -1
- package/src/{responsive → device/detection}/deviceDetection.ts +2 -2
- package/src/{responsive → device/detection}/iPadDetection.ts +1 -1
- package/src/{responsive → device/detection}/iPadLayoutUtils.ts +1 -1
- package/src/device/detection/index.ts +54 -0
- package/src/device/index.ts +59 -6
- package/src/responsive/gridUtils.ts +1 -1
- package/src/responsive/index.ts +28 -43
- package/src/responsive/responsive.ts +2 -2
- package/src/responsive/responsiveLayout.ts +1 -1
- package/src/responsive/responsiveModal.ts +1 -1
- package/src/responsive/responsiveSizing.ts +1 -1
- package/src/responsive/useResponsive.ts +1 -1
- /package/src/{responsive → device/detection}/iPadBreakpoints.ts +0 -0
- /package/src/{responsive → device/detection}/iPadModalUtils.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
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",
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { Dimensions } from 'react-native';
|
|
9
|
-
import { DEVICE_BREAKPOINTS, LAYOUT_CONSTANTS } from '
|
|
10
|
-
import { validateScreenDimensions } from '
|
|
9
|
+
import { DEVICE_BREAKPOINTS, LAYOUT_CONSTANTS } from '../../responsive/config';
|
|
10
|
+
import { validateScreenDimensions } from '../../responsive/validation';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Helper function for device detection with fallback
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device Detection Module - Public API
|
|
3
|
+
*
|
|
4
|
+
* Centralized device detection utilities including:
|
|
5
|
+
* - Device type detection (phone, tablet, iPad variants)
|
|
6
|
+
* - Screen dimension utilities
|
|
7
|
+
* - Layout utilities for different device types
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Breakpoints and constants
|
|
11
|
+
export {
|
|
12
|
+
IPAD_BREAKPOINTS,
|
|
13
|
+
TOUCH_TARGETS,
|
|
14
|
+
CONTENT_WIDTH_CONSTRAINTS,
|
|
15
|
+
IPAD_LAYOUT_CONFIG,
|
|
16
|
+
} from './iPadBreakpoints';
|
|
17
|
+
|
|
18
|
+
// Device type detection
|
|
19
|
+
export {
|
|
20
|
+
DeviceType,
|
|
21
|
+
getScreenDimensions,
|
|
22
|
+
isSmallPhone,
|
|
23
|
+
isTablet,
|
|
24
|
+
isLandscape,
|
|
25
|
+
getDeviceType,
|
|
26
|
+
getSpacingMultiplier,
|
|
27
|
+
} from './deviceDetection';
|
|
28
|
+
|
|
29
|
+
// iPad-specific detection
|
|
30
|
+
export {
|
|
31
|
+
isIPad,
|
|
32
|
+
isIPadMini,
|
|
33
|
+
isIPadPro,
|
|
34
|
+
isIPadLandscape,
|
|
35
|
+
} from './iPadDetection';
|
|
36
|
+
|
|
37
|
+
// iPad layout utilities
|
|
38
|
+
export {
|
|
39
|
+
getContentMaxWidth,
|
|
40
|
+
getIPadGridColumns,
|
|
41
|
+
getTouchTargetSize,
|
|
42
|
+
getIPadScreenPadding,
|
|
43
|
+
getIPadFontScale,
|
|
44
|
+
getIPadLayoutInfo,
|
|
45
|
+
type IPadLayoutInfo,
|
|
46
|
+
} from './iPadLayoutUtils';
|
|
47
|
+
|
|
48
|
+
// iPad modal utilities
|
|
49
|
+
export {
|
|
50
|
+
getIPadModalDimensions,
|
|
51
|
+
getPaywallDimensions,
|
|
52
|
+
type ModalDimensions,
|
|
53
|
+
type PaywallDimensions,
|
|
54
|
+
} from './iPadModalUtils';
|
package/src/device/index.ts
CHANGED
|
@@ -1,16 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Device Module - Public API
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Complete device utilities including:
|
|
5
|
+
* - Device detection (phone, tablet, iPad variants)
|
|
6
|
+
* - Device info and capabilities
|
|
7
|
+
* - Anonymous user management
|
|
6
8
|
*/
|
|
7
9
|
|
|
8
|
-
//
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// DETECTION - Device type and screen detection
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
// Breakpoints
|
|
16
|
+
IPAD_BREAKPOINTS,
|
|
17
|
+
TOUCH_TARGETS,
|
|
18
|
+
CONTENT_WIDTH_CONSTRAINTS,
|
|
19
|
+
IPAD_LAYOUT_CONFIG,
|
|
20
|
+
// Device type detection
|
|
21
|
+
DeviceType,
|
|
22
|
+
getScreenDimensions,
|
|
23
|
+
isSmallPhone,
|
|
24
|
+
isTablet,
|
|
25
|
+
isLandscape,
|
|
26
|
+
getDeviceType,
|
|
27
|
+
getSpacingMultiplier,
|
|
28
|
+
// iPad-specific detection
|
|
29
|
+
isIPad,
|
|
30
|
+
isIPadMini,
|
|
31
|
+
isIPadPro,
|
|
32
|
+
isIPadLandscape,
|
|
33
|
+
// iPad layout utilities
|
|
34
|
+
getContentMaxWidth,
|
|
35
|
+
getIPadGridColumns,
|
|
36
|
+
getTouchTargetSize,
|
|
37
|
+
getIPadScreenPadding,
|
|
38
|
+
getIPadFontScale,
|
|
39
|
+
getIPadLayoutInfo,
|
|
40
|
+
type IPadLayoutInfo,
|
|
41
|
+
// iPad modal utilities
|
|
42
|
+
getIPadModalDimensions,
|
|
43
|
+
getPaywallDimensions,
|
|
44
|
+
type ModalDimensions,
|
|
45
|
+
type PaywallDimensions,
|
|
46
|
+
} from './detection';
|
|
47
|
+
|
|
48
|
+
// ============================================================================
|
|
49
|
+
// DOMAIN - Device entities and utilities
|
|
50
|
+
// ============================================================================
|
|
51
|
+
|
|
9
52
|
export type {
|
|
10
53
|
DeviceInfo,
|
|
11
54
|
ApplicationInfo,
|
|
12
55
|
SystemInfo,
|
|
13
|
-
DeviceType,
|
|
56
|
+
DeviceType as DeviceInfoType,
|
|
14
57
|
} from './domain/entities/Device';
|
|
15
58
|
|
|
16
59
|
export {
|
|
@@ -21,13 +64,19 @@ export {
|
|
|
21
64
|
export { DeviceTypeUtils } from './domain/entities/DeviceTypeUtils';
|
|
22
65
|
export { DeviceMemoryUtils } from './domain/entities/DeviceMemoryUtils';
|
|
23
66
|
|
|
24
|
-
//
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// INFRASTRUCTURE - Device services
|
|
69
|
+
// ============================================================================
|
|
70
|
+
|
|
25
71
|
export { DeviceService } from './infrastructure/services/DeviceService';
|
|
26
72
|
export { UserFriendlyIdService } from './infrastructure/services/UserFriendlyIdService';
|
|
27
73
|
import { PersistentDeviceIdService } from './infrastructure/services/PersistentDeviceIdService';
|
|
28
74
|
export { PersistentDeviceIdService };
|
|
29
75
|
|
|
30
|
-
//
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// PRESENTATION - Device hooks
|
|
78
|
+
// ============================================================================
|
|
79
|
+
|
|
31
80
|
export {
|
|
32
81
|
useDeviceInfo,
|
|
33
82
|
useDeviceCapabilities,
|
|
@@ -43,6 +92,10 @@ export type {
|
|
|
43
92
|
UseAnonymousUserOptions,
|
|
44
93
|
} from './presentation/hooks/useAnonymousUser';
|
|
45
94
|
|
|
95
|
+
// ============================================================================
|
|
96
|
+
// UTILITIES
|
|
97
|
+
// ============================================================================
|
|
98
|
+
|
|
46
99
|
/**
|
|
47
100
|
* Get anonymous user ID for services
|
|
48
101
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Responsive grid sizing and column calculations
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getScreenDimensions } from '
|
|
6
|
+
import { getScreenDimensions } from '../device/detection';
|
|
7
7
|
import { DEVICE_BREAKPOINTS, GRID_CONFIG } from './config';
|
|
8
8
|
import { validateNumber } from './validation';
|
|
9
9
|
|
package/src/responsive/index.ts
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @umituz/react-native-design-system
|
|
2
|
+
* @umituz/react-native-design-system/responsive - Public API
|
|
3
3
|
*
|
|
4
|
-
* Responsive
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { useResponsive, isTablet, getResponsiveLogoSize } from '@umituz/react-native-design-system-responsive';
|
|
10
|
-
* ```
|
|
4
|
+
* Responsive sizing and layout utilities for React Native.
|
|
5
|
+
* For device detection, use '@umituz/react-native-design-system/device'.
|
|
11
6
|
*/
|
|
12
7
|
|
|
13
8
|
// Hook exports
|
|
14
9
|
export { useResponsive } from './useResponsive';
|
|
15
10
|
export type { UseResponsiveReturn } from './useResponsive';
|
|
16
11
|
|
|
17
|
-
//
|
|
12
|
+
// Responsive sizing utilities
|
|
18
13
|
export {
|
|
19
|
-
getScreenDimensions,
|
|
20
|
-
isSmallPhone,
|
|
21
|
-
isTablet,
|
|
22
14
|
getResponsiveLogoSize,
|
|
23
15
|
getResponsiveInputHeight,
|
|
24
16
|
getResponsiveHorizontalPadding,
|
|
@@ -43,41 +35,26 @@ export {
|
|
|
43
35
|
type GridCellSizeConfig,
|
|
44
36
|
getResponsiveMaxWidth,
|
|
45
37
|
getResponsiveFontSize,
|
|
46
|
-
isLandscape,
|
|
47
|
-
getDeviceType,
|
|
48
|
-
DeviceType,
|
|
49
38
|
MODAL_CONFIG,
|
|
50
39
|
} from './responsive';
|
|
51
40
|
|
|
52
|
-
//
|
|
53
|
-
export { getSpacingMultiplier } from './deviceDetection';
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Platform constants exports
|
|
58
|
-
export {
|
|
59
|
-
IOS_HIG,
|
|
60
|
-
PLATFORM_CONSTANTS,
|
|
61
|
-
isValidTouchTarget,
|
|
62
|
-
getMinTouchTarget,
|
|
63
|
-
} from './platformConstants';
|
|
64
|
-
|
|
65
|
-
// iPad-specific exports
|
|
66
|
-
export {
|
|
67
|
-
IPAD_BREAKPOINTS,
|
|
68
|
-
TOUCH_TARGETS,
|
|
69
|
-
CONTENT_WIDTH_CONSTRAINTS,
|
|
70
|
-
IPAD_LAYOUT_CONFIG,
|
|
71
|
-
} from './iPadBreakpoints';
|
|
72
|
-
|
|
41
|
+
// Re-export from device for backward compatibility
|
|
73
42
|
export {
|
|
43
|
+
DeviceType,
|
|
44
|
+
getScreenDimensions,
|
|
45
|
+
isSmallPhone,
|
|
46
|
+
isTablet,
|
|
47
|
+
isLandscape,
|
|
48
|
+
getDeviceType,
|
|
49
|
+
getSpacingMultiplier,
|
|
74
50
|
isIPad,
|
|
75
51
|
isIPadMini,
|
|
76
52
|
isIPadPro,
|
|
77
53
|
isIPadLandscape,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
IPAD_BREAKPOINTS,
|
|
55
|
+
TOUCH_TARGETS,
|
|
56
|
+
CONTENT_WIDTH_CONSTRAINTS,
|
|
57
|
+
IPAD_LAYOUT_CONFIG,
|
|
81
58
|
getContentMaxWidth,
|
|
82
59
|
getIPadGridColumns,
|
|
83
60
|
getTouchTargetSize,
|
|
@@ -85,11 +62,19 @@ export {
|
|
|
85
62
|
getIPadFontScale,
|
|
86
63
|
getIPadLayoutInfo,
|
|
87
64
|
type IPadLayoutInfo,
|
|
88
|
-
} from './iPadLayoutUtils';
|
|
89
|
-
|
|
90
|
-
export {
|
|
91
65
|
getIPadModalDimensions,
|
|
92
66
|
getPaywallDimensions,
|
|
93
67
|
type ModalDimensions,
|
|
94
68
|
type PaywallDimensions,
|
|
95
|
-
} from '
|
|
69
|
+
} from '../device/detection';
|
|
70
|
+
|
|
71
|
+
// Platform constants
|
|
72
|
+
export {
|
|
73
|
+
IOS_HIG,
|
|
74
|
+
PLATFORM_CONSTANTS,
|
|
75
|
+
isValidTouchTarget,
|
|
76
|
+
getMinTouchTarget,
|
|
77
|
+
} from './platformConstants';
|
|
78
|
+
|
|
79
|
+
// Config exports
|
|
80
|
+
export { DEVICE_BREAKPOINTS } from './config';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* This is the main export file that imports from specialized modules.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
// Device detection
|
|
10
|
+
// Device detection (re-exported from device module)
|
|
11
11
|
export {
|
|
12
12
|
getScreenDimensions,
|
|
13
13
|
isSmallPhone,
|
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
isLandscape,
|
|
16
16
|
getDeviceType,
|
|
17
17
|
DeviceType,
|
|
18
|
-
} from '
|
|
18
|
+
} from '../device/detection';
|
|
19
19
|
|
|
20
20
|
// Responsive sizing
|
|
21
21
|
export {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Layout utilities for positioning and spacing.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getScreenDimensions } from '
|
|
6
|
+
import { getScreenDimensions } from '../device/detection';
|
|
7
7
|
import { DEVICE_BREAKPOINTS, LAYOUT_CONSTANTS } from './config';
|
|
8
8
|
import { validateNumber, validateSafeAreaInsets } from './validation';
|
|
9
9
|
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
type ResponsiveBottomSheetLayout,
|
|
39
39
|
type ResponsiveDialogLayout,
|
|
40
40
|
} from './responsive';
|
|
41
|
-
import { getSpacingMultiplier } from '
|
|
41
|
+
import { getSpacingMultiplier } from '../device/detection';
|
|
42
42
|
|
|
43
43
|
export interface UseResponsiveReturn {
|
|
44
44
|
// Device info
|
|
File without changes
|
|
File without changes
|