@momo-kits/native-kits 0.169.14-beta.2 → 0.169.14-debug

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 (147) hide show
  1. package/build.gradle.kts +11 -0
  2. package/compose/build.gradle.kts +197 -0
  3. package/compose/compose.podspec +47 -0
  4. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +19 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +154 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReduceMotion.android.kt +17 -0
  10. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/ReservedRegions.android.kt +6 -0
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +110 -0
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/DesignSystemKits.kt +61 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1067 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +268 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +56 -0
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +81 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +354 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +115 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +130 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +482 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +49 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +86 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +125 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +224 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +137 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +473 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +113 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +262 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +237 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +228 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +280 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +183 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +342 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +40 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +82 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +39 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +362 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +108 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +304 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +21 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +88 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +308 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +218 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +456 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +205 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +89 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +542 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +86 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +175 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +201 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +176 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +208 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +180 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +325 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +12 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +194 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +291 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +54 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/HeaderLayout.kt +71 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +50 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ModalLayout.kt +184 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +315 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +54 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +397 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +153 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +118 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +206 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +421 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +750 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +152 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +35 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +242 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +406 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +111 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +93 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +208 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/TabBarMetrics.kt +133 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +167 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +446 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +105 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +400 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +197 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +127 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +114 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +7 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +76 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReduceMotion.kt +7 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +21 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +117 -0
  124. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +42 -0
  125. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +45 -0
  126. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +38 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +65 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +217 -0
  130. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReduceMotion.ios.kt +48 -0
  131. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/ReservedRegions.ios.kt +143 -0
  132. package/gradle/libs.versions.toml +67 -0
  133. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  134. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  135. package/gradle.properties +24 -0
  136. package/gradlew +252 -0
  137. package/gradlew.bat +94 -0
  138. package/ios/Navigation/BottomTab/BottomTab.swift +3 -22
  139. package/ios/Navigation/BottomTab/DuoTabBar.swift +0 -2
  140. package/ios/Navigation/StackScreen.swift +1 -2
  141. package/ios/native-kits.podspec +1 -1
  142. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  143. package/ios-demo/README.md +120 -0
  144. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/BottomTabDemo.swift +1 -5
  145. package/package.json +1 -1
  146. package/settings.gradle.kts +63 -0
  147. package/ios/Navigation/BottomTab/LegacyBottomTabBar.swift +0 -226
@@ -167,8 +167,7 @@ public struct StackScreen<Content: View>: View {
167
167
  /// (`floatingTabBarEdgeToEdge()`), when it also covers the home indicator that BottomTab keeps clear of
168
168
  /// (a negative inset extends the content past the tab's frame).
169
169
  private var contentBottomInset: CGFloat {
170
- guard let navigation, navigation.bottomTabIndex != -1, navigation.bottomTabEdgeToEdge,
171
- !duoTabBarInsets.isLegacyBar else {
170
+ guard let navigation, navigation.bottomTabIndex != -1, navigation.bottomTabEdgeToEdge else {
172
171
  return duoTabBarInsets.overlay
173
172
  }
174
173
  return -layout.insets.bottom
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'MoMoUIKits'
3
- s.version = '0.169.14-beta.2'
3
+ s.version = '0.169.14'
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.14-beta.2'
3
+ s.version = '0.169.14'
4
4
  s.summary = 'Demo browser for MoMoUIKits SwiftUI components'
5
5
  s.homepage = 'https://momo.vn'
6
6
  s.license = { :type => 'MIT' }
@@ -0,0 +1,120 @@
1
+ # MoMoUIKitsDemo
2
+
3
+ SwiftUI demo browser for `MoMoUIKits`.
4
+
5
+ The package can optionally host a Compose UIKits screen by receiving a
6
+ `UIViewController` factory from the host app. It does not import the KMP
7
+ `shared` module directly.
8
+
9
+ SwiftUI mode reuses the full demo screen set from
10
+ `sample/iosApp/iosApp/Demo`, including the sample `HomeView` registry and demo
11
+ screens for all currently available components.
12
+
13
+ ## CocoaPods
14
+
15
+ In the host app `Podfile`, include both local pods:
16
+
17
+ ```ruby
18
+ pod 'MoMoUIKits', :path => '../momo-native-kits/ios/native-kits.podspec'
19
+ pod 'MoMoUIKitsDemo', :path => '../momo-native-kits/ios-demo'
20
+ ```
21
+
22
+ Adjust the relative paths to match the host app checkout.
23
+
24
+ ## Host App Usage
25
+
26
+ ```swift
27
+ import MoMoUIKitsDemo
28
+ import shared
29
+
30
+ class UIKitsViewController: BaseComposeAppViewController {
31
+ override func getViewController() -> UIViewController? {
32
+ let params = self.application.data as? [String: Any]
33
+
34
+ return MoMoUIKitsDemoViewControllerFactory.make(
35
+ context: MoMoUIKitsDemoContext(
36
+ appId: params?["appId"] as? String ?? "",
37
+ appCode: params?["code"] as? String ?? "",
38
+ appName: params?["name"] as? String,
39
+ appIcon: params?["icon"] as? String ?? ""
40
+ ),
41
+ composeViewController: {
42
+ UIKitsScreenComposeViewControllerKt.UIKitsScreenComposeViewController(
43
+ params: params
44
+ )
45
+ }
46
+ )
47
+ }
48
+
49
+ override func viewDidDisappear(_ animated: Bool) {
50
+ super.viewDidDisappear(animated)
51
+ composeViewController = nil
52
+ }
53
+ }
54
+ ```
55
+
56
+ If the host does not pass `composeViewController`, the demo opens directly in
57
+ SwiftUI mode.
58
+
59
+ ## Included SwiftUI Demos
60
+
61
+ The pod includes the sample demo screens for:
62
+
63
+ - Animated Header
64
+ - Avatar
65
+ - Badge
66
+ - Baseline View
67
+ - Bottom Tab
68
+ - Button
69
+ - Carousel
70
+ - Checkbox
71
+ - Chip
72
+ - Collapse
73
+ - DateTimePicker
74
+ - Divider
75
+ - Header User
76
+ - Icon Button
77
+ - Image
78
+ - Information
79
+ - Input
80
+ - Input DropDown
81
+ - Input Money
82
+ - Input OTP
83
+ - Input Phone Number
84
+ - Input Search
85
+ - Input TextArea
86
+ - Loader
87
+ - Navigation
88
+ - Pagination
89
+ - Popup Display
90
+ - Popup Notify
91
+ - Popup Promotion
92
+ - Progress Info
93
+ - Radio
94
+ - Rating
95
+ - Skeleton
96
+ - Slider
97
+ - SnackBar
98
+ - Stepper
99
+ - Steps
100
+ - Suggest Action
101
+ - Swipe
102
+ - Switch
103
+ - TabView
104
+ - Tag
105
+ - Theme
106
+ - Title
107
+ - Tooltip
108
+ - Typography
109
+ - Uploader
110
+
111
+ ## Validation Notes
112
+
113
+ Validated locally with:
114
+
115
+ ```sh
116
+ pod ipc spec ios/MoMoUIKits.podspec
117
+ pod ipc spec ios-demo/MoMoUIKitsDemo.podspec
118
+ pod lib lint ios/MoMoUIKits.podspec --allow-warnings --skip-import-validation
119
+ pod lib lint ios-demo/MoMoUIKitsDemo.podspec --allow-warnings --skip-import-validation --include-podspecs=ios/MoMoUIKits.podspec
120
+ ```
@@ -38,7 +38,6 @@ private struct DemoConfig: Hashable {
38
38
  var ctaLottie = false
39
39
  var initialRouteName = "Momo"
40
40
  var compressionBehavior: DuoBarCompressionBehavior = .toolbar
41
- var useLegacy = false
42
41
  var backToInitialTab = true
43
42
  // a sticky footer in the tab's content body, to check it clears the floating bar
44
43
  var footer = false
@@ -135,8 +134,7 @@ struct BottomTabDemoContent: View {
135
134
  focused = tabs[index].name
136
135
  switchTab()
137
136
  },
138
- backToInitialTab: config.backToInitialTab,
139
- useLegacy: config.useLegacy
137
+ backToInitialTab: config.backToInitialTab
140
138
  )
141
139
  .id(config)
142
140
  .onAppear { ctaLottieLoader.load() }
@@ -224,8 +222,6 @@ private struct TabContent: View {
224
222
  config.compressionBehavior = .tabBar
225
223
  },
226
224
  ])
227
- Options(title: "useLegacy", hint: "Thanh tab cũ (trước redesign), iPhone thường",
228
- options: yesNo(config.useLegacy) { config.useLegacy = $0 })
229
225
  Options(title: "backToInitialTab", hint: "Back ở tab khác quay về tab đầu trước khi rời màn",
230
226
  options: yesNo(config.backToInitialTab) { config.backToInitialTab = $0 })
231
227
  Options(title: "footer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.169.14-beta.2",
3
+ "version": "0.169.14-debug",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "publish:local": "bash publish.sh local"
@@ -0,0 +1,63 @@
1
+ import org.gradle.kotlin.dsl.maven
2
+
3
+ rootProject.name = "momo-native-kits"
4
+ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
5
+
6
+ pluginManagement {
7
+ repositories {
8
+ google {
9
+ mavenContent {
10
+ includeGroupAndSubgroups("androidx")
11
+ includeGroupAndSubgroups("com.android")
12
+ includeGroupAndSubgroups("com.google")
13
+ }
14
+ }
15
+ mavenCentral()
16
+ gradlePluginPortal()
17
+ maven {
18
+ url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
19
+ credentials {username = "download_packages"; password = "gldt-bjDqLpU_sPcHDuXau2ws" }
20
+ }
21
+ maven {
22
+ url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
23
+ credentials {
24
+ username = "viewer"
25
+ password = "viewer"
26
+ }
27
+ isAllowInsecureProtocol = true
28
+ }
29
+ }
30
+ }
31
+
32
+ dependencyResolutionManagement {
33
+ repositories {
34
+ google {
35
+ mavenContent {
36
+ includeGroupAndSubgroups("androidx")
37
+ includeGroupAndSubgroups("com.android")
38
+ includeGroupAndSubgroups("com.google")
39
+ }
40
+ }
41
+ mavenCentral()
42
+ maven {
43
+ url = uri("https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven")
44
+ credentials {
45
+ username = "download_packages";
46
+ password = "gldt-bjDqLpU_sPcHDuXau2ws"
47
+ }
48
+ }
49
+ maven {
50
+ url = uri("https://artifacts.mservice.com.vn/repository/maven-momo-app/")
51
+ credentials {
52
+ username = "viewer"
53
+ password = "viewer"
54
+ }
55
+ isAllowInsecureProtocol = true
56
+ }
57
+ }
58
+ }
59
+
60
+ include(":compose")
61
+
62
+ include(":sample:androidApp")
63
+ include(":sample:shared")
@@ -1,226 +0,0 @@
1
- // The pre-redesign (DS-984) phone tab bar, kept for `BottomTab(useLegacy: true)`: a full-width surface bar with a
2
- // sliding top indicator, a top shadow, badges and the notched center floating button, over a home-indicator filler.
3
-
4
- import SwiftUI
5
-
6
- let LEGACY_BOTTOM_TAB_BAR_HEIGHT: CGFloat = 64
7
- private let legacyFloatingButtonWidth: CGFloat = 75
8
-
9
- /// The legacy bar plus its surface filler under it, down to the window bottom.
10
- struct LegacyBottomTabBar: View {
11
- let items: [BottomTabItem]
12
- let floatingButton: BottomTabFloatingButton?
13
- let selectedIndex: Int
14
- let onTabSelected: (Int) -> Void
15
- let bottomInset: CGFloat
16
-
17
- @Environment(\.screenLayout) private var layout
18
- @Environment(\.appTheme) private var theme
19
-
20
- // the bar sits between the side safe areas
21
- private var screenWidth: CGFloat { layout.width - layout.insets.leading - layout.insets.trailing }
22
- private var mid: Int { items.count / 2 }
23
-
24
- private var tabWidth: CGFloat {
25
- let available = floatingButton != nil ? screenWidth - legacyFloatingButtonWidth : screenWidth
26
- return available / CGFloat(max(items.count, 1))
27
- }
28
-
29
- private var indicatorOffset: CGFloat {
30
- let adjust: CGFloat = (floatingButton != nil && selectedIndex >= mid) ? legacyFloatingButtonWidth : 0
31
- return tabWidth * CGFloat(selectedIndex) + tabWidth / 2 - screenWidth / 2 + adjust
32
- }
33
-
34
- var body: some View {
35
- VStack(spacing: 0) {
36
- bar
37
- theme.colors.background.surface
38
- .frame(height: bottomInset + Spacing.S)
39
- .ignoresSafeArea(edges: .horizontal)
40
- }
41
- }
42
-
43
- private var bar: some View {
44
- ZStack(alignment: .bottom) {
45
- HStack(spacing: 0) {
46
- if floatingButton == nil {
47
- tabItems(from: 0, to: items.count)
48
- } else {
49
- tabItems(from: 0, to: mid)
50
- Spacer()
51
- .frame(width: legacyFloatingButtonWidth)
52
- .padding(.horizontal, Spacing.XXS)
53
- tabItems(from: mid, to: items.count)
54
- }
55
- }
56
- .frame(maxWidth: .infinity)
57
- .frame(height: LEGACY_BOTTOM_TAB_BAR_HEIGHT)
58
- .background(theme.colors.background.surface.ignoresSafeArea(edges: .horizontal))
59
-
60
- RoundedRectangle(cornerRadius: 2)
61
- .fill(theme.colors.primary)
62
- .frame(width: 44, height: 2)
63
- .offset(x: indicatorOffset, y: -LEGACY_BOTTOM_TAB_BAR_HEIGHT + 2)
64
- .animation(.easeInOut(duration: 0.25), value: selectedIndex)
65
-
66
- LinearGradient(colors: [Color.black.opacity(0.05), .clear], startPoint: .bottom, endPoint: .top)
67
- .frame(height: 6)
68
- .frame(maxWidth: .infinity)
69
- .offset(y: -LEGACY_BOTTOM_TAB_BAR_HEIGHT)
70
-
71
- if let floatingButton {
72
- LegacyCenterFloatingButton(data: floatingButton)
73
- }
74
- }
75
- }
76
-
77
- @ViewBuilder
78
- private func tabItems(from: Int, to: Int) -> some View {
79
- ForEach(from..<to, id: \.self) { index in
80
- LegacyTabBarItem(
81
- item: items[index],
82
- selected: index == selectedIndex,
83
- // from the icon's center to the cell's end edge, inside both XXS paddings
84
- badgeMaxWidth: tabWidth / 2 - Spacing.XXS * 2,
85
- onClick: { onTabSelected(index) }
86
- )
87
- .frame(maxWidth: .infinity)
88
- }
89
- }
90
- }
91
-
92
- private struct LegacyTabBarItem: View {
93
- let item: BottomTabItem
94
- let selected: Bool
95
- let badgeMaxWidth: CGFloat
96
- let onClick: () -> Void
97
-
98
- @Environment(\.appTheme) private var theme
99
-
100
- private var tintColor: Color { selected ? theme.colors.primary : theme.colors.text.hint }
101
-
102
- /// Compose's `formatLabel`: a badge that is the number "0" is hidden.
103
- private var badgeLabel: String? {
104
- guard let label = item.badgeLabel else { return nil }
105
- if let number = Int(label), number == 0 { return nil }
106
- return label
107
- }
108
-
109
- var body: some View {
110
- VStack(spacing: 0) {
111
- Icon(source: item.icon, size: 28, color: tintColor)
112
- .overlay(alignment: .topLeading) {
113
- // starts at the icon's center and grows toward the cell's end edge, ellipsized past it
114
- if let badgeLabel, !badgeLabel.isEmpty {
115
- Badge(label: badgeLabel)
116
- .frame(width: max(badgeMaxWidth, 0), alignment: .leading)
117
- .offset(x: 14, y: -Spacing.S)
118
- }
119
- }
120
- .overlay(alignment: .topTrailing) {
121
- if badgeLabel?.isEmpty == true || (badgeLabel == nil && item.showDot) {
122
- BadgeDot(size: .small).offset(x: 4, y: -4)
123
- }
124
- }
125
- .padding(Spacing.XS)
126
- MomoText(
127
- item.label,
128
- typography: selected ? .labelXsMedium : .descriptionXsRegular,
129
- color: tintColor,
130
- textAlign: .center,
131
- maxLines: 1
132
- )
133
- .truncationMode(.tail)
134
- }
135
- .frame(maxWidth: .infinity, maxHeight: .infinity)
136
- .padding(Spacing.S)
137
- .frame(maxWidth: .infinity, maxHeight: .infinity)
138
- .padding(.horizontal, Spacing.XXS)
139
- .contentShape(Rectangle())
140
- .onTapGesture { onClick() }
141
- }
142
- }
143
-
144
- /// The 48 primary circle in the bar's notch; `iconContent` replaces the icon, `labelContent` overlays the label.
145
- private struct LegacyCenterFloatingButton: View {
146
- let data: BottomTabFloatingButton
147
-
148
- @Environment(\.appTheme) private var theme
149
-
150
- var body: some View {
151
- VStack(spacing: 0) {
152
- LegacyCurvedContainer()
153
- Circle()
154
- .fill(theme.colors.primary)
155
- .frame(width: 48, height: 48)
156
- .overlay(icon)
157
- Spacer().frame(height: 4)
158
- MomoText(data.label, typography: .labelXsMedium, color: Colors.black01, textAlign: .center, maxLines: 1)
159
- .frame(maxWidth: .infinity)
160
- .frame(height: 14)
161
- .background(theme.colors.primary)
162
- .clipShape(RoundedRectangle(cornerRadius: Radius.XL))
163
- .overlay(data.labelContent)
164
- }
165
- .frame(width: legacyFloatingButtonWidth)
166
- .padding(.horizontal, Spacing.XXS)
167
- .padding(.vertical, Spacing.S)
168
- .contentShape(Rectangle())
169
- .onTapGesture { data.onPress() }
170
- }
171
-
172
- @ViewBuilder
173
- private var icon: some View {
174
- if let iconContent = data.iconContent {
175
- iconContent
176
- } else {
177
- Icon(source: data.icon, size: 28, color: .white)
178
- }
179
- }
180
- }
181
-
182
- /// Compose's legacy `CurvedContainer`: the surface notch carved into the bar's top edge behind the center button.
183
- private struct LegacyCurvedContainer: View {
184
- private let circleSize: CGFloat = 48
185
- private let iconSize: CGFloat = 28
186
- private let circleOverSize: CGFloat = 2
187
- private let width: CGFloat = 71
188
- private let height: CGFloat = 16
189
-
190
- var body: some View {
191
- let circleOverTop = circleSize - iconSize - 10 + circleOverSize
192
- LegacyCurvedShape(circleOverTop: circleOverTop, centerX: width / 2, circleOverR: circleSize / 2 + circleOverSize)
193
- .fill(Colors.black01)
194
- .frame(width: width, height: height)
195
- .offset(y: 24)
196
- .zIndex(-1)
197
- }
198
- }
199
-
200
- /// A flat bar with a smooth circular dip in the middle, sized to cradle the floating button.
201
- private struct LegacyCurvedShape: Shape {
202
- let circleOverTop: CGFloat
203
- let centerX: CGFloat
204
- let circleOverR: CGFloat
205
-
206
- func path(in rect: CGRect) -> Path {
207
- var path = Path()
208
- path.move(to: CGPoint(x: 0, y: circleOverTop))
209
- path.addLine(to: CGPoint(x: centerX - circleOverR - 40, y: circleOverTop))
210
- path.addCurve(
211
- to: CGPoint(x: centerX, y: 0),
212
- control1: CGPoint(x: centerX - circleOverR, y: circleOverTop),
213
- control2: CGPoint(x: centerX - circleOverR, y: 0)
214
- )
215
- path.addCurve(
216
- to: CGPoint(x: centerX + circleOverR + 40, y: circleOverTop),
217
- control1: CGPoint(x: centerX + circleOverR, y: 0),
218
- control2: CGPoint(x: centerX + circleOverR, y: circleOverTop)
219
- )
220
- path.addLine(to: CGPoint(x: rect.width, y: circleOverTop))
221
- path.addLine(to: CGPoint(x: rect.width, y: 60))
222
- path.addLine(to: CGPoint(x: 0, y: 60))
223
- path.closeSubpath()
224
- return path
225
- }
226
- }