@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
package/src/index.ts CHANGED
@@ -15,460 +15,54 @@
15
15
  // =============================================================================
16
16
  // THEME EXPORTS
17
17
  // =============================================================================
18
-
19
- export {
20
- useAppDesignTokens,
21
- useCommonStyles,
22
- useDesignSystemTheme,
23
- useTheme,
24
- useThemedStyles,
25
- useThemedStyleSheet,
26
- DesignSystemProvider,
27
- lightColors,
28
- darkColors,
29
- getColorPalette,
30
- withAlpha,
31
- BASE_TOKENS,
32
- BASE_TOKENS as STATIC_TOKENS,
33
- spacing,
34
- typography,
35
- borders,
36
- createDesignTokens,
37
- lightTheme,
38
- darkTheme,
39
- createResponsiveValue,
40
- ThemeStorage,
41
- createNavigationTheme,
42
- applyCustomColors,
43
- type ColorPalette,
44
- type ThemeMode,
45
- type CustomThemeColors,
46
- type Spacing,
47
- type Typography,
48
- type Borders,
49
- type BaseTokens,
50
- type IconSizes,
51
- type Opacity,
52
- type AvatarSizes,
53
- type ComponentSizes,
54
- type DesignTokens,
55
- type ResponsiveSpacing,
56
- type ResponsiveTypography,
57
- type Theme,
58
- type ExtendedColorPalette,
59
- type NavigationTheme,
60
- } from './theme';
18
+ export * from './exports/theme';
61
19
 
62
20
  // =============================================================================
63
21
  // TYPOGRAPHY EXPORTS
64
22
  // =============================================================================
65
-
66
- export {
67
- getTextColor,
68
- getTextStyle,
69
- isTextStyleVariant,
70
- getAllTextStyleVariants,
71
- clearTypographyCache,
72
- clearColorCache,
73
- isValidHexColor,
74
- isValidRgbColor,
75
- isValidHslColor,
76
- isValidNamedColor,
77
- isValidColor,
78
- getColorFormat,
79
- normalizeColor,
80
- type TextStyleVariant,
81
- type ColorVariant,
82
- } from './typography';
23
+ export * from './exports/typography';
83
24
 
84
25
  // =============================================================================
85
26
  // RESPONSIVE EXPORTS
86
27
  // =============================================================================
87
-
88
- export {
89
- useResponsive,
90
- getResponsiveLogoSize,
91
- getResponsiveInputHeight,
92
- getResponsiveHorizontalPadding,
93
- getResponsiveBottomPosition,
94
- getResponsiveFABPosition,
95
- getResponsiveModalMaxHeight,
96
- getResponsiveMinModalHeight,
97
- getResponsiveModalWidth,
98
- getResponsiveModalHeight,
99
- getResponsiveModalBorderRadius,
100
- getResponsiveModalMaxWidth,
101
- getResponsiveBackdropOpacity,
102
- getResponsiveModalLayout,
103
- getResponsiveBottomSheetLayout,
104
- getResponsiveDialogLayout,
105
- getResponsiveIconContainerSize,
106
- getResponsiveGridColumns,
107
- getResponsiveMaxWidth,
108
- getResponsiveFontSize,
109
- getMinTouchTarget,
110
- IOS_HIG,
111
- PLATFORM_CONSTANTS,
112
- isValidTouchTarget,
113
- DEVICE_BREAKPOINTS,
114
- type ResponsiveModalLayout,
115
- type ResponsiveBottomSheetLayout,
116
- type ResponsiveDialogLayout,
117
- type UseResponsiveReturn,
118
- } from './responsive';
28
+ export * from './exports/responsive';
119
29
 
120
30
  // =============================================================================
121
31
  // DEVICE EXPORTS
122
32
  // =============================================================================
123
-
124
- export {
125
- // Device detection
126
- DeviceType,
127
- getScreenDimensions,
128
- isPhone,
129
- isSmallPhone,
130
- isLargePhone,
131
- isTablet,
132
- isLandscape,
133
- getDeviceType,
134
- getSpacingMultiplier,
135
- // iPad detection
136
- isIPad,
137
- isIPadMini,
138
- isIPadPro,
139
- isIPadLandscape,
140
- IPAD_BREAKPOINTS,
141
- TOUCH_TARGETS,
142
- CONTENT_WIDTH_CONSTRAINTS,
143
- IPAD_LAYOUT_CONFIG,
144
- // iPad utilities
145
- getContentMaxWidth,
146
- getIPadGridColumns,
147
- getTouchTargetSize,
148
- getIPadScreenPadding,
149
- getIPadFontScale,
150
- getIPadLayoutInfo,
151
- getIPadModalDimensions,
152
- getPaywallDimensions,
153
- type IPadLayoutInfo,
154
- type ModalDimensions,
155
- type PaywallDimensions,
156
- // Device info
157
- DEVICE_CONSTANTS,
158
- DeviceUtils,
159
- DeviceTypeUtils,
160
- DeviceMemoryUtils,
161
- DeviceService,
162
- UserFriendlyIdService,
163
- PersistentDeviceIdService,
164
- useDeviceInfo,
165
- useDeviceCapabilities,
166
- useDeviceId,
167
- useAnonymousUser,
168
- getAnonymousUserId,
169
- collectDeviceExtras,
170
- type DeviceInfo,
171
- type ApplicationInfo,
172
- type SystemInfo,
173
- type AnonymousUser,
174
- type UseAnonymousUserOptions,
175
- type DeviceExtras,
176
- } from './device';
33
+ export * from './exports/device';
177
34
 
178
35
  // =============================================================================
179
36
  // ATOMS EXPORTS
180
37
  // =============================================================================
181
-
182
- export {
183
- AtomicText,
184
- AtomicIcon,
185
- AtomicButton,
186
- AtomicInput,
187
- AtomicCard,
188
- AtomicFab,
189
- AtomicAvatar,
190
- AtomicChip,
191
- AtomicProgress,
192
- AtomicPicker,
193
- AtomicDatePicker,
194
- AtomicSkeleton,
195
- AtomicBadge,
196
- AtomicSpinner,
197
- LoadingSpinner,
198
- EmptyState,
199
- type IconName,
200
- type IconSize,
201
- type IconColor,
202
- type AtomicTextProps,
203
- type AtomicIconProps,
204
- type AtomicButtonProps,
205
- type ButtonVariant,
206
- type ButtonSize,
207
- type AtomicInputProps,
208
- type AtomicInputVariant,
209
- type AtomicInputState,
210
- type AtomicInputSize,
211
- type AtomicCardProps,
212
- type AtomicCardVariant,
213
- type AtomicCardPadding,
214
- type AtomicFabProps,
215
- type FabSize,
216
- type FabVariant,
217
- type AtomicAvatarProps,
218
- type AtomicChipProps,
219
- type AtomicProgressProps,
220
- type AtomicPickerProps,
221
- type PickerOption,
222
- type PickerSize,
223
- type AtomicDatePickerProps,
224
- type AtomicSkeletonProps,
225
- type SkeletonPattern,
226
- type SkeletonConfig,
227
- SKELETON_PATTERNS,
228
- type AtomicBadgeProps,
229
- type BadgeVariant,
230
- type BadgeSize,
231
- type AtomicSpinnerProps,
232
- type SpinnerSize,
233
- type SpinnerColor,
234
- type EmptyStateProps,
235
- AtomicTextArea,
236
- type AtomicTextAreaProps,
237
- AtomicSwitch,
238
- type AtomicSwitchProps,
239
- AtomicTouchable,
240
- type AtomicTouchableProps,
241
- AtomicStatusBar,
242
- type AtomicStatusBarProps,
243
- AtomicKeyboardAvoidingView,
244
- type AtomicKeyboardAvoidingViewProps,
245
- } from './atoms';
38
+ export * from './exports/atoms';
246
39
 
247
40
  // =============================================================================
248
41
  // LAYOUTS EXPORTS
249
42
  // =============================================================================
250
-
251
- export {
252
- ScreenLayout,
253
- AppHeader,
254
- ScreenHeader,
255
- Grid,
256
- Container,
257
- FormLayout,
258
- type ScreenLayoutProps,
259
- type AppHeaderProps,
260
- type ScreenHeaderProps,
261
- type GridProps,
262
- type ContainerProps,
263
- type FormLayoutProps,
264
- } from './layouts';
43
+ export * from './exports/layouts';
265
44
 
266
45
  // =============================================================================
267
46
  // MOLECULES EXPORTS
268
47
  // =============================================================================
269
-
270
- export {
271
- FormField,
272
- ListItem,
273
- SearchBar,
274
- IconContainer,
275
- BaseModal,
276
- ConfirmationModal,
277
- useConfirmationModal,
278
- StepProgress,
279
- List,
280
- Avatar,
281
- AvatarGroup,
282
- AvatarUtils,
283
- type AvatarProps,
284
- type AvatarGroupProps,
285
- type AvatarGroupItem,
286
- type AvatarSize,
287
- type AvatarShape,
288
- type AvatarConfig,
289
- type AvatarType,
290
- // Media Card
291
- MediaCard,
292
- type MediaCardProps,
293
- type MediaCardSize,
294
- type MediaCardOverlayPosition,
295
- // Bottom Sheet
296
- BottomSheet,
297
- BottomSheetModal,
298
- SafeBottomSheetModalProvider,
299
- FilterBottomSheet,
300
- FilterSheet,
301
- useBottomSheet,
302
- useBottomSheetModal,
303
- useListFilters,
304
- type BottomSheetProps,
305
- type BottomSheetModalProps,
306
- type BottomSheetRef,
307
- type BottomSheetModalRef,
308
- type FilterOption,
309
- type FilterCategory,
310
- // Alerts
311
- AlertBanner,
312
- AlertToast,
313
- AlertInline,
314
- AlertModal,
315
- AlertContainer,
316
- AlertProvider,
317
- AlertService,
318
- useAlert,
319
- alertService,
320
- AlertType,
321
- AlertMode,
322
- AlertPosition,
323
- type BaseModalProps,
324
- type ListProps,
325
- type Alert,
326
- type AlertAction,
327
- type AlertOptions,
328
- // Calendar
329
- AtomicCalendar,
330
- useCalendar,
331
- useCalendarNavigation,
332
- useCalendarEvents,
333
- CalendarService,
334
- CalendarGeneration,
335
- DateUtilities,
336
- useCalendarStore,
337
- type AtomicCalendarProps,
338
- type UseCalendarReturn,
339
- type CalendarEvent,
340
- type CreateCalendarEventRequest,
341
- type UpdateCalendarEventRequest,
342
- type CalendarDay,
343
- type CalendarMonth,
344
- type CalendarWeek,
345
- type ICalendarRepository,
346
- type CalendarViewMode,
347
- // Swipe Actions
348
- SwipeActionButton,
349
- SwipeActionUtils,
350
- ACTION_PRESETS,
351
- DEFAULT_SWIPE_CONFIG,
352
- type SwipeActionButtonProps,
353
- type SwipeActionType,
354
- type SwipeActionConfig,
355
- type SwipeDirection,
356
- type SwipeableConfig,
357
- // Navigation
358
- TabsNavigator,
359
- StackNavigator,
360
- createTabNavigator,
361
- createStackNavigator,
362
- FabButton,
363
- NavigationCleanupManager,
364
- AppNavigation,
365
- TabLabel,
366
- useTabBarStyles,
367
- useTabConfig,
368
- type TabsNavigatorProps,
369
- type StackNavigatorProps,
370
- type FabButtonProps,
371
- type TabScreen,
372
- type TabNavigatorConfig,
373
- type StackScreen,
374
- type StackNavigatorConfig,
375
- type BaseScreen,
376
- type BaseNavigatorConfig,
377
- type IconRendererProps,
378
- type LabelProcessorProps,
379
- type FabConfig,
380
- type NavigationCleanup,
381
- type BottomTabNavigationOptions,
382
- type BottomTabScreenProps,
383
- type StackNavigationOptions,
384
- type TabLabelProps,
385
- type TabBarConfig,
386
- // Long Press Menu
387
- type MenuAction,
388
- type MenuActionTypeValue,
389
- MenuActionType,
390
- // Emoji
391
- EmojiPicker,
392
- useEmojiPicker,
393
- EmojiCategory,
394
- EmojiUtils,
395
- type EmojiObject,
396
- type EmojiPickerConfig,
397
- type EmojiSelectCallback,
398
- type EmojiPickerState,
399
- type EmojiPickerProps,
400
- type UseEmojiPickerOptions,
401
- type UseEmojiPickerReturn,
402
- // Countdown
403
- Countdown,
404
- TimeUnit,
405
- CountdownHeader,
406
- useCountdown,
407
- calculateTimeRemaining,
408
- padNumber,
409
- getNextDayStart,
410
- getNextYearStart,
411
- type CountdownProps,
412
- type TimeUnitProps,
413
- type CountdownHeaderProps,
414
- type UseCountdownOptions,
415
- type UseCountdownReturn,
416
- type TimeRemaining,
417
- type CountdownTarget,
418
- type CountdownFormatOptions,
419
- type CountdownDisplayConfig,
420
- // Step Header
421
- StepHeader,
422
- type StepHeaderProps,
423
- type StepHeaderConfig,
424
- // Splash
425
- SplashScreen,
426
- useSplashFlow,
427
- type SplashScreenProps,
428
- type SplashColors,
429
- type UseSplashFlowOptions,
430
- type UseSplashFlowResult,
431
- } from './molecules';
48
+ export * from './exports/molecules';
432
49
 
433
50
  // =============================================================================
434
51
  // ORGANISMS EXPORTS
435
52
  // =============================================================================
436
-
437
- export {
438
- FormContainer,
439
- type FormContainerProps,
440
- } from './organisms';
53
+ export * from './exports/organisms';
441
54
 
442
55
  // =============================================================================
443
56
  // SAFE AREA EXPORTS
444
57
  // =============================================================================
445
-
446
- export * from './safe-area';
58
+ export * from './exports/safe-area';
447
59
 
448
60
  // =============================================================================
449
61
  // VARIANT UTILITIES
450
62
  // =============================================================================
451
-
452
- export {
453
- createVariants,
454
- type VariantConfig,
455
- type VariantProps,
456
- } from './presentation/utils/variants/core';
457
-
458
- export {
459
- createAdvancedVariants,
460
- type AdvancedVariantConfig,
461
- type CompoundVariant,
462
- } from './presentation/utils/variants/compound';
463
-
464
- export {
465
- conditionalStyle,
466
- responsiveStyle,
467
- combineStyles,
468
- } from './presentation/utils/variants/helpers';
63
+ export * from './exports/variants';
469
64
 
470
65
  // =============================================================================
471
66
  // UTILITIES
472
67
  // =============================================================================
473
-
474
- export * from './utilities';
68
+ export * from './exports/utilities';
@@ -1,145 +1,16 @@
1
1
  /**
2
- * ScreenLayout - Universal Screen Container Component
3
- *
4
- * Provides consistent layout structure for all screens:
5
- * - SafeAreaView with configurable edges
6
- * - Optional ScrollView for content
7
- * - Theme-aware background colors
8
- * - Optional header/footer slots
9
- * - Consistent spacing and padding
10
- *
11
- * Usage:
12
- * <ScreenLayout>
13
- * <View>Your content here</View>
14
- * </ScreenLayout>
15
- *
16
- * Advanced:
17
- * <ScreenLayout
18
- * scrollable={false}
19
- * edges={['top', 'bottom']}
20
- * header={<CustomHeader />}
21
- * >
22
- * <View>Content</View>
23
- * </ScreenLayout>
2
+ * ScreenLayout Component
3
+ * Refactored: Extracted types, styles, and ContentWrapper
24
4
  */
25
5
 
26
6
  import React, { useMemo } from 'react';
27
- import { View, ScrollView, StyleSheet, type ViewStyle, type RefreshControlProps } from 'react-native';
28
- import { SafeAreaView, useSafeAreaInsets, type Edge } from '../../safe-area';
7
+ import { View, ScrollView } from 'react-native';
8
+ import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
29
9
  import { useAppDesignTokens } from '../../theme';
30
10
  import { getScreenLayoutConfig } from '../../responsive/responsiveLayout';
31
- import { AtomicKeyboardAvoidingView } from '../../atoms';
32
-
33
- /**
34
- * NOTE: This component now works in conjunction with the SafeAreaProvider
35
- * from our safe-area module. The SafeAreaProvider should wrap your app root:
36
- *
37
- * import { SafeAreaProvider } from '../../index';
38
- *
39
- * function App() {
40
- * return (
41
- * <SafeAreaProvider>
42
- * <YourApp />
43
- * </SafeAreaProvider>
44
- * );
45
- * }
46
- */
47
-
48
- export interface ScreenLayoutProps {
49
- /**
50
- * Content to render inside the layout
51
- */
52
- children: React.ReactNode;
53
-
54
- /**
55
- * Enable scrolling (default: true)
56
- * Set to false for screens with custom scroll logic
57
- */
58
- scrollable?: boolean;
59
-
60
- /**
61
- * Safe area edges to apply (default: ['top'])
62
- * Common values:
63
- * - ['top'] - For screens with bottom tabs
64
- * - ['top', 'bottom'] - For modal screens
65
- * - [] - No safe area (use cautiously)
66
- */
67
- edges?: Edge[];
68
-
69
- /**
70
- * Optional header component
71
- * Rendered above scrollable content
72
- */
73
- header?: React.ReactNode;
74
-
75
- /**
76
- * Optional footer component
77
- * Rendered below scrollable content
78
- */
79
- footer?: React.ReactNode;
80
-
81
- /**
82
- * Override background color
83
- * If not provided, uses theme's backgroundPrimary
84
- */
85
- backgroundColor?: string;
86
-
87
- /**
88
- * Custom container style
89
- */
90
- containerStyle?: ViewStyle;
91
-
92
- /**
93
- * Custom content container style (for ScrollView)
94
- */
95
- contentContainerStyle?: ViewStyle;
96
-
97
- /**
98
- * Test ID for automation
99
- */
100
- testID?: string;
101
-
102
- /**
103
- * Hide vertical scroll indicator (default: false)
104
- */
105
- hideScrollIndicator?: boolean;
106
-
107
- /**
108
- * Enable keyboard avoiding behavior (default: false)
109
- * Useful for screens with inputs
110
- */
111
- keyboardAvoiding?: boolean;
112
-
113
- /**
114
- * Accessibility label for the layout
115
- */
116
- accessibilityLabel?: string;
117
-
118
- /**
119
- * Accessibility hint for the layout
120
- */
121
- accessibilityHint?: string;
122
-
123
- /**
124
- * Whether the layout is accessible
125
- */
126
- accessible?: boolean;
127
-
128
- /**
129
- * Enable responsive content width and centering (default: true)
130
- */
131
- responsiveEnabled?: boolean;
132
-
133
- /**
134
- * Maximum content width override
135
- */
136
- maxWidth?: number;
137
-
138
- /**
139
- * RefreshControl component for pull-to-refresh
140
- */
141
- refreshControl?: React.ReactElement<RefreshControlProps>;
142
- }
11
+ import { ContentWrapper } from './components/ContentWrapper';
12
+ import { getScreenLayoutStyles } from './styles/screenLayoutStyles';
13
+ import type { ScreenLayoutProps } from './types';
143
14
 
144
15
  export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
145
16
  children,
@@ -157,7 +28,6 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
157
28
  maxWidth,
158
29
  refreshControl,
159
30
  }) => {
160
- // Automatically uses current theme from global store
161
31
  const tokens = useAppDesignTokens();
162
32
  const insets = useSafeAreaInsets();
163
33
 
@@ -172,51 +42,14 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
172
42
  const horizontalPadding = responsiveEnabled ? layoutConfig.horizontalPadding : tokens.spacing.md;
173
43
  const verticalPadding = responsiveEnabled ? layoutConfig.verticalPadding : tokens.spacing.lg;
174
44
 
175
- const styles = useMemo(() => StyleSheet.create({
176
- container: {
177
- flex: 1,
178
- },
179
- keyboardAvoidingView: {
180
- flex: 1,
181
- },
182
- responsiveWrapper: {
183
- flex: 1,
184
- width: '100%',
185
- ...(finalMaxWidth ? { maxWidth: finalMaxWidth, alignSelf: 'center' as const } : {}),
186
- },
187
- content: {
188
- flex: 1,
189
- paddingTop: verticalPadding,
190
- paddingHorizontal: horizontalPadding,
191
- },
192
- scrollView: {
193
- flex: 1,
194
- },
195
- scrollContent: {
196
- flexGrow: 1,
197
- paddingTop: verticalPadding,
198
- paddingHorizontal: horizontalPadding,
199
- paddingBottom: verticalPadding,
200
- },
201
- }), [tokens, finalMaxWidth, horizontalPadding, verticalPadding]);
45
+ // Pre-compute styles
46
+ const styles = useMemo(
47
+ () => getScreenLayoutStyles(tokens, { maxWidth: finalMaxWidth, horizontalPadding, verticalPadding }),
48
+ [tokens, finalMaxWidth, horizontalPadding, verticalPadding]
49
+ );
202
50
 
203
51
  const bgColor = backgroundColor || tokens.colors.backgroundPrimary;
204
52
 
205
- // Content wrapper - optionally with KeyboardAvoidingView
206
- // Uses 'padding' behavior which works consistently cross-platform
207
- const ContentWrapper: React.FC<{ children: React.ReactNode }> = ({ children: wrapperChildren }) => {
208
- if (keyboardAvoiding) {
209
- return (
210
- <AtomicKeyboardAvoidingView
211
- style={styles.keyboardAvoidingView}
212
- >
213
- {wrapperChildren}
214
- </AtomicKeyboardAvoidingView>
215
- );
216
- }
217
- return <>{wrapperChildren}</>;
218
- };
219
-
220
53
  // Non-scrollable layout
221
54
  if (!scrollable) {
222
55
  return (
@@ -225,7 +58,7 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
225
58
  edges={edges}
226
59
  testID={testID}
227
60
  >
228
- <ContentWrapper>
61
+ <ContentWrapper keyboardAvoiding={keyboardAvoiding}>
229
62
  <View style={styles.responsiveWrapper}>
230
63
  {header}
231
64
  <View style={[styles.content, contentContainerStyle]}>
@@ -245,7 +78,7 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
245
78
  edges={edges}
246
79
  testID={testID}
247
80
  >
248
- <ContentWrapper>
81
+ <ContentWrapper keyboardAvoiding={keyboardAvoiding}>
249
82
  <View style={styles.responsiveWrapper}>
250
83
  {header}
251
84
  <ScrollView
@@ -263,3 +96,6 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = ({
263
96
  </SafeAreaView>
264
97
  );
265
98
  };
99
+
100
+ // Re-export types for convenience
101
+ export type { ScreenLayoutProps } from './types';