@umituz/react-native-design-system 2.5.17 → 2.5.18
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 +1 -1
- package/src/atoms/AtomicText.tsx +13 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.18",
|
|
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",
|
package/src/atoms/AtomicText.tsx
CHANGED
|
@@ -4,21 +4,24 @@ import { useAppDesignTokens } from '../theme';
|
|
|
4
4
|
import { getTextColor, type TextStyleVariant, type ColorVariant } from '../typography';
|
|
5
5
|
|
|
6
6
|
export interface AtomicTextProps extends TextProps {
|
|
7
|
+
/** Typographic style variant from tokens (alias for 'type') */
|
|
8
|
+
variant?: TextStyleVariant;
|
|
9
|
+
|
|
7
10
|
/** Typographic style variant from tokens */
|
|
8
11
|
type?: TextStyleVariant;
|
|
9
|
-
|
|
12
|
+
|
|
10
13
|
/** Color variant from tokens or custom hex color */
|
|
11
14
|
color?: ColorVariant | string;
|
|
12
|
-
|
|
15
|
+
|
|
13
16
|
/** Text alignment */
|
|
14
17
|
align?: TextStyle['textAlign'];
|
|
15
|
-
|
|
18
|
+
|
|
16
19
|
/** Content to render */
|
|
17
20
|
children: React.ReactNode;
|
|
18
|
-
|
|
21
|
+
|
|
19
22
|
/** Custom text style */
|
|
20
23
|
style?: StyleProp<TextStyle>;
|
|
21
|
-
|
|
24
|
+
|
|
22
25
|
/** Test ID for automation */
|
|
23
26
|
testID?: string;
|
|
24
27
|
}
|
|
@@ -31,6 +34,7 @@ export interface AtomicTextProps extends TextProps {
|
|
|
31
34
|
* ✅ SOLID, DRY, KISS
|
|
32
35
|
*/
|
|
33
36
|
export const AtomicText = ({
|
|
37
|
+
variant,
|
|
34
38
|
type = 'bodyMedium',
|
|
35
39
|
color = 'textPrimary',
|
|
36
40
|
align,
|
|
@@ -41,8 +45,11 @@ export const AtomicText = ({
|
|
|
41
45
|
}: AtomicTextProps) => {
|
|
42
46
|
const tokens = useAppDesignTokens();
|
|
43
47
|
|
|
48
|
+
// Support both 'variant' and 'type' props for backward compatibility
|
|
49
|
+
const textType = variant || type;
|
|
50
|
+
|
|
44
51
|
// Get typography style from tokens
|
|
45
|
-
const typographyStyle = (tokens.typography as Record<string, any>)[
|
|
52
|
+
const typographyStyle = (tokens.typography as Record<string, any>)[textType];
|
|
46
53
|
|
|
47
54
|
// Use responsive font size if available
|
|
48
55
|
const fontSize = typographyStyle?.responsiveFontSize || typographyStyle?.fontSize;
|