@momo-kits/foundation 0.76.1-beta.2 → 0.77.1-optimize.10
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/BottomTabBar.tsx +439 -0
- package/Application/BottomTab/index.tsx +138 -0
- package/Application/Components.tsx +348 -167
- package/Application/ModalScreen.tsx +135 -98
- package/Application/Navigation.ts +22 -16
- package/Application/NavigationContainer.tsx +99 -48
- package/Application/Navigator.ts +110 -41
- package/Application/StackScreen.tsx +129 -8
- package/Application/index.ts +23 -4
- package/Application/types.ts +86 -34
- package/Application/utils.tsx +67 -49
- package/Assets/DotAnimation.json +256 -0
- package/Assets/SpinnerAnimation.json +1027 -0
- package/Assets/icon.json +83 -5
- 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 +91 -40
- package/Button/styles.ts +19 -0
- package/CheckBox/index.tsx +58 -43
- package/CheckBox/styles.ts +1 -1
- package/CheckBox/types.ts +6 -4
- package/Consts/colors+spacing+radius.ts +18 -0
- package/Consts/styles.ts +0 -26
- package/Consts/theme.ts +4 -0
- package/Divider/index.tsx +2 -0
- package/Icon/index.tsx +14 -9
- package/Icon/types.ts +4 -3
- package/IconButton/index.tsx +24 -15
- package/Image/index.tsx +63 -47
- package/Image/styles.ts +1 -9
- package/Image/types.ts +5 -1
- package/Input/Input.tsx +227 -116
- package/Input/InputDropDown.tsx +132 -0
- package/Input/InputMoney.tsx +173 -111
- package/Input/InputOTP.tsx +257 -0
- package/Input/InputSearch.tsx +160 -132
- package/Input/InputTextArea.tsx +150 -123
- package/Input/common.tsx +35 -17
- package/Input/index.tsx +211 -18
- package/Input/styles.ts +44 -7
- package/Input/utils.ts +2 -2
- package/Layout/Card.tsx +67 -29
- package/Layout/FloatingButton.tsx +168 -0
- package/Layout/GridSystem.tsx +31 -21
- package/Layout/Item.tsx +21 -25
- package/Layout/ItemList.tsx +55 -0
- package/Layout/ItemSectionList.tsx +39 -0
- package/Layout/Screen.tsx +355 -153
- package/Layout/Section.tsx +66 -34
- package/Layout/index.ts +13 -3
- package/Layout/styles.ts +101 -0
- package/Layout/types.ts +1 -39
- package/Layout/utils.ts +27 -52
- package/Loader/DotLoader.tsx +37 -0
- package/Loader/Loader.tsx +13 -0
- package/Loader/ProgressBar.tsx +44 -0
- package/Loader/Spinner.tsx +29 -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/PaginationDot.tsx +7 -2
- package/Pagination/PaginationNumber.tsx +8 -6
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Pagination/PaginationWhiteDot.tsx +8 -5
- package/Pagination/styles.ts +3 -0
- package/Pagination/types.ts +2 -0
- package/Popup/PopupNotify.tsx +108 -46
- package/Popup/PopupPromotion.tsx +63 -22
- package/Popup/types.ts +15 -4
- package/Radio/index.tsx +35 -21
- package/Radio/types.ts +7 -5
- package/Skeleton/index.tsx +1 -1
- package/Skeleton/types.ts +3 -0
- package/Switch/index.tsx +35 -24
- package/Switch/types.ts +5 -3
- package/Tag/index.tsx +2 -4
- package/Text/index.tsx +27 -22
- package/Text/styles.ts +38 -0
- package/Text/types.ts +25 -13
- package/Text/utils.ts +1 -1
- package/Title/index.tsx +186 -0
- package/Title/styles.ts +79 -0
- package/Title/types.ts +20 -0
- package/code-scanner.js +143 -0
- package/index.ts +6 -0
- package/migrate_typo.js +56 -0
- package/package.json +14 -9
- package/tsconfig.json +24 -0
- package/verify.js +47 -0
- package/Application/BottomTab.tsx +0 -52
- package/Application/NavigationButton.tsx +0 -54
- package/Assets/header-background.png +0 -0
package/package.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.1-optimize.10",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
6
|
+
"scripts": {},
|
|
9
7
|
"keywords": [
|
|
10
8
|
"@momo-kits/foundation"
|
|
11
9
|
],
|
|
12
10
|
"dependencies": {
|
|
11
|
+
"@gorhom/bottom-sheet": "2.4.1",
|
|
13
12
|
"react-native-safe-area-context": "3.1.4",
|
|
14
|
-
"react-native-linear-gradient": "2.
|
|
15
|
-
"
|
|
13
|
+
"react-native-linear-gradient": "2.8.3",
|
|
14
|
+
"react-native-gesture-handler": "1.10.3",
|
|
15
|
+
"react-native-modalize": "2.1.1",
|
|
16
|
+
"react-native-fast-image": "8.1.5",
|
|
17
|
+
"@react-navigation/bottom-tabs": "https://oauth2:5WXQLHPMxxCyvGt_Py4D@gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
|
|
16
18
|
"@react-navigation/core": "5.16.1",
|
|
17
19
|
"@react-navigation/native": "5.9.8",
|
|
18
20
|
"@react-navigation/routers": "5.7.4",
|
|
19
|
-
"
|
|
20
|
-
"@
|
|
21
|
+
"lottie-react-native": "3.3.2",
|
|
22
|
+
"@react-navigation/stack": "https://oauth2:eX-jVhzQdLc343AjD3Sc@gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
|
|
21
23
|
},
|
|
22
24
|
"peerDependencies": {
|
|
23
25
|
"react-native": "*"
|
|
@@ -29,12 +31,15 @@
|
|
|
29
31
|
"@types/jest": "26.0.23",
|
|
30
32
|
"@types/react-native": "0.64.4",
|
|
31
33
|
"@types/react-test-renderer": "16.9.2",
|
|
34
|
+
"@types/d3-shape": "1.3.7",
|
|
32
35
|
"babel-jest": "^26.6.3",
|
|
33
36
|
"eslint": "^7.14.0",
|
|
34
37
|
"jest": "^26.6.3",
|
|
35
38
|
"metro-react-native-babel-preset": "^0.64.0",
|
|
36
39
|
"react-test-renderer": "17.0.1",
|
|
37
|
-
"typescript": "^4.0.3"
|
|
40
|
+
"typescript": "^4.0.3",
|
|
41
|
+
"@momo-platform/versions": "4.1.11",
|
|
42
|
+
"react-scanner": "^1.1.0"
|
|
38
43
|
},
|
|
39
44
|
"author": "@momo-kits/foundation",
|
|
40
45
|
"license": "ISC"
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDir": ".",
|
|
4
|
+
"allowUnreachableCode": false,
|
|
5
|
+
"allowUnusedLabels": false,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"jsx": "react",
|
|
9
|
+
"lib": ["esnext"],
|
|
10
|
+
"module": "esnext",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"noFallthroughCasesInSwitch": true,
|
|
13
|
+
"noImplicitReturns": false,
|
|
14
|
+
"noImplicitUseStrict": false,
|
|
15
|
+
"noStrictGenericChecks": false,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"resolveJsonModule": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"target": "esnext",
|
|
23
|
+
}
|
|
24
|
+
}
|
package/verify.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
try {
|
|
5
|
+
const packageInfo = JSON.parse(
|
|
6
|
+
fs.readFileSync(path.join(`${__dirname}`, 'package.json'), 'utf8'),
|
|
7
|
+
);
|
|
8
|
+
const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
|
|
9
|
+
|
|
10
|
+
const app = path.join(`${__dirname}/../../../`, 'app.json');
|
|
11
|
+
const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
|
|
12
|
+
|
|
13
|
+
if (!fs.existsSync(app) || fs.existsSync(miniJson)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
|
|
18
|
+
const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
|
|
19
|
+
|
|
20
|
+
const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
|
|
21
|
+
const androidAppTarget = appInfo?.client?.android.deploymentTarget;
|
|
22
|
+
|
|
23
|
+
if (packageVersion > iOSAppTarget || packageVersion > androidAppTarget) {
|
|
24
|
+
console.error(
|
|
25
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
|
|
26
|
+
);
|
|
27
|
+
throw new Error(
|
|
28
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (
|
|
33
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] &&
|
|
34
|
+
miniInfo?.dependencies?.['@momo-platform/momo-core'] !==
|
|
35
|
+
packageInfo?.version
|
|
36
|
+
) {
|
|
37
|
+
console.error(
|
|
38
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
|
|
39
|
+
);
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error(`Installation failed: ${error.message}`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, {FC, useContext} from 'react';
|
|
2
|
-
import {BottomTabProps} from './types';
|
|
3
|
-
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
|
|
4
|
-
import {Icon} from '../Icon';
|
|
5
|
-
import {Text} from '../Text';
|
|
6
|
-
import {ApplicationContext} from './index';
|
|
7
|
-
|
|
8
|
-
const Tab = createBottomTabNavigator();
|
|
9
|
-
|
|
10
|
-
const BottomTab: FC<BottomTabProps> = ({tabs, listeners}) => {
|
|
11
|
-
const {theme} = useContext(ApplicationContext);
|
|
12
|
-
return (
|
|
13
|
-
<Tab.Navigator>
|
|
14
|
-
{tabs.map(item => {
|
|
15
|
-
return (
|
|
16
|
-
<Tab.Screen
|
|
17
|
-
key={item.name}
|
|
18
|
-
name={item.name}
|
|
19
|
-
component={item.screen}
|
|
20
|
-
listeners={listeners}
|
|
21
|
-
options={{
|
|
22
|
-
tabBarLabel: ({color, focused}) => {
|
|
23
|
-
return (
|
|
24
|
-
<Text
|
|
25
|
-
typography={focused ? 'label_xs' : 'description_xs'}
|
|
26
|
-
color={color}>
|
|
27
|
-
{item.label}
|
|
28
|
-
</Text>
|
|
29
|
-
);
|
|
30
|
-
},
|
|
31
|
-
tabBarBadge: item?.badgeLabel,
|
|
32
|
-
tabBarBadgeStyle: {
|
|
33
|
-
borderColor: 'white',
|
|
34
|
-
borderWidth: 2,
|
|
35
|
-
fontSize: 10,
|
|
36
|
-
lineHeight: 14,
|
|
37
|
-
fontWeight: 'bold',
|
|
38
|
-
alignSelf: 'center',
|
|
39
|
-
fontFamily: `${theme.font}-Bold`,
|
|
40
|
-
},
|
|
41
|
-
tabBarIcon: ({color, size}) => (
|
|
42
|
-
<Icon source={item.icon} color={color} size={size} />
|
|
43
|
-
),
|
|
44
|
-
}}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
})}
|
|
48
|
-
</Tab.Navigator>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export default BottomTab;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {Platform, StyleSheet, TouchableOpacity as TouchRN} from 'react-native';
|
|
2
|
-
import {TouchableOpacity as TouchGesture} from 'react-native-gesture-handler';
|
|
3
|
-
import React, {useContext} from 'react';
|
|
4
|
-
import {NavigationButtonProps} from './types';
|
|
5
|
-
import {ApplicationContext} from './index';
|
|
6
|
-
import {Icon} from '../Icon';
|
|
7
|
-
import {Colors} from '../Consts';
|
|
8
|
-
|
|
9
|
-
const TouchableOpacity = Platform.OS === 'ios' ? TouchRN : TouchGesture;
|
|
10
|
-
const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
11
|
-
icon,
|
|
12
|
-
tintColor,
|
|
13
|
-
onPress,
|
|
14
|
-
backgroundColor,
|
|
15
|
-
useBorder = true,
|
|
16
|
-
accessibilityLabel,
|
|
17
|
-
}) => {
|
|
18
|
-
const {theme} = useContext(ApplicationContext);
|
|
19
|
-
if (!backgroundColor && tintColor != Colors.black_01) {
|
|
20
|
-
backgroundColor = theme.colors.background.surface;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<TouchableOpacity
|
|
25
|
-
accessibilityLabel={`NavigationButton/${accessibilityLabel}`}
|
|
26
|
-
style={[
|
|
27
|
-
styles.container,
|
|
28
|
-
{
|
|
29
|
-
backgroundColor: backgroundColor ?? '#00000066',
|
|
30
|
-
borderWidth: useBorder && backgroundColor ? 0.5 : 0,
|
|
31
|
-
},
|
|
32
|
-
]}
|
|
33
|
-
onPress={onPress}>
|
|
34
|
-
<Icon
|
|
35
|
-
source={icon}
|
|
36
|
-
color={tintColor ?? theme.colors.text.default}
|
|
37
|
-
size={20}
|
|
38
|
-
/>
|
|
39
|
-
</TouchableOpacity>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const styles = StyleSheet.create({
|
|
44
|
-
container: {
|
|
45
|
-
height: 28,
|
|
46
|
-
width: 28,
|
|
47
|
-
borderRadius: 14,
|
|
48
|
-
borderColor: '#00000066',
|
|
49
|
-
justifyContent: 'center',
|
|
50
|
-
alignItems: 'center',
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export default NavigationButton;
|
|
Binary file
|