@momo-kits/foundation 0.169.16-beta.32 → 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.
@@ -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
- let content: React.ReactNode;
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
- // Content shrinks so a tall sheet keeps its header and footer.
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
- {content}
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 { Radius, Spacing } from '../Consts';
9
+ import { Colors } from '../Consts';
10
10
  import { Icon } from '../Icon';
11
+ import { HeaderBarMetrics } from './headerLayout';
11
12
 
12
- // modal spec: icon button 32, icon 20, shared with the Compose / SwiftUI kits
13
- const MODAL_ICON_BUTTON_SIZE = Spacing.XXL;
14
- const MODAL_ICON_SIZE = 20;
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: Radius.L,
60
- borderWidth: 1,
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 = 653;
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.169.16-beta.32",
3
+ "version": "0.169.16-beta.33",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},