@momo-kits/native-kits 0.167.1-duo.2-debug → 0.167.1-duo.20

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 (266) hide show
  1. package/CLAUDE.md +36 -8
  2. package/README.md +2 -2
  3. package/ios/Application/ApplicationEnvironment.swift +17 -0
  4. package/ios/Application/MaxApi.swift +12 -3
  5. package/ios/Avatar/Avatar.swift +4 -3
  6. package/ios/Badge/Badge.swift +6 -4
  7. package/ios/Badge/BadgeDot.swift +1 -1
  8. package/ios/Badge/BadgeRibbon.swift +0 -1
  9. package/ios/Button/Button.swift +15 -12
  10. package/ios/CalculatorKeyboard/CalculatorKeyboard.swift +64 -18
  11. package/ios/Carousel/Carousel.swift +29 -12
  12. package/ios/Checkbox/Checkbox.swift +7 -3
  13. package/ios/Chip/Chip.swift +5 -4
  14. package/ios/Collapse/Collapse.swift +70 -19
  15. package/ios/Colors+Radius+Spacing/Colors.swift +10 -1
  16. package/ios/Colors+Radius+Spacing/Radius.swift +6 -0
  17. package/ios/DateTimePicker/DateTimePicker.swift +54 -20
  18. package/ios/DateTimePicker/WheelPicker.swift +103 -105
  19. package/ios/Divider/Divider.swift +37 -4
  20. package/ios/Extensions/Color++.swift +38 -9
  21. package/ios/Extensions/OptionalEnvironmentObject.swift +12 -0
  22. package/ios/Extensions/SkeletonUICompat.swift +11 -0
  23. package/ios/Icon/Icon.swift +21 -23
  24. package/ios/Icon/Icons.swift +1329 -0
  25. package/ios/IconButton/IconButton.swift +15 -7
  26. package/ios/Image/Image.swift +7 -23
  27. package/ios/Information/Information.swift +27 -9
  28. package/ios/Input/ErrorView.swift +2 -2
  29. package/ios/Input/Input.swift +160 -147
  30. package/ios/Input/InputPhoneNumber.swift +12 -9
  31. package/ios/Input/InputSearch.swift +102 -75
  32. package/ios/Input/InputTextArea.swift +128 -145
  33. package/ios/InputDropDown/InputDropDown.swift +10 -7
  34. package/ios/InputMoney/InputMoney.swift +33 -11
  35. package/ios/InputOTP/InputOTP.swift +22 -12
  36. package/ios/Layout/Card.swift +50 -0
  37. package/ios/Layout/GridContext.swift +187 -3
  38. package/ios/Layout/Item.swift +5 -4
  39. package/ios/Layout/ScreenLayout.swift +380 -0
  40. package/ios/Layout/Section.swift +4 -100
  41. package/ios/Loader/Loader.swift +5 -9
  42. package/ios/Lottie/LottieView.swift +14 -2
  43. package/ios/{Application/Navigation/Overplay → Navigation}/BottomSheet.swift +128 -9
  44. package/ios/Navigation/BottomTab/BottomTab.swift +185 -0
  45. package/ios/{Application/Navigation → Navigation}/BottomTab/BottomTabBar.swift +15 -7
  46. package/ios/Navigation/BottomTab/DuoBarCompression.swift +105 -0
  47. package/ios/Navigation/BottomTab/DuoTabBar.swift +304 -0
  48. package/ios/{Application → Navigation/Component}/FloatingButton.swift +14 -3
  49. package/ios/Navigation/Component/Header.swift +531 -0
  50. package/ios/Navigation/Component/HeaderBackground.swift +133 -0
  51. package/ios/Navigation/Component/HeaderJourney.swift +73 -0
  52. package/ios/Navigation/Component/HeaderLocation.swift +48 -0
  53. package/ios/Navigation/Component/HeaderRight.swift +377 -0
  54. package/ios/Navigation/Component/HeaderTitle.swift +36 -0
  55. package/ios/{Application/Navigation → Navigation/Component}/HeaderUser.swift +21 -24
  56. package/ios/Navigation/Component/SideBar.swift +183 -0
  57. package/ios/{Application/Navigation/Overplay → Navigation/Component}/SnackBar.swift +5 -6
  58. package/ios/Navigation/HostBackGestureBridge.swift +78 -0
  59. package/ios/{Application/Navigation/Overplay → Navigation}/ModalScreen.swift +5 -2
  60. package/ios/Navigation/Navigation.swift +204 -0
  61. package/ios/Navigation/NavigationContainer.swift +194 -0
  62. package/ios/{Application/Navigation → Navigation}/Navigator.swift +177 -91
  63. package/ios/Navigation/StackScreen.swift +820 -0
  64. package/ios/Navigation/StackTransition.swift +400 -0
  65. package/ios/Navigation/SwipeBackHaptic.swift +33 -0
  66. package/ios/{Application/Navigation → Navigation}/Tracking/ScreenTracker.swift +12 -5
  67. package/ios/OTPKeyboard/OTPKeyboard.swift +8 -11
  68. package/ios/Pagination/PaginationScroll.swift +2 -2
  69. package/ios/Popup/PopupDisplay.swift +72 -136
  70. package/ios/Popup/PopupInput.swift +10 -13
  71. package/ios/Popup/PopupLayout.swift +140 -0
  72. package/ios/Popup/PopupNotify.swift +56 -73
  73. package/ios/Popup/PopupPromotion.swift +31 -47
  74. package/ios/PopupView/FullscreenPopup.swift +13 -19
  75. package/ios/PopupView/PopupView.swift +1 -1
  76. package/ios/PopupView/Utils++.swift +0 -8
  77. package/ios/ProgressInfo/ProgressInfo.swift +4 -2
  78. package/ios/Radio/Radio.swift +2 -1
  79. package/ios/Rating/Rating.swift +9 -1
  80. package/ios/Resources/dot_loading.json +558 -0
  81. package/ios/Resources/lottie_circle_loader.json +1 -0
  82. package/ios/ScrollIndicator/ScrollIndicator.swift +11 -10
  83. package/ios/Skeleton/Skeleton.swift +22 -27
  84. package/ios/Slider/Slider.swift +16 -18
  85. package/ios/Stepper/Stepper.swift +6 -1
  86. package/ios/Steps/Steps.swift +8 -6
  87. package/ios/SuggestAction/SuggestAction.swift +5 -0
  88. package/ios/Swipeable/SwipeCell.swift +10 -6
  89. package/ios/Switch/Switch.swift +22 -20
  90. package/ios/TabView/TabView.swift +102 -21
  91. package/ios/Tag/Tag.swift +15 -4
  92. package/ios/Template/Logo/Logo.swift +2 -1
  93. package/ios/Template/TrustBanner/TrustBanner.swift +106 -54
  94. package/ios/Title/Title.swift +6 -17
  95. package/ios/Tooltip/Tooltip.swift +29 -14
  96. package/ios/Typography/Text.swift +61 -19
  97. package/ios/Uploader/Uploader.swift +3 -1
  98. package/ios/native-kits.podspec +2 -1
  99. package/ios-demo/MoMoUIKitsDemo.podspec +1 -1
  100. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/ContentView.swift +1 -1
  101. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/DuoTabDemo.swift +80 -0
  102. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/Home.swift +1 -0
  103. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/IPhoneDuoDemo.swift +173 -0
  104. package/ios-demo/Sources/MoMoUIKitsDemo/SampleDemos/NavigationDemo.swift +77 -1
  105. package/package.json +1 -1
  106. package/scripts/gen-ios-icons.mjs +36 -0
  107. package/build.gradle.kts +0 -11
  108. package/compose/build.gradle.kts +0 -190
  109. package/compose/build.gradle.kts.backup +0 -190
  110. package/compose/compose.podspec +0 -47
  111. package/compose/src/androidMain/kotlin/vn/momo/kits/const/HostFont.android.kt +0 -19
  112. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  113. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/BackGesture.android.kt +0 -12
  114. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/OsFontScale.android.kt +0 -7
  115. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -151
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -52
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -124
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -183
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -207
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -39
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -293
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -831
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +0 -269
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -110
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -378
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/application/WidgetContainer.kt +0 -56
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -82
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -338
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -175
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -356
  138. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -113
  139. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -89
  140. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -128
  141. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -209
  142. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -542
  143. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -49
  144. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  145. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -125
  146. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -231
  147. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -189
  148. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -475
  149. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -114
  150. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -266
  151. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -240
  152. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -223
  153. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -264
  154. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -185
  155. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -343
  156. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  157. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  158. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  159. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -84
  160. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  161. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -334
  162. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -98
  163. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -310
  164. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -59
  165. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  166. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -21
  167. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -90
  168. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -323
  169. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -220
  170. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -473
  171. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -122
  172. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -199
  173. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -91
  174. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -552
  175. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -88
  176. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -125
  177. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -207
  178. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -498
  179. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -176
  180. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -182
  181. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -193
  182. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  183. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -234
  184. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -188
  185. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -325
  186. package/compose/src/commonMain/kotlin/vn/momo/kits/const/HostFont.kt +0 -16
  187. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitDesignSystem.kt +0 -18
  188. package/compose/src/commonMain/kotlin/vn/momo/kits/const/KitFontScale.kt +0 -22
  189. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  190. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  191. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  192. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -297
  193. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -54
  194. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -50
  195. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/ScreenLayout.kt +0 -157
  196. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -41
  197. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -52
  198. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -66
  199. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  200. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -104
  201. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -48
  202. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  203. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -299
  204. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/HostBackGestureBridge.kt +0 -58
  205. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -129
  206. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -106
  207. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -205
  208. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -393
  209. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  210. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -622
  211. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackTransition.kt +0 -148
  212. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/SwipeBackHaptic.kt +0 -35
  213. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -175
  214. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -232
  215. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  216. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -169
  217. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -381
  218. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -83
  219. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderJourney.kt +0 -105
  220. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderLocation.kt +0 -74
  221. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -347
  222. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -37
  223. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -363
  224. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SideBar.kt +0 -169
  225. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -132
  226. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -127
  227. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/BackGesture.kt +0 -12
  228. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -91
  229. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/OsFontScale.kt +0 -9
  230. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -71
  231. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  232. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -55
  233. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  234. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -118
  235. package/compose/src/iosMain/kotlin/vn/momo/kits/const/HostFont.ios.kt +0 -40
  236. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/HostBackGesture.ios.kt +0 -45
  237. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -32
  238. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/BackGesture.ios.kt +0 -38
  239. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/OsFontScale.ios.kt +0 -66
  240. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -213
  241. package/gradle/libs.versions.toml +0 -69
  242. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  243. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  244. package/gradle.properties +0 -26
  245. package/gradlew +0 -252
  246. package/gradlew.bat +0 -94
  247. package/ios/Application/Components.swift +0 -270
  248. package/ios/Application/ComposeApi.swift +0 -22
  249. package/ios/Application/HeaderRight.swift +0 -306
  250. package/ios/Application/Navigation/BottomTab/BottomTab.swift +0 -104
  251. package/ios/Application/Navigation/HeaderBackProps.swift +0 -66
  252. package/ios/Application/Navigation/HeaderTitle.swift +0 -57
  253. package/ios/Application/Navigation/NavigationContainer.swift +0 -213
  254. package/ios/Application/Navigation/NavigationOptions.swift +0 -109
  255. package/ios/Application/Navigation/NavigatorManager.swift +0 -22
  256. package/ios/Application/Navigation/component/Header.swift +0 -178
  257. package/ios/Application/Navigation/component/HeaderBackground.swift +0 -83
  258. package/ios/Application/Navigation/component/HeaderColor.swift +0 -65
  259. package/ios/Application/Navigation/component/HeaderRightWidthKey.swift +0 -11
  260. package/ios/Application/Navigation/component/NavigationFooter.swift +0 -90
  261. package/ios/Application/Navigation/component/NavigationHeaderRight.swift +0 -196
  262. package/ios/Application/Screen.swift +0 -250
  263. package/ios/Application/StackScreen.swift +0 -492
  264. package/ios-demo/README.md +0 -120
  265. package/settings.gradle.kts +0 -64
  266. /package/ios/{Application/Navigation → Navigation}/BottomTab/CurvedContainer.swift +0 -0
@@ -1,310 +0,0 @@
1
- package vn.momo.kits.components
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.runtime.Composable
8
- import androidx.compose.runtime.mutableFloatStateOf
9
- import androidx.compose.runtime.remember
10
- import androidx.compose.ui.Alignment
11
- import androidx.compose.ui.Modifier
12
- import androidx.compose.ui.draw.clip
13
- import androidx.compose.ui.layout.onGloballyPositioned
14
- import androidx.compose.ui.platform.LocalDensity
15
- import androidx.compose.ui.text.style.TextAlign
16
- import androidx.compose.ui.unit.dp
17
- import vn.momo.kits.application.IsShowBaseLineDebug
18
- import vn.momo.kits.const.*
19
- import vn.momo.kits.modifier.conditional
20
-
21
- data class ProgressInfoItem(
22
- val title: String,
23
- val description: String? = null,
24
- )
25
-
26
- enum class ProgressInfoSize { Small, Large }
27
-
28
- enum class ProgressInfoAlign { Left, Right, Center, Stretch }
29
-
30
- @Composable
31
- fun ProgressInfo(
32
- steps: List<ProgressInfoItem>,
33
- horizontal: Boolean = false,
34
- size: ProgressInfoSize = ProgressInfoSize.Large,
35
- useNumber: Boolean = false,
36
- align: ProgressInfoAlign = ProgressInfoAlign.Center,
37
- showTitle: Boolean = true,
38
- showDescription: Boolean = true,
39
- customIcon: String? = null,
40
- modifier: Modifier = Modifier,
41
- ) {
42
- if (horizontal) {
43
- ProgressInfoHorizontal(
44
- steps = steps,
45
- size = size,
46
- useNumber = useNumber,
47
- align = align,
48
- showTitle = showTitle,
49
- showDescription = showDescription,
50
- customIcon = customIcon,
51
- modifier = modifier,
52
- )
53
- } else {
54
- ProgressInfoVertical(
55
- steps = steps,
56
- size = size,
57
- useNumber = useNumber,
58
- showTitle = showTitle,
59
- showDescription = showDescription,
60
- customIcon = customIcon,
61
- modifier = modifier,
62
- )
63
- }
64
- }
65
-
66
- @Composable
67
- private fun ProgressInfoHorizontal(
68
- steps: List<ProgressInfoItem>,
69
- size: ProgressInfoSize,
70
- useNumber: Boolean,
71
- align: ProgressInfoAlign,
72
- showTitle: Boolean,
73
- showDescription: Boolean,
74
- customIcon: String?,
75
- modifier: Modifier = Modifier,
76
- ) {
77
- Row(
78
- modifier = modifier
79
- .fillMaxWidth()
80
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
81
- verticalAlignment = Alignment.Top,
82
- ) {
83
- steps.forEachIndexed { index, item ->
84
- val isFirst = index == 0
85
- val isLast = index == steps.lastIndex
86
-
87
- val columnAlign: Alignment.Horizontal = when (align) {
88
- ProgressInfoAlign.Left -> Alignment.Start
89
- ProgressInfoAlign.Right -> Alignment.End
90
- ProgressInfoAlign.Stretch -> when {
91
- isFirst -> Alignment.Start
92
- isLast -> Alignment.End
93
- else -> Alignment.CenterHorizontally
94
- }
95
- ProgressInfoAlign.Center -> Alignment.CenterHorizontally
96
- }
97
-
98
- val textAlign: TextAlign = when (align) {
99
- ProgressInfoAlign.Left -> TextAlign.Left
100
- ProgressInfoAlign.Right -> TextAlign.Right
101
- ProgressInfoAlign.Stretch -> when {
102
- isFirst -> TextAlign.Left
103
- isLast -> TextAlign.Right
104
- else -> TextAlign.Center
105
- }
106
- ProgressInfoAlign.Center -> TextAlign.Center
107
- }
108
-
109
- val endPadding = if (!isLast &&
110
- align != ProgressInfoAlign.Center &&
111
- align != ProgressInfoAlign.Stretch
112
- ) Spacing.XS else 0.dp
113
-
114
- val hideLineLeft = align == ProgressInfoAlign.Left ||
115
- (align == ProgressInfoAlign.Stretch && isFirst)
116
- val hideLineRight = align == ProgressInfoAlign.Right ||
117
- (align == ProgressInfoAlign.Stretch && isLast)
118
-
119
- Column(
120
- modifier = Modifier
121
- .weight(1f)
122
- .padding(end = endPadding),
123
- horizontalAlignment = columnAlign,
124
- ) {
125
- Row(
126
- modifier = Modifier.fillMaxWidth(),
127
- verticalAlignment = Alignment.CenterVertically,
128
- ) {
129
- if (!hideLineLeft) {
130
- ProgressInfoHorizontalLine(modifier = Modifier.weight(1f))
131
- }
132
- ProgressInfoStepIcon(
133
- index = index,
134
- size = size,
135
- useNumber = useNumber,
136
- customIcon = customIcon,
137
- modifier = Modifier.padding(vertical = Spacing.XS),
138
- )
139
- if (!hideLineRight) {
140
- ProgressInfoHorizontalLine(modifier = Modifier.weight(1f))
141
- }
142
- }
143
-
144
- if (showTitle && item.title.isNotEmpty()) {
145
- Text(
146
- text = item.title,
147
- style = Typography.headerXsSemibold,
148
- textAlign = textAlign,
149
- modifier = Modifier
150
- .fillMaxWidth()
151
- .padding(bottom = Spacing.XS),
152
- )
153
- }
154
-
155
- val desc = item.description
156
- if (showDescription && !desc.isNullOrEmpty()) {
157
- Text(
158
- text = desc,
159
- style = Typography.descriptionDefaultRegular,
160
- color = Colors.black_12,
161
- textAlign = textAlign,
162
- modifier = Modifier.fillMaxWidth(),
163
- )
164
- }
165
- }
166
- }
167
- }
168
- }
169
-
170
-
171
- @Composable
172
- private fun ProgressInfoVertical(
173
- steps: List<ProgressInfoItem>,
174
- size: ProgressInfoSize,
175
- useNumber: Boolean,
176
- showTitle: Boolean,
177
- showDescription: Boolean,
178
- customIcon: String?,
179
- modifier: Modifier = Modifier,
180
- ) {
181
- val theme = AppTheme.current
182
- val lineColor = remember(theme) { theme.colors.primary.copy(alpha = 0.2f) }
183
- val density = LocalDensity.current
184
-
185
- Column(
186
- modifier = modifier
187
- .fillMaxWidth()
188
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
189
- ) {
190
- steps.forEachIndexed { index, item ->
191
- val isLast = index == steps.lastIndex
192
- val rowHeightPx = remember { mutableFloatStateOf(0f) }
193
- val rowHeightDp = with(density) { rowHeightPx.value.toDp() }
194
-
195
- Row(
196
- modifier = Modifier
197
- .fillMaxWidth()
198
- .onGloballyPositioned { coords -> rowHeightPx.value = coords.size.height.toFloat() },
199
- ) {
200
- Column(
201
- modifier = Modifier.heightIn(min = if (isLast) 40.dp else 48.dp),
202
- horizontalAlignment = Alignment.CenterHorizontally,
203
- ) {
204
- ProgressInfoStepIcon(
205
- index = index,
206
- size = size,
207
- useNumber = useNumber,
208
- customIcon = customIcon,
209
- )
210
- if (!isLast) {
211
- Spacer(
212
- modifier = Modifier
213
- .width(2.dp)
214
- .height(rowHeightDp-if(size == ProgressInfoSize.Large) scaleSize(24f).dp else scaleSize(16f).dp)
215
- .background(lineColor),
216
- )
217
- }
218
- }
219
-
220
- // Right column: title + description
221
- Column(
222
- modifier = Modifier
223
- .weight(1f)
224
- .padding(
225
- end = Spacing.S,
226
- bottom = if (isLast) 0.dp else Spacing.S,
227
- ),
228
- ) {
229
- if (showTitle && item.title.isNotEmpty()) {
230
- Text(
231
- text = item.title,
232
- style = Typography.headerXsSemibold,
233
- maxLines = 2,
234
- modifier = Modifier
235
- .fillMaxWidth()
236
- .padding(end = Spacing.S),
237
- )
238
- }
239
-
240
- val desc = item.description
241
- if (showDescription && !desc.isNullOrEmpty()) {
242
- Text(
243
- text = desc,
244
- style = Typography.descriptionDefaultRegular,
245
- color = Colors.black_12,
246
- )
247
- }
248
- }
249
- }
250
- }
251
- }
252
- }
253
-
254
- @Composable
255
- private fun ProgressInfoStepIcon(
256
- index: Int,
257
- size: ProgressInfoSize,
258
- useNumber: Boolean,
259
- customIcon: String?,
260
- modifier: Modifier = Modifier,
261
- ) {
262
- val containerSize = scaleSize(if (size == ProgressInfoSize.Small) 16f else 24f).dp
263
- val dotSize = scaleSize(if (size == ProgressInfoSize.Small) 6f else 8f).dp
264
- val iconSize = scaleSize(if (size == ProgressInfoSize.Small) 12f else 16f).dp
265
-
266
- Box(
267
- contentAlignment = Alignment.Center,
268
- modifier = modifier
269
- .size(containerSize)
270
- .clip(CircleShape)
271
- .background(Colors.pink_08)
272
- .border(width = 2.dp, color = Colors.pink_08, shape = CircleShape)
273
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
274
- ) {
275
- when {
276
- useNumber -> {
277
- Text(
278
- text = (index + 1).toString(),
279
- style = Typography.headerXsSemibold,
280
- color = Colors.pink_MoMo_Branding,
281
- textAlign = TextAlign.Center,
282
- )
283
- }
284
- !customIcon.isNullOrEmpty() -> {
285
- Icon(
286
- source = customIcon,
287
- size = iconSize,
288
- color = Colors.pink_MoMo_Branding,
289
- )
290
- }
291
- else -> {
292
- Box(
293
- modifier = Modifier
294
- .size(dotSize)
295
- .clip(CircleShape)
296
- .background(Colors.pink_MoMo_Branding),
297
- )
298
- }
299
- }
300
- }
301
- }
302
-
303
- @Composable
304
- private fun ProgressInfoHorizontalLine(modifier: Modifier = Modifier) {
305
- Box(
306
- modifier = modifier
307
- .height(2.dp)
308
- .background(Colors.pink_08),
309
- )
310
- }
@@ -1,59 +0,0 @@
1
- package vn.momo.kits.components
2
-
3
- import androidx.compose.foundation.border
4
- import androidx.compose.foundation.layout.*
5
- import androidx.compose.foundation.shape.RoundedCornerShape
6
- import androidx.compose.runtime.Composable
7
- import androidx.compose.ui.Alignment
8
- import androidx.compose.ui.Modifier
9
- import androidx.compose.ui.draw.clip
10
- import androidx.compose.ui.unit.dp
11
- import vn.momo.kits.application.IsShowBaseLineDebug
12
- import vn.momo.kits.const.*
13
- import vn.momo.kits.modifier.activeOpacityClickable
14
- import vn.momo.kits.modifier.conditional
15
-
16
- @Composable
17
- fun Radio(
18
- value: Any,
19
- groupValue: Any,
20
- disabled: Boolean = false,
21
- onChange: () -> Unit = {},
22
- label: String = "",
23
- modifier: Modifier = Modifier,
24
- ) {
25
- val selected = value == groupValue
26
- val borderColor = when {
27
- disabled && selected -> AppTheme.current.colors.background.tonal
28
- disabled -> AppTheme.current.colors.text.disable
29
- selected -> AppTheme.current.colors.primary
30
- else -> AppTheme.current.colors.text.default
31
- }
32
- val borderWidth = if (selected) 6.dp else 2.dp
33
-
34
- Row(
35
- modifier = modifier.activeOpacityClickable(
36
- onClick = onChange,
37
- enabled = !disabled,
38
- ),
39
- horizontalArrangement = Arrangement.Center,
40
- verticalAlignment = Alignment.CenterVertically,
41
- ) {
42
- Box(
43
- modifier = modifier
44
- .padding(end = if (label.isEmpty()) 0.dp else Spacing.XS)
45
- .border(borderWidth, borderColor, RoundedCornerShape(Radius.M))
46
- .conditional(IsShowBaseLineDebug) {
47
- border(1.dp, Colors.blue_03)
48
- }
49
- .clip(RoundedCornerShape(Radius.M))
50
- .size(20.dp)
51
- )
52
- if (label.isNotEmpty()) {
53
- Text(
54
- style = Typography.descriptionDefaultRegular,
55
- text = label,
56
- )
57
- }
58
- }
59
- }
@@ -1,87 +0,0 @@
1
- package vn.momo.kits.components
2
-
3
- import androidx.compose.foundation.border
4
- import androidx.compose.foundation.layout.Arrangement
5
- import androidx.compose.foundation.layout.Row
6
- import androidx.compose.runtime.Composable
7
- import androidx.compose.runtime.Immutable
8
- import androidx.compose.runtime.remember
9
- import androidx.compose.ui.Alignment
10
- import androidx.compose.ui.Modifier
11
- import androidx.compose.ui.unit.dp
12
- import vn.momo.kits.application.IsShowBaseLineDebug
13
- import vn.momo.kits.const.Colors
14
- import vn.momo.kits.const.scaleSize
15
- import vn.momo.kits.modifier.activeOpacityClickable
16
- import vn.momo.kits.modifier.conditional
17
-
18
- @Composable
19
- fun Rating(
20
- modifier: Modifier = Modifier,
21
- numOfStars: Int,
22
- rating: Float,
23
- onRatingChange: ((Int) -> Unit)? = null,
24
- size: RatingSize = RatingSize.LARGE,
25
- ) {
26
- val iconSize = remember(size) {
27
- when (size) {
28
- RatingSize.SMALL -> RatingDefaults.Small.iconSize
29
- RatingSize.MEDIUM -> RatingDefaults.Medium.iconSize
30
- RatingSize.LARGE -> RatingDefaults.Large.iconSize
31
- }
32
- }
33
-
34
- Row(
35
- modifier = modifier
36
- .conditional(IsShowBaseLineDebug) {
37
- border(1.dp, Colors.blue_03)
38
- },
39
- verticalAlignment = Alignment.CenterVertically,
40
- horizontalArrangement = Arrangement.spacedBy(2.dp)
41
- ) {
42
- for (index in 0 until numOfStars) {
43
- val starIcon = remember(rating, index) {
44
- when {
45
- index < rating.toInt() -> "reaction_star_full"
46
- index == rating.toInt() && rating % 1 != 0f -> "reaction_star_half"
47
- else -> "reaction_star_non"
48
- }
49
- }
50
- val starColor = remember(rating, index) {
51
- when {
52
- index < rating.toInt() -> Colors.yellow_03
53
- index == rating.toInt() && rating % 1 != 0f -> Colors.yellow_03
54
- else -> Colors.black_07
55
- }
56
- }
57
-
58
- val starModifier = if (onRatingChange != null) {
59
- Modifier.activeOpacityClickable {
60
- onRatingChange(index + 1)
61
- }
62
- } else {
63
- Modifier
64
- }
65
-
66
- Icon(
67
- source = starIcon,
68
- size = scaleSize(iconSize).dp,
69
- color = starColor,
70
- modifier = starModifier,
71
- )
72
- }
73
- }
74
- }
75
-
76
- enum class RatingSize { SMALL, MEDIUM, LARGE }
77
-
78
- object RatingDefaults {
79
- @Immutable
80
- data class Dimensions(
81
- val iconSize: Float,
82
- )
83
-
84
- val Small = Dimensions(iconSize = 16f)
85
- val Medium = Dimensions(iconSize = 20f)
86
- val Large = Dimensions(iconSize = 24f)
87
- }
@@ -1,21 +0,0 @@
1
- package vn.momo.kits.components
2
-
3
- import androidx.compose.runtime.Composable
4
- import androidx.compose.runtime.CompositionLocalProvider
5
- import vn.momo.kits.application.ScaleSizeMaxRate
6
-
7
- @Deprecated(
8
- "Max font scale is fixed at MAX_FONT_SCALE (1.5); this override is no longer applied. Remove the wrapper.",
9
- ReplaceWith("content()"),
10
- )
11
- @Composable
12
- fun ScaleSizeScope(
13
- scaleSizeMaxRate: Float? = null,
14
- content: @Composable () -> Unit
15
- ) {
16
- CompositionLocalProvider(
17
- ScaleSizeMaxRate provides scaleSizeMaxRate,
18
- ) {
19
- content()
20
- }
21
- }
@@ -1,90 +0,0 @@
1
- package vn.momo.kits.components
2
-
3
- import vn.momo.kits.modifier.InternalApi
4
-
5
- import androidx.compose.animation.core.*
6
- import androidx.compose.foundation.background
7
- import androidx.compose.foundation.border
8
- import androidx.compose.foundation.layout.Box
9
- import androidx.compose.foundation.layout.BoxWithConstraints
10
- import androidx.compose.foundation.layout.fillMaxSize
11
- import androidx.compose.runtime.Composable
12
- import androidx.compose.runtime.remember
13
- import androidx.compose.ui.Modifier
14
- import androidx.compose.ui.draw.drawBehind
15
- import androidx.compose.ui.geometry.Offset
16
- import androidx.compose.ui.graphics.Brush
17
- import androidx.compose.ui.unit.dp
18
- import vn.momo.kits.application.IsShowBaseLineDebug
19
- import vn.momo.kits.const.Colors
20
- import vn.momo.kits.modifier.conditional
21
-
22
- private val shimmerColors = listOf(
23
- Colors.black_05,
24
- Colors.black_03,
25
- Colors.black_05,
26
- )
27
- private const val SHADOW_BRUSH_PERCENTAGE = 0.6f
28
- private const val DEFAULT_DURATION_MILLIS = 1000
29
-
30
- @Composable
31
- fun Skeleton() {
32
- BoxWithConstraints(modifier = Modifier.fillMaxSize()) {
33
- val maxWidthValue = remember(maxWidth) { maxWidth.value.toInt() }
34
-
35
- Box(
36
- modifier = Modifier
37
- .fillMaxSize()
38
- .background(Colors.black_05)
39
- .conditional(IsShowBaseLineDebug) {
40
- border(1.dp, Colors.blue_03)
41
- }
42
- .shimmerLoadingAnimation(maxWidth = maxWidthValue)
43
- )
44
- }
45
- }
46
-
47
- @Composable
48
- @InternalApi
49
- fun Modifier.shimmerLoadingAnimation(
50
- maxWidth: Int,
51
- angleOfAxisY: Float = 0f,
52
- durationMillis: Int = DEFAULT_DURATION_MILLIS,
53
- ): Modifier {
54
- // Memoize calculations to avoid repeated computations
55
- val widthOfShadowBrush = remember(maxWidth) {
56
- (maxWidth * SHADOW_BRUSH_PERCENTAGE).toInt()
57
- }
58
-
59
- val animationTarget = remember(durationMillis, widthOfShadowBrush) {
60
- (durationMillis + widthOfShadowBrush).toFloat()
61
- }
62
-
63
- val transition = rememberInfiniteTransition(label = "shimmer")
64
- val translateAnimation = transition.animateFloat(
65
- initialValue = 0f,
66
- targetValue = animationTarget,
67
- animationSpec = infiniteRepeatable(
68
- animation = tween(
69
- durationMillis = durationMillis,
70
- easing = LinearEasing,
71
- ),
72
- repeatMode = RepeatMode.Restart,
73
- ),
74
- label = "shimmerTranslate"
75
- )
76
-
77
- return drawBehind {
78
- // Memoize brush creation by using remember in the calling composable
79
- val startX = translateAnimation.value - widthOfShadowBrush
80
- val endX = translateAnimation.value
81
-
82
- drawRect(
83
- brush = Brush.linearGradient(
84
- colors = shimmerColors,
85
- start = Offset(x = startX, y = 0f),
86
- end = Offset(x = endX, y = angleOfAxisY)
87
- )
88
- )
89
- }
90
- }