@umituz/react-native-design-system 2.5.1 → 2.5.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 +1 -1
- package/src/atoms/AtomicAvatar.tsx +9 -9
- package/src/atoms/AtomicBadge.tsx +27 -7
- package/src/atoms/AtomicButton.tsx +9 -9
- package/src/atoms/AtomicChip.tsx +3 -3
- package/src/atoms/AtomicDatePicker.tsx +2 -2
- package/src/atoms/AtomicFab.tsx +10 -2
- package/src/atoms/AtomicIcon.tsx +4 -2
- package/src/atoms/AtomicProgress.tsx +7 -5
- package/src/atoms/AtomicSpinner.tsx +8 -4
- package/src/atoms/input/styles/inputStylesHelper.ts +9 -9
- package/src/atoms/picker/styles/pickerStyles.ts +19 -19
- package/src/atoms/skeleton/AtomicSkeleton.tsx +7 -5
- package/src/molecules/ListItem.tsx +2 -2
- package/src/molecules/SearchBar/SearchBar.tsx +8 -5
- package/src/theme/core/TokenFactory.ts +8 -2
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.3",
|
|
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",
|
|
@@ -70,7 +70,7 @@ export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
|
70
70
|
}) => {
|
|
71
71
|
const tokens = useAppDesignTokens();
|
|
72
72
|
|
|
73
|
-
const avatarSize = customSize
|
|
73
|
+
const avatarSize = customSize ? customSize * tokens.spacingMultiplier : tokens.avatarSizes[size];
|
|
74
74
|
const avatarRadius = borderRadius ?? avatarSize / 2;
|
|
75
75
|
|
|
76
76
|
// Generate initials from name
|
|
@@ -106,12 +106,12 @@ export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
|
106
106
|
borderRadius: avatarRadius,
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
// Font size based on avatar size
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return
|
|
109
|
+
// Font size based on avatar size (scaled)
|
|
110
|
+
const getAvatarFontSize = (sizeValue: number): number => {
|
|
111
|
+
const baseFontSize = sizeValue <= 32 ? 12 :
|
|
112
|
+
sizeValue <= 48 ? 16 :
|
|
113
|
+
sizeValue <= 64 ? 20 : 24;
|
|
114
|
+
return baseFontSize * tokens.spacingMultiplier;
|
|
115
115
|
};
|
|
116
116
|
|
|
117
117
|
return (
|
|
@@ -132,7 +132,7 @@ export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
|
132
132
|
type="labelLarge"
|
|
133
133
|
color={defaultTextColor}
|
|
134
134
|
style={{
|
|
135
|
-
fontSize:
|
|
135
|
+
fontSize: getAvatarFontSize(avatarSize),
|
|
136
136
|
fontWeight: tokens.typography.semibold,
|
|
137
137
|
}}
|
|
138
138
|
>
|
|
@@ -143,7 +143,7 @@ export const AtomicAvatar: React.FC<AtomicAvatarProps> = ({
|
|
|
143
143
|
type="labelLarge"
|
|
144
144
|
color={defaultTextColor}
|
|
145
145
|
style={{
|
|
146
|
-
fontSize:
|
|
146
|
+
fontSize: getAvatarFontSize(avatarSize),
|
|
147
147
|
fontWeight: tokens.typography.semibold,
|
|
148
148
|
}}
|
|
149
149
|
>
|
|
@@ -31,12 +31,6 @@ export interface AtomicBadgeProps {
|
|
|
31
31
|
testID?: string;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const SIZE_CONFIG = {
|
|
35
|
-
sm: { paddingH: 6, paddingV: 2, fontSize: 10, iconSize: 10, gap: 3, radius: 4 },
|
|
36
|
-
md: { paddingH: 8, paddingV: 4, fontSize: 11, iconSize: 12, gap: 4, radius: 6 },
|
|
37
|
-
lg: { paddingH: 12, paddingV: 6, fontSize: 13, iconSize: 14, gap: 5, radius: 8 },
|
|
38
|
-
};
|
|
39
|
-
|
|
40
34
|
export const AtomicBadge: React.FC<AtomicBadgeProps> = React.memo(({
|
|
41
35
|
text,
|
|
42
36
|
variant = "primary",
|
|
@@ -48,7 +42,33 @@ export const AtomicBadge: React.FC<AtomicBadgeProps> = React.memo(({
|
|
|
48
42
|
testID,
|
|
49
43
|
}) => {
|
|
50
44
|
const tokens = useAppDesignTokens();
|
|
51
|
-
|
|
45
|
+
|
|
46
|
+
const sizeConfig = {
|
|
47
|
+
sm: {
|
|
48
|
+
paddingH: 6 * tokens.spacingMultiplier,
|
|
49
|
+
paddingV: 2 * tokens.spacingMultiplier,
|
|
50
|
+
fontSize: 10 * tokens.spacingMultiplier,
|
|
51
|
+
iconSize: 10 * tokens.spacingMultiplier,
|
|
52
|
+
gap: 3 * tokens.spacingMultiplier,
|
|
53
|
+
radius: 4 * tokens.spacingMultiplier
|
|
54
|
+
},
|
|
55
|
+
md: {
|
|
56
|
+
paddingH: 8 * tokens.spacingMultiplier,
|
|
57
|
+
paddingV: 4 * tokens.spacingMultiplier,
|
|
58
|
+
fontSize: 11 * tokens.spacingMultiplier,
|
|
59
|
+
iconSize: 12 * tokens.spacingMultiplier,
|
|
60
|
+
gap: 4 * tokens.spacingMultiplier,
|
|
61
|
+
radius: 6 * tokens.spacingMultiplier
|
|
62
|
+
},
|
|
63
|
+
lg: {
|
|
64
|
+
paddingH: 12 * tokens.spacingMultiplier,
|
|
65
|
+
paddingV: 6 * tokens.spacingMultiplier,
|
|
66
|
+
fontSize: 13 * tokens.spacingMultiplier,
|
|
67
|
+
iconSize: 14 * tokens.spacingMultiplier,
|
|
68
|
+
gap: 5 * tokens.spacingMultiplier,
|
|
69
|
+
radius: 8 * tokens.spacingMultiplier
|
|
70
|
+
},
|
|
71
|
+
}[size];
|
|
52
72
|
|
|
53
73
|
const getVariantColors = () => {
|
|
54
74
|
switch (variant) {
|
|
@@ -53,23 +53,23 @@ export const AtomicButton: React.FC<AtomicButtonProps> = React.memo(({
|
|
|
53
53
|
sm: {
|
|
54
54
|
paddingVertical: tokens.spacing.xs,
|
|
55
55
|
paddingHorizontal: tokens.spacing.sm,
|
|
56
|
-
fontSize: tokens.typography.bodySmall.
|
|
57
|
-
iconSize: 16,
|
|
58
|
-
minHeight: 32,
|
|
56
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
57
|
+
iconSize: 16 * tokens.spacingMultiplier,
|
|
58
|
+
minHeight: 32 * tokens.spacingMultiplier,
|
|
59
59
|
},
|
|
60
60
|
md: {
|
|
61
61
|
paddingVertical: tokens.spacing.sm,
|
|
62
62
|
paddingHorizontal: tokens.spacing.md,
|
|
63
|
-
fontSize: tokens.typography.bodyMedium.
|
|
64
|
-
iconSize: 20,
|
|
65
|
-
minHeight: 44,
|
|
63
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
64
|
+
iconSize: 20 * tokens.spacingMultiplier,
|
|
65
|
+
minHeight: 44 * tokens.spacingMultiplier,
|
|
66
66
|
},
|
|
67
67
|
lg: {
|
|
68
68
|
paddingVertical: tokens.spacing.md,
|
|
69
69
|
paddingHorizontal: tokens.spacing.lg,
|
|
70
|
-
fontSize: tokens.typography.bodyLarge.
|
|
71
|
-
iconSize: 24,
|
|
72
|
-
minHeight: 52,
|
|
70
|
+
fontSize: tokens.typography.bodyLarge.responsiveFontSize,
|
|
71
|
+
iconSize: 24 * tokens.spacingMultiplier,
|
|
72
|
+
minHeight: 52 * tokens.spacingMultiplier,
|
|
73
73
|
},
|
|
74
74
|
};
|
|
75
75
|
|
package/src/atoms/AtomicChip.tsx
CHANGED
|
@@ -89,19 +89,19 @@ export const AtomicChip: React.FC<AtomicChipProps> = React.memo(({
|
|
|
89
89
|
sm: {
|
|
90
90
|
paddingHorizontal: tokens.spacing.sm,
|
|
91
91
|
paddingVertical: tokens.spacing.xs,
|
|
92
|
-
fontSize: tokens.typography.bodySmall.
|
|
92
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
93
93
|
iconSize: 'xs' as const
|
|
94
94
|
},
|
|
95
95
|
md: {
|
|
96
96
|
paddingHorizontal: tokens.spacing.md,
|
|
97
97
|
paddingVertical: tokens.spacing.sm,
|
|
98
|
-
fontSize: tokens.typography.bodyMedium.
|
|
98
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
99
99
|
iconSize: 'sm' as const
|
|
100
100
|
},
|
|
101
101
|
lg: {
|
|
102
102
|
paddingHorizontal: tokens.spacing.md,
|
|
103
103
|
paddingVertical: tokens.spacing.sm,
|
|
104
|
-
fontSize: tokens.typography.bodyLarge.
|
|
104
|
+
fontSize: tokens.typography.bodyLarge.responsiveFontSize,
|
|
105
105
|
iconSize: 'sm' as const
|
|
106
106
|
},
|
|
107
107
|
};
|
|
@@ -239,13 +239,13 @@ const getStyles = (tokens: ReturnType<typeof useAppDesignTokens>) => {
|
|
|
239
239
|
marginBottom: tokens.spacing.md,
|
|
240
240
|
},
|
|
241
241
|
label: {
|
|
242
|
-
fontSize: tokens.typography.bodyMedium.
|
|
242
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
243
243
|
fontWeight: tokens.typography.semibold,
|
|
244
244
|
color: tokens.colors.onSurface,
|
|
245
245
|
marginBottom: tokens.spacing.sm,
|
|
246
246
|
},
|
|
247
247
|
errorText: {
|
|
248
|
-
fontSize: tokens.typography.bodySmall.
|
|
248
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
249
249
|
color: tokens.colors.error,
|
|
250
250
|
marginTop: tokens.spacing.xs,
|
|
251
251
|
marginLeft: tokens.spacing.xs,
|
package/src/atoms/AtomicFab.tsx
CHANGED
|
@@ -60,10 +60,18 @@ export const AtomicFab: React.FC<AtomicFabProps> = ({
|
|
|
60
60
|
const isDisabled = disabled;
|
|
61
61
|
|
|
62
62
|
// Get configurations
|
|
63
|
-
const
|
|
63
|
+
const baseSizeConfig = FAB_SIZES[size as 'sm' | 'md' | 'lg'];
|
|
64
64
|
const variants = getFabVariants(tokens);
|
|
65
65
|
const variantConfig = variants[variant as 'primary' | 'secondary' | 'surface'];
|
|
66
|
-
const
|
|
66
|
+
const baseIconSize = getFabIconSize(size as 'sm' | 'md' | 'lg');
|
|
67
|
+
|
|
68
|
+
// Scale dimensions
|
|
69
|
+
const sizeConfig = {
|
|
70
|
+
width: baseSizeConfig.width * tokens.spacingMultiplier,
|
|
71
|
+
height: baseSizeConfig.height * tokens.spacingMultiplier,
|
|
72
|
+
borderRadius: baseSizeConfig.borderRadius * tokens.spacingMultiplier,
|
|
73
|
+
};
|
|
74
|
+
const iconSize = baseIconSize * tokens.spacingMultiplier;
|
|
67
75
|
|
|
68
76
|
// Combine styles
|
|
69
77
|
const fabStyle = StyleSheet.flatten([
|
package/src/atoms/AtomicIcon.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { View, StyleSheet, StyleProp, ViewStyle } from "react-native";
|
|
|
10
10
|
import { Ionicons } from "@expo/vector-icons";
|
|
11
11
|
import { useAppDesignTokens } from '../theme';
|
|
12
12
|
import {
|
|
13
|
-
getIconSize,
|
|
14
13
|
type IconSize as BaseIconSize
|
|
15
14
|
} from "./AtomicIcon.types";
|
|
16
15
|
|
|
@@ -110,7 +109,10 @@ export const AtomicIcon: React.FC<AtomicIconProps> = React.memo(({
|
|
|
110
109
|
const tokens = useAppDesignTokens();
|
|
111
110
|
|
|
112
111
|
// Calculate size
|
|
113
|
-
const
|
|
112
|
+
const baseSize = customSize ?? size;
|
|
113
|
+
const sizeInPixels = typeof baseSize === 'number'
|
|
114
|
+
? baseSize * tokens.spacingMultiplier
|
|
115
|
+
: (tokens.iconSizes as Record<string, number>)[baseSize] || (tokens.iconSizes as Record<string, number>).md;
|
|
114
116
|
|
|
115
117
|
// Calculate color
|
|
116
118
|
const iconColor = customColor
|
|
@@ -77,14 +77,16 @@ export const AtomicProgress: React.FC<AtomicProgressProps> = ({
|
|
|
77
77
|
// Calculate progress width
|
|
78
78
|
const progressWidth = `${clampedValue}%`;
|
|
79
79
|
|
|
80
|
+
const scaledHeight = height * tokens.spacingMultiplier;
|
|
81
|
+
|
|
80
82
|
// Border radius based on shape
|
|
81
|
-
const
|
|
83
|
+
const progressBorderRadius = shape === 'rounded' ? scaledHeight / 2 : 0;
|
|
82
84
|
|
|
83
85
|
const containerStyle: ViewStyle = {
|
|
84
86
|
width: width as DimensionValue,
|
|
85
|
-
height,
|
|
87
|
+
height: scaledHeight,
|
|
86
88
|
backgroundColor: progressBackground,
|
|
87
|
-
borderRadius,
|
|
89
|
+
borderRadius: progressBorderRadius,
|
|
88
90
|
overflow: 'hidden',
|
|
89
91
|
};
|
|
90
92
|
|
|
@@ -92,11 +94,11 @@ export const AtomicProgress: React.FC<AtomicProgressProps> = ({
|
|
|
92
94
|
width: progressWidth as DimensionValue,
|
|
93
95
|
height: '100%' as DimensionValue,
|
|
94
96
|
backgroundColor: progressColor,
|
|
95
|
-
borderRadius,
|
|
97
|
+
borderRadius: progressBorderRadius,
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
const textStyle = {
|
|
99
|
-
fontSize: tokens.typography.bodySmall.
|
|
101
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
100
102
|
fontWeight: tokens.typography.labelMedium.fontWeight,
|
|
101
103
|
color: progressTextColor,
|
|
102
104
|
textAlign: 'center' as const,
|
|
@@ -81,8 +81,10 @@ export const AtomicSpinner: React.FC<AtomicSpinnerProps> = ({
|
|
|
81
81
|
}) => {
|
|
82
82
|
const tokens = useAppDesignTokens();
|
|
83
83
|
|
|
84
|
-
// Resolve size
|
|
85
|
-
const
|
|
84
|
+
// Resolve size (scaled)
|
|
85
|
+
const baseSize = typeof size === 'number' ? size : SIZE_MAP[size];
|
|
86
|
+
const resolvedSize = baseSize * tokens.spacingMultiplier;
|
|
87
|
+
|
|
86
88
|
const activitySize = typeof size === 'number'
|
|
87
89
|
? (size >= 30 ? 'large' : 'small')
|
|
88
90
|
: ACTIVITY_SIZE_MAP[size];
|
|
@@ -109,7 +111,7 @@ export const AtomicSpinner: React.FC<AtomicSpinnerProps> = ({
|
|
|
109
111
|
// Container styles
|
|
110
112
|
const containerStyles: ViewStyle[] = [
|
|
111
113
|
styles.container,
|
|
112
|
-
textPosition === 'right' &&
|
|
114
|
+
textPosition === 'right' && { flexDirection: 'row' },
|
|
113
115
|
fullContainer && styles.fullContainer,
|
|
114
116
|
overlay && [styles.overlay, { backgroundColor: resolvedOverlayColor }],
|
|
115
117
|
].filter(Boolean) as ViewStyle[];
|
|
@@ -142,7 +144,9 @@ export const AtomicSpinner: React.FC<AtomicSpinnerProps> = ({
|
|
|
142
144
|
type="bodyMedium"
|
|
143
145
|
style={[
|
|
144
146
|
styles.text,
|
|
145
|
-
textPosition === 'right'
|
|
147
|
+
textPosition === 'right'
|
|
148
|
+
? { marginLeft: 12 * tokens.spacingMultiplier }
|
|
149
|
+
: { marginTop: 12 * tokens.spacingMultiplier },
|
|
146
150
|
{ color: overlay ? '#FFFFFF' : tokens.colors.textSecondary },
|
|
147
151
|
]}
|
|
148
152
|
>
|
|
@@ -28,23 +28,23 @@ export const getSizeConfig = ({ size, tokens }: GetSizeConfigParams) => {
|
|
|
28
28
|
sm: {
|
|
29
29
|
paddingVertical: tokens.spacing.xs,
|
|
30
30
|
paddingHorizontal: tokens.spacing.sm,
|
|
31
|
-
fontSize: tokens.typography.bodySmall.
|
|
32
|
-
iconSize: 16,
|
|
33
|
-
minHeight: 40,
|
|
31
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
32
|
+
iconSize: 16 * tokens.spacingMultiplier,
|
|
33
|
+
minHeight: 40 * tokens.spacingMultiplier,
|
|
34
34
|
},
|
|
35
35
|
md: {
|
|
36
36
|
paddingVertical: tokens.spacing.sm,
|
|
37
37
|
paddingHorizontal: tokens.spacing.md,
|
|
38
|
-
fontSize: tokens.typography.bodyMedium.
|
|
39
|
-
iconSize: 20,
|
|
40
|
-
minHeight: 48,
|
|
38
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
39
|
+
iconSize: 20 * tokens.spacingMultiplier,
|
|
40
|
+
minHeight: 48 * tokens.spacingMultiplier,
|
|
41
41
|
},
|
|
42
42
|
lg: {
|
|
43
43
|
paddingVertical: tokens.spacing.md,
|
|
44
44
|
paddingHorizontal: tokens.spacing.lg,
|
|
45
|
-
fontSize: tokens.typography.bodyLarge.
|
|
46
|
-
iconSize: 24,
|
|
47
|
-
minHeight: 56,
|
|
45
|
+
fontSize: tokens.typography.bodyLarge.responsiveFontSize,
|
|
46
|
+
iconSize: 24 * tokens.spacingMultiplier,
|
|
47
|
+
minHeight: 56 * tokens.spacingMultiplier,
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
50
|
|
|
@@ -44,17 +44,17 @@ export const getPickerContainerStyles = (tokens: DesignTokens): PickerContainerS
|
|
|
44
44
|
sm: {
|
|
45
45
|
paddingHorizontal: tokens.spacing.sm,
|
|
46
46
|
paddingVertical: tokens.spacing.xs,
|
|
47
|
-
minHeight: 36,
|
|
47
|
+
minHeight: 36 * tokens.spacingMultiplier,
|
|
48
48
|
},
|
|
49
49
|
md: {
|
|
50
50
|
paddingHorizontal: tokens.spacing.md,
|
|
51
51
|
paddingVertical: tokens.spacing.sm,
|
|
52
|
-
minHeight: 48,
|
|
52
|
+
minHeight: 48 * tokens.spacingMultiplier,
|
|
53
53
|
},
|
|
54
54
|
lg: {
|
|
55
55
|
paddingHorizontal: tokens.spacing.lg,
|
|
56
56
|
paddingVertical: tokens.spacing.md,
|
|
57
|
-
minHeight: 56,
|
|
57
|
+
minHeight: 56 * tokens.spacingMultiplier,
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
state: {
|
|
@@ -73,9 +73,9 @@ export const getPickerLabelStyles = (tokens: DesignTokens): PickerLabelStyles =>
|
|
|
73
73
|
marginBottom: tokens.spacing.xs,
|
|
74
74
|
},
|
|
75
75
|
size: {
|
|
76
|
-
sm: { fontSize: tokens.typography.bodySmall.
|
|
77
|
-
md: { fontSize: tokens.typography.bodyMedium.
|
|
78
|
-
lg: { fontSize: tokens.typography.bodyLarge.
|
|
76
|
+
sm: { fontSize: tokens.typography.bodySmall.responsiveFontSize },
|
|
77
|
+
md: { fontSize: tokens.typography.bodyMedium.responsiveFontSize },
|
|
78
|
+
lg: { fontSize: tokens.typography.bodyLarge.responsiveFontSize },
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
81
|
|
|
@@ -85,9 +85,9 @@ export const getPickerValueStyles = (tokens: DesignTokens): PickerValueStyles =>
|
|
|
85
85
|
flex: 1,
|
|
86
86
|
},
|
|
87
87
|
size: {
|
|
88
|
-
sm: { fontSize: tokens.typography.bodySmall.
|
|
89
|
-
md: { fontSize: tokens.typography.bodyMedium.
|
|
90
|
-
lg: { fontSize: tokens.typography.bodyLarge.
|
|
88
|
+
sm: { fontSize: tokens.typography.bodySmall.responsiveFontSize },
|
|
89
|
+
md: { fontSize: tokens.typography.bodyMedium.responsiveFontSize },
|
|
90
|
+
lg: { fontSize: tokens.typography.bodyLarge.responsiveFontSize },
|
|
91
91
|
},
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -97,15 +97,15 @@ export const getPickerPlaceholderStyles = (tokens: DesignTokens): PickerPlacehol
|
|
|
97
97
|
flex: 1,
|
|
98
98
|
},
|
|
99
99
|
size: {
|
|
100
|
-
sm: { fontSize: tokens.typography.bodySmall.
|
|
101
|
-
md: { fontSize: tokens.typography.bodyMedium.
|
|
102
|
-
lg: { fontSize: tokens.typography.bodyLarge.
|
|
100
|
+
sm: { fontSize: tokens.typography.bodySmall.responsiveFontSize },
|
|
101
|
+
md: { fontSize: tokens.typography.bodyMedium.responsiveFontSize },
|
|
102
|
+
lg: { fontSize: tokens.typography.bodyLarge.responsiveFontSize },
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
export const getPickerErrorStyles = (tokens: DesignTokens): TextStyle => ({
|
|
107
107
|
color: tokens.colors.error,
|
|
108
|
-
fontSize: tokens.typography.bodySmall.
|
|
108
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
109
109
|
marginTop: tokens.spacing.xs,
|
|
110
110
|
});
|
|
111
111
|
|
|
@@ -135,7 +135,7 @@ export const getModalHeaderStyles = (tokens: DesignTokens): ViewStyle => ({
|
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
export const getModalTitleStyles = (tokens: DesignTokens): TextStyle => ({
|
|
138
|
-
fontSize: tokens.typography.titleLarge.
|
|
138
|
+
fontSize: tokens.typography.titleLarge.responsiveFontSize,
|
|
139
139
|
fontWeight: '600',
|
|
140
140
|
color: tokens.colors.onSurface,
|
|
141
141
|
});
|
|
@@ -154,7 +154,7 @@ export const getSearchContainerStyles = (tokens: DesignTokens): ViewStyle => ({
|
|
|
154
154
|
|
|
155
155
|
export const getSearchInputStyles = (tokens: DesignTokens): TextStyle => ({
|
|
156
156
|
flex: 1,
|
|
157
|
-
fontSize: tokens.typography.bodyMedium.
|
|
157
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
158
158
|
color: tokens.colors.onSurface,
|
|
159
159
|
paddingVertical: 0,
|
|
160
160
|
});
|
|
@@ -174,13 +174,13 @@ export const getOptionContainerStyles = (
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
export const getOptionTextStyles = (tokens: DesignTokens, selected: boolean): TextStyle => ({
|
|
177
|
-
fontSize: tokens.typography.bodyLarge.
|
|
177
|
+
fontSize: tokens.typography.bodyLarge.responsiveFontSize,
|
|
178
178
|
color: selected ? tokens.colors.primary : tokens.colors.onSurface,
|
|
179
179
|
fontWeight: selected ? '600' : '400',
|
|
180
180
|
});
|
|
181
181
|
|
|
182
182
|
export const getOptionDescriptionStyles = (tokens: DesignTokens): TextStyle => ({
|
|
183
|
-
fontSize: tokens.typography.bodySmall.
|
|
183
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
184
184
|
color: tokens.colors.textSecondary,
|
|
185
185
|
marginTop: tokens.spacing.xs,
|
|
186
186
|
});
|
|
@@ -194,7 +194,7 @@ export const getEmptyStateStyles = (tokens: DesignTokens): ViewStyle => ({
|
|
|
194
194
|
});
|
|
195
195
|
|
|
196
196
|
export const getEmptyStateTextStyles = (tokens: DesignTokens): TextStyle => ({
|
|
197
|
-
fontSize: tokens.typography.bodyMedium.
|
|
197
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
198
198
|
color: tokens.colors.textSecondary,
|
|
199
199
|
textAlign: 'center',
|
|
200
200
|
});
|
|
@@ -218,6 +218,6 @@ export const getChipStyles = (tokens: DesignTokens): ViewStyle => ({
|
|
|
218
218
|
});
|
|
219
219
|
|
|
220
220
|
export const getChipTextStyles = (tokens: DesignTokens): TextStyle => ({
|
|
221
|
-
fontSize: tokens.typography.bodySmall.
|
|
221
|
+
fontSize: tokens.typography.bodySmall.responsiveFontSize,
|
|
222
222
|
color: tokens.colors.onSurface,
|
|
223
223
|
});
|
|
@@ -65,7 +65,8 @@ const SkeletonItem: React.FC<{
|
|
|
65
65
|
baseColor: string;
|
|
66
66
|
highlightColor: string;
|
|
67
67
|
disableAnimation: boolean;
|
|
68
|
-
|
|
68
|
+
multiplier: number;
|
|
69
|
+
}> = ({ config, baseColor, highlightColor, disableAnimation, multiplier }) => {
|
|
69
70
|
const opacity = useSharedValue(0);
|
|
70
71
|
|
|
71
72
|
useEffect(() => {
|
|
@@ -95,10 +96,10 @@ const SkeletonItem: React.FC<{
|
|
|
95
96
|
style={[
|
|
96
97
|
styles.skeleton,
|
|
97
98
|
{
|
|
98
|
-
width: config.width
|
|
99
|
-
height: config.height,
|
|
100
|
-
borderRadius: config.borderRadius,
|
|
101
|
-
marginBottom: config.marginBottom,
|
|
99
|
+
width: typeof config.width === 'number' ? config.width * multiplier : config.width,
|
|
100
|
+
height: config.height ? config.height * multiplier : undefined,
|
|
101
|
+
borderRadius: config.borderRadius ? config.borderRadius * multiplier : undefined,
|
|
102
|
+
marginBottom: config.marginBottom ? config.marginBottom * multiplier : undefined,
|
|
102
103
|
backgroundColor: baseColor,
|
|
103
104
|
},
|
|
104
105
|
animatedStyle,
|
|
@@ -129,6 +130,7 @@ export const AtomicSkeleton: React.FC<AtomicSkeletonProps> = ({
|
|
|
129
130
|
baseColor={tokens.colors.surfaceSecondary}
|
|
130
131
|
highlightColor={tokens.colors.border}
|
|
131
132
|
disableAnimation={disableAnimation}
|
|
133
|
+
multiplier={tokens.spacingMultiplier}
|
|
132
134
|
/>
|
|
133
135
|
))}
|
|
134
136
|
</View>
|
|
@@ -18,7 +18,7 @@ export const ListItem: React.FC<ListItemProps> = ({
|
|
|
18
18
|
<Component style={[listItemStyles.container, disabled ? listItemStyles.disabled : undefined, style]} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
19
19
|
{leftIcon && (
|
|
20
20
|
<View style={listItemStyles.iconContainer}>
|
|
21
|
-
<AtomicIcon name={leftIcon} color={disabled ? 'surfaceVariant' : 'primary'} />
|
|
21
|
+
<AtomicIcon name={leftIcon} color={disabled ? 'surfaceVariant' : 'primary'} size="md" />
|
|
22
22
|
</View>
|
|
23
23
|
)}
|
|
24
24
|
<View style={listItemStyles.content}>
|
|
@@ -27,7 +27,7 @@ export const ListItem: React.FC<ListItemProps> = ({
|
|
|
27
27
|
</View>
|
|
28
28
|
{rightIcon && onPress && (
|
|
29
29
|
<View style={listItemStyles.iconContainer}>
|
|
30
|
-
<AtomicIcon name={rightIcon} color="surfaceVariant" />
|
|
30
|
+
<AtomicIcon name={rightIcon} color="surfaceVariant" size="sm" />
|
|
31
31
|
</View>
|
|
32
32
|
)}
|
|
33
33
|
</Component>
|
|
@@ -41,6 +41,9 @@ export const SearchBar = forwardRef<React.ComponentRef<typeof TextInput>, Search
|
|
|
41
41
|
{
|
|
42
42
|
backgroundColor: tokens.colors.surfaceVariant,
|
|
43
43
|
borderColor: tokens.colors.border,
|
|
44
|
+
height: 48 * tokens.spacingMultiplier,
|
|
45
|
+
paddingHorizontal: 12 * tokens.spacingMultiplier,
|
|
46
|
+
borderRadius: 24 * tokens.spacingMultiplier,
|
|
44
47
|
},
|
|
45
48
|
containerStyle,
|
|
46
49
|
]}
|
|
@@ -72,7 +75,7 @@ export const SearchBar = forwardRef<React.ComponentRef<typeof TextInput>, Search
|
|
|
72
75
|
styles.input,
|
|
73
76
|
{
|
|
74
77
|
color: tokens.colors.textPrimary,
|
|
75
|
-
fontSize:
|
|
78
|
+
fontSize: tokens.typography.bodyMedium.responsiveFontSize,
|
|
76
79
|
},
|
|
77
80
|
inputStyle,
|
|
78
81
|
]}
|
|
@@ -115,9 +118,9 @@ const styles = StyleSheet.create({
|
|
|
115
118
|
container: {
|
|
116
119
|
flexDirection: 'row',
|
|
117
120
|
alignItems: 'center',
|
|
118
|
-
paddingHorizontal: 12,
|
|
119
|
-
height: 48,
|
|
120
|
-
borderRadius: 24,
|
|
121
|
+
paddingHorizontal: 12, // Will be scaled by parent if needed, or we rely on token usage elsewhere
|
|
122
|
+
height: 48, // Should be dynamic ideally, but keeping simple for now
|
|
123
|
+
borderRadius: 24,
|
|
121
124
|
borderWidth: 1,
|
|
122
125
|
},
|
|
123
126
|
iconContainer: {
|
|
@@ -126,7 +129,7 @@ const styles = StyleSheet.create({
|
|
|
126
129
|
input: {
|
|
127
130
|
flex: 1,
|
|
128
131
|
height: '100%',
|
|
129
|
-
paddingVertical: 0,
|
|
132
|
+
paddingVertical: 0,
|
|
130
133
|
},
|
|
131
134
|
rightActions: {
|
|
132
135
|
flexDirection: 'row',
|
|
@@ -56,9 +56,15 @@ export const createDesignTokens = (
|
|
|
56
56
|
colors,
|
|
57
57
|
spacing,
|
|
58
58
|
typography,
|
|
59
|
-
iconSizes: BASE_TOKENS.iconSizes,
|
|
59
|
+
iconSizes: Object.keys(BASE_TOKENS.iconSizes).reduce((acc, key) => {
|
|
60
|
+
acc[key as keyof typeof BASE_TOKENS.iconSizes] = BASE_TOKENS.iconSizes[key as keyof typeof BASE_TOKENS.iconSizes] * multiplier;
|
|
61
|
+
return acc;
|
|
62
|
+
}, {} as any),
|
|
60
63
|
opacity: BASE_TOKENS.opacity,
|
|
61
|
-
avatarSizes: BASE_TOKENS.avatarSizes,
|
|
64
|
+
avatarSizes: Object.keys(BASE_TOKENS.avatarSizes).reduce((acc, key) => {
|
|
65
|
+
acc[key as keyof typeof BASE_TOKENS.avatarSizes] = BASE_TOKENS.avatarSizes[key as keyof typeof BASE_TOKENS.avatarSizes] * multiplier;
|
|
66
|
+
return acc;
|
|
67
|
+
}, {} as any),
|
|
62
68
|
borderRadius,
|
|
63
69
|
borders: {
|
|
64
70
|
...BASE_TOKENS.borders,
|