@umituz/react-native-design-system 2.8.36 → 2.8.37

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": "2.8.36",
3
+ "version": "2.8.37",
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, and onboarding utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -119,28 +119,41 @@ export const AtomicIcon: React.FC<AtomicIconProps> = React.memo(({
119
119
  console.warn(`[DesignSystem] Invalid icon name: "${name}". Falling back to "${FALLBACK_ICON}"`);
120
120
  }
121
121
 
122
- const iconElement = svgPath ? (
123
- <Svg
124
- viewBox={svgViewBox}
125
- width={sizeInPixels}
126
- height={sizeInPixels}
127
- key="custom-svg-icon"
128
- >
129
- <Path
130
- d={svgPath}
131
- fill={iconColor}
132
- />
133
- </Svg>
134
- ) : (
122
+ const iconProps = {
123
+ testID,
124
+ accessibilityLabel,
125
+ style: [
126
+ !svgPath && {
127
+ padding: 4, // Prevent font truncation
128
+ includeFontPadding: false, // Android specific
129
+ },
130
+ style,
131
+ ] as StyleProp<ViewStyle>,
132
+ };
133
+
134
+ if (svgPath) {
135
+ return (
136
+ <Svg
137
+ viewBox={svgViewBox}
138
+ width={sizeInPixels}
139
+ height={sizeInPixels}
140
+ key="custom-svg-icon"
141
+ {...iconProps}
142
+ >
143
+ <Path
144
+ d={svgPath}
145
+ fill={iconColor}
146
+ />
147
+ </Svg>
148
+ );
149
+ }
150
+
151
+ const iconElement = (
135
152
  <Ionicons
136
153
  name={iconName as keyof typeof Ionicons.glyphMap}
137
154
  size={sizeInPixels}
138
155
  color={iconColor}
139
- testID={testID ? `${testID}-icon` : undefined}
140
- style={{
141
- padding: 4, // Prevent font truncation
142
- includeFontPadding: false, // Android specific
143
- }}
156
+ {...iconProps}
144
157
  />
145
158
  );
146
159
 
@@ -168,11 +181,7 @@ export const AtomicIcon: React.FC<AtomicIconProps> = React.memo(({
168
181
  );
169
182
  }
170
183
 
171
- return (
172
- <View accessibilityLabel={accessibilityLabel} testID={testID} style={style}>
173
- {iconElement}
174
- </View>
175
- );
184
+ return iconElement;
176
185
  });
177
186
 
178
187
  AtomicIcon.displayName = "AtomicIcon";
@@ -19,14 +19,24 @@ export const InputIcon: React.FC<InputIconProps> = ({
19
19
  onPress,
20
20
  testID,
21
21
  }) => {
22
- const positionStyle = position === 'leading' ? styles.leadingIcon : styles.trailingIcon;
23
- const Wrapper = onPress ? Pressable : View;
24
- const wrapperProps = onPress ? { onPress, testID } : {};
22
+ const style = position === 'leading' ? styles.leadingIcon : styles.trailingIcon;
23
+
24
+ if (onPress) {
25
+ return (
26
+ <Pressable onPress={onPress} style={style} testID={testID}>
27
+ <AtomicIcon name={name as any} customSize={size} customColor={color} />
28
+ </Pressable>
29
+ );
30
+ }
25
31
 
26
32
  return (
27
- <Wrapper style={positionStyle} {...wrapperProps}>
28
- <AtomicIcon name={name} customSize={size} customColor={color} />
29
- </Wrapper>
33
+ <AtomicIcon
34
+ name={name as any}
35
+ customSize={size}
36
+ customColor={color}
37
+ style={style}
38
+ testID={testID}
39
+ />
30
40
  );
31
41
  };
32
42