@umituz/react-native-design-system 2.8.35 → 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.35",
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";
@@ -52,6 +52,7 @@ export const AtomicInput = React.forwardRef<TextInput, AtomicInputProps>(({
52
52
  onFocus,
53
53
  multiline = false,
54
54
  numberOfLines,
55
+ textContentType,
55
56
  }, ref) => {
56
57
  const tokens = useAppDesignTokens();
57
58
 
@@ -114,7 +115,7 @@ export const AtomicInput = React.forwardRef<TextInput, AtomicInputProps>(({
114
115
  fontSize: sizeConfig.fontSize,
115
116
  lineHeight: (sizeConfig.fontSize || 16) * 1.2,
116
117
  color: textColor,
117
- paddingVertical: 0,
118
+ paddingVertical: 4,
118
119
  },
119
120
  leadingIcon ? { paddingLeft: sizeConfig.iconSize + 8 } : undefined,
120
121
  (trailingIcon || showPasswordToggle) ? { paddingRight: sizeConfig.iconSize + 8 } : undefined,
@@ -153,6 +154,7 @@ export const AtomicInput = React.forwardRef<TextInput, AtomicInputProps>(({
153
154
  editable={!isDisabled}
154
155
  multiline={multiline}
155
156
  numberOfLines={numberOfLines}
157
+ textContentType={textContentType}
156
158
  style={textInputStyle}
157
159
  onBlur={() => {
158
160
  setIsFocused(false);
@@ -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
 
@@ -1,4 +1,4 @@
1
- import type { StyleProp } from 'react-native';
1
+ import type { StyleProp, TextInputProps } from 'react-native';
2
2
  import type { TextStyle, ViewStyle } from 'react-native';
3
3
  import type { IconName } from '../AtomicIcon';
4
4
 
@@ -67,6 +67,8 @@ export interface AtomicInputProps {
67
67
  multiline?: boolean;
68
68
  /** Number of lines for multiline input */
69
69
  numberOfLines?: number;
70
+ /** iOS text content type for AutoFill */
71
+ textContentType?: TextInputProps['textContentType'];
70
72
  }
71
73
 
72
74
  export type { AtomicInputProps as InputProps };
@@ -49,6 +49,7 @@ export {
49
49
  AlertProvider,
50
50
  AlertService,
51
51
  useAlert,
52
+ useAlertStore,
52
53
  alertService,
53
54
  AlertType,
54
55
  AlertMode,
@@ -33,10 +33,10 @@ export function AlertBanner({ alert }: AlertBannerProps) {
33
33
  // Auto-dismiss after duration
34
34
  useEffect(() => {
35
35
  const duration = alert.duration ?? DEFAULT_DURATION;
36
- if (duration > 0) {
37
- const timer = setTimeout(handleDismiss, duration);
38
- return () => clearTimeout(timer);
39
- }
36
+ if (duration <= 0) return;
37
+
38
+ const timer = setTimeout(handleDismiss, duration);
39
+ return () => clearTimeout(timer);
40
40
  }, [alert.id, alert.duration]);
41
41
 
42
42
  const getBackgroundColor = (type: AlertType): string => {
@@ -36,10 +36,10 @@ export function AlertToast({ alert }: AlertToastProps) {
36
36
  // Auto-dismiss after duration
37
37
  useEffect(() => {
38
38
  const duration = alert.duration ?? DEFAULT_DURATION;
39
- if (duration > 0) {
40
- const timer = setTimeout(dismiss, duration);
41
- return () => clearTimeout(timer);
42
- }
39
+ if (duration <= 0) return;
40
+
41
+ const timer = setTimeout(dismiss, duration);
42
+ return () => clearTimeout(timer);
43
43
  }, [alert.id, alert.duration]);
44
44
 
45
45
  const getBackgroundColor = (type: AlertType): string => {