@momo-kits/foundation 0.75.1-beta.9 → 0.75.3-beta.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.
Files changed (113) hide show
  1. package/Application/BottomSheet.tsx +225 -0
  2. package/Application/BottomTab/BottomTabBar.tsx +291 -0
  3. package/Application/BottomTab/index.tsx +138 -0
  4. package/Application/Components.tsx +555 -0
  5. package/Application/ModalScreen.tsx +97 -0
  6. package/Application/Navigation.ts +50 -0
  7. package/Application/NavigationContainer.tsx +121 -0
  8. package/Application/Navigator.ts +151 -0
  9. package/Application/StackScreen.tsx +148 -0
  10. package/Application/index.ts +37 -0
  11. package/{Navigation → Application}/types.ts +101 -33
  12. package/Application/utils.tsx +153 -0
  13. package/Assets/DotAnimation.json +256 -0
  14. package/Assets/SpinnerAnimation.json +1027 -0
  15. package/Assets/icon.json +89 -5
  16. package/Assets/icon_bank.json +506 -0
  17. package/Assets/language.json +202 -0
  18. package/Badge/Badge.tsx +56 -0
  19. package/Badge/BadgeDot.tsx +11 -0
  20. package/Badge/BadgeRibbon.tsx +125 -0
  21. package/Badge/Shape.tsx +29 -0
  22. package/Badge/index.tsx +7 -0
  23. package/Badge/styles.ts +58 -0
  24. package/Badge/types.ts +63 -0
  25. package/Button/index.tsx +91 -40
  26. package/Button/styles.ts +19 -0
  27. package/CheckBox/index.tsx +58 -43
  28. package/CheckBox/styles.ts +1 -1
  29. package/CheckBox/types.ts +6 -4
  30. package/Consts/colors+spacing+radius.ts +18 -0
  31. package/Consts/styles.ts +0 -26
  32. package/Consts/theme.ts +5 -1
  33. package/Divider/index.tsx +3 -1
  34. package/Icon/index.tsx +15 -10
  35. package/Icon/types.ts +4 -3
  36. package/IconButton/index.tsx +24 -15
  37. package/Image/index.tsx +63 -45
  38. package/Image/styles.ts +1 -9
  39. package/Image/types.ts +5 -1
  40. package/Input/Input.tsx +227 -115
  41. package/Input/InputDropDown.tsx +132 -0
  42. package/Input/InputMoney.tsx +173 -110
  43. package/Input/InputOTP.tsx +257 -0
  44. package/Input/InputSearch.tsx +160 -130
  45. package/Input/InputTextArea.tsx +149 -121
  46. package/Input/common.tsx +36 -18
  47. package/Input/index.tsx +212 -17
  48. package/Input/styles.ts +44 -7
  49. package/Input/utils.ts +2 -2
  50. package/Layout/Card.tsx +76 -37
  51. package/Layout/FloatingButton.tsx +168 -0
  52. package/Layout/GridSystem.tsx +35 -23
  53. package/Layout/Item.tsx +29 -33
  54. package/Layout/ItemList.tsx +55 -0
  55. package/Layout/ItemSectionList.tsx +39 -0
  56. package/Layout/Screen.tsx +390 -0
  57. package/Layout/Section.tsx +73 -35
  58. package/Layout/index.ts +13 -3
  59. package/Layout/styles.ts +101 -0
  60. package/Layout/types.ts +1 -37
  61. package/Layout/utils.ts +38 -43
  62. package/Loader/DotLoader.tsx +37 -0
  63. package/Loader/Loader.tsx +13 -0
  64. package/Loader/ProgressBar.tsx +44 -0
  65. package/Loader/Spinner.tsx +29 -0
  66. package/Loader/index.tsx +4 -0
  67. package/Loader/styles.ts +10 -0
  68. package/Loader/types.ts +35 -0
  69. package/Loader/utils.ts +25 -0
  70. package/Pagination/Dot.tsx +1 -1
  71. package/Pagination/PaginationDot.tsx +8 -3
  72. package/Pagination/PaginationNumber.tsx +8 -7
  73. package/Pagination/PaginationScroll.tsx +1 -1
  74. package/Pagination/PaginationWhiteDot.tsx +8 -5
  75. package/Pagination/styles.ts +3 -0
  76. package/Pagination/types.ts +2 -0
  77. package/Popup/PopupNotify.tsx +108 -46
  78. package/Popup/PopupPromotion.tsx +63 -22
  79. package/Popup/types.ts +15 -4
  80. package/Radio/index.tsx +35 -21
  81. package/Radio/types.ts +7 -5
  82. package/Skeleton/index.tsx +1 -1
  83. package/Skeleton/types.ts +3 -0
  84. package/Switch/index.tsx +35 -24
  85. package/Switch/types.ts +5 -3
  86. package/Tag/index.tsx +1 -1
  87. package/Text/index.tsx +32 -26
  88. package/Text/styles.ts +38 -0
  89. package/Text/types.ts +25 -13
  90. package/Text/utils.ts +14 -0
  91. package/Title/index.tsx +197 -0
  92. package/Title/styles.ts +79 -0
  93. package/Title/types.ts +20 -0
  94. package/code-scanner.js +143 -0
  95. package/index.ts +22 -2
  96. package/migrate_typo.js +56 -0
  97. package/package.json +44 -39
  98. package/publish.sh +2 -5
  99. package/tsconfig.json +24 -0
  100. package/verify.js +47 -0
  101. package/Assets/header-background.png +0 -0
  102. package/Layout/ScreenContainer.tsx +0 -121
  103. package/Navigation/BottomTab.tsx +0 -39
  104. package/Navigation/Components.tsx +0 -365
  105. package/Navigation/ModalScreen.tsx +0 -226
  106. package/Navigation/Navigation.ts +0 -44
  107. package/Navigation/NavigationButton.tsx +0 -54
  108. package/Navigation/NavigationContainer.tsx +0 -77
  109. package/Navigation/Navigator.ts +0 -82
  110. package/Navigation/Observer.ts +0 -79
  111. package/Navigation/StackScreen.tsx +0 -27
  112. package/Navigation/index.ts +0 -14
  113. package/Navigation/utils.tsx +0 -137
@@ -0,0 +1,153 @@
1
+ import React from 'react';
2
+ import {
3
+ StackNavigationOptions,
4
+ TransitionPresets,
5
+ } from '@react-navigation/stack';
6
+ import {
7
+ HeaderBackground,
8
+ HeaderCustom,
9
+ HeaderLeft,
10
+ HeaderTitle,
11
+ HeaderToolkitAction,
12
+ } from './Components';
13
+ import {NavigationOptions, Theme} from './types';
14
+ import {Colors} from '../Consts';
15
+
16
+ /**
17
+ * default options for stack screen
18
+ */
19
+ const getStackOptions = (): StackNavigationOptions => {
20
+ return {
21
+ headerTitleAlign: 'left',
22
+ headerTitle: HeaderTitle,
23
+ headerBackground: (props: any) => <HeaderBackground {...props} />,
24
+ headerLeft: (props: any) => <HeaderLeft {...props} />,
25
+ headerRight: (props: any) => <HeaderToolkitAction {...props} />,
26
+ headerTintColor: Colors.black_01,
27
+ };
28
+ };
29
+
30
+ /**
31
+ * default options for dialog screen
32
+ */
33
+ const getDialogOptions = (): StackNavigationOptions => {
34
+ return {
35
+ headerTitleAlign: 'left',
36
+ headerTitle: HeaderTitle,
37
+ headerLeft: (props: any) => <HeaderLeft {...props} />,
38
+ headerBackground: (props: any) => <HeaderBackground {...props} />,
39
+ headerTintColor: Colors.black_01,
40
+ ...TransitionPresets.ModalTransition,
41
+ };
42
+ };
43
+
44
+ /**
45
+ * default options for modal screen
46
+ */
47
+ const getModalOptions = (): StackNavigationOptions => {
48
+ return {
49
+ headerShown: false,
50
+ headerBackground: undefined,
51
+ cardStyle: {backgroundColor: 'transparent'},
52
+ cardOverlayEnabled: true,
53
+ animationEnabled: false,
54
+ cardStyleInterpolator: ({current: {progress}}) => ({
55
+ cardStyle: {
56
+ opacity: progress.interpolate({
57
+ inputRange: [0, 0.5, 0.9, 1],
58
+ outputRange: [0, 0.25, 0.7, 1],
59
+ }),
60
+ },
61
+ overlayStyle: {
62
+ opacity: progress.interpolate({
63
+ inputRange: [0, 0.5, 0.9, 1],
64
+ outputRange: [0, 0.2, 0.4, 0.6],
65
+ extrapolate: 'clamp',
66
+ }),
67
+ },
68
+ }),
69
+ };
70
+ };
71
+
72
+ /**
73
+ * build react-navigation options
74
+ */
75
+ const getOptions = (params: NavigationOptions, theme: Theme) => {
76
+ let options = {};
77
+
78
+ if (
79
+ typeof params.onPressLeftHeader === 'function' ||
80
+ params.preventBack !== undefined ||
81
+ typeof params.hiddenBack === 'boolean'
82
+ ) {
83
+ options = {
84
+ ...options,
85
+ headerLeft: params.hiddenBack
86
+ ? null
87
+ : (props: any) => (
88
+ <HeaderLeft
89
+ {...props}
90
+ preventBack={params.preventBack}
91
+ onPressLeftHeader={params.onPressLeftHeader}
92
+ />
93
+ ),
94
+ };
95
+ }
96
+
97
+ if (typeof params.surface == 'boolean') {
98
+ if (params.surface) {
99
+ options = {
100
+ ...options,
101
+ headerTintColor: theme.colors.text.default,
102
+ headerBackground: () => (
103
+ <HeaderBackground image={null} useSurface={true} />
104
+ ),
105
+ };
106
+ } else {
107
+ options = {
108
+ ...options,
109
+ headerTintColor: Colors.black_01,
110
+ headerBackground: HeaderBackground,
111
+ };
112
+ }
113
+ }
114
+
115
+ if (params.customTitle) {
116
+ options = {
117
+ ...options,
118
+ headerTitleAlign: 'left',
119
+ headerTitle: (props: any) => {
120
+ return <HeaderCustom {...params.customTitle} {...props} />;
121
+ },
122
+ };
123
+ }
124
+
125
+ if (params.toolkitParams) {
126
+ options = {
127
+ ...options,
128
+ headerRight: (props: any) => {
129
+ return <HeaderToolkitAction {...params.toolkitParams} {...props} />;
130
+ },
131
+ };
132
+ }
133
+
134
+ return {
135
+ ...params,
136
+ ...options,
137
+ };
138
+ };
139
+
140
+ const formatNameLength = (name = '') => {
141
+ let formattedName = name;
142
+ if (formattedName.length > 100) {
143
+ formattedName = formattedName.substring(0, 100);
144
+ }
145
+ return formattedName;
146
+ };
147
+ export {
148
+ getStackOptions,
149
+ getDialogOptions,
150
+ getModalOptions,
151
+ getOptions,
152
+ formatNameLength,
153
+ };
@@ -0,0 +1,256 @@
1
+ {
2
+ "v": "4.8.0",
3
+ "meta": {"g": "LottieFiles AE 3.2.2", "a": "", "k": "", "d": "", "tc": ""},
4
+ "fr": 60,
5
+ "ip": 10,
6
+ "op": 54,
7
+ "w": 52,
8
+ "h": 20,
9
+ "nm": "Dot 10",
10
+ "ddd": 0,
11
+ "assets": [
12
+ {
13
+ "id": "comp_0",
14
+ "layers": [
15
+ {
16
+ "ddd": 0,
17
+ "ind": 1,
18
+ "ty": 4,
19
+ "nm": "1",
20
+ "sr": 1,
21
+ "ks": {
22
+ "o": {"a": 0, "k": 100, "ix": 11},
23
+ "r": {"a": 0, "k": 0, "ix": 10},
24
+ "p": {
25
+ "a": 1,
26
+ "k": [
27
+ {
28
+ "i": {"x": 0.711, "y": 1},
29
+ "o": {"x": 0.26, "y": 0.24},
30
+ "t": 0,
31
+ "s": [-14, 11, 0],
32
+ "to": [0, -1.172, 0],
33
+ "ti": [0, -0.21, 0]
34
+ },
35
+ {
36
+ "i": {"x": 0.667, "y": 1},
37
+ "o": {"x": 0.333, "y": 0},
38
+ "t": 17,
39
+ "s": [-14, 5, 0],
40
+ "to": [0, 0.333, 0],
41
+ "ti": [0, -1, 0]
42
+ },
43
+ {
44
+ "i": {"x": 0.833, "y": 0.542},
45
+ "o": {"x": 0.333, "y": 0},
46
+ "t": 30,
47
+ "s": [-14, 13, 0],
48
+ "to": [0, 1, 0],
49
+ "ti": [0, 0.333, 0]
50
+ },
51
+ {"t": 45, "s": [-14, 11, 0]}
52
+ ],
53
+ "ix": 2
54
+ },
55
+ "a": {"a": 0, "k": [-40, 0, 0], "ix": 1},
56
+ "s": {"a": 0, "k": [100, 100, 100], "ix": 6}
57
+ },
58
+ "ao": 0,
59
+ "shapes": [
60
+ {
61
+ "ty": "gr",
62
+ "it": [
63
+ {
64
+ "d": 1,
65
+ "ty": "el",
66
+ "s": {"a": 0, "k": [12, 12], "ix": 2},
67
+ "p": {"a": 0, "k": [0, 0], "ix": 3},
68
+ "nm": "Ellipse Path 1",
69
+ "mn": "ADBE Vector Shape - Ellipse",
70
+ "hd": false
71
+ },
72
+ {
73
+ "ty": "st",
74
+ "c": {"a": 0, "k": [1, 1, 1, 1], "ix": 3},
75
+ "o": {"a": 0, "k": 100, "ix": 4},
76
+ "w": {"a": 0, "k": 0, "ix": 5},
77
+ "lc": 1,
78
+ "lj": 1,
79
+ "ml": 4,
80
+ "bm": 0,
81
+ "nm": "Stroke 1",
82
+ "mn": "ADBE Vector Graphic - Stroke",
83
+ "hd": false
84
+ },
85
+ {
86
+ "ty": "fl",
87
+ "c": {
88
+ "a": 1,
89
+ "k": [
90
+ {
91
+ "i": {"x": [0.833], "y": [0.833]},
92
+ "o": {"x": [0.167], "y": [0.167]},
93
+ "t": 0,
94
+ "s": [0.968627510819, 0.674509803922, 0.835294177485, 1]
95
+ },
96
+ {
97
+ "i": {"x": [0.833], "y": [0.833]},
98
+ "o": {"x": [0.167], "y": [0.167]},
99
+ "t": 17,
100
+ "s": [0.921568632126, 0.184313729405, 0.588235318661, 1]
101
+ },
102
+ {
103
+ "t": 35,
104
+ "s": [0.968627510819, 0.674509803922, 0.835294177485, 1]
105
+ }
106
+ ],
107
+ "ix": 4
108
+ },
109
+ "o": {"a": 0, "k": 100, "ix": 5},
110
+ "r": 1,
111
+ "bm": 0,
112
+ "nm": "Fill 1",
113
+ "mn": "ADBE Vector Graphic - Fill",
114
+ "hd": false
115
+ },
116
+ {
117
+ "ty": "tr",
118
+ "p": {"a": 0, "k": [-20, 1], "ix": 2},
119
+ "a": {"a": 0, "k": [0, 0], "ix": 1},
120
+ "s": {"a": 0, "k": [100, 100], "ix": 3},
121
+ "r": {"a": 0, "k": 0, "ix": 6},
122
+ "o": {"a": 0, "k": 100, "ix": 7},
123
+ "sk": {"a": 0, "k": 0, "ix": 4},
124
+ "sa": {"a": 0, "k": 0, "ix": 5},
125
+ "nm": "Transform"
126
+ }
127
+ ],
128
+ "nm": "Ellipse 1",
129
+ "np": 3,
130
+ "cix": 2,
131
+ "bm": 0,
132
+ "ix": 1,
133
+ "mn": "ADBE Vector Group",
134
+ "hd": false
135
+ }
136
+ ],
137
+ "ip": 0,
138
+ "op": 45,
139
+ "st": 0,
140
+ "bm": 0
141
+ }
142
+ ]
143
+ }
144
+ ],
145
+ "layers": [
146
+ {
147
+ "ddd": 0,
148
+ "ind": 1,
149
+ "ty": 0,
150
+ "nm": "Dot 0",
151
+ "refId": "comp_0",
152
+ "sr": 1,
153
+ "ks": {
154
+ "o": {"a": 0, "k": 100, "ix": 11},
155
+ "r": {"a": 0, "k": 0, "ix": 10},
156
+ "p": {"a": 0, "k": [6, 10, 0], "ix": 2},
157
+ "a": {"a": 0, "k": [-34, 10, 0], "ix": 1},
158
+ "s": {"a": 0, "k": [100, 100, 100], "ix": 6}
159
+ },
160
+ "ao": 0,
161
+ "tm": {
162
+ "a": 1,
163
+ "k": [
164
+ {
165
+ "i": {"x": [0.833], "y": [0.833]},
166
+ "o": {"x": [0.167], "y": [0.167]},
167
+ "t": 10,
168
+ "s": [0]
169
+ },
170
+ {"t": 54, "s": [0.733]}
171
+ ],
172
+ "ix": 2,
173
+ "x": "var $bm_rt;\n$bm_rt = loopOut('cycle', 0);"
174
+ },
175
+ "w": 12,
176
+ "h": 20,
177
+ "ip": 10,
178
+ "op": 90,
179
+ "st": 10,
180
+ "bm": 0
181
+ },
182
+ {
183
+ "ddd": 0,
184
+ "ind": 2,
185
+ "ty": 0,
186
+ "nm": "Dot 0",
187
+ "refId": "comp_0",
188
+ "sr": 1,
189
+ "ks": {
190
+ "o": {"a": 0, "k": 100, "ix": 11},
191
+ "r": {"a": 0, "k": 0, "ix": 10},
192
+ "p": {"a": 0, "k": [6, 10, 0], "ix": 2},
193
+ "a": {"a": 0, "k": [-14, 10, 0], "ix": 1},
194
+ "s": {"a": 0, "k": [100, 100, 100], "ix": 6}
195
+ },
196
+ "ao": 0,
197
+ "tm": {
198
+ "a": 1,
199
+ "k": [
200
+ {
201
+ "i": {"x": [0.833], "y": [0.833]},
202
+ "o": {"x": [0.167], "y": [0.167]},
203
+ "t": 5,
204
+ "s": [0]
205
+ },
206
+ {"t": 49, "s": [0.733]}
207
+ ],
208
+ "ix": 2,
209
+ "x": "var $bm_rt;\n$bm_rt = loopOut('cycle', 0);"
210
+ },
211
+ "w": 12,
212
+ "h": 20,
213
+ "ip": 5,
214
+ "op": 85,
215
+ "st": 5,
216
+ "bm": 0
217
+ },
218
+ {
219
+ "ddd": 0,
220
+ "ind": 3,
221
+ "ty": 0,
222
+ "nm": "Dot 0",
223
+ "refId": "comp_0",
224
+ "sr": 1,
225
+ "ks": {
226
+ "o": {"a": 0, "k": 100, "ix": 11},
227
+ "r": {"a": 0, "k": 0, "ix": 10},
228
+ "p": {"a": 0, "k": [6, 10, 0], "ix": 2},
229
+ "a": {"a": 0, "k": [6, 10, 0], "ix": 1},
230
+ "s": {"a": 0, "k": [100, 100, 100], "ix": 6}
231
+ },
232
+ "ao": 0,
233
+ "tm": {
234
+ "a": 1,
235
+ "k": [
236
+ {
237
+ "i": {"x": [0.833], "y": [0.833]},
238
+ "o": {"x": [0.167], "y": [0.167]},
239
+ "t": 0,
240
+ "s": [0]
241
+ },
242
+ {"t": 44, "s": [0.733]}
243
+ ],
244
+ "ix": 2,
245
+ "x": "var $bm_rt;\n$bm_rt = loopOut('cycle', 0);"
246
+ },
247
+ "w": 12,
248
+ "h": 20,
249
+ "ip": 0,
250
+ "op": 80,
251
+ "st": 0,
252
+ "bm": 0
253
+ }
254
+ ],
255
+ "markers": []
256
+ }