@momo-kits/foundation 0.74.2-react-native.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 +120 -0
- package/Application/Components.tsx +534 -0
- package/Application/ModalScreen.tsx +268 -0
- package/Application/Navigation.ts +50 -0
- package/Application/NavigationContainer.tsx +120 -0
- package/Application/Navigator.ts +131 -0
- package/Application/StackScreen.tsx +71 -0
- package/Application/index.ts +41 -0
- package/Application/types.ts +216 -0
- package/Application/utils.tsx +151 -0
- package/Assets/DotAnimation.json +256 -0
- package/Assets/SpinnerAnimation.json +1027 -0
- package/Assets/icon.json +4031 -0
- package/Assets/icon_bank.json +506 -0
- package/Assets/language.json +202 -0
- package/Badge/Badge.tsx +56 -0
- package/Badge/BadgeDot.tsx +11 -0
- package/Badge/BadgeRibbon.tsx +125 -0
- package/Badge/Shape.tsx +29 -0
- package/Badge/index.tsx +7 -0
- package/Badge/styles.ts +58 -0
- package/Badge/types.ts +63 -0
- package/Button/index.tsx +310 -0
- package/Button/styles.ts +60 -0
- package/CheckBox/index.tsx +65 -0
- package/CheckBox/styles.ts +15 -0
- package/CheckBox/types.ts +38 -0
- package/Consts/colors+spacing+radius.ts +218 -0
- package/Consts/index.ts +4 -0
- package/Consts/styles.ts +52 -0
- package/Consts/theme.ts +125 -0
- package/Divider/index.tsx +21 -0
- package/Icon/index.tsx +41 -0
- package/Icon/types.ts +27 -0
- package/IconButton/index.tsx +139 -0
- package/IconButton/styles.ts +19 -0
- package/Image/index.tsx +83 -0
- package/Image/styles.ts +5 -0
- package/Image/types.ts +5 -0
- package/Input/Input.tsx +192 -0
- package/Input/InputDropDown.tsx +114 -0
- package/Input/InputMoney.tsx +163 -0
- package/Input/InputOTP.tsx +235 -0
- package/Input/InputSearch.tsx +151 -0
- package/Input/InputTextArea.tsx +159 -0
- package/Input/common.tsx +129 -0
- package/Input/index.tsx +251 -0
- package/Input/styles.ts +160 -0
- package/Input/utils.ts +69 -0
- package/Layout/Card.tsx +180 -0
- package/Layout/GridSystem.tsx +136 -0
- package/Layout/Item.tsx +56 -0
- package/Layout/ItemList.tsx +55 -0
- package/Layout/ItemSectionList.tsx +39 -0
- package/Layout/Screen.tsx +355 -0
- package/Layout/Section.tsx +179 -0
- package/Layout/index.ts +29 -0
- package/Layout/styles.ts +97 -0
- package/Layout/types.ts +23 -0
- package/Layout/utils.ts +55 -0
- package/Loader/DotLoader.tsx +37 -0
- package/Loader/Loader.tsx +13 -0
- package/Loader/ProgressBar.tsx +44 -0
- package/Loader/Spinner.tsx +28 -0
- package/Loader/index.tsx +4 -0
- package/Loader/styles.ts +10 -0
- package/Loader/types.ts +35 -0
- package/Loader/utils.ts +25 -0
- package/Pagination/Dot.tsx +16 -0
- package/Pagination/PaginationDot.tsx +38 -0
- package/Pagination/PaginationNumber.tsx +24 -0
- package/Pagination/PaginationScroll.tsx +88 -0
- package/Pagination/PaginationWhiteDot.tsx +35 -0
- package/Pagination/index.tsx +25 -0
- package/Pagination/styles.ts +50 -0
- package/Pagination/types.ts +40 -0
- package/Popup/PopupNotify.tsx +266 -0
- package/Popup/PopupPromotion.tsx +120 -0
- package/Popup/index.tsx +4 -0
- package/Popup/types.ts +87 -0
- package/Radio/index.tsx +64 -0
- package/Radio/styles.ts +11 -0
- package/Radio/types.ts +38 -0
- package/Skeleton/index.tsx +72 -0
- package/Skeleton/styles.ts +5 -0
- package/Skeleton/types.ts +6 -0
- package/Switch/index.tsx +37 -0
- package/Switch/styles.ts +23 -0
- package/Switch/types.ts +26 -0
- package/Tag/index.tsx +79 -0
- package/Tag/styles.ts +24 -0
- package/Tag/types.ts +36 -0
- package/Text/index.tsx +110 -0
- package/Text/styles.ts +73 -0
- package/Text/types.ts +34 -0
- package/Text/utils.ts +14 -0
- package/Title/index.tsx +132 -0
- package/Title/styles.ts +52 -0
- package/Title/types.ts +52 -0
- package/code-scanner.js +51 -0
- package/index.ts +51 -0
- package/package.json +36 -0
- package/publish.sh +23 -0
- package/tsconfig.json +24 -0
- package/verify.js +44 -0
package/Button/index.tsx
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
TouchableOpacityProps,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
|
|
10
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
11
|
+
import {ApplicationContext} from '../Application';
|
|
12
|
+
import {Text} from '../Text';
|
|
13
|
+
import {Typography} from '../Text/types';
|
|
14
|
+
import {Colors, Spacing} from '../Consts';
|
|
15
|
+
import styles from './styles';
|
|
16
|
+
import {Icon} from '../Icon';
|
|
17
|
+
import {Loader} from '../Loader';
|
|
18
|
+
|
|
19
|
+
const AnimationLinear = Animated.createAnimatedComponent(LinearGradient);
|
|
20
|
+
|
|
21
|
+
export interface ButtonProps extends TouchableOpacityProps {
|
|
22
|
+
/**
|
|
23
|
+
* Defines the visual style of the button.
|
|
24
|
+
*/
|
|
25
|
+
type?:
|
|
26
|
+
| 'primary'
|
|
27
|
+
| 'secondary'
|
|
28
|
+
| 'tonal'
|
|
29
|
+
| 'outline'
|
|
30
|
+
| 'danger'
|
|
31
|
+
| 'text'
|
|
32
|
+
| 'disabled';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Defines the size of the button.
|
|
36
|
+
*/
|
|
37
|
+
size?: 'large' | 'medium' | 'small';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* If true, the button will take the full width of its container.
|
|
41
|
+
*/
|
|
42
|
+
full?: boolean;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Specifies the name of the icon that should be placed on the right side of the button.
|
|
46
|
+
*/
|
|
47
|
+
iconRight?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Specifies the name of the icon that should be placed on the left side of the button.
|
|
51
|
+
*/
|
|
52
|
+
iconLeft?: string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Represents the text that will be displayed on the button.
|
|
56
|
+
*/
|
|
57
|
+
title: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* If true, the icon of button will use the tint color provided by its container.
|
|
61
|
+
*/
|
|
62
|
+
useTintColor?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* If true, the icon of button will use be show indicator loading.
|
|
66
|
+
*/
|
|
67
|
+
loading?: boolean;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A callback function that is called when the button is pressed.
|
|
71
|
+
*/
|
|
72
|
+
onPress: () => void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const Button: FC<ButtonProps> = ({
|
|
76
|
+
type = 'primary',
|
|
77
|
+
size = 'large',
|
|
78
|
+
useTintColor = true,
|
|
79
|
+
full = true,
|
|
80
|
+
iconRight,
|
|
81
|
+
iconLeft,
|
|
82
|
+
loading = false,
|
|
83
|
+
title = 'Button',
|
|
84
|
+
onPress,
|
|
85
|
+
...rest
|
|
86
|
+
}) => {
|
|
87
|
+
const {theme, config} = useContext(ApplicationContext);
|
|
88
|
+
const {gradient, color} = config?.navigationBar?.buttonColors ?? {};
|
|
89
|
+
let gradientPros;
|
|
90
|
+
if (gradient?.length > 0 && type == 'primary') {
|
|
91
|
+
gradientPros = {
|
|
92
|
+
colors: gradient,
|
|
93
|
+
start: {x: 1, y: 0.5},
|
|
94
|
+
end: {x: 0, y: 0.5},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const getSizeStyle = () => {
|
|
98
|
+
const styleSheet: {[key: string]: any} = styles;
|
|
99
|
+
return styleSheet[size ?? 'small'];
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const getTypeStyle = () => {
|
|
103
|
+
switch (type) {
|
|
104
|
+
case 'disabled':
|
|
105
|
+
return {
|
|
106
|
+
backgroundColor: theme.colors.background.disable,
|
|
107
|
+
};
|
|
108
|
+
case 'primary':
|
|
109
|
+
return {backgroundColor: theme.colors.primary};
|
|
110
|
+
case 'secondary':
|
|
111
|
+
return {
|
|
112
|
+
backgroundColor: theme.colors.background.surface,
|
|
113
|
+
borderWidth: 1,
|
|
114
|
+
borderColor: theme.colors.border.default,
|
|
115
|
+
};
|
|
116
|
+
case 'outline':
|
|
117
|
+
return {
|
|
118
|
+
backgroundColor: theme.colors.background.surface,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
borderColor: color ?? theme.colors.primary,
|
|
121
|
+
};
|
|
122
|
+
case 'tonal':
|
|
123
|
+
return {
|
|
124
|
+
backgroundColor: theme.colors.background.tonal,
|
|
125
|
+
};
|
|
126
|
+
case 'danger':
|
|
127
|
+
return {
|
|
128
|
+
backgroundColor: theme.colors.error.primary,
|
|
129
|
+
};
|
|
130
|
+
case 'text':
|
|
131
|
+
return {};
|
|
132
|
+
default:
|
|
133
|
+
return {backgroundColor: theme.colors.primary};
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* export icon size
|
|
139
|
+
*/
|
|
140
|
+
const getIconSize = () => {
|
|
141
|
+
switch (size) {
|
|
142
|
+
case 'large':
|
|
143
|
+
return 24;
|
|
144
|
+
case 'medium':
|
|
145
|
+
case 'small':
|
|
146
|
+
return 16;
|
|
147
|
+
|
|
148
|
+
default:
|
|
149
|
+
return 24;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* export icon size
|
|
155
|
+
*/
|
|
156
|
+
const getIconSpace = () => {
|
|
157
|
+
switch (size) {
|
|
158
|
+
case 'large':
|
|
159
|
+
case 'medium':
|
|
160
|
+
return 8;
|
|
161
|
+
case 'small':
|
|
162
|
+
return 4;
|
|
163
|
+
|
|
164
|
+
default:
|
|
165
|
+
return 8;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* export typography style
|
|
171
|
+
*/
|
|
172
|
+
const getTypography = (): Typography => {
|
|
173
|
+
switch (size) {
|
|
174
|
+
case 'large':
|
|
175
|
+
return 'action_default_bold';
|
|
176
|
+
case 'medium':
|
|
177
|
+
return 'action_s_bold';
|
|
178
|
+
case 'small':
|
|
179
|
+
return 'action_xs_bold';
|
|
180
|
+
|
|
181
|
+
default:
|
|
182
|
+
return 'action_default_bold';
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const getTextColor = (): string => {
|
|
187
|
+
switch (type) {
|
|
188
|
+
case 'disabled':
|
|
189
|
+
return theme.colors.text.disable;
|
|
190
|
+
case 'primary':
|
|
191
|
+
return Colors.black_01;
|
|
192
|
+
case 'secondary':
|
|
193
|
+
return theme.colors.text.default;
|
|
194
|
+
case 'outline':
|
|
195
|
+
return color ?? theme.colors.primary;
|
|
196
|
+
case 'tonal':
|
|
197
|
+
return theme.colors.primary;
|
|
198
|
+
case 'danger':
|
|
199
|
+
return Colors.black_01;
|
|
200
|
+
case 'text':
|
|
201
|
+
return color ?? theme.colors.primary;
|
|
202
|
+
default:
|
|
203
|
+
return Colors.black_01;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* render title
|
|
209
|
+
*/
|
|
210
|
+
const renderTitle = () => {
|
|
211
|
+
const typography = getTypography();
|
|
212
|
+
const color = getTextColor();
|
|
213
|
+
return (
|
|
214
|
+
<Text typography={typography} color={color} numberOfLines={1}>
|
|
215
|
+
{title}
|
|
216
|
+
</Text>
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* render leading
|
|
222
|
+
*/
|
|
223
|
+
const renderLeading = () => {
|
|
224
|
+
const iconSize = getIconSize();
|
|
225
|
+
const marginRight = getIconSpace();
|
|
226
|
+
const color = useTintColor ? getTextColor() : undefined;
|
|
227
|
+
|
|
228
|
+
if (loading) {
|
|
229
|
+
return (
|
|
230
|
+
<View
|
|
231
|
+
style={[
|
|
232
|
+
styles.trailing,
|
|
233
|
+
{
|
|
234
|
+
width: iconSize,
|
|
235
|
+
height: iconSize,
|
|
236
|
+
marginRight,
|
|
237
|
+
borderRadius: Spacing.M,
|
|
238
|
+
},
|
|
239
|
+
]}>
|
|
240
|
+
<Loader type="spinner" color={color} />
|
|
241
|
+
</View>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
if (iconLeft) {
|
|
245
|
+
return (
|
|
246
|
+
<View
|
|
247
|
+
style={[
|
|
248
|
+
styles.leading,
|
|
249
|
+
{width: iconSize, height: iconSize, marginRight},
|
|
250
|
+
]}>
|
|
251
|
+
<Icon color={color} source={iconLeft} size={iconSize} />
|
|
252
|
+
</View>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* render trailing
|
|
259
|
+
*/
|
|
260
|
+
const renderTrailing = () => {
|
|
261
|
+
const color = useTintColor ? getTextColor() : undefined;
|
|
262
|
+
const marginLeft = getIconSpace();
|
|
263
|
+
|
|
264
|
+
if (iconRight) {
|
|
265
|
+
const iconSize = getIconSize();
|
|
266
|
+
return (
|
|
267
|
+
<View
|
|
268
|
+
style={[
|
|
269
|
+
styles.trailing,
|
|
270
|
+
{width: iconSize, height: iconSize, marginLeft},
|
|
271
|
+
]}>
|
|
272
|
+
<Icon color={color} source={iconRight} size={iconSize} />
|
|
273
|
+
</View>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const buttonStyle = StyleSheet.flatten([
|
|
279
|
+
getSizeStyle(),
|
|
280
|
+
getTypeStyle(),
|
|
281
|
+
full && {width: '100%'},
|
|
282
|
+
]);
|
|
283
|
+
|
|
284
|
+
const onPressButton = () => {
|
|
285
|
+
if (type === 'disabled') {
|
|
286
|
+
return () => {};
|
|
287
|
+
}
|
|
288
|
+
onPress?.();
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
const activeOpacity = type === 'disabled' ? 0.75 : 0.5;
|
|
292
|
+
|
|
293
|
+
return (
|
|
294
|
+
<TouchableOpacity
|
|
295
|
+
{...rest}
|
|
296
|
+
activeOpacity={activeOpacity}
|
|
297
|
+
onPress={onPressButton}
|
|
298
|
+
style={buttonStyle}>
|
|
299
|
+
{renderLeading()}
|
|
300
|
+
{renderTitle()}
|
|
301
|
+
{renderTrailing()}
|
|
302
|
+
{gradientPros && (
|
|
303
|
+
<AnimationLinear {...gradientPros} style={styles.gradientView} />
|
|
304
|
+
)}
|
|
305
|
+
{gradientPros && <View style={styles.strokeView} />}
|
|
306
|
+
</TouchableOpacity>
|
|
307
|
+
);
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export {Button};
|
package/Button/styles.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
large: {
|
|
5
|
+
height: 48,
|
|
6
|
+
borderRadius: 8,
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
paddingHorizontal: 16,
|
|
11
|
+
minWidth: 128,
|
|
12
|
+
},
|
|
13
|
+
medium: {
|
|
14
|
+
height: 36,
|
|
15
|
+
borderRadius: 8,
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
paddingHorizontal: 12,
|
|
20
|
+
minWidth: 80,
|
|
21
|
+
},
|
|
22
|
+
small: {
|
|
23
|
+
height: 28,
|
|
24
|
+
borderRadius: 6,
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
paddingHorizontal: 8,
|
|
29
|
+
minWidth: 60,
|
|
30
|
+
},
|
|
31
|
+
leading: {
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
},
|
|
36
|
+
trailing: {
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
},
|
|
41
|
+
gradientView: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
zIndex: -1,
|
|
44
|
+
borderRadius: 8,
|
|
45
|
+
top: 0,
|
|
46
|
+
bottom: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
right: 0,
|
|
49
|
+
},
|
|
50
|
+
strokeView: {
|
|
51
|
+
position: 'absolute',
|
|
52
|
+
top: 2,
|
|
53
|
+
bottom: 2,
|
|
54
|
+
left: 2,
|
|
55
|
+
right: 2,
|
|
56
|
+
borderRadius: 6,
|
|
57
|
+
borderWidth: 0.5,
|
|
58
|
+
borderColor: '#FFF9E1',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
|
+
import {TouchableOpacity, View} from 'react-native';
|
|
3
|
+
import {CheckBoxProps} from './types';
|
|
4
|
+
import styles from './styles';
|
|
5
|
+
import {ApplicationContext} from '../Application';
|
|
6
|
+
import {Text} from '../Text';
|
|
7
|
+
import {Icon} from '../Icon';
|
|
8
|
+
|
|
9
|
+
const CheckBox: FC<CheckBoxProps> = ({
|
|
10
|
+
value,
|
|
11
|
+
disabled,
|
|
12
|
+
onChange,
|
|
13
|
+
style,
|
|
14
|
+
label,
|
|
15
|
+
indeterminate,
|
|
16
|
+
}) => {
|
|
17
|
+
const {theme} = useContext(ApplicationContext);
|
|
18
|
+
const haveValue = value || indeterminate;
|
|
19
|
+
const iconSource = indeterminate ? 'ic_minus' : 'ic_checked';
|
|
20
|
+
let borderColor = theme.colors.text.default;
|
|
21
|
+
let backgroundColor = theme.colors.background.surface;
|
|
22
|
+
|
|
23
|
+
if (haveValue) {
|
|
24
|
+
borderColor = theme.colors.primary;
|
|
25
|
+
backgroundColor = theme.colors.primary;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (disabled) {
|
|
29
|
+
borderColor = theme.colors.border.disable;
|
|
30
|
+
backgroundColor = theme.colors.background.surface;
|
|
31
|
+
if (haveValue) {
|
|
32
|
+
borderColor = theme.colors.background.tonal;
|
|
33
|
+
backgroundColor = theme.colors.background.tonal;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<TouchableOpacity
|
|
39
|
+
activeOpacity={0.8}
|
|
40
|
+
onPress={() => onChange?.(!value)}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
style={[style, styles.container]}>
|
|
43
|
+
<View
|
|
44
|
+
style={[
|
|
45
|
+
{borderColor, backgroundColor, borderWidth: 1},
|
|
46
|
+
styles.checkbox,
|
|
47
|
+
]}>
|
|
48
|
+
{haveValue && (
|
|
49
|
+
<Icon
|
|
50
|
+
color={theme.colors.background.surface}
|
|
51
|
+
size={20}
|
|
52
|
+
source={iconSource}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
</View>
|
|
56
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
CheckBox.defaultProps = {
|
|
62
|
+
disabled: false,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export {CheckBox};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
import {Radius, Spacing} from '../Consts';
|
|
3
|
+
|
|
4
|
+
export default StyleSheet.create({
|
|
5
|
+
checkbox: {
|
|
6
|
+
width: 20,
|
|
7
|
+
height: 20,
|
|
8
|
+
borderRadius: Radius.XS,
|
|
9
|
+
borderWidth: 2,
|
|
10
|
+
marginRight: Spacing.S,
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
},
|
|
14
|
+
container: {flexDirection: 'row', alignItems: 'center'},
|
|
15
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {ViewStyle} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type CheckBoxProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Represents whether the CheckBox is currently checked (`true`) or unchecked (`false`).
|
|
6
|
+
*/
|
|
7
|
+
value: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Optional. If `true`, the user won't be able to interact with the CheckBox.
|
|
11
|
+
* Defaults to `false` if not provided.
|
|
12
|
+
*/
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional. Represents the text label displayed next to the CheckBox.
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A callback function that is called when the value of the CheckBox changes.
|
|
22
|
+
* Receives the new value of the CheckBox as a parameter.
|
|
23
|
+
*/
|
|
24
|
+
onChange: (value: boolean) => void;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Optional. If `true`, the CheckBox will be in an indeterminate state,
|
|
28
|
+
* which is typically used to represent a "mixed" or "partial" selection state.
|
|
29
|
+
* Defaults to `false` if not provided.
|
|
30
|
+
*/
|
|
31
|
+
indeterminate?: boolean;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Optional. Used to apply custom styling to the CheckBox component.
|
|
35
|
+
* Accepts an object of style properties.
|
|
36
|
+
*/
|
|
37
|
+
style?: ViewStyle;
|
|
38
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import {Platform} from 'react-native';
|
|
2
|
+
|
|
3
|
+
const Colors = {
|
|
4
|
+
black_01: '#ffffff',
|
|
5
|
+
black_02: '#f9f9f9',
|
|
6
|
+
black_03: '#f0f0f0',
|
|
7
|
+
black_04: '#e8e8e8',
|
|
8
|
+
black_05: '#e5e5e5',
|
|
9
|
+
black_06: '#d8d8d8',
|
|
10
|
+
black_07: '#cccccc',
|
|
11
|
+
black_08: '#c6c6c6',
|
|
12
|
+
black_09: '#b9b9b9',
|
|
13
|
+
black_10: '#a0a0a0',
|
|
14
|
+
black_11: '#878787',
|
|
15
|
+
black_12: '#727272',
|
|
16
|
+
black_13: '#646464',
|
|
17
|
+
black_14: '#565656',
|
|
18
|
+
black_15: '#484848',
|
|
19
|
+
black_16: '#404040',
|
|
20
|
+
black_17: '#303233',
|
|
21
|
+
black_18: '#242424',
|
|
22
|
+
black_19: '#18191a',
|
|
23
|
+
black_20: '#000000',
|
|
24
|
+
pink_01: '#bc2678',
|
|
25
|
+
pink_02: '#d42a87',
|
|
26
|
+
pink_03: '#eb2f96',
|
|
27
|
+
pink_04: '#ed43a0',
|
|
28
|
+
pink_05: '#ef59ab',
|
|
29
|
+
pink_06: '#f382c0',
|
|
30
|
+
pink_07: '#f7acd5',
|
|
31
|
+
pink_08: '#fbd5ea',
|
|
32
|
+
pink_09: '#fdeaf4',
|
|
33
|
+
pink_10: '#fef4fa',
|
|
34
|
+
pink_11: '#fef8fc',
|
|
35
|
+
pink_MoMo_Branding: '#a50064',
|
|
36
|
+
violet_01: '#7822c0',
|
|
37
|
+
violet_02: '#8726d8',
|
|
38
|
+
violet_03: '#962af0',
|
|
39
|
+
violet_04: '#a03ff1',
|
|
40
|
+
violet_05: '#ab55f3',
|
|
41
|
+
violet_06: '#c07ff6',
|
|
42
|
+
violet_07: '#d5aaf9',
|
|
43
|
+
violet_08: '#ead4fc',
|
|
44
|
+
violet_09: '#f4e9fd',
|
|
45
|
+
violet_10: '#faf4fe',
|
|
46
|
+
violet_11: '#fcf8fe',
|
|
47
|
+
violet_11_stroke: '#dfe1e5',
|
|
48
|
+
indigo_01: '#3e3ccc',
|
|
49
|
+
indigo_02: '#4644e6',
|
|
50
|
+
indigo_03: '#4e4bff',
|
|
51
|
+
indigo_04: '#5f5dff',
|
|
52
|
+
indigo_05: '#716fff',
|
|
53
|
+
indigo_06: '#9593ff',
|
|
54
|
+
indigo_07: '#b8b7ff',
|
|
55
|
+
indigo_08: '#dcdbff',
|
|
56
|
+
indigo_09: '#ededff',
|
|
57
|
+
indigo_10: '#f6f6ff',
|
|
58
|
+
indigo_11: '#f9f9ff',
|
|
59
|
+
blue_01: '#0062cc',
|
|
60
|
+
blue_02: '#006ee6',
|
|
61
|
+
blue_03: '#007aff',
|
|
62
|
+
blue_04: '#1987ff',
|
|
63
|
+
blue_05: '#3395ff',
|
|
64
|
+
blue_06: '#66afff',
|
|
65
|
+
blue_07: '#99caff',
|
|
66
|
+
blue_08: '#cce4ff',
|
|
67
|
+
blue_09: '#e5f1ff',
|
|
68
|
+
blue_10: '#f2f8ff',
|
|
69
|
+
blue_11: '#f7fbff',
|
|
70
|
+
mint_01: '#0f9b9b',
|
|
71
|
+
mint_02: '#11afaf',
|
|
72
|
+
mint_03: '#13c2c2',
|
|
73
|
+
mint_04: '#2ac8c8',
|
|
74
|
+
mint_05: '#42cece',
|
|
75
|
+
mint_06: '#71dada',
|
|
76
|
+
mint_07: '#a1e7e7',
|
|
77
|
+
mint_08: '#d0f3f3',
|
|
78
|
+
mint_09: '#e7f8f8',
|
|
79
|
+
mint_10: '#f3fcfc',
|
|
80
|
+
mint_11: '#f8fdfd',
|
|
81
|
+
green_01: '#2a9f47',
|
|
82
|
+
green_02: '#2fb350',
|
|
83
|
+
green_03: '#34c759',
|
|
84
|
+
green_04: '#48cc69',
|
|
85
|
+
green_05: '#5dd27a',
|
|
86
|
+
green_06: '#85dd9b',
|
|
87
|
+
green_07: '#aee9bd',
|
|
88
|
+
green_08: '#d6f4de',
|
|
89
|
+
green_09: '#eaf9ee',
|
|
90
|
+
green_10: '#f5fcf6',
|
|
91
|
+
green_11: '#f9fdfa',
|
|
92
|
+
lime_01: '#80ae0e',
|
|
93
|
+
lime_02: '#90c30f',
|
|
94
|
+
lime_03: '#a0d911',
|
|
95
|
+
lime_04: '#a9dc28',
|
|
96
|
+
lime_05: '#b3e141',
|
|
97
|
+
lime_06: '#c6e870',
|
|
98
|
+
lime_07: '#d9f0a0',
|
|
99
|
+
lime_08: '#ecf7cf',
|
|
100
|
+
lime_09: '#f5fbe7',
|
|
101
|
+
lime_10: '#fafdf3',
|
|
102
|
+
lime_11: '#fcfef8',
|
|
103
|
+
yellow_01: '#cca300',
|
|
104
|
+
yellow_02: '#e6b800',
|
|
105
|
+
yellow_03: '#ffcc00',
|
|
106
|
+
yellow_04: '#ffd119',
|
|
107
|
+
yellow_05: '#ffd633',
|
|
108
|
+
yellow_06: '#ffe066',
|
|
109
|
+
yellow_07: '#ffeb99',
|
|
110
|
+
yellow_08: '#fff5cc',
|
|
111
|
+
yellow_09: '#fff9e5',
|
|
112
|
+
yellow_10: '#fffcf2',
|
|
113
|
+
yellow_11: '#fffdf7',
|
|
114
|
+
gold_01: '#c87012',
|
|
115
|
+
gold_02: '#e17e14',
|
|
116
|
+
gold_03: '#fa8c16',
|
|
117
|
+
gold_04: '#fa972d',
|
|
118
|
+
gold_05: '#fba345',
|
|
119
|
+
gold_06: '#fcba73',
|
|
120
|
+
gold_07: '#fdd1a2',
|
|
121
|
+
gold_08: '#fee8d0',
|
|
122
|
+
gold_09: '#fef3e7',
|
|
123
|
+
gold_10: '#fff9f3',
|
|
124
|
+
gold_11: '#fefbf8',
|
|
125
|
+
orange_01: '#c84316',
|
|
126
|
+
orange_02: '#e14c19',
|
|
127
|
+
orange_03: '#fa541c',
|
|
128
|
+
orange_04: '#fa6532',
|
|
129
|
+
orange_05: '#fb7649',
|
|
130
|
+
orange_06: '#fc9877',
|
|
131
|
+
orange_07: '#fdbba4',
|
|
132
|
+
orange_08: '#feddd2',
|
|
133
|
+
orange_09: '#feede8',
|
|
134
|
+
orange_10: '#fff6f3',
|
|
135
|
+
orange_11: '#fefaf8',
|
|
136
|
+
red_01: '#c41b24',
|
|
137
|
+
red_02: '#dd1f29',
|
|
138
|
+
red_03: '#f5222d',
|
|
139
|
+
red_04: '#f63842',
|
|
140
|
+
red_05: '#f74e57',
|
|
141
|
+
red_06: '#f97a81',
|
|
142
|
+
red_07: '#fba7ab',
|
|
143
|
+
red_08: '#fdd3d5',
|
|
144
|
+
red_09: '#fee8ea',
|
|
145
|
+
red_10: '#fef4f4',
|
|
146
|
+
red_11: '#fef8f8',
|
|
147
|
+
};
|
|
148
|
+
const Spacing = {
|
|
149
|
+
XXS: 2,
|
|
150
|
+
XS: 4,
|
|
151
|
+
S: 8,
|
|
152
|
+
M: 12,
|
|
153
|
+
L: 16,
|
|
154
|
+
XL: 24,
|
|
155
|
+
XXL: 32,
|
|
156
|
+
Size3XL: 48,
|
|
157
|
+
Size4XL: 56,
|
|
158
|
+
Size5XL: 64,
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const Radius = {
|
|
162
|
+
XXS: 2,
|
|
163
|
+
XS: 4,
|
|
164
|
+
S: 8,
|
|
165
|
+
M: 12,
|
|
166
|
+
L: 16,
|
|
167
|
+
XL: 24,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const Shadow = {
|
|
171
|
+
Dark: Platform.select({
|
|
172
|
+
ios: {
|
|
173
|
+
shadowColor: Colors.black_17,
|
|
174
|
+
shadowOffset: {
|
|
175
|
+
width: 2,
|
|
176
|
+
height: 2,
|
|
177
|
+
},
|
|
178
|
+
shadowOpacity: 0.25,
|
|
179
|
+
shadowRadius: 10,
|
|
180
|
+
},
|
|
181
|
+
android: {
|
|
182
|
+
shadowColor: Colors.black_20,
|
|
183
|
+
shadowOffset: {
|
|
184
|
+
width: 0,
|
|
185
|
+
height: 3,
|
|
186
|
+
},
|
|
187
|
+
shadowOpacity: 0.29,
|
|
188
|
+
shadowRadius: 4.65,
|
|
189
|
+
|
|
190
|
+
elevation: 7,
|
|
191
|
+
},
|
|
192
|
+
}),
|
|
193
|
+
|
|
194
|
+
Light: Platform.select({
|
|
195
|
+
ios: {
|
|
196
|
+
shadowColor: Colors.black_17,
|
|
197
|
+
shadowOffset: {
|
|
198
|
+
width: 2,
|
|
199
|
+
height: 2,
|
|
200
|
+
},
|
|
201
|
+
shadowOpacity: 0.07,
|
|
202
|
+
shadowRadius: 10,
|
|
203
|
+
},
|
|
204
|
+
android: {
|
|
205
|
+
shadowColor: Colors.black_10,
|
|
206
|
+
shadowOffset: {
|
|
207
|
+
width: 1,
|
|
208
|
+
height: 3,
|
|
209
|
+
},
|
|
210
|
+
shadowOpacity: 0.29,
|
|
211
|
+
shadowRadius: 4.65,
|
|
212
|
+
|
|
213
|
+
elevation: 6,
|
|
214
|
+
},
|
|
215
|
+
}),
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export {Colors, Spacing, Radius, Shadow};
|
package/Consts/index.ts
ADDED