@momo-kits/native-kits 0.162.0-debug → 0.162.1-beta.1-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 (104) hide show
  1. package/.claude/settings.local.json +32 -0
  2. package/compose/build.gradle.kts +66 -63
  3. package/compose/build.gradle.kts.backup +66 -63
  4. package/compose/compose.podspec +1 -1
  5. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +2 -7
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +1 -1
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +6 -24
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +4 -19
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +1 -10
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +2 -2
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +1 -1
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +1 -1
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +5 -16
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +6 -101
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +4 -16
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +9 -34
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +1 -6
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +27 -29
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +3 -26
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +27 -30
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +3 -13
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -5
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +3 -11
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +3 -18
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +3 -11
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -5
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +84 -59
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +13 -71
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +10 -51
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +6 -1
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +4 -21
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +15 -76
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +5 -26
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +3 -11
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +15 -36
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -9
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -28
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +2 -13
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +4 -10
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -28
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +8 -47
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +4 -25
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +2 -11
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +1 -17
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +1 -6
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +50 -111
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +1 -5
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +1 -5
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -12
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +4 -96
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +2 -12
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +9 -21
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +9 -14
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +8 -11
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +3 -18
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -2
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -2
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +1 -5
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +5 -12
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +6 -5
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +55 -55
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +3 -9
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +12 -32
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +1 -1
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +6 -24
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +55 -15
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +2 -1
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +6 -3
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +5 -3
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +3 -13
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +3 -2
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +1 -40
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -2
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -8
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Deprecated.kt +107 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +3 -8
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +1 -1
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +3 -3
  88. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +2 -3
  89. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -2
  90. package/gradle.properties +1 -1
  91. package/local.properties +2 -2
  92. package/package.json +1 -1
  93. package/publish.sh +2 -2
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
  96. package/example/ios/Example.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  97. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  98. package/example/ios/Example.xcworkspace/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  99. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  100. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  101. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  102. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  103. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  104. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/huynhdung.xcuserdatad/xcschemes/xcschememanagement.plist +0 -46
@@ -2,43 +2,16 @@ package vn.momo.kits.application
2
2
 
3
3
  import androidx.annotation.FloatRange
4
4
  import androidx.compose.animation.animateContentSize
5
- import androidx.compose.foundation.ScrollState
6
- import androidx.compose.foundation.background
7
- import androidx.compose.foundation.border
5
+ import androidx.compose.foundation.*
8
6
  import androidx.compose.foundation.gestures.detectTapGestures
9
7
  import androidx.compose.foundation.interaction.FocusInteraction
10
8
  import androidx.compose.foundation.interaction.MutableInteractionSource
11
- import androidx.compose.foundation.layout.Arrangement
12
- import androidx.compose.foundation.layout.Box
13
- import androidx.compose.foundation.layout.Row
14
- import androidx.compose.foundation.layout.WindowInsets
15
- import androidx.compose.foundation.layout.asPaddingValues
16
- import androidx.compose.foundation.layout.fillMaxSize
17
- import androidx.compose.foundation.layout.fillMaxWidth
18
- import androidx.compose.foundation.layout.ime
19
- import androidx.compose.foundation.layout.navigationBars
20
- import androidx.compose.foundation.layout.offset
21
- import androidx.compose.foundation.layout.padding
22
- import androidx.compose.foundation.layout.size
23
- import androidx.compose.foundation.rememberScrollState
9
+ import androidx.compose.foundation.layout.*
24
10
  import androidx.compose.foundation.shape.CircleShape
25
11
  import androidx.compose.foundation.text.BasicTextField
26
12
  import androidx.compose.foundation.text.KeyboardActions
27
13
  import androidx.compose.foundation.text.KeyboardOptions
28
- import androidx.compose.foundation.verticalScroll
29
- import androidx.compose.runtime.Composable
30
- import androidx.compose.runtime.LaunchedEffect
31
- import androidx.compose.runtime.MutableState
32
- import androidx.compose.runtime.Stable
33
- import androidx.compose.runtime.State
34
- import androidx.compose.runtime.derivedStateOf
35
- import androidx.compose.runtime.getValue
36
- import androidx.compose.runtime.mutableStateOf
37
- import androidx.compose.runtime.produceState
38
- import androidx.compose.runtime.remember
39
- import androidx.compose.runtime.rememberUpdatedState
40
- import androidx.compose.runtime.snapshotFlow
41
- import androidx.compose.runtime.staticCompositionLocalOf
14
+ import androidx.compose.runtime.*
42
15
  import androidx.compose.ui.Alignment
43
16
  import androidx.compose.ui.Modifier
44
17
  import androidx.compose.ui.composed
@@ -52,25 +25,13 @@ import androidx.compose.ui.graphics.Color
52
25
  import androidx.compose.ui.graphics.SolidColor
53
26
  import androidx.compose.ui.graphics.graphicsLayer
54
27
  import androidx.compose.ui.input.pointer.pointerInput
55
- import androidx.compose.ui.layout.Layout
56
- import androidx.compose.ui.layout.Measurable
57
- import androidx.compose.ui.layout.MeasurePolicy
58
- import androidx.compose.ui.layout.MeasureResult
59
- import androidx.compose.ui.layout.MeasureScope
60
- import androidx.compose.ui.layout.Placeable
61
- import androidx.compose.ui.layout.layoutId
28
+ import androidx.compose.ui.layout.*
62
29
  import androidx.compose.ui.platform.LocalDensity
63
30
  import androidx.compose.ui.platform.LocalFocusManager
64
31
  import androidx.compose.ui.platform.LocalSoftwareKeyboardController
65
32
  import androidx.compose.ui.text.TextStyle
66
33
  import androidx.compose.ui.text.style.TextOverflow
67
- import androidx.compose.ui.unit.Constraints
68
- import androidx.compose.ui.unit.Dp
69
- import androidx.compose.ui.unit.IntOffset
70
- import androidx.compose.ui.unit.LayoutDirection
71
- import androidx.compose.ui.unit.dp
72
- import androidx.compose.ui.unit.lerp
73
- import androidx.compose.ui.unit.sp
34
+ import androidx.compose.ui.unit.*
74
35
  import kotlinx.coroutines.flow.collectLatest
75
36
  import kotlinx.coroutines.flow.mapNotNull
76
37
  import vn.momo.kits.components.Icon
@@ -82,7 +43,6 @@ import vn.momo.kits.const.Typography
82
43
  import vn.momo.kits.modifier.kitsAutomationId
83
44
  import vn.momo.kits.modifier.noFeedbackClickable
84
45
  import vn.momo.kits.modifier.setAutomationId
85
- import vn.momo.kits.modifier.shadow
86
46
  import vn.momo.kits.navigation.component.HEADER_HEIGHT
87
47
  import vn.momo.kits.utils.getAppStatusBarHeight
88
48
  import kotlin.math.max
@@ -123,7 +83,7 @@ fun LiteScreen(
123
83
  title: String? = null,
124
84
  inputSearchProps: LiteInputSearchProps? = null,
125
85
  goBack: (() -> Unit)? = null,
126
- headerRight: @Composable() (() -> Unit)? = null,
86
+ headerRight: @Composable (() -> Unit)? = null,
127
87
  useAnimationSearch: Boolean = true,
128
88
  titlePosition: TitlePosition = TitlePosition.LEFT,
129
89
  headerRightData: HeaderRightData? = null,
@@ -853,61 +813,6 @@ private fun LiteInputSearch(
853
813
  }
854
814
  }
855
815
 
856
- @Composable
857
- private fun footerOffset(
858
- useAvoidKeyboard: Boolean = true,
859
- ): State<IntOffset> {
860
- if (!useAvoidKeyboard) return remember { mutableStateOf(IntOffset.Zero) }
861
- val density = LocalDensity.current
862
- val navPaddingValue = WindowInsets.navigationBars.asPaddingValues()
863
- val keyboardSize = keyboardSizeState()
864
-
865
- return produceState(IntOffset.Zero, density, navPaddingValue) {
866
- val navSystemOffset = with(density) { navPaddingValue.calculateBottomPadding().roundToPx() }
867
- snapshotFlow { keyboardSize.value }.collectLatest {
868
- value = if (it == 0.dp) IntOffset.Zero
869
- else IntOffset(
870
- x = 0, y = with(density) {
871
- navSystemOffset - it.roundToPx()
872
- })
873
- }
874
- }
875
- }
876
-
877
- @Composable
878
- fun keyboardSizeState(): State<Dp> {
879
- val bottom = WindowInsets.ime.asPaddingValues()
880
- return rememberUpdatedState(bottom.calculateBottomPadding())
881
- }
882
-
883
- @Composable
884
- private fun Footer(
885
- useAvoidKeyboard: Boolean,
886
- footerContent: (@Composable () -> Unit)?,
887
- ) {
888
- footerContent ?: return
889
- val theme = AppTheme.current
890
- val navPaddingValue = WindowInsets.navigationBars.asPaddingValues()
891
- val offsetMove = footerOffset(useAvoidKeyboard)
892
-
893
- Box(
894
- modifier = Modifier.padding(navPaddingValue).fillMaxWidth().offset {
895
- offsetMove.value
896
- }.shadow(
897
- color = Colors.black_20.copy(alpha = 0.05f),
898
- blurRadius = 24f,
899
- offsetX = 0.dp,
900
- offsetY = (-4).dp
901
- ).background(theme.colors.background.surface).padding(
902
- start = Spacing.M,
903
- top = Spacing.M,
904
- end = Spacing.M,
905
- )
906
- ) {
907
- footerContent()
908
- }
909
- }
910
-
911
816
  fun Modifier.hideKeyboardOnTap() = composed {
912
817
  val focusManager = LocalFocusManager.current
913
818
  val keyboardManager = LocalSoftwareKeyboardController.current
@@ -1,24 +1,12 @@
1
1
  package vn.momo.kits.application
2
2
 
3
3
  import androidx.compose.foundation.layout.Box
4
- import androidx.compose.foundation.layout.fillMaxSize
5
4
  import androidx.compose.foundation.layout.wrapContentSize
6
- import androidx.compose.runtime.Composable
7
- import androidx.compose.runtime.CompositionLocalProvider
8
- import androidx.compose.runtime.LaunchedEffect
9
- import androidx.compose.runtime.getValue
10
- import androidx.compose.runtime.mutableStateOf
11
- import androidx.compose.runtime.remember
12
- import androidx.compose.runtime.setValue
13
- import androidx.compose.runtime.staticCompositionLocalOf
5
+ import androidx.compose.runtime.*
14
6
  import androidx.compose.ui.Modifier
15
7
  import androidx.compose.ui.unit.Dp
16
- import vn.momo.kits.const.AppStatusBar
17
- import vn.momo.kits.const.AppTheme
18
- import vn.momo.kits.const.Theme
19
- import vn.momo.kits.const.ThemeAssets
20
- import vn.momo.kits.const.defaultTheme
21
- import vn.momo.kits.modifier.DeprecatedModifier
8
+ import vn.momo.kits.const.*
9
+ import vn.momo.kits.utils.Deprecated as DeprecatedKit
22
10
  import vn.momo.kits.platform.getStatusBarHeight
23
11
 
24
12
  @Deprecated("Use IMaxApi instead", ReplaceWith("IMaxApi"))
@@ -113,7 +101,7 @@ fun ApplicationContainer(
113
101
  AppConfig provides config,
114
102
  AppLanguage provides language,
115
103
  ) {
116
- Box(Modifier.wrapContentSize().then(DeprecatedModifier())) {
104
+ Box(Modifier.wrapContentSize().then(DeprecatedKit.deprecatedModifier())) {
117
105
  content()
118
106
  }
119
107
  }
@@ -6,32 +6,10 @@ import androidx.compose.animation.core.tween
6
6
  import androidx.compose.foundation.ScrollState
7
7
  import androidx.compose.foundation.background
8
8
  import androidx.compose.foundation.gestures.detectTapGestures
9
- import androidx.compose.foundation.layout.Arrangement
10
- import androidx.compose.foundation.layout.Box
11
- import androidx.compose.foundation.layout.Column
12
- import androidx.compose.foundation.layout.Spacer
13
- import androidx.compose.foundation.layout.WindowInsets
14
- import androidx.compose.foundation.layout.asPaddingValues
15
- import androidx.compose.foundation.layout.aspectRatio
16
- import androidx.compose.foundation.layout.fillMaxSize
17
- import androidx.compose.foundation.layout.fillMaxWidth
18
- import androidx.compose.foundation.layout.height
19
- import androidx.compose.foundation.layout.ime
20
- import androidx.compose.foundation.layout.imePadding
21
- import androidx.compose.foundation.layout.navigationBars
22
- import androidx.compose.foundation.layout.offset
23
- import androidx.compose.foundation.layout.padding
9
+ import androidx.compose.foundation.layout.*
24
10
  import androidx.compose.foundation.rememberScrollState
25
11
  import androidx.compose.foundation.verticalScroll
26
- import androidx.compose.runtime.Composable
27
- import androidx.compose.runtime.CompositionLocalProvider
28
- import androidx.compose.runtime.DisposableEffect
29
- import androidx.compose.runtime.LaunchedEffect
30
- import androidx.compose.runtime.getValue
31
- import androidx.compose.runtime.mutableStateOf
32
- import androidx.compose.runtime.remember
33
- import androidx.compose.runtime.setValue
34
- import androidx.compose.runtime.staticCompositionLocalOf
12
+ import androidx.compose.runtime.*
35
13
  import androidx.compose.ui.Alignment
36
14
  import androidx.compose.ui.Modifier
37
15
  import androidx.compose.ui.graphics.Color
@@ -44,24 +22,20 @@ import androidx.compose.ui.unit.Dp
44
22
  import androidx.compose.ui.unit.IntOffset
45
23
  import androidx.compose.ui.unit.dp
46
24
  import androidx.compose.ui.zIndex
47
- import kotlinx.coroutines.CoroutineScope
48
- import kotlinx.coroutines.Dispatchers
49
- import kotlinx.coroutines.SupervisorJob
50
- import kotlinx.coroutines.cancel
51
- import kotlinx.coroutines.delay
52
- import kotlinx.coroutines.launch
25
+ import kotlinx.coroutines.*
53
26
  import vn.momo.kits.components.InputSearchProps
54
27
  import vn.momo.kits.const.AppNavigationBar
55
28
  import vn.momo.kits.const.AppTheme
56
29
  import vn.momo.kits.const.Colors
57
30
  import vn.momo.kits.const.Spacing
58
- import vn.momo.kits.modifier.DeprecatedModifier
59
31
  import vn.momo.kits.modifier.conditional
32
+ import vn.momo.kits.utils.Deprecated as DeprecatedKit
60
33
  import vn.momo.kits.modifier.shadow
61
34
  import vn.momo.kits.navigation.component.SnackBar
62
35
  import vn.momo.kits.platform.supportsImePadding
63
36
  import vn.momo.kits.utils.getAppStatusBarHeight
64
37
  import vn.momo.kits.utils.getNavigationBarHeight
38
+ import kotlin.time.Duration.Companion.milliseconds
65
39
 
66
40
  enum class HeaderType {
67
41
  DEFAULT,
@@ -137,7 +111,7 @@ fun Screen(
137
111
  .background(backgroundColor ?: AppTheme.current.colors.background.default)
138
112
  .conditional(useAvoidKeyboard && supportsImePadding()) {
139
113
  imePadding()
140
- }.then(DeprecatedModifier())
114
+ }.then(DeprecatedKit.deprecatedModifier())
141
115
  ) {
142
116
  val footerHeightPx = remember { mutableStateOf(0) }
143
117
 
@@ -281,6 +255,7 @@ fun Footer(
281
255
  .onGloballyPositioned {
282
256
  onFooterMeasured?.invoke(it.size.height)
283
257
  }
258
+
284
259
  ) {
285
260
  Box(
286
261
  Modifier.fillMaxWidth()
@@ -333,7 +308,7 @@ val LocalScreenHelper = staticCompositionLocalOf<ScreenHelper> {
333
308
  }
334
309
 
335
310
  @Composable
336
- fun ScreenSnackBarHost(footerHeightPx: Int) {
311
+ internal fun ScreenSnackBarHost(footerHeightPx: Int) {
337
312
  val helper = LocalScreenHelper.current
338
313
  val snackBarData = helper.snackBarState ?: return
339
314
  val density = LocalDensity.current
@@ -370,7 +345,7 @@ fun ScreenSnackBarHost(footerHeightPx: Int) {
370
345
  LaunchedEffect(snackBarData.type.duration) {
371
346
  val duration = snackBarData.type.duration
372
347
  if (duration != null) {
373
- delay(duration)
348
+ delay(duration.milliseconds)
374
349
  helper.hideSnackBar()
375
350
  }
376
351
  }
@@ -24,7 +24,7 @@ private const val BACK_WIDTH = 28
24
24
 
25
25
  @Deprecated("Use vn.momo.kits.navigation.component.Header instead", ReplaceWith("vn.momo.kits.navigation.component.Header"))
26
26
  @Composable
27
- fun useHeaderSearchAnimation(
27
+ internal fun useHeaderSearchAnimation(
28
28
  opacityAni: Float,
29
29
  scrollState: Int,
30
30
  headerRightWidth: Dp,
@@ -13,12 +13,7 @@ import androidx.compose.ui.Modifier
13
13
  import androidx.compose.ui.graphics.Color
14
14
  import androidx.compose.ui.unit.dp
15
15
  import vn.momo.kits.application.IsShowBaseLineDebug
16
- import vn.momo.kits.const.AppTheme
17
- import vn.momo.kits.const.Colors
18
- import vn.momo.kits.const.Radius
19
- import vn.momo.kits.const.Spacing
20
- import vn.momo.kits.const.Typography
21
- import vn.momo.kits.const.scaleSize
16
+ import vn.momo.kits.const.*
22
17
  import vn.momo.kits.modifier.conditional
23
18
 
24
19
 
@@ -70,15 +70,15 @@ fun BadgeRibbon(
70
70
  }
71
71
 
72
72
  if (isRound) {
73
- renderRoundContent(label, rotate, theme.colors.warning.primary)
73
+ RenderRoundContent(label, rotate, theme.colors.warning.primary)
74
74
  } else {
75
- renderSkewContent(label, rotate, theme.colors.warning.primary)
75
+ RenderSkewContent(label, rotate, theme.colors.warning.primary)
76
76
  }
77
77
  }
78
78
  }
79
79
 
80
80
  @Composable
81
- fun renderRoundContent(label: String, rotate: Float, backgroundColor: Color){
81
+ internal fun RenderRoundContent(label: String, rotate: Float, backgroundColor: Color){
82
82
  Box(
83
83
  modifier = Modifier
84
84
  .height(roundHeight)
@@ -97,7 +97,7 @@ fun renderRoundContent(label: String, rotate: Float, backgroundColor: Color){
97
97
  }
98
98
 
99
99
  @Composable
100
- fun renderSkewContent(label: String, rotate: Float, backgroundColor: Color){
100
+ internal fun RenderSkewContent(label: String, rotate: Float, backgroundColor: Color){
101
101
  Box(
102
102
  modifier = Modifier
103
103
  .height(skewBodyHeight)
@@ -110,7 +110,7 @@ fun renderSkewContent(label: String, rotate: Float, backgroundColor: Color){
110
110
  }
111
111
 
112
112
  @Composable
113
- fun Label(label: String, rotate: Float){
113
+ internal fun Label(label: String, rotate: Float){
114
114
  Text(
115
115
  text = label,
116
116
  color = Colors.black_01,
@@ -122,7 +122,7 @@ fun Label(label: String, rotate: Float){
122
122
  }
123
123
 
124
124
  @Composable
125
- fun UpTail() {
125
+ internal fun UpTail() {
126
126
  Image(
127
127
  source = "https://static.momocdn.net/app/img/kits/utils/Head_down_4x.png",
128
128
  modifier = Modifier
@@ -136,7 +136,7 @@ fun UpTail() {
136
136
  }
137
137
 
138
138
  @Composable
139
- fun DownTail() {
139
+ internal fun DownTail() {
140
140
  Image(
141
141
  source = "https://static.momocdn.net/app/img/kits/utils/Head_4x.png",
142
142
  modifier = Modifier
@@ -149,7 +149,7 @@ fun DownTail() {
149
149
  }
150
150
 
151
151
  @Composable
152
- fun RightTail() {
152
+ internal fun RightTail() {
153
153
  Image(
154
154
  source = "https://static.momocdn.net/app/img/kits/utils/Tail_4x.png",
155
155
  modifier = Modifier
@@ -190,10 +190,9 @@ fun RoundedBadgeRibbon(
190
190
  val textHeight = with(density) { textLayoutResult.size.height.toDp() }
191
191
 
192
192
  val minRibbonHeight = (textHeight * 1.2f).coerceAtLeast(16.dp)
193
- val paddingBottom = minRibbonHeight / 4f
194
- val badgeHeight = minRibbonHeight + paddingBottom
195
- val horizontalPadding = paddingBottom
196
- val badgeWidth = (textWidth + horizontalPadding * 2).coerceAtLeast(28.dp)
193
+ val padding = minRibbonHeight / 4f
194
+ val badgeHeight = minRibbonHeight + padding
195
+ val badgeWidth = (textWidth + padding * 2).coerceAtLeast(28.dp)
197
196
 
198
197
  val (rotateZ, scaleY, scaleX) = when (position) {
199
198
  RibbonPosition.TopLeft -> Triple(0f, 1f, -1f)
@@ -211,12 +210,12 @@ fun RoundedBadgeRibbon(
211
210
  this.scaleX = scaleX
212
211
  }
213
212
  ) {
214
- val roundedRect = (badgeHeight - paddingBottom) / 2f
213
+ val roundedRect = (badgeHeight - padding) / 2f
215
214
 
216
215
  Canvas(modifier = Modifier.matchParentSize()) {
217
216
  val width = size.width
218
217
  val height = size.height
219
- val ribbonHeight = height - paddingBottom.toPx()
218
+ val ribbonHeight = height - padding.toPx()
220
219
  val cornerRadius = roundedRect.toPx()
221
220
 
222
221
  val mainColor = Color(0xFFFA541C)
@@ -273,7 +272,7 @@ fun RoundedBadgeRibbon(
273
272
 
274
273
  // Draw bottom tail section
275
274
  val tailY = ribbonHeight
276
- val tailHeight = paddingBottom.toPx()
275
+ val tailHeight = padding.toPx()
277
276
  val halfHeadWidth = headWidth / 2f
278
277
  val tailStartX = rightX + headWidth - halfHeadWidth
279
278
 
@@ -284,7 +283,6 @@ fun RoundedBadgeRibbon(
284
283
  size = Size(halfHeadWidth, halfHeadWidth)
285
284
  )
286
285
 
287
- val tailRoundRadius = tailHeight
288
286
  val tailRightPath = Path().apply {
289
287
  addRoundRect(
290
288
  RoundRect(
@@ -295,8 +293,8 @@ fun RoundedBadgeRibbon(
295
293
  bottom = tailY + tailHeight
296
294
  ),
297
295
  topLeft = CornerRadius.Zero,
298
- topRight = CornerRadius(tailRoundRadius, tailRoundRadius),
299
- bottomRight = CornerRadius(tailRoundRadius, tailRoundRadius),
296
+ topRight = CornerRadius(tailHeight, tailHeight),
297
+ bottomRight = CornerRadius(tailHeight, tailHeight),
300
298
  bottomLeft = CornerRadius.Zero
301
299
  )
302
300
  )
@@ -310,8 +308,8 @@ fun RoundedBadgeRibbon(
310
308
  Text(
311
309
  text = text,
312
310
  modifier = Modifier
313
- .padding(bottom = paddingBottom)
314
- .padding(horizontal = paddingBottom / 2)
311
+ .padding(bottom = padding)
312
+ .padding(horizontal = padding / 2)
315
313
  .align(Alignment.Center)
316
314
  .graphicsLayer {
317
315
  rotationZ = rotateZ
@@ -327,14 +325,14 @@ fun RoundedBadgeRibbon(
327
325
  }
328
326
  }
329
327
 
330
- val ribbonHeight: Dp = 20.dp
331
- val roundHeight: Dp = 16.dp
332
- val skewBodyHeight: Dp = 16.dp
333
- val roundRightRadius: Dp = 12.dp
334
- val roundPaddingEnd: Dp = 6.dp
335
- val skewTailWidth: Dp = 8.dp
336
- val skewTailHeight: Dp = 16.dp
337
- val headTailWidth: Dp = 5.dp
338
- val headTailHeight: Dp = 20.dp
328
+ private val ribbonHeight: Dp = 20.dp
329
+ private val roundHeight: Dp = 16.dp
330
+ private val skewBodyHeight: Dp = 16.dp
331
+ private val roundRightRadius: Dp = 12.dp
332
+ private val roundPaddingEnd: Dp = 6.dp
333
+ private val skewTailWidth: Dp = 8.dp
334
+ private val skewTailHeight: Dp = 16.dp
335
+ private val headTailWidth: Dp = 5.dp
336
+ private val headTailHeight: Dp = 20.dp
339
337
 
340
338
  enum class RibbonPosition {TopLeft, TopRight, BottomLeft, BottomRight}
@@ -2,17 +2,7 @@ package vn.momo.kits.components
2
2
 
3
3
  import androidx.compose.foundation.Canvas
4
4
  import androidx.compose.foundation.background
5
- import androidx.compose.foundation.border
6
- import androidx.compose.foundation.layout.Box
7
- import androidx.compose.foundation.layout.WindowInsets
8
- import androidx.compose.foundation.layout.asPaddingValues
9
- import androidx.compose.foundation.layout.fillMaxHeight
10
- import androidx.compose.foundation.layout.fillMaxSize
11
- import androidx.compose.foundation.layout.fillMaxWidth
12
- import androidx.compose.foundation.layout.height
13
- import androidx.compose.foundation.layout.navigationBars
14
- import androidx.compose.foundation.layout.padding
15
- import androidx.compose.foundation.layout.width
5
+ import androidx.compose.foundation.layout.*
16
6
  import androidx.compose.runtime.Composable
17
7
  import androidx.compose.ui.Alignment
18
8
  import androidx.compose.ui.Modifier
@@ -21,22 +11,9 @@ import androidx.compose.ui.graphics.Color
21
11
  import androidx.compose.ui.graphics.PathEffect
22
12
  import androidx.compose.ui.graphics.StrokeCap
23
13
  import androidx.compose.ui.unit.dp
24
- import io.ktor.util.Platform
25
- import vn.momo.kits.application.IsShowBaseLineDebug
26
- import vn.momo.kits.const.Colors
27
- import vn.momo.kits.modifier.conditional
28
14
  import vn.momo.kits.platform.getPlatformName
29
15
  import vn.momo.kits.platform.getStatusBarHeight
30
16
 
31
- /**
32
- * A debug overlay that draws danger/warning baseline guides on top of the screen.
33
- *
34
- * Highlights safe-area boundaries, header regions, and bottom navigation zones
35
- * using colored solid or dotted lines and semi-transparent red zones.
36
- *
37
- * @param enabled When `false` the composable renders nothing. Pass `false` when
38
- * your QC automation flag is active to suppress the overlay.
39
- */
40
17
  @Composable
41
18
  fun BaselineView(enabled: Boolean = true) {
42
19
  if (!enabled) return
@@ -169,10 +146,10 @@ fun BaselineView(enabled: Boolean = true) {
169
146
  }
170
147
  }
171
148
 
172
- enum class BaselineOrientation { Horizontal, Vertical }
149
+ private enum class BaselineOrientation { Horizontal, Vertical }
173
150
 
174
151
  @Composable
175
- fun BaselineDottedLine(
152
+ private fun BaselineDottedLine(
176
153
  modifier: Modifier = Modifier,
177
154
  color: Color = Color.Red,
178
155
  orientation: BaselineOrientation = BaselineOrientation.Horizontal,
@@ -1,5 +1,7 @@
1
1
  package vn.momo.kits.components
2
2
 
3
+ import vn.momo.kits.utils.Deprecated.InternalApi
4
+
3
5
  import androidx.compose.animation.core.animateDpAsState
4
6
  import androidx.compose.animation.core.animateFloatAsState
5
7
  import androidx.compose.animation.core.tween
@@ -8,14 +10,7 @@ import androidx.compose.foundation.border
8
10
  import androidx.compose.foundation.clickable
9
11
  import androidx.compose.foundation.interaction.MutableInteractionSource
10
12
  import androidx.compose.foundation.interaction.collectIsPressedAsState
11
- import androidx.compose.foundation.layout.Arrangement
12
- import androidx.compose.foundation.layout.Box
13
- import androidx.compose.foundation.layout.Row
14
- import androidx.compose.foundation.layout.fillMaxWidth
15
- import androidx.compose.foundation.layout.height
16
- import androidx.compose.foundation.layout.padding
17
- import androidx.compose.foundation.layout.size
18
- import androidx.compose.foundation.layout.wrapContentHeight
13
+ import androidx.compose.foundation.layout.*
19
14
  import androidx.compose.foundation.shape.RoundedCornerShape
20
15
  import androidx.compose.runtime.Composable
21
16
  import androidx.compose.runtime.getValue
@@ -30,11 +25,7 @@ import androidx.compose.ui.text.style.TextOverflow
30
25
  import androidx.compose.ui.unit.Dp
31
26
  import androidx.compose.ui.unit.dp
32
27
  import vn.momo.kits.application.IsShowBaseLineDebug
33
- import vn.momo.kits.const.AppTheme
34
- import vn.momo.kits.const.Colors
35
- import vn.momo.kits.const.Radius
36
- import vn.momo.kits.const.Spacing
37
- import vn.momo.kits.const.Typography
28
+ import vn.momo.kits.const.*
38
29
  import vn.momo.kits.modifier.conditional
39
30
  import vn.momo.kits.platform.LottieAnimation
40
31
 
@@ -100,32 +91,37 @@ private val iconSpaceCache = mapOf(
100
91
  Size.LARGE to Spacing.S
101
92
  )
102
93
 
103
- fun getStyle(size: Size): TextStyle {
94
+ private fun getStyle(size: Size): TextStyle {
104
95
  return styleCache[size] ?: Typography.actionDefaultBold
105
96
  }
106
97
 
107
- fun getIconSize(size: Size): Dp = iconSizeCache[size] ?: 24.dp
108
- fun getIconSpace(size: Size): Dp = iconSpaceCache[size] ?: Spacing.S
98
+ private fun getIconSize(size: Size): Dp = iconSizeCache[size] ?: 24.dp
99
+ private fun getIconSpace(size: Size): Dp = iconSpaceCache[size] ?: Spacing.S
109
100
 
110
101
  @Composable
111
- fun getTextColor(loading: Boolean, type: ButtonType): Color {
102
+ internal fun getTextColor(loading: Boolean, type: ButtonType): Color {
112
103
  val theme = AppTheme.current
113
104
 
114
105
  return remember(type, theme, loading) {
115
- when (type) {
116
- ButtonType.DISABLED -> theme.colors.text.disable
117
- ButtonType.PRIMARY -> Colors.black_01
118
- ButtonType.SECONDARY -> theme.colors.text.default
119
- ButtonType.OUTLINE -> theme.colors.primary
120
- ButtonType.TONAL -> theme.colors.primary
121
- ButtonType.DANGER -> Colors.black_01
122
- ButtonType.TEXT -> theme.colors.primary
123
- }.withLoading(loading)
106
+ getButtonColor(type, theme).withLoading(loading)
107
+ }
108
+ }
109
+
110
+ internal fun getButtonColor(type: ButtonType, theme: Theme): Color {
111
+ return when (type) {
112
+ ButtonType.DISABLED -> theme.colors.text.disable
113
+ ButtonType.PRIMARY -> Colors.black_01
114
+ ButtonType.SECONDARY -> theme.colors.text.default
115
+ ButtonType.OUTLINE -> theme.colors.primary
116
+ ButtonType.TONAL -> theme.colors.primary
117
+ ButtonType.DANGER -> Colors.black_01
118
+ ButtonType.TEXT -> theme.colors.primary
124
119
  }
125
120
  }
126
121
 
122
+
127
123
  @Composable
128
- fun RenderTitle(size: Size, title: String = "", textColor: Color) {
124
+ internal fun RenderTitle(size: Size, title: String = "", textColor: Color) {
129
125
  val style = remember(size) { getStyle(size) }
130
126
  Text(
131
127
  style = style,
@@ -137,6 +133,7 @@ fun RenderTitle(size: Size, title: String = "", textColor: Color) {
137
133
  }
138
134
 
139
135
  @Composable
136
+ @InternalApi
140
137
  fun RenderIcon(
141
138
  size: Size,
142
139
  isIconLeft: Boolean,
@@ -187,7 +184,7 @@ private fun shouldLoadingOnLeft(iconLeft: String, iconRight: String): Boolean {
187
184
  }
188
185
 
189
186
  @Composable
190
- fun getTypeStyle(
187
+ internal fun getTypeStyle(
191
188
  type: ButtonType,
192
189
  color: Color? = AppTheme.current.colors.primary,
193
190
  size: Size,
@@ -223,7 +220,7 @@ fun getTypeStyle(
223
220
  }
224
221
 
225
222
  @Composable
226
- fun getButtonBackgroundColor(
223
+ internal fun getButtonBackgroundColor(
227
224
  loading: Boolean,
228
225
  type: ButtonType
229
226
  ): Color {
@@ -242,7 +239,7 @@ fun getButtonBackgroundColor(
242
239
  }
243
240
  }
244
241
 
245
- fun Color.withLoading(loading: Boolean): Color =
242
+ private fun Color.withLoading(loading: Boolean): Color =
246
243
  this.copy(alpha = if (loading) 0.75f else 1f)
247
244
 
248
245
  @Composable