@umituz/react-native-design-system 4.25.58 → 4.25.60
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/AtomicTouchable.tsx +4 -1
- package/src/atoms/datepicker/components/DatePickerButton.tsx +3 -3
- package/src/atoms/input/components/InputIcon.tsx +1 -1
- package/src/atoms/picker/components/PickerModal.tsx +9 -6
- package/src/infinite-scroll/presentation/components/infinite-scroll-list.tsx +1 -0
- package/src/layouts/ScreenLayout/ScreenLayout.tsx +1 -1
- package/src/molecules/List/List.tsx +1 -0
- package/src/molecules/bottom-sheet/components/filter/FilterBottomSheet.tsx +1 -1
- package/src/molecules/bottom-sheet/components/filter/FilterSheet.tsx +1 -1
- package/src/molecules/filter-group/FilterGroup.tsx +1 -0
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.60",
|
|
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",
|
|
@@ -32,7 +32,7 @@ export interface AtomicTouchableProps {
|
|
|
32
32
|
accessible?: boolean;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
const AtomicTouchableComponent: React.FC<AtomicTouchableProps> = ({
|
|
36
36
|
children,
|
|
37
37
|
onPress,
|
|
38
38
|
onLongPress,
|
|
@@ -75,3 +75,6 @@ export const AtomicTouchable: React.FC<AtomicTouchableProps> = ({
|
|
|
75
75
|
</TouchableOpacity>
|
|
76
76
|
);
|
|
77
77
|
};
|
|
78
|
+
|
|
79
|
+
export const AtomicTouchable = React.memo(AtomicTouchableComponent);
|
|
80
|
+
AtomicTouchableComponent.displayName = 'AtomicTouchable';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Extracted from AtomicDatePicker for better separation of concerns.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import React from 'react';
|
|
8
|
+
import React, { useMemo } from 'react';
|
|
9
9
|
import {
|
|
10
10
|
View,
|
|
11
11
|
TouchableOpacity,
|
|
@@ -35,7 +35,7 @@ export const DatePickerButton: React.FC<DatePickerButtonProps> = ({
|
|
|
35
35
|
const tokens = useAppDesignTokens();
|
|
36
36
|
const calendarIcon = useIconName('calendar');
|
|
37
37
|
|
|
38
|
-
const buttonStyles = StyleSheet.create({
|
|
38
|
+
const buttonStyles = useMemo(() => StyleSheet.create({
|
|
39
39
|
container: {
|
|
40
40
|
flexDirection: 'row',
|
|
41
41
|
alignItems: 'center',
|
|
@@ -75,7 +75,7 @@ export const DatePickerButton: React.FC<DatePickerButtonProps> = ({
|
|
|
75
75
|
alignItems: 'center',
|
|
76
76
|
gap: tokens.spacing.xs,
|
|
77
77
|
},
|
|
78
|
-
});
|
|
78
|
+
}), [tokens]);
|
|
79
79
|
|
|
80
80
|
const containerStyle = [
|
|
81
81
|
buttonStyles.container,
|
|
@@ -23,7 +23,7 @@ export const InputIcon: React.FC<InputIconProps> = ({
|
|
|
23
23
|
|
|
24
24
|
if (onPress) {
|
|
25
25
|
return (
|
|
26
|
-
<Pressable onPress={onPress} style={style} testID={testID}>
|
|
26
|
+
<Pressable onPress={onPress} style={style} testID={testID} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}>
|
|
27
27
|
<AtomicIcon name={name} customSize={size} customColor={color} />
|
|
28
28
|
</Pressable>
|
|
29
29
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* PickerModal - Selection modal for AtomicPicker
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
6
|
import { View, Modal, FlatList, TextInput, TouchableOpacity } from 'react-native';
|
|
7
7
|
import { useSafeAreaInsets } from '../../../safe-area';
|
|
8
8
|
import { useAppDesignTokens } from '../../../theme';
|
|
@@ -71,9 +71,9 @@ export const PickerModal: React.FC<PickerModalProps> = React.memo(({
|
|
|
71
71
|
emptyText: getEmptyStateTextStyles(tokens),
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
const isSelected = (value: string) => selectedValues?.includes(value) ?? false;
|
|
74
|
+
const isSelected = useCallback((value: string) => selectedValues?.includes(value) ?? false, [selectedValues]);
|
|
75
75
|
|
|
76
|
-
const renderOption = ({ item }: { item: PickerOption }) => {
|
|
76
|
+
const renderOption = useCallback(({ item }: { item: PickerOption }) => {
|
|
77
77
|
const selected = isSelected(item.value);
|
|
78
78
|
const disabled = item.disabled || false;
|
|
79
79
|
|
|
@@ -81,6 +81,9 @@ export const PickerModal: React.FC<PickerModalProps> = React.memo(({
|
|
|
81
81
|
<TouchableOpacity
|
|
82
82
|
onPress={() => !disabled && onSelect(item.value)}
|
|
83
83
|
disabled={disabled}
|
|
84
|
+
accessibilityRole="button"
|
|
85
|
+
accessibilityLabel={item.label}
|
|
86
|
+
accessibilityState={{ disabled, selected }}
|
|
84
87
|
testID={item.testID || `${testID}-option-${item.value}`}
|
|
85
88
|
style={getOptionContainerStyles(tokens, selected, disabled)}
|
|
86
89
|
>
|
|
@@ -92,7 +95,7 @@ export const PickerModal: React.FC<PickerModalProps> = React.memo(({
|
|
|
92
95
|
{selected && <AtomicIcon name={icons.checkCircle} size="md" color="primary" />}
|
|
93
96
|
</TouchableOpacity>
|
|
94
97
|
);
|
|
95
|
-
};
|
|
98
|
+
}, [isSelected, onSelect, tokens, testID]);
|
|
96
99
|
|
|
97
100
|
return (
|
|
98
101
|
<Modal visible={visible} animationType="none" transparent onRequestClose={onClose} testID={`${testID}-modal`} accessibilityViewIsModal={true}>
|
|
@@ -109,12 +112,12 @@ export const PickerModal: React.FC<PickerModalProps> = React.memo(({
|
|
|
109
112
|
<View style={styles.search}>
|
|
110
113
|
<AtomicIcon name={icons.search} size="sm" color="secondary" />
|
|
111
114
|
<TextInput value={searchQuery} onChangeText={onSearchChange} placeholder={searchPlaceholder} placeholderTextColor={tokens.colors.textSecondary} style={styles.searchInput} testID={`${testID}-search`} />
|
|
112
|
-
{searchQuery.length > 0 && <TouchableOpacity onPress={() => onSearchChange('')}><AtomicIcon name={icons.close} size="sm" color="secondary" /></TouchableOpacity>}
|
|
115
|
+
{searchQuery.length > 0 && <TouchableOpacity onPress={() => onSearchChange('')} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} accessibilityRole="button" accessibilityLabel="Clear search"><AtomicIcon name={icons.close} size="sm" color="secondary" /></TouchableOpacity>}
|
|
113
116
|
</View>
|
|
114
117
|
)}
|
|
115
118
|
|
|
116
119
|
{filteredOptions.length > 0 ? (
|
|
117
|
-
<FlatList data={filteredOptions} keyExtractor={(item: PickerOption) => item.value} renderItem={renderOption} showsVerticalScrollIndicator testID={`${testID}-list`} />
|
|
120
|
+
<FlatList data={filteredOptions} keyExtractor={(item: PickerOption) => item.value} renderItem={renderOption} showsVerticalScrollIndicator keyboardShouldPersistTaps="handled" testID={`${testID}-list`} />
|
|
118
121
|
) : (
|
|
119
122
|
<View style={styles.empty}>
|
|
120
123
|
<AtomicIcon name={icons.info} size="xl" color="secondary" />
|
|
@@ -103,6 +103,7 @@ function InfiniteScrollListComponent<T>({
|
|
|
103
103
|
onEndReachedThreshold={calculateEndReachedThreshold(config.threshold)}
|
|
104
104
|
onRefresh={refresh}
|
|
105
105
|
refreshing={state.isRefreshing}
|
|
106
|
+
keyboardShouldPersistTaps="handled"
|
|
106
107
|
ListHeaderComponent={ListHeaderComponent}
|
|
107
108
|
ListFooterComponent={
|
|
108
109
|
<>
|
|
@@ -71,7 +71,7 @@ export const ScreenLayout: React.FC<ScreenLayoutProps> = (props: ScreenLayoutPro
|
|
|
71
71
|
style={styles.scrollView}
|
|
72
72
|
contentContainerStyle={[styles.scrollContent, contentContainerStyle]}
|
|
73
73
|
showsVerticalScrollIndicator={!hideScrollIndicator}
|
|
74
|
-
keyboardShouldPersistTaps=
|
|
74
|
+
keyboardShouldPersistTaps="handled"
|
|
75
75
|
refreshControl={refreshControl}
|
|
76
76
|
nestedScrollEnabled
|
|
77
77
|
>
|
|
@@ -108,7 +108,7 @@ export const FilterBottomSheet = forwardRef<BottomSheetModalRef, FilterBottomShe
|
|
|
108
108
|
</TouchableOpacity>
|
|
109
109
|
</View>
|
|
110
110
|
|
|
111
|
-
<ScrollView style={styles.scrollView} showsVerticalScrollIndicator={false}>
|
|
111
|
+
<ScrollView style={styles.scrollView} showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled">
|
|
112
112
|
{categories.map(renderCategory)}
|
|
113
113
|
</ScrollView>
|
|
114
114
|
|
|
@@ -57,7 +57,7 @@ export const FilterSheet: React.FC<FilterSheetProps> = ({
|
|
|
57
57
|
tokens={tokens}
|
|
58
58
|
/>
|
|
59
59
|
|
|
60
|
-
<ScrollView style={styles.optionsList} showsVerticalScrollIndicator={false}>
|
|
60
|
+
<ScrollView style={styles.optionsList} showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled">
|
|
61
61
|
{options.map((option) => (
|
|
62
62
|
<FilterSheetOption
|
|
63
63
|
key={option.id}
|