@momo-kits/foundation 0.89.6 → 0.92.1-beta.16
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 +479 -0
- package/Application/{BottomTab.tsx → BottomTab/index.tsx} +19 -9
- package/Application/Components.tsx +26 -10
- package/Application/NavigationContainer.tsx +15 -3
- package/Application/StackScreen.tsx +73 -14
- package/Application/types.ts +12 -2
- package/Application/utils.tsx +70 -2
- package/Badge/Badge.tsx +1 -1
- package/Button/index.tsx +54 -14
- package/CheckBox/index.tsx +53 -20
- package/CheckBox/types.ts +4 -0
- package/Consts/colors+spacing+radius.ts +14 -0
- package/IconButton/index.tsx +30 -7
- package/Image/index.tsx +3 -1
- package/Input/Input.tsx +68 -5
- package/Input/InputDropDown.tsx +44 -5
- package/Input/InputMoney.tsx +53 -5
- package/Input/InputOTP.tsx +39 -7
- package/Input/InputSearch.tsx +61 -25
- package/Input/InputTextArea.tsx +23 -0
- package/Input/index.tsx +29 -2
- package/Popup/PopupNotify.tsx +13 -2
- package/Popup/PopupPromotion.tsx +11 -4
- package/Radio/index.tsx +52 -19
- package/Radio/types.ts +5 -0
- package/Switch/index.tsx +39 -14
- package/Switch/types.ts +4 -0
- package/Text/index.tsx +22 -0
- package/Text/styles.ts +1 -1
- package/Text/types.ts +19 -1
- package/Title/index.tsx +148 -102
- package/Title/styles.ts +33 -9
- package/Title/types.ts +12 -48
- package/index.ts +2 -1
- package/package.json +3 -1
package/Title/styles.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {StyleSheet} from 'react-native';
|
|
2
2
|
import {scaleSize} from '../Text';
|
|
3
|
-
import {Radius, Spacing} from '../Consts';
|
|
3
|
+
import {Colors, Radius, Spacing} from '../Consts';
|
|
4
4
|
|
|
5
5
|
export default StyleSheet.create({
|
|
6
6
|
card_small: {
|
|
@@ -27,10 +27,6 @@ export default StyleSheet.create({
|
|
|
27
27
|
fontSize: scaleSize(24),
|
|
28
28
|
lineHeight: scaleSize(34),
|
|
29
29
|
},
|
|
30
|
-
screen: {
|
|
31
|
-
fontSize: scaleSize(36),
|
|
32
|
-
lineHeight: scaleSize(44),
|
|
33
|
-
},
|
|
34
30
|
actionIcon: {
|
|
35
31
|
borderRadius: Radius.M,
|
|
36
32
|
alignItems: 'center',
|
|
@@ -41,12 +37,40 @@ export default StyleSheet.create({
|
|
|
41
37
|
borderRadius: Radius.XS,
|
|
42
38
|
},
|
|
43
39
|
wrapper: {
|
|
44
|
-
width: '100%',
|
|
45
40
|
flexDirection: 'row',
|
|
46
|
-
alignItems: 'center',
|
|
47
41
|
},
|
|
48
|
-
|
|
42
|
+
margin: {
|
|
43
|
+
marginTop: Spacing.S,
|
|
44
|
+
},
|
|
45
|
+
iconView: {
|
|
49
46
|
marginRight: Spacing.S,
|
|
50
|
-
|
|
47
|
+
},
|
|
48
|
+
iconRight: {
|
|
49
|
+
width: scaleSize(22),
|
|
50
|
+
height: scaleSize(22),
|
|
51
|
+
borderRadius: Radius.M,
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
justifyContent: 'center',
|
|
54
|
+
marginLeft: Spacing.S,
|
|
55
|
+
},
|
|
56
|
+
iconLeft: {
|
|
57
|
+
width: scaleSize(18),
|
|
58
|
+
height: scaleSize(18),
|
|
59
|
+
borderRadius: Radius.M,
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
marginHorizontal: Spacing.XS,
|
|
63
|
+
},
|
|
64
|
+
iconLeftView: {
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
},
|
|
68
|
+
contentView: {marginRight: Spacing.S, flex: 1},
|
|
69
|
+
title: {
|
|
70
|
+
fontWeight: 'bold',
|
|
71
|
+
marginBottom: Spacing.XS,
|
|
72
|
+
},
|
|
73
|
+
badge: {
|
|
74
|
+
marginLeft: Spacing.XS,
|
|
51
75
|
},
|
|
52
76
|
});
|
package/Title/types.ts
CHANGED
|
@@ -1,52 +1,16 @@
|
|
|
1
1
|
export type TitleProps = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* 'screen' - Used for screen titles.
|
|
5
|
-
* 'section' - Used for section titles within a screen.
|
|
6
|
-
* 'card' - Used for titles within a card component.
|
|
7
|
-
*/
|
|
8
|
-
type?: 'screen' | 'section' | 'card';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Required. The text of the title.
|
|
12
|
-
*/
|
|
2
|
+
type?: 'card' | 'section';
|
|
3
|
+
size?: 'small' | 'medium' | 'large';
|
|
13
4
|
title: string;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Optional. A description or subtitle that appears below the title.
|
|
17
|
-
*/
|
|
18
|
-
description?: string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Optional. Defines the size of the Title component.
|
|
22
|
-
* 'large' - A larger, more prominent title.
|
|
23
|
-
* 'small' - A smaller, less prominent title.
|
|
24
|
-
*/
|
|
25
|
-
size?: 'large' | 'medium' | 'small';
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Optional. Represents the name or key of the icon to be displayed alongside the title.
|
|
29
|
-
*/
|
|
30
5
|
icon?: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Optional. Function to be called when the action associated with the title is pressed.
|
|
44
|
-
*/
|
|
45
|
-
onPressAction?: () => void;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Optional. If `true`, an action button or icon is displayed alongside the title.
|
|
49
|
-
*/
|
|
50
|
-
showAction?: boolean;
|
|
51
|
-
usePadding?: boolean;
|
|
6
|
+
description?: string;
|
|
7
|
+
iconColor?: string;
|
|
8
|
+
iconAlign?: 'top' | 'middle' | 'bottom';
|
|
9
|
+
showRightAction?: boolean;
|
|
10
|
+
showTrailingAction?: boolean;
|
|
11
|
+
badgeLabel?: string;
|
|
12
|
+
buttonTitle?: string;
|
|
13
|
+
buttonSize?: 'small' | 'large';
|
|
14
|
+
onPressRightAction?: () => void;
|
|
15
|
+
textOnly?: boolean;
|
|
52
16
|
};
|
package/index.ts
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
useSafeAreaInsets,
|
|
5
5
|
} from 'react-native-safe-area-context';
|
|
6
6
|
import LinearGradient from 'react-native-linear-gradient';
|
|
7
|
+
import {getAccessibilityID} from "./Application/utils";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* native export
|
|
10
11
|
*/
|
|
11
|
-
export {SafeAreaView, useSafeAreaInsets, SafeAreaProvider, LinearGradient};
|
|
12
|
+
export {SafeAreaView, useSafeAreaInsets, SafeAreaProvider, LinearGradient, getAccessibilityID};
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* foundation component
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.1-beta.16",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"@momo-kits/foundation"
|
|
11
11
|
],
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@gorhom/bottom-sheet": "git+https://gitlab.com/momo-platform/bottom-sheet.git#main",
|
|
13
14
|
"react-native-safe-area-context": "3.1.4",
|
|
14
15
|
"react-native-linear-gradient": "2.8.3",
|
|
15
16
|
"react-native-gesture-handler": "1.10.3",
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
"@types/jest": "26.0.23",
|
|
33
34
|
"@types/react-native": "0.64.4",
|
|
34
35
|
"@types/react-test-renderer": "16.9.2",
|
|
36
|
+
"@types/d3-shape": "1.3.7",
|
|
35
37
|
"babel-jest": "^26.6.3",
|
|
36
38
|
"eslint": "^7.14.0",
|
|
37
39
|
"jest": "^26.6.3",
|