@momo-kits/native-kits 0.162.2-beta.3 → 0.162.2-lottie.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 (157) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/build.gradle.kts +11 -0
  3. package/compose/build.gradle.kts +190 -0
  4. package/compose/build.gradle.kts.backup +190 -0
  5. package/compose/compose.podspec +47 -0
  6. package/compose/src/androidMain/kotlin/vn/momo/kits/navigation/ScrollToTop.android.kt +6 -0
  7. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +132 -0
  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 +52 -0
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +101 -0
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +183 -0
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +207 -0
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +39 -0
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +294 -0
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +826 -0
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +107 -0
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +378 -0
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +82 -0
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +338 -0
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +175 -0
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +356 -0
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +113 -0
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +89 -0
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +128 -0
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +209 -0
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +140 -0
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +231 -0
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +112 -0
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +477 -0
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +114 -0
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +214 -0
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +240 -0
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +216 -0
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +259 -0
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +182 -0
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +343 -0
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +84 -0
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +328 -0
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +97 -0
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +310 -0
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +59 -0
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +90 -0
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +323 -0
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +217 -0
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +473 -0
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +122 -0
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +199 -0
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +91 -0
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +470 -0
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +88 -0
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +131 -0
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +203 -0
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +498 -0
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +175 -0
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +182 -0
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +193 -0
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +234 -0
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +188 -0
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +16 -0
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +188 -0
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +270 -0
  95. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
  96. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
  97. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
  98. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +52 -0
  99. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +66 -0
  100. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
  101. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +104 -0
  102. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +48 -0
  103. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
  104. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +253 -0
  105. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +129 -0
  106. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +100 -0
  107. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +154 -0
  108. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +360 -0
  109. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ScrollToTop.kt +8 -0
  110. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +580 -0
  111. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +156 -0
  112. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +225 -0
  113. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
  114. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +169 -0
  115. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +320 -0
  116. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +81 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +309 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +34 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +360 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +128 -0
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +80 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +65 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +55 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +105 -0
  128. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +32 -0
  129. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +207 -0
  130. package/gradle/libs.versions.toml +69 -0
  131. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  132. package/gradle/wrapper/gradle-wrapper.properties +8 -0
  133. package/gradle.properties +26 -0
  134. package/gradlew +252 -0
  135. package/gradlew.bat +94 -0
  136. package/ios/Application/ApplicationEnvironment.swift +0 -1
  137. package/ios/Typography/Text.swift +7 -12
  138. package/ios/Typography/Typography.swift +9 -14
  139. package/local.properties +8 -0
  140. package/package.json +1 -1
  141. package/settings.gradle.kts +64 -0
  142. package/.codegraph/.gitignore +0 -5
  143. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +0 -32
  144. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  145. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  146. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +0 -16
  147. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  148. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  149. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  150. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  151. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  152. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  153. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  154. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
  155. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
  156. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -60
  157. package/ios/Application/FontScaleStore.swift +0 -59
@@ -0,0 +1,80 @@
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.runtime.key
10
+ import androidx.compose.ui.Modifier
11
+ import androidx.compose.ui.graphics.Color
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
+ iterations: Int,
27
+ isPlaying: Boolean,
28
+ restartKey: Any?,
29
+ modifier: Modifier,
30
+ ) {
31
+ val json = readJson(path)
32
+
33
+ if (json.isEmpty()) {
34
+ Box(modifier.background(bgColor ?: Color.Transparent))
35
+ return
36
+ }
37
+
38
+ val composition by rememberLottieComposition(json) {
39
+ LottieCompositionSpec.JsonString(json)
40
+ }
41
+
42
+ val dynamicProperties = if (tintColor != null) {
43
+ rememberLottieDynamicProperties(tintColor) {
44
+ shapeLayer("**") {
45
+ fill("**") { color { tintColor } }
46
+ stroke("**") { color { tintColor } }
47
+ }
48
+ }
49
+ } else {
50
+ null
51
+ }
52
+
53
+ // Our sentinel LottieIterateForever == Compottie.IterateForever (both Int.MAX_VALUE).
54
+ // key(restartKey) recreates the animation state so a new key replays from frame 0;
55
+ // restartOnPlay = false makes isPlaying resume from the current frame instead.
56
+ val lottieState = key(restartKey) {
57
+ animateLottieCompositionAsState(
58
+ composition = composition,
59
+ iterations = iterations,
60
+ isPlaying = isPlaying,
61
+ restartOnPlay = false,
62
+ )
63
+ }
64
+
65
+ Box(modifier.background(bgColor ?: Color.Transparent)) {
66
+ Image(
67
+ painter = rememberLottiePainter(
68
+ composition = composition,
69
+ progress = lottieState::value,
70
+ dynamicProperties = dynamicProperties,
71
+ enableExpressions = false,
72
+ expressionEngineFactory = { _, _ ->
73
+ error("Lottie JS expressions are disabled in MoMo kits")
74
+ },
75
+ ),
76
+ contentDescription = null,
77
+ modifier = Modifier.fillMaxSize(),
78
+ )
79
+ }
80
+ }
@@ -0,0 +1,65 @@
1
+ package vn.momo.kits.platform
2
+
3
+ import androidx.compose.runtime.Composable
4
+ import androidx.compose.ui.Modifier
5
+ import androidx.compose.ui.graphics.Color
6
+ import androidx.compose.ui.graphics.NativePaint
7
+ import androidx.compose.ui.unit.Dp
8
+
9
+ data class ScreenDimension(
10
+ val width: Int,
11
+ val height: Int,
12
+ )
13
+
14
+ expect fun getPlatformName(): String
15
+
16
+ @Composable
17
+ expect fun getScreenDimensions(): ScreenDimension
18
+
19
+ expect fun NativePaint.setMaskFilter(blurRadius: Float)
20
+
21
+ @Composable
22
+ expect fun getStatusBarHeight(): Dp
23
+
24
+ @Composable
25
+ expect fun BackHandler(enabled: Boolean, onBack: () -> Unit)
26
+
27
+ @Composable
28
+ expect fun ProvideNavigationEventDispatcherOwner(content: @Composable () -> Unit)
29
+
30
+ @Composable
31
+ expect fun getScreenHeight(): Dp
32
+
33
+ sealed interface OSVersion {
34
+ val value: Int
35
+ data class Android(val sdk: Int) : OSVersion { override val value: Int get() = sdk }
36
+ data class IOS(val major: Int) : OSVersion { override val value: Int get() = major }
37
+
38
+ operator fun compareTo(other: Int): Int = value.compareTo(other)
39
+ }
40
+ expect fun getOSVersion(): OSVersion
41
+
42
+ fun supportsImePadding(): Boolean = when (val v = getOSVersion()) {
43
+ is OSVersion.Android -> v.sdk > 29
44
+ is OSVersion.IOS -> true
45
+ }
46
+ /** Sentinel for [LottieAnimation.iterations] meaning "loop forever" (kept as the default). */
47
+ const val LottieIterateForever: Int = Int.MAX_VALUE
48
+
49
+ @Composable
50
+ expect fun LottieAnimation(
51
+ path: String,
52
+ tintColor: Color? = null,
53
+ bgColor: Color? = null,
54
+ placedAsOverlay: Boolean = false,
55
+ iterations: Int = LottieIterateForever,
56
+ // isPlaying pauses/resumes from the current frame; assign a new restartKey to replay from frame 0.
57
+ isPlaying: Boolean = true,
58
+ restartKey: Any? = null,
59
+ modifier: Modifier = Modifier,
60
+ useCompose: Boolean = false
61
+ )
62
+
63
+ expect fun NativePaint.setColor(
64
+ color: Color = Color.Black
65
+ )