@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.
- package/Application/{BottomTab/index.tsx → BottomTab.tsx} +18 -42
- package/Application/Components.tsx +91 -356
- package/Application/ModalScreen.tsx +185 -14
- package/Application/Navigation.ts +19 -5
- package/Application/NavigationContainer.tsx +72 -62
- package/Application/Navigator.ts +48 -154
- package/Application/StackScreen.tsx +32 -289
- package/Application/index.ts +15 -13
- package/Application/types.ts +35 -81
- package/Application/utils.tsx +30 -76
- package/Assets/icon_bank.json +1 -1
- package/Badge/Badge.tsx +1 -1
- package/Badge/index.tsx +1 -2
- package/Badge/styles.ts +6 -50
- package/Button/index.tsx +26 -44
- package/CheckBox/index.tsx +26 -37
- package/CheckBox/types.ts +3 -5
- package/Consts/colors+spacing+radius.ts +0 -14
- package/Icon/index.tsx +8 -9
- package/Icon/types.ts +2 -2
- package/IconButton/index.tsx +14 -24
- package/Image/index.tsx +8 -23
- package/Image/types.ts +0 -2
- package/Input/Input.tsx +26 -116
- package/Input/InputDropDown.tsx +51 -66
- package/Input/InputMoney.tsx +15 -106
- package/Input/InputOTP.tsx +26 -49
- package/Input/InputSearch.tsx +99 -252
- package/Input/InputTextArea.tsx +6 -26
- package/Input/common.tsx +22 -48
- package/Input/index.tsx +77 -112
- package/Input/styles.ts +11 -48
- package/Input/utils.ts +1 -1
- package/Layout/Card.tsx +3 -4
- package/Layout/GridSystem.tsx +1 -1
- package/Layout/ItemList.tsx +2 -3
- package/Layout/Screen.tsx +121 -242
- package/Layout/Section.tsx +3 -4
- package/Layout/styles.ts +13 -11
- package/Layout/types.ts +1 -1
- package/Layout/utils.ts +4 -4
- package/Loader/index.tsx +0 -2
- package/Pagination/PaginationScroll.tsx +2 -2
- package/Pagination/styles.ts +1 -1
- package/Popup/PopupNotify.tsx +46 -57
- package/Popup/PopupPromotion.tsx +8 -6
- package/Popup/types.ts +7 -1
- package/Radio/index.tsx +20 -35
- package/Radio/types.ts +3 -5
- package/Switch/index.tsx +18 -32
- package/Switch/types.ts +3 -5
- package/Tag/index.tsx +2 -9
- package/Tag/styles.ts +2 -3
- package/Tag/types.ts +0 -12
- package/Text/index.tsx +5 -24
- package/Text/styles.ts +8 -8
- package/Title/index.tsx +103 -170
- package/Title/styles.ts +9 -36
- package/Title/types.ts +48 -16
- package/code-scanner.js +16 -125
- package/index.ts +0 -7
- package/package.json +7 -8
- package/publish.sh +21 -16
- package/tsconfig.json +1 -1
- package/Application/BottomSheet.tsx +0 -216
- package/Application/BottomTab/BottomTabBar.tsx +0 -278
- package/Application/Localize.ts +0 -44
- package/Application/constants.ts +0 -9
- package/Badge/BadgeDotAnimation.tsx +0 -95
- package/Input/TextTyping.tsx +0 -113
- 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 {
|
|
8
|
-
import {Icon} from '
|
|
9
|
-
import {Text} from '
|
|
10
|
-
import {ApplicationContext} from '
|
|
11
|
-
import
|
|
12
|
-
import
|
|
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
|
-
|
|
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:
|
|
67
|
+
height: 68 + Math.min(insets.bottom, 21),
|
|
88
68
|
},
|
|
89
69
|
tabStyle: {
|
|
90
70
|
height: 68,
|
|
91
|
-
paddingVertical:
|
|
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={
|
|
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:
|
|
128
|
-
top:
|
|
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} />
|