@momo-kits/native-kits 0.162.1 → 0.162.2-beta.1

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 (154) hide show
  1. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +32 -0
  2. package/example/ios/Example.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/xcschememanagement.plist +2 -2
  3. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  4. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +16 -0
  5. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +6 -0
  6. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +58 -0
  7. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +58 -0
  8. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/xcschememanagement.plist +14 -0
  9. package/ios/Typography/MomoFontScale.swift +36 -0
  10. package/ios/Typography/Text.swift +19 -9
  11. package/ios/Typography/Typography.swift +6 -22
  12. package/package.json +1 -1
  13. package/publish.sh +2 -2
  14. package/build.gradle.kts +0 -11
  15. package/compose/build.gradle.kts +0 -186
  16. package/compose/compose.podspec +0 -47
  17. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  18. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -123
  19. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  20. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  21. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  22. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  23. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  24. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  25. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  26. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  27. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  28. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  29. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  30. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  31. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  32. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -57
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -109
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -201
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -222
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -48
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -305
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -921
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -121
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -403
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -85
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -340
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -123
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -94
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -136
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -224
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -543
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -148
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -188
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -116
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -452
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -172
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -255
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -233
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -259
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -241
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -364
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -92
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -352
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -103
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -338
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -70
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -96
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -348
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -256
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -494
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -131
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -215
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -96
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -531
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -92
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -135
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -214
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -590
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -177
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -192
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -205
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -239
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -191
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -306
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -285
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -2
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -35
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -2
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -57
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -68
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -50
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -253
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -133
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -100
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -145
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -345
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -556
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -161
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -243
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -187
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -279
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -80
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -306
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -32
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -370
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -131
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -167
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -72
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -66
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  135. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -70
  136. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  137. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -105
  138. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -33
  139. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -186
  140. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  141. package/gradle/libs.versions.toml +0 -67
  142. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  143. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  144. package/gradle.properties +0 -26
  145. package/gradlew +0 -252
  146. package/gradlew.bat +0 -94
  147. package/local.properties +0 -8
  148. package/settings.gradle.kts +0 -64
  149. /package/example/ios/Example.xcworkspace/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/xcschememanagement.plist +0 -0
  150. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/MoMoUIKits.xcscheme +0 -0
  151. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/Pods-Example.xcscheme +0 -0
  152. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/SDWebImage.xcscheme +0 -0
  153. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/SDWebImageSwiftUI.xcscheme +0 -0
  154. /package/example/ios/Pods/Pods.xcodeproj/xcuserdata/{huynhdung.xcuserdatad → sonnguyen.xcuserdatad}/xcschemes/SkeletonUI.xcscheme +0 -0
@@ -1,103 +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.clickable
6
- import androidx.compose.foundation.interaction.MutableInteractionSource
7
- import androidx.compose.foundation.layout.Box
8
- import androidx.compose.foundation.layout.Column
9
- import androidx.compose.foundation.layout.aspectRatio
10
- import androidx.compose.foundation.layout.fillMaxWidth
11
- import androidx.compose.foundation.layout.height
12
- import androidx.compose.foundation.layout.padding
13
- import androidx.compose.foundation.layout.width
14
- import androidx.compose.foundation.shape.RoundedCornerShape
15
- import androidx.compose.runtime.Composable
16
- import androidx.compose.runtime.remember
17
- import androidx.compose.ui.Alignment
18
- import androidx.compose.ui.Modifier
19
- import androidx.compose.ui.draw.clip
20
- import androidx.compose.ui.layout.ContentScale
21
- import androidx.compose.ui.unit.dp
22
- import vn.momo.kits.const.AppTheme
23
- import vn.momo.kits.const.Radius
24
- import vn.momo.kits.application.IsShowBaseLineDebug
25
- import vn.momo.kits.const.Colors
26
- import vn.momo.kits.const.Spacing
27
- import vn.momo.kits.modifier.conditional
28
- import vn.momo.kits.modifier.setAutomationId
29
- import vn.momo.kits.utils.ifNotNull
30
-
31
- @Composable
32
- fun PopupPromotion(
33
- source: String = "",
34
- onPress: (() -> Unit) = {},
35
- onClose: (() -> Unit) = {},
36
- ) {
37
- Column(Modifier
38
- .padding(horizontal = Spacing.M)
39
- .conditional(IsShowBaseLineDebug) {
40
- border(1.dp, Colors.blue_03)
41
- }
42
- .setAutomationId("popup_notify")) {
43
- source.ifNotNull(
44
- Image(
45
- source = source,
46
- modifier = Modifier.fillMaxWidth()
47
- .aspectRatio(0.72f)
48
- .clickable(
49
- interactionSource = remember { MutableInteractionSource() },
50
- indication = null,
51
- onClick = onPress
52
- ),
53
- options = Options(alignment = Alignment.Center, contentScale = ContentScale.FillBounds)
54
- ), null
55
- )
56
- Box(
57
- modifier = Modifier
58
- .padding(top = Spacing.S)
59
- .fillMaxWidth()
60
- .width(40.dp)
61
- .height(40.dp),
62
- contentAlignment = Alignment.Center
63
- ) {
64
- Box(
65
- modifier = Modifier
66
- .width(40.dp)
67
- .height(40.dp)
68
- .clickable(
69
- interactionSource = remember { MutableInteractionSource() },
70
- indication = null,
71
- onClick = onClose
72
- ),
73
- contentAlignment = Alignment.Center
74
- ) {
75
- Box(
76
- Modifier
77
- .width(22.dp)
78
- .height(22.dp)
79
- .background(
80
- color = AppTheme.current.colors.text.default,
81
- shape = RoundedCornerShape(Radius.M)
82
- )
83
- .border(
84
- width = 2.dp,
85
- color = AppTheme.current.colors.background.surface,
86
- shape = RoundedCornerShape(Radius.M)
87
- )
88
- .clip(RoundedCornerShape(100))
89
- ,
90
- contentAlignment = Alignment.Center
91
- ) {
92
- Icon(
93
- source = "navigation_close",
94
- color = AppTheme.current.colors.background.surface,
95
- size = 16.dp,
96
- modifier = Modifier.setAutomationId("ic_popup_close")
97
- )
98
- }
99
- }
100
-
101
- }
102
- }
103
- }
@@ -1,338 +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 model ───────────────────────────────────────────────────────────────
22
-
23
- data class ProgressInfoItem(
24
- val title: String,
25
- val description: String? = null,
26
- )
27
-
28
- enum class ProgressInfoSize { Small, Large }
29
-
30
- enum class ProgressInfoAlign { Left, Right, Center, Stretch }
31
-
32
- // ─── Public entry-point ───────────────────────────────────────────────────────
33
-
34
- /**
35
- * Display-only step progress indicator migrated from the React Native ProgressInfo component.
36
- *
37
- * @param steps Ordered list of steps; each has a [ProgressInfoItem.title] and an
38
- * optional [ProgressInfoItem.description].
39
- * @param horizontal When `true` renders steps in a horizontal row with connector lines;
40
- * when `false` (default) renders a vertical column.
41
- * @param size Icon diameter: [ProgressInfoSize.Small] = 16 dp,
42
- * [ProgressInfoSize.Large] = 24 dp (default).
43
- * @param useNumber Show the 1-based step index inside the icon instead of the default dot.
44
- * @param align Alignment of icon + text for the horizontal variant.
45
- * @param showTitle Whether step titles are rendered (default `true`).
46
- * @param showDescription Whether step descriptions are rendered (default `true`).
47
- * @param customIcon Icon source key rendered inside each step circle (overrides the dot;
48
- * itself overridden by [useNumber]).
49
- * @param modifier Modifier applied to the root layout.
50
- */
51
- @Composable
52
- fun ProgressInfo(
53
- steps: List<ProgressInfoItem>,
54
- horizontal: Boolean = false,
55
- size: ProgressInfoSize = ProgressInfoSize.Large,
56
- useNumber: Boolean = false,
57
- align: ProgressInfoAlign = ProgressInfoAlign.Center,
58
- showTitle: Boolean = true,
59
- showDescription: Boolean = true,
60
- customIcon: String? = null,
61
- modifier: Modifier = Modifier,
62
- ) {
63
- if (horizontal) {
64
- ProgressInfoHorizontal(
65
- steps = steps,
66
- size = size,
67
- useNumber = useNumber,
68
- align = align,
69
- showTitle = showTitle,
70
- showDescription = showDescription,
71
- customIcon = customIcon,
72
- modifier = modifier,
73
- )
74
- } else {
75
- ProgressInfoVertical(
76
- steps = steps,
77
- size = size,
78
- useNumber = useNumber,
79
- showTitle = showTitle,
80
- showDescription = showDescription,
81
- customIcon = customIcon,
82
- modifier = modifier,
83
- )
84
- }
85
- }
86
-
87
- // ─── Horizontal variant ───────────────────────────────────────────────────────
88
-
89
- @Composable
90
- private fun ProgressInfoHorizontal(
91
- steps: List<ProgressInfoItem>,
92
- size: ProgressInfoSize,
93
- useNumber: Boolean,
94
- align: ProgressInfoAlign,
95
- showTitle: Boolean,
96
- showDescription: Boolean,
97
- customIcon: String?,
98
- modifier: Modifier = Modifier,
99
- ) {
100
- Row(
101
- modifier = modifier
102
- .fillMaxWidth()
103
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
104
- verticalAlignment = Alignment.Top,
105
- ) {
106
- steps.forEachIndexed { index, item ->
107
- val isFirst = index == 0
108
- val isLast = index == steps.lastIndex
109
-
110
- val columnAlign: Alignment.Horizontal = when (align) {
111
- ProgressInfoAlign.Left -> Alignment.Start
112
- ProgressInfoAlign.Right -> Alignment.End
113
- ProgressInfoAlign.Stretch -> when {
114
- isFirst -> Alignment.Start
115
- isLast -> Alignment.End
116
- else -> Alignment.CenterHorizontally
117
- }
118
- ProgressInfoAlign.Center -> Alignment.CenterHorizontally
119
- }
120
-
121
- val textAlign: TextAlign = when (align) {
122
- ProgressInfoAlign.Left -> TextAlign.Left
123
- ProgressInfoAlign.Right -> TextAlign.Right
124
- ProgressInfoAlign.Stretch -> when {
125
- isFirst -> TextAlign.Left
126
- isLast -> TextAlign.Right
127
- else -> TextAlign.Center
128
- }
129
- ProgressInfoAlign.Center -> TextAlign.Center
130
- }
131
-
132
- val endPadding = if (!isLast &&
133
- align != ProgressInfoAlign.Center &&
134
- align != ProgressInfoAlign.Stretch
135
- ) Spacing.XS else 0.dp
136
-
137
- val hideLineLeft = align == ProgressInfoAlign.Left ||
138
- (align == ProgressInfoAlign.Stretch && isFirst)
139
- val hideLineRight = align == ProgressInfoAlign.Right ||
140
- (align == ProgressInfoAlign.Stretch && isLast)
141
-
142
- Column(
143
- modifier = Modifier
144
- .weight(1f)
145
- .padding(end = endPadding),
146
- horizontalAlignment = columnAlign,
147
- ) {
148
- Row(
149
- modifier = Modifier.fillMaxWidth(),
150
- verticalAlignment = Alignment.CenterVertically,
151
- ) {
152
- if (!hideLineLeft) {
153
- ProgressInfoHorizontalLine(modifier = Modifier.weight(1f))
154
- }
155
- ProgressInfoStepIcon(
156
- index = index,
157
- size = size,
158
- useNumber = useNumber,
159
- customIcon = customIcon,
160
- modifier = Modifier.padding(vertical = Spacing.XS),
161
- )
162
- if (!hideLineRight) {
163
- ProgressInfoHorizontalLine(modifier = Modifier.weight(1f))
164
- }
165
- }
166
-
167
- if (showTitle && item.title.isNotEmpty()) {
168
- Text(
169
- text = item.title,
170
- style = Typography.headerXsSemibold,
171
- textAlign = textAlign,
172
- modifier = Modifier
173
- .fillMaxWidth()
174
- .padding(bottom = Spacing.XS),
175
- )
176
- }
177
-
178
- val desc = item.description
179
- if (showDescription && !desc.isNullOrEmpty()) {
180
- Text(
181
- text = desc,
182
- style = Typography.descriptionDefaultRegular,
183
- color = Colors.black_12,
184
- textAlign = textAlign,
185
- modifier = Modifier.fillMaxWidth(),
186
- )
187
- }
188
- }
189
- }
190
- }
191
- }
192
-
193
- // ─── Vertical variant ─────────────────────────────────────────────────────────
194
-
195
- @Composable
196
- private fun ProgressInfoVertical(
197
- steps: List<ProgressInfoItem>,
198
- size: ProgressInfoSize,
199
- useNumber: Boolean,
200
- showTitle: Boolean,
201
- showDescription: Boolean,
202
- customIcon: String?,
203
- modifier: Modifier = Modifier,
204
- ) {
205
- val theme = AppTheme.current
206
- val lineColor = remember(theme) { theme.colors.primary.copy(alpha = 0.2f) }
207
- val density = LocalDensity.current
208
-
209
- Column(
210
- modifier = modifier
211
- .fillMaxWidth()
212
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
213
- ) {
214
- steps.forEachIndexed { index, item ->
215
- val isLast = index == steps.lastIndex
216
- val rowHeightPx = remember { mutableFloatStateOf(0f) }
217
- val rowHeightDp = with(density) { rowHeightPx.value.toDp() }
218
-
219
- Row(
220
- modifier = Modifier
221
- .fillMaxWidth()
222
- .onGloballyPositioned { coords -> rowHeightPx.value = coords.size.height.toFloat() },
223
- ) {
224
- Column(
225
- modifier = Modifier.heightIn(min = if (isLast) 40.dp else 48.dp),
226
- horizontalAlignment = Alignment.CenterHorizontally,
227
- ) {
228
- ProgressInfoStepIcon(
229
- index = index,
230
- size = size,
231
- useNumber = useNumber,
232
- customIcon = customIcon,
233
- )
234
- if (!isLast) {
235
- Spacer(
236
- modifier = Modifier
237
- .width(2.dp)
238
- .height(rowHeightDp-if(size == ProgressInfoSize.Large) scaleSize(24f).dp else scaleSize(16f).dp)
239
- .background(lineColor),
240
- )
241
- }
242
- }
243
-
244
- // Right column: title + description
245
- Column(
246
- modifier = Modifier
247
- .weight(1f)
248
- .padding(
249
- end = Spacing.S,
250
- bottom = if (isLast) 0.dp else Spacing.S,
251
- ),
252
- ) {
253
- if (showTitle && item.title.isNotEmpty()) {
254
- Text(
255
- text = item.title,
256
- style = Typography.headerXsSemibold,
257
- maxLines = 2,
258
- modifier = Modifier
259
- .fillMaxWidth()
260
- .padding(end = Spacing.S),
261
- )
262
- }
263
-
264
- val desc = item.description
265
- if (showDescription && !desc.isNullOrEmpty()) {
266
- Text(
267
- text = desc,
268
- style = Typography.descriptionDefaultRegular,
269
- color = Colors.black_12,
270
- )
271
- }
272
- }
273
- }
274
- }
275
- }
276
- }
277
-
278
- // ─── Step icon ────────────────────────────────────────────────────────────────
279
-
280
- @Composable
281
- private fun ProgressInfoStepIcon(
282
- index: Int,
283
- size: ProgressInfoSize,
284
- useNumber: Boolean,
285
- customIcon: String?,
286
- modifier: Modifier = Modifier,
287
- ) {
288
- val containerSize = scaleSize(if (size == ProgressInfoSize.Small) 16f else 24f).dp
289
- val dotSize = scaleSize(if (size == ProgressInfoSize.Small) 6f else 8f).dp
290
- val iconSize = scaleSize(if (size == ProgressInfoSize.Small) 12f else 16f).dp
291
-
292
- Box(
293
- contentAlignment = Alignment.Center,
294
- modifier = modifier
295
- .size(containerSize)
296
- .clip(CircleShape)
297
- .background(Colors.pink_08)
298
- .border(width = 2.dp, color = Colors.pink_08, shape = CircleShape)
299
- .conditional(IsShowBaseLineDebug) { border(1.dp, Colors.blue_03) },
300
- ) {
301
- when {
302
- useNumber -> {
303
- Text(
304
- text = (index + 1).toString(),
305
- style = Typography.headerXsSemibold,
306
- color = Colors.pink_MoMo_Branding,
307
- textAlign = TextAlign.Center,
308
- )
309
- }
310
- !customIcon.isNullOrEmpty() -> {
311
- Icon(
312
- source = customIcon,
313
- size = iconSize,
314
- color = Colors.pink_MoMo_Branding,
315
- )
316
- }
317
- else -> {
318
- Box(
319
- modifier = Modifier
320
- .size(dotSize)
321
- .clip(CircleShape)
322
- .background(Colors.pink_MoMo_Branding),
323
- )
324
- }
325
- }
326
- }
327
- }
328
-
329
- // ─── Horizontal connector line ────────────────────────────────────────────────
330
-
331
- @Composable
332
- private fun ProgressInfoHorizontalLine(modifier: Modifier = Modifier) {
333
- Box(
334
- modifier = modifier
335
- .height(2.dp)
336
- .background(Colors.pink_08),
337
- )
338
- }
@@ -1,70 +0,0 @@
1
- package vn.momo.kits.components
2
-
3
- import androidx.compose.foundation.border
4
- import androidx.compose.foundation.clickable
5
- import androidx.compose.foundation.interaction.MutableInteractionSource
6
- import androidx.compose.foundation.layout.Arrangement
7
- import androidx.compose.foundation.layout.Box
8
- import androidx.compose.foundation.layout.Row
9
- import androidx.compose.foundation.layout.padding
10
- import androidx.compose.foundation.layout.size
11
- import androidx.compose.foundation.shape.RoundedCornerShape
12
- import androidx.compose.runtime.Composable
13
- import androidx.compose.runtime.remember
14
- import androidx.compose.ui.Alignment
15
- import androidx.compose.ui.Modifier
16
- import androidx.compose.ui.draw.clip
17
- import androidx.compose.ui.unit.dp
18
- import vn.momo.kits.application.IsShowBaseLineDebug
19
- import vn.momo.kits.const.AppTheme
20
- import vn.momo.kits.const.Colors
21
- import vn.momo.kits.const.Radius
22
- import vn.momo.kits.const.Spacing
23
- import vn.momo.kits.const.Typography
24
- import vn.momo.kits.modifier.activeOpacityClickable
25
- import vn.momo.kits.modifier.conditional
26
-
27
- @Composable
28
- fun Radio(
29
- value: Any,
30
- groupValue: Any,
31
- disabled: Boolean = false,
32
- onChange: () -> Unit = {},
33
- label: String = "",
34
- modifier: Modifier = Modifier,
35
- ) {
36
- val selected = value == groupValue
37
- val borderColor = when {
38
- disabled && selected -> AppTheme.current.colors.background.tonal
39
- disabled -> AppTheme.current.colors.text.disable
40
- selected -> AppTheme.current.colors.primary
41
- else -> AppTheme.current.colors.text.default
42
- }
43
- val borderWidth = if (selected) 6.dp else 2.dp
44
-
45
- Row(
46
- modifier = modifier.activeOpacityClickable(
47
- onClick = onChange,
48
- enabled = !disabled,
49
- ),
50
- horizontalArrangement = Arrangement.Center,
51
- verticalAlignment = Alignment.CenterVertically,
52
- ) {
53
- Box(
54
- modifier = modifier
55
- .padding(end = if (label.isEmpty()) 0.dp else Spacing.XS)
56
- .border(borderWidth, borderColor, RoundedCornerShape(Radius.M))
57
- .conditional(IsShowBaseLineDebug) {
58
- border(1.dp, Colors.blue_03)
59
- }
60
- .clip(RoundedCornerShape(Radius.M))
61
- .size(20.dp)
62
- )
63
- if (label.isNotEmpty()) {
64
- Text(
65
- style = Typography.descriptionDefaultRegular,
66
- text = label,
67
- )
68
- }
69
- }
70
- }
@@ -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,17 +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
- @Composable
8
- fun ScaleSizeScope(
9
- scaleSizeMaxRate: Float? = null,
10
- content: @Composable () -> Unit
11
- ) {
12
- CompositionLocalProvider(
13
- ScaleSizeMaxRate provides scaleSizeMaxRate,
14
- ) {
15
- content()
16
- }
17
- }