@umituz/react-native-design-system 1.5.54 → 1.5.56
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/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/presentation/organisms/AppHeader.d.ts +24 -0
- package/dist/presentation/organisms/AppHeader.d.ts.map +1 -0
- package/dist/presentation/organisms/AppHeader.js +76 -0
- package/dist/presentation/tokens/commonStyles.d.ts +122 -0
- package/dist/presentation/tokens/commonStyles.d.ts.map +1 -0
- package/dist/presentation/tokens/commonStyles.js +219 -0
- package/dist/presentation/utils/variants/compound.d.ts +10 -0
- package/dist/presentation/utils/variants/compound.d.ts.map +1 -0
- package/dist/presentation/utils/variants/compound.js +15 -0
- package/dist/presentation/utils/variants/core.d.ts +15 -0
- package/dist/presentation/utils/variants/core.d.ts.map +1 -0
- package/dist/presentation/utils/variants/core.js +22 -0
- package/dist/presentation/utils/variants/helpers.d.ts +5 -0
- package/dist/presentation/utils/variants/helpers.d.ts.map +1 -0
- package/dist/presentation/utils/variants/helpers.js +9 -0
- package/dist/presentation/utils/variants.d.ts +4 -0
- package/dist/presentation/utils/variants.d.ts.map +1 -0
- package/dist/presentation/utils/variants.js +3 -0
- package/package.json +9 -5
- package/src/index.js +28 -0
- package/src/presentation/organisms/AppHeader.js +76 -0
- package/src/presentation/tokens/commonStyles.js +219 -0
- package/src/presentation/utils/variants/compound.js +15 -0
- package/src/presentation/utils/variants/core.js +22 -0
- package/src/presentation/utils/variants/helpers.js +9 -0
- package/src/presentation/utils/variants.js +3 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AtomicButton, AtomicText, AtomicCard, AtomicInput, AtomicTextArea, AtomicPicker, AtomicIcon, AtomicImage, AtomicSwitch, AtomicBadge, AtomicFormError, AtomicAvatar, AtomicChip, AtomicDivider, AtomicProgress, AtomicAvatarGroup, AtomicFab, AtomicFilter, AtomicTouchable, AtomicNumberInput, AtomicDatePicker, AtomicSearchBar, AtomicSort, type AtomicButtonProps, type AtomicTextProps, type AtomicCardProps, type AtomicInputProps, type AtomicTextAreaProps, type AtomicPickerProps, type AtomicIconProps, type AtomicImageProps, type AtomicSwitchProps, type AtomicBadgeProps, type AtomicFormErrorProps, type AtomicAvatarProps, type AtomicChipProps, type AtomicDividerProps, type AtomicProgressProps, type AtomicAvatarGroupProps, type AtomicFabProps, type AtomicFilterProps, type AtomicTouchableProps, type AtomicNumberInputProps, type AtomicDatePickerProps, type AtomicSearchBarProps, type AtomicSortProps, type IconName, type IconSize, type IconColor, } from '@umituz/react-native-design-system-atoms';
|
|
2
|
+
export { AtomicIcon as Icon, type AtomicIconProps as IconProps, } from '@umituz/react-native-design-system-atoms';
|
|
3
|
+
export { FormField, ListItem, SearchBar, SectionCard, IconContainer, ScreenHeader, EmptyState, SectionHeader, SectionContainer, GridContainer, ConfirmationModal, useConfirmationModal, type FormFieldProps, type ListItemProps, type SearchBarProps, type ScreenHeaderProps, type ConfirmationModalProps, type ConfirmationModalVariant, } from '@umituz/react-native-design-system-molecules';
|
|
4
|
+
export { ConfirmationModal as AtomicConfirmationModal, type ConfirmationModalProps as AtomicConfirmationModalProps, } from '@umituz/react-native-design-system-molecules';
|
|
5
|
+
export { AppHeader, ScreenLayout, FormContainer, type AppHeaderProps, type ScreenLayoutProps, type FormContainerProps, } from '@umituz/react-native-design-system-organisms';
|
|
6
|
+
export type { TextStyleVariant, ColorVariant, } from '@umituz/react-native-design-system-typography';
|
|
7
|
+
export { createDesignTokens, STATIC_DESIGN_TOKENS, BASE_TOKENS, STATIC_TOKENS, withAlpha, lightColors, darkColors, getColorPalette, useAppDesignTokens, useDesignSystemTheme, useTheme, lightTheme, darkTheme, createResponsiveValue, ThemeStorage, type DesignTokens, type ThemeMode, type ColorPalette, type BaseTokens, type Spacing, type Typography, type Borders, type Theme, type ExtendedColorPalette, } from '@umituz/react-native-design-system-theme';
|
|
8
|
+
export { useCommonStyles, } from './presentation/tokens/commonStyles';
|
|
9
|
+
export { IOS_HIG, ANDROID_MATERIAL, PLATFORM_CONSTANTS, isValidTouchTarget, getMinTouchTarget, useResponsive, useResponsiveSizes, useDeviceType, getScreenDimensions, isSmallPhone, isTablet, getResponsiveLogoSize, getResponsiveInputHeight, getResponsiveHorizontalPadding, getResponsiveBottomPosition, getResponsiveFABPosition, getResponsiveModalMaxHeight, getResponsiveMinModalHeight, getResponsiveIconContainerSize, getResponsiveGridColumns, getResponsiveMaxWidth, getResponsiveFontSize, isLandscape, getKeyboardBehavior, getDeviceType, getMinTouchTargetSize, getSpacingMultiplier, getOnboardingIconMarginTop, getOnboardingIconMarginBottom, getOnboardingTitleMarginBottom, getOnboardingTextPadding, getOnboardingDescriptionMarginTop, type UseResponsiveReturn, type DeviceType, } from '@umituz/react-native-design-system-responsive';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ATOMS - Atomic Design Components
|
|
3
|
+
// =============================================================================
|
|
4
|
+
export { AtomicButton, AtomicText, AtomicCard, AtomicInput, AtomicTextArea, AtomicPicker, AtomicIcon, AtomicImage, AtomicSwitch, AtomicBadge, AtomicFormError, AtomicAvatar, AtomicChip, AtomicDivider, AtomicProgress, AtomicAvatarGroup, AtomicFab, AtomicFilter, AtomicTouchable, AtomicNumberInput, AtomicDatePicker, AtomicSearchBar, AtomicSort, } from '@umituz/react-native-design-system-atoms';
|
|
5
|
+
// Icon alias
|
|
6
|
+
export { AtomicIcon as Icon, } from '@umituz/react-native-design-system-atoms';
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// MOLECULES - Composite Components
|
|
9
|
+
// =============================================================================
|
|
10
|
+
export { FormField, ListItem, SearchBar, SectionCard, IconContainer, ScreenHeader, EmptyState, SectionHeader, SectionContainer, GridContainer, ConfirmationModal, useConfirmationModal, } from '@umituz/react-native-design-system-molecules';
|
|
11
|
+
// ConfirmationModal alias
|
|
12
|
+
export { ConfirmationModal as AtomicConfirmationModal, } from '@umituz/react-native-design-system-molecules';
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// ORGANISMS - Complex Patterns
|
|
15
|
+
// =============================================================================
|
|
16
|
+
export { AppHeader, ScreenLayout, FormContainer, } from '@umituz/react-native-design-system-organisms';
|
|
17
|
+
// =============================================================================
|
|
18
|
+
// THEME & DESIGN TOKENS
|
|
19
|
+
// =============================================================================
|
|
20
|
+
export { createDesignTokens, STATIC_DESIGN_TOKENS, BASE_TOKENS, STATIC_TOKENS, withAlpha, lightColors, darkColors, getColorPalette, useAppDesignTokens, useDesignSystemTheme, useTheme, lightTheme, darkTheme, createResponsiveValue, ThemeStorage, } from '@umituz/react-native-design-system-theme';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// COMMON STYLES
|
|
23
|
+
// =============================================================================
|
|
24
|
+
export { useCommonStyles, } from './presentation/tokens/commonStyles';
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// RESPONSIVE UTILITIES
|
|
27
|
+
// =============================================================================
|
|
28
|
+
export { IOS_HIG, ANDROID_MATERIAL, PLATFORM_CONSTANTS, isValidTouchTarget, getMinTouchTarget, useResponsive, useResponsiveSizes, useDeviceType, getScreenDimensions, isSmallPhone, isTablet, getResponsiveLogoSize, getResponsiveInputHeight, getResponsiveHorizontalPadding, getResponsiveBottomPosition, getResponsiveFABPosition, getResponsiveModalMaxHeight, getResponsiveMinModalHeight, getResponsiveIconContainerSize, getResponsiveGridColumns, getResponsiveMaxWidth, getResponsiveFontSize, isLandscape, getKeyboardBehavior, getDeviceType, getMinTouchTargetSize, getSpacingMultiplier, getOnboardingIconMarginTop, getOnboardingIconMarginBottom, getOnboardingTitleMarginBottom, getOnboardingTextPadding, getOnboardingDescriptionMarginTop, } from '@umituz/react-native-design-system-responsive';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppHeader Organism - Application Header Component
|
|
3
|
+
*
|
|
4
|
+
* Complex header combining atoms and molecules
|
|
5
|
+
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
+
*
|
|
7
|
+
* Atomic Design Level: ORGANISM
|
|
8
|
+
* Composition: AtomicIcon + AtomicText + AtomicButton + SearchBar
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { ViewStyle } from 'react-native';
|
|
12
|
+
export interface AppHeaderProps {
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
leftIcon?: string;
|
|
16
|
+
onLeftPress?: () => void;
|
|
17
|
+
rightIcon?: string;
|
|
18
|
+
onRightPress?: () => void;
|
|
19
|
+
showShadow?: boolean;
|
|
20
|
+
backgroundColor?: string;
|
|
21
|
+
style?: ViewStyle;
|
|
22
|
+
}
|
|
23
|
+
export declare const AppHeader: React.FC<AppHeaderProps>;
|
|
24
|
+
//# sourceMappingURL=AppHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../../../src/presentation/organisms/AppHeader.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,SAAS,EAAgB,MAAM,cAAc,CAAC;AAI7D,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAMD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAwD9C,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppHeader Organism - Application Header Component
|
|
3
|
+
*
|
|
4
|
+
* Complex header combining atoms and molecules
|
|
5
|
+
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
+
*
|
|
7
|
+
* Atomic Design Level: ORGANISM
|
|
8
|
+
* Composition: AtomicIcon + AtomicText + AtomicButton + SearchBar
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { View, SafeAreaView } from 'react-native';
|
|
12
|
+
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
13
|
+
import { AtomicText, AtomicButton } from '@umituz/react-native-design-system-atoms';
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// COMPONENT IMPLEMENTATION
|
|
16
|
+
// =============================================================================
|
|
17
|
+
export const AppHeader = ({ title, subtitle, leftIcon, onLeftPress, rightIcon, onRightPress, showShadow = true, backgroundColor, style, }) => {
|
|
18
|
+
const tokens = useAppDesignTokens();
|
|
19
|
+
const bgColor = backgroundColor || tokens.colors.surface;
|
|
20
|
+
const styles = getStyles(tokens);
|
|
21
|
+
return (<SafeAreaView style={[styles.safeArea, { backgroundColor: bgColor }]}>
|
|
22
|
+
<View style={[styles.container, { backgroundColor: bgColor }, style]}>
|
|
23
|
+
{/* Left Action */}
|
|
24
|
+
<View style={styles.leftContainer}>
|
|
25
|
+
{leftIcon && onLeftPress && (<AtomicButton variant="text" size="sm" onPress={onLeftPress} icon={leftIcon}/>)}
|
|
26
|
+
</View>
|
|
27
|
+
|
|
28
|
+
{/* Title Section */}
|
|
29
|
+
<View style={styles.titleContainer}>
|
|
30
|
+
<AtomicText type="titleLarge" color="primary" numberOfLines={1}>
|
|
31
|
+
{title}
|
|
32
|
+
</AtomicText>
|
|
33
|
+
{subtitle && (<AtomicText type="bodySmall" color="secondary" numberOfLines={1}>
|
|
34
|
+
{subtitle}
|
|
35
|
+
</AtomicText>)}
|
|
36
|
+
</View>
|
|
37
|
+
|
|
38
|
+
{/* Right Action */}
|
|
39
|
+
<View style={styles.rightContainer}>
|
|
40
|
+
{rightIcon && onRightPress && (<AtomicButton variant="text" size="sm" onPress={onRightPress} icon={rightIcon}/>)}
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
</SafeAreaView>);
|
|
44
|
+
};
|
|
45
|
+
// =============================================================================
|
|
46
|
+
// STYLES
|
|
47
|
+
// =============================================================================
|
|
48
|
+
const getStyles = (tokens) => ({
|
|
49
|
+
safeArea: {
|
|
50
|
+
backgroundColor: tokens.colors.surface,
|
|
51
|
+
},
|
|
52
|
+
container: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'space-between',
|
|
56
|
+
paddingHorizontal: tokens.spacing.md,
|
|
57
|
+
paddingVertical: tokens.spacing.sm,
|
|
58
|
+
minHeight: tokens.iconSizes.xl + tokens.spacing.md,
|
|
59
|
+
},
|
|
60
|
+
leftContainer: {
|
|
61
|
+
width: tokens.iconSizes.xl + tokens.spacing.sm,
|
|
62
|
+
alignItems: 'flex-start',
|
|
63
|
+
},
|
|
64
|
+
titleContainer: {
|
|
65
|
+
flex: 1,
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
paddingHorizontal: tokens.spacing.sm,
|
|
68
|
+
},
|
|
69
|
+
rightContainer: {
|
|
70
|
+
width: tokens.iconSizes.xl + tokens.spacing.sm,
|
|
71
|
+
alignItems: 'flex-start',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// EXPORTS
|
|
76
|
+
// =============================================================================
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
};
|
|
122
|
+
//# sourceMappingURL=commonStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonStyles.d.ts","sourceRoot":"","sources":["../../../src/presentation/tokens/commonStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD;;GAEG;AACH,eAAO,MAAM,eAAe;IAQxB;;;OAGG;qBAIE,SAAS;IAEd;;;OAGG;mBAGE,SAAS;IAEd;;OAEG;8BAIE,SAAS;IAMd;;OAEG;gBAGE,SAAS;IAEd;;OAEG;mBAIE,SAAS;IAEd;;OAEG;uBAIE,SAAS;IAEd;;OAEG;2BAKE,SAAS;IAMd;;;OAGG;qBAKE,SAAS;IAEd;;OAEG;2BAME,SAAS;IAEd;;OAEG;SAIE,SAAS;IAEd;;OAEG;gBAKE,SAAS;IAEd;;OAEG;eAKE,SAAS;IAMd;;OAEG;sBAGE,SAAS;IAEd;;OAEG;oBAGE,SAAS;IAEd;;OAEG;YAGE,SAAS;IAMd;;OAEG;aAGE,SAAS;IAEd;;OAEG;mBAIE,SAAS;IAMd;;OAEG;iBAKE,SAAS;IAEd;;OAEG;kBAKE,SAAS;IAEd;;OAEG;cAKE,SAAS;IAEd;;OAEG;cAIE,SAAS;IAEd;;OAEG;mBAIE,SAAS;IAMd;;OAEG;UAGE,SAAS;IAEd;;OAEG;gBAIE,SAAS;CAEjB,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
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 { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
18
|
+
/**
|
|
19
|
+
* Hook to get common styles with dynamic theme support
|
|
20
|
+
*/
|
|
21
|
+
export const useCommonStyles = () => {
|
|
22
|
+
const tokens = useAppDesignTokens();
|
|
23
|
+
return {
|
|
24
|
+
// ========================================================================
|
|
25
|
+
// SCREEN CONTAINERS
|
|
26
|
+
// ========================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Standard full-screen container
|
|
29
|
+
* Most common pattern: flex: 1 with background color
|
|
30
|
+
*/
|
|
31
|
+
screenContainer: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
backgroundColor: tokens.colors.backgroundPrimary,
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Basic flex container without background
|
|
37
|
+
* Use when background is set elsewhere or not needed
|
|
38
|
+
*/
|
|
39
|
+
flexContainer: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Screen container with secondary background
|
|
44
|
+
*/
|
|
45
|
+
screenContainerSecondary: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
backgroundColor: tokens.colors.backgroundSecondary,
|
|
48
|
+
},
|
|
49
|
+
// ========================================================================
|
|
50
|
+
// SCROLL CONTAINERS
|
|
51
|
+
// ========================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Standard ScrollView wrapper
|
|
54
|
+
*/
|
|
55
|
+
scrollView: {
|
|
56
|
+
flex: 1,
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* ScrollView content container with standard padding
|
|
60
|
+
*/
|
|
61
|
+
scrollContent: {
|
|
62
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
63
|
+
paddingBottom: tokens.spacing.xl,
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* ScrollView content that grows to fill available space
|
|
67
|
+
*/
|
|
68
|
+
scrollContentGrow: {
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
padding: tokens.spacing.lg,
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Centered scroll content (for forms, onboarding screens)
|
|
74
|
+
*/
|
|
75
|
+
scrollContentCentered: {
|
|
76
|
+
flexGrow: 1,
|
|
77
|
+
padding: tokens.spacing.lg,
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
},
|
|
80
|
+
// ========================================================================
|
|
81
|
+
// LAYOUT UTILITIES
|
|
82
|
+
// ========================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Centered container - both horizontal and vertical
|
|
85
|
+
* Perfect for empty states, splash screens
|
|
86
|
+
*/
|
|
87
|
+
centerContainer: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
justifyContent: 'center',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Centered container with padding
|
|
94
|
+
*/
|
|
95
|
+
centerContainerPadded: {
|
|
96
|
+
flex: 1,
|
|
97
|
+
justifyContent: 'center',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
paddingHorizontal: tokens.spacing.xl,
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Horizontal row layout
|
|
103
|
+
*/
|
|
104
|
+
row: {
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Horizontal row with space between
|
|
110
|
+
*/
|
|
111
|
+
rowBetween: {
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'space-between',
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Horizontal row centered
|
|
118
|
+
*/
|
|
119
|
+
rowCenter: {
|
|
120
|
+
flexDirection: 'row',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
},
|
|
124
|
+
// ========================================================================
|
|
125
|
+
// PADDING UTILITIES
|
|
126
|
+
// ========================================================================
|
|
127
|
+
/**
|
|
128
|
+
* Standard horizontal padding
|
|
129
|
+
*/
|
|
130
|
+
paddedHorizontal: {
|
|
131
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* Standard vertical padding
|
|
135
|
+
*/
|
|
136
|
+
paddedVertical: {
|
|
137
|
+
paddingVertical: tokens.spacing.lg,
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Standard padding all sides
|
|
141
|
+
*/
|
|
142
|
+
padded: {
|
|
143
|
+
padding: tokens.spacing.lg,
|
|
144
|
+
},
|
|
145
|
+
// ========================================================================
|
|
146
|
+
// SECTION STYLES
|
|
147
|
+
// ========================================================================
|
|
148
|
+
/**
|
|
149
|
+
* Standard section container
|
|
150
|
+
*/
|
|
151
|
+
section: {
|
|
152
|
+
marginBottom: tokens.spacing.xl,
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Section with padding
|
|
156
|
+
*/
|
|
157
|
+
sectionPadded: {
|
|
158
|
+
marginBottom: tokens.spacing.xl,
|
|
159
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
160
|
+
},
|
|
161
|
+
// ========================================================================
|
|
162
|
+
// TEXT STYLES
|
|
163
|
+
// ========================================================================
|
|
164
|
+
/**
|
|
165
|
+
* Screen title - primary heading
|
|
166
|
+
*/
|
|
167
|
+
screenTitle: {
|
|
168
|
+
...tokens.typography.headingLarge,
|
|
169
|
+
color: tokens.colors.textPrimary,
|
|
170
|
+
marginBottom: tokens.spacing.sm,
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Section title
|
|
174
|
+
*/
|
|
175
|
+
sectionTitle: {
|
|
176
|
+
...tokens.typography.headingMedium,
|
|
177
|
+
color: tokens.colors.textPrimary,
|
|
178
|
+
marginBottom: tokens.spacing.md,
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Subtitle/description text
|
|
182
|
+
*/
|
|
183
|
+
subtitle: {
|
|
184
|
+
...tokens.typography.bodyMedium,
|
|
185
|
+
color: tokens.colors.textSecondary,
|
|
186
|
+
textAlign: 'center',
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Body text
|
|
190
|
+
*/
|
|
191
|
+
bodyText: {
|
|
192
|
+
...tokens.typography.bodyMedium,
|
|
193
|
+
color: tokens.colors.textPrimary,
|
|
194
|
+
},
|
|
195
|
+
/**
|
|
196
|
+
* Secondary text (muted)
|
|
197
|
+
*/
|
|
198
|
+
secondaryText: {
|
|
199
|
+
...tokens.typography.bodySmall,
|
|
200
|
+
color: tokens.colors.textSecondary,
|
|
201
|
+
},
|
|
202
|
+
// ========================================================================
|
|
203
|
+
// FORM STYLES
|
|
204
|
+
// ========================================================================
|
|
205
|
+
/**
|
|
206
|
+
* Form container
|
|
207
|
+
*/
|
|
208
|
+
form: {
|
|
209
|
+
width: '100%',
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* Form header section
|
|
213
|
+
*/
|
|
214
|
+
formHeader: {
|
|
215
|
+
alignItems: 'center',
|
|
216
|
+
marginBottom: tokens.spacing.xl,
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Style, VariantConfig, VariantProps } from './core';
|
|
2
|
+
export type CompoundVariant<T extends Record<string, any>> = {
|
|
3
|
+
conditions: Partial<VariantProps<T>>;
|
|
4
|
+
style: Style;
|
|
5
|
+
};
|
|
6
|
+
export type AdvancedVariantConfig<T extends Record<string, any>> = VariantConfig<T> & {
|
|
7
|
+
compoundVariants?: CompoundVariant<T>[];
|
|
8
|
+
};
|
|
9
|
+
export declare function createAdvancedVariants<T extends Record<string, any>>(config: AdvancedVariantConfig<T>): (props?: VariantProps<T>) => Style;
|
|
10
|
+
//# sourceMappingURL=compound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compound.d.ts","sourceRoot":"","sources":["../../../../src/presentation/utils/variants/compound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,YAAY,EAAkB,MAAM,QAAQ,CAAC;AAE5E,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IAC3D,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG;IACpF,gBAAgB,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;CACzC,CAAC;AAEF,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,IAGnF,QAAO,YAAY,CAAC,CAAC,CAAM,KAAG,KAAK,CAcrD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createVariants } from './core';
|
|
2
|
+
export function createAdvancedVariants(config) {
|
|
3
|
+
const baseVariantFn = createVariants(config);
|
|
4
|
+
return function (props = {}) {
|
|
5
|
+
let result = baseVariantFn(props);
|
|
6
|
+
if (config.compoundVariants) {
|
|
7
|
+
for (const compound of config.compoundVariants) {
|
|
8
|
+
const conditionsMet = Object.entries(compound.conditions).every(([key, value]) => props[key] === value);
|
|
9
|
+
if (conditionsMet)
|
|
10
|
+
result = { ...result, ...compound.style };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ViewStyle, TextStyle, ImageStyle } from 'react-native';
|
|
2
|
+
type Style = ViewStyle | TextStyle | ImageStyle;
|
|
3
|
+
export type VariantConfig<T extends Record<string, any>> = {
|
|
4
|
+
base?: Style;
|
|
5
|
+
variants?: T;
|
|
6
|
+
defaultVariants?: {
|
|
7
|
+
[K in keyof T]?: keyof T[K];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type VariantProps<T extends Record<string, any>> = {
|
|
11
|
+
[K in keyof T]?: keyof T[K];
|
|
12
|
+
};
|
|
13
|
+
export declare function createVariants<T extends Record<string, any>>(config: VariantConfig<T>): (props?: VariantProps<T>) => Style;
|
|
14
|
+
export type { Style };
|
|
15
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/presentation/utils/variants/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEhE,KAAK,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEhD,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;IACzD,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,eAAe,CAAC,EAAE;SAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;KAAE,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;KACvD,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CAC5B,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,IACnE,QAAO,YAAY,CAAC,CAAC,CAAM,KAAG,KAAK,CAqBrD;AAED,YAAY,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function createVariants(config) {
|
|
2
|
+
return function (props = {}) {
|
|
3
|
+
let result = { ...config.base };
|
|
4
|
+
if (config.defaultVariants) {
|
|
5
|
+
for (const [variantKey, defaultValue] of Object.entries(config.defaultVariants)) {
|
|
6
|
+
if (config.variants?.[variantKey] && defaultValue) {
|
|
7
|
+
const variantStyle = config.variants[variantKey][defaultValue];
|
|
8
|
+
if (variantStyle)
|
|
9
|
+
result = { ...result, ...variantStyle };
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
for (const [variantKey, variantValue] of Object.entries(props)) {
|
|
14
|
+
if (config.variants?.[variantKey] && variantValue) {
|
|
15
|
+
const variantStyle = config.variants[variantKey][variantValue];
|
|
16
|
+
if (variantStyle)
|
|
17
|
+
result = { ...result, ...variantStyle };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Style } from './core';
|
|
2
|
+
export declare function combineStyles<T extends Style>(...styles: (T | undefined | null | false)[]): T;
|
|
3
|
+
export declare function conditionalStyle<T extends Style>(condition: boolean, trueStyle: T, falseStyle?: T): T | undefined;
|
|
4
|
+
export declare function responsiveStyle<T extends Style>(small: T, medium?: T, large?: T): T;
|
|
5
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/presentation/utils/variants/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,wBAAgB,aAAa,CAAC,CAAC,SAAS,KAAK,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAE7F;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAEjH;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAEnF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function combineStyles(...styles) {
|
|
2
|
+
return styles.reduce((acc, style) => (style ? { ...acc, ...style } : acc), {});
|
|
3
|
+
}
|
|
4
|
+
export function conditionalStyle(condition, trueStyle, falseStyle) {
|
|
5
|
+
return condition ? trueStyle : falseStyle;
|
|
6
|
+
}
|
|
7
|
+
export function responsiveStyle(small, medium, large) {
|
|
8
|
+
return small;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../src/presentation/utils/variants.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.56",
|
|
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
6
|
"types": "./src/index.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"
|
|
16
|
+
"build": "npx --yes -p typescript tsc --skipLibCheck || true",
|
|
17
|
+
"prebuild": "rm -rf dist",
|
|
18
|
+
"prepublishOnly": "npm run build",
|
|
19
|
+
"typecheck": "npx --yes -p typescript tsc --noEmit --skipLibCheck",
|
|
16
20
|
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
|
|
17
21
|
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
|
|
18
22
|
"version:patch": "npm version patch -m 'chore: release v%s'",
|
package/src/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// =============================================================================
|
|
2
|
+
// ATOMS - Atomic Design Components
|
|
3
|
+
// =============================================================================
|
|
4
|
+
export { AtomicButton, AtomicText, AtomicCard, AtomicInput, AtomicTextArea, AtomicPicker, AtomicIcon, AtomicImage, AtomicSwitch, AtomicBadge, AtomicFormError, AtomicAvatar, AtomicChip, AtomicDivider, AtomicProgress, AtomicAvatarGroup, AtomicFab, AtomicFilter, AtomicTouchable, AtomicNumberInput, AtomicDatePicker, AtomicSearchBar, AtomicSort, } from '@umituz/react-native-design-system-atoms';
|
|
5
|
+
// Icon alias
|
|
6
|
+
export { AtomicIcon as Icon, } from '@umituz/react-native-design-system-atoms';
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// MOLECULES - Composite Components
|
|
9
|
+
// =============================================================================
|
|
10
|
+
export { FormField, ListItem, SearchBar, SectionCard, IconContainer, ScreenHeader, EmptyState, SectionHeader, SectionContainer, GridContainer, ConfirmationModal, useConfirmationModal, } from '@umituz/react-native-design-system-molecules';
|
|
11
|
+
// ConfirmationModal alias
|
|
12
|
+
export { ConfirmationModal as AtomicConfirmationModal, } from '@umituz/react-native-design-system-molecules';
|
|
13
|
+
// =============================================================================
|
|
14
|
+
// ORGANISMS - Complex Patterns
|
|
15
|
+
// =============================================================================
|
|
16
|
+
export { AppHeader, ScreenLayout, FormContainer, } from '@umituz/react-native-design-system-organisms';
|
|
17
|
+
// =============================================================================
|
|
18
|
+
// THEME & DESIGN TOKENS
|
|
19
|
+
// =============================================================================
|
|
20
|
+
export { createDesignTokens, STATIC_DESIGN_TOKENS, BASE_TOKENS, STATIC_TOKENS, withAlpha, lightColors, darkColors, getColorPalette, useAppDesignTokens, useDesignSystemTheme, useTheme, lightTheme, darkTheme, createResponsiveValue, ThemeStorage, } from '@umituz/react-native-design-system-theme';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// COMMON STYLES
|
|
23
|
+
// =============================================================================
|
|
24
|
+
export { useCommonStyles, } from './presentation/tokens/commonStyles';
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// RESPONSIVE UTILITIES
|
|
27
|
+
// =============================================================================
|
|
28
|
+
export { IOS_HIG, ANDROID_MATERIAL, PLATFORM_CONSTANTS, isValidTouchTarget, getMinTouchTarget, useResponsive, useResponsiveSizes, useDeviceType, getScreenDimensions, isSmallPhone, isTablet, getResponsiveLogoSize, getResponsiveInputHeight, getResponsiveHorizontalPadding, getResponsiveBottomPosition, getResponsiveFABPosition, getResponsiveModalMaxHeight, getResponsiveMinModalHeight, getResponsiveIconContainerSize, getResponsiveGridColumns, getResponsiveMaxWidth, getResponsiveFontSize, isLandscape, getKeyboardBehavior, getDeviceType, getMinTouchTargetSize, getSpacingMultiplier, getOnboardingIconMarginTop, getOnboardingIconMarginBottom, getOnboardingTitleMarginBottom, getOnboardingTextPadding, getOnboardingDescriptionMarginTop, } from '@umituz/react-native-design-system-responsive';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppHeader Organism - Application Header Component
|
|
3
|
+
*
|
|
4
|
+
* Complex header combining atoms and molecules
|
|
5
|
+
* Theme: {{THEME_NAME}} ({{CATEGORY}} category)
|
|
6
|
+
*
|
|
7
|
+
* Atomic Design Level: ORGANISM
|
|
8
|
+
* Composition: AtomicIcon + AtomicText + AtomicButton + SearchBar
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { View, SafeAreaView } from 'react-native';
|
|
12
|
+
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
13
|
+
import { AtomicText, AtomicButton } from '@umituz/react-native-design-system-atoms';
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// COMPONENT IMPLEMENTATION
|
|
16
|
+
// =============================================================================
|
|
17
|
+
export const AppHeader = ({ title, subtitle, leftIcon, onLeftPress, rightIcon, onRightPress, showShadow = true, backgroundColor, style, }) => {
|
|
18
|
+
const tokens = useAppDesignTokens();
|
|
19
|
+
const bgColor = backgroundColor || tokens.colors.surface;
|
|
20
|
+
const styles = getStyles(tokens);
|
|
21
|
+
return (<SafeAreaView style={[styles.safeArea, { backgroundColor: bgColor }]}>
|
|
22
|
+
<View style={[styles.container, { backgroundColor: bgColor }, style]}>
|
|
23
|
+
{/* Left Action */}
|
|
24
|
+
<View style={styles.leftContainer}>
|
|
25
|
+
{leftIcon && onLeftPress && (<AtomicButton variant="text" size="sm" onPress={onLeftPress} icon={leftIcon}/>)}
|
|
26
|
+
</View>
|
|
27
|
+
|
|
28
|
+
{/* Title Section */}
|
|
29
|
+
<View style={styles.titleContainer}>
|
|
30
|
+
<AtomicText type="titleLarge" color="primary" numberOfLines={1}>
|
|
31
|
+
{title}
|
|
32
|
+
</AtomicText>
|
|
33
|
+
{subtitle && (<AtomicText type="bodySmall" color="secondary" numberOfLines={1}>
|
|
34
|
+
{subtitle}
|
|
35
|
+
</AtomicText>)}
|
|
36
|
+
</View>
|
|
37
|
+
|
|
38
|
+
{/* Right Action */}
|
|
39
|
+
<View style={styles.rightContainer}>
|
|
40
|
+
{rightIcon && onRightPress && (<AtomicButton variant="text" size="sm" onPress={onRightPress} icon={rightIcon}/>)}
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
</SafeAreaView>);
|
|
44
|
+
};
|
|
45
|
+
// =============================================================================
|
|
46
|
+
// STYLES
|
|
47
|
+
// =============================================================================
|
|
48
|
+
const getStyles = (tokens) => ({
|
|
49
|
+
safeArea: {
|
|
50
|
+
backgroundColor: tokens.colors.surface,
|
|
51
|
+
},
|
|
52
|
+
container: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'space-between',
|
|
56
|
+
paddingHorizontal: tokens.spacing.md,
|
|
57
|
+
paddingVertical: tokens.spacing.sm,
|
|
58
|
+
minHeight: tokens.iconSizes.xl + tokens.spacing.md,
|
|
59
|
+
},
|
|
60
|
+
leftContainer: {
|
|
61
|
+
width: tokens.iconSizes.xl + tokens.spacing.sm,
|
|
62
|
+
alignItems: 'flex-start',
|
|
63
|
+
},
|
|
64
|
+
titleContainer: {
|
|
65
|
+
flex: 1,
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
paddingHorizontal: tokens.spacing.sm,
|
|
68
|
+
},
|
|
69
|
+
rightContainer: {
|
|
70
|
+
width: tokens.iconSizes.xl + tokens.spacing.sm,
|
|
71
|
+
alignItems: 'flex-start',
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// =============================================================================
|
|
75
|
+
// EXPORTS
|
|
76
|
+
// =============================================================================
|
|
@@ -0,0 +1,219 @@
|
|
|
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 { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
18
|
+
/**
|
|
19
|
+
* Hook to get common styles with dynamic theme support
|
|
20
|
+
*/
|
|
21
|
+
export const useCommonStyles = () => {
|
|
22
|
+
const tokens = useAppDesignTokens();
|
|
23
|
+
return {
|
|
24
|
+
// ========================================================================
|
|
25
|
+
// SCREEN CONTAINERS
|
|
26
|
+
// ========================================================================
|
|
27
|
+
/**
|
|
28
|
+
* Standard full-screen container
|
|
29
|
+
* Most common pattern: flex: 1 with background color
|
|
30
|
+
*/
|
|
31
|
+
screenContainer: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
backgroundColor: tokens.colors.backgroundPrimary,
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* Basic flex container without background
|
|
37
|
+
* Use when background is set elsewhere or not needed
|
|
38
|
+
*/
|
|
39
|
+
flexContainer: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Screen container with secondary background
|
|
44
|
+
*/
|
|
45
|
+
screenContainerSecondary: {
|
|
46
|
+
flex: 1,
|
|
47
|
+
backgroundColor: tokens.colors.backgroundSecondary,
|
|
48
|
+
},
|
|
49
|
+
// ========================================================================
|
|
50
|
+
// SCROLL CONTAINERS
|
|
51
|
+
// ========================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Standard ScrollView wrapper
|
|
54
|
+
*/
|
|
55
|
+
scrollView: {
|
|
56
|
+
flex: 1,
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* ScrollView content container with standard padding
|
|
60
|
+
*/
|
|
61
|
+
scrollContent: {
|
|
62
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
63
|
+
paddingBottom: tokens.spacing.xl,
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* ScrollView content that grows to fill available space
|
|
67
|
+
*/
|
|
68
|
+
scrollContentGrow: {
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
padding: tokens.spacing.lg,
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Centered scroll content (for forms, onboarding screens)
|
|
74
|
+
*/
|
|
75
|
+
scrollContentCentered: {
|
|
76
|
+
flexGrow: 1,
|
|
77
|
+
padding: tokens.spacing.lg,
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
},
|
|
80
|
+
// ========================================================================
|
|
81
|
+
// LAYOUT UTILITIES
|
|
82
|
+
// ========================================================================
|
|
83
|
+
/**
|
|
84
|
+
* Centered container - both horizontal and vertical
|
|
85
|
+
* Perfect for empty states, splash screens
|
|
86
|
+
*/
|
|
87
|
+
centerContainer: {
|
|
88
|
+
flex: 1,
|
|
89
|
+
justifyContent: 'center',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Centered container with padding
|
|
94
|
+
*/
|
|
95
|
+
centerContainerPadded: {
|
|
96
|
+
flex: 1,
|
|
97
|
+
justifyContent: 'center',
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
paddingHorizontal: tokens.spacing.xl,
|
|
100
|
+
},
|
|
101
|
+
/**
|
|
102
|
+
* Horizontal row layout
|
|
103
|
+
*/
|
|
104
|
+
row: {
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Horizontal row with space between
|
|
110
|
+
*/
|
|
111
|
+
rowBetween: {
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'space-between',
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* Horizontal row centered
|
|
118
|
+
*/
|
|
119
|
+
rowCenter: {
|
|
120
|
+
flexDirection: 'row',
|
|
121
|
+
alignItems: 'center',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
},
|
|
124
|
+
// ========================================================================
|
|
125
|
+
// PADDING UTILITIES
|
|
126
|
+
// ========================================================================
|
|
127
|
+
/**
|
|
128
|
+
* Standard horizontal padding
|
|
129
|
+
*/
|
|
130
|
+
paddedHorizontal: {
|
|
131
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* Standard vertical padding
|
|
135
|
+
*/
|
|
136
|
+
paddedVertical: {
|
|
137
|
+
paddingVertical: tokens.spacing.lg,
|
|
138
|
+
},
|
|
139
|
+
/**
|
|
140
|
+
* Standard padding all sides
|
|
141
|
+
*/
|
|
142
|
+
padded: {
|
|
143
|
+
padding: tokens.spacing.lg,
|
|
144
|
+
},
|
|
145
|
+
// ========================================================================
|
|
146
|
+
// SECTION STYLES
|
|
147
|
+
// ========================================================================
|
|
148
|
+
/**
|
|
149
|
+
* Standard section container
|
|
150
|
+
*/
|
|
151
|
+
section: {
|
|
152
|
+
marginBottom: tokens.spacing.xl,
|
|
153
|
+
},
|
|
154
|
+
/**
|
|
155
|
+
* Section with padding
|
|
156
|
+
*/
|
|
157
|
+
sectionPadded: {
|
|
158
|
+
marginBottom: tokens.spacing.xl,
|
|
159
|
+
paddingHorizontal: tokens.spacing.lg,
|
|
160
|
+
},
|
|
161
|
+
// ========================================================================
|
|
162
|
+
// TEXT STYLES
|
|
163
|
+
// ========================================================================
|
|
164
|
+
/**
|
|
165
|
+
* Screen title - primary heading
|
|
166
|
+
*/
|
|
167
|
+
screenTitle: {
|
|
168
|
+
...tokens.typography.headingLarge,
|
|
169
|
+
color: tokens.colors.textPrimary,
|
|
170
|
+
marginBottom: tokens.spacing.sm,
|
|
171
|
+
},
|
|
172
|
+
/**
|
|
173
|
+
* Section title
|
|
174
|
+
*/
|
|
175
|
+
sectionTitle: {
|
|
176
|
+
...tokens.typography.headingMedium,
|
|
177
|
+
color: tokens.colors.textPrimary,
|
|
178
|
+
marginBottom: tokens.spacing.md,
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Subtitle/description text
|
|
182
|
+
*/
|
|
183
|
+
subtitle: {
|
|
184
|
+
...tokens.typography.bodyMedium,
|
|
185
|
+
color: tokens.colors.textSecondary,
|
|
186
|
+
textAlign: 'center',
|
|
187
|
+
},
|
|
188
|
+
/**
|
|
189
|
+
* Body text
|
|
190
|
+
*/
|
|
191
|
+
bodyText: {
|
|
192
|
+
...tokens.typography.bodyMedium,
|
|
193
|
+
color: tokens.colors.textPrimary,
|
|
194
|
+
},
|
|
195
|
+
/**
|
|
196
|
+
* Secondary text (muted)
|
|
197
|
+
*/
|
|
198
|
+
secondaryText: {
|
|
199
|
+
...tokens.typography.bodySmall,
|
|
200
|
+
color: tokens.colors.textSecondary,
|
|
201
|
+
},
|
|
202
|
+
// ========================================================================
|
|
203
|
+
// FORM STYLES
|
|
204
|
+
// ========================================================================
|
|
205
|
+
/**
|
|
206
|
+
* Form container
|
|
207
|
+
*/
|
|
208
|
+
form: {
|
|
209
|
+
width: '100%',
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* Form header section
|
|
213
|
+
*/
|
|
214
|
+
formHeader: {
|
|
215
|
+
alignItems: 'center',
|
|
216
|
+
marginBottom: tokens.spacing.xl,
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createVariants } from './core';
|
|
2
|
+
export function createAdvancedVariants(config) {
|
|
3
|
+
const baseVariantFn = createVariants(config);
|
|
4
|
+
return function (props = {}) {
|
|
5
|
+
let result = baseVariantFn(props);
|
|
6
|
+
if (config.compoundVariants) {
|
|
7
|
+
for (const compound of config.compoundVariants) {
|
|
8
|
+
const conditionsMet = Object.entries(compound.conditions).every(([key, value]) => props[key] === value);
|
|
9
|
+
if (conditionsMet)
|
|
10
|
+
result = { ...result, ...compound.style };
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function createVariants(config) {
|
|
2
|
+
return function (props = {}) {
|
|
3
|
+
let result = { ...config.base };
|
|
4
|
+
if (config.defaultVariants) {
|
|
5
|
+
for (const [variantKey, defaultValue] of Object.entries(config.defaultVariants)) {
|
|
6
|
+
if (config.variants?.[variantKey] && defaultValue) {
|
|
7
|
+
const variantStyle = config.variants[variantKey][defaultValue];
|
|
8
|
+
if (variantStyle)
|
|
9
|
+
result = { ...result, ...variantStyle };
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
for (const [variantKey, variantValue] of Object.entries(props)) {
|
|
14
|
+
if (config.variants?.[variantKey] && variantValue) {
|
|
15
|
+
const variantStyle = config.variants[variantKey][variantValue];
|
|
16
|
+
if (variantStyle)
|
|
17
|
+
result = { ...result, ...variantStyle };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function combineStyles(...styles) {
|
|
2
|
+
return styles.reduce((acc, style) => (style ? { ...acc, ...style } : acc), {});
|
|
3
|
+
}
|
|
4
|
+
export function conditionalStyle(condition, trueStyle, falseStyle) {
|
|
5
|
+
return condition ? trueStyle : falseStyle;
|
|
6
|
+
}
|
|
7
|
+
export function responsiveStyle(small, medium, large) {
|
|
8
|
+
return small;
|
|
9
|
+
}
|