@momo-kits/foundation 0.169.16-beta.3 → 0.169.16-beta.30

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.
@@ -215,7 +215,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
215
215
  onRequestClose={() => {
216
216
  handleDismiss();
217
217
  }}
218
- style={StyleSheet.absoluteFill}
218
+ style={StyleSheet.absoluteFillObject}
219
219
  isModalKit={true}
220
220
  supportedOrientations={isDuo ? DUO_ORIENTATIONS : undefined}
221
221
  >
@@ -230,7 +230,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
230
230
  style={styles.container}
231
231
  >
232
232
  <Pressable
233
- style={StyleSheet.absoluteFill}
233
+ style={StyleSheet.absoluteFillObject}
234
234
  onPress={() => {
235
235
  action.current = 'touch';
236
236
  handleDismiss();
@@ -68,7 +68,7 @@ export const styles = StyleSheet.create({
68
68
  },
69
69
  // custom label content over the label text, centered and unclipped
70
70
  ctaLabelOverlay: {
71
- ...{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0},
71
+ ...StyleSheet.absoluteFillObject,
72
72
  alignItems: 'center',
73
73
  justifyContent: 'center',
74
74
  },
@@ -57,7 +57,7 @@ export const styles = StyleSheet.create({
57
57
  },
58
58
  // custom label content over the label text, centered and unclipped
59
59
  railCtaLabelOverlay: {
60
- ...{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0},
60
+ ...StyleSheet.absoluteFillObject,
61
61
  alignItems: 'center',
62
62
  justifyContent: 'center',
63
63
  },
@@ -150,7 +150,7 @@ const styles = StyleSheet.create({
150
150
  height: TabBarMetrics.iconSize,
151
151
  },
152
152
  layer: {
153
- ...{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0},
153
+ ...StyleSheet.absoluteFillObject,
154
154
  alignItems: 'center',
155
155
  justifyContent: 'center',
156
156
  },
@@ -161,7 +161,7 @@ const Modal: React.FC<ModalParams> = props => {
161
161
  transparent
162
162
  visible={true}
163
163
  onRequestClose={handleDismiss}
164
- style={StyleSheet.absoluteFill}
164
+ style={StyleSheet.absoluteFillObject}
165
165
  isModalKit={true}
166
166
  supportedOrientations={isDuo ? DUO_ORIENTATIONS : undefined}
167
167
  >
@@ -170,7 +170,7 @@ const Modal: React.FC<ModalParams> = props => {
170
170
  behavior={Platform.OS === 'ios' ? 'padding' : undefined}
171
171
  >
172
172
  <Pressable
173
- style={StyleSheet.absoluteFill}
173
+ style={StyleSheet.absoluteFillObject}
174
174
  onPress={() => handleDismiss(undefined, barrierDismissible)}
175
175
  >
176
176
  <Animated.View style={[styles.overlayContent, scrimStyle]} />
@@ -1,4 +1,5 @@
1
1
  import React, { useContext, useEffect, useLayoutEffect, useRef } from 'react';
2
+ import { InteractionManager } from 'react-native';
2
3
  import { useHeaderHeight } from '@react-navigation/elements';
3
4
  import { ScreenTrackingParams } from './types';
4
5
  import Navigation from './Navigation';
@@ -13,12 +14,7 @@ const TRACKING_TIMEOUT = 5000;
13
14
  const ELEMENT_IDLE_TIMEOUT = 2000;
14
15
  const LOADING_IDLE_TIMEOUT = 2000;
15
16
 
16
- // RN 0.87+: InteractionManager đã bị xoá khỏi react-native → thay bằng requestIdleCallback.
17
- // Giữ nguyên shape trả về { cancel } để code bên dưới (timeoutInteraction?.cancel?.()) không đổi.
18
- const runAfterInteractions = (task: () => void) => {
19
- const handle = requestIdleCallback(() => task());
20
- return { cancel: () => cancelIdleCallback(handle) };
21
- };
17
+ const runAfterInteractions = InteractionManager.runAfterInteractions;
22
18
 
23
19
  /**
24
20
  * Hosts a feature screen in the stack: applies its header options, provides
@@ -8,13 +8,13 @@ import React, {
8
8
  useReducer,
9
9
  useRef,
10
10
  } from 'react';
11
- import { StyleSheet, View, type ViewInstance } from 'react-native';
11
+ import { StyleSheet, View } from 'react-native';
12
12
 
13
13
  interface TooltipPortalContextValue {
14
14
  register: (id: string, content: ReactNode) => void;
15
15
  unregister: (id: string, immediate?: boolean) => void;
16
16
  portals: Map<string, ReactNode>;
17
- hostRef: RefObject<ViewInstance | null>;
17
+ hostRef: RefObject<View | null>;
18
18
  }
19
19
 
20
20
  const TooltipPortalContext = createContext<TooltipPortalContextValue | null>(
@@ -30,7 +30,7 @@ export const TooltipPortalProvider: React.FC<{ children: ReactNode }> = ({
30
30
  }) => {
31
31
  // The ref map updates synchronously; the reducer only triggers re-renders.
32
32
  const portalsRef = useRef<Map<string, ReactNode>>(new Map());
33
- const hostRef = useRef<ViewInstance>(null);
33
+ const hostRef = useRef<View>(null);
34
34
  const [updateCounter, forceUpdate] = useReducer((x: number) => x + 1, 0);
35
35
  const pendingUpdateRef = useRef<any>(null);
36
36
 
@@ -54,7 +54,7 @@ const useAppState = () => {
54
54
 
55
55
  useEffect(() => {
56
56
  const subscription = AppState.addEventListener('change', nextAppState => {
57
- const wasInBackground = /inactive|background/.test(appState.current ?? '');
57
+ const wasInBackground = /inactive|background/.test(appState.current);
58
58
  const isReturning = wasInBackground && nextAppState === 'active';
59
59
  isBackgroundToForeground.current = isReturning;
60
60
  appState.current = nextAppState;
package/Button/index.tsx CHANGED
@@ -192,10 +192,10 @@ const Button: FC<ButtonProps> = ({
192
192
 
193
193
  const sizeStyle = getSizeStyle();
194
194
  const typeStyle = getTypeStyle(type, theme, color);
195
- const containerStyle = StyleSheet.flatten([
195
+ const containerStyle: ViewStyle = StyleSheet.flatten([
196
196
  full && { width: '100%' },
197
197
  loading && { opacity: 0.75 },
198
- ]) as ViewStyle;
198
+ ]);
199
199
  const buttonStyle = StyleSheet.flatten([sizeStyle, typeStyle]);
200
200
 
201
201
  const animatedStyle = useAnimatedStyle(() => {
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
2
+ import { StyleSheet, View, ViewStyle } from 'react-native';
3
3
  import { ApplicationContext } from '../Context';
4
4
  import { Spacing } from '../Consts';
5
5
  import Svg, { Line } from 'react-native-svg';
@@ -8,7 +8,7 @@ export interface DashDividerProps {
8
8
  /**
9
9
  * Custom styles for dash divider
10
10
  */
11
- style?: StyleProp<ViewStyle>;
11
+ style?: ViewStyle;
12
12
  }
13
13
 
14
14
  /** 1px dashed horizontal line in the default border color. */
package/Divider/index.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { useContext } from 'react';
2
- import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
2
+ import { StyleSheet, View, ViewStyle } from 'react-native';
3
3
  import { ApplicationContext } from '../Context';
4
4
  import { Spacing } from '../Consts';
5
5
  import { DashDivider } from './DashDivider';
@@ -8,7 +8,7 @@ export interface DividerProps {
8
8
  /**
9
9
  * Custom styles for divider
10
10
  */
11
- style?: StyleProp<ViewStyle>;
11
+ style?: ViewStyle;
12
12
 
13
13
  /**
14
14
  * Enable margin vertical 4px
@@ -34,10 +34,10 @@ const Divider: React.FC<DividerProps> = ({
34
34
  return (
35
35
  <View
36
36
  style={[
37
+ style,
37
38
  styles.divider,
38
39
  useMargin ? styles.margin : styles.noMargin,
39
40
  { backgroundColor: theme.colors.border.default },
40
- style,
41
41
  ]}
42
42
  />
43
43
  );
@@ -10,7 +10,7 @@ type CombinedListProps<ItemT> = FlatListProps<ItemT> &
10
10
  * switch to it without type changes.
11
11
  */
12
12
  const FoundationList = <ItemT,>(props: CombinedListProps<ItemT>) => {
13
- return <FlashList {...(props as FlashListProps<ItemT>)} />;
13
+ return <FlashList {...props} />;
14
14
  };
15
15
 
16
16
  export { FoundationList };
package/Icon/index.tsx CHANGED
@@ -7,9 +7,472 @@ import { Image } from '../Image';
7
7
  import { StyleSheet } from 'react-native';
8
8
  import { Colors } from '../Consts';
9
9
 
10
+ type IconMap = { [key: string]: { uri: string } };
11
+
12
+ // Kept in this file on purpose: mini apps load foundation modules from the host
13
+ // app per file (Module Federation shares `@momo-kits/foundation/`), so a new file
14
+ // here crashes them on a host built with an older foundation.
15
+ const NEW_ICON_BASE_URL = 'https://img.mservice.com.vn/app/icon/kits/v2025/';
16
+
17
+ /** Keys of the 2025 icon set, served as `<NEW_ICON_BASE_URL><key>.png`. */
18
+ const NEW_ICON_KEYS = [
19
+ 'arrow_back',
20
+ 'arrow_bold_forward',
21
+ 'arrow_chevron_down',
22
+ 'arrow_chevron_down_small',
23
+ 'arrow_chevron_left',
24
+ 'arrow_chevron_left_small',
25
+ 'arrow_chevron_right',
26
+ 'arrow_chevron_right_small',
27
+ 'arrow_chevron_up',
28
+ 'arrow_chevron_up_small',
29
+ 'arrow_chevrons_double_down',
30
+ 'arrow_chevrons_double_left',
31
+ 'arrow_chevrons_double_up',
32
+ 'arrow_circle_chevron_right',
33
+ 'arrow_circle_chevron_top',
34
+ 'arrow_circle_chevrons_left',
35
+ 'arrow_circle_chevrons_right',
36
+ 'arrow_diagonals',
37
+ 'arrow_diagonals_bltr',
38
+ 'arrow_down',
39
+ 'arrow_next',
40
+ 'arrow_refresh_ccw',
41
+ 'arrow_reply',
42
+ 'arrow_rotate_ccw',
43
+ 'arrow_rotate_cw',
44
+ 'arrow_top',
45
+ 'arrow_undo_1',
46
+ 'arrow_undo_2',
47
+ 'basic_account',
48
+ 'basic_add_to_phone',
49
+ 'basic_cccd',
50
+ 'basic_change_account',
51
+ 'basic_chart',
52
+ 'basic_chart_line_up',
53
+ 'basic_chart_up',
54
+ 'basic_copy',
55
+ 'basic_delete',
56
+ 'basic_feed',
57
+ 'basic_filter',
58
+ 'basic_flag',
59
+ 'basic_flaged',
60
+ 'basic_help_center_1',
61
+ 'basic_help_center_2',
62
+ 'basic_home',
63
+ 'basic_moon',
64
+ 'basic_nfc',
65
+ 'basic_none_delete',
66
+ 'basic_options',
67
+ 'basic_person',
68
+ 'basic_person_add',
69
+ 'basic_person_group',
70
+ 'basic_power',
71
+ 'basic_quet_qr',
72
+ 'basic_setting',
73
+ 'basic_sorting',
74
+ 'basic_support',
75
+ 'basic_support_24h',
76
+ 'basic_thong_bao_tai_khoan',
77
+ 'basic_ticket',
78
+ 'basic_ticket_movie',
79
+ 'basic_ticket_star',
80
+ 'basic_translate',
81
+ 'basic_upload_photo',
82
+ 'basic_world',
83
+ 'bookmark_1',
84
+ 'bookmark_2',
85
+ 'bookmark_add',
86
+ 'bookmark_heart',
87
+ 'bookmark_star',
88
+ 'bookmark_x',
89
+ 'chatting_back_space',
90
+ 'chatting_comment',
91
+ 'chatting_comment_delete',
92
+ 'chatting_comment_empty',
93
+ 'chatting_q_and_a_left',
94
+ 'chatting_q_and_a_right',
95
+ 'chatting_request_money',
96
+ 'chatting_sent',
97
+ 'chatting_sticker',
98
+ 'connection_bluetooth',
99
+ 'connection_bluetooth_no',
100
+ 'connection_launch',
101
+ 'connection_link',
102
+ 'connection_link_disable',
103
+ 'connection_mail',
104
+ 'connection_share_1',
105
+ 'connection_share_2',
106
+ 'connection_wifi',
107
+ 'connection_wifi_no',
108
+ 'entertainment_home_movie_1',
109
+ 'entertainment_home_movie_2',
110
+ 'entertainment_movie_uni',
111
+ 'file_account_notebook',
112
+ 'file_bill_setting',
113
+ 'file_briefcase',
114
+ 'file_clipboard_check',
115
+ 'file_clipboard_note',
116
+ 'file_cloud_download',
117
+ 'file_cloud_upload',
118
+ 'file_download',
119
+ 'file_edit',
120
+ 'file_edit_in_box',
121
+ 'file_file',
122
+ 'file_file_create',
123
+ 'file_file_download',
124
+ 'file_file_plus',
125
+ 'file_file_search',
126
+ 'file_file_text',
127
+ 'file_folder',
128
+ 'file_folder_forward',
129
+ 'file_folder_opened',
130
+ 'file_folder_plus',
131
+ 'file_mail',
132
+ 'file_paperclip',
133
+ 'file_paperclip_no',
134
+ 'file_pin',
135
+ 'file_pinned',
136
+ 'file_unpin',
137
+ 'file_upload',
138
+ 'finance_card_1',
139
+ 'finance_card_2',
140
+ 'finance_card_jcb',
141
+ 'finance_card_master',
142
+ 'finance_card_visa',
143
+ 'finance_cash',
144
+ 'finance_chuyen_tien_ngan_hang',
145
+ 'finance_chuyen_tien_ngan_hang_2',
146
+ 'finance_credit_card',
147
+ 'finance_dat_lenh',
148
+ 'finance_jcb',
149
+ 'finance_legal_certifiacte',
150
+ 'finance_lien_ket_ngan_hang',
151
+ 'finance_lien_ket_ngan_hang_2',
152
+ 'finance_limit',
153
+ 'finance_master',
154
+ 'finance_money_arrow_down',
155
+ 'finance_money_arrow_up',
156
+ 'finance_money_bag',
157
+ 'finance_money_bag_plus',
158
+ 'finance_nap_tien_ngan_hang',
159
+ 'finance_nap_tien_ngan_hang_2',
160
+ 'finance_ngan_hang_1',
161
+ 'finance_ngan_hang_2',
162
+ 'finance_quan_ly',
163
+ 'finance_quan_ly_tai_khoan',
164
+ 'finance_rut_tien',
165
+ 'finance_rut_tien_ngan_hang',
166
+ 'finance_rut_tien_ngan_hang_2',
167
+ 'finance_safe_box',
168
+ 'finance_saving',
169
+ 'finance_stock',
170
+ 'finance_tax',
171
+ 'finance_visa',
172
+ 'finance_wallet',
173
+ 'finance_wallet_add',
174
+ 'finance_wallet_card',
175
+ 'gadgets_iphone',
176
+ 'gadgets_mobile',
177
+ 'gadgets_monitor',
178
+ 'gadgets_print',
179
+ 'gadgets_soft_disk',
180
+ 'logistics_delivery',
181
+ 'logistics_delivery_bike',
182
+ 'logistics_delivery_fast',
183
+ 'logistics_package',
184
+ 'logistics_package_cancel',
185
+ 'logistics_package_list',
186
+ 'maps_360',
187
+ 'maps_direction_45',
188
+ 'maps_location',
189
+ 'maps_map',
190
+ 'maps_pin',
191
+ 'maps_pin_round',
192
+ 'maps_pin_start',
193
+ 'maps_zoom_in',
194
+ 'maps_zoom_out',
195
+ 'media',
196
+ 'media_add',
197
+ 'media_camera',
198
+ 'media_camera_add',
199
+ 'media_camera_linked',
200
+ 'media_camera_switch',
201
+ 'media_collection',
202
+ 'media_control_point',
203
+ 'media_flash_on',
204
+ 'media_flashlight_on',
205
+ 'media_player_play_circle',
206
+ 'media_record',
207
+ 'media_repeat',
208
+ 'media_video',
209
+ 'media_volume',
210
+ 'media_volume_high',
211
+ 'media_volume_low',
212
+ 'media_volume_no',
213
+ 'media_volume_off',
214
+ 'momo_background_primary',
215
+ 'momo_background_white',
216
+ 'navigation_add_to_home',
217
+ 'navigation_app',
218
+ 'navigation_ar',
219
+ 'navigation_cash_in',
220
+ 'navigation_close',
221
+ 'navigation_close_circle',
222
+ 'navigation_close_circle_full',
223
+ 'navigation_full_screen',
224
+ 'navigation_menu',
225
+ 'navigation_minus_circle',
226
+ 'navigation_minus_circle_full',
227
+ 'navigation_more_action',
228
+ 'navigation_more_horiz',
229
+ 'navigation_more_vert',
230
+ 'navigation_plus',
231
+ 'navigation_plus_circle',
232
+ 'navigation_plus_circle_full',
233
+ 'navigation_qr_code',
234
+ 'navigation_remove_from_home',
235
+ 'navigation_scan_barcode',
236
+ 'navigation_search',
237
+ 'navigation_search_add',
238
+ 'navigation_search_minus',
239
+ 'notifications_alert_octagon',
240
+ 'notifications_alert_triangle',
241
+ 'notifications_bell',
242
+ 'notifications_bell_checked',
243
+ 'notifications_bell_no',
244
+ 'notifications_bell_setting',
245
+ 'notifications_bell_x',
246
+ 'notifications_check',
247
+ 'notifications_check_circle',
248
+ 'notifications_check_circle_full',
249
+ 'notifications_check_double',
250
+ 'notifications_circle_alert',
251
+ 'notifications_circle_question',
252
+ 'notifications_follow',
253
+ 'notifications_followed',
254
+ 'notifications_guide',
255
+ 'notifications_information',
256
+ 'notifications_x_octagon',
257
+ 'phone_call',
258
+ 'phone_call_mic_on',
259
+ 'phone_call_phone_calling',
260
+ 'phone_call_phonebook_outline',
261
+ 'reaction_dislike',
262
+ 'reaction_disliked',
263
+ 'reaction_heart',
264
+ 'reaction_heart_check',
265
+ 'reaction_heart_disable',
266
+ 'reaction_heart_full',
267
+ 'reaction_like',
268
+ 'reaction_liked',
269
+ 'reaction_star_check',
270
+ 'reaction_star_disable',
271
+ 'reaction_star_full',
272
+ 'reaction_star_half',
273
+ 'reaction_star_non',
274
+ 'security_account',
275
+ 'security_alert',
276
+ 'security_bug',
277
+ 'security_eye_off',
278
+ 'security_eye_open',
279
+ 'security_fingerprint',
280
+ 'security_hacker',
281
+ 'security_key',
282
+ 'security_keypass',
283
+ 'security_lock',
284
+ 'security_lock_no',
285
+ 'security_password',
286
+ 'security_phone_alert',
287
+ 'security_shield',
288
+ 'security_shield_check',
289
+ 'security_shield_setting_1',
290
+ 'security_shield_setting_2',
291
+ 'security_unlock',
292
+ 'security_verified_face_id',
293
+ 'shopping_add',
294
+ 'shopping_bag',
295
+ 'shopping_bag_shopping',
296
+ 'shopping_bill',
297
+ 'shopping_cart',
298
+ 'shopping_check',
299
+ 'shopping_coupon',
300
+ 'shopping_coupon_percent',
301
+ 'shopping_coupon_star',
302
+ 'shopping_fast_food',
303
+ 'shopping_free',
304
+ 'shopping_gift_box',
305
+ 'shopping_gift_card',
306
+ 'shopping_scan_money',
307
+ 'shopping_store',
308
+ 'shopping_tag',
309
+ 'shopping_x',
310
+ 'time_alarm',
311
+ 'time_alarm_check',
312
+ 'time_calendar_1',
313
+ 'time_calendar_2',
314
+ 'time_calendar_add',
315
+ 'time_calendar_checked',
316
+ 'time_calendar_edit',
317
+ 'time_calendar_fire',
318
+ 'time_calendar_heart',
319
+ 'time_calendar_setting',
320
+ 'time_calendar_star',
321
+ 'time_calendar_x',
322
+ 'time_clock',
323
+ 'time_clock_reset',
324
+ 'time_note',
325
+ 'time_stop_watch',
326
+ 'travel_air_conditional',
327
+ 'travel_apartment',
328
+ 'travel_apartment_hotel',
329
+ 'travel_apartments',
330
+ 'travel_bathtub',
331
+ 'travel_bed',
332
+ 'travel_bed_single',
333
+ 'travel_bike',
334
+ 'travel_bus',
335
+ 'travel_business',
336
+ 'travel_camping',
337
+ 'travel_car',
338
+ 'travel_children_area',
339
+ 'travel_environment_friendly',
340
+ 'travel_family',
341
+ 'travel_fridge',
342
+ 'travel_healing',
343
+ 'travel_historical_place',
344
+ 'travel_homestay',
345
+ 'travel_kitchen',
346
+ 'travel_led_light',
347
+ 'travel_luxury_place',
348
+ 'travel_luxury_place_2',
349
+ 'travel_outdoor_table',
350
+ 'travel_people_baby',
351
+ 'travel_people_kid',
352
+ 'travel_people_man',
353
+ 'travel_people_wheelchair',
354
+ 'travel_plane',
355
+ 'travel_plane_landing',
356
+ 'travel_plane_take_off',
357
+ 'travel_pool',
358
+ 'travel_private_room',
359
+ 'travel_resort',
360
+ 'travel_romantic',
361
+ 'travel_romantical_place',
362
+ 'travel_ship',
363
+ 'travel_subway',
364
+ 'travel_suitcase',
365
+ 'travel_taxi',
366
+ 'travel_tram',
367
+ 'travel_van',
368
+ 'travel_villa',
369
+ ];
370
+
371
+ /** Legacy key -> replacement key in the new set. Legacy keys keep rendering. */
372
+ const DEPRECATED_ICONS: { [key: string]: string } = {
373
+ Phonebook: 'phone_call_phonebook_outline',
374
+ 'arrow-back': 'arrow_back',
375
+ 'arrow_arrow-down': 'arrow_down',
376
+ 'arrow_arrow-next': 'arrow_next',
377
+ 'arrow_arrow-top': 'arrow_top',
378
+ arrow_arrow_bold_forward: 'arrow_bold_forward',
379
+ arrow_arrow_reply: 'arrow_reply',
380
+ arrow_arrow_undo: 'arrow_undo_2',
381
+ arrow_undo: 'arrow_undo_1',
382
+ basic_Moon: 'basic_moon',
383
+ chat_back_space: 'chatting_back_space',
384
+ chat_comment: 'chatting_comment',
385
+ chat_comment_delete: 'chatting_comment_delete',
386
+ chat_comment_empty: 'chatting_comment_empty',
387
+ chat_q_and_a: 'chatting_q_and_a_right',
388
+ chat_sent: 'chatting_sent',
389
+ chat_sticker: 'chatting_sticker',
390
+ connection_share: 'connection_share_1',
391
+ file_Billsetting: 'file_bill_setting',
392
+ file_clipboard_checked: 'file_clipboard_check',
393
+ file_plus: 'file_file_plus',
394
+ file_search: 'file_file_search',
395
+ file_text: 'file_file_text',
396
+ finance_safe: 'finance_safe_box',
397
+ help_center: 'basic_help_center_1',
398
+ logicstics_delivery: 'logistics_delivery',
399
+ logicstics_delivery_fast: 'logistics_delivery_fast',
400
+ logicstics_delivey_bike: 'logistics_delivery_bike',
401
+ logicstics_package: 'logistics_package',
402
+ logicstics_package_cancel: 'logistics_package_cancel',
403
+ logicstics_package_list: 'logistics_package_list',
404
+ navigation_AR: 'navigation_ar',
405
+ navigation_close_circle_full_2: 'navigation_close_circle_full',
406
+ navigation_qrcode: 'navigation_qr_code',
407
+ phonebook_outline: 'phone_call_phonebook_outline',
408
+ security_verifiedface_id: 'security_verified_face_id',
409
+ time_calendar: 'time_calendar_1',
410
+ travel_airconditional: 'travel_air_conditional',
411
+ 'travel_bed-single': 'travel_bed_single',
412
+ travel_kid_area: 'travel_children_area',
413
+ travel_led_Light: 'travel_led_light',
414
+ travel_people_family: 'travel_family',
415
+ };
416
+
417
+ const NEW_ICONS: { [key: string]: { uri: string } } = Object.fromEntries(
418
+ NEW_ICON_KEYS.map(key => [key, { uri: `${NEW_ICON_BASE_URL}${key}.png` }]),
419
+ );
420
+
421
+ const OLD_ICONS: IconMap = IconSources;
422
+ const FALLBACK_ICON = 'ic_warning';
423
+
424
+ /**
425
+ * Multicolor brand glyphs that keep their own colors; tinting turns them into
426
+ * solid blocks. Parity with native `noThemeIcons`.
427
+ */
428
+ const NO_THEME_ICONS = new Set<string>([
429
+ 'ic_round_momo_tiny',
430
+ 'finance_card_visa',
431
+ 'finance_card_jcb',
432
+ 'finance_card_master',
433
+ 'finance_visa',
434
+ 'finance_jcb',
435
+ 'finance_master',
436
+ 'momo_background_white',
437
+ 'momo_background_primary',
438
+ ]);
439
+
440
+ const isNoThemeIcon = (source: string) => NO_THEME_ICONS.has(source);
441
+
442
+ const warnedKeys = new Set<string>();
443
+
444
+ /**
445
+ * Warns once per key in dev when a deprecated icon name is used, pointing to
446
+ * its replacement in the new icon set.
447
+ */
448
+ const warnDeprecatedIcon = (source: string) => {
449
+ const replacement = DEPRECATED_ICONS[source];
450
+ if (!__DEV__ || !replacement || warnedKeys.has(source)) {
451
+ return;
452
+ }
453
+ warnedKeys.add(source);
454
+ console.warn(
455
+ `[@momo-kits] Icon "${source}" is deprecated, use "${replacement}" instead.`,
456
+ );
457
+ };
458
+
459
+ /**
460
+ * Resolves an icon name or URL to an image source. Lookup order: new set,
461
+ * old set, then `ic_warning`.
462
+ */
463
+ const getIconSource = (source: string): { uri: string } => {
464
+ if (!source || source.includes('http')) {
465
+ return { uri: source };
466
+ }
467
+ warnDeprecatedIcon(source);
468
+ const icon = NEW_ICONS[source] ?? OLD_ICONS[source];
469
+ return icon ?? OLD_ICONS[FALLBACK_ICON];
470
+ };
471
+
10
472
  /**
11
473
  * Tinted icon from the bundled icon map (unknown names fall back to
12
- * `ic_warning`) or from a URL. `color={null}` keeps the image's own colors.
474
+ * `ic_warning`) or from a URL; the new icon set wins over the old one.
475
+ * `color={null}` keeps the image's own colors, as do multicolor brand icons.
13
476
  */
14
477
  const Icon: React.FC<IconProps> = ({
15
478
  source = 'ic_back',
@@ -23,22 +486,15 @@ const Icon: React.FC<IconProps> = ({
23
486
 
24
487
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
25
488
 
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
-
34
489
  const tintColor = color ?? theme.colors.text.default;
35
- const tintColorProps = color !== null && { tintColor };
490
+ const tintColorProps = color !== null &&
491
+ !isNoThemeIcon(source) && { tintColor };
36
492
 
37
493
  return (
38
494
  <Image
39
495
  {...props}
40
496
  loading={false}
41
- source={getIconSource()}
497
+ source={getIconSource(source)}
42
498
  style={[
43
499
  style,
44
500
  { width: size, height: size },
@@ -54,4 +510,10 @@ const styles = StyleSheet.create({
54
510
  debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
55
511
  });
56
512
 
57
- export { Icon, IconSources, IconBankSources };
513
+ export {
514
+ Icon,
515
+ IconSources,
516
+ IconBankSources,
517
+ NEW_ICONS as IconNewSources,
518
+ DEPRECATED_ICONS as IconDeprecatedSources,
519
+ };
package/Icon/types.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { ImageStyle, StyleProp } from 'react-native';
1
+ import { ImageStyle } from 'react-native-fast-image';
2
+ import { StyleProp } from 'react-native';
2
3
 
3
4
  export type IconProps = {
4
5
  /**
package/Image/index.tsx CHANGED
@@ -1,11 +1,6 @@
1
1
  import React, { useContext, useRef, useState } from 'react';
2
- import {
3
- ImageBackground,
4
- ImageSourcePropType,
5
- StyleSheet,
6
- View,
7
- } from 'react-native';
8
- import FastImage, { FastImageProps } from 'react-native-fast-image';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import FastImage from 'react-native-fast-image';
9
4
  import styles from './styles';
10
5
  import {
11
6
  ApplicationContext,
@@ -29,10 +24,6 @@ export const getImageName = (source: any): string => {
29
24
  return '';
30
25
  };
31
26
 
32
- const isDataUriSource = (source: any): boolean => {
33
- return typeof source?.uri === 'string' && source.uri.startsWith('data:');
34
- };
35
-
36
27
  /**
37
28
  * FastImage that shows a skeleton while loading (if `loading`) or inside a
38
29
  * loading `SkeletonProvider`, and a fail icon on error.
@@ -57,7 +48,6 @@ const Image: React.FC<ImageProps> = ({
57
48
  const [status, setStatus] = useState<Status>('success');
58
49
 
59
50
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
60
- const useFastImage = !isDataUriSource(source);
61
51
 
62
52
  const imageName = getImageName(source);
63
53
  let accessibilityLabel: any = `img|${imageName}`;
@@ -91,61 +81,16 @@ const Image: React.FC<ImageProps> = ({
91
81
  return children;
92
82
  };
93
83
 
94
- if (!useFastImage) {
95
- // RN <Image> throws when given children (skeleton / fail icon), so use
96
- // ImageBackground, which renders them on top of the image like FastImage.
97
- return (
98
- <ImageBackground
99
- {...(rest as any)}
100
- {...{
101
- accessibilityLabel: rest.accessibilityLabel ?? accessibilityLabel,
102
- }}
103
- source={source as ImageSourcePropType}
104
- style={[
105
- styles.dataUriContainer,
106
- styles.container,
107
- style,
108
- showBaseLineDebug && styles.debugBaseLine,
109
- ]}
110
- onLoadStart={() => {
111
- hasErrorRef.current = false;
112
- if (status !== 'loading' && loading) {
113
- setStatus('loading');
114
- }
115
- }}
116
- onLoad={() => {
117
- hasErrorRef.current = false;
118
- }}
119
- onLoadEnd={() => {
120
- let current: Status = 'success';
121
- if (hasErrorRef.current) {
122
- current = 'error';
123
- }
124
- setStatus(prevState =>
125
- prevState !== current ? current : prevState,
126
- );
127
- }}
128
- onError={() => {
129
- hasErrorRef.current = true;
130
- }}
131
- >
132
- {renderContent()}
133
- </ImageBackground>
134
- );
135
- }
136
-
137
84
  return (
138
85
  <FastImage
139
86
  {...rest}
140
87
  {...{ accessibilityLabel: rest.accessibilityLabel ?? accessibilityLabel }}
141
88
  source={source}
142
- style={
143
- [
144
- styles.container,
145
- style,
146
- showBaseLineDebug && styles.debugBaseLine,
147
- ] as FastImageProps['style']
148
- }
89
+ style={[
90
+ styles.container,
91
+ style,
92
+ showBaseLineDebug && styles.debugBaseLine,
93
+ ]}
149
94
  onProgress={event => {
150
95
  hasErrorRef.current = false;
151
96
  if (status !== 'loading' && loading) {
package/Image/styles.ts CHANGED
@@ -3,7 +3,5 @@ import { Colors } from '../Consts';
3
3
 
4
4
  export default StyleSheet.create({
5
5
  container: {},
6
- // same clipping as FastImage's container, so borderRadius rounds the image
7
- dataUriContainer: { overflow: 'hidden' },
8
6
  debugBaseLine: { borderWidth: 1, borderColor: Colors.green_06 },
9
7
  });
package/Image/types.ts CHANGED
@@ -1,14 +1,6 @@
1
- import { ImageStyle, StyleProp } from 'react-native';
2
1
  import { FastImageProps } from 'react-native-fast-image';
3
2
 
4
- /**
5
- * `style` uses React Native's own `ImageStyle`: from RN 0.87 (Strict TS API)
6
- * react-native no longer exports `FlexStyle`/`ShadowStyleIOS`, which
7
- * react-native-fast-image's `ImageStyle` extends, so that type lost layout
8
- * props such as `width`, `margin*` or `position`.
9
- */
10
- export interface ImageProps extends Omit<FastImageProps, 'style'> {
11
- style?: StyleProp<ImageStyle>;
3
+ export interface ImageProps extends FastImageProps {
12
4
  loading?: boolean;
13
5
  accessibilityLabel?: any;
14
6
  params?: any;
package/Input/Input.tsx CHANGED
@@ -6,10 +6,10 @@ import React, {
6
6
  useState,
7
7
  } from 'react';
8
8
  import {
9
+ TextInput,
9
10
  TextInputFocusEvent,
10
11
  TouchableOpacity,
11
12
  View,
12
- type TextInputInstance,
13
13
  } from 'react-native';
14
14
  import { useComponentId } from '../Application';
15
15
  import { Icon } from '../Icon';
@@ -81,7 +81,7 @@ const Input = forwardRef(
81
81
  const [isFocused, setIsFocused] = useState(false);
82
82
  const [internalText, setInternalText] = useState(defaultValue || '');
83
83
  const hasValue = value !== undefined ? !!value : !!internalText;
84
- const inputRef = useRef<TextInputInstance | null>(null);
84
+ const inputRef = useRef<TextInput | null>(null);
85
85
  const componentName = 'Input';
86
86
 
87
87
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
@@ -7,12 +7,7 @@ import React, {
7
7
  useRef,
8
8
  useState,
9
9
  } from 'react';
10
- import {
11
- Platform,
12
- TextInputFocusEvent,
13
- View,
14
- type TextInputInstance,
15
- } from 'react-native';
10
+ import { Platform, TextInput, TextInputFocusEvent, View } from 'react-native';
16
11
  import { useComponentId } from '../Application';
17
12
  import { ComponentContext, MiniAppContext } from '../Context';
18
13
  import { ErrorView } from './ErrorView';
@@ -61,7 +56,7 @@ const InputMoney = forwardRef(
61
56
  const [displayValue, setDisplayValue] = useState('');
62
57
  const [numericValue, setNumericValue] = useState('');
63
58
  const [lastDisplayValue, setLastDisplayValue] = useState('');
64
- const inputRef = useRef<TextInputInstance>(null);
59
+ const inputRef = useRef<TextInput>(null);
65
60
  const caretDigitsAfter = useRef<number | undefined>(undefined);
66
61
  const lastRawText = useRef('');
67
62
  const [caretSelection, setCaretSelection] = useState<{
@@ -2,11 +2,11 @@ import React, { RefObject, useContext } from 'react';
2
2
  import {
3
3
  Pressable,
4
4
  Text,
5
+ TextInput,
5
6
  TextInputFocusEvent,
6
7
  TextInputProps,
7
8
  TouchableOpacity,
8
9
  View,
9
- type TextInputInstance,
10
10
  } from 'react-native';
11
11
  import { ApplicationContext } from '../Context';
12
12
  import { Icon } from '../Icon';
@@ -43,7 +43,7 @@ type InputMoneyViewProps = Pick<
43
43
  componentId: string;
44
44
  displayValue: string;
45
45
  caretSelection?: { start: number; end: number };
46
- inputRef: RefObject<TextInputInstance | null>;
46
+ inputRef: RefObject<TextInput | null>;
47
47
  focusAtEnd: () => void;
48
48
  onClearText: () => void;
49
49
  onChangeText: (text: string) => void;
@@ -9,10 +9,10 @@ import React, {
9
9
  } from 'react';
10
10
  import {
11
11
  PixelRatio,
12
+ TextInput,
12
13
  TextInputFocusEvent,
13
14
  TouchableOpacity,
14
15
  View,
15
- type TextInputInstance,
16
16
  } from 'react-native';
17
17
  import Animated, {
18
18
  cancelAnimation,
@@ -116,7 +116,7 @@ const InputOTP = forwardRef(
116
116
  ) => {
117
117
  const [value, setValue] = useState('');
118
118
  const [isFocused, setIsFocused] = useState(false);
119
- const inputRef = useRef<TextInputInstance | null>(null);
119
+ const inputRef = useRef<TextInput | null>(null);
120
120
  const { theme } = useContext(ApplicationContext);
121
121
  const context = useContext<any>(MiniAppContext);
122
122
 
@@ -7,10 +7,10 @@ import React, {
7
7
  } from 'react';
8
8
  import {
9
9
  StyleSheet,
10
+ TextInput,
10
11
  TextInputFocusEvent,
11
12
  TouchableOpacity,
12
13
  View,
13
- type TextInputInstance,
14
14
  } from 'react-native';
15
15
  import { useComponentId } from '../Application';
16
16
  import {
@@ -76,7 +76,7 @@ const InputPhoneNumber = forwardRef(
76
76
  const [isFocused, setIsFocused] = useState(false);
77
77
  const [internalText, setInternalText] = useState(defaultValue || '');
78
78
  const hasValue = value !== undefined ? !!value : !!internalText;
79
- const inputRef = useRef<TextInputInstance | null>(null);
79
+ const inputRef = useRef<TextInput | null>(null);
80
80
  const componentName = 'InputPhoneNumber';
81
81
 
82
82
  const showBaseLineDebug = context?.features?.showBaseLineDebug ?? false;
@@ -7,10 +7,10 @@ import React, {
7
7
  useState,
8
8
  } from 'react';
9
9
  import {
10
+ TextInput,
10
11
  TextInputFocusEvent,
11
12
  TouchableOpacity,
12
13
  View,
13
- type TextInputInstance,
14
14
  } from 'react-native';
15
15
  import { useComponentId } from '../Application';
16
16
  import { HeaderBarMetrics } from '../Application/headerLayout';
@@ -76,7 +76,7 @@ const InputSearch: ForwardRefRenderFunction<InputRef, InputSearchProps> = (
76
76
  const [internalText, setInternalText] = useState(defaultValue || '');
77
77
  const currentValue = value !== undefined ? value : internalText;
78
78
  const hasValue = !!currentValue;
79
- const inputRef = useRef<TextInputInstance | null>(null);
79
+ const inputRef = useRef<TextInput | null>(null);
80
80
 
81
81
  const componentName = 'InputSearch';
82
82
 
@@ -7,10 +7,10 @@ import React, {
7
7
  useState,
8
8
  } from 'react';
9
9
  import {
10
+ TextInput,
10
11
  TextInputFocusEvent,
11
12
  TouchableOpacity,
12
13
  View,
13
- type TextInputInstance,
14
14
  } from 'react-native';
15
15
  import { setAutomationID, useComponentId } from '../Application';
16
16
  import { ApplicationContext, MiniAppContext } from '../Context';
@@ -70,7 +70,7 @@ const InputTextArea = forwardRef(
70
70
  const inputFontFamily = exportFontFamily('regular');
71
71
  const [isFocused, setIsFocused] = useState(false);
72
72
  const [inputValue, setInputValue] = useState(defaultValue ?? '');
73
- const inputRef = useRef<TextInputInstance | null>(null);
73
+ const inputRef = useRef<TextInput | null>(null);
74
74
 
75
75
  useEffect(() => {
76
76
  setInputValue(value ?? '');
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
2
  import React, { FC, useEffect, useRef } from 'react';
3
- import { TextInput, type TextInputInstance } from 'react-native';
3
+ import { TextInput } from 'react-native';
4
4
  import { useScaleSize, exportFontFamily } from '../Text';
5
5
  import styles from './styles';
6
6
 
@@ -13,7 +13,7 @@ export const TextTyping: FC<any> = ({
13
13
  timeDelayEnd = 2000,
14
14
  timeDelayNextChar = 20,
15
15
  }) => {
16
- const textRef = useRef<TextInputInstance>(null);
16
+ const textRef = useRef<TextInput>(null);
17
17
  const scaledFontSize = useScaleSize(12);
18
18
  const typingFontFamily = exportFontFamily('regular');
19
19
 
@@ -4,12 +4,11 @@ import {
4
4
  TextInput,
5
5
  TextInputProps,
6
6
  TouchableOpacity,
7
- type TextInputInstance,
8
7
  } from 'react-native';
9
8
  import { Styles } from '../Consts';
10
9
 
11
10
  interface SystemTextInputProps extends TextInputProps {
12
- ref?: React.RefObject<TextInputInstance | null>;
11
+ ref?: React.RefObject<TextInput | null>;
13
12
  }
14
13
 
15
14
  /**
@@ -1,11 +1,6 @@
1
1
  /* eslint-disable react-hooks/exhaustive-deps */
2
2
  import React, { FC, memo, useEffect, useRef } from 'react';
3
- import {
4
- Platform,
5
- TextInput,
6
- TextStyle,
7
- type TextInputInstance,
8
- } from 'react-native';
3
+ import { Platform, TextInput, TextStyle } from 'react-native';
9
4
  import { Colors } from '../Consts';
10
5
  import { useScaleSize, exportFontFamily } from '../Text';
11
6
 
@@ -26,7 +21,7 @@ const TextTyping: FC<TextTypingProps> = ({
26
21
  timeDelayNextChar = 20,
27
22
  inputStyle = {},
28
23
  }) => {
29
- const textRef = useRef<TextInputInstance>(null);
24
+ const textRef = useRef<TextInput>(null);
30
25
  const scaledFontSize = useScaleSize(12);
31
26
  const inputFontFamily = exportFontFamily('regular');
32
27
 
@@ -1,8 +1,4 @@
1
- import {
2
- ScrollViewProps,
3
- ViewStyle,
4
- type ScrollViewInstance,
5
- } from 'react-native';
1
+ import {ScrollView, ScrollViewProps, ViewStyle} from 'react-native';
6
2
  import {Ref} from 'react';
7
3
 
8
4
  export type PaginationProps = {
@@ -36,7 +32,7 @@ export interface ScrollIndicatorProps extends ScrollViewProps {
36
32
  * Optional. Represents a reference to the ScrollView component.
37
33
  * It can be used to access the instance methods of the ScrollView.
38
34
  */
39
- scrollViewRef?: Ref<ScrollViewInstance>;
35
+ scrollViewRef?: Ref<ScrollView>;
40
36
  }
41
37
 
42
38
  export type ChildPaginationProps = Omit<PaginationProps, 'type'>;
package/package.json CHANGED
@@ -1,41 +1,39 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.169.16-beta.3",
3
+ "version": "0.169.16-beta.30",
4
4
  "description": "React Native Component Kits",
5
+ "main": "index.ts",
6
+ "scripts": {},
5
7
  "keywords": [
6
8
  "@momo-kits/foundation"
7
9
  ],
8
- "license": "MoMo",
9
- "main": "index.ts",
10
- "publishConfig": {
11
- "registry": "https://registry.npmjs.org/"
12
- },
13
- "scripts": {},
14
10
  "dependencies": {
15
- "@react-navigation/bottom-tabs": "7.21.0",
16
- "@react-navigation/core": "7.24.0",
17
- "@react-navigation/elements": "2.9.45",
18
- "@react-navigation/native": "7.5.1",
19
- "@react-navigation/routers": "7.6.5",
20
- "@react-navigation/stack": "7.12.1",
21
- "@shopify/flash-list": "2.1.0",
22
- "lottie-react-native": "7.3.6",
23
11
  "react-native-fast-image": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-fast-image.git#v8.11.0",
24
- "react-native-gesture-handler": "3.4.0",
12
+ "@react-navigation/bottom-tabs": "7.4.2",
13
+ "@react-navigation/core": "7.12.1",
14
+ "@react-navigation/elements": "2.5.2",
15
+ "@react-navigation/native": "7.1.14",
16
+ "@react-navigation/routers": "7.4.1",
17
+ "@react-navigation/stack": "7.4.2",
18
+ "react-native-gesture-handler": "2.27.1",
25
19
  "react-native-linear-gradient": "git+https://oauth2:TGi6oBj-LdzsKpLXQSoH@gitlab.mservice.com.vn/momo-platform/public/react-native-linear-gradient#v3.0.0",
26
- "react-native-reanimated": "4.7.1",
27
- "react-native-safe-area-context": "5.7.0",
28
- "react-native-reserved-regions": "0.2.0"
29
- },
30
- "devDependencies": {
31
- "@types/color": "3.0.6",
32
- "react-native-reanimated": "4.7.1",
33
- "react-native-worklets": "0.13.0"
20
+ "react-native-reanimated": "4.1.3",
21
+ "react-native-worklets": "0.6.1",
22
+ "react-native-safe-area-context": "5.5.2",
23
+ "react-native-reserved-regions": "0.2.0",
24
+ "@shopify/flash-list": "2.1.0",
25
+ "lottie-react-native": "7.2.4"
34
26
  },
35
27
  "peerDependencies": {
36
28
  "react-native": "*",
37
29
  "react-native-svg": "*",
38
- "react-native-reanimated": ">=4.7.0",
39
- "react-native-worklets": ">=0.13.0"
40
- }
30
+ "react-native-worklets": "0.6.1"
31
+ },
32
+ "devDependencies": {
33
+ "@types/color": "3.0.6"
34
+ },
35
+ "publishConfig": {
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "license": "MoMo"
41
39
  }