@momo-kits/foundation 0.81.51-beta.0 → 0.81.52

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 (71) hide show
  1. package/Application/{BottomTab/index.tsx → BottomTab.tsx} +18 -42
  2. package/Application/Components.tsx +91 -356
  3. package/Application/ModalScreen.tsx +185 -14
  4. package/Application/Navigation.ts +19 -5
  5. package/Application/NavigationContainer.tsx +72 -62
  6. package/Application/Navigator.ts +48 -154
  7. package/Application/StackScreen.tsx +32 -289
  8. package/Application/index.ts +15 -13
  9. package/Application/types.ts +35 -81
  10. package/Application/utils.tsx +30 -76
  11. package/Assets/icon_bank.json +1 -1
  12. package/Badge/Badge.tsx +1 -1
  13. package/Badge/index.tsx +1 -2
  14. package/Badge/styles.ts +6 -50
  15. package/Button/index.tsx +26 -44
  16. package/CheckBox/index.tsx +26 -37
  17. package/CheckBox/types.ts +3 -5
  18. package/Consts/colors+spacing+radius.ts +0 -14
  19. package/Icon/index.tsx +8 -9
  20. package/Icon/types.ts +2 -2
  21. package/IconButton/index.tsx +14 -24
  22. package/Image/index.tsx +8 -23
  23. package/Image/types.ts +0 -2
  24. package/Input/Input.tsx +26 -116
  25. package/Input/InputDropDown.tsx +51 -66
  26. package/Input/InputMoney.tsx +15 -106
  27. package/Input/InputOTP.tsx +26 -49
  28. package/Input/InputSearch.tsx +99 -252
  29. package/Input/InputTextArea.tsx +6 -26
  30. package/Input/common.tsx +22 -48
  31. package/Input/index.tsx +77 -112
  32. package/Input/styles.ts +11 -48
  33. package/Input/utils.ts +1 -1
  34. package/Layout/Card.tsx +3 -4
  35. package/Layout/GridSystem.tsx +1 -1
  36. package/Layout/ItemList.tsx +2 -3
  37. package/Layout/Screen.tsx +121 -242
  38. package/Layout/Section.tsx +3 -4
  39. package/Layout/styles.ts +13 -11
  40. package/Layout/types.ts +1 -1
  41. package/Layout/utils.ts +4 -4
  42. package/Loader/index.tsx +0 -2
  43. package/Pagination/PaginationScroll.tsx +2 -2
  44. package/Pagination/styles.ts +1 -1
  45. package/Popup/PopupNotify.tsx +46 -57
  46. package/Popup/PopupPromotion.tsx +8 -6
  47. package/Popup/types.ts +7 -1
  48. package/Radio/index.tsx +20 -35
  49. package/Radio/types.ts +3 -5
  50. package/Switch/index.tsx +18 -32
  51. package/Switch/types.ts +3 -5
  52. package/Tag/index.tsx +2 -9
  53. package/Tag/styles.ts +2 -3
  54. package/Tag/types.ts +0 -12
  55. package/Text/index.tsx +5 -24
  56. package/Text/styles.ts +8 -8
  57. package/Title/index.tsx +103 -170
  58. package/Title/styles.ts +9 -36
  59. package/Title/types.ts +48 -16
  60. package/code-scanner.js +16 -125
  61. package/index.ts +0 -7
  62. package/package.json +7 -8
  63. package/publish.sh +21 -16
  64. package/tsconfig.json +1 -1
  65. package/Application/BottomSheet.tsx +0 -216
  66. package/Application/BottomTab/BottomTabBar.tsx +0 -278
  67. package/Application/Localize.ts +0 -44
  68. package/Application/constants.ts +0 -9
  69. package/Badge/BadgeDotAnimation.tsx +0 -95
  70. package/Input/TextTyping.tsx +0 -113
  71. package/Layout/FloatingButton.tsx +0 -168
@@ -1,39 +1,28 @@
1
- import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
2
- import {NavigationContainer} from '@react-navigation/native';
3
- import {createStackNavigator} from '@react-navigation/stack';
4
1
  import React, {useContext, useEffect} from 'react';
5
2
  import {Platform} from 'react-native';
3
+ import {BottomTabProps, NavigationScreenProps} from './types';
4
+ import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
5
+ import {createStackNavigator} from '@react-navigation/stack';
6
6
  import {useSafeAreaInsets} from 'react-native-safe-area-context';
7
- import {Colors} from '../../Consts';
8
- import {Icon} from '../../Icon';
9
- import {Text} from '../../Text';
10
- import {ApplicationContext} from '../index';
11
- import StackScreen from '../StackScreen';
12
- import {BottomTabProps, NavigationScreenProps} from '../types';
13
- import {getOptions, getStackOptions} from '../utils';
14
- import BottomTabBar from './BottomTabBar';
7
+ import {NavigationContainer} from '@react-navigation/native';
8
+ import {Icon} from '../Icon';
9
+ import {Text} from '../Text';
10
+ import {ApplicationContext} from './index';
11
+ import {getStackOptions} from './utils';
12
+ import StackScreen from './StackScreen';
15
13
 
16
14
  const Tab = createBottomTabNavigator();
17
15
  const Stack = createStackNavigator();
18
16
 
19
17
  const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
20
- let options = {};
21
- if (route.params?.options) {
22
- options = getOptions(route.params?.options);
23
- }
24
-
25
18
  if (route.params?.nested) {
26
19
  return (
27
20
  <Stack.Navigator>
28
21
  <Stack.Screen
29
22
  name="Stack"
30
23
  component={StackScreen}
31
- initialParams={{
32
- screen: route.params?.screen,
33
- options,
34
- initialParams: route.params?.initialParams,
35
- }}
36
- options={{...getStackOptions()}}
24
+ initialParams={{screen: route.params?.screen}}
25
+ options={{...getStackOptions(), ...route.params?.options}}
37
26
  />
38
27
  </Stack.Navigator>
39
28
  );
@@ -44,25 +33,19 @@ const TabScreen: React.FC<NavigationScreenProps> = ({route}) => {
44
33
  <Stack.Screen
45
34
  name="Stack"
46
35
  component={StackScreen}
47
- initialParams={{
48
- screen: route.params?.screen,
49
- options,
50
- initialParams: route.params?.initialParams,
51
- }}
36
+ initialParams={{screen: route.params?.screen}}
52
37
  options={{...getStackOptions(), ...route.params?.options}}
53
38
  />
54
39
  </Stack.Navigator>
55
40
  </NavigationContainer>
56
41
  );
57
42
  };
58
-
59
43
  const BottomTab: React.FC<BottomTabProps> = ({
60
44
  nested,
61
45
  tabs,
62
46
  listeners,
63
47
  navigation,
64
48
  initialRouteName,
65
- floatingButton,
66
49
  }) => {
67
50
  const {theme} = useContext(ApplicationContext);
68
51
  const insets = useSafeAreaInsets();
@@ -79,28 +62,23 @@ const BottomTab: React.FC<BottomTabProps> = ({
79
62
  <Tab.Navigator
80
63
  initialRouteName={initialRouteName}
81
64
  backBehavior={'firstRoute'}
82
- tabBar={props => (
83
- <BottomTabBar {...props} floatingButton={floatingButton} />
84
- )}
85
65
  tabBarOptions={{
86
66
  style: {
87
- height: 64 + Math.min(insets.bottom, 21),
67
+ height: 68 + Math.min(insets.bottom, 21),
88
68
  },
89
69
  tabStyle: {
90
70
  height: 68,
91
- paddingVertical: 10,
71
+ paddingVertical: 8,
92
72
  },
93
73
  }}>
94
74
  {tabs.map(item => {
95
- const isNum = !isNaN(parseInt(`${item?.badgeLabel}`));
96
- const isDot = typeof item?.badgeLabel === 'string' && !item?.badgeLabel;
97
75
  return (
98
76
  <Tab.Screen
99
77
  key={item.name}
100
78
  name={item.name}
101
79
  component={TabScreen}
102
80
  initialParams={{...item, nested}}
103
- listeners={item.listeners ?? listeners}
81
+ listeners={listeners}
104
82
  options={{
105
83
  tabBarLabel: ({color, focused}) => {
106
84
  return (
@@ -109,8 +87,7 @@ const BottomTab: React.FC<BottomTabProps> = ({
109
87
  typography={
110
88
  focused ? 'label_xs_medium' : 'description_xs_regular'
111
89
  }
112
- color={color}
113
- style={{width: '90%', textAlign: 'center'}}>
90
+ color={color}>
114
91
  {item.label}
115
92
  </Text>
116
93
  );
@@ -124,9 +101,8 @@ const BottomTab: React.FC<BottomTabProps> = ({
124
101
  fontWeight: 'bold',
125
102
  alignSelf: 'center',
126
103
  fontFamily: `${theme.font}-Bold`,
127
- left: isDot ? 8 : 4,
128
- top: isDot ? -2 : -6,
129
- backgroundColor: isNum ? Colors.red_03 : Colors.orange_03,
104
+ left: item?.showDot ? 8 : 4,
105
+ top: item?.showDot ? -2 : -6,
130
106
  },
131
107
  tabBarIcon: ({color}) => (
132
108
  <Icon source={item.icon} color={color} size={28} />