@momo-kits/native-kits 0.157.1-debug → 0.157.1-skill.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.
- package/.claude/momo-native-kits/SKILL.md +87 -0
- package/.claude/momo-native-kits/references/Badge.md +39 -0
- package/.claude/momo-native-kits/references/BadgeDot.md +37 -0
- package/.claude/momo-native-kits/references/BottomSheet.md +51 -0
- package/.claude/momo-native-kits/references/BottomTab.md +65 -0
- package/.claude/momo-native-kits/references/Button.md +197 -0
- package/.claude/momo-native-kits/references/CheckBox.md +51 -0
- package/.claude/momo-native-kits/references/Chip.md +47 -0
- package/.claude/momo-native-kits/references/Divider.md +29 -0
- package/.claude/momo-native-kits/references/HeaderTitle.md +45 -0
- package/.claude/momo-native-kits/references/HeaderType.md +47 -0
- package/.claude/momo-native-kits/references/Icon.md +32 -0
- package/.claude/momo-native-kits/references/Image.md +38 -0
- package/.claude/momo-native-kits/references/Information.md +36 -0
- package/.claude/momo-native-kits/references/Input.md +334 -0
- package/.claude/momo-native-kits/references/InputDropDown.md +47 -0
- package/.claude/momo-native-kits/references/InputMoney.md +241 -0
- package/.claude/momo-native-kits/references/InputOTP.md +52 -0
- package/.claude/momo-native-kits/references/InputPhoneNumber.md +175 -0
- package/.claude/momo-native-kits/references/InputSearch.md +57 -0
- package/.claude/momo-native-kits/references/InputTextArea.md +46 -0
- package/.claude/momo-native-kits/references/NavigationContainer.md +51 -0
- package/.claude/momo-native-kits/references/Navigator.md +287 -0
- package/.claude/momo-native-kits/references/PaginationDot.md +28 -0
- package/.claude/momo-native-kits/references/PaginationNumber.md +28 -0
- package/.claude/momo-native-kits/references/PopupNotify.md +47 -0
- package/.claude/momo-native-kits/references/Radio.md +44 -0
- package/.claude/momo-native-kits/references/Skeleton.md +32 -0
- package/.claude/momo-native-kits/references/Switch.md +36 -0
- package/.claude/momo-native-kits/references/Tag.md +40 -0
- package/.claude/momo-native-kits/references/Text.md +37 -0
- package/.claude/momo-native-kits/references/Title.md +43 -0
- package/.claude/momo-native-kits/references/Tooltip.md +30 -0
- package/.claude/settings.local.json +13 -0
- package/building-skill-for-claude.md +1190 -0
- package/compose/build.gradle.kts +1 -1
- package/compose/compose.podspec +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +51 -33
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +41 -27
- package/gradle.properties +1 -1
- package/ios/Input/InputPhoneNumber.swift +2 -1
- package/local.properties +8 -0
- package/package.json +1 -1
package/compose/build.gradle.kts
CHANGED
package/compose/compose.podspec
CHANGED
|
@@ -15,6 +15,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|
|
15
15
|
import androidx.compose.foundation.layout.height
|
|
16
16
|
import androidx.compose.foundation.layout.padding
|
|
17
17
|
import androidx.compose.foundation.layout.size
|
|
18
|
+
import androidx.compose.foundation.layout.wrapContentHeight
|
|
18
19
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
|
19
20
|
import androidx.compose.runtime.Composable
|
|
20
21
|
import androidx.compose.runtime.getValue
|
|
@@ -284,7 +285,6 @@ fun Button(
|
|
|
284
285
|
val clickableModifier =
|
|
285
286
|
if (isEnabled && !loading) {
|
|
286
287
|
modifier
|
|
287
|
-
.then(if (isFull) Modifier.fillMaxWidth() else Modifier)
|
|
288
288
|
.clip(RoundedCornerShape(radius))
|
|
289
289
|
.clickable(
|
|
290
290
|
enabled = isEnabled && !loading,
|
|
@@ -295,45 +295,63 @@ fun Button(
|
|
|
295
295
|
.alpha(alpha)
|
|
296
296
|
} else {
|
|
297
297
|
modifier
|
|
298
|
-
.then(if (isFull) Modifier.fillMaxWidth() else Modifier)
|
|
299
298
|
.clip(RoundedCornerShape(radius))
|
|
300
299
|
}
|
|
301
300
|
|
|
302
301
|
val bgColor = getButtonBackgroundColor(loading, type)
|
|
303
302
|
val textColor = getTextColor(loading, type)
|
|
304
303
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
.
|
|
308
|
-
.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
verticalAlignment = Alignment.CenterVertically,
|
|
304
|
+
val rootModifier = if (isFull) {
|
|
305
|
+
Modifier
|
|
306
|
+
.fillMaxWidth()
|
|
307
|
+
.wrapContentHeight()
|
|
308
|
+
} else {
|
|
309
|
+
Modifier
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
Box(
|
|
313
|
+
modifier = rootModifier.then(clickableModifier),
|
|
314
|
+
contentAlignment = Alignment.Center
|
|
317
315
|
) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
RenderIcon(
|
|
329
|
-
size = size,
|
|
330
|
-
isIconLeft = false,
|
|
331
|
-
useTintColor = useTintColor,
|
|
332
|
-
icon = iconRight,
|
|
333
|
-
forceLoading = loading && !loadingOnLeft,
|
|
334
|
-
bgColor = bgColor,
|
|
335
|
-
textColor = textColor
|
|
316
|
+
// Visual background (shrinks on press)
|
|
317
|
+
Box(
|
|
318
|
+
modifier = Modifier
|
|
319
|
+
.matchParentSize()
|
|
320
|
+
.padding(horizontal = animatedPadding)
|
|
321
|
+
.clip(RoundedCornerShape(radius))
|
|
322
|
+
.then(getTypeStyle(type, size = size, bgColor = bgColor))
|
|
323
|
+
.conditional(IsShowBaseLineDebug) {
|
|
324
|
+
border(1.dp, Colors.blue_03)
|
|
325
|
+
}
|
|
336
326
|
)
|
|
327
|
+
|
|
328
|
+
// Content
|
|
329
|
+
Row(
|
|
330
|
+
modifier = Modifier
|
|
331
|
+
.padding(horizontal = sizeSpecs.padding)
|
|
332
|
+
.height(sizeSpecs.height),
|
|
333
|
+
horizontalArrangement = Arrangement.Center,
|
|
334
|
+
verticalAlignment = Alignment.CenterVertically,
|
|
335
|
+
) {
|
|
336
|
+
RenderIcon(
|
|
337
|
+
size = size,
|
|
338
|
+
isIconLeft = true,
|
|
339
|
+
useTintColor = useTintColor,
|
|
340
|
+
icon = iconLeft,
|
|
341
|
+
forceLoading = loading && loadingOnLeft,
|
|
342
|
+
bgColor = bgColor,
|
|
343
|
+
textColor = textColor
|
|
344
|
+
)
|
|
345
|
+
RenderTitle(size, title, textColor = textColor)
|
|
346
|
+
RenderIcon(
|
|
347
|
+
size = size,
|
|
348
|
+
isIconLeft = false,
|
|
349
|
+
useTintColor = useTintColor,
|
|
350
|
+
icon = iconRight,
|
|
351
|
+
forceLoading = loading && !loadingOnLeft,
|
|
352
|
+
bgColor = bgColor,
|
|
353
|
+
textColor = textColor
|
|
354
|
+
)
|
|
355
|
+
}
|
|
337
356
|
}
|
|
338
357
|
}
|
|
339
|
-
|
|
@@ -8,8 +8,11 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
|
8
8
|
import androidx.compose.foundation.layout.Arrangement
|
|
9
9
|
import androidx.compose.foundation.layout.Box
|
|
10
10
|
import androidx.compose.foundation.layout.Column
|
|
11
|
+
import androidx.compose.foundation.layout.IntrinsicSize
|
|
11
12
|
import androidx.compose.foundation.layout.Row
|
|
12
13
|
import androidx.compose.foundation.layout.Spacer
|
|
14
|
+
import androidx.compose.foundation.layout.fillMaxWidth
|
|
15
|
+
import androidx.compose.foundation.layout.height
|
|
13
16
|
import androidx.compose.foundation.layout.offset
|
|
14
17
|
import androidx.compose.foundation.layout.padding
|
|
15
18
|
import androidx.compose.foundation.layout.size
|
|
@@ -221,7 +224,7 @@ private class TooltipPositionProvider(
|
|
|
221
224
|
fun Tooltip(
|
|
222
225
|
state: TooltipState,
|
|
223
226
|
title: String? = null,
|
|
224
|
-
description: String
|
|
227
|
+
description: String,
|
|
225
228
|
buttons: List<TooltipButton> = emptyList(),
|
|
226
229
|
placement: TooltipPlacement = TooltipPlacement.TOP,
|
|
227
230
|
align: TooltipAlign = TooltipAlign.CENTER,
|
|
@@ -260,7 +263,7 @@ fun Tooltip(
|
|
|
260
263
|
buttons = buttons,
|
|
261
264
|
placement = placement,
|
|
262
265
|
align = align,
|
|
263
|
-
onPressClose = onPressClose
|
|
266
|
+
onPressClose = onPressClose,
|
|
264
267
|
)
|
|
265
268
|
}
|
|
266
269
|
}
|
|
@@ -273,7 +276,7 @@ private fun TooltipPopupContent(
|
|
|
273
276
|
buttons: List<TooltipButton>,
|
|
274
277
|
placement: TooltipPlacement,
|
|
275
278
|
align: TooltipAlign,
|
|
276
|
-
onPressClose: () -> Unit,
|
|
279
|
+
onPressClose: (() -> Unit)? = null,
|
|
277
280
|
) {
|
|
278
281
|
val tooltipMaxWidth = 300.dp
|
|
279
282
|
val tooltipShape = remember { RoundedCornerShape(Radius.S) }
|
|
@@ -282,6 +285,7 @@ private fun TooltipPopupContent(
|
|
|
282
285
|
Column(
|
|
283
286
|
modifier = Modifier
|
|
284
287
|
.widthIn(max = tooltipMaxWidth)
|
|
288
|
+
.width(IntrinsicSize.Max)
|
|
285
289
|
.background(Colors.black_17, tooltipShape)
|
|
286
290
|
.clip(tooltipShape)
|
|
287
291
|
.conditional(IsShowBaseLineDebug) {
|
|
@@ -289,8 +293,8 @@ private fun TooltipPopupContent(
|
|
|
289
293
|
}
|
|
290
294
|
.padding(Spacing.M)
|
|
291
295
|
) {
|
|
292
|
-
Row {
|
|
293
|
-
Column(modifier = Modifier.weight(1f
|
|
296
|
+
Row(Modifier.fillMaxWidth()) {
|
|
297
|
+
Column(modifier = Modifier.weight(1f)) {
|
|
294
298
|
if (!title.isNullOrEmpty()) {
|
|
295
299
|
Text(
|
|
296
300
|
text = title,
|
|
@@ -307,27 +311,29 @@ private fun TooltipPopupContent(
|
|
|
307
311
|
style = Typography.descriptionDefaultRegular,
|
|
308
312
|
color = Colors.black_01,
|
|
309
313
|
maxLines = 2,
|
|
310
|
-
modifier = Modifier.padding(bottom = Spacing.M),
|
|
311
314
|
overflow = TextOverflow.Ellipsis,
|
|
312
315
|
)
|
|
313
316
|
}
|
|
314
317
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
318
|
+
if (onPressClose != null) {
|
|
319
|
+
Spacer(Modifier.width(Spacing.M))
|
|
320
|
+
Box(
|
|
321
|
+
modifier = Modifier
|
|
322
|
+
.size(20.dp)
|
|
323
|
+
.activeOpacityClickable {
|
|
324
|
+
onPressClose.invoke()
|
|
325
|
+
}
|
|
326
|
+
) {
|
|
327
|
+
Icon(
|
|
328
|
+
source = "navigation_close",
|
|
329
|
+
size = 20.dp,
|
|
330
|
+
color = Colors.black_01,
|
|
331
|
+
)
|
|
332
|
+
}
|
|
328
333
|
}
|
|
329
334
|
}
|
|
330
335
|
if (buttons.isNotEmpty()) {
|
|
336
|
+
Spacer(Modifier.height(Spacing.M))
|
|
331
337
|
TooltipButtons(
|
|
332
338
|
buttons = buttons,
|
|
333
339
|
modifier = Modifier.align(Alignment.End),
|
|
@@ -486,6 +492,7 @@ private fun TooltipButtons(buttons: List<TooltipButton>, modifier: Modifier = Mo
|
|
|
486
492
|
TooltipSecondaryButton(
|
|
487
493
|
title = secondary.title ?: "",
|
|
488
494
|
onPress = secondary.onPress ?: {},
|
|
495
|
+
modifier = Modifier.weight(1f, fill = false),
|
|
489
496
|
)
|
|
490
497
|
Spacer(modifier = Modifier.width(Spacing.S))
|
|
491
498
|
TooltipPrimaryButton(
|
|
@@ -518,6 +525,12 @@ private fun TooltipSingleButton(btn: TooltipButton) {
|
|
|
518
525
|
)
|
|
519
526
|
}
|
|
520
527
|
}
|
|
528
|
+
|
|
529
|
+
private const val MAX_BUTTON_LENGTH = 16
|
|
530
|
+
|
|
531
|
+
private fun String.limitWithEllipsis(max: Int = 16): String {
|
|
532
|
+
return if (length > max) take(max) + "…" else this
|
|
533
|
+
}
|
|
521
534
|
@Composable
|
|
522
535
|
private fun TooltipPrimaryButton(
|
|
523
536
|
title: String,
|
|
@@ -525,7 +538,7 @@ private fun TooltipPrimaryButton(
|
|
|
525
538
|
) {
|
|
526
539
|
Button(
|
|
527
540
|
onClick = onPress,
|
|
528
|
-
title = title,
|
|
541
|
+
title = title.limitWithEllipsis(),
|
|
529
542
|
type = ButtonType.SECONDARY,
|
|
530
543
|
size = Size.MEDIUM,
|
|
531
544
|
isFull = false,
|
|
@@ -535,20 +548,21 @@ private fun TooltipPrimaryButton(
|
|
|
535
548
|
private fun TooltipSecondaryButton(
|
|
536
549
|
title: String,
|
|
537
550
|
onPress: () -> Unit,
|
|
551
|
+
modifier: Modifier = Modifier,
|
|
538
552
|
) {
|
|
539
553
|
Box(
|
|
540
|
-
modifier =
|
|
541
|
-
.
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
onClick = onPress,
|
|
545
|
-
)
|
|
554
|
+
modifier = modifier
|
|
555
|
+
.activeOpacityClickable {
|
|
556
|
+
onPress()
|
|
557
|
+
}
|
|
546
558
|
.padding(horizontal = Spacing.M, vertical = Spacing.S),
|
|
547
559
|
) {
|
|
548
560
|
Text(
|
|
549
|
-
text = title,
|
|
561
|
+
text = title.limitWithEllipsis(),
|
|
550
562
|
color = Colors.black_01,
|
|
551
563
|
style = Typography.actionSBold,
|
|
564
|
+
maxLines = 1,
|
|
565
|
+
overflow = TextOverflow.Ellipsis,
|
|
552
566
|
)
|
|
553
567
|
}
|
|
554
568
|
}
|
package/gradle.properties
CHANGED
|
@@ -89,7 +89,7 @@ public struct InputPhoneNumber: View {
|
|
|
89
89
|
MomoText(placeholder, typography: size == .small ? .headerSSemibold : .headerMBold, color: Colors.black12)
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
TextField(
|
|
92
|
+
TextField("", text: textBinding, onEditingChanged: { focused in
|
|
93
93
|
handleFocusChange(focused)
|
|
94
94
|
})
|
|
95
95
|
.keyboardType(.numberPad)
|
|
@@ -98,6 +98,7 @@ public struct InputPhoneNumber: View {
|
|
|
98
98
|
.applyPrimaryCursorColor()
|
|
99
99
|
.lineLimit(1)
|
|
100
100
|
.accessibility(identifier: accessibilityLabel ?? "")
|
|
101
|
+
.accessibilityValue(textBinding.wrappedValue.isEmpty ? placeholder : textBinding.wrappedValue)
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
// Clear button
|
package/local.properties
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Mon Dec 22 10:07:29 ICT 2025
|
|
8
|
+
sdk.dir=/Users/phuc/Library/Android/sdk
|