@momo-kits/foundation 0.81.43-rc.5 → 0.81.43-tracking.1
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 +2 -3
- package/Application/NavigationContainer.tsx +1 -1
- package/Application/StackScreen.tsx +11 -2
- package/Application/types.ts +4 -4
- package/Badge/Badge.tsx +1 -1
- package/Badge/BadgeRibbon.tsx +2 -2
- package/Button/index.tsx +35 -19
- package/CheckBox/index.tsx +35 -21
- package/IconButton/index.tsx +22 -8
- package/Input/Input.tsx +20 -6
- package/Input/InputMoney.tsx +20 -6
- package/Input/InputOTP.tsx +33 -13
- package/Input/InputSearch.tsx +43 -27
- package/Input/InputTextArea.tsx +3 -1
- package/Input/common.tsx +5 -3
- package/Input/index.tsx +4 -0
- package/Pagination/PaginationNumber.tsx +1 -1
- package/Popup/PopupNotify.tsx +3 -3
- package/Radio/index.tsx +34 -19
- package/Switch/index.tsx +28 -14
- package/Tag/index.tsx +1 -1
- package/Text/styles.ts +1 -1
- package/Text/types.ts +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';
|
|
@@ -245,10 +244,10 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
245
244
|
)}
|
|
246
245
|
</View>
|
|
247
246
|
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
248
|
-
<Text typography="
|
|
247
|
+
<Text typography="header_default_bold" color={tintColor}>
|
|
249
248
|
{title}
|
|
250
249
|
</Text>
|
|
251
|
-
<Text typography="
|
|
250
|
+
<Text typography="description_default_regular" color={tintColor}>
|
|
252
251
|
{subTitle}
|
|
253
252
|
</Text>
|
|
254
253
|
</View>
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
NavigationContainerRef,
|
|
7
7
|
} from '@react-navigation/native';
|
|
8
8
|
import {createStackNavigator} from '@react-navigation/stack';
|
|
9
|
-
import {DeviceEventEmitter, NativeModules} from 'react-native';
|
|
9
|
+
import {Alert, DeviceEventEmitter, NativeModules} from 'react-native';
|
|
10
10
|
import StackScreen from './StackScreen';
|
|
11
11
|
import ModalScreen from './ModalScreen';
|
|
12
12
|
import Navigator from './Navigator';
|
|
@@ -5,6 +5,10 @@ import {ApplicationContext} from './index';
|
|
|
5
5
|
import {GridSystem} from '../Layout';
|
|
6
6
|
import {useHeaderHeight} from '@react-navigation/stack';
|
|
7
7
|
|
|
8
|
+
const {
|
|
9
|
+
ScreenContext,
|
|
10
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
11
|
+
|
|
8
12
|
const StackScreen: React.FC<ScreenParams> = props => {
|
|
9
13
|
const {screen: Component, options}: ScreenParams = props.route.params;
|
|
10
14
|
const {theme, showGrid, navigator} = useContext(ApplicationContext);
|
|
@@ -64,10 +68,15 @@ const StackScreen: React.FC<ScreenParams> = props => {
|
|
|
64
68
|
}, []);
|
|
65
69
|
|
|
66
70
|
return (
|
|
67
|
-
|
|
71
|
+
<ScreenContext.Provider
|
|
72
|
+
value={{
|
|
73
|
+
...navigator?.trackingInfo,
|
|
74
|
+
screenName: Component.name,
|
|
75
|
+
autoTracking: navigator?.maxApi?.autoTracking,
|
|
76
|
+
}}>
|
|
68
77
|
<Component heightHeader={heightHeader} {...params} />
|
|
69
78
|
{showGrid && <GridSystem />}
|
|
70
|
-
|
|
79
|
+
</ScreenContext.Provider>
|
|
71
80
|
);
|
|
72
81
|
};
|
|
73
82
|
|
package/Application/types.ts
CHANGED
|
@@ -82,10 +82,10 @@ export type LocalizationObject = {
|
|
|
82
82
|
|
|
83
83
|
export type TrackingInfo = {
|
|
84
84
|
[key: string]: any;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
app_id: string;
|
|
86
|
+
feature_code: string;
|
|
87
|
+
screen_name: string;
|
|
88
|
+
flow_partner_id?: string;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export type NavigationContainerProps = {
|
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_xs_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
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
TouchableOpacityProps,
|
|
7
7
|
View,
|
|
8
8
|
} from 'react-native';
|
|
9
|
-
|
|
10
9
|
import LinearGradient from 'react-native-linear-gradient';
|
|
11
10
|
import {ApplicationContext} from '../Application';
|
|
12
11
|
import {Text} from '../Text';
|
|
@@ -15,6 +14,11 @@ import {Colors, Spacing} from '../Consts';
|
|
|
15
14
|
import styles from './styles';
|
|
16
15
|
import {Icon} from '../Icon';
|
|
17
16
|
import {Loader} from '../Loader';
|
|
17
|
+
import {TrackingInfo} from '../Application/types';
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
ScreenContext,
|
|
21
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
18
22
|
|
|
19
23
|
const AnimationLinear = Animated.createAnimatedComponent(LinearGradient);
|
|
20
24
|
|
|
@@ -70,6 +74,8 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
70
74
|
* A callback function that is called when the button is pressed.
|
|
71
75
|
*/
|
|
72
76
|
onPress: () => void;
|
|
77
|
+
|
|
78
|
+
trackingParams?: any;
|
|
73
79
|
}
|
|
74
80
|
|
|
75
81
|
const Button: FC<ButtonProps> = ({
|
|
@@ -82,6 +88,7 @@ const Button: FC<ButtonProps> = ({
|
|
|
82
88
|
loading = false,
|
|
83
89
|
title = 'Button',
|
|
84
90
|
onPress,
|
|
91
|
+
trackingParams,
|
|
85
92
|
...rest
|
|
86
93
|
}) => {
|
|
87
94
|
const {theme, config} = useContext(ApplicationContext);
|
|
@@ -94,6 +101,8 @@ const Button: FC<ButtonProps> = ({
|
|
|
94
101
|
end: {x: 0, y: 0.5},
|
|
95
102
|
};
|
|
96
103
|
}
|
|
104
|
+
|
|
105
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
97
106
|
const getSizeStyle = () => {
|
|
98
107
|
const styleSheet: {[key: string]: any} = styles;
|
|
99
108
|
return styleSheet[size ?? 'small'];
|
|
@@ -172,14 +181,14 @@ const Button: FC<ButtonProps> = ({
|
|
|
172
181
|
const getTypography = (): Typography => {
|
|
173
182
|
switch (size) {
|
|
174
183
|
case 'large':
|
|
175
|
-
return '
|
|
184
|
+
return 'action_default_bold';
|
|
176
185
|
case 'medium':
|
|
177
|
-
return '
|
|
186
|
+
return 'action_s_bold';
|
|
178
187
|
case 'small':
|
|
179
|
-
return '
|
|
188
|
+
return 'action_xs_bold';
|
|
180
189
|
|
|
181
190
|
default:
|
|
182
|
-
return '
|
|
191
|
+
return 'action_default_bold';
|
|
183
192
|
}
|
|
184
193
|
};
|
|
185
194
|
|
|
@@ -291,20 +300,27 @@ const Button: FC<ButtonProps> = ({
|
|
|
291
300
|
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
292
301
|
|
|
293
302
|
return (
|
|
294
|
-
<
|
|
295
|
-
{
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
303
|
+
<ScreenContext.Provider
|
|
304
|
+
value={{
|
|
305
|
+
...screenInfo,
|
|
306
|
+
componentName: 'Button',
|
|
307
|
+
params: trackingParams,
|
|
308
|
+
state: type === 'disabled' ? 'disabled' : 'enabled',
|
|
309
|
+
}}>
|
|
310
|
+
<TouchableOpacity
|
|
311
|
+
{...rest}
|
|
312
|
+
activeOpacity={activeOpacity}
|
|
313
|
+
onPress={onPressButton}
|
|
314
|
+
style={buttonStyle}>
|
|
315
|
+
{renderLeading()}
|
|
316
|
+
{renderTitle()}
|
|
317
|
+
{renderTrailing()}
|
|
318
|
+
{gradientPros && (
|
|
319
|
+
<AnimationLinear {...gradientPros} style={styles.gradientView} />
|
|
320
|
+
)}
|
|
321
|
+
{gradientPros && <View style={styles.strokeView} />}
|
|
322
|
+
</TouchableOpacity>
|
|
323
|
+
</ScreenContext.Provider>
|
|
308
324
|
);
|
|
309
325
|
};
|
|
310
326
|
|
package/CheckBox/index.tsx
CHANGED
|
@@ -5,6 +5,11 @@ import styles from './styles';
|
|
|
5
5
|
import {ApplicationContext} from '../Application';
|
|
6
6
|
import {Text} from '../Text';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
|
+
import {TrackingInfo} from '../Application/types';
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
ScreenContext,
|
|
12
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
8
13
|
|
|
9
14
|
const CheckBox: FC<CheckBoxProps> = ({
|
|
10
15
|
value,
|
|
@@ -19,6 +24,7 @@ const CheckBox: FC<CheckBoxProps> = ({
|
|
|
19
24
|
const iconSource = indeterminate ? 'ic_minus' : 'ic_checked';
|
|
20
25
|
let borderColor = theme.colors.text.default;
|
|
21
26
|
let backgroundColor = theme.colors.background.surface;
|
|
27
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
22
28
|
|
|
23
29
|
if (haveValue) {
|
|
24
30
|
borderColor = theme.colors.primary;
|
|
@@ -35,27 +41,35 @@ const CheckBox: FC<CheckBoxProps> = ({
|
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
return (
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
<ScreenContext.Provider
|
|
45
|
+
value={{
|
|
46
|
+
...screenInfo,
|
|
47
|
+
componentName: 'CheckBox',
|
|
48
|
+
params: {
|
|
49
|
+
value,
|
|
50
|
+
},
|
|
51
|
+
}}>
|
|
52
|
+
<TouchableOpacity
|
|
53
|
+
activeOpacity={0.8}
|
|
54
|
+
onPress={() => onChange?.(!value)}
|
|
55
|
+
disabled={disabled}
|
|
56
|
+
style={[style, styles.container]}>
|
|
57
|
+
<View
|
|
58
|
+
style={[
|
|
59
|
+
{borderColor, backgroundColor, borderWidth: 1},
|
|
60
|
+
styles.checkbox,
|
|
61
|
+
]}>
|
|
62
|
+
{haveValue && (
|
|
63
|
+
<Icon
|
|
64
|
+
color={theme.colors.background.surface}
|
|
65
|
+
size={20}
|
|
66
|
+
source={iconSource}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</View>
|
|
70
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
71
|
+
</TouchableOpacity>
|
|
72
|
+
</ScreenContext.Provider>
|
|
59
73
|
);
|
|
60
74
|
};
|
|
61
75
|
|
package/IconButton/index.tsx
CHANGED
|
@@ -9,6 +9,11 @@ import {ApplicationContext} from '../Application';
|
|
|
9
9
|
import {Colors} from '../Consts';
|
|
10
10
|
import {Icon} from '../Icon';
|
|
11
11
|
import styles from './styles';
|
|
12
|
+
import {TrackingInfo} from '../Application/types';
|
|
13
|
+
|
|
14
|
+
const {
|
|
15
|
+
ScreenContext,
|
|
16
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
12
17
|
|
|
13
18
|
export interface IconButtonProps extends TouchableOpacityProps {
|
|
14
19
|
/**
|
|
@@ -36,6 +41,7 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
|
36
41
|
...rest
|
|
37
42
|
}) => {
|
|
38
43
|
const {theme} = useContext(ApplicationContext);
|
|
44
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* get size icon button
|
|
@@ -121,14 +127,22 @@ const IconButton: React.FC<IconButtonProps> = ({
|
|
|
121
127
|
const iconSize = size === 'small' ? 16 : 24;
|
|
122
128
|
|
|
123
129
|
return (
|
|
124
|
-
<
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
<ScreenContext.Provider
|
|
131
|
+
value={{
|
|
132
|
+
...screenInfo,
|
|
133
|
+
componentName: 'IconButton',
|
|
134
|
+
params: {
|
|
135
|
+
icon,
|
|
136
|
+
},
|
|
137
|
+
}}>
|
|
138
|
+
<TouchableOpacity
|
|
139
|
+
{...rest}
|
|
140
|
+
activeOpacity={activeOpacity}
|
|
141
|
+
onPress={onPressButton}
|
|
142
|
+
style={buttonStyle}>
|
|
143
|
+
<Icon size={iconSize} source={icon} color={getIconColor()} />
|
|
144
|
+
</TouchableOpacity>
|
|
145
|
+
</ScreenContext.Provider>
|
|
132
146
|
);
|
|
133
147
|
};
|
|
134
148
|
|
package/Input/Input.tsx
CHANGED
|
@@ -13,6 +13,10 @@ import {InputProps} from './index';
|
|
|
13
13
|
import {Icon} from '../Icon';
|
|
14
14
|
import {checkTyping} from './utils';
|
|
15
15
|
import {Loader} from '../Loader';
|
|
16
|
+
import {TrackingInfo} from '../Application/types';
|
|
17
|
+
const {
|
|
18
|
+
ScreenContext,
|
|
19
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
16
20
|
|
|
17
21
|
const Input = forwardRef(
|
|
18
22
|
(
|
|
@@ -38,6 +42,7 @@ const Input = forwardRef(
|
|
|
38
42
|
fontWeight = 'Regular',
|
|
39
43
|
onPressIcon,
|
|
40
44
|
style,
|
|
45
|
+
trackingParams,
|
|
41
46
|
...props
|
|
42
47
|
}: InputProps,
|
|
43
48
|
ref,
|
|
@@ -47,6 +52,7 @@ const Input = forwardRef(
|
|
|
47
52
|
const [haveValue, setHaveValue] = useState(!!value || !!props.defaultValue);
|
|
48
53
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
49
54
|
const accessibilityLabel = `Input/${floatingValue ?? placeholder}`;
|
|
55
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
50
56
|
|
|
51
57
|
const onClearText = () => {
|
|
52
58
|
inputRef?.current?.clear();
|
|
@@ -160,12 +166,20 @@ const Input = forwardRef(
|
|
|
160
166
|
};
|
|
161
167
|
|
|
162
168
|
return (
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
<ScreenContext.Provider
|
|
170
|
+
value={{
|
|
171
|
+
...screenInfo,
|
|
172
|
+
componentName: 'Input',
|
|
173
|
+
params: trackingParams,
|
|
174
|
+
state: disabled ? 'disabled' : 'enabled',
|
|
175
|
+
}}>
|
|
176
|
+
<View
|
|
177
|
+
style={[style, styles.wrapper]}
|
|
178
|
+
accessibilityLabel={accessibilityLabel}>
|
|
179
|
+
{renderInputView()}
|
|
180
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
181
|
+
</View>
|
|
182
|
+
</ScreenContext.Provider>
|
|
169
183
|
);
|
|
170
184
|
},
|
|
171
185
|
);
|
package/Input/InputMoney.tsx
CHANGED
|
@@ -12,6 +12,10 @@ import {ErrorView, FloatingView, getBorderColor, getSizeStyle} from './common';
|
|
|
12
12
|
import {InputMoneyProps} from './index';
|
|
13
13
|
import {Icon} from '../Icon';
|
|
14
14
|
import {formatMoneyToNumber, formatNumberToMoney} from './utils';
|
|
15
|
+
import {TrackingInfo} from '../Application/types';
|
|
16
|
+
const {
|
|
17
|
+
ScreenContext,
|
|
18
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
15
19
|
|
|
16
20
|
const InputMoney = forwardRef(
|
|
17
21
|
(
|
|
@@ -30,6 +34,7 @@ const InputMoney = forwardRef(
|
|
|
30
34
|
required = false,
|
|
31
35
|
errorSpacing,
|
|
32
36
|
style,
|
|
37
|
+
trackingParams,
|
|
33
38
|
defaultValue = '',
|
|
34
39
|
...props
|
|
35
40
|
}: InputMoneyProps,
|
|
@@ -39,6 +44,7 @@ const InputMoney = forwardRef(
|
|
|
39
44
|
const [focused, setFocused] = useState(false);
|
|
40
45
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
41
46
|
const accessibilityLabel = `InputMoney/${floatingValue}`;
|
|
47
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
42
48
|
|
|
43
49
|
const validateText = (text: string) => {
|
|
44
50
|
const valueFormat = formatMoneyToNumber(text, 'đ');
|
|
@@ -142,12 +148,20 @@ const InputMoney = forwardRef(
|
|
|
142
148
|
};
|
|
143
149
|
|
|
144
150
|
return (
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
<ScreenContext.Provider
|
|
152
|
+
value={{
|
|
153
|
+
...screenInfo,
|
|
154
|
+
componentName: 'InputMoney',
|
|
155
|
+
params: trackingParams,
|
|
156
|
+
state: 'enable',
|
|
157
|
+
}}>
|
|
158
|
+
<View
|
|
159
|
+
style={[style, styles.wrapper]}
|
|
160
|
+
accessibilityLabel={accessibilityLabel}>
|
|
161
|
+
{renderInputView()}
|
|
162
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
163
|
+
</View>
|
|
164
|
+
</ScreenContext.Provider>
|
|
151
165
|
);
|
|
152
166
|
},
|
|
153
167
|
);
|
package/Input/InputOTP.tsx
CHANGED
|
@@ -21,6 +21,10 @@ import styles from './styles';
|
|
|
21
21
|
import {ErrorView, getBorderColor} from './common';
|
|
22
22
|
import {ApplicationContext} from '../Application';
|
|
23
23
|
import {Spacing} from '../Consts';
|
|
24
|
+
import {TrackingInfo} from '../Application/types';
|
|
25
|
+
const {
|
|
26
|
+
ScreenContext,
|
|
27
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
24
28
|
|
|
25
29
|
const OTPCaret: FC<CaretProps> = ({index, length}) => {
|
|
26
30
|
const DURATION = 300;
|
|
@@ -57,7 +61,7 @@ const OTPCaret: FC<CaretProps> = ({index, length}) => {
|
|
|
57
61
|
opacity,
|
|
58
62
|
}}
|
|
59
63
|
/>
|
|
60
|
-
<Text color={theme.colors.text.hint} typography={'
|
|
64
|
+
<Text color={theme.colors.text.hint} typography={'body_default_regular'}>
|
|
61
65
|
-
|
|
62
66
|
</Text>
|
|
63
67
|
</View>
|
|
@@ -78,6 +82,7 @@ const InputOTP = forwardRef(
|
|
|
78
82
|
onFocus,
|
|
79
83
|
onBlur,
|
|
80
84
|
dataType = 'number',
|
|
85
|
+
trackingParams,
|
|
81
86
|
style,
|
|
82
87
|
...props
|
|
83
88
|
}: InputOTPProps,
|
|
@@ -89,6 +94,7 @@ const InputOTP = forwardRef(
|
|
|
89
94
|
const inputRef = useRef<TextInput>(null);
|
|
90
95
|
const {theme} = useContext(ApplicationContext);
|
|
91
96
|
const accessibilityLabel = `InputOTP/${floatingValue ?? placeholder}`;
|
|
97
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
92
98
|
|
|
93
99
|
useImperativeHandle(ref, () => ({
|
|
94
100
|
onChangeText: (text: string) => {
|
|
@@ -135,7 +141,9 @@ const InputOTP = forwardRef(
|
|
|
135
141
|
? theme.colors.text.default
|
|
136
142
|
: theme.colors.text.hint
|
|
137
143
|
}
|
|
138
|
-
typography={
|
|
144
|
+
typography={
|
|
145
|
+
!!value[i] ? 'header_m_bold' : 'body_default_regular'
|
|
146
|
+
}>
|
|
139
147
|
{value[i] || '-'}
|
|
140
148
|
</Text>
|
|
141
149
|
)}
|
|
@@ -150,7 +158,9 @@ const InputOTP = forwardRef(
|
|
|
150
158
|
|
|
151
159
|
if (!focused && value.length === 0 && !!placeholder) {
|
|
152
160
|
return (
|
|
153
|
-
<Text
|
|
161
|
+
<Text
|
|
162
|
+
color={theme.colors.text.hint}
|
|
163
|
+
typography={'description_default_regular'}>
|
|
154
164
|
{placeholder}
|
|
155
165
|
</Text>
|
|
156
166
|
);
|
|
@@ -167,7 +177,7 @@ const InputOTP = forwardRef(
|
|
|
167
177
|
marginRight: Spacing.L,
|
|
168
178
|
}
|
|
169
179
|
}
|
|
170
|
-
typography={'
|
|
180
|
+
typography={'header_m_bold'}>
|
|
171
181
|
{letter}
|
|
172
182
|
</Text>
|
|
173
183
|
);
|
|
@@ -191,7 +201,9 @@ const InputOTP = forwardRef(
|
|
|
191
201
|
styles.otpFloatingView,
|
|
192
202
|
{backgroundColor: theme.colors.background.surface},
|
|
193
203
|
]}>
|
|
194
|
-
<Text typography={'
|
|
204
|
+
<Text typography={'description_default_regular'}>
|
|
205
|
+
{floatingValue}
|
|
206
|
+
</Text>
|
|
195
207
|
</View>
|
|
196
208
|
)}
|
|
197
209
|
<View style={styles.otpInputsView}>
|
|
@@ -217,14 +229,22 @@ const InputOTP = forwardRef(
|
|
|
217
229
|
};
|
|
218
230
|
|
|
219
231
|
return (
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
232
|
+
<ScreenContext.Provider
|
|
233
|
+
value={{
|
|
234
|
+
...screenInfo,
|
|
235
|
+
componentName: 'InputOTP',
|
|
236
|
+
params: trackingParams,
|
|
237
|
+
state: 'enable',
|
|
238
|
+
}}>
|
|
239
|
+
<TouchableOpacity
|
|
240
|
+
activeOpacity={1}
|
|
241
|
+
onPress={onFocusInput}
|
|
242
|
+
style={[style, styles.otpWrapper]}
|
|
243
|
+
accessibilityLabel={accessibilityLabel}>
|
|
244
|
+
{renderInputView()}
|
|
245
|
+
<ErrorView errorMessage={errorMessage} errorSpacing={errorSpacing} />
|
|
246
|
+
</TouchableOpacity>
|
|
247
|
+
</ScreenContext.Provider>
|
|
228
248
|
);
|
|
229
249
|
},
|
|
230
250
|
);
|
package/Input/InputSearch.tsx
CHANGED
|
@@ -12,6 +12,10 @@ import styles from './styles';
|
|
|
12
12
|
import {Icon} from '../Icon';
|
|
13
13
|
import {Text} from '../Text';
|
|
14
14
|
import {checkTyping} from './utils';
|
|
15
|
+
import {TrackingInfo} from '../Application/types';
|
|
16
|
+
const {
|
|
17
|
+
ScreenContext,
|
|
18
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
15
19
|
|
|
16
20
|
const InputSearch = forwardRef(
|
|
17
21
|
(
|
|
@@ -29,6 +33,7 @@ const InputSearch = forwardRef(
|
|
|
29
33
|
style,
|
|
30
34
|
defaultValue,
|
|
31
35
|
onPressButtonText,
|
|
36
|
+
trackingParams,
|
|
32
37
|
...props
|
|
33
38
|
}: InputSearchProps,
|
|
34
39
|
ref,
|
|
@@ -38,6 +43,7 @@ const InputSearch = forwardRef(
|
|
|
38
43
|
const [haveValue, setHaveValue] = useState(!!value || !!defaultValue);
|
|
39
44
|
const inputRef = (ref as React.RefObject<TextInput>) ?? useRef<TextInput>();
|
|
40
45
|
const accessibilityLabel = `InputMoney/${placeholder}`;
|
|
46
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
41
47
|
|
|
42
48
|
const _onFocus = (e: NativeSyntheticEvent<TextInputFocusEventData>) => {
|
|
43
49
|
setFocused(true);
|
|
@@ -119,35 +125,45 @@ const InputSearch = forwardRef(
|
|
|
119
125
|
);
|
|
120
126
|
};
|
|
121
127
|
return (
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
<ScreenContext.Provider
|
|
129
|
+
value={{
|
|
130
|
+
...screenInfo,
|
|
131
|
+
componentName: 'InputSearch',
|
|
132
|
+
params: trackingParams,
|
|
133
|
+
state: 'enabled',
|
|
134
|
+
}}>
|
|
125
135
|
<View
|
|
126
|
-
style={[
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
style={[style, styles.searchInputContainer]}
|
|
137
|
+
accessibilityLabel={accessibilityLabel}>
|
|
138
|
+
<View
|
|
139
|
+
style={[
|
|
140
|
+
styles.searchInputWrapper,
|
|
141
|
+
{
|
|
142
|
+
backgroundColor: theme.colors.background.surface,
|
|
143
|
+
borderColor: theme.colors.background.surface,
|
|
144
|
+
},
|
|
145
|
+
showBorder && {borderColor: theme.colors.border.default},
|
|
146
|
+
focused && {borderColor: theme.colors.primary},
|
|
147
|
+
]}>
|
|
148
|
+
<Icon
|
|
149
|
+
source={'navigation_search'}
|
|
150
|
+
size={24}
|
|
151
|
+
color={theme.colors.text.hint}
|
|
152
|
+
/>
|
|
153
|
+
{renderInputView()}
|
|
154
|
+
{renderIconView()}
|
|
155
|
+
</View>
|
|
156
|
+
{showButtonText && (
|
|
157
|
+
<TouchableOpacity onPress={onPressButtonText}>
|
|
158
|
+
<Text
|
|
159
|
+
typography={'action_default_bold'}
|
|
160
|
+
style={styles.textButton}>
|
|
161
|
+
{buttonText}
|
|
162
|
+
</Text>
|
|
163
|
+
</TouchableOpacity>
|
|
164
|
+
)}
|
|
142
165
|
</View>
|
|
143
|
-
|
|
144
|
-
<TouchableOpacity onPress={onPressButtonText}>
|
|
145
|
-
<Text typography={'action_default'} style={styles.textButton}>
|
|
146
|
-
{buttonText}
|
|
147
|
-
</Text>
|
|
148
|
-
</TouchableOpacity>
|
|
149
|
-
)}
|
|
150
|
-
</View>
|
|
166
|
+
</ScreenContext.Provider>
|
|
151
167
|
);
|
|
152
168
|
},
|
|
153
169
|
);
|
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
|
)}
|
package/Input/index.tsx
CHANGED
|
@@ -80,6 +80,8 @@ export interface InputProps extends TextInputProps {
|
|
|
80
80
|
fontWeight?: 'Regular' | 'Bold';
|
|
81
81
|
|
|
82
82
|
onPressIcon?: () => void;
|
|
83
|
+
|
|
84
|
+
trackingParams?: any;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
type InputPropsWithoutSizeAndIcon = Omit<
|
|
@@ -126,6 +128,8 @@ export interface InputSearchProps extends TextInputProps {
|
|
|
126
128
|
* Optional. Represents the name or key of the icon to be displayed in the Input component.
|
|
127
129
|
*/
|
|
128
130
|
icon?: string;
|
|
131
|
+
|
|
132
|
+
trackingParams?: any;
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
export interface InputMoneyProps extends InputPropsWithoutPlaceholder {}
|
|
@@ -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={'header_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
|
@@ -6,6 +6,11 @@ import {Text} from '../Text';
|
|
|
6
6
|
import styles from './styles';
|
|
7
7
|
import {ApplicationContext} from '../Application';
|
|
8
8
|
import {Spacing} from '../Consts';
|
|
9
|
+
import {TrackingInfo} from '../Application/types';
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
ScreenContext,
|
|
13
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
9
14
|
|
|
10
15
|
const Radio: FC<RadioProps> = ({
|
|
11
16
|
value,
|
|
@@ -37,28 +42,38 @@ const Radio: FC<RadioProps> = ({
|
|
|
37
42
|
};
|
|
38
43
|
}
|
|
39
44
|
|
|
45
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
46
|
+
|
|
40
47
|
return (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
flexDirection: 'row',
|
|
49
|
-
alignItems: 'center',
|
|
48
|
+
<ScreenContext.Provider
|
|
49
|
+
value={{
|
|
50
|
+
...screenInfo,
|
|
51
|
+
componentName: 'Radio',
|
|
52
|
+
params: {
|
|
53
|
+
value,
|
|
50
54
|
},
|
|
51
|
-
|
|
52
|
-
<
|
|
55
|
+
}}>
|
|
56
|
+
<TouchableOpacity
|
|
57
|
+
onPress={onChange}
|
|
58
|
+
disabled={disabled}
|
|
53
59
|
style={[
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
style,
|
|
61
|
+
{
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
},
|
|
65
|
+
]}>
|
|
66
|
+
<View
|
|
67
|
+
style={[
|
|
68
|
+
styles.radio,
|
|
69
|
+
checkBoxStyle,
|
|
70
|
+
disabledStyle,
|
|
71
|
+
{marginRight: label ? Spacing.XS : 0},
|
|
72
|
+
]}
|
|
73
|
+
/>
|
|
74
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
75
|
+
</TouchableOpacity>
|
|
76
|
+
</ScreenContext.Provider>
|
|
62
77
|
);
|
|
63
78
|
};
|
|
64
79
|
|
package/Switch/index.tsx
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
2
|
import {TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {SwitchProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import {Colors} from '../Consts';
|
|
6
|
+
import {TrackingInfo} from '../Application/types';
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
ScreenContext,
|
|
10
|
+
} = require('react-native/Libraries/Components/ScreenContext');
|
|
6
11
|
|
|
7
12
|
const Switch: FC<SwitchProps> = props => {
|
|
8
13
|
const {value, onChange, disabled, style} = props;
|
|
9
14
|
const circleBackgroundColor = value ? Colors.black_01 : Colors.black_03;
|
|
10
15
|
const circleAlign = value ? 'flex-end' : 'flex-start';
|
|
16
|
+
const screenInfo = useContext<TrackingInfo>(ScreenContext);
|
|
11
17
|
|
|
12
18
|
let backgroundColor = value ? Colors.green_03 : Colors.black_07;
|
|
13
19
|
if (disabled) {
|
|
@@ -15,19 +21,27 @@ const Switch: FC<SwitchProps> = props => {
|
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
return (
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
<ScreenContext.Provider
|
|
25
|
+
value={{
|
|
26
|
+
...screenInfo,
|
|
27
|
+
componentName: 'Switch',
|
|
28
|
+
params: {
|
|
29
|
+
value,
|
|
30
|
+
},
|
|
31
|
+
}}>
|
|
32
|
+
<TouchableOpacity
|
|
33
|
+
disabled={disabled}
|
|
34
|
+
onPress={() => onChange?.(!value)}
|
|
35
|
+
style={[
|
|
36
|
+
style,
|
|
37
|
+
styles.container,
|
|
38
|
+
{backgroundColor, alignItems: circleAlign},
|
|
39
|
+
]}>
|
|
40
|
+
<View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
|
|
41
|
+
<View style={[styles.circleSmall, {backgroundColor}]} />
|
|
42
|
+
</View>
|
|
43
|
+
</TouchableOpacity>
|
|
44
|
+
</ScreenContext.Provider>
|
|
31
45
|
);
|
|
32
46
|
};
|
|
33
47
|
|
package/Tag/index.tsx
CHANGED
package/Text/styles.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
header_s_semibold: {fontSize: 14, lineHeight: 20, fontWeight: '600'},
|
|
6
6
|
header_xs_semibold: {fontSize: 12, lineHeight: 16, fontWeight: '600'},
|
|
7
7
|
body_default_regular: {fontSize: 14, lineHeight: 20, fontWeight: '400'},
|
|
8
|
-
|
|
8
|
+
body_regularstrikethrought: {
|
|
9
9
|
fontSize: 14,
|
|
10
10
|
lineHeight: 20,
|
|
11
11
|
fontWeight: '400',
|
package/Text/types.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type Typography =
|
|
|
20
20
|
| 'header_s_semibold'
|
|
21
21
|
| 'header_xs_semibold'
|
|
22
22
|
| 'body_default_regular'
|
|
23
|
-
| '
|
|
23
|
+
| 'body_regularstrikethrought'
|
|
24
24
|
| 'description_default_regular'
|
|
25
25
|
| 'description_default_regularstrikethrought'
|
|
26
26
|
| 'description_xs_regular'
|
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>
|