@umituz/react-native-design-system 4.25.59 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-design-system",
3
- "version": "4.25.59",
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
- export const AtomicTouchable: React.FC<AtomicTouchableProps> = ({
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
  <>
@@ -79,6 +79,7 @@ export const List = <T,>({
79
79
  : undefined
80
80
  }
81
81
  showsVerticalScrollIndicator={false}
82
+ keyboardShouldPersistTaps="handled"
82
83
  {...rest}
83
84
  />
84
85
  );