@umituz/react-native-design-system 4.25.88 → 4.25.89
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.
|
|
3
|
+
"version": "4.25.89",
|
|
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": "./dist/index.d.ts",
|
|
@@ -28,7 +28,8 @@ export interface ComputedResponsivePositioning {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export const computeResponsivePositioning = (
|
|
31
|
-
insets: { top: number; bottom: number; left: number; right: number }
|
|
31
|
+
insets: { top: number; bottom: number; left: number; right: number },
|
|
32
|
+
dimensions?: { width: number; height: number }
|
|
32
33
|
): ComputedResponsivePositioning => ({
|
|
33
34
|
horizontalPadding: getResponsiveHorizontalPadding(undefined, insets),
|
|
34
35
|
verticalPadding: getResponsiveVerticalPadding(insets),
|
|
@@ -36,7 +37,7 @@ export const computeResponsivePositioning = (
|
|
|
36
37
|
fabPosition: getResponsiveFABPosition(insets),
|
|
37
38
|
screenLayoutConfig: getScreenLayoutConfig(insets),
|
|
38
39
|
tabBarConfig: getResponsiveTabBarConfig(insets),
|
|
39
|
-
modalLayout: getResponsiveModalLayout(),
|
|
40
|
-
bottomSheetLayout: getResponsiveBottomSheetLayout(),
|
|
41
|
-
dialogLayout: getResponsiveDialogLayout(),
|
|
40
|
+
modalLayout: getResponsiveModalLayout(dimensions),
|
|
41
|
+
bottomSheetLayout: getResponsiveBottomSheetLayout(dimensions),
|
|
42
|
+
dialogLayout: getResponsiveDialogLayout(dimensions),
|
|
42
43
|
});
|
|
@@ -70,9 +70,9 @@ export const getResponsiveMinModalHeight = (dimensions?: { height: number }): nu
|
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
export const getResponsiveModalWidth = (): number => {
|
|
73
|
+
export const getResponsiveModalWidth = (dimensions?: { width: number }): number => {
|
|
74
74
|
try {
|
|
75
|
-
const { width } = getScreenDimensions();
|
|
75
|
+
const { width } = dimensions || getScreenDimensions();
|
|
76
76
|
const isTabletDevice = isTablet();
|
|
77
77
|
|
|
78
78
|
const widthPercent = isTabletDevice
|
|
@@ -89,9 +89,9 @@ export const getResponsiveModalWidth = (): number => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
export const getResponsiveModalHeight = (): number => {
|
|
92
|
+
export const getResponsiveModalHeight = (dimensions?: { height: number }): number => {
|
|
93
93
|
try {
|
|
94
|
-
const { height } = getScreenDimensions();
|
|
94
|
+
const { height } = dimensions || getScreenDimensions();
|
|
95
95
|
const isTabletDevice = isTablet();
|
|
96
96
|
|
|
97
97
|
if (isTabletDevice) {
|
|
@@ -136,12 +136,12 @@ export const getResponsiveBackdropOpacity = (): number => {
|
|
|
136
136
|
return MODAL_CONFIG.BACKDROP_OPACITY_DEFAULT;
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
export const getResponsiveModalLayout = (): ResponsiveModalLayout => {
|
|
139
|
+
export const getResponsiveModalLayout = (dimensions?: { width: number; height: number }): ResponsiveModalLayout => {
|
|
140
140
|
const isTabletDevice = isTablet();
|
|
141
141
|
|
|
142
142
|
return {
|
|
143
|
-
width: getResponsiveModalWidth(),
|
|
144
|
-
height: getResponsiveModalHeight(),
|
|
143
|
+
width: getResponsiveModalWidth(dimensions),
|
|
144
|
+
height: getResponsiveModalHeight(dimensions),
|
|
145
145
|
maxWidth: getResponsiveModalMaxWidth(),
|
|
146
146
|
borderRadius: getResponsiveModalBorderRadius(),
|
|
147
147
|
backdropOpacity: getResponsiveBackdropOpacity(),
|
|
@@ -151,8 +151,8 @@ export const getResponsiveModalLayout = (): ResponsiveModalLayout => {
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
export const getResponsiveBottomSheetLayout = (): ResponsiveBottomSheetLayout => {
|
|
155
|
-
const { height } = getScreenDimensions();
|
|
154
|
+
export const getResponsiveBottomSheetLayout = (dimensions?: { width: number; height: number }): ResponsiveBottomSheetLayout => {
|
|
155
|
+
const { height } = dimensions || getScreenDimensions();
|
|
156
156
|
|
|
157
157
|
return {
|
|
158
158
|
minHeight: MODAL_CONFIG.BOTTOM_SHEET_MIN_HEIGHT,
|
|
@@ -161,8 +161,8 @@ export const getResponsiveBottomSheetLayout = (): ResponsiveBottomSheetLayout =>
|
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
export const getResponsiveDialogLayout = (): ResponsiveDialogLayout => {
|
|
165
|
-
const { width, height } = getScreenDimensions();
|
|
164
|
+
export const getResponsiveDialogLayout = (dimensions?: { width: number; height: number }): ResponsiveDialogLayout => {
|
|
165
|
+
const { width, height } = dimensions || getScreenDimensions();
|
|
166
166
|
|
|
167
167
|
return {
|
|
168
168
|
width: Math.min(
|
|
@@ -59,7 +59,7 @@ export const useResponsive = (): UseResponsiveReturn => {
|
|
|
59
59
|
const dimensions = { width, height };
|
|
60
60
|
const deviceInfo = computeDeviceInfo(dimensions);
|
|
61
61
|
const sizes = computeResponsiveSizes(dimensions);
|
|
62
|
-
const positioning = computeResponsivePositioning(insets);
|
|
62
|
+
const positioning = computeResponsivePositioning(insets, dimensions);
|
|
63
63
|
const onboarding = computeOnboardingSizes(deviceInfo);
|
|
64
64
|
const iPadLayout = deviceInfo.isTabletDevice ? getIPadLayoutInfo() : null;
|
|
65
65
|
|