@momo-kits/foundation 1.0.0
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/Assets/header-background.png +0 -0
- package/Button/index.tsx +307 -0
- package/Button/styles.ts +41 -0
- package/Button/types.ts +18 -0
- package/CheckBox/index.js +74 -0
- package/CheckBox/styles.js +3 -0
- package/Consts/colors+spacing+radius.ts +162 -0
- package/Consts/index.ts +76 -0
- package/Consts/styles.ts +137 -0
- package/ContentLoader/index.tsx +71 -0
- package/ContentLoader/styles.ts +5 -0
- package/ContentLoader/types.ts +3 -0
- package/Divider/index.js +43 -0
- package/Divider/styles.js +10 -0
- package/Icon/icon.json +3935 -0
- package/Icon/index.tsx +30 -0
- package/Icon/types.ts +8 -0
- package/IconButton/index.tsx +127 -0
- package/IconButton/types.ts +17 -0
- package/Image/index.tsx +67 -0
- package/Image/styles.ts +13 -0
- package/Image/types.ts +6 -0
- package/Layout/Row.tsx +42 -0
- package/Layout/Screen.tsx +68 -0
- package/Layout/Section.tsx +30 -0
- package/Layout/View.tsx +84 -0
- package/Layout/index.ts +6 -0
- package/Layout/styles.ts +24 -0
- package/Layout/types.ts +39 -0
- package/Layout/utils.ts +37 -0
- package/Navigation/Components.tsx +55 -0
- package/Navigation/ModalScreen.tsx +177 -0
- package/Navigation/Navigation.ts +34 -0
- package/Navigation/NavigationButton.tsx +25 -0
- package/Navigation/NavigationContainer.tsx +74 -0
- package/Navigation/Navigator.ts +45 -0
- package/Navigation/ScreenContainer.tsx +38 -0
- package/Navigation/StackScreen.tsx +19 -0
- package/Navigation/index.ts +10 -0
- package/Navigation/types.ts +87 -0
- package/Navigation/utils.tsx +84 -0
- package/SizedBox/index.js +23 -0
- package/SizedBox/styles.js +7 -0
- package/Text/index.tsx +164 -0
- package/Text/styles.ts +34 -0
- package/Text/types.ts +47 -0
- package/TextInput/index.js +225 -0
- package/TextInput/styles.js +55 -0
- package/index.ts +18 -0
- package/package.json +41 -0
- package/publish.sh +26 -0
package/Text/index.tsx
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import React, {useContext} from 'react';
|
|
2
|
+
import {StyleSheet, Text as RNText} from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
NavigationContext,
|
|
5
|
+
// FontWeight,
|
|
6
|
+
TextProps,
|
|
7
|
+
Typography,
|
|
8
|
+
TypographyWeight,
|
|
9
|
+
} from '../index';
|
|
10
|
+
import styles from './styles';
|
|
11
|
+
|
|
12
|
+
const ProximaNova: TypographyWeight = {
|
|
13
|
+
100: 'Thin',
|
|
14
|
+
200: 'Thin',
|
|
15
|
+
300: 'Thin',
|
|
16
|
+
400: 'Regular',
|
|
17
|
+
500: 'Regular',
|
|
18
|
+
600: 'Regular',
|
|
19
|
+
700: 'Bold',
|
|
20
|
+
800: 'ExtraBold',
|
|
21
|
+
900: 'Black',
|
|
22
|
+
normal: 'Regular',
|
|
23
|
+
bold: 'Bold',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Raleway: TypographyWeight = {
|
|
27
|
+
100: 'Thin',
|
|
28
|
+
200: 'ExtraLight',
|
|
29
|
+
300: 'Light',
|
|
30
|
+
400: 'Regular',
|
|
31
|
+
500: 'Medium',
|
|
32
|
+
600: 'SemiBold',
|
|
33
|
+
700: 'Bold',
|
|
34
|
+
800: 'ExtraBold',
|
|
35
|
+
900: 'Black',
|
|
36
|
+
normal: 'Regular',
|
|
37
|
+
bold: 'Bold',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const SFProText: TypographyWeight = {
|
|
41
|
+
100: 'Thin',
|
|
42
|
+
200: 'Ultralight',
|
|
43
|
+
300: 'Light',
|
|
44
|
+
400: 'Regular',
|
|
45
|
+
500: 'Medium',
|
|
46
|
+
600: 'Semibold',
|
|
47
|
+
700: 'Bold',
|
|
48
|
+
800: 'Heavy',
|
|
49
|
+
900: 'Black',
|
|
50
|
+
normal: 'Regular',
|
|
51
|
+
bold: 'Bold',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const FontStyle: {[key: string]: string} = {
|
|
55
|
+
normal: '',
|
|
56
|
+
italic: 'Italic',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* export font fontFamily for font
|
|
61
|
+
* @return {*}
|
|
62
|
+
*/
|
|
63
|
+
const getFontFamily = ({
|
|
64
|
+
fontFamily = 'SFProText',
|
|
65
|
+
fontWeight = '400',
|
|
66
|
+
fontStyle = 'normal',
|
|
67
|
+
}) => {
|
|
68
|
+
let style = FontStyle[fontStyle];
|
|
69
|
+
if (style === 'Italic' && fontWeight === '400') {
|
|
70
|
+
fontWeight = 'bold';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
switch (fontFamily) {
|
|
74
|
+
case 'ProximaNova':
|
|
75
|
+
return `${fontFamily}-${ProximaNova[fontWeight]}${style}`;
|
|
76
|
+
case 'Raleway':
|
|
77
|
+
return `${fontFamily}-${Raleway[fontWeight]}${style}`;
|
|
78
|
+
case 'SFProText':
|
|
79
|
+
return `${fontFamily}-${SFProText[fontWeight]}${style}`;
|
|
80
|
+
default:
|
|
81
|
+
return `${fontFamily}-${SFProText[fontWeight]}${style}`;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const Text: React.FC<TextProps> = ({
|
|
85
|
+
typography,
|
|
86
|
+
// weight,
|
|
87
|
+
color,
|
|
88
|
+
// fontStyle,
|
|
89
|
+
children,
|
|
90
|
+
style,
|
|
91
|
+
...rest
|
|
92
|
+
}) => {
|
|
93
|
+
const {theme} = useContext(NavigationContext);
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* typography style
|
|
97
|
+
* @return {*}
|
|
98
|
+
*/
|
|
99
|
+
const getTypography = (value: Typography) => {
|
|
100
|
+
const typo: {
|
|
101
|
+
[key: string]: object;
|
|
102
|
+
} = styles;
|
|
103
|
+
return typo[value];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* weight style
|
|
108
|
+
* @return {*}
|
|
109
|
+
*/
|
|
110
|
+
/*
|
|
111
|
+
const getFontWeight = (value: FontWeight | undefined) => {
|
|
112
|
+
switch (value) {
|
|
113
|
+
case 'thin':
|
|
114
|
+
return {fontWeight: '100'};
|
|
115
|
+
case 'ultraLight':
|
|
116
|
+
return {fontWeight: '200'};
|
|
117
|
+
case 'light':
|
|
118
|
+
return {fontWeight: '300'};
|
|
119
|
+
case 'regular':
|
|
120
|
+
return {fontWeight: '400'};
|
|
121
|
+
case 'medium':
|
|
122
|
+
return {fontWeight: '500'};
|
|
123
|
+
case 'semibold':
|
|
124
|
+
return {fontWeight: '600'};
|
|
125
|
+
case 'bold':
|
|
126
|
+
return {fontWeight: '700'};
|
|
127
|
+
case 'heavy':
|
|
128
|
+
return {fontWeight: '800'};
|
|
129
|
+
case 'black':
|
|
130
|
+
return {fontWeight: '900'};
|
|
131
|
+
default:
|
|
132
|
+
return {fontWeight: '400'};
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
const textStyle: any = StyleSheet.flatten([
|
|
138
|
+
{fontFamily: theme.font, color: color ?? theme.colors},
|
|
139
|
+
getTypography(typography),
|
|
140
|
+
// getFontWeight(weight),
|
|
141
|
+
style,
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
textStyle.fontFamily = getFontFamily({
|
|
145
|
+
fontFamily: textStyle.fontFamily,
|
|
146
|
+
// fontWeight: textStyle.fontWeight,
|
|
147
|
+
// fontStyle,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<RNText {...rest} style={textStyle}>
|
|
152
|
+
{children ?? ''}
|
|
153
|
+
</RNText>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
Text.defaultProps = {
|
|
158
|
+
typography: 'paragraph_default',
|
|
159
|
+
// weight: 'regular',
|
|
160
|
+
color: undefined,
|
|
161
|
+
// fontStyle: 'normal',
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export {Text, getFontFamily};
|
package/Text/styles.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
'headline-default': {
|
|
3
|
+
fontSize: 28,
|
|
4
|
+
lineHeight: 34,
|
|
5
|
+
fontWeight: '600',
|
|
6
|
+
},
|
|
7
|
+
'headline-s': {fontSize: 24, lineHeight: 32, fontWeight: '600'},
|
|
8
|
+
'headline-l': {fontSize: 32, lineHeight: 36, fontWeight: '600'},
|
|
9
|
+
'headline-xl': {fontSize: 36, lineHeight: 44, fontWeight: '600'},
|
|
10
|
+
'title-default': {fontSize: 20, lineHeight: 28, fontWeight: '700'},
|
|
11
|
+
'title-xs': {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
12
|
+
'title-s': {fontSize: 18, lineHeight: 28, fontWeight: '700'},
|
|
13
|
+
'headerText-default': {fontSize: 15, lineHeight: 22, fontWeight: '600'},
|
|
14
|
+
'headerText-xs': {fontSize: 12, lineHeight: 16, fontWeight: '600'},
|
|
15
|
+
'headerText-s': {fontSize: 14, lineHeight: 20, fontWeight: '600'},
|
|
16
|
+
'paragraph-default': {fontSize: 15, lineHeight: 22, fontWeight: '400'},
|
|
17
|
+
'paragraph-bold': {fontSize: 15, lineHeight: 22, fontWeight: '700'},
|
|
18
|
+
'paragraph-italic': {
|
|
19
|
+
fontSize: 15,
|
|
20
|
+
lineHeight: 22,
|
|
21
|
+
fontWeight: '400',
|
|
22
|
+
fontStyle: 'italic',
|
|
23
|
+
},
|
|
24
|
+
'description-default': {fontSize: 14, lineHeight: 20, fontWeight: '400'},
|
|
25
|
+
'description-xs': {fontSize: 10, lineHeight: 14, fontWeight: '400'},
|
|
26
|
+
'description-s': {fontSize: 12, lineHeight: 16, fontWeight: '400'},
|
|
27
|
+
'label-default': {fontSize: 14, lineHeight: 20, fontWeight: '500'},
|
|
28
|
+
'label-xxs': {fontSize: 8, lineHeight: 12, fontWeight: '500'},
|
|
29
|
+
'label-xs': {fontSize: 10, lineHeight: 14, fontWeight: '500'},
|
|
30
|
+
'label-s': {fontSize: 12, lineHeight: 16, fontWeight: '500'},
|
|
31
|
+
'action-default': {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
32
|
+
'action-xxs': {fontSize: 10, lineHeight: 14, fontWeight: '700'},
|
|
33
|
+
'action-xs': {fontSize: 12, lineHeight: 16, fontWeight: '700'},
|
|
34
|
+
};
|
package/Text/types.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {TextProps as RNTextProps} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface TypographyWeight {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
100: string;
|
|
6
|
+
200: string;
|
|
7
|
+
300: string;
|
|
8
|
+
400: string;
|
|
9
|
+
500: string;
|
|
10
|
+
600: string;
|
|
11
|
+
700: string;
|
|
12
|
+
800: string;
|
|
13
|
+
900: string;
|
|
14
|
+
normal: string;
|
|
15
|
+
bold: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type Typography =
|
|
19
|
+
| 'headline_default'
|
|
20
|
+
| 'headline_s'
|
|
21
|
+
| 'headline_l'
|
|
22
|
+
| 'headline_xl'
|
|
23
|
+
| 'title_default'
|
|
24
|
+
| 'title_xs'
|
|
25
|
+
| 'title_s'
|
|
26
|
+
| 'headerText_default'
|
|
27
|
+
| 'headerText_xs'
|
|
28
|
+
| 'headerText_s'
|
|
29
|
+
| 'paragraph_default'
|
|
30
|
+
| 'paragraph_bold'
|
|
31
|
+
| 'paragraph_italic'
|
|
32
|
+
| 'description_default'
|
|
33
|
+
| 'description_xs'
|
|
34
|
+
| 'description_s'
|
|
35
|
+
| 'label_default'
|
|
36
|
+
| 'label_xxs'
|
|
37
|
+
| 'label_xs'
|
|
38
|
+
| 'label_s'
|
|
39
|
+
| 'action_default'
|
|
40
|
+
| 'action_xxs'
|
|
41
|
+
| 'action_xs'
|
|
42
|
+
| 'action_s';
|
|
43
|
+
|
|
44
|
+
export interface TextProps extends RNTextProps {
|
|
45
|
+
typography: Typography;
|
|
46
|
+
color?: string;
|
|
47
|
+
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
forwardRef,
|
|
3
|
+
useContext,
|
|
4
|
+
useImperativeHandle,
|
|
5
|
+
useRef,
|
|
6
|
+
useState,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {TextInput, TouchableOpacity, View} from 'react-native';
|
|
9
|
+
import PropTypes from 'prop-types';
|
|
10
|
+
import {
|
|
11
|
+
ApplicationContext,
|
|
12
|
+
getFontFamily,
|
|
13
|
+
Index,
|
|
14
|
+
SizedBox,
|
|
15
|
+
Text,
|
|
16
|
+
} from '@components';
|
|
17
|
+
import styles from './styles';
|
|
18
|
+
import {Opacity} from '@configs';
|
|
19
|
+
|
|
20
|
+
const Index = forwardRef((props, ref) => {
|
|
21
|
+
const {theme, font} = useContext(ApplicationContext);
|
|
22
|
+
const {
|
|
23
|
+
style,
|
|
24
|
+
size,
|
|
25
|
+
label,
|
|
26
|
+
info,
|
|
27
|
+
onPressInfo,
|
|
28
|
+
onChangeText,
|
|
29
|
+
error,
|
|
30
|
+
trailing,
|
|
31
|
+
numberOfLines,
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
const inputRef = useRef();
|
|
35
|
+
const [focus, setFocus] = useState(false);
|
|
36
|
+
|
|
37
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* get border color
|
|
41
|
+
*/
|
|
42
|
+
const getBorderColor = () => {
|
|
43
|
+
if (error) {
|
|
44
|
+
return theme.colors.error;
|
|
45
|
+
}
|
|
46
|
+
if (focus) {
|
|
47
|
+
return theme.colors.primary;
|
|
48
|
+
}
|
|
49
|
+
return theme.colors.border;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* get size style
|
|
54
|
+
*/
|
|
55
|
+
const getSizeStyle = () => {
|
|
56
|
+
if (numberOfLines > 1) {
|
|
57
|
+
return [styles.small, {height: numberOfLines * 24}];
|
|
58
|
+
}
|
|
59
|
+
switch (size) {
|
|
60
|
+
case 'large':
|
|
61
|
+
return styles.large;
|
|
62
|
+
case 'small':
|
|
63
|
+
return styles.small;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
return styles.large;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* get text style
|
|
72
|
+
*/
|
|
73
|
+
const getTextStyle = () => {
|
|
74
|
+
let textStyle;
|
|
75
|
+
switch (size) {
|
|
76
|
+
case 'large':
|
|
77
|
+
textStyle = styles.textLarge;
|
|
78
|
+
break;
|
|
79
|
+
case 'small':
|
|
80
|
+
textStyle = styles.textSmall;
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
textStyle = styles.textLarge;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
...textStyle,
|
|
89
|
+
fontFamily: getFontFamily({
|
|
90
|
+
fontFamily: font,
|
|
91
|
+
fontWeight: textStyle.fontWeight,
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* on clear text
|
|
98
|
+
*/
|
|
99
|
+
const onClear = () => {
|
|
100
|
+
inputRef?.current?.clear?.();
|
|
101
|
+
onChangeText?.('');
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* on blur
|
|
106
|
+
*/
|
|
107
|
+
const onBlur = () => {
|
|
108
|
+
setFocus(false);
|
|
109
|
+
props.onBlur?.();
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* on forcus
|
|
114
|
+
*/
|
|
115
|
+
const onFocus = () => {
|
|
116
|
+
setFocus(true);
|
|
117
|
+
props.onFocus?.();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* render info icon button
|
|
122
|
+
*/
|
|
123
|
+
const renderInfo = () => {
|
|
124
|
+
if (info) {
|
|
125
|
+
return (
|
|
126
|
+
<TouchableOpacity style={styles.rowInfo} onPress={onPressInfo}>
|
|
127
|
+
<Index
|
|
128
|
+
name="information-outline"
|
|
129
|
+
color={theme.colors.secondary}
|
|
130
|
+
size={16}
|
|
131
|
+
/>
|
|
132
|
+
</TouchableOpacity>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* render clear action
|
|
139
|
+
*/
|
|
140
|
+
const renderClear = () => {
|
|
141
|
+
if (focus) {
|
|
142
|
+
return (
|
|
143
|
+
<TouchableOpacity onPress={onClear}>
|
|
144
|
+
<Index name="close-circle" />
|
|
145
|
+
</TouchableOpacity>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* render trailing
|
|
152
|
+
*/
|
|
153
|
+
const renderTrailing = () => {
|
|
154
|
+
if (trailing) {
|
|
155
|
+
return <View style={styles.trailingContent}>{trailing}</View>;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<View style={[styles.container, style]}>
|
|
161
|
+
<View style={[getSizeStyle(), {borderColor: getBorderColor()}]}>
|
|
162
|
+
<View style={styles.rowContent}>
|
|
163
|
+
<TextInput
|
|
164
|
+
{...props}
|
|
165
|
+
ref={inputRef}
|
|
166
|
+
multiline={numberOfLines > 1}
|
|
167
|
+
textAlignVertical={numberOfLines > 1 ? 'top' : 'center'}
|
|
168
|
+
style={[
|
|
169
|
+
styles.inputContent,
|
|
170
|
+
{color: theme.colors.text},
|
|
171
|
+
numberOfLines > 1 && styles.multilineContent,
|
|
172
|
+
getTextStyle(),
|
|
173
|
+
]}
|
|
174
|
+
placeholderTextColor={theme.colors.textSecondary + Opacity['40']}
|
|
175
|
+
onFocus={onFocus}
|
|
176
|
+
onBlur={onBlur}
|
|
177
|
+
/>
|
|
178
|
+
{renderClear()}
|
|
179
|
+
{renderTrailing()}
|
|
180
|
+
<View
|
|
181
|
+
style={[styles.infoContent, {backgroundColor: theme.colors.card}]}>
|
|
182
|
+
<Text typography="subtitle" type="secondary">
|
|
183
|
+
{label}
|
|
184
|
+
</Text>
|
|
185
|
+
{renderInfo()}
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
</View>
|
|
189
|
+
{error && (
|
|
190
|
+
<>
|
|
191
|
+
<SizedBox height={4} />
|
|
192
|
+
<Text typography="subtitle" color="error">
|
|
193
|
+
{error}
|
|
194
|
+
</Text>
|
|
195
|
+
</>
|
|
196
|
+
)}
|
|
197
|
+
</View>
|
|
198
|
+
);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
Index.propTypes = {
|
|
202
|
+
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
203
|
+
size: PropTypes.oneOf(['large', 'small']),
|
|
204
|
+
label: PropTypes.string,
|
|
205
|
+
error: PropTypes.string,
|
|
206
|
+
info: PropTypes.bool,
|
|
207
|
+
autoCorrect: PropTypes.bool,
|
|
208
|
+
spellCheck: PropTypes.bool,
|
|
209
|
+
onPressInfo: PropTypes.func,
|
|
210
|
+
trailing: PropTypes.element,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
Index.defaultProps = {
|
|
214
|
+
style: {},
|
|
215
|
+
size: 'large',
|
|
216
|
+
label: 'Label',
|
|
217
|
+
error: null,
|
|
218
|
+
info: false,
|
|
219
|
+
autoCorrect: false,
|
|
220
|
+
spellCheck: false,
|
|
221
|
+
onPressInfo: () => {},
|
|
222
|
+
trailing: null,
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
export default Index;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
width: '100%',
|
|
6
|
+
},
|
|
7
|
+
large: {
|
|
8
|
+
height: 60,
|
|
9
|
+
width: '100%',
|
|
10
|
+
borderWidth: 1,
|
|
11
|
+
borderRadius: 8,
|
|
12
|
+
},
|
|
13
|
+
small: {
|
|
14
|
+
height: 50,
|
|
15
|
+
width: '100%',
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
borderRadius: 8,
|
|
18
|
+
},
|
|
19
|
+
inputContent: {flex: 1, height: '100%'},
|
|
20
|
+
textLarge: {
|
|
21
|
+
fontSize: 20,
|
|
22
|
+
fontWeight: 'bold',
|
|
23
|
+
},
|
|
24
|
+
textSmall: {fontSize: 16},
|
|
25
|
+
rowInfo: {
|
|
26
|
+
paddingLeft: 4,
|
|
27
|
+
flex: 1,
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
},
|
|
31
|
+
rowContent: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
flexDirection: 'row',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
paddingHorizontal: 16,
|
|
36
|
+
},
|
|
37
|
+
infoContent: {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
flexDirection: 'row',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
left: 8,
|
|
42
|
+
top: -8,
|
|
43
|
+
height: 16,
|
|
44
|
+
paddingHorizontal: 8,
|
|
45
|
+
overflow: 'hidden',
|
|
46
|
+
},
|
|
47
|
+
trailingContent: {
|
|
48
|
+
marginLeft: 12,
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
},
|
|
52
|
+
multilineContent: {
|
|
53
|
+
paddingTop: 12,
|
|
54
|
+
},
|
|
55
|
+
});
|
package/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Button from './Button';
|
|
2
|
+
|
|
3
|
+
export {Button};
|
|
4
|
+
|
|
5
|
+
export * from './Layout';
|
|
6
|
+
export * from './Consts';
|
|
7
|
+
export * from './Text';
|
|
8
|
+
export * from './Text/types';
|
|
9
|
+
export * from './Navigation';
|
|
10
|
+
export * from './Navigation/types';
|
|
11
|
+
export * from './Icon';
|
|
12
|
+
export * from './Icon/types';
|
|
13
|
+
export * from './IconButton';
|
|
14
|
+
export * from './IconButton/types';
|
|
15
|
+
export * from './Image';
|
|
16
|
+
export * from './Image/types';
|
|
17
|
+
export * from './ContentLoader';
|
|
18
|
+
export * from './ContentLoader/types';
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@momo-kits/foundation",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native Component Kits",
|
|
5
|
+
"main": "index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [
|
|
10
|
+
"@momo-kits/foundation"
|
|
11
|
+
],
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"react-native-safe-area-context": "3.1.4",
|
|
14
|
+
"@react-navigation/bottom-tabs": "5.11.15",
|
|
15
|
+
"@react-navigation/core": "5.16.1",
|
|
16
|
+
"@react-navigation/native": "5.9.8",
|
|
17
|
+
"@react-navigation/routers": "5.7.4",
|
|
18
|
+
"@react-navigation/stack": "5.14.9",
|
|
19
|
+
"@gorhom/bottom-sheet": "2.4.1",
|
|
20
|
+
"react-native-screens": "git+https://gitlab.com/dung.huynh1/react-native-screens.git#main"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"react-native": "*"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/core": "^7.12.9",
|
|
27
|
+
"@babel/runtime": "^7.12.5",
|
|
28
|
+
"@react-native-community/eslint-config": "^2.0.0",
|
|
29
|
+
"@types/jest": "26.0.23",
|
|
30
|
+
"@types/react-native": "0.64.4",
|
|
31
|
+
"@types/react-test-renderer": "16.9.2",
|
|
32
|
+
"babel-jest": "^26.6.3",
|
|
33
|
+
"eslint": "^7.14.0",
|
|
34
|
+
"jest": "^26.6.3",
|
|
35
|
+
"metro-react-native-babel-preset": "^0.64.0",
|
|
36
|
+
"react-test-renderer": "17.0.1",
|
|
37
|
+
"typescript": "^4.0.3"
|
|
38
|
+
},
|
|
39
|
+
"author": "@momo-kits/foundation",
|
|
40
|
+
"license": "ISC"
|
|
41
|
+
}
|
package/publish.sh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
rm -rf dist
|
|
3
|
+
mkdir dist
|
|
4
|
+
|
|
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
|
+
#babel component to dist
|
|
16
|
+
#babel ./dist -d dist --copy-files
|
|
17
|
+
|
|
18
|
+
cd dist
|
|
19
|
+
npm publish --tag beta --access=public
|
|
20
|
+
|
|
21
|
+
#clear dist and package json
|
|
22
|
+
cd ..
|
|
23
|
+
rm -rf dist
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
#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/core"}'
|