@momo-kits/foundation 0.169.16-beta.31 → 0.169.16-beta.33
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/BottomSheet.tsx +6 -16
- package/Application/ModalIconButton.tsx +13 -15
- package/Application/modalLayout.ts +1 -1
- package/Icon/index.tsx +12 -18
- package/package.json +1 -1
- package/Assets/icon_deprecated.json +0 -44
- package/Assets/icon_new.json +0 -1052
- package/Icon/utils.ts +0 -65
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Pressable,
|
|
8
8
|
StyleSheet,
|
|
9
9
|
View,
|
|
10
|
+
ViewStyle,
|
|
10
11
|
} from 'react-native';
|
|
11
12
|
import { ApplicationContext, MiniAppContext } from '../Context';
|
|
12
13
|
import { BottomSheetParams } from './types';
|
|
@@ -190,22 +191,10 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
190
191
|
/>
|
|
191
192
|
);
|
|
192
193
|
|
|
193
|
-
|
|
194
|
+
// same tree on every layout so fold / unfold keeps the screen mounted (state, scroll)
|
|
195
|
+
let contentStyle: ViewStyle | undefined;
|
|
194
196
|
if (isFoldable) {
|
|
195
|
-
|
|
196
|
-
content = (
|
|
197
|
-
<View style={styles.shrink}>
|
|
198
|
-
{renderSheetHeader(headerParams)}
|
|
199
|
-
<View style={styles.shrink}>{screen}</View>
|
|
200
|
-
</View>
|
|
201
|
-
);
|
|
202
|
-
} else {
|
|
203
|
-
content = (
|
|
204
|
-
<>
|
|
205
|
-
{renderSheetHeader(headerParams)}
|
|
206
|
-
{screen}
|
|
207
|
-
</>
|
|
208
|
-
);
|
|
197
|
+
contentStyle = styles.shrink;
|
|
209
198
|
}
|
|
210
199
|
|
|
211
200
|
return (
|
|
@@ -253,7 +242,8 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
253
242
|
}),
|
|
254
243
|
]}
|
|
255
244
|
>
|
|
256
|
-
{
|
|
245
|
+
{renderSheetHeader(headerParams)}
|
|
246
|
+
<View style={contentStyle}>{screen}</View>
|
|
257
247
|
{renderSheetFooter({ footerComponent, theme })}
|
|
258
248
|
{useBottomInset && (
|
|
259
249
|
<View
|
|
@@ -6,12 +6,14 @@ import {
|
|
|
6
6
|
ViewStyle,
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { ApplicationContext } from '../Context';
|
|
9
|
-
import {
|
|
9
|
+
import { Colors } from '../Consts';
|
|
10
10
|
import { Icon } from '../Icon';
|
|
11
|
+
import { HeaderBarMetrics } from './headerLayout';
|
|
11
12
|
|
|
12
|
-
//
|
|
13
|
-
const MODAL_ICON_BUTTON_SIZE =
|
|
14
|
-
const MODAL_ICON_SIZE =
|
|
13
|
+
// same round button as the Top nav (NavigationButton), shared with the Compose / SwiftUI kits
|
|
14
|
+
const MODAL_ICON_BUTTON_SIZE = HeaderBarMetrics.buttonSize;
|
|
15
|
+
const MODAL_ICON_SIZE = HeaderBarMetrics.iconSize;
|
|
16
|
+
const MODAL_ICON_BUTTON_BORDER_WIDTH = 0.2;
|
|
15
17
|
|
|
16
18
|
type ModalIconButtonProps = {
|
|
17
19
|
icon: string;
|
|
@@ -21,7 +23,8 @@ type ModalIconButtonProps = {
|
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
|
-
* Close / back button of popups and bottom sheet headers
|
|
26
|
+
* Close / back button of popups and bottom sheet headers, drawn like the round
|
|
27
|
+
* Top nav icon button so modals and headers share one look.
|
|
25
28
|
*/
|
|
26
29
|
const ModalIconButton: React.FC<ModalIconButtonProps> = ({
|
|
27
30
|
icon,
|
|
@@ -34,14 +37,7 @@ const ModalIconButton: React.FC<ModalIconButtonProps> = ({
|
|
|
34
37
|
<TouchableOpacity
|
|
35
38
|
accessibilityLabel={accessibilityLabel}
|
|
36
39
|
onPress={onPress}
|
|
37
|
-
style={[
|
|
38
|
-
styles.button,
|
|
39
|
-
{
|
|
40
|
-
backgroundColor: theme.colors.background.surface,
|
|
41
|
-
borderColor: theme.colors.border.default,
|
|
42
|
-
},
|
|
43
|
-
style,
|
|
44
|
-
]}
|
|
40
|
+
style={[styles.button, style]}
|
|
45
41
|
>
|
|
46
42
|
<Icon
|
|
47
43
|
source={icon}
|
|
@@ -56,10 +52,12 @@ const styles = StyleSheet.create({
|
|
|
56
52
|
button: {
|
|
57
53
|
width: MODAL_ICON_BUTTON_SIZE,
|
|
58
54
|
height: MODAL_ICON_BUTTON_SIZE,
|
|
59
|
-
borderRadius:
|
|
60
|
-
borderWidth:
|
|
55
|
+
borderRadius: MODAL_ICON_BUTTON_SIZE / 2,
|
|
56
|
+
borderWidth: MODAL_ICON_BUTTON_BORDER_WIDTH,
|
|
61
57
|
alignItems: 'center',
|
|
62
58
|
justifyContent: 'center',
|
|
59
|
+
backgroundColor: Colors.black_01 + '99',
|
|
60
|
+
borderColor: Colors.black_20 + '33',
|
|
63
61
|
},
|
|
64
62
|
});
|
|
65
63
|
|
|
@@ -8,7 +8,7 @@ import { isIPhoneDuo } from './utils';
|
|
|
8
8
|
const POPUP_MAX_WIDTH = 450;
|
|
9
9
|
const POPUP_MIN_WIDTH = 280;
|
|
10
10
|
const POPUP_MAX_HEIGHT = 600;
|
|
11
|
-
const SHEET_MAX_WIDTH =
|
|
11
|
+
const SHEET_MAX_WIDTH = 600;
|
|
12
12
|
const SHEET_MIN_WIDTH = 296;
|
|
13
13
|
const SHEET_MIN_HEIGHT = 230;
|
|
14
14
|
const FOLDABLE_MIN_WIDTH = 600;
|
package/Icon/index.tsx
CHANGED
|
@@ -6,17 +6,10 @@ import { ApplicationContext, MiniAppContext } from '../Context';
|
|
|
6
6
|
import { Image } from '../Image';
|
|
7
7
|
import { StyleSheet } from 'react-native';
|
|
8
8
|
import { Colors } from '../Consts';
|
|
9
|
-
import {
|
|
10
|
-
getIconSource,
|
|
11
|
-
isNoThemeIcon,
|
|
12
|
-
IconNewSources,
|
|
13
|
-
IconDeprecatedSources,
|
|
14
|
-
} from './utils';
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
11
|
* Tinted icon from the bundled icon map (unknown names fall back to
|
|
18
|
-
* `ic_warning`) or from a URL
|
|
19
|
-
* `color={null}` keeps the image's own colors, as do multicolor brand icons.
|
|
12
|
+
* `ic_warning`) or from a URL. `color={null}` keeps the image's own colors.
|
|
20
13
|
*/
|
|
21
14
|
const Icon: React.FC<IconProps> = ({
|
|
22
15
|
source = 'ic_back',
|
|
@@ -30,15 +23,22 @@ const Icon: React.FC<IconProps> = ({
|
|
|
30
23
|
|
|
31
24
|
const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
|
|
32
25
|
|
|
26
|
+
const getIconSource = (): any => {
|
|
27
|
+
if (source && !source.includes('http')) {
|
|
28
|
+
let icon: { [key: string]: { uri: string } } = IconSources;
|
|
29
|
+
return icon[source] ?? icon.ic_warning;
|
|
30
|
+
}
|
|
31
|
+
return { uri: source };
|
|
32
|
+
};
|
|
33
|
+
|
|
33
34
|
const tintColor = color ?? theme.colors.text.default;
|
|
34
|
-
const tintColorProps =
|
|
35
|
-
color !== null && !isNoThemeIcon(source) && { tintColor };
|
|
35
|
+
const tintColorProps = color !== null && { tintColor };
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<Image
|
|
39
39
|
{...props}
|
|
40
40
|
loading={false}
|
|
41
|
-
source={getIconSource(
|
|
41
|
+
source={getIconSource()}
|
|
42
42
|
style={[
|
|
43
43
|
style,
|
|
44
44
|
{ width: size, height: size },
|
|
@@ -54,10 +54,4 @@ const styles = StyleSheet.create({
|
|
|
54
54
|
debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
export {
|
|
58
|
-
Icon,
|
|
59
|
-
IconSources,
|
|
60
|
-
IconBankSources,
|
|
61
|
-
IconNewSources,
|
|
62
|
-
IconDeprecatedSources,
|
|
63
|
-
};
|
|
57
|
+
export { Icon, IconSources, IconBankSources };
|
package/package.json
CHANGED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Phonebook": "phone_call_phonebook_outline",
|
|
3
|
-
"arrow-back": "arrow_back",
|
|
4
|
-
"arrow_arrow-down": "arrow_down",
|
|
5
|
-
"arrow_arrow-next": "arrow_next",
|
|
6
|
-
"arrow_arrow-top": "arrow_top",
|
|
7
|
-
"arrow_arrow_bold_forward": "arrow_bold_forward",
|
|
8
|
-
"arrow_arrow_reply": "arrow_reply",
|
|
9
|
-
"arrow_arrow_undo": "arrow_undo_2",
|
|
10
|
-
"arrow_undo": "arrow_undo_1",
|
|
11
|
-
"basic_Moon": "basic_moon",
|
|
12
|
-
"chat_back_space": "chatting_back_space",
|
|
13
|
-
"chat_comment": "chatting_comment",
|
|
14
|
-
"chat_comment_delete": "chatting_comment_delete",
|
|
15
|
-
"chat_comment_empty": "chatting_comment_empty",
|
|
16
|
-
"chat_q_and_a": "chatting_q_and_a_right",
|
|
17
|
-
"chat_sent": "chatting_sent",
|
|
18
|
-
"chat_sticker": "chatting_sticker",
|
|
19
|
-
"connection_share": "connection_share_1",
|
|
20
|
-
"file_Billsetting": "file_bill_setting",
|
|
21
|
-
"file_clipboard_checked": "file_clipboard_check",
|
|
22
|
-
"file_plus": "file_file_plus",
|
|
23
|
-
"file_search": "file_file_search",
|
|
24
|
-
"file_text": "file_file_text",
|
|
25
|
-
"finance_safe": "finance_safe_box",
|
|
26
|
-
"help_center": "basic_help_center_1",
|
|
27
|
-
"logicstics_delivery": "logistics_delivery",
|
|
28
|
-
"logicstics_delivery_fast": "logistics_delivery_fast",
|
|
29
|
-
"logicstics_delivey_bike": "logistics_delivery_bike",
|
|
30
|
-
"logicstics_package": "logistics_package",
|
|
31
|
-
"logicstics_package_cancel": "logistics_package_cancel",
|
|
32
|
-
"logicstics_package_list": "logistics_package_list",
|
|
33
|
-
"navigation_AR": "navigation_ar",
|
|
34
|
-
"navigation_close_circle_full_2": "navigation_close_circle_full",
|
|
35
|
-
"navigation_qrcode": "navigation_qr_code",
|
|
36
|
-
"phonebook_outline": "phone_call_phonebook_outline",
|
|
37
|
-
"security_verifiedface_id": "security_verified_face_id",
|
|
38
|
-
"time_calendar": "time_calendar_1",
|
|
39
|
-
"travel_airconditional": "travel_air_conditional",
|
|
40
|
-
"travel_bed-single": "travel_bed_single",
|
|
41
|
-
"travel_kid_area": "travel_children_area",
|
|
42
|
-
"travel_led_Light": "travel_led_light",
|
|
43
|
-
"travel_people_family": "travel_family"
|
|
44
|
-
}
|