@umituz/react-native-design-system 1.5.24 → 1.5.26
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/dist/AtomicIcon.d.ts +34 -0
- package/dist/index.d.ts +60 -0
- package/dist/presentation/atoms/AtomicAvatar.d.ts +47 -0
- package/dist/presentation/atoms/AtomicAvatarGroup.d.ts +55 -0
- package/dist/presentation/atoms/AtomicBadge.d.ts +41 -0
- package/dist/presentation/atoms/AtomicButton.d.ts +20 -0
- package/dist/presentation/atoms/AtomicCard.d.ts +14 -0
- package/dist/presentation/atoms/AtomicChip.d.ts +52 -0
- package/dist/presentation/atoms/AtomicDatePicker.d.ts +74 -0
- package/dist/presentation/atoms/AtomicDivider.d.ts +44 -0
- package/dist/presentation/atoms/AtomicFab.d.ts +36 -0
- package/dist/presentation/atoms/AtomicFilter.d.ts +36 -0
- package/dist/presentation/atoms/AtomicFormError.d.ts +29 -0
- package/dist/presentation/atoms/AtomicIcon.d.ts +34 -0
- package/dist/presentation/atoms/AtomicImage.d.ts +39 -0
- package/dist/presentation/atoms/AtomicInput.d.ts +70 -0
- package/dist/presentation/atoms/AtomicNumberInput.d.ts +68 -0
- package/dist/presentation/atoms/AtomicPicker.d.ts +51 -0
- package/dist/presentation/atoms/AtomicProgress.d.ts +43 -0
- package/dist/presentation/atoms/AtomicSearchBar.d.ts +18 -0
- package/dist/presentation/atoms/AtomicSort.d.ts +71 -0
- package/dist/presentation/atoms/AtomicSwitch.d.ts +42 -0
- package/dist/presentation/atoms/AtomicText.d.ts +33 -0
- package/dist/presentation/atoms/AtomicTextArea.d.ts +84 -0
- package/dist/presentation/atoms/AtomicTouchable.d.ts +76 -0
- package/dist/presentation/atoms/fab/styles/fabStyles.d.ts +22 -0
- package/dist/presentation/atoms/fab/types/index.d.ts +70 -0
- package/dist/presentation/atoms/filter/styles/filterStyles.d.ts +14 -0
- package/dist/presentation/atoms/filter/types/index.d.ts +75 -0
- package/dist/presentation/atoms/index.d.ts +272 -0
- package/dist/presentation/atoms/picker/styles/pickerStyles.d.ts +84 -0
- package/dist/presentation/atoms/picker/types/index.d.ts +37 -0
- package/dist/presentation/atoms/touchable/styles/touchableStyles.d.ts +30 -0
- package/dist/presentation/atoms/touchable/types/index.d.ts +133 -0
- package/dist/presentation/hooks/useResponsive.d.ts +79 -0
- package/dist/presentation/molecules/AtomicConfirmationModal.d.ts +72 -0
- package/dist/presentation/molecules/EmptyState.d.ts +40 -0
- package/dist/presentation/molecules/FormField.d.ts +21 -0
- package/dist/presentation/molecules/GridContainer.d.ts +39 -0
- package/dist/presentation/molecules/IconContainer.d.ts +28 -0
- package/dist/presentation/molecules/ListItem.d.ts +4 -0
- package/dist/presentation/molecules/ScreenHeader.d.ts +54 -0
- package/dist/presentation/molecules/SearchBar.d.ts +17 -0
- package/dist/presentation/molecules/SectionCard.d.ts +24 -0
- package/dist/presentation/molecules/SectionContainer.d.ts +32 -0
- package/dist/presentation/molecules/SectionHeader.d.ts +36 -0
- package/dist/presentation/molecules/confirmation-modal/styles/confirmationModalStyles.d.ts +49 -0
- package/dist/presentation/molecules/confirmation-modal/types/index.d.ts +85 -0
- package/dist/presentation/molecules/listitem/styles/listItemStyles.d.ts +11 -0
- package/dist/presentation/molecules/listitem/types/index.d.ts +16 -0
- package/dist/presentation/organisms/AppHeader.d.ts +30 -0
- package/dist/presentation/organisms/FormContainer.d.ts +75 -0
- package/dist/presentation/organisms/ScreenLayout.d.ts +83 -0
- package/dist/presentation/tokens/commonStyles.d.ts +121 -0
- package/dist/presentation/utils/platformConstants.d.ts +99 -0
- package/dist/presentation/utils/responsive.d.ts +217 -0
- package/package.json +4 -3
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormContainer Component
|
|
3
|
+
*
|
|
4
|
+
* A reusable container for forms with proper keyboard handling and responsive layout.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Pure React Native implementation (no Paper dependency)
|
|
8
|
+
* - Universal keyboard handling (no platform-specific code)
|
|
9
|
+
* - ScrollView with automatic content padding
|
|
10
|
+
* - Safe area insets for bottom tab navigation overlap
|
|
11
|
+
* - Responsive max width for large screens (tablets)
|
|
12
|
+
* - Consistent vertical spacing between form elements
|
|
13
|
+
* - Theme-aware surface colors
|
|
14
|
+
* - Optimized performance with memoized styles
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <FormContainer>
|
|
19
|
+
* <AtomicInput label="Name" value={name} onChangeText={setName} />
|
|
20
|
+
* <AtomicTextArea label="Description" value={desc} onChangeText={setDesc} />
|
|
21
|
+
* <AtomicButton variant="primary" onPress={handleSubmit}>
|
|
22
|
+
* Submit
|
|
23
|
+
* </AtomicButton>
|
|
24
|
+
* </FormContainer>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Why This Component:
|
|
28
|
+
* - Prevents keyboard from covering input fields (universal solution)
|
|
29
|
+
* - Handles safe area (notch, bottom tabs) automatically
|
|
30
|
+
* - Consistent form layout across all 100+ generated apps
|
|
31
|
+
* - Responsive design for tablets (max 700px) and phones (full width)
|
|
32
|
+
* - Automatic vertical spacing between form elements (no manual marginBottom)
|
|
33
|
+
* - Reduces boilerplate in form screens
|
|
34
|
+
* - Universal code - no platform checks, works on iOS, Android, Web
|
|
35
|
+
*
|
|
36
|
+
* Technical Details:
|
|
37
|
+
* - Uses ScrollView with contentContainerStyle for keyboard handling
|
|
38
|
+
* - Pure React Native View for surface (lightweight)
|
|
39
|
+
* - Vertical spacing via Children.map() wrapping (universal compatibility)
|
|
40
|
+
* - Safe area insets from react-native-safe-area-context
|
|
41
|
+
* - Responsive values from useResponsive hook
|
|
42
|
+
*
|
|
43
|
+
* @module FormContainer
|
|
44
|
+
*/
|
|
45
|
+
import React from 'react';
|
|
46
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
47
|
+
/**
|
|
48
|
+
* Props for FormContainer component
|
|
49
|
+
*/
|
|
50
|
+
export interface FormContainerProps {
|
|
51
|
+
/** Form content (inputs, buttons, etc.) */
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
/** Container style override (for outer View) */
|
|
54
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
55
|
+
/** Content container style override (for ScrollView content) */
|
|
56
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
57
|
+
/** Show vertical scroll indicator */
|
|
58
|
+
showsVerticalScrollIndicator?: boolean;
|
|
59
|
+
/** Optional test ID for E2E testing */
|
|
60
|
+
testID?: string;
|
|
61
|
+
/** Show surface border (default: true) */
|
|
62
|
+
showBorder?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* FormContainer - Universal form wrapper component
|
|
66
|
+
*
|
|
67
|
+
* Wraps forms with:
|
|
68
|
+
* - Pure React Native surface
|
|
69
|
+
* - Universal keyboard handling (no platform checks)
|
|
70
|
+
* - ScrollView for content overflow
|
|
71
|
+
* - Safe area insets (bottom tabs, notch)
|
|
72
|
+
* - Responsive max width (tablets)
|
|
73
|
+
* - Theme integration
|
|
74
|
+
*/
|
|
75
|
+
export declare const FormContainer: React.FC<FormContainerProps>;
|
|
@@ -0,0 +1,83 @@
|
|
|
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>
|
|
24
|
+
*/
|
|
25
|
+
import React from 'react';
|
|
26
|
+
import { ViewStyle } from 'react-native';
|
|
27
|
+
import { Edge } from 'react-native-safe-area-context';
|
|
28
|
+
export interface ScreenLayoutProps {
|
|
29
|
+
/**
|
|
30
|
+
* Content to render inside the layout
|
|
31
|
+
*/
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Enable scrolling (default: true)
|
|
35
|
+
* Set to false for screens with custom scroll logic
|
|
36
|
+
*/
|
|
37
|
+
scrollable?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Safe area edges to apply (default: ['top'])
|
|
40
|
+
* Common values:
|
|
41
|
+
* - ['top'] - For screens with bottom tabs
|
|
42
|
+
* - ['top', 'bottom'] - For modal screens
|
|
43
|
+
* - [] - No safe area (use cautiously)
|
|
44
|
+
*/
|
|
45
|
+
edges?: Edge[];
|
|
46
|
+
/**
|
|
47
|
+
* Optional header component
|
|
48
|
+
* Rendered above scrollable content
|
|
49
|
+
*/
|
|
50
|
+
header?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Optional footer component
|
|
53
|
+
* Rendered below scrollable content
|
|
54
|
+
*/
|
|
55
|
+
footer?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Override background color
|
|
58
|
+
* If not provided, uses theme's backgroundPrimary
|
|
59
|
+
*/
|
|
60
|
+
backgroundColor?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Custom container style
|
|
63
|
+
*/
|
|
64
|
+
containerStyle?: ViewStyle;
|
|
65
|
+
/**
|
|
66
|
+
* Custom content container style (for ScrollView)
|
|
67
|
+
*/
|
|
68
|
+
contentContainerStyle?: ViewStyle;
|
|
69
|
+
/**
|
|
70
|
+
* Test ID for automation
|
|
71
|
+
*/
|
|
72
|
+
testID?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Hide vertical scroll indicator (default: false)
|
|
75
|
+
*/
|
|
76
|
+
hideScrollIndicator?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Enable keyboard avoiding behavior (default: false)
|
|
79
|
+
* Useful for screens with inputs
|
|
80
|
+
*/
|
|
81
|
+
keyboardAvoiding?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export declare const ScreenLayout: React.FC<ScreenLayoutProps>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common Styles - Reusable Style Patterns
|
|
3
|
+
*
|
|
4
|
+
* Centralized style utilities to reduce duplication across screens.
|
|
5
|
+
* These styles are composable and follow DRY principles.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { useCommonStyles } from '@domains/design-system/commonStyles';
|
|
10
|
+
*
|
|
11
|
+
* const MyComponent = () => {
|
|
12
|
+
* const commonStyles = useCommonStyles();
|
|
13
|
+
* return <View style={commonStyles.screenContainer}>...</View>;
|
|
14
|
+
* };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import { ViewStyle, TextStyle } from 'react-native';
|
|
18
|
+
/**
|
|
19
|
+
* Hook to get common styles with dynamic theme support
|
|
20
|
+
*/
|
|
21
|
+
export declare const useCommonStyles: () => {
|
|
22
|
+
/**
|
|
23
|
+
* Standard full-screen container
|
|
24
|
+
* Most common pattern: flex: 1 with background color
|
|
25
|
+
*/
|
|
26
|
+
screenContainer: ViewStyle;
|
|
27
|
+
/**
|
|
28
|
+
* Basic flex container without background
|
|
29
|
+
* Use when background is set elsewhere or not needed
|
|
30
|
+
*/
|
|
31
|
+
flexContainer: ViewStyle;
|
|
32
|
+
/**
|
|
33
|
+
* Screen container with secondary background
|
|
34
|
+
*/
|
|
35
|
+
screenContainerSecondary: ViewStyle;
|
|
36
|
+
/**
|
|
37
|
+
* Standard ScrollView wrapper
|
|
38
|
+
*/
|
|
39
|
+
scrollView: ViewStyle;
|
|
40
|
+
/**
|
|
41
|
+
* ScrollView content container with standard padding
|
|
42
|
+
*/
|
|
43
|
+
scrollContent: ViewStyle;
|
|
44
|
+
/**
|
|
45
|
+
* ScrollView content that grows to fill available space
|
|
46
|
+
*/
|
|
47
|
+
scrollContentGrow: ViewStyle;
|
|
48
|
+
/**
|
|
49
|
+
* Centered scroll content (for forms, onboarding screens)
|
|
50
|
+
*/
|
|
51
|
+
scrollContentCentered: ViewStyle;
|
|
52
|
+
/**
|
|
53
|
+
* Centered container - both horizontal and vertical
|
|
54
|
+
* Perfect for empty states, splash screens
|
|
55
|
+
*/
|
|
56
|
+
centerContainer: ViewStyle;
|
|
57
|
+
/**
|
|
58
|
+
* Centered container with padding
|
|
59
|
+
*/
|
|
60
|
+
centerContainerPadded: ViewStyle;
|
|
61
|
+
/**
|
|
62
|
+
* Horizontal row layout
|
|
63
|
+
*/
|
|
64
|
+
row: ViewStyle;
|
|
65
|
+
/**
|
|
66
|
+
* Horizontal row with space between
|
|
67
|
+
*/
|
|
68
|
+
rowBetween: ViewStyle;
|
|
69
|
+
/**
|
|
70
|
+
* Horizontal row centered
|
|
71
|
+
*/
|
|
72
|
+
rowCenter: ViewStyle;
|
|
73
|
+
/**
|
|
74
|
+
* Standard horizontal padding
|
|
75
|
+
*/
|
|
76
|
+
paddedHorizontal: ViewStyle;
|
|
77
|
+
/**
|
|
78
|
+
* Standard vertical padding
|
|
79
|
+
*/
|
|
80
|
+
paddedVertical: ViewStyle;
|
|
81
|
+
/**
|
|
82
|
+
* Standard padding all sides
|
|
83
|
+
*/
|
|
84
|
+
padded: ViewStyle;
|
|
85
|
+
/**
|
|
86
|
+
* Standard section container
|
|
87
|
+
*/
|
|
88
|
+
section: ViewStyle;
|
|
89
|
+
/**
|
|
90
|
+
* Section with padding
|
|
91
|
+
*/
|
|
92
|
+
sectionPadded: ViewStyle;
|
|
93
|
+
/**
|
|
94
|
+
* Screen title - primary heading
|
|
95
|
+
*/
|
|
96
|
+
screenTitle: TextStyle;
|
|
97
|
+
/**
|
|
98
|
+
* Section title
|
|
99
|
+
*/
|
|
100
|
+
sectionTitle: TextStyle;
|
|
101
|
+
/**
|
|
102
|
+
* Subtitle/description text
|
|
103
|
+
*/
|
|
104
|
+
subtitle: TextStyle;
|
|
105
|
+
/**
|
|
106
|
+
* Body text
|
|
107
|
+
*/
|
|
108
|
+
bodyText: TextStyle;
|
|
109
|
+
/**
|
|
110
|
+
* Secondary text (muted)
|
|
111
|
+
*/
|
|
112
|
+
secondaryText: TextStyle;
|
|
113
|
+
/**
|
|
114
|
+
* Form container
|
|
115
|
+
*/
|
|
116
|
+
form: ViewStyle;
|
|
117
|
+
/**
|
|
118
|
+
* Form header section
|
|
119
|
+
*/
|
|
120
|
+
formHeader: ViewStyle;
|
|
121
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-Specific Constants
|
|
3
|
+
*
|
|
4
|
+
* Design system constants that ensure compliance with platform guidelines.
|
|
5
|
+
* These values are based on official Human Interface Guidelines (HIG) from Apple and Material Design from Google.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* iOS Human Interface Guidelines (HIG) Constants
|
|
9
|
+
*
|
|
10
|
+
* @see https://developer.apple.com/design/human-interface-guidelines/layout
|
|
11
|
+
*/
|
|
12
|
+
export declare const IOS_HIG: {
|
|
13
|
+
/**
|
|
14
|
+
* Minimum Touch Target Size
|
|
15
|
+
*
|
|
16
|
+
* Apple requires a minimum tappable area of 44pt x 44pt for ALL interactive controls.
|
|
17
|
+
* This is enforced during App Store review.
|
|
18
|
+
*
|
|
19
|
+
* @critical Violating this can result in App Store rejection
|
|
20
|
+
*/
|
|
21
|
+
readonly MIN_TOUCH_TARGET: 44;
|
|
22
|
+
/**
|
|
23
|
+
* Recommended Minimum Touch Target Size
|
|
24
|
+
*
|
|
25
|
+
* For better accessibility and usability, Apple recommends 48pt x 48pt.
|
|
26
|
+
*/
|
|
27
|
+
readonly RECOMMENDED_TOUCH_TARGET: 48;
|
|
28
|
+
/**
|
|
29
|
+
* Minimum Text Size
|
|
30
|
+
*
|
|
31
|
+
* Minimum font size for body text to ensure readability.
|
|
32
|
+
*/
|
|
33
|
+
readonly MIN_TEXT_SIZE: 17;
|
|
34
|
+
/**
|
|
35
|
+
* Minimum Contrast Ratio
|
|
36
|
+
*
|
|
37
|
+
* WCAG AA compliance requires 4.5:1 for normal text.
|
|
38
|
+
*/
|
|
39
|
+
readonly MIN_CONTRAST_RATIO: 4.5;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Android Material Design Guidelines Constants
|
|
43
|
+
*
|
|
44
|
+
* @see https://m3.material.io/foundations/layout/applying-layout/window-size-classes
|
|
45
|
+
*/
|
|
46
|
+
export declare const ANDROID_MATERIAL: {
|
|
47
|
+
/**
|
|
48
|
+
* Minimum Touch Target Size
|
|
49
|
+
*
|
|
50
|
+
* Material Design 3 recommends a minimum of 48dp x 48dp.
|
|
51
|
+
*/
|
|
52
|
+
readonly MIN_TOUCH_TARGET: 48;
|
|
53
|
+
/**
|
|
54
|
+
* Minimum Text Size
|
|
55
|
+
*
|
|
56
|
+
* Minimum font size for body text.
|
|
57
|
+
*/
|
|
58
|
+
readonly MIN_TEXT_SIZE: 14;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Universal Platform Constants
|
|
62
|
+
*
|
|
63
|
+
* These values work across both iOS and Android, taking the more restrictive requirement.
|
|
64
|
+
*/
|
|
65
|
+
export declare const PLATFORM_CONSTANTS: {
|
|
66
|
+
/**
|
|
67
|
+
* Minimum Touch Target Size
|
|
68
|
+
*
|
|
69
|
+
* Uses iOS requirement (44pt) as it's more restrictive than Android (48dp).
|
|
70
|
+
* This ensures compliance on both platforms.
|
|
71
|
+
*/
|
|
72
|
+
readonly MIN_TOUCH_TARGET: number;
|
|
73
|
+
/**
|
|
74
|
+
* Recommended Touch Target Size
|
|
75
|
+
*
|
|
76
|
+
* Uses the higher value between iOS and Android recommendations.
|
|
77
|
+
*/
|
|
78
|
+
readonly RECOMMENDED_TOUCH_TARGET: 48;
|
|
79
|
+
/**
|
|
80
|
+
* Minimum Text Size
|
|
81
|
+
*
|
|
82
|
+
* Uses iOS requirement as it's larger.
|
|
83
|
+
*/
|
|
84
|
+
readonly MIN_TEXT_SIZE: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Helper function to validate touch target size
|
|
88
|
+
*
|
|
89
|
+
* @param size - The size to validate (in pt/dp)
|
|
90
|
+
* @returns true if size meets platform requirements
|
|
91
|
+
*/
|
|
92
|
+
export declare const isValidTouchTarget: (size: number) => boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Helper function to get minimum touch target for component
|
|
95
|
+
*
|
|
96
|
+
* @param componentType - The type of component ('button' | 'input' | 'icon' | 'generic')
|
|
97
|
+
* @returns The minimum touch target size for that component type
|
|
98
|
+
*/
|
|
99
|
+
export declare const getMinTouchTarget: (componentType?: "button" | "input" | "icon" | "generic") => number;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Responsive Design Utilities
|
|
3
|
+
*
|
|
4
|
+
* Centralized responsive sizing and spacing utilities to prevent
|
|
5
|
+
* Apple App Store rejection due to layout issues on different devices.
|
|
6
|
+
*
|
|
7
|
+
* Supports:
|
|
8
|
+
* - iPhone 13 mini (5.4" - smallest)
|
|
9
|
+
* - iPhone 13/14/15 (6.1" - standard)
|
|
10
|
+
* - iPhone 14 Pro Max (6.7" - largest phone)
|
|
11
|
+
* - iPad Air (10.9" - tablet)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Get current screen dimensions
|
|
15
|
+
*/
|
|
16
|
+
export declare const getScreenDimensions: () => {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Check if current device is a small phone (iPhone 13 mini, SE)
|
|
22
|
+
*/
|
|
23
|
+
export declare const isSmallPhone: () => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Check if current device is a tablet (iPad)
|
|
26
|
+
*/
|
|
27
|
+
export declare const isTablet: () => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Responsive logo/icon size
|
|
30
|
+
* Small devices: 100-120px
|
|
31
|
+
* Medium devices: 120-160px
|
|
32
|
+
* Tablets: 160-200px
|
|
33
|
+
*/
|
|
34
|
+
export declare const getResponsiveLogoSize: (baseSize?: number) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Responsive multiline input height
|
|
37
|
+
* Prevents keyboard overlap on small devices
|
|
38
|
+
*
|
|
39
|
+
* Small devices: 100-120px
|
|
40
|
+
* Medium devices: 120-150px
|
|
41
|
+
* Tablets: 150-200px
|
|
42
|
+
*/
|
|
43
|
+
export declare const getResponsiveInputHeight: (baseHeight?: number) => number;
|
|
44
|
+
/**
|
|
45
|
+
* Responsive horizontal padding
|
|
46
|
+
* Accounts for safe area on notched devices and iPad
|
|
47
|
+
*/
|
|
48
|
+
export declare const getResponsiveHorizontalPadding: (basePadding?: number, insets?: {
|
|
49
|
+
left: number;
|
|
50
|
+
right: number;
|
|
51
|
+
}) => number;
|
|
52
|
+
/**
|
|
53
|
+
* Responsive bottom positioning
|
|
54
|
+
* Accounts for home indicator and safe area
|
|
55
|
+
*/
|
|
56
|
+
export declare const getResponsiveBottomPosition: (basePosition?: number, insets?: {
|
|
57
|
+
bottom: number;
|
|
58
|
+
}) => number;
|
|
59
|
+
/**
|
|
60
|
+
* Responsive FAB (Floating Action Button) position
|
|
61
|
+
* CRITICAL: Ensures FAB appears above tab bar (70-90px tall) and safe areas
|
|
62
|
+
*
|
|
63
|
+
* Tab bar heights:
|
|
64
|
+
* - iOS: ~80-90px (including safe area)
|
|
65
|
+
* - Android: ~70px
|
|
66
|
+
*
|
|
67
|
+
* FAB positioning:
|
|
68
|
+
* - Tablets: 100px from bottom (generous spacing)
|
|
69
|
+
* - Phones: 90px from bottom (above tab bar)
|
|
70
|
+
* - Safe area aware (home indicator clearance)
|
|
71
|
+
*/
|
|
72
|
+
export declare const getResponsiveFABPosition: (insets?: {
|
|
73
|
+
bottom: number;
|
|
74
|
+
right: number;
|
|
75
|
+
}) => {
|
|
76
|
+
bottom: number;
|
|
77
|
+
right: number;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Responsive modal max height
|
|
81
|
+
* Prevents modals from taking too much space on tablets
|
|
82
|
+
* or too little on small devices
|
|
83
|
+
*/
|
|
84
|
+
export declare const getResponsiveModalMaxHeight: () => string;
|
|
85
|
+
/**
|
|
86
|
+
* Responsive modal min height
|
|
87
|
+
* Ensures modals are always usable and not too small
|
|
88
|
+
* Complements getResponsiveModalMaxHeight for complete modal sizing
|
|
89
|
+
*/
|
|
90
|
+
export declare const getResponsiveMinModalHeight: () => number;
|
|
91
|
+
/**
|
|
92
|
+
* Responsive icon container size
|
|
93
|
+
* Used in onboarding, cards, etc.
|
|
94
|
+
*/
|
|
95
|
+
export declare const getResponsiveIconContainerSize: (baseSize?: number) => number;
|
|
96
|
+
/**
|
|
97
|
+
* Responsive grid columns
|
|
98
|
+
* Returns number of columns for grid layouts
|
|
99
|
+
*/
|
|
100
|
+
export declare const getResponsiveGridColumns: (mobileColumns?: number, tabletColumns?: number) => number;
|
|
101
|
+
/**
|
|
102
|
+
* Responsive max width for content
|
|
103
|
+
* Prevents text from stretching too wide on tablets
|
|
104
|
+
*/
|
|
105
|
+
export declare const getResponsiveMaxWidth: (baseWidth?: number) => number;
|
|
106
|
+
/**
|
|
107
|
+
* Responsive font size
|
|
108
|
+
* Scales text for different devices while respecting minimum sizes
|
|
109
|
+
*/
|
|
110
|
+
export declare const getResponsiveFontSize: (baseFontSize: number) => number;
|
|
111
|
+
/**
|
|
112
|
+
* Check if device is in landscape mode
|
|
113
|
+
*/
|
|
114
|
+
export declare const isLandscape: () => boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Get universal keyboard behavior
|
|
117
|
+
* Returns 'padding' which works across all platforms (iOS, Android, Web)
|
|
118
|
+
*/
|
|
119
|
+
export declare const getKeyboardBehavior: () => "padding" | "height" | "position" | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Device type enum for conditional rendering
|
|
122
|
+
*/
|
|
123
|
+
export declare enum DeviceType {
|
|
124
|
+
SMALL_PHONE = "SMALL_PHONE",
|
|
125
|
+
MEDIUM_PHONE = "MEDIUM_PHONE",
|
|
126
|
+
LARGE_PHONE = "LARGE_PHONE",
|
|
127
|
+
TABLET = "TABLET"
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get current device type
|
|
131
|
+
*/
|
|
132
|
+
export declare const getDeviceType: () => DeviceType;
|
|
133
|
+
/**
|
|
134
|
+
* Apple HIG compliant touch target size
|
|
135
|
+
*/
|
|
136
|
+
export declare const getMinTouchTargetSize: () => number;
|
|
137
|
+
/**
|
|
138
|
+
* Responsive spacing multiplier
|
|
139
|
+
* Returns a multiplier for spacing based on device size
|
|
140
|
+
*/
|
|
141
|
+
export declare const getSpacingMultiplier: () => number;
|
|
142
|
+
/**
|
|
143
|
+
* Onboarding icon container top margin
|
|
144
|
+
* Small phones: 24px (lg), Others: 40px (xxl)
|
|
145
|
+
*/
|
|
146
|
+
export declare const getOnboardingIconMarginTop: () => number;
|
|
147
|
+
/**
|
|
148
|
+
* Onboarding icon container bottom margin
|
|
149
|
+
* Tablets: 60px (xxl * 1.5 for extra breathing room), Others: 40px (xxl)
|
|
150
|
+
*/
|
|
151
|
+
export declare const getOnboardingIconMarginBottom: () => number;
|
|
152
|
+
/**
|
|
153
|
+
* Onboarding title bottom margin
|
|
154
|
+
* Tablets: 24px (lg), Others: 16px (md)
|
|
155
|
+
*/
|
|
156
|
+
export declare const getOnboardingTitleMarginBottom: () => number;
|
|
157
|
+
/**
|
|
158
|
+
* Onboarding text horizontal padding (title and description)
|
|
159
|
+
* Small phones: 8px (sm for tighter fit), Others: 16px (md)
|
|
160
|
+
*/
|
|
161
|
+
export declare const getOnboardingTextPadding: () => number;
|
|
162
|
+
/**
|
|
163
|
+
* Onboarding description top margin
|
|
164
|
+
* Small phones: 4px (xs), Others: 8px (sm)
|
|
165
|
+
*/
|
|
166
|
+
export declare const getOnboardingDescriptionMarginTop: () => number;
|
|
167
|
+
/**
|
|
168
|
+
* Onboarding icon size (for icon inside container)
|
|
169
|
+
* Calculated as ~55% of icon container size for proper visual balance
|
|
170
|
+
* Small phones: ~66px (55% of 120px), Standard: ~77px (55% of 140px), Tablets: ~99px (55% of 180px)
|
|
171
|
+
*/
|
|
172
|
+
export declare const getOnboardingIconSize: () => number;
|
|
173
|
+
/**
|
|
174
|
+
* Keyboard vertical offset for KeyboardAvoidingView
|
|
175
|
+
* Accounts for header/navigation bar height
|
|
176
|
+
* Universal value that works across all platforms
|
|
177
|
+
*/
|
|
178
|
+
export declare const getKeyboardVerticalOffset: () => number;
|
|
179
|
+
/**
|
|
180
|
+
* Form container bottom padding
|
|
181
|
+
* Prevents overlap with bottom tab navigation and ensures submit buttons are accessible
|
|
182
|
+
*
|
|
183
|
+
* Formula: safeAreaBottom + tabBarHeight + extraSpace
|
|
184
|
+
* - Tab bar height: ~56px (iOS/Android standard)
|
|
185
|
+
* - Extra space: ~24px (breathing room for submit button)
|
|
186
|
+
* - Safe area: Variable (home indicator on iPhone)
|
|
187
|
+
* - Minimum: 100px (ensures buttons always accessible)
|
|
188
|
+
*/
|
|
189
|
+
export declare const getFormBottomPadding: (safeAreaBottom: number) => number;
|
|
190
|
+
/**
|
|
191
|
+
* Input field icon size
|
|
192
|
+
* Used for leading/trailing icons and password toggle
|
|
193
|
+
* Apple HIG: Minimum 22px for touch targets
|
|
194
|
+
*/
|
|
195
|
+
export declare const getInputIconSize: () => number;
|
|
196
|
+
/**
|
|
197
|
+
* Form content container width
|
|
198
|
+
* Forms need more generous width than regular content to prevent cramped layouts
|
|
199
|
+
*
|
|
200
|
+
* Strategy:
|
|
201
|
+
* - Phones: undefined (no max width restriction, fills available space)
|
|
202
|
+
* - Tablets: Max 700px (readable but not restrictive)
|
|
203
|
+
*
|
|
204
|
+
* Different from getResponsiveMaxWidth which is for text content (max 400px)
|
|
205
|
+
*
|
|
206
|
+
* @returns number for tablets (700px max), undefined for phones (no restriction)
|
|
207
|
+
*/
|
|
208
|
+
export declare const getFormContentWidth: () => number | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* Form element spacing (vertical)
|
|
211
|
+
* Vertical spacing between form elements (inputs, buttons, etc.)
|
|
212
|
+
* Used with Children.map() wrapper pattern for universal compatibility
|
|
213
|
+
* Replaces CSS gap property (old RN version compatibility)
|
|
214
|
+
*
|
|
215
|
+
* Universal pattern - works on iOS, Android, Web
|
|
216
|
+
*/
|
|
217
|
+
export declare const getFormElementSpacing: () => number;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.26",
|
|
4
4
|
"description": "Universal design system for React Native apps - Domain-Driven Design architecture with Material Design 3 components",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
|
-
"types": "./
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"types": "./
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./src/index.ts",
|
|
11
11
|
"require": "./src/index.ts",
|
|
12
12
|
"default": "./src/index.ts"
|
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
},
|
|
79
79
|
"files": [
|
|
80
80
|
"src",
|
|
81
|
+
"dist",
|
|
81
82
|
"README.md",
|
|
82
83
|
"LICENSE"
|
|
83
84
|
],
|