@momo-kits/native-kits 0.162.2-test.2-debug → 0.162.2-test.21-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 (132) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/CLAUDE.md +78 -0
  3. package/compose/build.gradle.kts +12 -8
  4. package/compose/build.gradle.kts.backup +15 -11
  5. package/compose/compose.podspec +1 -1
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +2 -7
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +6 -10
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +6 -24
  9. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +4 -19
  10. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +1 -10
  11. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +2 -2
  12. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +1 -1
  13. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +1 -1
  14. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +6 -17
  15. package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +1 -1
  16. package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +6 -101
  17. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Localize.kt +269 -0
  18. package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +5 -19
  19. package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +8 -33
  20. package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +1 -1
  21. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +22 -25
  22. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +27 -29
  23. package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +3 -26
  24. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +30 -31
  25. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +3 -13
  26. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +0 -5
  27. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +3 -11
  28. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +3 -18
  29. package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +11 -11
  30. package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +3 -11
  31. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +69 -26
  32. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +1 -5
  33. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +84 -59
  34. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +13 -71
  35. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +10 -51
  36. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +6 -1
  37. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +4 -21
  38. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +1 -1
  39. package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +16 -75
  40. package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +5 -26
  41. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +1 -1
  42. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +3 -11
  43. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +16 -40
  44. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +3 -9
  45. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +0 -28
  46. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +2 -13
  47. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
  48. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +4 -10
  49. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +3 -28
  50. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +8 -47
  51. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +4 -25
  52. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +2 -11
  53. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +1 -17
  54. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +1 -6
  55. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +50 -111
  56. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +1 -5
  57. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +1 -5
  58. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +1 -12
  59. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +4 -96
  60. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +5 -7
  61. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +2 -12
  62. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +9 -21
  63. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +2 -2
  64. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +9 -14
  65. package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +8 -11
  66. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +1 -1
  67. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +7 -27
  68. package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +1 -1
  69. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +0 -5
  70. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +0 -2
  71. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +94 -4
  72. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +0 -2
  73. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +2 -2
  74. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +3 -7
  75. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +12 -16
  76. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +33 -27
  77. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +48 -33
  78. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +91 -63
  79. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +9 -14
  80. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +13 -31
  81. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +1 -1
  82. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +6 -24
  83. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +11 -6
  84. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +2 -1
  85. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +9 -6
  86. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +1 -1
  87. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +3 -13
  88. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +3 -2
  89. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +1 -40
  90. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/ComposeLottieAnimation.kt +0 -2
  91. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +0 -8
  92. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +2 -17
  93. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +1 -1
  94. package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +3 -3
  95. package/compose/src/iosMain/kotlin/vn/momo/kits/navigation/ScrollToTop.ios.kt +2 -3
  96. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +0 -2
  97. package/gradle/libs.versions.toml +2 -0
  98. package/gradle.properties +1 -1
  99. package/ios/Application/Components.swift +1 -0
  100. package/ios/Application/FloatingButton.swift +1 -0
  101. package/ios/Badge/Badge.swift +1 -0
  102. package/ios/Badge/BadgeRibbon.swift +2 -0
  103. package/ios/Button/Button.swift +1 -1
  104. package/ios/Checkbox/Checkbox.swift +1 -0
  105. package/ios/Information/Information.swift +151 -0
  106. package/ios/Input/Input.swift +1 -0
  107. package/ios/Input/InputPhoneNumber.swift +1 -0
  108. package/ios/Input/InputSearch.swift +3 -0
  109. package/ios/Input/InputTextArea.swift +1 -0
  110. package/ios/OTPKeyboard/KeyboardButton.swift +1 -1
  111. package/ios/Popup/PopupDisplay.swift +6 -0
  112. package/ios/Popup/PopupInput.swift +2 -0
  113. package/ios/Template/TrustBanner/TrustBanner.swift +2 -0
  114. package/ios/Typography/Text.swift +1 -0
  115. package/ios/Typography/Typography.swift +14 -5
  116. package/local.properties +2 -2
  117. package/package.json +1 -1
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/application/FontScaleStore.kt +0 -77
  119. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +0 -32
  120. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  121. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  122. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +0 -16
  123. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -6
  124. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -5
  125. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +0 -58
  126. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +0 -58
  127. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +0 -58
  128. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +0 -58
  129. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +0 -58
  130. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +0 -58
  131. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +0 -58
  132. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +0 -60
@@ -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
@@ -0,0 +1,269 @@
1
+ package vn.momo.kits.application
2
+
3
+ import androidx.compose.runtime.Immutable
4
+ import androidx.compose.runtime.Stable
5
+ import androidx.compose.runtime.getValue
6
+ import androidx.compose.runtime.mutableStateOf
7
+ import androidx.compose.runtime.setValue
8
+ import androidx.compose.runtime.staticCompositionLocalOf
9
+
10
+ /** Translation dictionary keyed by language; both `vi` and `en` are required. */
11
+ @Immutable
12
+ data class LocalizationObject(
13
+ val vi: Map<String, String> = emptyMap(),
14
+ val en: Map<String, String> = emptyMap(),
15
+ )
16
+
17
+ /**
18
+ * Translation gateway, ported from momo-kits React Native (`Application/Localize.ts`).
19
+ * Holds the merged dictionary (kit defaults + host overrides) and the active language,
20
+ * switched at runtime via [changeLanguage]. Language is snapshot-backed, so a switch
21
+ * recomposes consumers of [translate]/[translateData].
22
+ */
23
+ @Stable
24
+ class Localize(translations: LocalizationObject = LocalizationObject()) {
25
+
26
+ private var assets by mutableStateOf(merge(defaultLanguage, translations))
27
+
28
+ private var language by mutableStateOf(VI)
29
+
30
+ val currentLanguage: String get() = language
31
+
32
+ fun changeLanguage(language: String?) {
33
+ this.language = if (language == EN) EN else VI
34
+ }
35
+
36
+ fun translate(key: String): String {
37
+ val dictionary = if (language == EN) assets.en else assets.vi
38
+ return dictionary[key]?.takeIf { it.isNotEmpty() } ?: key
39
+ }
40
+
41
+ fun translateData(data: Map<String, String>): String =
42
+ data[language] ?: data.entries.joinToString(prefix = "{", postfix = "}") {
43
+ "\"${it.key}\":\"${it.value}\""
44
+ }
45
+
46
+ fun translateData(vi: String, en: String): String = if (language == EN) en else vi
47
+
48
+ fun addTranslations(translations: LocalizationObject) {
49
+ assets = merge(translations, assets)
50
+ }
51
+
52
+ companion object {
53
+ const val VI = "vi"
54
+ const val EN = "en"
55
+
56
+ private fun merge(base: LocalizationObject, override: LocalizationObject) = LocalizationObject(vi = base.vi + override.vi, en = base.en + override.en)
57
+
58
+ private val defaultLanguage = LocalizationObject(
59
+ vi = mapOf(
60
+ "errorCode" to "Mã lỗi: ",
61
+ "seeMore" to "Xem thêm",
62
+ "cancel" to "Huỷ",
63
+ "done" to "Xong",
64
+ "confirm" to "Xác nhận",
65
+ "month" to "tháng",
66
+ "day" to "ngày",
67
+ "choose" to "Chọn",
68
+ "sent" to "Đã gửi",
69
+ "received" to "Đã tiếp nhận",
70
+ "processing" to "Đang xử lý",
71
+ "processed" to "Đã xử lý",
72
+ "addImg" to "Thêm hình",
73
+ "chooseBtn" to "Chọn button",
74
+ "imgEg" to "Hình ảnh tham khảo",
75
+ "filter" to "Sắp xếp",
76
+ "shipping" to "Đang giao hàng",
77
+ "men" to "Nam",
78
+ "women" to "Nữ",
79
+ "more" to "Khác",
80
+ "expDate" to "Ngày hết hạn",
81
+ "exp" to "HSD",
82
+ "inActive" to "Chưa kích hoạt",
83
+ "voucherRemindHour" to "Hết hạn sau {hours} giờ",
84
+ "voucherRemindMinute" to "Hết hạn sau {minutes} phút",
85
+ "voucherRemindSecond" to "Hết hạn sau {seconds} giây",
86
+ "voucherRemindDay" to "Hết hạn sau {days} ngày",
87
+ "chooseRoundtrip" to "Chọn vé khứ hồi",
88
+ "depart" to "Ngày đi",
89
+ "return" to "Ngày về",
90
+ "departing" to "Đi",
91
+ "returning" to "Về",
92
+ "jan" to "Tháng 1",
93
+ "feb" to "Tháng 2",
94
+ "mar" to "Tháng 3",
95
+ "apr" to "Tháng 4",
96
+ "may" to "Tháng 5",
97
+ "jun" to "Tháng 6",
98
+ "jul" to "Tháng 7",
99
+ "aug" to "Tháng 8",
100
+ "sep" to "Tháng 9",
101
+ "oct" to "Tháng 10",
102
+ "nov" to "Tháng 11",
103
+ "dec" to "Tháng 12",
104
+ "mon" to "T2",
105
+ "tue" to "T3",
106
+ "wed" to "T4",
107
+ "thu" to "T5",
108
+ "fri" to "T6",
109
+ "sat" to "T7",
110
+ "sun" to "CN",
111
+ "showLunar" to "Hiển thị lịch âm",
112
+ "newYear" to "Tết Dương lịch",
113
+ "valentine" to "Ngày Lễ Tình nhân",
114
+ "womenDay" to "Ngày Quốc tế Phụ nữ",
115
+ "liberationDay" to "Ngày giải phóng Miền Nam thống nhất đất nước",
116
+ "laborDay" to "Ngày Quốc tế Lao động",
117
+ "childrenDay" to "Ngày Quốc tế Thiếu nhi",
118
+ "nationalDay" to "Quốc khánh nước CHXHCN Việt Nam",
119
+ "womenDayVN" to "Ngày Phụ nữ Việt Nam",
120
+ "teacherDay" to "Ngày Nhà giáo Việt Nam",
121
+ "christmasEve" to "Ngày Lễ Giáng Sinh",
122
+ "christmas" to "Ngày Lễ Giáng Sinh",
123
+ "lunarNewYear" to "Tết Nguyên Đán",
124
+ "hungKingDay" to "Giỗ Tổ Hùng Vương",
125
+ "balance" to "Số dư trong ví",
126
+ "chooseDate" to "Chọn ngày tháng năm",
127
+ "year" to "năm",
128
+ "hour" to "giờ",
129
+ "minute" to "phút",
130
+ "from" to "Từ",
131
+ "to" to "Đến",
132
+ "connected" to "Đã kết nối",
133
+ "disconnected" to "Mất kết nối",
134
+ "hide" to "Ẩn",
135
+ "viewAllTitle" to "Xem tất cả",
136
+ "headerTitle" to "Lịch sử thanh toán",
137
+ "SHORTEN" to "THU GỌN",
138
+ "viewMoreBank" to "XEM THÊM (\${otherItemCount} ngân hàng)",
139
+ "transaction_success" to "Thành công",
140
+ "transaction_fail" to "Thất bại",
141
+ "transaction_processing" to "Đang xử lý",
142
+ "viewMore" to "Xem thêm",
143
+ "shorten" to "Thu gọn",
144
+ "Payment" to "Thanh toán \${serviceName}",
145
+ "currencyUnit" to "đ",
146
+ "Month" to "Tháng",
147
+ "save" to "Lưu",
148
+ "favoriteIn" to "Thêm dịch vụ yêu thích",
149
+ "favoriteOut" to "Xóa dịch vụ yêu thích",
150
+ "deviceIn" to "Thêm vào thiết bị",
151
+ "setting" to "Cài đặt",
152
+ "transaction" to "Lịch sử giao dịch",
153
+ "share" to "Chia sẽ dịch vụ",
154
+ "information" to "Thông tin chung",
155
+ "tutorial" to "Hướng dẫn sử dụng",
156
+ "question" to "Câu hỏi thường gặp",
157
+ "support" to "Trung tâm hỗ trợ",
158
+ "skip" to "Bỏ qua",
159
+ "enterPhoneNumber" to "Vui lòng nhập số điện thoại",
160
+ "invalidPhoneNumber" to "Số điện thoại không đúng",
161
+ ),
162
+ en = mapOf(
163
+ "seeMore" to "See more",
164
+ "cancel" to "Cancel",
165
+ "done" to "Done",
166
+ "confirm" to "Confirm",
167
+ "month" to "month",
168
+ "day" to "day",
169
+ "choose" to "Choose",
170
+ "sent" to "Sent",
171
+ "received" to "Received",
172
+ "processing" to "Processing",
173
+ "processed" to "Done",
174
+ "addImg" to "Add image",
175
+ "chooseBtn" to "Choose button",
176
+ "imgEg" to "Example images",
177
+ "filter" to "Filter",
178
+ "shipping" to "Shipping",
179
+ "men" to "Men",
180
+ "women" to "Women",
181
+ "more" to "More",
182
+ "expDate" to "Expiration date",
183
+ "exp" to "EXP",
184
+ "inActive" to "Not Activated",
185
+ "voucherRemindHour" to "Revoke after {hours} hours",
186
+ "voucherRemindMinute" to "Revoke after {minutes} minutes",
187
+ "voucherRemindSecond" to "Revoke after {seconds} seconds",
188
+ "voucherRemindDay" to "Revoke after {days} days",
189
+ "chooseRoundtrip" to "Choose roundtrip ticket",
190
+ "depart" to "Departing",
191
+ "return" to "Returning",
192
+ "departing" to "De",
193
+ "returning" to "Re",
194
+ "jan" to "January",
195
+ "feb" to "February",
196
+ "mar" to "March",
197
+ "apr" to "April",
198
+ "may" to "May",
199
+ "jun" to "June",
200
+ "jul" to "July",
201
+ "aug" to "August",
202
+ "sep" to "September",
203
+ "oct" to "October",
204
+ "nov" to "November",
205
+ "dec" to "December",
206
+ "mon" to "Mon",
207
+ "tue" to "Tue",
208
+ "wed" to "Wed",
209
+ "thu" to "Thu",
210
+ "fri" to "Fri",
211
+ "sat" to "Sat",
212
+ "sun" to "Sun",
213
+ "showLunar" to "Show Lunar Calendar",
214
+ "newYear" to "New Year's Day",
215
+ "valentine" to "Valentine's Day",
216
+ "womenDay" to "International Women's Day",
217
+ "liberationDay" to "Liberation Day",
218
+ "laborDay" to "Internation Labor's Day",
219
+ "childrenDay" to "International Labor's Day",
220
+ "nationalDay" to "National Day",
221
+ "womenDayVN" to "Vietnamese Women's Day",
222
+ "teacherDay" to "Teacher's Day",
223
+ "christmasEve" to "Christmas Eve",
224
+ "christmas" to "Christmas Day",
225
+ "lunarNewYear" to "Lunar New Year",
226
+ "hungKingDay" to "Hung Kings' Festival",
227
+ "balance" to "Wallet Balance",
228
+ "chooseDate" to "Choose date",
229
+ "year" to "year",
230
+ "hour" to "hour",
231
+ "minute" to "minute",
232
+ "from" to "From",
233
+ "to" to "To",
234
+ "connected" to "Connected",
235
+ "disconnected" to "Disconnected",
236
+ "hide" to "Hide",
237
+ "viewAllTitle" to "View all",
238
+ "headerTitle" to "Transaction history",
239
+ "SHORTEN" to "SHORTEN",
240
+ "viewMoreBank" to "VIEW MORE (\${otherItemCount} banks)",
241
+ "transaction_success" to "Success",
242
+ "transaction_fail" to "Fail",
243
+ "transaction_processing" to "Processing",
244
+ "viewMore" to "View more",
245
+ "shorten" to "Shorten",
246
+ "Payment" to "\${serviceName} payment",
247
+ "currencyUnit" to "VND",
248
+ "Month" to "Month",
249
+ "save" to "Save",
250
+ "favoriteIn" to "Add to favorite services",
251
+ "favoriteOut" to "Remove to favorite services",
252
+ "deviceIn" to "Add to device",
253
+ "setting" to "Settings",
254
+ "transaction" to "Transaction History",
255
+ "share" to "Share",
256
+ "information" to "Information",
257
+ "tutorial" to "Instruction",
258
+ "question" to "FAQ",
259
+ "support" to "Support center",
260
+ "errorCode" to "Error code: ",
261
+ "skip" to "Skip",
262
+ "enterPhoneNumber" to "Please enter your phone number",
263
+ "invalidPhoneNumber" to "Invalid phone number",
264
+ ),
265
+ )
266
+ }
267
+ }
268
+
269
+ val LocalLocalize = staticCompositionLocalOf { Localize() }
@@ -1,23 +1,11 @@
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
8
+ import vn.momo.kits.const.*
21
9
  import vn.momo.kits.modifier.DeprecatedModifier
22
10
  import vn.momo.kits.platform.getStatusBarHeight
23
11
 
@@ -81,7 +69,7 @@ fun ApplicationContainer(
81
69
  composeApi: ComposeApi? = null,
82
70
  statusBarHeight: Dp? = AppStatusBar.current,
83
71
  applicationContext: MiniAppContext? = null,
84
- config: KitConfig? = null,
72
+ config: DesignSystemConfig? = null,
85
73
  language: String? = null,
86
74
  isWhiteList: Boolean = false,
87
75
  content: @Composable () -> Unit,
@@ -109,13 +97,11 @@ fun ApplicationContainer(
109
97
  AppTheme provides appTheme,
110
98
  PlatformApi provides composeApi,
111
99
  AppStatusBar provides appStatusBarHeight,
112
- ApplicationContext provides applicationContext,
113
- AppConfig provides config,
114
- AppLanguage provides language,
100
+ LocalContext provides applicationContext,
115
101
  ) {
116
102
  Box(Modifier.wrapContentSize().then(DeprecatedModifier())) {
117
103
  content()
118
104
  }
119
105
  }
120
106
 
121
- }
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.modifier.DeprecatedModifier
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,
@@ -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,
@@ -11,19 +11,15 @@ import androidx.compose.runtime.Composable
11
11
  import androidx.compose.ui.Alignment
12
12
  import androidx.compose.ui.Modifier
13
13
  import androidx.compose.ui.graphics.Color
14
+ import androidx.compose.ui.text.style.TextOverflow
14
15
  import androidx.compose.ui.unit.dp
15
16
  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
17
+ import vn.momo.kits.const.*
22
18
  import vn.momo.kits.modifier.conditional
23
19
 
24
20
 
25
21
  @Composable
26
- fun Badge(label: String = "Label", backgroundColor: Color? = null, modifier: Modifier? = null) {
22
+ fun Badge(label: String = "Label", backgroundColor: Color? = null, modifier: Modifier = Modifier) {
27
23
  val primaryColors = listOf(
28
24
  Color(0xFFF0F0F0),
29
25
  Color(0xFFEB2F96),
@@ -63,23 +59,24 @@ fun Badge(label: String = "Label", backgroundColor: Color? = null, modifier: Mod
63
59
  }
64
60
  val scaleSize = scaleSize(16f)
65
61
 
66
- if (modifier != null) {
67
- Box(
68
- modifier = modifier
69
- .height(scaleSize.dp)
70
- .widthIn(min = scaleSize.dp)
71
- .background(color = badgeColor, shape = RoundedCornerShape(Radius.M))
72
- .border(width = 1.dp, shape = RoundedCornerShape(Radius.M), color = Colors.black_01)
73
- .conditional(IsShowBaseLineDebug) {
74
- border(1.dp, Colors.blue_03)
75
- }
76
- .padding(horizontal = Spacing.XS), contentAlignment = Alignment.Center
77
- ) {
78
- Text(
79
- text = formatTitle(label),
80
- color = Colors.black_01,
81
- style = Typography.actionXxsBold
82
- )
83
- }
62
+ Box(
63
+ modifier = modifier
64
+ .height(scaleSize.dp)
65
+ .widthIn(min = scaleSize.dp)
66
+ .background(color = badgeColor, shape = RoundedCornerShape(Radius.M))
67
+ .border(width = 1.dp, shape = RoundedCornerShape(Radius.M), color = Colors.black_01)
68
+ .conditional(IsShowBaseLineDebug) {
69
+ border(1.dp, Colors.blue_03)
70
+ }
71
+ .padding(horizontal = Spacing.XS),
72
+ contentAlignment = Alignment.Center
73
+ ) {
74
+ Text(
75
+ text = formatTitle(label),
76
+ color = Colors.black_01,
77
+ style = Typography.actionXxsBold,
78
+ maxLines = 1,
79
+ overflow = TextOverflow.Ellipsis
80
+ )
84
81
  }
85
82
  }