@momo-kits/native-kits 0.161.2-beta.27-debug → 0.161.2-beta.27

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 (136) hide show
  1. package/package.json +1 -1
  2. package/build.gradle.kts +0 -11
  3. package/compose/build.gradle.kts +0 -186
  4. package/compose/build.gradle.kts.backup +0 -186
  5. package/compose/compose.podspec +0 -47
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +0 -6
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +0 -136
  8. package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
  9. package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
  10. package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
  11. package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
  12. package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
  13. package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
  14. package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
  15. package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
  16. package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
  17. package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
  18. package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
  19. package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
  20. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
  21. package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +0 -57
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +0 -109
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +0 -201
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +0 -222
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +0 -48
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +0 -86
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +0 -76
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +0 -76
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +0 -305
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +0 -33
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +0 -921
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +0 -121
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +0 -403
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +0 -69
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +0 -157
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +0 -85
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +0 -32
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +0 -340
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +0 -198
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +0 -357
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +0 -123
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -94
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +0 -136
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +0 -224
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +0 -543
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +0 -23
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +0 -76
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +0 -148
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +0 -188
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +0 -116
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +0 -452
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +0 -172
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +0 -255
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +0 -235
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +0 -233
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +0 -259
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +0 -241
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +0 -364
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +0 -108
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +0 -56
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +0 -41
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +0 -92
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +0 -40
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +0 -352
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +0 -103
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -338
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +0 -70
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +0 -87
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +0 -17
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +0 -96
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +0 -348
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +0 -256
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +0 -494
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +0 -131
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +0 -215
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +0 -96
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +0 -531
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +0 -92
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +0 -135
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +0 -214
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +0 -590
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +0 -177
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +0 -192
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +0 -205
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +0 -29
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +0 -239
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +0 -191
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +0 -306
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +0 -12
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +0 -16
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +0 -188
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +0 -285
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +0 -2
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +0 -35
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +0 -2
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -57
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -68
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +0 -11
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +0 -14
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -50
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +0 -51
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +0 -253
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +0 -133
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +0 -104
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +0 -155
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +0 -345
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +0 -8
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +0 -556
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +0 -161
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +0 -243
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +0 -86
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +0 -187
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +0 -315
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +0 -80
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +0 -306
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +0 -34
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +0 -370
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +0 -131
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +0 -167
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -72
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -101
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +0 -1329
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +0 -70
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +0 -15
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +0 -105
  127. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +0 -33
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -205
  129. package/gradle/libs.versions.toml +0 -67
  130. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  131. package/gradle/wrapper/gradle-wrapper.properties +0 -8
  132. package/gradle.properties +0 -26
  133. package/gradlew +0 -252
  134. package/gradlew.bat +0 -94
  135. package/local.properties +0 -8
  136. package/settings.gradle.kts +0 -64
@@ -1,72 +0,0 @@
1
- package vn.momo.kits.platform
2
-
3
- import androidx.compose.foundation.Image
4
- import androidx.compose.foundation.background
5
- import androidx.compose.foundation.layout.Box
6
- import androidx.compose.foundation.layout.fillMaxSize
7
- import androidx.compose.runtime.Composable
8
- import androidx.compose.runtime.getValue
9
- import androidx.compose.ui.Modifier
10
- import androidx.compose.ui.graphics.Color
11
- import io.github.alexzhirkevich.compottie.Compottie
12
- import io.github.alexzhirkevich.compottie.ExperimentalCompottieApi
13
- import io.github.alexzhirkevich.compottie.LottieCompositionSpec
14
- import io.github.alexzhirkevich.compottie.animateLottieCompositionAsState
15
- import io.github.alexzhirkevich.compottie.dynamic.rememberLottieDynamicProperties
16
- import io.github.alexzhirkevich.compottie.rememberLottieComposition
17
- import io.github.alexzhirkevich.compottie.rememberLottiePainter
18
- import vn.momo.kits.utils.readJson
19
-
20
- @OptIn(ExperimentalCompottieApi::class)
21
- @Composable
22
- internal fun ComposeLottieAnimation(
23
- path: String,
24
- tintColor: Color?,
25
- bgColor: Color?,
26
- modifier: Modifier,
27
- ) {
28
- val json = readJson(path)
29
-
30
- if (json.isEmpty()) {
31
- Box(modifier.background(bgColor ?: Color.Transparent))
32
- return
33
- }
34
-
35
- val composition by rememberLottieComposition(json) {
36
- LottieCompositionSpec.JsonString(json)
37
- }
38
-
39
- // Recolor only the fill/stroke color slots (matching the native lottie-ios per-keypath tint)
40
- // instead of a global ColorFilter.tint, which would flatten a multicolor animation to a silhouette.
41
- val dynamicProperties = if (tintColor != null) {
42
- rememberLottieDynamicProperties(tintColor) {
43
- shapeLayer("**") {
44
- fill("**") { color { tintColor } }
45
- stroke("**") { color { tintColor } }
46
- }
47
- }
48
- } else {
49
- null
50
- }
51
-
52
- val lottieState = animateLottieCompositionAsState(
53
- composition = composition,
54
- iterations = Compottie.IterateForever,
55
- )
56
-
57
- Box(modifier.background(bgColor ?: Color.Transparent)) {
58
- Image(
59
- painter = rememberLottiePainter(
60
- composition = composition,
61
- progress = lottieState::value,
62
- dynamicProperties = dynamicProperties,
63
- enableExpressions = false,
64
- expressionEngineFactory = { _, _ ->
65
- error("Lottie JS expressions are disabled in MoMo kits")
66
- },
67
- ),
68
- contentDescription = null,
69
- modifier = Modifier.fillMaxSize(),
70
- )
71
- }
72
- }
@@ -1,101 +0,0 @@
1
- package vn.momo.kits.platform
2
-
3
- import androidx.compose.runtime.Composable
4
- import androidx.compose.runtime.CompositionLocalProvider
5
- import androidx.compose.runtime.ProvidedValue
6
- import androidx.compose.runtime.key
7
- import androidx.compose.ui.Modifier
8
- import androidx.compose.ui.graphics.Color
9
- import androidx.compose.ui.graphics.NativePaint
10
- import androidx.compose.ui.unit.Dp
11
-
12
- data class ScreenDimension(
13
- val width: Int,
14
- val height: Int,
15
- )
16
-
17
- expect fun getPlatformName(): String
18
-
19
- @Composable
20
- expect fun getScreenDimensions(): ScreenDimension
21
-
22
- expect fun NativePaint.setMaskFilter(blurRadius: Float)
23
-
24
- @Composable
25
- expect fun getStatusBarHeight(): Dp
26
-
27
- @Composable
28
- expect fun BackHandler(enabled: Boolean, onBack: () -> Unit)
29
-
30
- @Composable
31
- expect fun ProvideNavigationEventDispatcherOwner(content: @Composable () -> Unit)
32
-
33
- @Composable
34
- expect fun getScreenHeight(): Dp
35
-
36
- sealed interface OSVersion {
37
- val value: Int
38
- data class Android(val sdk: Int) : OSVersion { override val value: Int get() = sdk }
39
- data class IOS(val major: Int) : OSVersion { override val value: Int get() = major }
40
-
41
- operator fun compareTo(other: Int): Int = value.compareTo(other)
42
- }
43
- expect fun getOSVersion(): OSVersion
44
-
45
- fun supportsImePadding(): Boolean = when (val v = getOSVersion()) {
46
- is OSVersion.Android -> v.sdk > 29
47
- is OSVersion.IOS -> true
48
- }
49
-
50
- /**
51
- * @param useCompose when `true`, renders via the pure-Compose Compottie engine instead of the
52
- * platform-native engine (airbnb-lottie on Android, lottie-ios on iOS). Defaults to `false` for
53
- * backward compatibility. Note: when `useCompose = true`, `tintColor` recolors only the fill/stroke
54
- * color slots (matching the native lottie-ios per-keypath tint), so gradient and text-layer colors
55
- * are left untinted; `placedAsOverlay` is a no-op.
56
- */
57
- @Composable
58
- expect fun LottieAnimation(
59
- path: String,
60
- tintColor: Color? = null,
61
- bgColor: Color? = null,
62
- placedAsOverlay: Boolean = false,
63
- modifier: Modifier = Modifier,
64
- useCompose: Boolean = false
65
- )
66
-
67
- expect fun NativePaint.setColor(
68
- color: Color = Color.Black
69
- )
70
-
71
- /** Ngôn ngữ fallback mặc định của kit khi không xác định được ngôn ngữ: tiếng Việt. */
72
- const val DEFAULT_LANGUAGE = "vi"
73
-
74
- /**
75
- * Platform override cho ngôn ngữ mà Compose Resources (stringResource) sử dụng.
76
- * Pattern theo tài liệu:
77
- * https://kotlinlang.org/docs/multiplatform/compose-resource-environment.html
78
- */
79
- expect object LocalAppLocale {
80
- val current: String
81
- @Composable get
82
-
83
- @Composable
84
- infix fun provides(value: String?): ProvidedValue<*>
85
- }
86
-
87
- /**
88
- * Bọc [content] để ép Compose Resources resolve theo [language].
89
- *
90
- * `key(language)` buộc recompose toàn bộ subtree khi ngôn ngữ thay đổi, nhờ đó
91
- * các lời gọi stringResource() đã render trước đó được resolve lại đúng ngôn ngữ.
92
- * `language == null` nghĩa là dùng locale mặc định của thiết bị.
93
- */
94
- @Composable
95
- fun ProvideAppLocale(language: String?, content: @Composable () -> Unit) {
96
- CompositionLocalProvider(LocalAppLocale provides language) {
97
- key(language) {
98
- content()
99
- }
100
- }
101
- }