@momo-kits/foundation 1.0.0 → 1.0.1
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/ActivityIndicator.tsx +244 -0
- package/Button/index.tsx +94 -164
- package/Button/types.ts +12 -3
- package/CheckBox/index.tsx +57 -0
- package/CheckBox/styles.ts +14 -0
- package/CheckBox/types.ts +7 -0
- package/Consts/colors+spacing+radius.ts +6 -4
- package/Consts/index.ts +4 -73
- package/Consts/styles.ts +1 -1
- package/Consts/theme.ts +65 -0
- package/ContentLoader/index.tsx +8 -11
- package/Icon/index.tsx +11 -11
- package/Icon/types.ts +1 -4
- package/IconButton/index.tsx +52 -72
- package/IconButton/styles.ts +19 -0
- package/IconButton/types.ts +1 -2
- package/Image/index.tsx +19 -18
- package/Image/types.ts +0 -1
- package/Input/TextArea.tsx +202 -0
- package/Input/index.tsx +200 -0
- package/Input/styles.ts +92 -0
- package/Input/types.ts +23 -0
- package/Layout/GridSystem.tsx +109 -0
- package/Layout/ScreenContainer.tsx +78 -0
- package/Layout/ScreenSection.tsx +104 -0
- package/Layout/SectionItem.tsx +60 -0
- package/Layout/index.ts +11 -5
- package/Layout/types.ts +6 -33
- package/Layout/utils.ts +55 -23
- package/Navigation/Components.tsx +16 -8
- package/Navigation/ModalScreen.tsx +35 -25
- package/Navigation/Navigation.ts +2 -2
- package/Navigation/NavigationButton.tsx +5 -3
- package/Navigation/NavigationContainer.tsx +59 -17
- package/Navigation/StackScreen.tsx +8 -2
- package/Navigation/index.ts +5 -3
- package/Navigation/types.ts +53 -36
- package/Navigation/utils.tsx +20 -18
- package/Radio/index.tsx +34 -0
- package/Radio/styles.ts +11 -0
- package/Radio/types.ts +7 -0
- package/Switch/index.tsx +37 -0
- package/Switch/styles.ts +23 -0
- package/Switch/types.ts +5 -0
- package/Text/index.tsx +36 -120
- package/Text/styles.ts +24 -23
- package/Text/types.ts +2 -0
- package/index.ts +18 -1
- package/package.json +1 -1
- package/publish.sh +8 -6
- package/CheckBox/index.js +0 -74
- package/CheckBox/styles.js +0 -3
- package/Layout/Row.tsx +0 -42
- package/Layout/Screen.tsx +0 -68
- package/Layout/Section.tsx +0 -30
- package/Layout/View.tsx +0 -84
- package/Layout/styles.ts +0 -24
- package/Navigation/ScreenContainer.tsx +0 -38
- package/SizedBox/index.js +0 -23
- package/SizedBox/styles.js +0 -7
- package/TextInput/index.js +0 -225
- package/TextInput/styles.js +0 -55
package/Navigation/index.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {NavigationContainer,
|
|
2
|
-
import ScreenContainer from '
|
|
1
|
+
import {NavigationContainer, ApplicationContext} from './NavigationContainer';
|
|
2
|
+
import ScreenContainer from '../Layout/ScreenContainer';
|
|
3
3
|
import NavigationButton from './NavigationButton';
|
|
4
|
+
import {HeaderRightAction} from './Components';
|
|
4
5
|
|
|
5
6
|
export {
|
|
6
7
|
NavigationContainer,
|
|
7
|
-
|
|
8
|
+
ApplicationContext,
|
|
8
9
|
ScreenContainer,
|
|
9
10
|
NavigationButton,
|
|
11
|
+
HeaderRightAction,
|
|
10
12
|
};
|
package/Navigation/types.ts
CHANGED
|
@@ -1,42 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React
|
|
1
|
+
import {ViewProps} from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import Navigator from './Navigator';
|
|
4
|
-
import {Source} from 'react-native-fast-image';
|
|
5
4
|
import Navigation from './Navigation';
|
|
6
5
|
|
|
7
6
|
export type Theme = {
|
|
8
7
|
dark: boolean;
|
|
9
8
|
colors: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
primary: string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
background: {
|
|
12
|
+
default: string;
|
|
13
|
+
surface: string;
|
|
14
|
+
tonal: string;
|
|
15
|
+
pressed: string;
|
|
16
|
+
selected: string;
|
|
17
|
+
disable: string;
|
|
18
|
+
};
|
|
19
|
+
text: {
|
|
20
|
+
default: string;
|
|
21
|
+
secondary: string;
|
|
22
|
+
hint: string;
|
|
23
|
+
disable: string;
|
|
24
|
+
};
|
|
25
|
+
border: {
|
|
26
|
+
default: string;
|
|
27
|
+
disable: string;
|
|
28
|
+
};
|
|
29
|
+
success: {
|
|
30
|
+
primary: string;
|
|
31
|
+
secondary: string;
|
|
32
|
+
container: string;
|
|
33
|
+
};
|
|
34
|
+
warning: {
|
|
35
|
+
primary: string;
|
|
36
|
+
secondary: string;
|
|
37
|
+
container: string;
|
|
38
|
+
};
|
|
39
|
+
error: {
|
|
40
|
+
primary: string;
|
|
41
|
+
secondary: string;
|
|
42
|
+
container: string;
|
|
43
|
+
};
|
|
44
|
+
highlight: {
|
|
45
|
+
primary: string;
|
|
46
|
+
secondary: string;
|
|
47
|
+
container: string;
|
|
48
|
+
};
|
|
49
|
+
interactive: {
|
|
50
|
+
primary: string;
|
|
51
|
+
secondary: string;
|
|
52
|
+
container: string;
|
|
53
|
+
};
|
|
36
54
|
};
|
|
37
55
|
font: string;
|
|
38
56
|
assets?: {
|
|
39
|
-
headerBackground?:
|
|
57
|
+
headerBackground?: string;
|
|
40
58
|
};
|
|
41
59
|
};
|
|
42
60
|
|
|
@@ -46,20 +64,19 @@ export type Context = {
|
|
|
46
64
|
};
|
|
47
65
|
|
|
48
66
|
export type NavigationContainerProps = {
|
|
49
|
-
useNative?: boolean;
|
|
50
67
|
screen: React.ElementType;
|
|
68
|
+
isBottomSheet?: boolean;
|
|
51
69
|
theme: Theme;
|
|
52
|
-
onDismiss
|
|
70
|
+
onDismiss?: () => void;
|
|
53
71
|
};
|
|
54
72
|
|
|
55
|
-
export
|
|
56
|
-
style?: ViewStyle;
|
|
57
|
-
children: ReactNode;
|
|
73
|
+
export interface ScreenContainerProps extends ViewProps {
|
|
58
74
|
navigation: Navigation;
|
|
59
75
|
options?: NavigationOptions;
|
|
60
76
|
edges?: any[];
|
|
61
77
|
enableKeyboardAvoidingView?: boolean;
|
|
62
|
-
|
|
78
|
+
scrollable: boolean;
|
|
79
|
+
}
|
|
63
80
|
|
|
64
81
|
export type ScreenParams = {
|
|
65
82
|
[key: string]: any;
|
package/Navigation/utils.tsx
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {Colors, NavigationButton, Text, Theme} from '../index';
|
|
3
|
-
import {HeaderBackground} from './Components';
|
|
4
2
|
import {
|
|
5
3
|
StackNavigationOptions,
|
|
6
4
|
TransitionPresets,
|
|
7
5
|
} from '@react-navigation/stack';
|
|
6
|
+
import {HeaderBackground} from './Components';
|
|
7
|
+
import {Theme} from './types';
|
|
8
|
+
import {Colors} from '../Consts';
|
|
9
|
+
import {NavigationButton} from './index';
|
|
10
|
+
import {Text} from '../Text';
|
|
8
11
|
|
|
9
12
|
const renderTitle = (props: any) => {
|
|
10
13
|
return (
|
|
11
14
|
<Text
|
|
12
15
|
{...props}
|
|
13
|
-
typography="
|
|
16
|
+
typography="headerText_default"
|
|
14
17
|
weight="bold"
|
|
15
|
-
|
|
18
|
+
color={props.tintColor}
|
|
16
19
|
/>
|
|
17
20
|
);
|
|
18
21
|
};
|
|
19
22
|
|
|
20
|
-
const
|
|
23
|
+
const getTintColor = (theme: Theme): any => {
|
|
21
24
|
if (theme.assets?.headerBackground) {
|
|
22
25
|
return {
|
|
23
|
-
|
|
26
|
+
headerTintColor: Colors.black_01,
|
|
24
27
|
};
|
|
25
28
|
}
|
|
29
|
+
return {
|
|
30
|
+
headerTintColor: theme.colors.text.default,
|
|
31
|
+
};
|
|
26
32
|
};
|
|
27
33
|
|
|
28
34
|
const getStackOptions = (
|
|
29
35
|
theme: Theme,
|
|
30
|
-
|
|
36
|
+
options: StackNavigationOptions,
|
|
31
37
|
): StackNavigationOptions => {
|
|
32
38
|
return {
|
|
33
|
-
headerTintColor: Colors.black_01,
|
|
34
39
|
headerTitleAlign: 'center',
|
|
35
40
|
headerTitle: renderTitle,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
...getHeaderBackground(theme),
|
|
41
|
+
headerBackground: HeaderBackground,
|
|
42
|
+
...getTintColor(theme),
|
|
43
|
+
...options,
|
|
40
44
|
};
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
const getDialogOptions = (
|
|
44
48
|
theme: Theme,
|
|
45
|
-
|
|
49
|
+
options: StackNavigationOptions,
|
|
46
50
|
): StackNavigationOptions => {
|
|
47
51
|
return {
|
|
48
|
-
headerTintColor: Colors.black_01,
|
|
49
52
|
headerTitleAlign: 'center',
|
|
50
53
|
headerTitle: renderTitle,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
),
|
|
54
|
+
headerBackground: HeaderBackground,
|
|
55
|
+
...getTintColor(theme),
|
|
54
56
|
...TransitionPresets.ModalTransition,
|
|
55
|
-
...
|
|
57
|
+
...options,
|
|
56
58
|
};
|
|
57
59
|
};
|
|
58
60
|
|
package/Radio/index.tsx
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
|
+
import {TouchableOpacity, View} from 'react-native';
|
|
3
|
+
import {ApplicationContext} from '../index';
|
|
4
|
+
import {RadioProps} from './types';
|
|
5
|
+
import {Text} from '../Text';
|
|
6
|
+
import styles from './styles';
|
|
7
|
+
|
|
8
|
+
const Radio: FC<RadioProps> = props => {
|
|
9
|
+
const {theme} = useContext(ApplicationContext);
|
|
10
|
+
const {value, groupValue, disabled, onChange, label} = props;
|
|
11
|
+
|
|
12
|
+
const selected = value === groupValue;
|
|
13
|
+
const borderWidth = selected ? 6 : 2;
|
|
14
|
+
let borderColor = selected ? theme.colors.primary : theme.colors.text.default;
|
|
15
|
+
if (disabled) {
|
|
16
|
+
borderColor = selected
|
|
17
|
+
? theme.colors.background.tonal
|
|
18
|
+
: theme.colors.text.disable;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<TouchableOpacity
|
|
23
|
+
onPress={onChange}
|
|
24
|
+
disabled={disabled}
|
|
25
|
+
style={{
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
}}>
|
|
28
|
+
<View style={[styles.radio, {borderWidth, borderColor}]} />
|
|
29
|
+
<Text typography={'description_default'}>{label}</Text>
|
|
30
|
+
</TouchableOpacity>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {Radio};
|
package/Radio/styles.ts
ADDED
package/Radio/types.ts
ADDED
package/Switch/index.tsx
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, {FC, useContext} from 'react';
|
|
2
|
+
import {TouchableOpacity, View} from 'react-native';
|
|
3
|
+
import {SwitchProps} from './types';
|
|
4
|
+
import styles from './styles';
|
|
5
|
+
import {ApplicationContext} from '../Navigation';
|
|
6
|
+
import {Colors} from '../Consts';
|
|
7
|
+
|
|
8
|
+
const Switch: FC<SwitchProps> = props => {
|
|
9
|
+
const {theme} = useContext(ApplicationContext);
|
|
10
|
+
const {value, onChange, disabled} = props;
|
|
11
|
+
|
|
12
|
+
let backgroundColor = value ? theme.colors.primary : Colors.black_07;
|
|
13
|
+
|
|
14
|
+
const circleBackgroundColor = value ? Colors.black_01 : Colors.black_03;
|
|
15
|
+
if (disabled) {
|
|
16
|
+
backgroundColor = value ? theme.colors.background.tonal : Colors.black_05;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const circleAlign = value ? 'flex-end' : 'flex-start';
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<TouchableOpacity
|
|
23
|
+
disabled={disabled}
|
|
24
|
+
onPress={() => onChange?.(!value)}
|
|
25
|
+
style={[styles.container, {backgroundColor, alignItems: circleAlign}]}>
|
|
26
|
+
<View style={[styles.circle, {backgroundColor: circleBackgroundColor}]}>
|
|
27
|
+
<View style={[styles.circleSmall, {backgroundColor}]} />
|
|
28
|
+
</View>
|
|
29
|
+
</TouchableOpacity>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
Switch.defaultProps = {
|
|
34
|
+
value: false,
|
|
35
|
+
disabled: false,
|
|
36
|
+
};
|
|
37
|
+
export {Switch};
|
package/Switch/styles.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
container: {
|
|
5
|
+
width: 38,
|
|
6
|
+
height: 24,
|
|
7
|
+
borderRadius: 20,
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
paddingHorizontal: 4,
|
|
10
|
+
},
|
|
11
|
+
circle: {
|
|
12
|
+
width: 14,
|
|
13
|
+
height: 14,
|
|
14
|
+
borderRadius: 8,
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
},
|
|
18
|
+
circleSmall: {
|
|
19
|
+
width: 6,
|
|
20
|
+
height: 6,
|
|
21
|
+
borderRadius: 4,
|
|
22
|
+
},
|
|
23
|
+
});
|
package/Switch/types.ts
ADDED
package/Text/index.tsx
CHANGED
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
NavigationContext,
|
|
5
|
-
// FontWeight,
|
|
6
|
-
TextProps,
|
|
7
|
-
Typography,
|
|
8
|
-
TypographyWeight,
|
|
9
|
-
} from '../index';
|
|
2
|
+
import {Text as RNText} from 'react-native';
|
|
10
3
|
import styles from './styles';
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
};
|
|
4
|
+
import {TextProps, Typography, TypographyWeight} from './types';
|
|
5
|
+
import {ApplicationContext} from '../Navigation';
|
|
39
6
|
|
|
40
7
|
const SFProText: TypographyWeight = {
|
|
41
8
|
100: 'Thin',
|
|
@@ -52,103 +19,55 @@ const SFProText: TypographyWeight = {
|
|
|
52
19
|
};
|
|
53
20
|
|
|
54
21
|
const FontStyle: {[key: string]: string} = {
|
|
55
|
-
normal: '',
|
|
56
22
|
italic: 'Italic',
|
|
23
|
+
normal: '',
|
|
57
24
|
};
|
|
58
25
|
|
|
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
26
|
const Text: React.FC<TextProps> = ({
|
|
85
27
|
typography,
|
|
86
|
-
// weight,
|
|
87
28
|
color,
|
|
88
|
-
// fontStyle,
|
|
89
29
|
children,
|
|
90
|
-
|
|
30
|
+
textAlign,
|
|
91
31
|
...rest
|
|
92
32
|
}) => {
|
|
93
|
-
const {theme} = useContext(
|
|
33
|
+
const {theme} = useContext(ApplicationContext);
|
|
94
34
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
*/
|
|
99
|
-
const getTypography = (value: Typography) => {
|
|
100
|
-
const typo: {
|
|
101
|
-
[key: string]: object;
|
|
35
|
+
const getTypoStyle = (typo: Typography) => {
|
|
36
|
+
const styleSheet: {
|
|
37
|
+
[key: string]: any;
|
|
102
38
|
} = styles;
|
|
103
|
-
|
|
104
|
-
|
|
39
|
+
const typoStyle = styleSheet[typo] ?? styleSheet.paragraph_default;
|
|
40
|
+
const {fontWeight, fontSize, fontStyle, lineHeight} = typoStyle;
|
|
41
|
+
let fontFamily: string;
|
|
42
|
+
const style = FontStyle[fontStyle ?? 'normal'];
|
|
105
43
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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'};
|
|
44
|
+
switch (theme.font) {
|
|
45
|
+
case 'SFProText': {
|
|
46
|
+
fontFamily = `${theme.font}-${SFProText[fontWeight]}${style}`;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
50
|
+
fontFamily = `SFProText-${SFProText[fontWeight]}${style}`;
|
|
51
|
+
}
|
|
133
52
|
}
|
|
134
|
-
};
|
|
135
|
-
*/
|
|
136
53
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
54
|
+
return {
|
|
55
|
+
fontFamily,
|
|
56
|
+
fontSize,
|
|
57
|
+
lineHeight,
|
|
58
|
+
fontStyle,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
143
61
|
|
|
144
|
-
textStyle
|
|
145
|
-
fontFamily: textStyle.fontFamily,
|
|
146
|
-
// fontWeight: textStyle.fontWeight,
|
|
147
|
-
// fontStyle,
|
|
148
|
-
});
|
|
62
|
+
const textStyle = getTypoStyle(typography);
|
|
149
63
|
|
|
150
64
|
return (
|
|
151
|
-
<RNText
|
|
65
|
+
<RNText
|
|
66
|
+
{...rest}
|
|
67
|
+
style={[
|
|
68
|
+
textStyle,
|
|
69
|
+
{color: color ?? theme.colors.text.default, textAlign},
|
|
70
|
+
]}>
|
|
152
71
|
{children ?? ''}
|
|
153
72
|
</RNText>
|
|
154
73
|
);
|
|
@@ -156,9 +75,6 @@ const Text: React.FC<TextProps> = ({
|
|
|
156
75
|
|
|
157
76
|
Text.defaultProps = {
|
|
158
77
|
typography: 'paragraph_default',
|
|
159
|
-
// weight: 'regular',
|
|
160
|
-
color: undefined,
|
|
161
|
-
// fontStyle: 'normal',
|
|
162
78
|
};
|
|
163
79
|
|
|
164
|
-
export {Text
|
|
80
|
+
export {Text};
|
package/Text/styles.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
2
|
+
headline_default: {
|
|
3
3
|
fontSize: 28,
|
|
4
4
|
lineHeight: 34,
|
|
5
5
|
fontWeight: '600',
|
|
6
6
|
},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
19
|
fontSize: 15,
|
|
20
20
|
lineHeight: 22,
|
|
21
21
|
fontWeight: '400',
|
|
22
22
|
fontStyle: 'italic',
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
+
action_s: {fontSize: 15, lineHeight: 22, fontWeight: '700'},
|
|
34
35
|
};
|
package/Text/types.ts
CHANGED
package/index.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SafeAreaView,
|
|
3
|
+
useSafeAreaInsets,
|
|
4
|
+
SafeAreaProvider,
|
|
5
|
+
} from 'react-native-safe-area-context';
|
|
6
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
1
7
|
import Button from './Button';
|
|
2
8
|
|
|
3
9
|
export {Button};
|
|
4
10
|
|
|
5
|
-
export
|
|
11
|
+
export {SafeAreaView, useSafeAreaInsets, SafeAreaProvider, LinearGradient};
|
|
12
|
+
|
|
6
13
|
export * from './Consts';
|
|
14
|
+
export * from './Layout';
|
|
15
|
+
export * from './Layout/types';
|
|
7
16
|
export * from './Text';
|
|
8
17
|
export * from './Text/types';
|
|
9
18
|
export * from './Navigation';
|
|
@@ -16,3 +25,11 @@ export * from './Image';
|
|
|
16
25
|
export * from './Image/types';
|
|
17
26
|
export * from './ContentLoader';
|
|
18
27
|
export * from './ContentLoader/types';
|
|
28
|
+
export * from './Input';
|
|
29
|
+
export * from './Input/types';
|
|
30
|
+
export * from './CheckBox';
|
|
31
|
+
export * from './CheckBox/types';
|
|
32
|
+
export * from './Radio';
|
|
33
|
+
export * from './Radio/types';
|
|
34
|
+
export * from './Switch';
|
|
35
|
+
export * from './Switch/types';
|
package/package.json
CHANGED
package/publish.sh
CHANGED
|
@@ -4,7 +4,6 @@ mkdir dist
|
|
|
4
4
|
|
|
5
5
|
cp . ./dist
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
# GET VERSION from mck_package.json
|
|
9
8
|
VERSIONSTRING=( v$(jq .version package.json) )
|
|
10
9
|
VERSION=(${VERSIONSTRING//[\"]/})
|
|
@@ -12,15 +11,18 @@ echo VERSION: $VERSION
|
|
|
12
11
|
|
|
13
12
|
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
14
13
|
|
|
15
|
-
#babel component to dist
|
|
14
|
+
# #babel component to dist
|
|
16
15
|
#babel ./dist -d dist --copy-files
|
|
17
16
|
|
|
17
|
+
#copy option
|
|
18
|
+
#cp -r ./src/ dist
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
#npm login
|
|
22
|
+
#publish dist to npm
|
|
18
23
|
cd dist
|
|
19
24
|
npm publish --tag beta --access=public
|
|
20
|
-
|
|
21
|
-
#clear dist and package json
|
|
22
25
|
cd ..
|
|
23
26
|
rm -rf dist
|
|
24
27
|
|
|
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"}'
|
|
28
|
+
#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/foundation new version release: '*"$VERSION"*' https://www.npmjs.com/package/@momo-kits/foundation"}'
|