@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.
Files changed (68) hide show
  1. package/package.json +1 -1
  2. package/src/atoms/AtomicButton.tsx +6 -257
  3. package/src/atoms/AtomicChip.tsx +4 -224
  4. package/src/atoms/AtomicIcon.tsx +2 -6
  5. package/src/atoms/AtomicIcon.types.ts +5 -0
  6. package/src/atoms/AtomicInput.tsx +34 -154
  7. package/src/atoms/AtomicPicker.tsx +31 -123
  8. package/src/atoms/button/AtomicButton.tsx +108 -0
  9. package/src/atoms/button/configs/buttonSizeConfig.ts +37 -0
  10. package/src/atoms/button/index.ts +6 -0
  11. package/src/atoms/button/styles/buttonStyles.ts +36 -0
  12. package/src/atoms/button/styles/buttonVariantStyles.ts +88 -0
  13. package/src/atoms/button/types/index.ts +40 -0
  14. package/src/atoms/chip/AtomicChip.tsx +112 -0
  15. package/src/atoms/chip/configs/chipColorConfig.ts +47 -0
  16. package/src/atoms/chip/configs/chipSizeConfig.ts +34 -0
  17. package/src/atoms/chip/index.ts +6 -0
  18. package/src/atoms/chip/styles/chipStyles.ts +28 -0
  19. package/src/atoms/chip/types/index.ts +42 -0
  20. package/src/atoms/index.ts +6 -4
  21. package/src/atoms/input/components/InputHelper.tsx +49 -0
  22. package/src/atoms/input/components/InputIcon.tsx +44 -0
  23. package/src/atoms/input/components/InputLabel.tsx +20 -0
  24. package/src/atoms/input/styles/inputStylesHelper.ts +1 -1
  25. package/src/atoms/input/types.ts +72 -0
  26. package/src/atoms/picker/hooks/usePickerState.ts +139 -0
  27. package/src/exports/atoms.ts +69 -0
  28. package/src/exports/device.ts +58 -0
  29. package/src/exports/layouts.ts +19 -0
  30. package/src/exports/molecules.ts +166 -0
  31. package/src/exports/organisms.ts +9 -0
  32. package/src/exports/responsive.ts +36 -0
  33. package/src/exports/safe-area.ts +6 -0
  34. package/src/exports/theme.ts +47 -0
  35. package/src/exports/typography.ts +22 -0
  36. package/src/exports/utilities.ts +6 -0
  37. package/src/exports/variants.ts +22 -0
  38. package/src/index.ts +11 -417
  39. package/src/layouts/ScreenLayout/ScreenLayout.tsx +17 -181
  40. package/src/layouts/ScreenLayout/components/ContentWrapper.tsx +31 -0
  41. package/src/layouts/ScreenLayout/components/index.ts +6 -0
  42. package/src/layouts/ScreenLayout/styles/screenLayoutStyles.ts +47 -0
  43. package/src/layouts/ScreenLayout/types/index.ts +27 -0
  44. package/src/molecules/avatar/Avatar.constants.ts +103 -0
  45. package/src/molecules/avatar/Avatar.types.ts +64 -0
  46. package/src/molecules/avatar/Avatar.utils.ts +8 -160
  47. package/src/molecules/calendar/index.ts +4 -9
  48. package/src/molecules/calendar/infrastructure/storage/CalendarStore.ts +103 -302
  49. package/src/molecules/calendar/infrastructure/storage/CalendarStore.ts.bak +116 -0
  50. package/src/molecules/calendar/infrastructure/storage/CalendarStore.types.ts +64 -0
  51. package/src/molecules/calendar/infrastructure/storage/CalendarStore.utils.ts +56 -0
  52. package/src/molecules/calendar/infrastructure/storage/EventActions.ts +140 -0
  53. package/src/molecules/calendar/infrastructure/storage/NavigationActions.ts +118 -0
  54. package/src/molecules/calendar/infrastructure/stores/storageAdapter.ts +34 -0
  55. package/src/molecules/calendar/infrastructure/stores/useCalendarEvents.ts +168 -0
  56. package/src/molecules/calendar/infrastructure/stores/useCalendarNavigation.ts +47 -0
  57. package/src/molecules/calendar/infrastructure/stores/useCalendarView.ts +24 -0
  58. package/src/molecules/calendar/presentation/hooks/useCalendar.ts +7 -11
  59. package/src/responsive/compute/computeDeviceInfo.ts +22 -0
  60. package/src/responsive/compute/computeResponsivePositioning.ts +42 -0
  61. package/src/responsive/compute/computeResponsiveSizes.ts +48 -0
  62. package/src/responsive/padding/paddingUtils.ts +65 -0
  63. package/src/responsive/positioning/positioningUtils.ts +61 -0
  64. package/src/responsive/responsiveLayout.ts +11 -264
  65. package/src/responsive/screen/screenLayoutConfig.ts +38 -0
  66. package/src/responsive/tabbar/tabBarConfig.ts +88 -0
  67. package/src/responsive/types/responsiveTypes.ts +69 -0
  68. 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
- type ResponsiveModalLayout,
35
- type ResponsiveBottomSheetLayout,
36
- type ResponsiveDialogLayout,
37
- type ResponsiveTabBarConfig,
38
- type ScreenLayoutConfig,
15
+ getResponsiveGridColumns,
39
16
  } from "./responsive";
40
- import {
41
- isSmallPhone,
42
- isTablet,
43
- isLandscape,
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 to prevent unnecessary re-renders
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
- // Memoize responsive values to prevent unnecessary recalculations
53
+ // Compute all responsive values
148
54
  const responsiveValues = useMemo(
149
- () => ({
150
- // Device info
151
- width,
152
- height,
153
- isSmallDevice: isSmallPhone(),
154
- isTabletDevice: isTablet(),
155
- isLandscapeDevice: isLandscape(),
156
- deviceType: getDeviceType(),
157
-
158
- // Safe area insets
159
- insets,
160
-
161
- // Responsive sizes (with default values)
162
- logoSize: getResponsiveLogoSize(),
163
- inputHeight: getResponsiveInputHeight(),
164
- iconContainerSize: getResponsiveIconContainerSize(),
165
- maxContentWidth: getResponsiveMaxWidth(),
166
- minTouchTarget: getMinTouchTarget(),
167
-
168
- // Responsive positioning
169
- horizontalPadding: getResponsiveHorizontalPadding(undefined, insets),
170
- verticalPadding: getResponsiveVerticalPadding(insets),
171
- bottomPosition: getResponsiveBottomPosition(undefined, insets),
172
- fabPosition: getResponsiveFABPosition(insets),
173
-
174
- // Screen layout config (complete configuration for ScreenLayout)
175
- screenLayoutConfig: getScreenLayoutConfig(insets),
176
-
177
- // Responsive layout
178
- modalMaxHeight: getResponsiveModalMaxHeight(),
179
- modalMinHeight: getResponsiveMinModalHeight(),
180
- gridColumns: getResponsiveGridColumns(),
181
- spacingMultiplier: getSpacingMultiplier(),
182
- tabBarConfig: getResponsiveTabBarConfig(insets),
183
-
184
- // Modal layouts (complete configurations)
185
- modalLayout: getResponsiveModalLayout(),
186
- bottomSheetLayout: getResponsiveBottomSheetLayout(),
187
- dialogLayout: getResponsiveDialogLayout(),
188
-
189
- // Onboarding specific responsive values
190
- onboardingIconSize: getIconSize(64),
191
- onboardingIconMarginTop: getSpacingMultiplier() * 24,
192
- onboardingIconMarginBottom: getSpacingMultiplier() * 16,
193
- onboardingTitleMarginBottom: getSpacingMultiplier() * 16,
194
- onboardingDescriptionMarginTop: getSpacingMultiplier() * 12,
195
- onboardingTextPadding: getSpacingMultiplier() * 20,
196
-
197
- // Utility functions
198
- getLogoSize,
199
- getInputHeight,
200
- getIconSize,
201
- getMaxWidth,
202
- getFontSize,
203
- getGridCols,
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';