@umituz/react-native-design-system 2.6.61 → 2.6.64
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/atoms/AtomicButton.tsx +6 -257
- package/src/atoms/AtomicChip.tsx +4 -224
- package/src/atoms/AtomicIcon.tsx +2 -6
- package/src/atoms/AtomicIcon.types.ts +5 -0
- package/src/atoms/AtomicInput.tsx +34 -154
- package/src/atoms/AtomicPicker.tsx +31 -123
- package/src/atoms/button/AtomicButton.tsx +108 -0
- package/src/atoms/button/configs/buttonSizeConfig.ts +37 -0
- package/src/atoms/button/index.ts +6 -0
- package/src/atoms/button/styles/buttonStyles.ts +36 -0
- package/src/atoms/button/styles/buttonVariantStyles.ts +88 -0
- package/src/atoms/button/types/index.ts +40 -0
- package/src/atoms/chip/AtomicChip.tsx +112 -0
- package/src/atoms/chip/configs/chipColorConfig.ts +47 -0
- package/src/atoms/chip/configs/chipSizeConfig.ts +34 -0
- package/src/atoms/chip/index.ts +6 -0
- package/src/atoms/chip/styles/chipStyles.ts +28 -0
- package/src/atoms/chip/types/index.ts +42 -0
- package/src/atoms/index.ts +6 -4
- package/src/atoms/input/components/InputHelper.tsx +49 -0
- package/src/atoms/input/components/InputIcon.tsx +44 -0
- package/src/atoms/input/components/InputLabel.tsx +20 -0
- package/src/atoms/input/styles/inputStylesHelper.ts +1 -1
- package/src/atoms/input/types.ts +72 -0
- package/src/atoms/picker/hooks/usePickerState.ts +139 -0
- package/src/exports/atoms.ts +69 -0
- package/src/exports/device.ts +58 -0
- package/src/exports/layouts.ts +19 -0
- package/src/exports/molecules.ts +166 -0
- package/src/exports/organisms.ts +9 -0
- package/src/exports/responsive.ts +36 -0
- package/src/exports/safe-area.ts +6 -0
- package/src/exports/theme.ts +47 -0
- package/src/exports/typography.ts +22 -0
- package/src/exports/utilities.ts +6 -0
- package/src/exports/variants.ts +22 -0
- package/src/index.ts +11 -417
- package/src/layouts/ScreenLayout/ScreenLayout.tsx +17 -181
- package/src/layouts/ScreenLayout/components/ContentWrapper.tsx +31 -0
- package/src/layouts/ScreenLayout/components/index.ts +6 -0
- package/src/layouts/ScreenLayout/styles/screenLayoutStyles.ts +47 -0
- package/src/layouts/ScreenLayout/types/index.ts +27 -0
- package/src/molecules/avatar/Avatar.constants.ts +103 -0
- package/src/molecules/avatar/Avatar.types.ts +64 -0
- package/src/molecules/avatar/Avatar.utils.ts +8 -160
- package/src/molecules/calendar/index.ts +4 -9
- package/src/molecules/calendar/infrastructure/storage/CalendarStore.ts +103 -302
- package/src/molecules/calendar/infrastructure/storage/CalendarStore.ts.bak +116 -0
- package/src/molecules/calendar/infrastructure/storage/CalendarStore.types.ts +64 -0
- package/src/molecules/calendar/infrastructure/storage/CalendarStore.utils.ts +56 -0
- package/src/molecules/calendar/infrastructure/storage/EventActions.ts +140 -0
- package/src/molecules/calendar/infrastructure/storage/NavigationActions.ts +118 -0
- package/src/molecules/calendar/infrastructure/stores/storageAdapter.ts +34 -0
- package/src/molecules/calendar/infrastructure/stores/useCalendarEvents.ts +168 -0
- package/src/molecules/calendar/infrastructure/stores/useCalendarNavigation.ts +47 -0
- package/src/molecules/calendar/infrastructure/stores/useCalendarView.ts +24 -0
- package/src/molecules/calendar/presentation/hooks/useCalendar.ts +7 -11
- package/src/responsive/compute/computeDeviceInfo.ts +22 -0
- package/src/responsive/compute/computeResponsivePositioning.ts +42 -0
- package/src/responsive/compute/computeResponsiveSizes.ts +48 -0
- package/src/responsive/padding/paddingUtils.ts +65 -0
- package/src/responsive/positioning/positioningUtils.ts +61 -0
- package/src/responsive/responsiveLayout.ts +11 -264
- package/src/responsive/screen/screenLayoutConfig.ts +38 -0
- package/src/responsive/tabbar/tabBarConfig.ts +88 -0
- package/src/responsive/types/responsiveTypes.ts +69 -0
- package/src/responsive/useResponsive.ts +69 -158
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* useResponsive Hook
|
|
3
|
-
*
|
|
4
|
-
* React Hook for accessing responsive utilities with real-time dimension updates
|
|
5
|
-
* and safe area insets integration.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* ```tsx
|
|
9
|
-
* const { logoSize, inputHeight, fabPosition, isSmallDevice } = useResponsive();
|
|
10
|
-
* ```
|
|
3
|
+
* Refactored: Extracted compute functions
|
|
11
4
|
*/
|
|
12
5
|
|
|
13
6
|
import { useCallback, useMemo } from "react";
|
|
@@ -16,108 +9,21 @@ import { useSafeAreaInsets } from "../safe-area";
|
|
|
16
9
|
import {
|
|
17
10
|
getResponsiveLogoSize,
|
|
18
11
|
getResponsiveInputHeight,
|
|
19
|
-
getResponsiveHorizontalPadding,
|
|
20
|
-
getResponsiveVerticalPadding,
|
|
21
|
-
getScreenLayoutConfig,
|
|
22
|
-
getResponsiveBottomPosition,
|
|
23
|
-
getResponsiveFABPosition,
|
|
24
|
-
getResponsiveTabBarConfig,
|
|
25
|
-
getResponsiveModalMaxHeight,
|
|
26
|
-
getResponsiveMinModalHeight,
|
|
27
|
-
getResponsiveModalLayout,
|
|
28
|
-
getResponsiveBottomSheetLayout,
|
|
29
|
-
getResponsiveDialogLayout,
|
|
30
12
|
getResponsiveIconContainerSize,
|
|
31
|
-
getResponsiveGridColumns,
|
|
32
13
|
getResponsiveMaxWidth,
|
|
33
14
|
getResponsiveFontSize,
|
|
34
|
-
|
|
35
|
-
type ResponsiveBottomSheetLayout,
|
|
36
|
-
type ResponsiveDialogLayout,
|
|
37
|
-
type ResponsiveTabBarConfig,
|
|
38
|
-
type ScreenLayoutConfig,
|
|
15
|
+
getResponsiveGridColumns,
|
|
39
16
|
} from "./responsive";
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
getDeviceType,
|
|
45
|
-
DeviceType,
|
|
46
|
-
getSpacingMultiplier,
|
|
47
|
-
} from "../device/detection";
|
|
48
|
-
import { getMinTouchTarget } from "./platformConstants";
|
|
49
|
-
|
|
50
|
-
export interface UseResponsiveReturn {
|
|
51
|
-
// Device info
|
|
52
|
-
width: number;
|
|
53
|
-
height: number;
|
|
54
|
-
isSmallDevice: boolean;
|
|
55
|
-
isTabletDevice: boolean;
|
|
56
|
-
isLandscapeDevice: boolean;
|
|
57
|
-
deviceType: DeviceType;
|
|
58
|
-
|
|
59
|
-
// Safe area insets
|
|
60
|
-
insets: {
|
|
61
|
-
top: number;
|
|
62
|
-
bottom: number;
|
|
63
|
-
left: number;
|
|
64
|
-
right: number;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Responsive sizes
|
|
68
|
-
logoSize: number;
|
|
69
|
-
inputHeight: number;
|
|
70
|
-
iconContainerSize: number;
|
|
71
|
-
maxContentWidth: number;
|
|
72
|
-
minTouchTarget: number;
|
|
73
|
-
|
|
74
|
-
// Responsive positioning
|
|
75
|
-
horizontalPadding: number;
|
|
76
|
-
verticalPadding: number;
|
|
77
|
-
bottomPosition: number;
|
|
78
|
-
fabPosition: { bottom: number; right: number };
|
|
79
|
-
|
|
80
|
-
// Screen layout config (complete configuration for ScreenLayout)
|
|
81
|
-
screenLayoutConfig: ScreenLayoutConfig;
|
|
82
|
-
|
|
83
|
-
// Responsive layout
|
|
84
|
-
modalMaxHeight: string;
|
|
85
|
-
modalMinHeight: number;
|
|
86
|
-
gridColumns: number;
|
|
87
|
-
spacingMultiplier: number;
|
|
88
|
-
tabBarConfig: ResponsiveTabBarConfig;
|
|
89
|
-
|
|
90
|
-
// Modal layouts (complete configurations)
|
|
91
|
-
modalLayout: ResponsiveModalLayout;
|
|
92
|
-
bottomSheetLayout: ResponsiveBottomSheetLayout;
|
|
93
|
-
dialogLayout: ResponsiveDialogLayout;
|
|
94
|
-
|
|
95
|
-
// Onboarding specific responsive values
|
|
96
|
-
onboardingIconSize: number;
|
|
97
|
-
onboardingIconMarginTop: number;
|
|
98
|
-
onboardingIconMarginBottom: number;
|
|
99
|
-
onboardingTitleMarginBottom: number;
|
|
100
|
-
onboardingDescriptionMarginTop: number;
|
|
101
|
-
onboardingTextPadding: number;
|
|
102
|
-
|
|
103
|
-
// Utility functions
|
|
104
|
-
getLogoSize: (baseSize?: number) => number;
|
|
105
|
-
getInputHeight: (baseHeight?: number) => number;
|
|
106
|
-
getIconSize: (baseSize?: number) => number;
|
|
107
|
-
getMaxWidth: (baseWidth?: number) => number;
|
|
108
|
-
getFontSize: (baseFontSize: number) => number;
|
|
109
|
-
getGridCols: (mobile?: number, tablet?: number) => number;
|
|
110
|
-
}
|
|
17
|
+
import { computeDeviceInfo } from "./compute/computeDeviceInfo";
|
|
18
|
+
import { computeResponsiveSizes, computeOnboardingSizes } from "./compute/computeResponsiveSizes";
|
|
19
|
+
import { computeResponsivePositioning } from "./compute/computeResponsivePositioning";
|
|
20
|
+
import type { UseResponsiveReturn } from "./types/responsiveTypes";
|
|
111
21
|
|
|
112
|
-
/**
|
|
113
|
-
* Hook for responsive design utilities
|
|
114
|
-
* Automatically updates when screen dimensions or orientation changes
|
|
115
|
-
*/
|
|
116
22
|
export const useResponsive = (): UseResponsiveReturn => {
|
|
117
23
|
const { width, height } = useWindowDimensions();
|
|
118
24
|
const insets = useSafeAreaInsets();
|
|
119
25
|
|
|
120
|
-
// Memoize utility functions
|
|
26
|
+
// Memoize utility functions
|
|
121
27
|
const getLogoSize = useCallback(
|
|
122
28
|
(baseSize?: number) => getResponsiveLogoSize(baseSize),
|
|
123
29
|
[],
|
|
@@ -144,66 +50,71 @@ export const useResponsive = (): UseResponsiveReturn => {
|
|
|
144
50
|
[],
|
|
145
51
|
);
|
|
146
52
|
|
|
147
|
-
//
|
|
53
|
+
// Compute all responsive values
|
|
148
54
|
const responsiveValues = useMemo(
|
|
149
|
-
() =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
55
|
+
() => {
|
|
56
|
+
const deviceInfo = computeDeviceInfo();
|
|
57
|
+
const sizes = computeResponsiveSizes();
|
|
58
|
+
const positioning = computeResponsivePositioning(insets);
|
|
59
|
+
const onboarding = computeOnboardingSizes(deviceInfo);
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
// Device info
|
|
63
|
+
width,
|
|
64
|
+
height,
|
|
65
|
+
isSmallDevice: deviceInfo.isSmallDevice,
|
|
66
|
+
isTabletDevice: deviceInfo.isTabletDevice,
|
|
67
|
+
isLandscapeDevice: deviceInfo.isLandscapeDevice,
|
|
68
|
+
deviceType: deviceInfo.deviceType,
|
|
69
|
+
|
|
70
|
+
// Safe area insets
|
|
71
|
+
insets,
|
|
72
|
+
|
|
73
|
+
// Responsive sizes
|
|
74
|
+
logoSize: sizes.logoSize,
|
|
75
|
+
inputHeight: sizes.inputHeight,
|
|
76
|
+
iconContainerSize: sizes.iconContainerSize,
|
|
77
|
+
maxContentWidth: sizes.maxContentWidth,
|
|
78
|
+
minTouchTarget: sizes.minTouchTarget,
|
|
79
|
+
|
|
80
|
+
// Responsive positioning
|
|
81
|
+
horizontalPadding: positioning.horizontalPadding,
|
|
82
|
+
verticalPadding: positioning.verticalPadding,
|
|
83
|
+
bottomPosition: positioning.bottomPosition,
|
|
84
|
+
fabPosition: positioning.fabPosition,
|
|
85
|
+
|
|
86
|
+
// Screen layout config
|
|
87
|
+
screenLayoutConfig: positioning.screenLayoutConfig,
|
|
88
|
+
|
|
89
|
+
// Responsive layout
|
|
90
|
+
modalMaxHeight: sizes.modalMaxHeight,
|
|
91
|
+
modalMinHeight: sizes.modalMinHeight,
|
|
92
|
+
gridColumns: sizes.gridColumns,
|
|
93
|
+
spacingMultiplier: deviceInfo.spacingMultiplier,
|
|
94
|
+
tabBarConfig: positioning.tabBarConfig,
|
|
95
|
+
|
|
96
|
+
// Modal layouts
|
|
97
|
+
modalLayout: positioning.modalLayout,
|
|
98
|
+
bottomSheetLayout: positioning.bottomSheetLayout,
|
|
99
|
+
dialogLayout: positioning.dialogLayout,
|
|
100
|
+
|
|
101
|
+
// Onboarding specific
|
|
102
|
+
...onboarding,
|
|
103
|
+
|
|
104
|
+
// Utility functions
|
|
105
|
+
getLogoSize,
|
|
106
|
+
getInputHeight,
|
|
107
|
+
getIconSize,
|
|
108
|
+
getMaxWidth,
|
|
109
|
+
getFontSize,
|
|
110
|
+
getGridCols,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
205
113
|
[width, height, insets],
|
|
206
114
|
);
|
|
207
115
|
|
|
208
116
|
return responsiveValues;
|
|
209
117
|
};
|
|
118
|
+
|
|
119
|
+
// Re-export types
|
|
120
|
+
export type { UseResponsiveReturn } from './types/responsiveTypes';
|