@momo-kits/native-kits 0.162.1-nativeimage.2-debug → 0.162.1-nativeimage.2

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