@umituz/react-native-design-system 1.1.2 → 1.1.3
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": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Universal design system for React Native apps - Domain-Driven Design architecture with Material Design 3 components",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
package/src/index.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import type { ViewStyle } from 'react-native';
|
|
9
10
|
import * as LucideIcons from 'lucide-react-native';
|
|
10
11
|
import { useAppDesignTokens } from '../hooks/useAppDesignTokens';
|
|
11
12
|
|
|
@@ -44,8 +45,19 @@ export interface IconProps {
|
|
|
44
45
|
customSize?: number;
|
|
45
46
|
/** Custom color override (hex) */
|
|
46
47
|
customColor?: string;
|
|
48
|
+
/** Optional style */
|
|
49
|
+
style?: ViewStyle;
|
|
50
|
+
/** Optional test ID */
|
|
51
|
+
testID?: string;
|
|
52
|
+
/** Legacy prop support: icon (alias for name) */
|
|
53
|
+
icon?: string;
|
|
47
54
|
}
|
|
48
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Icon name type (all Lucide icon names as string)
|
|
58
|
+
*/
|
|
59
|
+
export type IconName = string;
|
|
60
|
+
|
|
49
61
|
/**
|
|
50
62
|
* Size mapping (pixels)
|
|
51
63
|
*/
|
|
@@ -65,18 +77,24 @@ const sizeMap: Record<IconSize, number> = {
|
|
|
65
77
|
*/
|
|
66
78
|
export const AtomicIcon: React.FC<IconProps> = ({
|
|
67
79
|
name,
|
|
80
|
+
icon, // Legacy support
|
|
68
81
|
color = 'textPrimary',
|
|
69
82
|
size = 'md',
|
|
70
83
|
customSize,
|
|
71
84
|
customColor,
|
|
85
|
+
style,
|
|
86
|
+
testID,
|
|
72
87
|
}) => {
|
|
73
88
|
const tokens = useAppDesignTokens();
|
|
74
89
|
|
|
90
|
+
// Support legacy 'icon' prop (fallback to 'name')
|
|
91
|
+
const iconName = name || icon || '';
|
|
92
|
+
|
|
75
93
|
// Get icon component from Lucide
|
|
76
|
-
const IconComponent = (LucideIcons as any)[
|
|
94
|
+
const IconComponent = (LucideIcons as any)[iconName];
|
|
77
95
|
|
|
78
96
|
if (!IconComponent) {
|
|
79
|
-
console.warn(`Icon "${
|
|
97
|
+
console.warn(`Icon "${iconName}" not found in Lucide icon set`);
|
|
80
98
|
return null;
|
|
81
99
|
}
|
|
82
100
|
|
|
@@ -104,10 +122,11 @@ export const AtomicIcon: React.FC<IconProps> = ({
|
|
|
104
122
|
// Resolve size
|
|
105
123
|
const iconSize = customSize || sizeMap[size];
|
|
106
124
|
|
|
107
|
-
return <IconComponent color={resolveColor()} size={iconSize} />;
|
|
125
|
+
return <IconComponent color={resolveColor()} size={iconSize} style={style} testID={testID} />;
|
|
108
126
|
};
|
|
109
127
|
|
|
110
128
|
// Re-export types for backward compatibility
|
|
111
129
|
export type AtomicIconProps = IconProps;
|
|
112
130
|
export type AtomicIconSize = IconSize;
|
|
113
131
|
export type AtomicIconColor = IconColor;
|
|
132
|
+
export type AtomicIconName = IconName;
|