@umituz/react-native-design-system 4.25.63 → 4.25.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/atoms/AtomicAvatar.tsx +2 -2
- package/src/layouts/Grid/Grid.tsx +6 -8
- package/src/layouts/ScreenHeader/ScreenHeader.tsx +4 -4
- package/src/molecules/ConfirmationModalContent.tsx +4 -4
- package/src/molecules/ConfirmationModalMain.tsx +2 -2
- package/src/molecules/avatar/Avatar.tsx +2 -2
- package/src/molecules/bottom-sheet/components/filter/FilterBottomSheet.tsx +6 -1
- package/src/molecules/calendar/presentation/components/CalendarDayCell.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.65",
|
|
4
4
|
"description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive, safe area, exception, infinite scroll, UUID, image, timezone, offline, onboarding, and loading utilities",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -54,7 +54,7 @@ export interface AtomicAvatarProps {
|
|
|
54
54
|
// COMPONENT IMPLEMENTATION
|
|
55
55
|
// =============================================================================
|
|
56
56
|
|
|
57
|
-
export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
57
|
+
export const AtomicAvatar: React.FC<AtomicAvatarProps> = React.memo(({
|
|
58
58
|
source,
|
|
59
59
|
name,
|
|
60
60
|
size = 'md',
|
|
@@ -152,5 +152,5 @@ export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
|
152
152
|
)}
|
|
153
153
|
</View>
|
|
154
154
|
);
|
|
155
|
-
};
|
|
155
|
+
});
|
|
156
156
|
|
|
@@ -73,23 +73,21 @@ export const Grid: React.FC<GridProps> = ({
|
|
|
73
73
|
[responsiveGap]
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
+
const itemStyle = useMemo(() => ({
|
|
77
|
+
flex: columns ? 1 / columns - 0.01 : undefined,
|
|
78
|
+
minWidth: columns ? `${100 / columns - 1}%` as const : undefined,
|
|
79
|
+
}), [columns]);
|
|
80
|
+
|
|
76
81
|
// Convert children to array for mapping
|
|
77
82
|
const childArray = React.Children.toArray(children);
|
|
78
83
|
|
|
79
84
|
return (
|
|
80
85
|
<View style={[styles.container, style]} testID={testID}>
|
|
81
86
|
{childArray.map((child, index) => {
|
|
82
|
-
// Use child's key if available, otherwise use index
|
|
83
87
|
const key = (child as React.ReactElement).key || `grid-item-${index}`;
|
|
84
88
|
|
|
85
89
|
return (
|
|
86
|
-
<View
|
|
87
|
-
key={key}
|
|
88
|
-
style={{
|
|
89
|
-
flex: columns ? 1 / columns - 0.01 : undefined,
|
|
90
|
-
minWidth: columns ? `${100 / columns - 1}%` : undefined,
|
|
91
|
-
}}
|
|
92
|
-
>
|
|
90
|
+
<View key={key} style={itemStyle}>
|
|
93
91
|
{child}
|
|
94
92
|
</View>
|
|
95
93
|
);
|
|
@@ -97,7 +97,7 @@ const ScreenHeaderTitle: React.FC<{
|
|
|
97
97
|
title: string;
|
|
98
98
|
tokens: ReturnType<typeof useAppDesignTokens>;
|
|
99
99
|
testID?: string;
|
|
100
|
-
}> = ({ title, tokens, testID }) => (
|
|
100
|
+
}> = React.memo(({ title, tokens, testID }) => (
|
|
101
101
|
<View style={{ flex: 1, alignItems: 'center', paddingHorizontal: tokens.spacing.sm }}>
|
|
102
102
|
<AtomicText
|
|
103
103
|
type="headlineMedium"
|
|
@@ -114,15 +114,15 @@ const ScreenHeaderTitle: React.FC<{
|
|
|
114
114
|
{title}
|
|
115
115
|
</AtomicText>
|
|
116
116
|
</View>
|
|
117
|
-
);
|
|
117
|
+
));
|
|
118
118
|
|
|
119
119
|
const ScreenHeaderRightAction: React.FC<{
|
|
120
120
|
rightAction?: React.ReactNode;
|
|
121
|
-
}> = ({ rightAction }) => (
|
|
121
|
+
}> = React.memo(({ rightAction }) => (
|
|
122
122
|
<View style={{ width: 40, alignItems: 'flex-start' }}>
|
|
123
123
|
{rightAction || <View style={{ width: 40 }} />}
|
|
124
124
|
</View>
|
|
125
|
-
);
|
|
125
|
+
));
|
|
126
126
|
|
|
127
127
|
export const ScreenHeader: React.FC<ScreenHeaderProps> = ({
|
|
128
128
|
title,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Content component for confirmation modal
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
8
|
import { View, ViewStyle, StyleProp } from 'react-native';
|
|
9
9
|
import { useAppDesignTokens } from '../theme';
|
|
10
10
|
import { ConfirmationModalVariant } from './confirmation-modal/types/';
|
|
@@ -27,7 +27,7 @@ const useConfirmButtonStyle = (
|
|
|
27
27
|
variant: ConfirmationModalVariant,
|
|
28
28
|
tokens: ReturnType<typeof useAppDesignTokens>
|
|
29
29
|
) => {
|
|
30
|
-
return
|
|
30
|
+
return useMemo(() => {
|
|
31
31
|
const baseStyle = getButtonStyle();
|
|
32
32
|
const variantStyles: ViewStyle[] = [];
|
|
33
33
|
|
|
@@ -54,7 +54,7 @@ export const ConfirmationModalContent: React.FC<{
|
|
|
54
54
|
}> = ({ tokens, variant, title, message, confirmText, cancelText, icon, onConfirm, onCancel, style, testID }) => {
|
|
55
55
|
const variantConfig = getVariantConfig(variant as 'default' | 'destructive' | 'warning' | 'success');
|
|
56
56
|
const finalIcon = icon || variantConfig.icon;
|
|
57
|
-
const
|
|
57
|
+
const confirmButtonStyle = useConfirmButtonStyle(variant, tokens);
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
60
|
<View style={[getModalContainerStyle(tokens), style]}>
|
|
@@ -79,7 +79,7 @@ export const ConfirmationModalContent: React.FC<{
|
|
|
79
79
|
cancelText={cancelText}
|
|
80
80
|
onConfirm={onConfirm}
|
|
81
81
|
onCancel={onCancel}
|
|
82
|
-
confirmButtonStyle={
|
|
82
|
+
confirmButtonStyle={confirmButtonStyle}
|
|
83
83
|
testID={testID}
|
|
84
84
|
/>
|
|
85
85
|
</View>
|
|
@@ -26,7 +26,7 @@ const ConfirmationModalBackdrop: React.FC<{
|
|
|
26
26
|
showBackdrop: boolean;
|
|
27
27
|
onBackdropPress: () => void;
|
|
28
28
|
testID: string;
|
|
29
|
-
}> = ({ showBackdrop, onBackdropPress, testID }) => {
|
|
29
|
+
}> = React.memo(({ showBackdrop, onBackdropPress, testID }) => {
|
|
30
30
|
if (!showBackdrop) return null;
|
|
31
31
|
|
|
32
32
|
return (
|
|
@@ -37,7 +37,7 @@ const ConfirmationModalBackdrop: React.FC<{
|
|
|
37
37
|
testID={`${testID}-backdrop`}
|
|
38
38
|
/>
|
|
39
39
|
);
|
|
40
|
-
};
|
|
40
|
+
});
|
|
41
41
|
|
|
42
42
|
export const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
|
|
43
43
|
visible,
|
|
@@ -38,7 +38,7 @@ interface AvatarContentProps {
|
|
|
38
38
|
imageStyle?: StyleProp<ImageStyle>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
const AvatarContent: React.FC<AvatarContentProps> = ({
|
|
41
|
+
const AvatarContent: React.FC<AvatarContentProps> = React.memo(({
|
|
42
42
|
hasImage,
|
|
43
43
|
hasName,
|
|
44
44
|
uri,
|
|
@@ -91,7 +91,7 @@ const AvatarContent: React.FC<AvatarContentProps> = ({
|
|
|
91
91
|
customColor={tokens.colors.textInverse}
|
|
92
92
|
/>
|
|
93
93
|
);
|
|
94
|
-
};
|
|
94
|
+
});
|
|
95
95
|
|
|
96
96
|
export const Avatar: React.FC<AvatarProps> = ({
|
|
97
97
|
uri,
|
|
@@ -103,7 +103,12 @@ export const FilterBottomSheet = forwardRef<BottomSheetModalRef, FilterBottomShe
|
|
|
103
103
|
<View style={styles.container}>
|
|
104
104
|
<View style={styles.header}>
|
|
105
105
|
<AtomicText type="headlineSmall">{title || 'Filter'}</AtomicText>
|
|
106
|
-
<TouchableOpacity
|
|
106
|
+
<TouchableOpacity
|
|
107
|
+
onPress={() => internalRef.current?.dismiss()}
|
|
108
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
109
|
+
accessibilityRole="button"
|
|
110
|
+
accessibilityLabel="Close filter"
|
|
111
|
+
>
|
|
107
112
|
<AtomicIcon name={icons.close} size="md" color="textPrimary" />
|
|
108
113
|
</TouchableOpacity>
|
|
109
114
|
</View>
|
|
@@ -22,7 +22,7 @@ interface CalendarDayCellProps {
|
|
|
22
22
|
testID?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const CalendarDayCell: React.FC<CalendarDayCellProps> = ({
|
|
25
|
+
export const CalendarDayCell: React.FC<CalendarDayCellProps> = React.memo(({
|
|
26
26
|
day,
|
|
27
27
|
index,
|
|
28
28
|
isSelected,
|
|
@@ -98,4 +98,4 @@ export const CalendarDayCell: React.FC<CalendarDayCellProps> = ({
|
|
|
98
98
|
</View>
|
|
99
99
|
</TouchableOpacity>
|
|
100
100
|
);
|
|
101
|
-
};
|
|
101
|
+
});
|