@momo-kits/native-kits 0.169.8-beta.7-debug → 0.169.8

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 (157) hide show
  1. package/ios/Input/InputSearch.swift +6 -23
  2. package/ios/Navigation/BottomTab/BottomTabBar.swift +0 -9
  3. package/ios/Navigation/Component/Header.swift +46 -31
  4. package/ios/Navigation/Component/HeaderJourney.swift +1 -2
  5. package/ios/Navigation/Component/HeaderLocation.swift +1 -2
  6. package/ios/Navigation/Component/HeaderRight.swift +15 -18
  7. package/ios/Navigation/Component/HeaderUser.swift +1 -2
  8. package/ios/Navigation/Component/SideBar.swift +13 -4
  9. package/ios/Navigation/Navigation.swift +1 -31
  10. package/ios/Navigation/StackScreen.swift +14 -43
  11. package/ios/native-kits.podspec +1 -1
  12. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  13. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/AnimatedHeaderDemo.swift +2 -11
  14. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +1 -13
  15. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +0 -11
  16. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/PopupNotifyDemo.swift +1 -1
  17. package/package.json +1 -1
  18. package/build.gradle.kts +0 -11
  19. package/compose/build.gradle.kts +0 -198
  20. package/compose/compose.podspec +0 -47
  21. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
  22. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  23. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  24. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  25. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -154
  26. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +0 -17
  27. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +0 -6
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -110
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +0 -62
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -1067
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -267
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -115
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -482
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -86
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -224
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -195
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -473
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -113
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -263
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -228
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -280
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -183
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -40
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -82
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -39
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -363
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -108
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -307
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -88
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -306
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -457
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -205
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -89
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -542
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -86
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -120
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -201
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -210
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -180
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -12
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -194
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -292
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +0 -63
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +0 -184
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -316
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -397
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -153
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -118
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -422
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -746
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -242
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -400
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -100
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +0 -97
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +0 -207
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +0 -132
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -167
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -446
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -105
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -106
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -398
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -39
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -197
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -133
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -114
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -76
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +0 -7
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +0 -22
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  141. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -42
  142. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  143. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  144. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  145. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  146. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -218
  147. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +0 -48
  148. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +0 -144
  149. package/gradle/libs.versions.toml +0 -67
  150. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  151. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  152. package/gradle.properties +0 -24
  153. package/gradlew +0 -252
  154. package/gradlew.bat +0 -94
  155. package/ios/Layout/HeaderLayout.swift +0 -60
  156. package/ios-demo/README.md +0 -120
  157. package/settings.gradle.kts +0 -64
@@ -34,7 +34,6 @@ public struct StackScreen<Content: View>: View {
34
34
  var layoutOffset: CGFloat
35
35
  var inputSearchProps: InputSearchProps?
36
36
  var fabProps: FabProps?
37
- var contentLayout: ContentLayout = .grid
38
37
  var screenName: String = ""
39
38
  var content: () -> Content
40
39
 
@@ -66,7 +65,6 @@ public struct StackScreen<Content: View>: View {
66
65
  layoutOffset: CGFloat = 56,
67
66
  inputSearchProps: InputSearchProps? = nil,
68
67
  fabProps: FabProps? = nil,
69
- contentLayout: ContentLayout = .grid,
70
68
  screenName: String = "",
71
69
  @ViewBuilder content: @escaping () -> Content
72
70
  ) {
@@ -97,7 +95,6 @@ public struct StackScreen<Content: View>: View {
97
95
  self.layoutOffset = layoutOffset
98
96
  self.inputSearchProps = inputSearchProps
99
97
  self.fabProps = fabProps
100
- self.contentLayout = contentLayout
101
98
  self.screenName = screenName
102
99
  self.content = content
103
100
  }
@@ -164,16 +161,6 @@ public struct StackScreen<Content: View>: View {
164
161
  && inputSearchProps == nil && !headerTransparent && !fullScreenContent
165
162
  }
166
163
 
167
- /// Bottom room for the tab's content: clear of the floating bar, unless the tab runs edge to edge
168
- /// (`floatingTabBarEdgeToEdge()`), when it also covers the home indicator that BottomTab keeps clear of
169
- /// (a negative inset extends the content past the tab's frame).
170
- private var contentBottomInset: CGFloat {
171
- guard let navigation, navigation.bottomTabIndex != -1, navigation.bottomTabEdgeToEdge else {
172
- return duoTabBarInsets.overlay
173
- }
174
- return -layout.insets.bottom
175
- }
176
-
177
164
  /// iPhone Duo: the header leaves with the content and slides back in on a reverse scroll
178
165
  /// (RN DuoQuickReturnHeader). The side bar is drawn apart from the header, so it stays put.
179
166
  private var useQuickReturn: Bool {
@@ -310,7 +297,6 @@ public struct StackScreen<Content: View>: View {
310
297
  }
311
298
  }
312
299
  .ignoresSafeArea(.keyboard, edges: .bottom)
313
- .environment(\.contentLayout, contentLayout)
314
300
  .onChange(of: scrollOffset) { updateHeaderHide($0) }
315
301
  .onAppear { reportEmptySideBar() }
316
302
  .onChange(of: showsSideBar) { _ in reportEmptySideBar() }
@@ -393,7 +379,7 @@ public struct StackScreen<Content: View>: View {
393
379
  scrollOffset: $scrollOffset,
394
380
  scrollToTopCallback: scrollToTopCallback,
395
381
  animatedSearchInset: animatedSearchInset,
396
- bottomInset: contentBottomInset,
382
+ bottomInset: duoTabBarInsets.overlay,
397
383
  snapDistance: searchSnapDistance,
398
384
  onScrollIdle: settleHeader,
399
385
  content: { animatedHeroBody(animatedHeader) }
@@ -426,7 +412,7 @@ public struct StackScreen<Content: View>: View {
426
412
  scrollOffset: $scrollOffset,
427
413
  scrollToTopCallback: scrollToTopCallback,
428
414
  animatedSearchInset: animatedSearchInset,
429
- bottomInset: contentBottomInset,
415
+ bottomInset: duoTabBarInsets.overlay,
430
416
  snapDistance: searchSnapDistance,
431
417
  onScrollIdle: settleHeader,
432
418
  content: { duoInsetContent }
@@ -447,7 +433,7 @@ public struct StackScreen<Content: View>: View {
447
433
  scrollOffset: $scrollOffset,
448
434
  scrollToTopCallback: scrollToTopCallback,
449
435
  topInset: layout.headerHeight - layout.insets.top,
450
- bottomInset: contentBottomInset,
436
+ bottomInset: duoTabBarInsets.overlay,
451
437
  snapDistance: searchSnapDistance,
452
438
  onScrollIdle: settleHeader,
453
439
  content: content
@@ -493,7 +479,7 @@ public struct StackScreen<Content: View>: View {
493
479
  scrollOffset: $scrollOffset,
494
480
  scrollToTopCallback: scrollToTopCallback,
495
481
  animatedSearchInset: animatedSearchInset,
496
- bottomInset: contentBottomInset,
482
+ bottomInset: duoTabBarInsets.overlay,
497
483
  snapDistance: searchSnapDistance,
498
484
  onScrollIdle: settleHeader,
499
485
  content: content
@@ -510,28 +496,18 @@ public struct StackScreen<Content: View>: View {
510
496
  }
511
497
 
512
498
  private func heroGlassStart(_ animatedHeader: AnimatedHeader) -> CGFloat {
513
- max(bannerWidth / animatedHeader.aspectRatio.value - layout.headerHeight, 0)
514
- }
515
-
516
- /// Wide windows keep the phone banner size, centered; phones fill the width.
517
- private var bannerWidth: CGFloat {
518
- layout.headerLayout(contentLayout).isWide ? HeaderLayoutMetrics.bannerWidth : layout.width
499
+ max(layout.width / animatedHeader.aspectRatio.value - layout.headerHeight, 0)
519
500
  }
520
501
 
521
502
  /// The banner fills the width at its aspect ratio; the body starts `layoutOffset` below the
522
- /// header band so it overlaps the banner's lower part. On wide windows `bannerBackgroundColor`
523
- /// fills the sides, fading out downward.
503
+ /// header band so it overlaps the banner's lower part.
524
504
  @ViewBuilder
525
505
  private func animatedHeroBody(_ animatedHeader: AnimatedHeader) -> some View {
526
- let width = bannerWidth
506
+ let width = layout.width
527
507
  let imageHeight = width / animatedHeader.aspectRatio.value
528
508
  let contentTopInset = layout.headerHeight + layoutOffset
529
509
 
530
510
  ZStack(alignment: .top) {
531
- if width < layout.width, let fill = animatedHeader.bannerBackgroundColor {
532
- LinearGradient(colors: [fill, fill.opacity(0)], startPoint: .top, endPoint: .bottom)
533
- .frame(width: layout.width, height: imageHeight)
534
- }
535
511
  animatedHeader.composable(scrollOffset)
536
512
  .frame(width: width, height: imageHeight)
537
513
  .clipped()
@@ -585,8 +561,7 @@ private struct StackScreenContent<Content: View>: View {
585
561
  /// Room for a header the content scrolls under (iPhone Duo glass header).
586
562
  var topInset: CGFloat = 0
587
563
  /// Room for the floating tab bar that overlays the content: scrolling content runs under it and
588
- /// ends clear of it, static content stays above it. Negative for an edge-to-edge tab: the content
589
- /// reaches that far past its frame.
564
+ /// ends clear of it, static content stays above it.
590
565
  var bottomInset: CGFloat = 0
591
566
  /// Compose's animated-search snap: a scroll that comes to rest part way through this distance
592
567
  /// finishes the move, up or back down.
@@ -647,8 +622,6 @@ private struct StackScreenContent<Content: View>: View {
647
622
  }
648
623
  }
649
624
  .coordinateSpace(name: scrollSpace)
650
- // an edge-to-edge tab's scroll reaches past its frame, under the home indicator
651
- .padding(.bottom, min(bottomInset, 0))
652
625
  .modifier(ScrollRest(offset: scrollOffset, onRest: scrollDidRest))
653
626
  // Status-bar tap (MoMoStatusBarTap swizzle) scrolls to top and notifies the consumer.
654
627
  .onReceive(NotificationCenter.default.publisher(for: MoMoStatusBarTap.notificationName)) { _ in
@@ -749,7 +722,6 @@ private struct SearchAnimatedHeader: View {
749
722
  var hasToolkit: Bool = false
750
723
 
751
724
  @Environment(\.screenLayout) private var layout
752
- @Environment(\.contentLayout) private var contentLayout
753
725
  @Environment(\.appTheme) private var theme
754
726
  @OptionalEnvironmentObject private var navigator: Navigator?
755
727
 
@@ -760,14 +732,14 @@ private struct SearchAnimatedHeader: View {
760
732
  let rowTop = layout.headerStatusBarHeight - layout.insets.top
761
733
  let minTop = rowTop + (layout.headerBarHeight - HEADER_HEIGHT) / 2
762
734
  let maxTop = layout.headerHeight - layout.insets.top
763
- // stretch screens on wide windows keep the search in the header's centered frame
764
- let minSide = layout.headerLayout(contentLayout).frameInset
765
- // collapsed on the iPhone Duo status bar row, the search stays between its clusters
735
+ let minSide = Spacing.M
736
+ // collapsed on the iPhone Duo status bar row, the search stays between its clusters (48pt back there)
766
737
  let clearance = layout.statusBarClearance
767
- let maxStart = (clearance?.left ?? 0) + (hiddenBack || useSideBar ? minSide : HeaderLayoutMetrics.buttonSize + minSide + HeaderLayoutMetrics.titleGap)
738
+ let backWidth: CGFloat = clearance != nil && !useSideBar ? DuoMetrics.controlSize : 28
739
+ let maxStart = (clearance?.left ?? 0) + (hiddenBack || useSideBar ? Spacing.M : backWidth + Spacing.M + Spacing.S)
768
740
  let maxEnd = (clearance?.right ?? 0) + (useSideBar && hasToolkit
769
- ? minSide
770
- : headerRightWidth + (hasHeaderRight ? minSide + Spacing.M : minSide))
741
+ ? Spacing.M
742
+ : headerRightWidth + (hasHeaderRight ? Spacing.M * 2 : Spacing.M))
771
743
 
772
744
  // one progress for all three, so the field docks with its final insets and never covers the toolkit
773
745
  let progress = min(scroll / HEADER_HEIGHT, 1)
@@ -783,7 +755,6 @@ private struct SearchAnimatedHeader: View {
783
755
  theme: theme,
784
756
  pop: navigator.map { navigator in { navigator.pop() } }
785
757
  ))
786
- .headerSize()
787
758
  .frame(height: HEADER_HEIGHT)
788
759
  .padding(.leading, start)
789
760
  .padding(.trailing, end)
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.8-beta.7'
3
+ s.version = '0.169.8'
4
4
  s.summary = 'MoMoUIKits for iOS'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKitsDemo'
3
- s.version = '0.169.8-beta.7'
3
+ s.version = '0.169.8'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -30,7 +30,6 @@ struct AnimatedHeaderDemoContent: View {
30
30
 
31
31
  @State private var ratio: AnimatedHeaderRatio = .ratio16_9
32
32
  @State private var isSurface = true
33
- @State private var isStretch = true
34
33
 
35
34
  private let imageUrl = "https://static.momocdn.net/app/img/booking/holiday/mid_atumn_dldl.jpeg"
36
35
 
@@ -48,11 +47,6 @@ struct AnimatedHeaderDemoContent: View {
48
47
  MomoText("Surface")
49
48
  }
50
49
 
51
- // wide windows (short side >= 600): phone-sized banner, sides filled with the banner color
52
- Toggle(isOn: $isStretch) {
53
- MomoText("Stretch content layout")
54
- }
55
-
56
50
  MoMoUIKits.Button(
57
51
  title: "Show Animated Header",
58
52
  action: show,
@@ -69,7 +63,6 @@ struct AnimatedHeaderDemoContent: View {
69
63
  private func show() {
70
64
  let ratio = ratio
71
65
  let isSurface = isSurface
72
- let contentLayout: ContentLayout = isStretch ? .stretch : .grid
73
66
  let url = imageUrl
74
67
  navigator.push(
75
68
  { AnimatedHeaderTargetScreen(ratio: ratio) },
@@ -84,10 +77,8 @@ struct AnimatedHeaderDemoContent: View {
84
77
  .frame(maxWidth: .infinity, maxHeight: .infinity)
85
78
  .clipped()
86
79
  )
87
- },
88
- bannerBackgroundColor: Colors.pink09
89
- ),
90
- contentLayout: contentLayout
80
+ }
81
+ )
91
82
  )
92
83
  )
93
84
  }
@@ -39,8 +39,6 @@ private struct DemoConfig: Hashable {
39
39
  var initialRouteName = "Momo"
40
40
  var compressionBehavior: DuoBarCompressionBehavior = .toolbar
41
41
  var backToInitialTab = true
42
- // a sticky footer in the tab's content body, to check it clears the floating bar
43
- var footer = false
44
42
 
45
43
  var visibleTabs: [TabConfig] { Array(tabs.prefix(tabCount)) }
46
44
  }
@@ -109,10 +107,7 @@ struct BottomTabDemoContent: View {
109
107
  icon: tab.icon,
110
108
  showDot: tab.showDot,
111
109
  badgeLabel: tab.badgeLabel,
112
- options: NavigationOptions(
113
- headerTitle: .default(tab.label),
114
- footer: config.footer ? { AnyView(demoFooter) } : nil
115
- ),
110
+ options: NavigationOptions(headerTitle: .default(tab.label)),
116
111
  screen: { TabContent(name: tab.name, config: $config, focused: $focused) }
117
112
  )
118
113
  },
@@ -129,10 +124,6 @@ struct BottomTabDemoContent: View {
129
124
  .onAppear { ctaLottieLoader.load() }
130
125
  }
131
126
 
132
- private var demoFooter: some View {
133
- MoMoUIKits.Button(title: "Footer trong content", action: {}, isFull: true)
134
- }
135
-
136
127
  private var floatingButton: BottomTabFloatingButton? {
137
128
  guard config.special else { return nil }
138
129
  guard config.ctaLottie else {
@@ -211,9 +202,6 @@ private struct TabContent: View {
211
202
  ])
212
203
  Options(title: "backToInitialTab", hint: "Back ở tab khác quay về tab đầu trước khi rời màn",
213
204
  options: yesNo(config.backToInitialTab) { config.backToInitialTab = $0 })
214
- Options(title: "footer",
215
- hint: "Footer dính trong content body, kiểm tra nó nằm trên thanh tab nổi",
216
- options: yesNo(config.footer) { config.footer = $0 })
217
205
  }
218
206
 
219
207
  Section(title: "Nút giữa (floatingButton)") {
@@ -273,9 +273,7 @@ private struct HeaderTypesScreen: View {
273
273
 
274
274
  @EnvironmentObject private var navigation: Navigation
275
275
  @Environment(\.applicationEnvironment) private var applicationEnvironment
276
- @Environment(\.screenLayout) private var layout
277
276
  @State private var kind: AnyHashable = Kind.default
278
- @State private var contentLayout: AnyHashable = ContentLayout.grid
279
277
  @State private var titlePosition: AnyHashable = TitlePosition.left
280
278
  @State private var showBack = true
281
279
  @State private var headerRight: AnyHashable = HeaderRightOption.toolkit
@@ -297,15 +295,6 @@ private struct HeaderTypesScreen: View {
297
295
  }, label: position == .left ? "LEFT" : "CENTER")
298
296
  }
299
297
  Divider()
300
- // stretch only differs on wide windows (short side >= 600, iPhone Duo excluded)
301
- let headerLayout = layout.headerLayout(contentLayout.base as? ContentLayout ?? .grid)
302
- MomoText("Content Layout · wide: \(headerLayout.isWide), frame inset: \(Int(headerLayout.frameInset))")
303
- ForEach([ContentLayout.grid, ContentLayout.stretch], id: \.self) { item in
304
- Radio(value: item, groupValue: $contentLayout, onChange: {
305
- navigation.setOptions { $0.contentLayout = item }
306
- }, label: item == .grid ? "Grid" : "Stretch")
307
- }
308
- Divider()
309
298
  Checkbox($showBack, onChange: { checked in
310
299
  navigation.setOptions { $0.hiddenBack = !checked }
311
300
  }, title: "Show Back")
@@ -14,7 +14,7 @@ struct PopupNotifyDemo: View {
14
14
  // MARK: - Preview
15
15
 
16
16
  // Figma Risk - eKYC (node 51445-177824)
17
- private let popupHighlightTitle = "Tạm khoá giao dịch để báo vệ bạn"
17
+ private let popupHighlightTitle = "Tạm khoá giao dịch để bảo vệ bạn"
18
18
  private let popupHighlightSentence =
19
19
  "Mỗi ngày có ít nhất 20 người bị lừa đảo hơn 100 triệu đồng trong các giao dịch có dấu hiệu tương tự"
20
20
  private let popupHighlightDescription =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.8-beta.7-debug",
3
+ "version": "0.169.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"
package/build.gradle.kts DELETED
@@ -1,11 +0,0 @@
1
- plugins {
2
- // this is necessary to avoid the plugins to be loaded multiple times
3
- // in each subproject's classloader
4
- alias(libs.plugins.android.application) apply false
5
- alias(libs.plugins.android.library) apply false
6
- alias(libs.plugins.compose) apply false
7
- alias(libs.plugins.kotlin.compose.compiler) apply false
8
- alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false
9
- alias(libs.plugins.jetbrains.kotlin.serialization) apply false
10
- alias(libs.plugins.vanniktech.mavenPublish) apply false
11
- }
@@ -1,198 +0,0 @@
1
- // import com.vanniktech.maven.publish.JavadocJar
2
- // import com.vanniktech.maven.publish.KotlinMultiplatform
3
- import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4
-
5
- plugins {
6
- alias(libs.plugins.jetbrains.kotlin.multiplatform)
7
- alias(libs.plugins.android.library)
8
- alias(libs.plugins.compose)
9
- alias(libs.plugins.kotlin.compose.compiler)
10
- // alias(libs.plugins.vanniktech.mavenPublish)
11
- id(libs.plugins.jetbrains.kotlin.cocoapods.get().pluginId)
12
- kotlin("plugin.serialization")
13
- }
14
-
15
- val gitlabName: String = findProperty("name") as String? ?: ""
16
- val gitlabRepo: String = findProperty("repo") as String? ?: ""
17
- val gitlabUrl: String = findProperty("url") as String? ?: ""
18
- val gitlabGroup: String = findProperty("group") as String? ?: ""
19
- val gitlabArtifactId: String = findProperty("artifact.id") as String? ?: ""
20
- val gitlabVersion: String = findProperty("version") as String? ?: ""
21
- val gitlabUser: String = findProperty("gitlab.user") as String? ?: ""
22
- val gitlabKey: String = findProperty("gitlab.password") as String? ?: ""
23
-
24
- kotlin {
25
- androidTarget {
26
- compilerOptions {
27
- jvmTarget.set(JvmTarget.JVM_17)
28
- }
29
- publishLibraryVariants("release")
30
- }
31
-
32
- val fwName = gitlabArtifactId
33
- val iosTargets = listOf(iosArm64(), iosSimulatorArm64())
34
- iosTargets.forEach {
35
- it.binaries.framework {
36
- baseName = fwName
37
- binaryOption("bundleId", "$gitlabGroup.$fwName")
38
- isStatic = true
39
- }
40
- }
41
-
42
- cocoapods {
43
- version = "0.169.8-beta.7-debug"
44
- summary = "IOS Shared module"
45
- homepage = "https://momo.vn"
46
- ios.deploymentTarget = "15.0"
47
-
48
- framework {
49
- baseName = fwName
50
- isStatic = true
51
- }
52
-
53
- pod("lottie-ios") {
54
- moduleName = "Lottie"
55
- version = "4.4.3"
56
- extraOpts += listOf("-compiler-option", "-fmodules")
57
- }
58
- }
59
-
60
- sourceSets {
61
- all {
62
- languageSettings.optIn("vn.momo.kits.modifier.InternalApi")
63
- }
64
- commonMain.dependencies {
65
- implementation(compose.runtime)
66
- implementation(compose.material)
67
- implementation(compose.material3)
68
- implementation(compose.components.resources)
69
- implementation(libs.compose.ui.backhandler)
70
- implementation(libs.ktor.client.core)
71
- implementation(libs.jetbrains.coroutines.core)
72
- implementation(libs.navigation.multiplatform)
73
- implementation(libs.coil.multiplatform.compose)
74
- implementation(libs.coil.multiplatform.core)
75
- implementation(libs.coil.multiplatform.network.ktor)
76
- implementation(libs.jetbrains.serialization.json)
77
- implementation(libs.kotlinx.datetime)
78
- api(libs.native.max.api)
79
- implementation(libs.compottie)
80
- implementation(libs.gif.image)
81
- }
82
- androidMain.dependencies {
83
- implementation(libs.ktor.client.okhttp)
84
- implementation(libs.airbnb.lottie)
85
- }
86
- iosMain.dependencies {
87
- implementation(libs.ktor.client.darwin)
88
- }
89
- }
90
- }
91
-
92
- android {
93
- namespace = "vn.momo.kits.kits"
94
- compileSdk = 35
95
- compileOptions {
96
- sourceCompatibility = JavaVersion.VERSION_17
97
- targetCompatibility = JavaVersion.VERSION_17
98
- }
99
- defaultConfig {
100
- minSdk = 24
101
- }
102
- }
103
-
104
- dependencies {
105
- }
106
-
107
- repositories {
108
- google {
109
- mavenContent {
110
- includeGroupAndSubgroups("androidx")
111
- includeGroupAndSubgroups("com.android")
112
- includeGroupAndSubgroups("com.google")
113
- }
114
- }
115
- mavenCentral()
116
- maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
117
- maven {
118
- url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
119
- credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
120
- }
121
- maven {
122
- url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
123
- credentials {
124
- username = "viewer"
125
- password = "viewer"
126
- }
127
- isAllowInsecureProtocol = true
128
- }
129
- }
130
-
131
- compose {
132
- resources {
133
- publicResClass = true
134
- packageOfResClass = "vn.momo.uikits.resources"
135
- generateResClass = always
136
- }
137
- }
138
-
139
- // publishing {
140
- // repositories {
141
- // maven {
142
- // name = "${gitlabRepo}Packages"
143
- // credentials {
144
- // username = gitlabUser
145
- // password = gitlabKey
146
- // }
147
- // url = uri("$gitlabUrl")
148
- // }
149
- // }
150
- // }
151
-
152
- // mavenPublishing {
153
- // configure(
154
- // KotlinMultiplatform(
155
- // javadocJar = JavadocJar.Empty(),
156
- // sourcesJar = true,
157
- // androidVariantsToPublish = listOf("release")
158
- // )
159
- // )
160
- //
161
- // repositories {
162
- // maven {
163
- // name = "${gitlabRepo}Packages"
164
- // credentials { username = gitlabUser; password = gitlabKey }
165
- // url = uri("$gitlabUrl")
166
- // }
167
- // }
168
- //
169
- // coordinates(gitlabGroup.toString(), gitlabArtifactId, gitlabVersion.toString())
170
- //
171
- // pom {
172
- // name = "$gitlabName Klib"
173
- // description = "$gitlabName"
174
- // url = "https://gitlab.mservice.com.vn"
175
- // licenses {
176
- // license {
177
- // name = "The Apache License, Version 2.0"
178
- // url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
179
- // distribution = "https://www.apache.org/licenses/LICENSE-2.0.txt"
180
- // }
181
- // }
182
- // developers {
183
- // developer {
184
- // id = "kotlin-hands-on"
185
- // name = "Kotlin Developer Advocate"
186
- // url = "https://github.com/kotlin-hands-on/"
187
- // }
188
- // }
189
- // }
190
- // }
191
-
192
- // Xcode 27 rejects iOS < 15; KGP's synthetic Podfile only raises pods to 12 (KT-57741), leaving lottie-ios at 13.
193
- tasks.named("podGenIos") {
194
- doLast {
195
- val podfile = layout.buildDirectory.file("cocoapods/synthetic/ios/Podfile").get().asFile
196
- podfile.writeText(podfile.readText().replace("major < 12 ||", "major < 15 ||").replace("#{12}", "#{15}"))
197
- }
198
- }
@@ -1,47 +0,0 @@
1
- Pod::Spec.new do |spec|
2
- spec.name = 'compose'
3
- spec.version = '0.169.8-beta.7-debug'
4
- spec.homepage = 'https://momo.vn'
5
- spec.source = { :http=> ''}
6
- spec.authors = ''
7
- spec.license = ''
8
- spec.summary = 'IOS Shared module'
9
- spec.vendored_frameworks = 'build/cocoapods/framework/kits.framework'
10
- spec.libraries = 'c++'
11
- spec.ios.deployment_target = '15.0'
12
- spec.dependency 'lottie-ios', '4.4.3'
13
- if !Dir.exist?('build/cocoapods/framework/kits.framework') || Dir.empty?('build/cocoapods/framework/kits.framework')
14
- raise "
15
- Kotlin framework 'kits' doesn't exist yet, so a proper Xcode project can't be generated.
16
- 'pod install' should be executed after running ':generateDummyFramework' Gradle task:
17
- ./gradlew :compose:generateDummyFramework
18
- Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
19
- end
20
- spec.xcconfig = {
21
- 'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
22
- }
23
- spec.pod_target_xcconfig = {
24
- 'KOTLIN_PROJECT_PATH' => ':compose',
25
- 'PRODUCT_MODULE_NAME' => 'kits',
26
- }
27
- spec.script_phases = [
28
- {
29
- :name => 'Build compose',
30
- :execution_position => :before_compile,
31
- :shell_path => '/bin/sh',
32
- :script => <<-SCRIPT
33
- if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then
34
- echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
35
- exit 0
36
- fi
37
- set -ev
38
- REPO_ROOT="$PODS_TARGET_SRCROOT"
39
- "$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \
40
- -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
41
- -Pkotlin.native.cocoapods.archs="$ARCHS" \
42
- -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
43
- SCRIPT
44
- }
45
- ]
46
- spec.resources = ['build/compose/cocoapods/compose-resources']
47
- end
@@ -1,19 +0,0 @@
1
- package vn.momo.kits.const
2
-
3
- import androidx.compose.runtime.Composable
4
- import androidx.compose.runtime.remember
5
- import androidx.compose.ui.platform.LocalContext
6
- import androidx.compose.ui.text.font.Font
7
- import androidx.compose.ui.text.font.FontFamily
8
- import androidx.compose.ui.text.font.FontWeight
9
-
10
- @Composable
11
- internal actual fun hostFontFamily(fileName: String, weight: FontWeight): FontFamily? {
12
- val assets = LocalContext.current.applicationContext.assets
13
- return remember(fileName, weight) {
14
- val path = "fonts/$fileName"
15
- // Font(path, assetManager) only fails later at render time, so check the asset exists first.
16
- val exists = runCatching { assets.open(path).close() }.isSuccess
17
- if (exists) FontFamily(Font(path = path, assetManager = assets, weight = weight)) else null
18
- }
19
- }
@@ -1,6 +0,0 @@
1
- package vn.momo.kits.navigation
2
-
3
- import androidx.compose.runtime.Composable
4
-
5
- @Composable
6
- internal actual fun RegisterScrollToTop(callback: (() -> Unit)?) = Unit
@@ -1,12 +0,0 @@
1
- package vn.momo.kits.platform
2
-
3
- import androidx.compose.runtime.Composable
4
- import androidx.compose.runtime.State
5
- import androidx.compose.runtime.mutableStateOf
6
- import androidx.compose.runtime.remember
7
-
8
- // No passive observer at androidx.activity 1.10.x; a second callback would steal the gesture.
9
- @Composable
10
- actual fun rememberBackGestureProgress(): State<Float?> = remember { mutableStateOf(null) }
11
-
12
- actual fun reportFloatingArrowBack(shouldUse: Boolean) = Unit
@@ -1,7 +0,0 @@
1
- package vn.momo.kits.platform
2
-
3
- import androidx.compose.runtime.Composable
4
-
5
- // Android's LocalDensity.fontScale already tracks Configuration.fontScale live.
6
- @Composable
7
- actual fun ProvideOsFontScale(content: @Composable () -> Unit) = content()