@umituz/react-native-design-system 2.6.31 → 2.6.33

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.6.31",
3
+ "version": "2.6.33",
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",
@@ -18,6 +18,7 @@ export interface AtomicButtonProps {
18
18
  disabled?: boolean;
19
19
  loading?: boolean;
20
20
  icon?: IconName;
21
+ iconPosition?: 'left' | 'right';
21
22
  fullWidth?: boolean;
22
23
  style?: StyleProp<ViewStyle>;
23
24
  textStyle?: StyleProp<TextStyle>;
@@ -34,6 +35,7 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
34
35
  disabled = false,
35
36
  loading = false,
36
37
  icon,
38
+ iconPosition = 'left',
37
39
  fullWidth = false,
38
40
  style,
39
41
  textStyle,
@@ -197,19 +199,19 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
197
199
  disabled={isDisabled}
198
200
  testID={testID}
199
201
  >
200
- <View style={styles.content}>
202
+ <View style={[styles.content, iconPosition === 'right' && styles.rowReverse]}>
201
203
  {loading ? (
202
204
  <AtomicSpinner
203
205
  size="sm"
204
206
  color={iconColor as string}
205
- style={styles.icon}
207
+ style={iconPosition === 'right' ? styles.iconRight : styles.iconLeft}
206
208
  />
207
209
  ) : showIcon ? (
208
210
  <AtomicIcon
209
211
  name={icon}
210
212
  customSize={config.iconSize}
211
213
  customColor={iconColor as string | undefined}
212
- style={styles.icon}
214
+ style={iconPosition === 'right' ? styles.iconRight : styles.iconLeft}
213
215
  />
214
216
  ) : null}
215
217
 
@@ -233,6 +235,9 @@ const styles = StyleSheet.create({
233
235
  alignItems: 'center',
234
236
  justifyContent: 'center',
235
237
  },
238
+ rowReverse: {
239
+ flexDirection: 'row-reverse',
240
+ },
236
241
  fullWidth: {
237
242
  width: '100%',
238
243
  },
@@ -242,9 +247,12 @@ const styles = StyleSheet.create({
242
247
  disabledText: {
243
248
  opacity: 0.7,
244
249
  },
245
- icon: {
250
+ iconLeft: {
246
251
  marginRight: 8,
247
252
  },
253
+ iconRight: {
254
+ marginLeft: 8,
255
+ },
248
256
  });
249
257
 
250
258
  export type { AtomicButtonProps as ButtonProps };