@momo-kits/foundation 0.81.1-beta.6 → 0.81.1-optimize.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/Application/BottomTab.tsx +76 -23
- package/Application/Components.tsx +243 -198
- package/Application/ModalScreen.tsx +20 -65
- package/Application/Navigation.ts +15 -4
- package/Application/NavigationContainer.tsx +20 -20
- package/Application/Navigator.ts +61 -28
- package/Application/StackScreen.tsx +41 -23
- package/Application/index.ts +16 -6
- package/Application/types.ts +34 -19
- package/Application/utils.tsx +26 -0
- package/Assets/icon.json +83 -5
- package/Assets/icon_bank.json +506 -0
- package/Assets/language.json +3 -1
- package/Badge/Badge.tsx +56 -0
- package/Badge/BadgeDot.tsx +11 -0
- package/Badge/BadgeRibbon.tsx +125 -0
- package/Badge/Shape.tsx +29 -0
- package/Badge/index.tsx +7 -0
- package/Badge/styles.ts +58 -0
- package/Badge/types.ts +63 -0
- package/Button/index.tsx +26 -9
- package/Button/styles.ts +19 -0
- package/CheckBox/index.tsx +1 -2
- package/Consts/colors+spacing+radius.ts +3 -3
- package/Icon/index.tsx +7 -3
- package/Icon/types.ts +3 -3
- package/IconButton/index.tsx +0 -1
- package/Image/index.tsx +39 -49
- package/Image/styles.ts +1 -9
- package/Image/types.ts +3 -1
- package/Input/Input.tsx +37 -16
- package/Input/InputDropDown.tsx +5 -14
- package/Input/InputMoney.tsx +28 -11
- package/Input/InputOTP.tsx +169 -145
- package/Input/InputSearch.tsx +9 -13
- package/Input/InputTextArea.tsx +6 -12
- package/Input/common.tsx +5 -3
- package/Input/index.tsx +15 -9
- package/Input/styles.ts +1 -4
- package/Layout/Card.tsx +20 -11
- package/Layout/GridSystem.tsx +1 -2
- package/Layout/Item.tsx +0 -1
- package/Layout/ItemList.tsx +39 -40
- package/Layout/ItemSectionList.tsx +39 -0
- package/Layout/Screen.tsx +96 -45
- package/Layout/Section.tsx +17 -19
- package/Layout/index.ts +2 -1
- package/Layout/styles.ts +16 -15
- package/Layout/types.ts +2 -5
- package/Pagination/PaginationNumber.tsx +1 -1
- package/Pagination/PaginationScroll.tsx +0 -1
- package/Popup/PopupNotify.tsx +71 -14
- package/Popup/PopupPromotion.tsx +43 -6
- package/Popup/types.ts +12 -3
- package/Radio/index.tsx +1 -2
- package/Skeleton/index.tsx +1 -1
- package/Switch/index.tsx +0 -1
- package/Tag/index.tsx +2 -4
- package/Text/index.tsx +3 -2
- package/Text/styles.ts +38 -0
- package/Text/types.ts +25 -13
- package/Title/index.tsx +82 -38
- package/Title/styles.ts +16 -10
- package/Title/types.ts +2 -1
- package/index.ts +2 -0
- package/package.json +6 -6
- package/verify.js +15 -0
package/Layout/Section.tsx
CHANGED
|
@@ -22,11 +22,6 @@ export interface SectionProps extends ViewProps {
|
|
|
22
22
|
*/
|
|
23
23
|
useMargin?: boolean;
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Optional. Background color for the Section component.
|
|
27
|
-
*/
|
|
28
|
-
backgroundColor?: string;
|
|
29
|
-
|
|
30
25
|
/**
|
|
31
26
|
* Optional. Background image for the Section component.
|
|
32
27
|
*/
|
|
@@ -36,8 +31,9 @@ export interface SectionProps extends ViewProps {
|
|
|
36
31
|
const Section: React.FC<SectionProps> = ({
|
|
37
32
|
children,
|
|
38
33
|
useMargin = true,
|
|
39
|
-
backgroundColor,
|
|
40
34
|
backgroundImage,
|
|
35
|
+
style,
|
|
36
|
+
...props
|
|
41
37
|
}) => {
|
|
42
38
|
const {showGrid} = useContext(ApplicationContext);
|
|
43
39
|
const {numberOfColumns} = useGridSystem();
|
|
@@ -55,7 +51,6 @@ const Section: React.FC<SectionProps> = ({
|
|
|
55
51
|
const gridContext: GridContextProps = {
|
|
56
52
|
numberOfColumns,
|
|
57
53
|
gutterSize,
|
|
58
|
-
margin,
|
|
59
54
|
sizePerSpan,
|
|
60
55
|
getSizeSpan: span => {
|
|
61
56
|
return span * sizePerSpan + (span - 1) * gutterSize;
|
|
@@ -112,8 +107,9 @@ const Section: React.FC<SectionProps> = ({
|
|
|
112
107
|
if (Array.isArray(children)) {
|
|
113
108
|
let cursor = 0;
|
|
114
109
|
let rows: any[] = [];
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
const arrayChild = children.filter(item => !!item);
|
|
111
|
+
for (let i = 0; i < arrayChild.length; ++i) {
|
|
112
|
+
const item = arrayChild[i];
|
|
117
113
|
const totalSpan = rows
|
|
118
114
|
.concat([item])
|
|
119
115
|
.map(i => i.props?.widthSpan)
|
|
@@ -129,7 +125,7 @@ const Section: React.FC<SectionProps> = ({
|
|
|
129
125
|
rows = [item];
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
if (i ==
|
|
128
|
+
if (i == arrayChild.length - 1) {
|
|
133
129
|
cursor += 1;
|
|
134
130
|
element.push(addRowView(rows, cursor, true));
|
|
135
131
|
}
|
|
@@ -148,21 +144,23 @@ const Section: React.FC<SectionProps> = ({
|
|
|
148
144
|
value={{
|
|
149
145
|
numberOfColumns,
|
|
150
146
|
gutterSize,
|
|
151
|
-
margin,
|
|
152
147
|
sizePerSpan,
|
|
153
148
|
getSizeSpan: span => {
|
|
154
149
|
return span * sizePerSpan + (span - 1) * gutterSize;
|
|
155
150
|
},
|
|
156
151
|
}}>
|
|
157
152
|
<View
|
|
158
|
-
|
|
159
|
-
style={
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
{...props}
|
|
154
|
+
style={[
|
|
155
|
+
style,
|
|
156
|
+
styles.protectedStyle,
|
|
157
|
+
{
|
|
158
|
+
width: widthSection,
|
|
159
|
+
marginHorizontal: margin,
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
flexWrap: 'wrap',
|
|
162
|
+
},
|
|
163
|
+
]}>
|
|
166
164
|
{!!backgroundImage && (
|
|
167
165
|
<Image
|
|
168
166
|
source={{uri: backgroundImage}}
|
package/Layout/index.ts
CHANGED
|
@@ -6,11 +6,11 @@ import {createContext} from 'react';
|
|
|
6
6
|
import {GridContextProps} from './types';
|
|
7
7
|
import Item from './Item';
|
|
8
8
|
import ItemList from './ItemList';
|
|
9
|
+
import ItemSectionList from './ItemSectionList';
|
|
9
10
|
|
|
10
11
|
const GridContext = createContext<GridContextProps>({
|
|
11
12
|
numberOfColumns: 12,
|
|
12
13
|
gutterSize: 12,
|
|
13
|
-
margin: 12,
|
|
14
14
|
sizePerSpan: 0,
|
|
15
15
|
getSizeSpan: () => 0,
|
|
16
16
|
});
|
|
@@ -23,4 +23,5 @@ export {
|
|
|
23
23
|
validateChildren,
|
|
24
24
|
Item,
|
|
25
25
|
ItemList,
|
|
26
|
+
ItemSectionList,
|
|
26
27
|
};
|
package/Layout/styles.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
|
-
import {Radius, Spacing} from '../Consts';
|
|
1
|
+
import {Platform, StyleSheet} from 'react-native';
|
|
2
|
+
import {Colors, Radius, Spacing} from '../Consts';
|
|
3
3
|
|
|
4
4
|
export default StyleSheet.create({
|
|
5
5
|
extendedHeader: {
|
|
@@ -45,19 +45,7 @@ export default StyleSheet.create({
|
|
|
45
45
|
flexDirection: 'row',
|
|
46
46
|
flexWrap: 'wrap',
|
|
47
47
|
borderRadius: Radius.M,
|
|
48
|
-
paddingTop: undefined,
|
|
49
|
-
paddingBottom: undefined,
|
|
50
|
-
paddingLeft: undefined,
|
|
51
|
-
paddingRight: undefined,
|
|
52
|
-
paddingVertical: undefined,
|
|
53
|
-
paddingHorizontal: undefined,
|
|
54
48
|
padding: 12,
|
|
55
|
-
margin: undefined,
|
|
56
|
-
marginTop: undefined,
|
|
57
|
-
marginBottom: undefined,
|
|
58
|
-
marginLeft: undefined,
|
|
59
|
-
marginRight: undefined,
|
|
60
|
-
marginVertical: undefined,
|
|
61
49
|
},
|
|
62
50
|
item: {
|
|
63
51
|
overflow: 'hidden',
|
|
@@ -75,7 +63,6 @@ export default StyleSheet.create({
|
|
|
75
63
|
bottom: 0,
|
|
76
64
|
left: 0,
|
|
77
65
|
right: 0,
|
|
78
|
-
borderRadius: Spacing.M,
|
|
79
66
|
},
|
|
80
67
|
protectedStyle: {
|
|
81
68
|
marginTop: undefined,
|
|
@@ -93,4 +80,18 @@ export default StyleSheet.create({
|
|
|
93
80
|
paddingHorizontal: undefined,
|
|
94
81
|
paddingVertical: undefined,
|
|
95
82
|
},
|
|
83
|
+
footerContainer: {
|
|
84
|
+
paddingTop: Spacing.S,
|
|
85
|
+
...Platform.select({
|
|
86
|
+
android: {
|
|
87
|
+
elevation: 4,
|
|
88
|
+
},
|
|
89
|
+
ios: {
|
|
90
|
+
shadowColor: Colors.black_20,
|
|
91
|
+
shadowOffset: {width: 0, height: -2},
|
|
92
|
+
shadowOpacity: 0.1,
|
|
93
|
+
shadowRadius: 3,
|
|
94
|
+
},
|
|
95
|
+
}),
|
|
96
|
+
},
|
|
96
97
|
});
|
package/Layout/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export type HeaderType = 'default' | 'surface' | 'extended' | 'none';
|
|
2
|
+
|
|
1
3
|
export type GridContextProps = {
|
|
2
4
|
/**
|
|
3
5
|
* Represents the number of columns in the grid.
|
|
@@ -9,11 +11,6 @@ export type GridContextProps = {
|
|
|
9
11
|
*/
|
|
10
12
|
gutterSize: number;
|
|
11
13
|
|
|
12
|
-
/**
|
|
13
|
-
* Optional. Represents the margin around the grid.
|
|
14
|
-
*/
|
|
15
|
-
margin?: number;
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Represents the size (width or height) per span number.
|
|
19
16
|
*/
|
|
@@ -13,7 +13,7 @@ const PaginationNumber: FC<ChildPaginationProps> = ({
|
|
|
13
13
|
return (
|
|
14
14
|
<View style={[style, styles.row]}>
|
|
15
15
|
<View style={styles.paginationNumberContainer}>
|
|
16
|
-
<Text color={Colors.black_01} typography={'
|
|
16
|
+
<Text color={Colors.black_01} typography={'label_default_medium'}>{`${
|
|
17
17
|
activeIndex + 1
|
|
18
18
|
}/${dataLength}`}</Text>
|
|
19
19
|
</View>
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -1,24 +1,66 @@
|
|
|
1
|
-
import React, {useContext} from 'react';
|
|
2
|
-
import {StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
1
|
+
import React, {useContext, useEffect, useRef, useState} from 'react';
|
|
2
|
+
import {ScrollView, StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {PopupNotifyProps} from './types';
|
|
4
4
|
import {Radius, Spacing, Styles} from '../Consts';
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
import {Text} from '../Text';
|
|
7
|
-
import {ApplicationContext} from '../Application';
|
|
7
|
+
import {ApplicationContext, MiniAppContext} from '../Application';
|
|
8
8
|
import {Button} from '../Button';
|
|
9
9
|
import {Icon} from '../Icon';
|
|
10
10
|
|
|
11
11
|
const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
12
|
+
id,
|
|
12
13
|
image,
|
|
13
14
|
title = 'Title',
|
|
14
15
|
description = 'Description',
|
|
15
|
-
|
|
16
|
+
error,
|
|
16
17
|
secondary,
|
|
17
18
|
primary,
|
|
18
19
|
buttonDirection = 'row',
|
|
19
20
|
onIconClose,
|
|
20
21
|
}) => {
|
|
21
|
-
const
|
|
22
|
+
const context = useContext(MiniAppContext);
|
|
23
|
+
const {theme, navigator, translate} = useContext(ApplicationContext);
|
|
24
|
+
const [scrollContent, setScrollContent] = useState(false);
|
|
25
|
+
const closeAction = useRef('touch_outside');
|
|
26
|
+
|
|
27
|
+
let descriptionStyle = {};
|
|
28
|
+
let Description: any = View;
|
|
29
|
+
if (scrollContent) {
|
|
30
|
+
Description = ScrollView;
|
|
31
|
+
descriptionStyle = {height: 80};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* tracking
|
|
36
|
+
*/
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
39
|
+
const routesLength = routes.length;
|
|
40
|
+
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
41
|
+
if (routesLength > 1) {
|
|
42
|
+
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
43
|
+
}
|
|
44
|
+
const tracking = {
|
|
45
|
+
...context,
|
|
46
|
+
screen_name,
|
|
47
|
+
component_type: 'popup',
|
|
48
|
+
component_name: id,
|
|
49
|
+
error_code: error ? error : undefined,
|
|
50
|
+
};
|
|
51
|
+
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
52
|
+
...tracking,
|
|
53
|
+
trigger_id: '111012100000000000',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return () => {
|
|
57
|
+
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
58
|
+
...tracking,
|
|
59
|
+
trigger_id: '111154100000000001',
|
|
60
|
+
action_type: closeAction.current,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
22
64
|
|
|
23
65
|
/**
|
|
24
66
|
* on action popup
|
|
@@ -44,6 +86,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
44
86
|
type="text"
|
|
45
87
|
size="medium"
|
|
46
88
|
onPress={() => {
|
|
89
|
+
closeAction.current = 'button_action';
|
|
47
90
|
onAction(secondary?.onPress);
|
|
48
91
|
}}
|
|
49
92
|
/>
|
|
@@ -56,6 +99,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
56
99
|
title={primary.title}
|
|
57
100
|
size="medium"
|
|
58
101
|
onPress={() => {
|
|
102
|
+
closeAction.current = 'button_action';
|
|
59
103
|
onAction(primary.onPress);
|
|
60
104
|
}}
|
|
61
105
|
/>
|
|
@@ -70,6 +114,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
70
114
|
title={primary.title}
|
|
71
115
|
size="medium"
|
|
72
116
|
onPress={() => {
|
|
117
|
+
closeAction.current = 'button_action';
|
|
73
118
|
onAction(primary.onPress);
|
|
74
119
|
}}
|
|
75
120
|
/>
|
|
@@ -81,6 +126,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
81
126
|
type="text"
|
|
82
127
|
size="medium"
|
|
83
128
|
onPress={() => {
|
|
129
|
+
closeAction.current = 'button_action';
|
|
84
130
|
onAction(secondary?.onPress);
|
|
85
131
|
}}
|
|
86
132
|
/>
|
|
@@ -112,7 +158,10 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
112
158
|
return (
|
|
113
159
|
<TouchableOpacity
|
|
114
160
|
style={styles.iconCloseContainer}
|
|
115
|
-
onPress={() =>
|
|
161
|
+
onPress={() => {
|
|
162
|
+
closeAction.current = 'icon_close';
|
|
163
|
+
onAction(onIconClose);
|
|
164
|
+
}}>
|
|
116
165
|
<View
|
|
117
166
|
style={[
|
|
118
167
|
styles.iconClose,
|
|
@@ -133,28 +182,35 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
133
182
|
|
|
134
183
|
return (
|
|
135
184
|
<View
|
|
136
|
-
accessibilityLabel={'PopupNotify'}
|
|
137
185
|
style={[
|
|
138
186
|
styles.container,
|
|
139
187
|
{backgroundColor: theme.colors.background.surface},
|
|
140
188
|
]}>
|
|
141
189
|
{!!image && <Image source={{uri: image}} style={styles.image} />}
|
|
142
190
|
<View style={styles.content}>
|
|
143
|
-
<Text typography={'
|
|
191
|
+
<Text typography={'header_default_bold'} numberOfLines={1}>
|
|
144
192
|
{title}
|
|
145
193
|
</Text>
|
|
146
|
-
<
|
|
147
|
-
<Text
|
|
194
|
+
<Description style={[styles.description, descriptionStyle]}>
|
|
195
|
+
<Text
|
|
196
|
+
typography={'body_default_regular'}
|
|
197
|
+
onTextLayout={({nativeEvent: {lines}}) => {
|
|
198
|
+
const enableScroll = lines.length > 3;
|
|
199
|
+
if (enableScroll != scrollContent) {
|
|
200
|
+
setScrollContent(enableScroll);
|
|
201
|
+
}
|
|
202
|
+
}}>
|
|
148
203
|
{description}
|
|
149
204
|
</Text>
|
|
150
|
-
</
|
|
151
|
-
{!!
|
|
205
|
+
</Description>
|
|
206
|
+
{!!error && (
|
|
152
207
|
<View style={styles.information}>
|
|
153
208
|
<Text
|
|
154
|
-
typography={'
|
|
209
|
+
typography={'description_xs_regular'}
|
|
155
210
|
color={theme.colors.text.hint}
|
|
156
211
|
numberOfLines={1}>
|
|
157
|
-
{
|
|
212
|
+
{translate?.('errorCode')}
|
|
213
|
+
{error}
|
|
158
214
|
</Text>
|
|
159
215
|
</View>
|
|
160
216
|
)}
|
|
@@ -174,6 +230,7 @@ const styles = StyleSheet.create({
|
|
|
174
230
|
borderTopLeftRadius: Radius.L,
|
|
175
231
|
borderTopRightRadius: Radius.L,
|
|
176
232
|
aspectRatio: 1.7777,
|
|
233
|
+
overflow: 'hidden',
|
|
177
234
|
},
|
|
178
235
|
content: {padding: Spacing.XL},
|
|
179
236
|
description: {
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -1,13 +1,48 @@
|
|
|
1
|
-
import React, {useContext} from 'react';
|
|
1
|
+
import React, {useContext, useEffect, useRef} from 'react';
|
|
2
2
|
import {StyleSheet, TouchableOpacity, View} from 'react-native';
|
|
3
3
|
import {PopupPromotionProps} from './types';
|
|
4
|
-
import {ApplicationContext} from '../Application';
|
|
4
|
+
import {ApplicationContext, MiniAppContext} from '../Application';
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
import {Radius, Spacing} from '../Consts';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
|
|
9
|
-
const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
9
|
+
const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
10
|
+
id,
|
|
11
|
+
image,
|
|
12
|
+
onIconClose,
|
|
13
|
+
}) => {
|
|
14
|
+
const context = useContext(MiniAppContext);
|
|
10
15
|
const {theme, navigator} = useContext(ApplicationContext);
|
|
16
|
+
const closeAction = useRef('touch_outside');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* tracking
|
|
20
|
+
*/
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const routes = navigator?.ref.current?.getRootState()?.routes || [];
|
|
23
|
+
const routesLength = routes.length;
|
|
24
|
+
let screen_name = routes?.[0]?.params?.screen?.name;
|
|
25
|
+
if (routesLength > 1) {
|
|
26
|
+
screen_name = routes[routesLength - 2]?.params?.screen?.name;
|
|
27
|
+
}
|
|
28
|
+
const tracking = {
|
|
29
|
+
...context,
|
|
30
|
+
screen_name,
|
|
31
|
+
component_type: 'popup',
|
|
32
|
+
component_name: id,
|
|
33
|
+
};
|
|
34
|
+
navigator?.maxApi?.trackEvent?.('service_component_displayed', {
|
|
35
|
+
...tracking,
|
|
36
|
+
trigger_id: '111012100000000000',
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
navigator?.maxApi?.trackEvent?.('service_popup_dismissed', {
|
|
40
|
+
...tracking,
|
|
41
|
+
trigger_id: '111154100000000001',
|
|
42
|
+
action_type: closeAction.current,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
11
46
|
|
|
12
47
|
/**
|
|
13
48
|
* build close action
|
|
@@ -17,8 +52,9 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onClose}) => {
|
|
|
17
52
|
<View style={styles.iconCloseContainer}>
|
|
18
53
|
<TouchableOpacity
|
|
19
54
|
onPress={() => {
|
|
55
|
+
closeAction.current = 'icon_close';
|
|
20
56
|
navigator?.pop();
|
|
21
|
-
|
|
57
|
+
onIconClose?.();
|
|
22
58
|
}}
|
|
23
59
|
style={styles.iconButton}>
|
|
24
60
|
<View
|
|
@@ -41,12 +77,12 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onClose}) => {
|
|
|
41
77
|
};
|
|
42
78
|
|
|
43
79
|
return (
|
|
44
|
-
<View
|
|
80
|
+
<View>
|
|
45
81
|
<Image
|
|
46
|
-
style={styles.container}
|
|
47
82
|
source={{
|
|
48
83
|
uri: image,
|
|
49
84
|
}}
|
|
85
|
+
style={styles.container}
|
|
50
86
|
/>
|
|
51
87
|
{buildCloseIcon()}
|
|
52
88
|
</View>
|
|
@@ -56,6 +92,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({image, onClose}) => {
|
|
|
56
92
|
const styles = StyleSheet.create({
|
|
57
93
|
container: {
|
|
58
94
|
aspectRatio: 0.72,
|
|
95
|
+
width: '100%',
|
|
59
96
|
},
|
|
60
97
|
iconCloseContainer: {
|
|
61
98
|
width: '100%',
|
package/Popup/types.ts
CHANGED
|
@@ -2,6 +2,10 @@ import {TextStyle} from 'react-native';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
export type PopupNotifyProps = {
|
|
5
|
+
/**
|
|
6
|
+
* `id`: Optional. id component_name for tracking component.
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
5
9
|
/**
|
|
6
10
|
* `image`: Optional. Represents the URL or path of the image to be displayed in the PopupNotify component.
|
|
7
11
|
*/
|
|
@@ -18,9 +22,9 @@ export type PopupNotifyProps = {
|
|
|
18
22
|
description: string | React.ReactNode;
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
|
-
* `
|
|
25
|
+
* `error`: Optional. Represents additional error text to be displayed in the PopupNotify component.
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
error?: string;
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
30
|
* `secondary`: Optional. Represents the secondary action that can be performed from the PopupNotify component.
|
|
@@ -47,6 +51,11 @@ export type PopupNotifyProps = {
|
|
|
47
51
|
};
|
|
48
52
|
|
|
49
53
|
export type PopupPromotionProps = {
|
|
54
|
+
/**
|
|
55
|
+
* `id`: Optional. id component_name for tracking component.
|
|
56
|
+
*/
|
|
57
|
+
id?: string;
|
|
58
|
+
|
|
50
59
|
/**
|
|
51
60
|
* `image`: Represents the URL or path of the image to be displayed in the PopupPromotion component.
|
|
52
61
|
*/
|
|
@@ -55,7 +64,7 @@ export type PopupPromotionProps = {
|
|
|
55
64
|
/**
|
|
56
65
|
* `onClose`: Optional. A callback function that is called when the PopupPromotion component is closed.
|
|
57
66
|
*/
|
|
58
|
-
|
|
67
|
+
onIconClose?: () => void;
|
|
59
68
|
};
|
|
60
69
|
|
|
61
70
|
type PopupAction = {
|
package/Radio/index.tsx
CHANGED
|
@@ -39,7 +39,6 @@ const Radio: FC<RadioProps> = ({
|
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
41
|
<TouchableOpacity
|
|
42
|
-
accessibilityLabel={`Radio/${label}/${value}`}
|
|
43
42
|
onPress={onChange}
|
|
44
43
|
disabled={disabled}
|
|
45
44
|
style={[
|
|
@@ -57,7 +56,7 @@ const Radio: FC<RadioProps> = ({
|
|
|
57
56
|
{marginRight: label ? Spacing.XS : 0},
|
|
58
57
|
]}
|
|
59
58
|
/>
|
|
60
|
-
{!!label && <Text typography={'
|
|
59
|
+
{!!label && <Text typography={'body_default_regular'}>{label}</Text>}
|
|
61
60
|
</TouchableOpacity>
|
|
62
61
|
);
|
|
63
62
|
};
|
package/Skeleton/index.tsx
CHANGED
|
@@ -41,7 +41,7 @@ const Skeleton: React.FC<SkeletonTypes> = ({style}) => {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
return (
|
|
44
|
-
<View style={[styles.container, style]}
|
|
44
|
+
<View style={[styles.container, style]}>
|
|
45
45
|
<View
|
|
46
46
|
onLayout={e => onLayout(e.nativeEvent.layout.width)}
|
|
47
47
|
style={[Styles.flex, {backgroundColor: PRIMARY_COLOR}]}>
|
package/Switch/index.tsx
CHANGED
package/Tag/index.tsx
CHANGED
|
@@ -60,9 +60,7 @@ const Tag: FC<TagProps> = ({
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<View
|
|
64
|
-
style={[style, sizeStyle, {backgroundColor: tagColor}]}
|
|
65
|
-
accessibilityLabel={`Tag/${label}`}>
|
|
63
|
+
<View style={[style, sizeStyle, {backgroundColor: tagColor}]}>
|
|
66
64
|
{!!icon && (
|
|
67
65
|
<Icon
|
|
68
66
|
style={styles.icon}
|
|
@@ -71,7 +69,7 @@ const Tag: FC<TagProps> = ({
|
|
|
71
69
|
color={labelColor}
|
|
72
70
|
/>
|
|
73
71
|
)}
|
|
74
|
-
<Text color={labelColor} typography={'
|
|
72
|
+
<Text color={labelColor} typography={'label_s_medium'}>
|
|
75
73
|
{label}
|
|
76
74
|
</Text>
|
|
77
75
|
</View>
|
package/Text/index.tsx
CHANGED
|
@@ -84,10 +84,12 @@ const Text: React.FC<TextProps> = ({
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
return {
|
|
87
|
+
...typoStyle,
|
|
87
88
|
fontFamily,
|
|
88
89
|
fontSize: scaleSize(fontSize),
|
|
89
90
|
lineHeight: scaleSize(lineHeight),
|
|
90
91
|
fontStyle,
|
|
92
|
+
fontWeight,
|
|
91
93
|
};
|
|
92
94
|
};
|
|
93
95
|
|
|
@@ -95,7 +97,6 @@ const Text: React.FC<TextProps> = ({
|
|
|
95
97
|
return (
|
|
96
98
|
<RNText
|
|
97
99
|
{...rest}
|
|
98
|
-
accessibilityLabel={`Text/${children}`}
|
|
99
100
|
style={[style, textStyle, {color: color ?? theme.colors.text.default}]}>
|
|
100
101
|
{children ?? ''}
|
|
101
102
|
</RNText>
|
|
@@ -103,7 +104,7 @@ const Text: React.FC<TextProps> = ({
|
|
|
103
104
|
};
|
|
104
105
|
|
|
105
106
|
Text.defaultProps = {
|
|
106
|
-
typography: '
|
|
107
|
+
typography: 'body_default_regular',
|
|
107
108
|
};
|
|
108
109
|
|
|
109
110
|
export {Text, scaleSize};
|
package/Text/styles.ts
CHANGED
|
@@ -1,4 +1,42 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
headline_default_bold: {fontSize: 24, lineHeight: 32, fontWeight: '700'},
|
|
3
|
+
header_m_bold: {fontSize: 18, lineHeight: 28, fontWeight: '700'},
|
|
4
|
+
header_default_bold: {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
5
|
+
header_s_semibold: {fontSize: 14, lineHeight: 20, fontWeight: '600'},
|
|
6
|
+
header_xs_semibold: {fontSize: 12, lineHeight: 16, fontWeight: '600'},
|
|
7
|
+
body_default_regular: {fontSize: 14, lineHeight: 20, fontWeight: '400'},
|
|
8
|
+
body_regularstrikethrought: {
|
|
9
|
+
fontSize: 14,
|
|
10
|
+
lineHeight: 20,
|
|
11
|
+
fontWeight: '400',
|
|
12
|
+
textDecorationLine: 'line-through',
|
|
13
|
+
},
|
|
14
|
+
description_default_regular: {
|
|
15
|
+
fontSize: 12,
|
|
16
|
+
lineHeight: 16,
|
|
17
|
+
fontWeight: '400',
|
|
18
|
+
},
|
|
19
|
+
description_default_regularstrikethrought: {
|
|
20
|
+
fontSize: 12,
|
|
21
|
+
lineHeight: 16,
|
|
22
|
+
fontWeight: '400',
|
|
23
|
+
textDecorationLine: 'line-through',
|
|
24
|
+
},
|
|
25
|
+
description_xs_regular: {fontSize: 10, lineHeight: 14, fontWeight: '400'},
|
|
26
|
+
description_xs_regularstrikethrought: {
|
|
27
|
+
fontSize: 10,
|
|
28
|
+
lineHeight: 14,
|
|
29
|
+
fontWeight: '400',
|
|
30
|
+
textDecorationLine: 'line-through',
|
|
31
|
+
},
|
|
32
|
+
label_default_medium: {fontSize: 14, lineHeight: 20, fontWeight: '500'},
|
|
33
|
+
label_s_medium: {fontSize: 12, lineHeight: 16, fontWeight: '500'},
|
|
34
|
+
label_xs_medium: {fontSize: 10, lineHeight: 14, fontWeight: '500'},
|
|
35
|
+
action_default_bold: {fontSize: 16, lineHeight: 22, fontWeight: '700'},
|
|
36
|
+
action_s_bold: {fontSize: 14, lineHeight: 20, fontWeight: '700'},
|
|
37
|
+
action_xs_bold: {fontSize: 12, lineHeight: 16, fontWeight: '700'},
|
|
38
|
+
action_xxs_bold: {fontSize: 10, lineHeight: 14, fontWeight: '700'},
|
|
39
|
+
/**non-support**/
|
|
2
40
|
headline_default: {
|
|
3
41
|
fontSize: 28,
|
|
4
42
|
lineHeight: 34,
|
package/Text/types.ts
CHANGED
|
@@ -14,27 +14,39 @@ export type TypographyWeight = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export type Typography =
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated
|
|
19
|
+
**/
|
|
17
20
|
| 'headline_default'
|
|
18
|
-
| 'headline_s'
|
|
19
21
|
| 'headline_l'
|
|
20
22
|
| 'headline_xl'
|
|
21
23
|
| 'title_default'
|
|
22
24
|
| 'title_xs'
|
|
23
25
|
| 'title_s'
|
|
24
26
|
| 'header_default'
|
|
25
|
-
| 'header_xs'
|
|
26
|
-
| 'header_s'
|
|
27
27
|
| 'paragraph_default'
|
|
28
28
|
| 'paragraph_bold'
|
|
29
29
|
| 'paragraph_italic'
|
|
30
|
-
| 'description_default'
|
|
31
|
-
| 'description_xs'
|
|
32
|
-
| 'description_s'
|
|
33
|
-
| 'label_default'
|
|
34
30
|
| 'label_xxs'
|
|
35
|
-
| '
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| '
|
|
40
|
-
| '
|
|
31
|
+
| 'action_s'
|
|
32
|
+
/**
|
|
33
|
+
* end
|
|
34
|
+
**/
|
|
35
|
+
| 'headline_default_bold'
|
|
36
|
+
| 'header_m_bold'
|
|
37
|
+
| 'header_default_bold'
|
|
38
|
+
| 'header_s_semibold'
|
|
39
|
+
| 'header_xs_semibold'
|
|
40
|
+
| 'body_default_regular'
|
|
41
|
+
| 'body_default_regularstrikethrought'
|
|
42
|
+
| 'description_default_regular'
|
|
43
|
+
| 'description_default_regularstrikethrought'
|
|
44
|
+
| 'description_xs_regular'
|
|
45
|
+
| 'description_xs_regularstrikethrought'
|
|
46
|
+
| 'label_default_medium'
|
|
47
|
+
| 'label_s_medium'
|
|
48
|
+
| 'label_xs_medium'
|
|
49
|
+
| 'action_default_bold'
|
|
50
|
+
| 'action_s_bold'
|
|
51
|
+
| 'action_xs_bold'
|
|
52
|
+
| 'action_xxs_bold';
|