@momo-kits/foundation 0.81.43-rc.4 → 0.81.43-rc.6
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/Application/BottomTab.tsx +3 -1
- package/Application/Components.tsx +8 -4
- package/Badge/Badge.tsx +1 -1
- package/Badge/BadgeRibbon.tsx +2 -2
- package/Button/index.tsx +4 -4
- package/CheckBox/index.tsx +1 -1
- package/Input/InputOTP.tsx +11 -5
- package/Input/InputSearch.tsx +1 -1
- package/Input/InputTextArea.tsx +3 -1
- package/Input/common.tsx +5 -3
- package/Pagination/PaginationNumber.tsx +1 -1
- package/Popup/PopupNotify.tsx +3 -3
- package/Radio/index.tsx +1 -1
- package/Tag/index.tsx +1 -1
- package/Title/index.tsx +2 -2
- package/package.json +1 -1
|
@@ -84,7 +84,9 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
84
84
|
return (
|
|
85
85
|
<Text
|
|
86
86
|
numberOfLines={1}
|
|
87
|
-
typography={
|
|
87
|
+
typography={
|
|
88
|
+
focused ? 'label_xs_medium' : 'description_xs_regular'
|
|
89
|
+
}
|
|
88
90
|
color={color}>
|
|
89
91
|
{item.label}
|
|
90
92
|
</Text>
|
|
@@ -22,7 +22,6 @@ import {
|
|
|
22
22
|
HeaderAnimatedProps,
|
|
23
23
|
HeaderBackgroundProps,
|
|
24
24
|
HeaderBackProps,
|
|
25
|
-
HeaderToolkitProps,
|
|
26
25
|
NavigationButtonProps,
|
|
27
26
|
TitleCustomProps,
|
|
28
27
|
} from './types';
|
|
@@ -50,12 +49,17 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
50
49
|
};
|
|
51
50
|
}
|
|
52
51
|
|
|
52
|
+
const isNumber = (label: any) => {
|
|
53
|
+
const numberRegex = /^\d+$/;
|
|
54
|
+
return numberRegex.test(String(label));
|
|
55
|
+
};
|
|
56
|
+
|
|
53
57
|
const renderBadge = useCallback(() => {
|
|
54
58
|
if (badgeType === 'dot') {
|
|
55
59
|
return <BadgeDot size="small" style={styles.badgeDot} />;
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
if (
|
|
62
|
+
if (isNumber(badgeValue)) {
|
|
59
63
|
return <Badge label={badgeValue} style={styles.badge} />;
|
|
60
64
|
}
|
|
61
65
|
}, [badgeType, badgeValue]);
|
|
@@ -240,10 +244,10 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
240
244
|
)}
|
|
241
245
|
</View>
|
|
242
246
|
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
243
|
-
<Text typography="
|
|
247
|
+
<Text typography="action_default_bold" color={tintColor}>
|
|
244
248
|
{title}
|
|
245
249
|
</Text>
|
|
246
|
-
<Text typography="
|
|
250
|
+
<Text typography="description_default_regular" color={tintColor}>
|
|
247
251
|
{subTitle}
|
|
248
252
|
</Text>
|
|
249
253
|
</View>
|
package/Badge/Badge.tsx
CHANGED
|
@@ -46,7 +46,7 @@ const Badge: FC<BadgeProps> = ({label = 'Label', style, backgroundColor}) => {
|
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
48
|
<View style={[style, styles.badge, {backgroundColor: badgeColor}]}>
|
|
49
|
-
<Text color={Colors.black_01} typography={'
|
|
49
|
+
<Text color={Colors.black_01} typography={'action_xxs_bold'}>
|
|
50
50
|
{formatTitle()}
|
|
51
51
|
</Text>
|
|
52
52
|
</View>
|
package/Badge/BadgeRibbon.tsx
CHANGED
|
@@ -54,7 +54,7 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
54
54
|
},
|
|
55
55
|
]}
|
|
56
56
|
color={Colors.black_01}
|
|
57
|
-
typography={'
|
|
57
|
+
typography={'label_xs_medium'}>
|
|
58
58
|
{label}
|
|
59
59
|
</Text>
|
|
60
60
|
</View>
|
|
@@ -87,7 +87,7 @@ const BadgeRibbon: FC<BadgeRibbonProps> = ({
|
|
|
87
87
|
},
|
|
88
88
|
]}
|
|
89
89
|
color={Colors.black_01}
|
|
90
|
-
typography={'
|
|
90
|
+
typography={'label_xs_medium'}>
|
|
91
91
|
{label}
|
|
92
92
|
</Text>
|
|
93
93
|
</View>
|
package/Button/index.tsx
CHANGED
|
@@ -172,14 +172,14 @@ const Button: FC<ButtonProps> = ({
|
|
|
172
172
|
const getTypography = (): Typography => {
|
|
173
173
|
switch (size) {
|
|
174
174
|
case 'large':
|
|
175
|
-
return '
|
|
175
|
+
return 'action_default_bold';
|
|
176
176
|
case 'medium':
|
|
177
|
-
return '
|
|
177
|
+
return 'action_s_bold';
|
|
178
178
|
case 'small':
|
|
179
|
-
return '
|
|
179
|
+
return 'action_xs_bold';
|
|
180
180
|
|
|
181
181
|
default:
|
|
182
|
-
return '
|
|
182
|
+
return 'action_default_bold';
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
|
package/CheckBox/index.tsx
CHANGED
package/Input/InputOTP.tsx
CHANGED
|
@@ -57,7 +57,7 @@ const OTPCaret: FC<CaretProps> = ({index, length}) => {
|
|
|
57
57
|
opacity,
|
|
58
58
|
}}
|
|
59
59
|
/>
|
|
60
|
-
<Text color={theme.colors.text.hint} typography={'
|
|
60
|
+
<Text color={theme.colors.text.hint} typography={'body_default_regular'}>
|
|
61
61
|
-
|
|
62
62
|
</Text>
|
|
63
63
|
</View>
|
|
@@ -135,7 +135,9 @@ const InputOTP = forwardRef(
|
|
|
135
135
|
? theme.colors.text.default
|
|
136
136
|
: theme.colors.text.hint
|
|
137
137
|
}
|
|
138
|
-
typography={
|
|
138
|
+
typography={
|
|
139
|
+
!!value[i] ? 'header_m_bold' : 'body_default_regular'
|
|
140
|
+
}>
|
|
139
141
|
{value[i] || '-'}
|
|
140
142
|
</Text>
|
|
141
143
|
)}
|
|
@@ -150,7 +152,9 @@ const InputOTP = forwardRef(
|
|
|
150
152
|
|
|
151
153
|
if (!focused && value.length === 0 && !!placeholder) {
|
|
152
154
|
return (
|
|
153
|
-
<Text
|
|
155
|
+
<Text
|
|
156
|
+
color={theme.colors.text.hint}
|
|
157
|
+
typography={'description_default_regular'}>
|
|
154
158
|
{placeholder}
|
|
155
159
|
</Text>
|
|
156
160
|
);
|
|
@@ -167,7 +171,7 @@ const InputOTP = forwardRef(
|
|
|
167
171
|
marginRight: Spacing.L,
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
|
-
typography={'
|
|
174
|
+
typography={'header_m_bold'}>
|
|
171
175
|
{letter}
|
|
172
176
|
</Text>
|
|
173
177
|
);
|
|
@@ -191,7 +195,9 @@ const InputOTP = forwardRef(
|
|
|
191
195
|
styles.otpFloatingView,
|
|
192
196
|
{backgroundColor: theme.colors.background.surface},
|
|
193
197
|
]}>
|
|
194
|
-
<Text typography={'
|
|
198
|
+
<Text typography={'description_default_regular'}>
|
|
199
|
+
{floatingValue}
|
|
200
|
+
</Text>
|
|
195
201
|
</View>
|
|
196
202
|
)}
|
|
197
203
|
<View style={styles.otpInputsView}>
|
package/Input/InputSearch.tsx
CHANGED
|
@@ -142,7 +142,7 @@ const InputSearch = forwardRef(
|
|
|
142
142
|
</View>
|
|
143
143
|
{showButtonText && (
|
|
144
144
|
<TouchableOpacity onPress={onPressButtonText}>
|
|
145
|
-
<Text typography={'
|
|
145
|
+
<Text typography={'action_default_bold'} style={styles.textButton}>
|
|
146
146
|
{buttonText}
|
|
147
147
|
</Text>
|
|
148
148
|
</TouchableOpacity>
|
package/Input/InputTextArea.tsx
CHANGED
|
@@ -71,7 +71,9 @@ const InputTextArea = forwardRef(
|
|
|
71
71
|
const renderCountingView = () => {
|
|
72
72
|
return (
|
|
73
73
|
<View style={styles.countingView}>
|
|
74
|
-
<Text
|
|
74
|
+
<Text
|
|
75
|
+
color={theme.colors.text.hint}
|
|
76
|
+
typography={'description_xs_regular'}>
|
|
75
77
|
{`${inputValue.length}/${maxLength}`}
|
|
76
78
|
</Text>
|
|
77
79
|
</View>
|
package/Input/common.tsx
CHANGED
|
@@ -64,7 +64,7 @@ export const ErrorView: FC<{errorMessage?: string; errorSpacing?: boolean}> = ({
|
|
|
64
64
|
style={Styles.flex}
|
|
65
65
|
color={errorColor}
|
|
66
66
|
numberOfLines={2}
|
|
67
|
-
typography={'
|
|
67
|
+
typography={'description_default_regular'}>
|
|
68
68
|
{errorMessage}
|
|
69
69
|
</Text>
|
|
70
70
|
</View>
|
|
@@ -104,10 +104,12 @@ export const FloatingView: FC<FloatingViewProps> = ({
|
|
|
104
104
|
},
|
|
105
105
|
style,
|
|
106
106
|
]}>
|
|
107
|
-
<Text color={floatingTextColor} typography={'
|
|
107
|
+
<Text color={floatingTextColor} typography={'label_s_medium'}>
|
|
108
108
|
{floatingValue}
|
|
109
109
|
{required && (
|
|
110
|
-
<Text
|
|
110
|
+
<Text
|
|
111
|
+
typography={'label_s_medium'}
|
|
112
|
+
color={theme.colors.error.primary}>
|
|
111
113
|
*
|
|
112
114
|
</Text>
|
|
113
115
|
)}
|
|
@@ -13,7 +13,7 @@ const PaginationNumber: FC<ChildPaginationProps> = ({
|
|
|
13
13
|
return (
|
|
14
14
|
<View style={[style, styles.row]}>
|
|
15
15
|
<View style={styles.paginationNumberContainer}>
|
|
16
|
-
<Text color={Colors.black_01} typography={'
|
|
16
|
+
<Text color={Colors.black_01} typography={'label_default_medium'}>{`${
|
|
17
17
|
activeIndex + 1
|
|
18
18
|
}/${dataLength}`}</Text>
|
|
19
19
|
</View>
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -192,12 +192,12 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
192
192
|
]}>
|
|
193
193
|
{!!image && <Image source={{uri: image}} style={styles.image} />}
|
|
194
194
|
<View style={styles.content}>
|
|
195
|
-
<Text typography={'
|
|
195
|
+
<Text typography={'action_default_bold'} numberOfLines={1}>
|
|
196
196
|
{title}
|
|
197
197
|
</Text>
|
|
198
198
|
<Description style={[styles.description, descriptionStyle]}>
|
|
199
199
|
<Text
|
|
200
|
-
typography={'
|
|
200
|
+
typography={'body_default_regular'}
|
|
201
201
|
onTextLayout={({nativeEvent: {lines}}) => {
|
|
202
202
|
const enableScroll = lines.length > 3;
|
|
203
203
|
if (enableScroll != scrollContent) {
|
|
@@ -210,7 +210,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
210
210
|
{!!error && (
|
|
211
211
|
<View style={styles.information}>
|
|
212
212
|
<Text
|
|
213
|
-
typography={'
|
|
213
|
+
typography={'description_xs_regular'}
|
|
214
214
|
color={theme.colors.text.hint}
|
|
215
215
|
numberOfLines={1}>
|
|
216
216
|
{translate?.('errorCode')}
|
package/Radio/index.tsx
CHANGED
|
@@ -57,7 +57,7 @@ const Radio: FC<RadioProps> = ({
|
|
|
57
57
|
{marginRight: label ? Spacing.XS : 0},
|
|
58
58
|
]}
|
|
59
59
|
/>
|
|
60
|
-
{!!label && <Text typography={'
|
|
60
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
61
61
|
</TouchableOpacity>
|
|
62
62
|
);
|
|
63
63
|
};
|
package/Tag/index.tsx
CHANGED
package/Title/index.tsx
CHANGED
|
@@ -39,7 +39,7 @@ const Title: FC<TitleProps> = ({
|
|
|
39
39
|
const renderAction = () => {
|
|
40
40
|
return !!actionTitle && titleFlex ? (
|
|
41
41
|
<TouchableOpacity onPress={onPressAction}>
|
|
42
|
-
<Text typography={'
|
|
42
|
+
<Text typography={'action_s_bold'} color={theme.colors.primary}>
|
|
43
43
|
{actionTitle}
|
|
44
44
|
</Text>
|
|
45
45
|
</TouchableOpacity>
|
|
@@ -116,7 +116,7 @@ const Title: FC<TitleProps> = ({
|
|
|
116
116
|
{!!description && type !== 'screen' && (
|
|
117
117
|
<Text
|
|
118
118
|
numberOfLines={1}
|
|
119
|
-
typography={'
|
|
119
|
+
typography={'description_default_regular'}
|
|
120
120
|
color={theme.colors.text.secondary}>
|
|
121
121
|
{description}
|
|
122
122
|
</Text>
|