@momo-kits/native-kits 0.300.5 → 0.300.6-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 (141) hide show
  1. package/build.gradle.kts +13 -0
  2. package/compose/build.gradle.kts +197 -0
  3. package/compose/build.gradle.kts.backup +197 -0
  4. package/compose/compose.podspec +47 -0
  5. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +20 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +12 -0
  8. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +7 -0
  9. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +153 -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 +62 -0
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +1071 -0
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +65 -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 +357 -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 +128 -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 +542 -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 +231 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +189 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +478 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +265 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +235 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +223 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +265 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +185 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -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 +41 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +361 -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 +308 -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 +90 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +330 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +220 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -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 +207 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +92 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +560 -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 +125 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +207 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +501 -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 +236 -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 +17 -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 +287 -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/Item.kt +50 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +306 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +41 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +338 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +58 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +137 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +116 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +215 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +404 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +732 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +148 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +40 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +233 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +217 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoBarCompression.kt +97 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/DuoTabBar.kt +377 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +455 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +103 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +106 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +74 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +413 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +39 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +363 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HelpCenterRequest.kt +37 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +192 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +133 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/ToolkitRequests.kt +41 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +135 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +12 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +91 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +9 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +74 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ReservedRegions.kt +20 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +118 -0
  122. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/HelpCenterRequestTest.kt +44 -0
  123. package/compose/src/commonTest/kotlin/vn/momo/kits/navigation/component/ToolkitRequestsTest.kt +62 -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 +34 -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 +66 -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/ReservedRegions.ios.kt +138 -0
  131. package/gradle/libs.versions.toml +68 -0
  132. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  133. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  134. package/gradle.properties +26 -0
  135. package/gradlew +252 -0
  136. package/gradlew.bat +94 -0
  137. package/ios/native-kits.podspec +1 -1
  138. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  139. package/ios-demo/README.md +120 -0
  140. package/package.json +1 -1
  141. package/settings.gradle.kts +64 -0
@@ -0,0 +1,39 @@
1
+ package vn.momo.kits.navigation.component
2
+
3
+ import androidx.compose.foundation.layout.fillMaxWidth
4
+ import androidx.compose.runtime.Composable
5
+ import androidx.compose.ui.Modifier
6
+ import androidx.compose.ui.graphics.Color
7
+ import androidx.compose.ui.text.style.TextAlign
8
+ import androidx.compose.ui.text.style.TextOverflow
9
+ import androidx.compose.ui.unit.sp
10
+ import androidx.compose.ui.zIndex
11
+ import vn.momo.kits.application.DesignSystemKits
12
+ import vn.momo.kits.components.Text
13
+ import vn.momo.kits.const.Typography
14
+ import vn.momo.kits.modifier.setAutomationId
15
+
16
+ internal val headerFontFamily: String?
17
+ get() = if (DesignSystemKits.getConfigs().isWhiteList) "MoMoTrustDisplay" else null
18
+
19
+ @Composable
20
+ internal fun HeaderTitle(
21
+ title: String = "",
22
+ color: Color? = null,
23
+ modifier: Modifier = Modifier.fillMaxWidth(),
24
+ textAlign: TextAlign = TextAlign.Start,
25
+ ) {
26
+ Text(
27
+ modifier = modifier.zIndex(1f).setAutomationId("title_navigation_header"),
28
+ text = title,
29
+ textAlign = textAlign,
30
+ style = Typography.actionSBold.copy(
31
+ fontSize = 15.sp,
32
+ lineHeight = 22.sp,
33
+ ),
34
+ fontFamily = headerFontFamily,
35
+ color = color,
36
+ maxLines = 1,
37
+ overflow = TextOverflow.Ellipsis
38
+ )
39
+ }
@@ -0,0 +1,363 @@
1
+ package vn.momo.kits.navigation.component
2
+
3
+ import androidx.compose.foundation.background
4
+ import androidx.compose.foundation.border
5
+ import androidx.compose.foundation.layout.*
6
+ import androidx.compose.foundation.shape.CircleShape
7
+ import androidx.compose.foundation.shape.RoundedCornerShape
8
+ import androidx.compose.foundation.text.BasicText
9
+ import androidx.compose.foundation.text.TextAutoSize
10
+ import androidx.compose.runtime.Composable
11
+ import androidx.compose.runtime.Immutable
12
+ import androidx.compose.runtime.remember
13
+ import androidx.compose.ui.Alignment
14
+ import androidx.compose.ui.Modifier
15
+ import androidx.compose.ui.draw.clip
16
+ import androidx.compose.ui.draw.clipToBounds
17
+ import androidx.compose.ui.layout.ContentScale
18
+ import androidx.compose.ui.text.TextStyle
19
+ import androidx.compose.ui.text.font.FontWeight
20
+ import androidx.compose.ui.text.style.TextOverflow
21
+ import androidx.compose.ui.unit.Dp
22
+ import androidx.compose.ui.unit.dp
23
+ import androidx.compose.ui.unit.sp
24
+ import vn.momo.kits.components.Image
25
+ import vn.momo.kits.components.Options
26
+ import vn.momo.kits.components.Skeleton
27
+ import vn.momo.kits.components.Text
28
+ import vn.momo.kits.const.AppTheme
29
+ import vn.momo.kits.const.Colors
30
+ import vn.momo.kits.const.Spacing
31
+ import vn.momo.kits.const.Typography
32
+ import vn.momo.kits.const.getFontFamily
33
+ import vn.momo.kits.modifier.activeOpacityClickable
34
+ import vn.momo.kits.navigation.component.HeaderTitle.User
35
+
36
+ @Composable
37
+ internal fun HeaderUser(
38
+ data: HeaderTitle
39
+ ) {
40
+ if (data !is User) return
41
+
42
+ if (data.isLoading) {
43
+ return TitleUserShimmer()
44
+ }
45
+
46
+ val maxWidth = headerTitleMaxWidth()
47
+
48
+ Row(
49
+ modifier = Modifier
50
+ .fillMaxWidth()
51
+ .padding(vertical = Spacing.XS)
52
+ .activeOpacityClickable(enabled = data.onPress != null, onClick = { data.onPress?.invoke() }),
53
+ horizontalArrangement = Arrangement.SpaceBetween,
54
+ verticalAlignment = Alignment.CenterVertically
55
+ ) {
56
+ Row(
57
+ modifier = Modifier.widthIn(max = maxWidth),
58
+ verticalAlignment = Alignment.CenterVertically
59
+ ) {
60
+ Box(modifier = Modifier.size(Spacing.XXL)) {
61
+ AvatarGroup(urls = AvatarUrls(data.image ?: listOf()), title = data.title)
62
+ if (data.dotColor != null) {
63
+ Box(
64
+ modifier = Modifier
65
+ .align(Alignment.BottomEnd)
66
+ .size(10.dp)
67
+ .clip(CircleShape)
68
+ .background(data.dotColor)
69
+ )
70
+ }
71
+ }
72
+
73
+ Spacer(Modifier.width(6.dp))
74
+
75
+ Column(modifier = Modifier.weight(1f, fill = false)) {
76
+ Row(verticalAlignment = Alignment.CenterVertically) {
77
+ Text(
78
+ text = data.title,
79
+ color = data.tintColor,
80
+ style = Typography.actionXsBold,
81
+ fontFamily = headerFontFamily,
82
+ maxLines = 1,
83
+ overflow = TextOverflow.Ellipsis
84
+ )
85
+ if (data.icons.isNotEmpty()) {
86
+ Spacer(Modifier.width(6.dp))
87
+ Row(verticalAlignment = Alignment.CenterVertically) {
88
+ data.icons.forEach { icon ->
89
+ RemoteIcon16(url = icon)
90
+ }
91
+ }
92
+ }
93
+ }
94
+
95
+ if (!data.subTitle.isNullOrEmpty()) {
96
+ Spacer(Modifier.height(2.dp))
97
+ Text(
98
+ text = data.subTitle,
99
+ color = data.tintColor,
100
+ style = Typography.descriptionXsRegular,
101
+ maxLines = 1,
102
+ overflow = TextOverflow.Ellipsis
103
+ )
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ @Composable
111
+ private fun TitleUserShimmer() {
112
+ val theme = AppTheme.current
113
+ Row(
114
+ modifier = Modifier
115
+ .fillMaxWidth()
116
+ .padding(vertical = Spacing.XS),
117
+ verticalAlignment = Alignment.CenterVertically
118
+ ) {
119
+ Box(
120
+ modifier = Modifier
121
+ .size(Spacing.XXL)
122
+ .clip(CircleShape)
123
+ .background(theme.colors.border.default)
124
+ ) {
125
+ Skeleton()
126
+ }
127
+ Spacer(Modifier.width(Spacing.M / 2))
128
+ Column(modifier = Modifier.fillMaxWidth()) {
129
+ Box(
130
+ modifier = Modifier
131
+ .height(18.dp)
132
+ .width(120.dp)
133
+ .clip(RoundedCornerShape(8.dp))
134
+ ) { Skeleton() }
135
+ Spacer(Modifier.height(Spacing.XXS))
136
+ Box(
137
+ modifier = Modifier
138
+ .height(12.dp)
139
+ .width(120.dp)
140
+ .clip(RoundedCornerShape(8.dp))
141
+ ) { Skeleton() }
142
+ }
143
+ }
144
+ }
145
+
146
+ @Composable
147
+ private fun AvatarGroup(
148
+ urls: AvatarUrls?,
149
+ title: String? = null,
150
+ size: Dp = Spacing.XXL
151
+ ) {
152
+ val theme = AppTheme.current
153
+ val modifierBorder = remember {
154
+ Modifier.clip(CircleShape).border(width = (0.5).dp, color = theme.colors.border.default, shape = CircleShape)
155
+ }
156
+ val options = Options(
157
+ contentScale = ContentScale.Crop,
158
+ alignment = Alignment.Center
159
+ )
160
+
161
+ when (urls?.items?.size) {
162
+ 0 -> InitialsAvatar(
163
+ modifier = modifierBorder,
164
+ name = title ?: "",
165
+ fallbackInitials = null,
166
+ size = size
167
+ )
168
+ 1 -> SingleAvatar(options = options, modifier = modifierBorder, urls.items[0], size)
169
+ 2 -> TwoAvatar(options = options, modifier = modifierBorder, urls, size)
170
+ 3 -> ThreeAvatar(options = options, modifier = modifierBorder, urls, size)
171
+ 4 -> FourAvatar(options = options, modifier = modifierBorder, urls, size)
172
+ else -> ManyAvatar(options = options, modifier = modifierBorder, urls!!, size)
173
+ }
174
+ }
175
+
176
+ @Composable
177
+ private fun SingleAvatar(options: Options, modifier: Modifier = Modifier, url: String, size: Dp) {
178
+ Image(
179
+ source = url,
180
+ options = options,
181
+ modifier = modifier
182
+ .size(size)
183
+ )
184
+ }
185
+
186
+ @Composable
187
+ private fun TwoAvatar(options: Options, modifier: Modifier = Modifier, urls: AvatarUrls, size: Dp) {
188
+ val child = 24.dp
189
+ Box(modifier = Modifier.size(size)) {
190
+ Image(
191
+ source = urls.items[0],
192
+ options = options,
193
+ modifier = modifier
194
+ .size(child)
195
+ .align(Alignment.TopEnd)
196
+ )
197
+ Image(
198
+ source = urls.items[1],
199
+ options = options,
200
+ modifier = modifier
201
+ .size(child)
202
+ .align(Alignment.BottomStart)
203
+ )
204
+ }
205
+ }
206
+
207
+ @Composable
208
+ private fun ThreeAvatar(options: Options, modifier: Modifier = Modifier, urls: AvatarUrls, size: Dp) {
209
+ val child = 16.dp
210
+ Box(modifier = Modifier.size(size).padding(2.dp)) {
211
+ Image(
212
+ source = urls.items[0],
213
+ options = options,
214
+ modifier = modifier
215
+ .size(child)
216
+ .align(Alignment.BottomEnd)
217
+ )
218
+ Image(
219
+ source = urls.items[1],
220
+ options = options,
221
+ modifier = modifier
222
+ .size(child)
223
+ .align(Alignment.TopCenter)
224
+ )
225
+ Image(
226
+ source = urls.items[2],
227
+ options = options,
228
+ modifier = modifier
229
+ .size(child)
230
+ .align(Alignment.BottomStart)
231
+ )
232
+ }
233
+ }
234
+
235
+ @Composable
236
+ private fun FourAvatar(options: Options, modifier: Modifier = Modifier, urls: AvatarUrls, size: Dp) {
237
+ val child = 16.dp
238
+ Box(modifier = Modifier.size(size).padding(1.dp)) {
239
+ Image(
240
+ source = urls.items[0],
241
+ options = options,
242
+ modifier = modifier
243
+ .size(child)
244
+ .align(Alignment.BottomStart)
245
+ )
246
+ Image(
247
+ source = urls.items[1],
248
+ options = options,
249
+ modifier = modifier
250
+ .size(child)
251
+ .align(Alignment.BottomEnd)
252
+ )
253
+ Image(
254
+ source = urls.items[2],
255
+ options = options,
256
+ modifier = modifier
257
+ .size(child)
258
+ .align(Alignment.TopEnd)
259
+ )
260
+ Image(
261
+ source = urls.items[3],
262
+ options = options,
263
+ modifier = modifier
264
+ .size(child)
265
+ .align(Alignment.TopStart)
266
+ )
267
+ }
268
+ }
269
+
270
+ @Composable
271
+ private fun ManyAvatar(options: Options, modifier: Modifier = Modifier, urls: AvatarUrls, size: Dp) {
272
+ val child = 16.dp
273
+ val more = urls.items.size - 3
274
+ Box(modifier = Modifier.size(size).padding(1.dp)) {
275
+ Image(
276
+ source = urls.items[0],
277
+ options = options,
278
+ modifier = modifier
279
+ .size(child)
280
+ .align(Alignment.BottomStart)
281
+ )
282
+ Image(
283
+ source = urls.items[1],
284
+ options = options,
285
+ modifier = modifier
286
+ .size(child)
287
+ .align(Alignment.TopEnd)
288
+ )
289
+ Image(
290
+ source = urls.items[2],
291
+ options = options,
292
+ modifier = modifier
293
+ .size(child)
294
+ .align(Alignment.TopStart)
295
+ )
296
+ Box(
297
+ modifier = modifier
298
+ .size(child)
299
+ .align(Alignment.BottomEnd)
300
+ .background(Colors.pink_09)
301
+ .padding(1.dp)
302
+ .clipToBounds(),
303
+ contentAlignment = Alignment.Center
304
+ ) {
305
+ BasicText(
306
+ text = "+$more",
307
+ style = TextStyle(
308
+ color = Colors.pink_03,
309
+ fontFamily = getFontFamily(AppTheme.current.font, FontWeight.Normal)
310
+ ),
311
+ maxLines = 1,
312
+ autoSize = TextAutoSize.StepBased(
313
+ minFontSize = 1.sp,
314
+ maxFontSize = 10.sp,
315
+ stepSize = 1.sp
316
+ )
317
+ )
318
+ }
319
+ }
320
+ }
321
+
322
+ @Composable
323
+ private fun InitialsAvatar(
324
+ modifier: Modifier = Modifier,
325
+ name: String,
326
+ fallbackInitials: String? = null,
327
+ size: Dp = Spacing.XXL
328
+ ) {
329
+ val initials = remember(name, fallbackInitials) {
330
+ fallbackInitials ?: run {
331
+ val words = name.trim().split(Regex("\\s+")).takeLast(2)
332
+ words.joinToString("") { it.firstOrNull()?.uppercase() ?: "" }
333
+ }
334
+ }
335
+ Box(
336
+ modifier = modifier
337
+ .size(size)
338
+ .background(Colors.pink_09),
339
+ contentAlignment = Alignment.Center
340
+ ) {
341
+ Text(
342
+ text = initials,
343
+ color = Colors.pink_03,
344
+ style = Typography.descriptionXsRegular
345
+ )
346
+ }
347
+ }
348
+
349
+ @Composable
350
+ private fun RemoteIcon16(url: String) {
351
+ Image(
352
+ source = url,
353
+ options = Options(
354
+ contentScale = ContentScale.Crop
355
+ ),
356
+ modifier = Modifier
357
+ .size(16.dp)
358
+ .clip(RoundedCornerShape(4.dp)),
359
+ )
360
+ }
361
+
362
+ @Immutable
363
+ private data class AvatarUrls(val items: List<String>)
@@ -0,0 +1,37 @@
1
+ // File: HelpCenterRequest.kt
2
+ // Created At: 2026-10-19 +07:00
3
+ // Created By: AI | AI Agent: Codex | Model: GPT-6
4
+ // AI-GENERATED START: preserve the toolkit Help Center payload in the typed request
5
+ package vn.momo.kits.navigation.component
6
+
7
+ import kotlinx.serialization.json.JsonArray
8
+ import kotlinx.serialization.json.JsonElement
9
+ import kotlinx.serialization.json.JsonNull
10
+ import kotlinx.serialization.json.JsonObject
11
+ import kotlinx.serialization.json.JsonPrimitive
12
+ import vn.momo.kits.application.MiniAppContext
13
+ import vn.momo.maxapi.contract.navigation.model.BottomSheetRequest
14
+ import vn.momo.maxapi.contract.navigation.model.HelpCenterContext
15
+
16
+ internal fun MiniAppContext.helpCenterRequest() = BottomSheetRequest.HelpCenter(
17
+ HelpCenterContext(
18
+ appId = appId,
19
+ code = appCode,
20
+ name = appName?.helpCenterJson(),
21
+ icon = appIcon,
22
+ description = description?.helpCenterJson(),
23
+ ),
24
+ )
25
+
26
+ private fun Any?.helpCenterJson(): JsonElement = when (this) {
27
+ null -> JsonNull
28
+ is JsonElement -> this
29
+ is String -> JsonPrimitive(this)
30
+ is Boolean -> JsonPrimitive(this)
31
+ is Number -> JsonPrimitive(this)
32
+ is Map<*, *> -> JsonObject(entries.associate { (key, value) -> key.toString() to value.helpCenterJson() })
33
+ is Iterable<*> -> JsonArray(map { it.helpCenterJson() })
34
+ is Array<*> -> JsonArray(map { it.helpCenterJson() })
35
+ else -> JsonPrimitive(toString())
36
+ }
37
+ // AI-GENERATED END: preserve the toolkit Help Center payload in the typed request
@@ -0,0 +1,192 @@
1
+ package vn.momo.kits.navigation.component
2
+
3
+ import androidx.compose.foundation.background
4
+ import androidx.compose.foundation.border
5
+ import androidx.compose.foundation.layout.Arrangement
6
+ import androidx.compose.foundation.layout.Box
7
+ import androidx.compose.foundation.layout.BoxScope
8
+ import androidx.compose.foundation.layout.Column
9
+ import androidx.compose.foundation.layout.Row
10
+ import androidx.compose.foundation.layout.Spacer
11
+ import androidx.compose.foundation.layout.absolutePadding
12
+ import androidx.compose.foundation.layout.offset
13
+ import androidx.compose.foundation.layout.size
14
+ import androidx.compose.foundation.layout.width
15
+ import androidx.compose.foundation.shape.CircleShape
16
+ import androidx.compose.foundation.shape.RoundedCornerShape
17
+ import androidx.compose.runtime.Composable
18
+ import androidx.compose.runtime.LaunchedEffect
19
+ import androidx.compose.ui.AbsoluteAlignment
20
+ import androidx.compose.ui.Alignment
21
+ import androidx.compose.ui.Modifier
22
+ import androidx.compose.ui.draw.clip
23
+ import androidx.compose.ui.draw.shadow
24
+ import androidx.compose.ui.graphics.Shape
25
+ import androidx.compose.ui.layout.layout
26
+ import androidx.compose.ui.unit.Dp
27
+ import androidx.compose.ui.unit.constrainHeight
28
+ import androidx.compose.ui.unit.dp
29
+ import vn.momo.kits.components.BadgeDot
30
+ import vn.momo.kits.components.DotSize
31
+ import vn.momo.kits.components.Icon
32
+ import vn.momo.kits.const.Colors
33
+ import vn.momo.kits.const.Radius
34
+ import vn.momo.kits.const.Spacing
35
+ import vn.momo.kits.layout.DuoMetrics
36
+ import vn.momo.kits.layout.SideBarEdge
37
+ import vn.momo.kits.layout.getScreenLayout
38
+ import vn.momo.kits.modifier.activeOpacityClickable
39
+ import vn.momo.kits.modifier.conditional
40
+ import vn.momo.kits.modifier.setAutomationId
41
+ import vn.momo.kits.navigation.LocalNavigator
42
+ import vn.momo.kits.navigation.LocalOptions
43
+ import vn.momo.kits.navigation.bottomtab.LocalDuoBarCompression
44
+
45
+ private val SIDE_BAR_ICON_SIZE = 24.dp
46
+
47
+ // iPhone Duo: back and toolkit leave the bar for a column in the side safe area, as the system bars do.
48
+ // bottomInset is what footer / tab bar / home indicator take from the bottom, gap included; the column stays above it.
49
+ @Composable
50
+ internal fun BoxScope.HeaderSideBar(bottomInset: Dp, modifier: Modifier = Modifier) {
51
+ val options = LocalOptions.current
52
+ val navigator = LocalNavigator.current
53
+ val screenLayout = getScreenLayout()
54
+ val sideBar = screenLayout.sideBar ?: return
55
+ val toolkit = options.headerRight as? HeaderRight.Toolkit
56
+ val empty = options.headerType == HeaderType.None || (options.hiddenBack && toolkit == null)
57
+ val compression = LocalDuoBarCompression.current
58
+ val fullHeight = if (empty) 0.dp else DuoMetrics.controlSize + (toolkit?.let { Spacing.M + toolkitColumnHeight(it) } ?: 0.dp)
59
+ LaunchedEffect(fullHeight, compression.setToolbarHeight) { compression.setToolbarHeight(fullHeight) }
60
+ if (empty) return
61
+
62
+ val headerColor = getHeaderColor(options.headerType, headerOpacity(), options.tintColor, Colors.black_17)
63
+ val isRight = sideBar.edge == SideBarEdge.RIGHT
64
+
65
+ Column(
66
+ modifier = modifier
67
+ .align(if (isRight) AbsoluteAlignment.TopRight else AbsoluteAlignment.TopLeft)
68
+ .width(sideBar.width)
69
+ .layout { measurable, constraints ->
70
+ val placeable = measurable.measure(constraints.copy(minHeight = 0))
71
+ val maxY = screenLayout.height.roundToPx() - bottomInset.roundToPx() - placeable.height
72
+ val y = minOf(sideBar.top.roundToPx(), maxY).coerceAtLeast(0)
73
+ layout(placeable.width, constraints.constrainHeight(y + placeable.height)) {
74
+ placeable.place(0, y)
75
+ }
76
+ }
77
+ .absolutePadding(left = if (isRight) Spacing.M else 0.dp, right = if (isRight) 0.dp else Spacing.M),
78
+ horizontalAlignment = if (isRight) AbsoluteAlignment.Left else AbsoluteAlignment.Right,
79
+ verticalArrangement = Arrangement.spacedBy(Spacing.M),
80
+ ) {
81
+ if (options.hiddenBack) {
82
+ // keep the slot so the toolkit does not jump between root and pushed screens
83
+ Spacer(Modifier.size(DuoMetrics.controlSize))
84
+ } else {
85
+ SideBarButton(
86
+ icon = "arrow-back",
87
+ headerColor = headerColor,
88
+ automationId = "btn_navigation_back",
89
+ onClick = { navigator.onBackSafe { } },
90
+ )
91
+ }
92
+ when {
93
+ toolkit == null || compression.toolbarHidden -> Unit
94
+ // HIG "Toolbar compressed": tools fold into one button, distinct from the useMore icon
95
+ compression.toolbarCompressed -> SideBarButton(
96
+ icon = "navigation_menu",
97
+ headerColor = headerColor,
98
+ showBadge = toolkit.tools.any { group -> group.items.any { it.showBadge } },
99
+ automationId = "btn_navigation_toolbar",
100
+ onClick = compression.expandToolbar,
101
+ )
102
+ else -> Toolkit(
103
+ headerRight = toolkit,
104
+ tintColor = options.tintColor,
105
+ headerColor = headerColor,
106
+ layout = ToolkitLayout.SideBarColumn,
107
+ )
108
+ }
109
+ }
110
+ }
111
+
112
+ @Composable
113
+ internal fun SideBarButton(
114
+ icon: String,
115
+ headerColor: HeaderColor,
116
+ onClick: () -> Unit,
117
+ enabled: Boolean = true,
118
+ showBadge: Boolean = false,
119
+ automationId: String? = null,
120
+ ) {
121
+ Box {
122
+ Box(
123
+ modifier = Modifier
124
+ .size(DuoMetrics.controlSize)
125
+ .sideBarGlass(headerColor, CircleShape)
126
+ .activeOpacityClickable(enabled = enabled, onClick = onClick)
127
+ .conditional(automationId != null) { setAutomationId(automationId.orEmpty()) },
128
+ contentAlignment = Alignment.Center,
129
+ ) {
130
+ Icon(source = icon, size = SIDE_BAR_ICON_SIZE, color = headerColor.tintIconColor)
131
+ }
132
+ if (showBadge) {
133
+ BadgeDot(
134
+ size = DotSize.Small,
135
+ modifier = Modifier.align(Alignment.TopEnd).offset(x = -Spacing.XXS, y = Spacing.XXS),
136
+ )
137
+ }
138
+ }
139
+ }
140
+
141
+ // Capsule grouping related controls, one item per 50pt: vertical in the side bar, horizontal on a header row.
142
+ @Composable
143
+ internal fun SideBarGroup(
144
+ headerColor: HeaderColor,
145
+ itemCount: Int,
146
+ horizontal: Boolean = false,
147
+ content: @Composable (itemModifier: Modifier) -> Unit,
148
+ ) {
149
+ val length = if (itemCount > 1) DuoMetrics.itemPitch * itemCount else DuoMetrics.controlSize
150
+ val item = length / itemCount.coerceAtLeast(1)
151
+ val glass = Modifier.sideBarGlass(headerColor, RoundedCornerShape(Radius.XL))
152
+ if (horizontal) {
153
+ Row(Modifier.size(width = length, height = DuoMetrics.controlSize).then(glass)) {
154
+ content(Modifier.size(width = item, height = DuoMetrics.controlSize))
155
+ }
156
+ } else {
157
+ Column(Modifier.size(width = DuoMetrics.controlSize, height = length).then(glass)) {
158
+ content(Modifier.size(width = DuoMetrics.controlSize, height = item))
159
+ }
160
+ }
161
+ }
162
+
163
+ @Composable
164
+ internal fun SideBarGroupItem(
165
+ icon: String,
166
+ headerColor: HeaderColor,
167
+ automationId: String,
168
+ onClick: () -> Unit,
169
+ modifier: Modifier = Modifier,
170
+ ) {
171
+ Box(
172
+ modifier = modifier
173
+ .activeOpacityClickable(onClick = onClick)
174
+ .setAutomationId(automationId),
175
+ contentAlignment = Alignment.Center,
176
+ ) {
177
+ Icon(source = icon, size = SIDE_BAR_ICON_SIZE, color = headerColor.tintIconColor)
178
+ }
179
+ }
180
+
181
+ // Dark glass under light icons (banner headers), light glass otherwise. The light one is opaque:
182
+ // Compose has no backdrop blur and a translucent fill shows its own shadow through (RN uses 85% white).
183
+ private fun Modifier.sideBarGlass(headerColor: HeaderColor, shape: Shape): Modifier =
184
+ if (headerColor.tintIconColor == Colors.black_01) {
185
+ clip(shape)
186
+ .background(Colors.black_20.copy(alpha = 0.5f))
187
+ .border(0.5.dp, Colors.black_01.copy(alpha = 0.2f), shape)
188
+ } else {
189
+ shadow(3.dp, shape)
190
+ .background(Colors.black_01)
191
+ .border(0.5.dp, Colors.black_20.copy(alpha = 0.08f), shape)
192
+ }