@momo-kits/foundation 0.89.5 → 0.89.6-rc.2

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.
Files changed (73) hide show
  1. package/Application/BottomSheet.tsx +216 -0
  2. package/Application/BottomTab/BottomTabBar.tsx +278 -0
  3. package/Application/{BottomTab.tsx → BottomTab/index.tsx} +42 -18
  4. package/Application/Components.tsx +350 -86
  5. package/Application/Localize.ts +44 -0
  6. package/Application/ModalScreen.tsx +14 -185
  7. package/Application/Navigation.ts +5 -19
  8. package/Application/NavigationContainer.tsx +62 -72
  9. package/Application/Navigator.ts +53 -35
  10. package/Application/StackScreen.tsx +289 -32
  11. package/Application/index.ts +13 -15
  12. package/Application/types.ts +64 -35
  13. package/Application/utils.tsx +76 -30
  14. package/Assets/icon_bank.json +1 -1
  15. package/Badge/Badge.tsx +1 -1
  16. package/Badge/BadgeDotAnimation.tsx +95 -0
  17. package/Badge/index.tsx +2 -1
  18. package/Badge/styles.ts +50 -6
  19. package/Button/index.tsx +44 -26
  20. package/CheckBox/index.tsx +37 -26
  21. package/CheckBox/types.ts +5 -3
  22. package/Consts/colors+spacing+radius.ts +14 -0
  23. package/Icon/index.tsx +9 -8
  24. package/Icon/types.ts +2 -2
  25. package/IconButton/index.tsx +24 -14
  26. package/Image/index.tsx +23 -8
  27. package/Image/types.ts +2 -0
  28. package/Input/Input.tsx +116 -26
  29. package/Input/InputDropDown.tsx +66 -51
  30. package/Input/InputMoney.tsx +106 -15
  31. package/Input/InputOTP.tsx +49 -26
  32. package/Input/InputSearch.tsx +252 -99
  33. package/Input/InputTextArea.tsx +26 -6
  34. package/Input/TextTyping.tsx +113 -0
  35. package/Input/common.tsx +48 -22
  36. package/Input/index.tsx +112 -77
  37. package/Input/styles.ts +48 -11
  38. package/Input/utils.ts +1 -1
  39. package/Layout/Card.tsx +4 -3
  40. package/Layout/FloatingButton.tsx +168 -0
  41. package/Layout/GridSystem.tsx +1 -1
  42. package/Layout/ItemList.tsx +3 -2
  43. package/Layout/Screen.tsx +242 -121
  44. package/Layout/Section.tsx +4 -3
  45. package/Layout/styles.ts +11 -13
  46. package/Layout/types.ts +1 -1
  47. package/Layout/utils.ts +4 -4
  48. package/Loader/index.tsx +2 -0
  49. package/Pagination/PaginationScroll.tsx +2 -2
  50. package/Pagination/styles.ts +1 -1
  51. package/Popup/PopupNotify.tsx +56 -45
  52. package/Popup/PopupPromotion.tsx +5 -7
  53. package/Popup/types.ts +1 -7
  54. package/Radio/index.tsx +35 -20
  55. package/Radio/types.ts +5 -3
  56. package/Switch/index.tsx +32 -18
  57. package/Switch/types.ts +5 -3
  58. package/Tag/index.tsx +9 -2
  59. package/Tag/styles.ts +3 -2
  60. package/Tag/types.ts +12 -0
  61. package/Text/index.tsx +24 -5
  62. package/Text/styles.ts +8 -8
  63. package/Text/types.ts +19 -1
  64. package/Title/index.tsx +170 -103
  65. package/Title/styles.ts +36 -9
  66. package/Title/types.ts +16 -48
  67. package/code-scanner.js +125 -16
  68. package/index.ts +7 -0
  69. package/migrate_typo.js +56 -0
  70. package/package.json +11 -10
  71. package/publish.sh +16 -21
  72. package/tsconfig.json +1 -1
  73. package/verify.js +37 -40
package/package.json CHANGED
@@ -1,26 +1,25 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.89.5",
3
+ "version": "0.89.6-rc.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
- "scripts": {
7
- "postinstall": "node verify.js"
8
- },
6
+ "scripts": {},
9
7
  "keywords": [
10
8
  "@momo-kits/foundation"
11
9
  ],
12
10
  "dependencies": {
13
- "@gorhom/bottom-sheet": "git+https://gitlab.com/momo-platform/bottom-sheet.git#main",
11
+ "@gorhom/bottom-sheet": "2.4.1",
14
12
  "react-native-safe-area-context": "3.1.4",
15
13
  "react-native-linear-gradient": "2.8.3",
16
14
  "react-native-gesture-handler": "1.10.3",
15
+ "react-native-modalize": "2.1.1",
17
16
  "react-native-fast-image": "8.1.5",
18
- "@react-navigation/bottom-tabs": "git+https://gitlab.com/momo-platform/react-navigation-bottom-tabs.git#main",
17
+ "@react-navigation/bottom-tabs": "https://gitlab.mservice.com.vn/momo-platform/react-native-bottom-tabs.git",
19
18
  "@react-navigation/core": "5.16.1",
20
19
  "@react-navigation/native": "5.9.8",
21
20
  "@react-navigation/routers": "5.7.4",
22
- "lottie-react-native": "3.3.2",
23
- "@react-navigation/stack": "git+https://gitlab.com/momo-platform/react-navigation-stack.git#main"
21
+ "lottie-react-native": "git+https://gitlab.mservice.com.vn/momo-platform/momo-lottie-react-native.git",
22
+ "@react-navigation/stack": "https://gitlab.mservice.com.vn/momo-platform/react-navigation-stack.git"
24
23
  },
25
24
  "peerDependencies": {
26
25
  "react-native": "*"
@@ -32,6 +31,7 @@
32
31
  "@types/jest": "26.0.23",
33
32
  "@types/react-native": "0.64.4",
34
33
  "@types/react-test-renderer": "16.9.2",
34
+ "@types/d3-shape": "1.3.7",
35
35
  "babel-jest": "^26.6.3",
36
36
  "eslint": "^7.14.0",
37
37
  "jest": "^26.6.3",
@@ -39,8 +39,9 @@
39
39
  "react-test-renderer": "17.0.1",
40
40
  "typescript": "^4.0.3",
41
41
  "@momo-platform/versions": "4.1.11",
42
- "react-scanner": "^1.1.0"
42
+ "react-scanner": "^1.1.0",
43
+ "@types/color": "3.0.6"
43
44
  },
44
45
  "author": "@momo-kits/foundation",
45
46
  "license": "ISC"
46
- }
47
+ }
package/publish.sh CHANGED
@@ -1,23 +1,18 @@
1
1
  #!/bin/bash
2
- rm -rf dist
3
- mkdir dist
4
2
 
5
- cp . ./dist
6
-
7
-
8
- # GET VERSION from mck_package.json
9
- VERSIONSTRING=( v$(jq .version package.json) )
10
- VERSION=(${VERSIONSTRING//[\"]/})
11
- echo VERSION: $VERSION
12
-
13
- rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
14
-
15
- cd dist
16
- npm publish --tag latest --access=public
17
-
18
- #clear dist and package json
19
- cd ..
20
- rm -rf dist
21
-
22
-
23
- #curl -X POST -H 'Content-Type: application/json' 'https://chat.googleapis.com/v1/spaces/AAAAbP8987c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=UGSFRvk_oYb9uGsAgs31bVvMm6jDkmD8zihGm3eyaQA%3D&threadKey=JoaXTEYaNNkl' -d '{"text": "@momo-kits/core new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/foundation"}'
3
+ if [ "$1" == "stable" ]; then
4
+ npm version $(npm view @momo-kits/foundation@stable version)
5
+ npm version patch
6
+ npm publish --tag stable --access=public
7
+ elif [ "$1" == "latest" ]; then
8
+ npm version $(npm view @momo-kits/foundation@latest version)
9
+ npm version prerelease --preid=rc
10
+ npm publish --tag latest --access=public
11
+ else
12
+ npm version $(npm view @momo-kits/foundation@beta version)
13
+ npm version prerelease --preid=beta
14
+ npm publish --tag beta --access=public
15
+ fi
16
+
17
+ PACKAGE_NAME=$(npm pkg get name)
18
+ NEW_PACKAGE_VERSION=$(npm pkg get version)
package/tsconfig.json CHANGED
@@ -19,6 +19,6 @@
19
19
  "resolveJsonModule": true,
20
20
  "skipLibCheck": true,
21
21
  "strict": true,
22
- "target": "esnext",
22
+ "target": "esnext"
23
23
  }
24
24
  }
package/verify.js CHANGED
@@ -1,44 +1,41 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- try {
5
- const package = path.join(`${__dirname}`, 'package.json');
6
- const packageInfo = JSON.parse(fs.readFileSync(package, 'utf8'));
7
- const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
8
-
9
- const app = path.join(`${__dirname}/../../../`, 'app.json');
10
- const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
11
- const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
12
- const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
13
- const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
14
- const androidAppTarget = appInfo?.client?.android.deploymentTarget;
15
-
16
- if (appInfo.name === 'MoMoPlatform') {
17
- return;
18
- }
19
-
20
- if (packageVersion > iOSAppTarget || packageVersion > androidAppTarget) {
21
- console.error(
22
- `Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
23
- );
24
- throw new Error(
25
- `Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`,
26
- );
27
- }
28
-
29
- if (
30
- miniInfo?.dependencies?.['@momo-platform/momo-core'] &&
31
- miniInfo?.dependencies?.['@momo-platform/momo-core'] !==
32
- packageInfo?.version
33
- ) {
34
- console.error(
35
- `Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
36
- );
37
- throw new Error(
38
- `Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`,
39
- );
40
- }
41
- } catch (error) {
42
- console.error(`Installation failed: ${error.message}`);
43
- process.exit(1);
4
+ const packageInfo = JSON.parse(
5
+ fs.readFileSync(path.join(`${__dirname}`, 'package.json'), 'utf8')
6
+ );
7
+ const packageVersion = parseInt(packageInfo?.version.split('.')?.[1]);
8
+
9
+ const app = path.join(`${__dirname}/../../../`, 'app.json');
10
+ const miniJson = path.join(`${__dirname}/../../../`, 'package.json');
11
+
12
+ if (!fs.existsSync(app) || !fs.existsSync(miniJson)) {
13
+ return;
14
+ }
15
+
16
+ const appInfo = JSON.parse(fs.readFileSync(app, 'utf8'));
17
+ const miniInfo = JSON.parse(fs.readFileSync(miniJson, 'utf8'));
18
+
19
+ const iOSAppTarget = appInfo?.client?.ios.deploymentTarget;
20
+ const androidAppTarget = appInfo?.client?.android.deploymentTarget;
21
+
22
+ if (
23
+ miniInfo?.dependencies?.['@momo-platform/momo-core']?.includes('optimize')
24
+ ) {
25
+ return;
26
+ }
27
+
28
+ if (packageVersion > iOSAppTarget || packageVersion > androidAppTarget) {
29
+ throw new Error(
30
+ `\x1b[41m Package ${packageInfo.name} version: ${packageInfo.version} require deploymentTarget ${packageVersion}`
31
+ );
32
+ }
33
+
34
+ if (
35
+ miniInfo?.dependencies?.['@momo-platform/momo-core'] &&
36
+ miniInfo?.dependencies?.['@momo-platform/momo-core'] !== packageInfo?.version
37
+ ) {
38
+ throw new Error(
39
+ `\x1b[41m Package ${packageInfo.name} version: ${packageInfo.version} require install resolutions @momo-platform/momo-core ${packageInfo.version}`
40
+ );
44
41
  }