@umituz/react-native-design-system 2.5.16 → 2.5.17

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.5.16",
3
+ "version": "2.5.17",
4
4
  "description": "Universal design system for React Native apps - Consolidated package with atoms, molecules, organisms, theme, typography, responsive and safe area utilities",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { StyleSheet, StyleProp, ViewStyle, TextStyle, TouchableOpacity, View } from 'react-native';
2
+ import { StyleSheet, StyleProp, ViewStyle, TextStyle, TouchableOpacity, View, ActivityIndicator } from 'react-native';
3
3
  import { AtomicText } from './AtomicText';
4
4
  import { AtomicIcon } from './AtomicIcon';
5
5
  import { useAppDesignTokens } from '../theme';
@@ -15,6 +15,7 @@ export interface AtomicButtonProps {
15
15
  variant?: ButtonVariant;
16
16
  size?: ButtonSize;
17
17
  disabled?: boolean;
18
+ loading?: boolean;
18
19
  icon?: IconName;
19
20
  fullWidth?: boolean;
20
21
  style?: StyleProp<ViewStyle>;
@@ -30,6 +31,7 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
30
31
  variant = 'primary',
31
32
  size = 'md',
32
33
  disabled = false,
34
+ loading = false,
33
35
  icon,
34
36
  fullWidth = false,
35
37
  style,
@@ -40,11 +42,13 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
40
42
  const tokens = useAppDesignTokens();
41
43
 
42
44
  const handlePress = () => {
43
- if (!disabled) {
45
+ if (!disabled && !loading) {
44
46
  onPress();
45
47
  }
46
48
  };
47
49
 
50
+ const isDisabled = disabled || loading;
51
+
48
52
  // Size configurations
49
53
  const sizeConfig = {
50
54
  sm: {
@@ -166,7 +170,7 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
166
170
  },
167
171
  variantStyles.container,
168
172
  fullWidth ? styles.fullWidth : undefined,
169
- disabled ? styles.disabled : undefined,
173
+ isDisabled ? styles.disabled : undefined,
170
174
  style,
171
175
  ];
172
176
 
@@ -176,7 +180,7 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
176
180
  fontWeight: '600',
177
181
  },
178
182
  variantStyles.text,
179
- disabled ? styles.disabledText : undefined,
183
+ isDisabled ? styles.disabledText : undefined,
180
184
  textStyle,
181
185
  ];
182
186
 
@@ -189,11 +193,17 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
189
193
  style={containerStyle}
190
194
  onPress={handlePress}
191
195
  activeOpacity={activeOpacity}
192
- disabled={disabled}
196
+ disabled={isDisabled}
193
197
  testID={testID}
194
198
  >
195
199
  <View style={styles.content}>
196
- {showIcon ? (
200
+ {loading ? (
201
+ <ActivityIndicator
202
+ size="small"
203
+ color={iconColor as string}
204
+ style={styles.icon}
205
+ />
206
+ ) : showIcon ? (
197
207
  <AtomicIcon
198
208
  name={icon}
199
209
  customSize={config.iconSize}
@@ -19,6 +19,7 @@ export interface AtomicTextAreaProps {
19
19
  errorText?: string;
20
20
  maxLength?: number;
21
21
  numberOfLines?: number;
22
+ rows?: number;
22
23
  disabled?: boolean;
23
24
  style?: ViewStyle;
24
25
  testID?: string;
@@ -32,11 +33,13 @@ export const AtomicTextArea: React.FC<AtomicTextAreaProps> = ({
32
33
  helperText,
33
34
  errorText,
34
35
  maxLength,
35
- numberOfLines = 4,
36
+ numberOfLines,
37
+ rows = 4,
36
38
  disabled = false,
37
39
  style,
38
40
  testID,
39
41
  }) => {
42
+ const lineCount = numberOfLines ?? rows;
40
43
  const tokens = useAppDesignTokens();
41
44
  const hasError = !!errorText;
42
45
 
@@ -56,7 +59,7 @@ export const AtomicTextArea: React.FC<AtomicTextAreaProps> = ({
56
59
  placeholder={placeholder}
57
60
  placeholderTextColor={tokens.colors.textTertiary}
58
61
  maxLength={maxLength}
59
- numberOfLines={numberOfLines}
62
+ numberOfLines={lineCount}
60
63
  multiline
61
64
  editable={!disabled}
62
65
  textAlignVertical="top"
@@ -66,7 +69,7 @@ export const AtomicTextArea: React.FC<AtomicTextAreaProps> = ({
66
69
  backgroundColor: tokens.colors.surface,
67
70
  borderColor: hasError ? tokens.colors.error : tokens.colors.border,
68
71
  color: tokens.colors.textPrimary,
69
- minHeight: numberOfLines * 24,
72
+ minHeight: lineCount * 24,
70
73
  },
71
74
  disabled && { opacity: 0.5 },
72
75
  ]}
@@ -30,8 +30,8 @@ export interface AtomicPickerProps {
30
30
  onChange: (value: string | string[]) => void;
31
31
  options: PickerOption[];
32
32
  label?: string;
33
- /** Placeholder text - REQUIRED for i18n, pass translated string */
34
- placeholder: string;
33
+ /** Placeholder text - pass translated string for i18n */
34
+ placeholder?: string;
35
35
  error?: string;
36
36
  disabled?: boolean;
37
37
  multiple?: boolean;
@@ -41,14 +41,14 @@ export interface AtomicPickerProps {
41
41
  color?: IconColor;
42
42
  size?: PickerSize;
43
43
  modalTitle?: string;
44
- /** Empty state message - REQUIRED for i18n, pass translated string */
45
- emptyMessage: string;
46
- /** Search placeholder text - REQUIRED for i18n, pass translated string */
47
- searchPlaceholder: string;
48
- /** Clear button accessibility label - REQUIRED for i18n, pass translated string */
49
- clearAccessibilityLabel: string;
50
- /** Close button accessibility label - REQUIRED for i18n, pass translated string */
51
- closeAccessibilityLabel: string;
44
+ /** Empty state message - pass translated string for i18n */
45
+ emptyMessage?: string;
46
+ /** Search placeholder text - pass translated string for i18n */
47
+ searchPlaceholder?: string;
48
+ /** Clear button accessibility label - pass translated string for i18n */
49
+ clearAccessibilityLabel?: string;
50
+ /** Close button accessibility label - pass translated string for i18n */
51
+ closeAccessibilityLabel?: string;
52
52
  style?: ViewStyle | ViewStyle[];
53
53
  labelStyle?: TextStyle | TextStyle[];
54
54
  testID?: string;