@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.
Files changed (62) hide show
  1. package/ActivityIndicator.tsx +244 -0
  2. package/Button/index.tsx +94 -164
  3. package/Button/types.ts +12 -3
  4. package/CheckBox/index.tsx +57 -0
  5. package/CheckBox/styles.ts +14 -0
  6. package/CheckBox/types.ts +7 -0
  7. package/Consts/colors+spacing+radius.ts +6 -4
  8. package/Consts/index.ts +4 -73
  9. package/Consts/styles.ts +1 -1
  10. package/Consts/theme.ts +65 -0
  11. package/ContentLoader/index.tsx +8 -11
  12. package/Icon/index.tsx +11 -11
  13. package/Icon/types.ts +1 -4
  14. package/IconButton/index.tsx +52 -72
  15. package/IconButton/styles.ts +19 -0
  16. package/IconButton/types.ts +1 -2
  17. package/Image/index.tsx +19 -18
  18. package/Image/types.ts +0 -1
  19. package/Input/TextArea.tsx +202 -0
  20. package/Input/index.tsx +200 -0
  21. package/Input/styles.ts +92 -0
  22. package/Input/types.ts +23 -0
  23. package/Layout/GridSystem.tsx +109 -0
  24. package/Layout/ScreenContainer.tsx +78 -0
  25. package/Layout/ScreenSection.tsx +104 -0
  26. package/Layout/SectionItem.tsx +60 -0
  27. package/Layout/index.ts +11 -5
  28. package/Layout/types.ts +6 -33
  29. package/Layout/utils.ts +55 -23
  30. package/Navigation/Components.tsx +16 -8
  31. package/Navigation/ModalScreen.tsx +35 -25
  32. package/Navigation/Navigation.ts +2 -2
  33. package/Navigation/NavigationButton.tsx +5 -3
  34. package/Navigation/NavigationContainer.tsx +59 -17
  35. package/Navigation/StackScreen.tsx +8 -2
  36. package/Navigation/index.ts +5 -3
  37. package/Navigation/types.ts +53 -36
  38. package/Navigation/utils.tsx +20 -18
  39. package/Radio/index.tsx +34 -0
  40. package/Radio/styles.ts +11 -0
  41. package/Radio/types.ts +7 -0
  42. package/Switch/index.tsx +37 -0
  43. package/Switch/styles.ts +23 -0
  44. package/Switch/types.ts +5 -0
  45. package/Text/index.tsx +36 -120
  46. package/Text/styles.ts +24 -23
  47. package/Text/types.ts +2 -0
  48. package/index.ts +18 -1
  49. package/package.json +1 -1
  50. package/publish.sh +8 -6
  51. package/CheckBox/index.js +0 -74
  52. package/CheckBox/styles.js +0 -3
  53. package/Layout/Row.tsx +0 -42
  54. package/Layout/Screen.tsx +0 -68
  55. package/Layout/Section.tsx +0 -30
  56. package/Layout/View.tsx +0 -84
  57. package/Layout/styles.ts +0 -24
  58. package/Navigation/ScreenContainer.tsx +0 -38
  59. package/SizedBox/index.js +0 -23
  60. package/SizedBox/styles.js +0 -7
  61. package/TextInput/index.js +0 -225
  62. package/TextInput/styles.js +0 -55
@@ -1,10 +1,12 @@
1
- import {NavigationContainer, NavigationContext} from './NavigationContainer';
2
- import ScreenContainer from './ScreenContainer';
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
- NavigationContext,
8
+ ApplicationContext,
8
9
  ScreenContainer,
9
10
  NavigationButton,
11
+ HeaderRightAction,
10
12
  };
@@ -1,42 +1,60 @@
1
- import {ViewStyle} from 'react-native';
2
- import React, {ReactNode} from '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
- background_default: string;
11
- background_surface: string;
12
- background_pressed: string;
13
- background_selected: string;
14
- background_disable: string;
15
- background_primary: string;
16
- background_tonal: string;
17
- text_default: string;
18
- text_secondary: string;
19
- text_hint: string;
20
- text_disable: string;
21
- text_white: string;
22
- text_primary: string;
23
- text_interactive: string;
24
- text_highlight: string;
25
- text_success: string;
26
- text_warning: string;
27
- text_error: string;
28
- border_default: string;
29
- border_disable: string;
30
- border_primary: string;
31
- border_primary_disable: string;
32
- border_error: string;
33
- border_error_disable: string;
34
- border_success: string;
35
- border_success_disable: string;
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?: Source | number;
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: () => void;
70
+ onDismiss?: () => void;
53
71
  };
54
72
 
55
- export type ScreenContainerProps = {
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;
@@ -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="h4"
16
+ typography="headerText_default"
14
17
  weight="bold"
15
- style={{color: props.tintColor}}
18
+ color={props.tintColor}
16
19
  />
17
20
  );
18
21
  };
19
22
 
20
- const getHeaderBackground = (theme: Theme): any => {
23
+ const getTintColor = (theme: Theme): any => {
21
24
  if (theme.assets?.headerBackground) {
22
25
  return {
23
- headerBackground: HeaderBackground,
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
- goBack: () => void,
36
+ options: StackNavigationOptions,
31
37
  ): StackNavigationOptions => {
32
38
  return {
33
- headerTintColor: Colors.black_01,
34
39
  headerTitleAlign: 'center',
35
40
  headerTitle: renderTitle,
36
- headerLeft: props => (
37
- <NavigationButton icon="ic_back" {...props} onPress={goBack} />
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
- goBack: () => void,
49
+ options: StackNavigationOptions,
46
50
  ): StackNavigationOptions => {
47
51
  return {
48
- headerTintColor: Colors.black_01,
49
52
  headerTitleAlign: 'center',
50
53
  headerTitle: renderTitle,
51
- headerLeft: props => (
52
- <NavigationButton icon="ic_close" {...props} onPress={goBack} />
53
- ),
54
+ headerBackground: HeaderBackground,
55
+ ...getTintColor(theme),
54
56
  ...TransitionPresets.ModalTransition,
55
- ...getHeaderBackground(theme),
57
+ ...options,
56
58
  };
57
59
  };
58
60
 
@@ -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};
@@ -0,0 +1,11 @@
1
+ import {StyleSheet} from 'react-native';
2
+ import {Radius, Spacing} from '../Consts';
3
+
4
+ export default StyleSheet.create({
5
+ radio: {
6
+ height: 20,
7
+ width: 20,
8
+ borderRadius: Radius.M,
9
+ },
10
+ container: {flex: 1, backgroundColor: 'red'},
11
+ });
package/Radio/types.ts ADDED
@@ -0,0 +1,7 @@
1
+ export interface RadioProps {
2
+ value: string;
3
+ disabled?: boolean;
4
+ label?: string;
5
+ onChange: () => void;
6
+ groupValue: string;
7
+ }
@@ -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};
@@ -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
+ });
@@ -0,0 +1,5 @@
1
+ export interface SwitchProps {
2
+ value: boolean;
3
+ onChange: (value: boolean) => void;
4
+ disabled: boolean;
5
+ }
package/Text/index.tsx CHANGED
@@ -1,41 +1,8 @@
1
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';
2
+ import {Text as RNText} from 'react-native';
10
3
  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
- };
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
- style,
30
+ textAlign,
91
31
  ...rest
92
32
  }) => {
93
- const {theme} = useContext(NavigationContext);
33
+ const {theme} = useContext(ApplicationContext);
94
34
 
95
- /**
96
- * typography style
97
- * @return {*}
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
- return typo[value];
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
- * 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'};
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
- const textStyle: any = StyleSheet.flatten([
138
- {fontFamily: theme.font, color: color ?? theme.colors},
139
- getTypography(typography),
140
- // getFontWeight(weight),
141
- style,
142
- ]);
54
+ return {
55
+ fontFamily,
56
+ fontSize,
57
+ lineHeight,
58
+ fontStyle,
59
+ };
60
+ };
143
61
 
144
- textStyle.fontFamily = getFontFamily({
145
- fontFamily: textStyle.fontFamily,
146
- // fontWeight: textStyle.fontWeight,
147
- // fontStyle,
148
- });
62
+ const textStyle = getTypoStyle(typography);
149
63
 
150
64
  return (
151
- <RNText {...rest} style={textStyle}>
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, getFontFamily};
80
+ export {Text};
package/Text/styles.ts CHANGED
@@ -1,34 +1,35 @@
1
1
  export default {
2
- 'headline-default': {
2
+ headline_default: {
3
3
  fontSize: 28,
4
4
  lineHeight: 34,
5
5
  fontWeight: '600',
6
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': {
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
- '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'},
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
@@ -41,7 +41,9 @@ export type Typography =
41
41
  | 'action_xs'
42
42
  | 'action_s';
43
43
 
44
+ export type TextAlign = 'left' | 'right' | 'center' | 'auto';
44
45
  export interface TextProps extends RNTextProps {
45
46
  typography: Typography;
46
47
  color?: string;
48
+ textAlign?: TextAlign;
47
49
  }
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 * from './Layout';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {
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"}'