@umituz/react-native-design-system 4.25.62 → 4.25.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.
- package/package.json +1 -1
- package/src/carousel/CarouselDots.tsx +2 -1
- package/src/image/presentation/components/GalleryHeader.tsx +4 -0
- package/src/image/presentation/components/editor/TextEditorSheet.tsx +1 -1
- package/src/molecules/ConfirmationModalContent.tsx +4 -4
- package/src/molecules/ConfirmationModalMain.tsx +2 -2
- package/src/molecules/SearchBar/SearchHistory.tsx +2 -0
- 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/src/molecules/circular-menu/CircularMenuItem.tsx +2 -2
- package/src/molecules/navigation/components/FabButton.tsx +6 -9
- package/src/molecules/swipe-actions/presentation/components/SwipeActionButton.tsx +10 -7
- package/src/onboarding/presentation/components/BaseSlide.tsx +1 -0
- package/src/onboarding/presentation/components/OnboardingFooter.tsx +3 -0
- package/src/onboarding/presentation/components/OnboardingHeader.tsx +7 -1
- package/src/onboarding/presentation/components/OnboardingSlide.tsx +2 -2
- package/src/onboarding/presentation/components/questions/QuestionOptionItem.tsx +5 -2
- package/src/onboarding/presentation/components/questions/RatingQuestion.tsx +10 -1
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.64",
|
|
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",
|
|
@@ -3,7 +3,7 @@ import { View, StyleSheet } from "react-native";
|
|
|
3
3
|
import { useAppDesignTokens } from "../theme";
|
|
4
4
|
import type { CarouselDotsProps } from "./types";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const CarouselDotsComponent: React.FC<CarouselDotsProps> = ({
|
|
7
7
|
count,
|
|
8
8
|
currentIndex,
|
|
9
9
|
activeColor,
|
|
@@ -35,6 +35,7 @@ export const CarouselDots: React.FC<CarouselDotsProps> = ({
|
|
|
35
35
|
</View>
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
|
+
export const CarouselDots = React.memo(CarouselDotsComponent);
|
|
38
39
|
|
|
39
40
|
const styles = StyleSheet.create({
|
|
40
41
|
container: {
|
|
@@ -33,6 +33,8 @@ export function GalleryHeader({ onEdit, onClose, title }: GalleryHeaderProps) {
|
|
|
33
33
|
style={[styles.actionButton, { backgroundColor: 'rgba(255, 255, 255, 0.15)' }]}
|
|
34
34
|
onPress={onEdit}
|
|
35
35
|
activeOpacity={0.7}
|
|
36
|
+
accessibilityRole="button"
|
|
37
|
+
accessibilityLabel="Edit"
|
|
36
38
|
>
|
|
37
39
|
<AtomicText style={styles.buttonText}>Edit</AtomicText>
|
|
38
40
|
</TouchableOpacity>
|
|
@@ -55,6 +57,8 @@ export function GalleryHeader({ onEdit, onClose, title }: GalleryHeaderProps) {
|
|
|
55
57
|
onPress={onClose}
|
|
56
58
|
activeOpacity={0.7}
|
|
57
59
|
hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
|
|
60
|
+
accessibilityRole="button"
|
|
61
|
+
accessibilityLabel="Close gallery"
|
|
58
62
|
>
|
|
59
63
|
<AtomicText style={styles.closeIcon}>✕</AtomicText>
|
|
60
64
|
</TouchableOpacity>
|
|
@@ -68,7 +68,7 @@ export const TextEditorSheet = forwardRef<BottomSheetModalRef, TextEditorSheetPr
|
|
|
68
68
|
))}
|
|
69
69
|
</View>
|
|
70
70
|
|
|
71
|
-
<ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={{ paddingBottom: 60 }}>
|
|
71
|
+
<ScrollView showsVerticalScrollIndicator={false} contentContainerStyle={{ paddingBottom: 60 }} keyboardShouldPersistTaps="handled">
|
|
72
72
|
{activeTab === 'content' && <TextContentTab text={props.text} onTextChange={props.onTextChange} t={t} />}
|
|
73
73
|
{activeTab === 'style' && (
|
|
74
74
|
<TextStyleTab
|
|
@@ -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,
|
|
@@ -80,6 +80,8 @@ export const SearchHistory: React.FC<SearchHistoryProps> = ({
|
|
|
80
80
|
onPress={() => onRemoveItem(item.id)}
|
|
81
81
|
style={styles.removeButton}
|
|
82
82
|
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
83
|
+
accessibilityRole="button"
|
|
84
|
+
accessibilityLabel={`Remove ${item.query} from history`}
|
|
83
85
|
>
|
|
84
86
|
<AtomicIcon
|
|
85
87
|
name={closeIcon}
|
|
@@ -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
|
+
});
|
|
@@ -11,7 +11,7 @@ export interface CircularMenuItemProps {
|
|
|
11
11
|
onPress: () => void;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const CircularMenuItem: React.FC<CircularMenuItemProps> = ({
|
|
14
|
+
export const CircularMenuItem: React.FC<CircularMenuItemProps> = React.memo(({
|
|
15
15
|
icon,
|
|
16
16
|
label,
|
|
17
17
|
onPress,
|
|
@@ -49,7 +49,7 @@ export const CircularMenuItem: React.FC<CircularMenuItemProps> = ({
|
|
|
49
49
|
</AtomicText>
|
|
50
50
|
</TouchableOpacity>
|
|
51
51
|
);
|
|
52
|
-
};
|
|
52
|
+
});
|
|
53
53
|
|
|
54
54
|
const styles = StyleSheet.create({
|
|
55
55
|
container: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View, type ViewStyle } from 'react-native';
|
|
3
3
|
import { useAppDesignTokens } from '../../../theme';
|
|
4
4
|
|
|
@@ -18,16 +18,13 @@ export const FabButton: React.FC<FabButtonProps> = ({
|
|
|
18
18
|
style,
|
|
19
19
|
}) => {
|
|
20
20
|
const tokens = useAppDesignTokens();
|
|
21
|
+
const themedStyle = useMemo(() => ({
|
|
22
|
+
backgroundColor: tokens.colors.primary,
|
|
23
|
+
borderColor: tokens.colors.onPrimary,
|
|
24
|
+
}), [tokens.colors.primary, tokens.colors.onPrimary]);
|
|
21
25
|
|
|
22
26
|
return (
|
|
23
|
-
<View style={[
|
|
24
|
-
styles.container,
|
|
25
|
-
{
|
|
26
|
-
backgroundColor: tokens.colors.primary,
|
|
27
|
-
borderColor: tokens.colors.onPrimary,
|
|
28
|
-
},
|
|
29
|
-
style
|
|
30
|
-
]}>
|
|
27
|
+
<View style={[styles.container, themedStyle, style]}>
|
|
31
28
|
{children}
|
|
32
29
|
</View>
|
|
33
30
|
);
|
|
@@ -86,14 +86,15 @@ export const SwipeActionButton: React.FC<SwipeActionButtonProps> = ({
|
|
|
86
86
|
const backgroundColor = getBackgroundColor();
|
|
87
87
|
|
|
88
88
|
const handlePress = async () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
try {
|
|
90
|
+
if (enableHaptics) {
|
|
91
|
+
const intensity = getHapticsIntensity(action);
|
|
92
|
+
await HapticService.impact(intensity);
|
|
93
|
+
}
|
|
94
|
+
await action.onPress();
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (__DEV__) console.warn('[SwipeActionButton] Action failed:', error);
|
|
93
97
|
}
|
|
94
|
-
|
|
95
|
-
// Execute action
|
|
96
|
-
await action.onPress();
|
|
97
98
|
};
|
|
98
99
|
|
|
99
100
|
return (
|
|
@@ -111,6 +112,8 @@ export const SwipeActionButton: React.FC<SwipeActionButtonProps> = ({
|
|
|
111
112
|
]}
|
|
112
113
|
onPress={handlePress}
|
|
113
114
|
activeOpacity={0.7}
|
|
115
|
+
accessibilityRole="button"
|
|
116
|
+
accessibilityLabel={label}
|
|
114
117
|
>
|
|
115
118
|
<View style={styles.content}>
|
|
116
119
|
<AtomicIcon
|
|
@@ -49,7 +49,13 @@ export const OnboardingHeader = ({
|
|
|
49
49
|
<View style={styles.headerButton} />
|
|
50
50
|
)}
|
|
51
51
|
{showSkipButton && skipButtonText ? (
|
|
52
|
-
<TouchableOpacity
|
|
52
|
+
<TouchableOpacity
|
|
53
|
+
onPress={onSkip}
|
|
54
|
+
activeOpacity={0.7}
|
|
55
|
+
accessibilityRole="button"
|
|
56
|
+
accessibilityLabel={skipButtonText}
|
|
57
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
58
|
+
>
|
|
53
59
|
<AtomicText
|
|
54
60
|
type="labelLarge"
|
|
55
61
|
style={[styles.skipText, { color: colors.textColor }]}
|
|
@@ -16,7 +16,7 @@ export interface OnboardingSlideProps {
|
|
|
16
16
|
variant?: "default" | "card" | "minimal" | "fullscreen";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const OnboardingSlide = ({
|
|
19
|
+
export const OnboardingSlide = React.memo(({
|
|
20
20
|
slide,
|
|
21
21
|
variant = "default",
|
|
22
22
|
}: OnboardingSlideProps) => {
|
|
@@ -89,7 +89,7 @@ export const OnboardingSlide = ({
|
|
|
89
89
|
)}
|
|
90
90
|
</BaseSlide>
|
|
91
91
|
);
|
|
92
|
-
};
|
|
92
|
+
});
|
|
93
93
|
|
|
94
94
|
const styles = StyleSheet.create({
|
|
95
95
|
iconBox: {
|
|
@@ -16,7 +16,7 @@ export interface QuestionOptionItemProps {
|
|
|
16
16
|
colors: OnboardingColors;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export const QuestionOptionItem = ({
|
|
19
|
+
export const QuestionOptionItem = React.memo(({
|
|
20
20
|
option,
|
|
21
21
|
isSelected,
|
|
22
22
|
onPress,
|
|
@@ -36,6 +36,9 @@ export const QuestionOptionItem = ({
|
|
|
36
36
|
]}
|
|
37
37
|
onPress={onPress}
|
|
38
38
|
activeOpacity={0.8}
|
|
39
|
+
accessibilityRole="button"
|
|
40
|
+
accessibilityLabel={option.label}
|
|
41
|
+
accessibilityState={{ selected: isSelected }}
|
|
39
42
|
>
|
|
40
43
|
{option.icon && (
|
|
41
44
|
<View style={[
|
|
@@ -83,7 +86,7 @@ export const QuestionOptionItem = ({
|
|
|
83
86
|
</View>
|
|
84
87
|
</TouchableOpacity>
|
|
85
88
|
);
|
|
86
|
-
};
|
|
89
|
+
});
|
|
87
90
|
|
|
88
91
|
const styles = StyleSheet.create({
|
|
89
92
|
option: {
|
|
@@ -26,7 +26,16 @@ export const RatingQuestion = ({
|
|
|
26
26
|
{Array.from({ length: max }).map((_, i) => {
|
|
27
27
|
const isFilled = i < value;
|
|
28
28
|
return (
|
|
29
|
-
<TouchableOpacity
|
|
29
|
+
<TouchableOpacity
|
|
30
|
+
key={i}
|
|
31
|
+
onPress={() => onChange(i + 1)}
|
|
32
|
+
activeOpacity={0.8}
|
|
33
|
+
style={styles.star}
|
|
34
|
+
hitSlop={{ top: 8, bottom: 8, left: 8, right: 8 }}
|
|
35
|
+
accessibilityRole="button"
|
|
36
|
+
accessibilityLabel={`Rate ${i + 1} out of ${max}`}
|
|
37
|
+
accessibilityState={{ selected: isFilled }}
|
|
38
|
+
>
|
|
30
39
|
<AtomicIcon
|
|
31
40
|
name={isFilled ? "star" : "star-outline"}
|
|
32
41
|
customSize={48}
|