@momo-kits/native-kits 0.157.1-skill.1 → 0.157.1-skill.3-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/SKILL.md +51 -0
- package/.claude/momo-native-kits-skill/evals/evals.json +95 -0
- package/.claude/momo-native-kits-skill/references/badge.md +52 -0
- package/.claude/momo-native-kits-skill/references/button.md +182 -0
- package/.claude/momo-native-kits-skill/references/card.md +48 -0
- package/.claude/momo-native-kits-skill/references/checkbox.md +51 -0
- package/.claude/momo-native-kits-skill/references/chip.md +48 -0
- package/.claude/momo-native-kits-skill/references/constants.md +260 -0
- package/.claude/momo-native-kits-skill/references/divider.md +26 -0
- package/.claude/momo-native-kits-skill/references/input.md +408 -0
- package/.claude/momo-native-kits-skill/references/navigation.md +475 -0
- package/.claude/momo-native-kits-skill/references/popup.md +97 -0
- package/.claude/momo-native-kits-skill/references/radio.md +60 -0
- package/.claude/momo-native-kits-skill/references/skeleton.md +40 -0
- package/.claude/momo-native-kits-skill/references/snackbar.md +54 -0
- package/.claude/momo-native-kits-skill/references/switch.md +62 -0
- package/.claude/momo-native-kits-skill/references/text.md +195 -0
- package/.claude/momo-native-kits-skill/references/tooltip.md +34 -0
- package/.claude/momo-native-kits-skill/references/trustbanner.md +61 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/benchmark.json +20 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/benchmark.md +13 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/with_skill/outputs/ButtonExample.kt +55 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/without_skill/outputs/ButtonExample.kt +45 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/with_skill/outputs/InputPhoneExample.kt +40 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/without_skill/outputs/InputPhoneExample.kt +42 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/with_skill/outputs/BottomTabExample.kt +236 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/without_skill/outputs/BottomTabExample.kt +152 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/with_skill/outputs/CheckBoxExample.kt +49 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/without_skill/outputs/CheckBoxExample.kt +123 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/with_skill/outputs/DateTimePickerExample.kt +318 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/without_skill/outputs/DateTimePickerExample.kt +330 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-card/with_skill/outputs/CardExample.kt +124 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-card/without_skill/outputs/CardExample.kt +71 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-loginform/with_skill/outputs/LoginFormExample.kt +134 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-loginform/without_skill/outputs/LoginFormExample.kt +199 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-navcontainer/with_skill/outputs/NavigationContainerExample.kt +224 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-navcontainer/without_skill/outputs/NavigationContainerExample.kt +225 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-popup/with_skill/outputs/PopupExample.kt +79 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-popup/without_skill/outputs/PopupExample.kt +169 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/eval_metadata.json +6 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/with_skill/outputs/SetOptionsExample.kt +255 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/without_skill/outputs/SetOptionsExample.kt +212 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-skeleton/with_skill/outputs/SkeletonExample.kt +199 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-skeleton/without_skill/outputs/SkeletonExample.kt +229 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/benchmark.json +20 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/benchmark.md +13 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/eval_metadata.json +22 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/with_skill/outputs/PrimaryButtonExample.kt +38 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/with_skill/timing.json +5 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/without_skill/outputs/PrimaryButtonExample.kt +83 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/without_skill/timing.json +5 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/eval_metadata.json +22 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/with_skill/outputs/NavigationContainerExample.kt +547 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/with_skill/timing.json +5 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/without_skill/outputs/MoMoNavigationContainer.kt +519 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/without_skill/timing.json +5 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/eval_metadata.json +27 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/with_skill/outputs/SetOptionsExample.kt +429 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/with_skill/timing.json +5 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/without_skill/outputs/SetOptionsExample.kt +353 -0
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/without_skill/timing.json +5 -0
- package/.claude/settings.local.json +35 -7
- package/build.gradle.kts +11 -0
- package/compose/build.gradle.kts +180 -0
- package/compose/build.gradle.kts.backup +180 -0
- package/compose/compose.podspec +54 -0
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +110 -0
- package/compose/src/commonMain/composeResources/font/momosignature.otf +0 -0
- package/compose/src/commonMain/composeResources/font/momotrustdisplay.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_black.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_bold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_heavy.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_light.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_medium.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_regular.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_semibold.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_thin.ttf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.otf +0 -0
- package/compose/src/commonMain/composeResources/font/sfprotext_ultralight.ttf +0 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/AnimationSearchInput.kt +57 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Context.kt +107 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/FloatingButton.kt +201 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Header.kt +222 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderAnimated.kt +48 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderBackground.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderDefault.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderExtended.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderRight.kt +305 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/HeaderTitle.kt +33 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/LiteScreen.kt +720 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/NavigationContainer.kt +121 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/Screen.kt +405 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/application/useHeaderSearchAnimation.kt +69 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Badge.kt +85 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeDot.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BadgeRibbon.kt +340 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/BaselineView.kt +198 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Button.kt +357 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CheckBox.kt +94 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Chip.kt +136 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/CupertinoOverscroll.kt +543 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Divider.kt +23 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Icon.kt +76 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/IconButton.kt +148 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Image.kt +188 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Information.kt +116 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Input.kt +448 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputDropDown.kt +172 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputMoney.kt +255 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputOTP.kt +231 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputPhoneNumber.kt +233 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputSearch.kt +254 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/InputTextArea.kt +241 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/LazyColumnWithBouncing.kt +364 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationDot.kt +56 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationNumber.kt +41 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationScroll.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PaginationWhiteDot.kt +40 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupNotify.kt +352 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +103 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Radio.kt +70 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ScaleSizeScope.kt +17 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Skeleton.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Switch.kt +96 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tag.kt +92 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Text.kt +130 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Title.kt +214 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Tooltip.kt +590 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TrustBanner.kt +177 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePicker.kt +205 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerTypes.kt +29 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/DateTimePickerUtils.kt +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/datetimepicker/WheelPicker.kt +191 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Colors.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Radius.kt +12 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +13 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +185 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Typography.kt +285 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Card.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Item.kt +35 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/layout/Section.kt +2 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +59 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Clickable.kt +68 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Conditional.kt +11 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/DeprecatedModifier.kt +14 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Shadow.kt +50 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/Size.kt +51 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +239 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +119 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +98 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +161 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +331 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +497 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTab.kt +162 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/BottomTabBar.kt +243 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/bottomtab/CurvedContainer.kt +86 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/FloatingButton.kt +187 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/Header.kt +279 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderBackground.kt +80 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderRight.kt +306 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderTitle.kt +32 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/HeaderUser.kt +370 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/component/SnackBar.kt +132 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +42 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Icons.kt +1329 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Resources.kt +62 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Tracking.kt +15 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/utils/Utils.kt +88 -0
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +149 -0
- package/gradle/libs.versions.toml +57 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/gradle.properties +26 -0
- package/gradlew +252 -0
- package/gradlew.bat +94 -0
- package/ios/Input/Input.swift +112 -50
- package/local.properties +8 -0
- package/package.json +1 -1
- package/settings.gradle.kts +52 -0
- package/.claude/momo-native-kits/SKILL.md +0 -87
- package/.claude/momo-native-kits/references/Badge.md +0 -39
- package/.claude/momo-native-kits/references/BadgeDot.md +0 -37
- package/.claude/momo-native-kits/references/BottomSheet.md +0 -51
- package/.claude/momo-native-kits/references/BottomTab.md +0 -65
- package/.claude/momo-native-kits/references/Button.md +0 -197
- package/.claude/momo-native-kits/references/CheckBox.md +0 -51
- package/.claude/momo-native-kits/references/Chip.md +0 -47
- package/.claude/momo-native-kits/references/Divider.md +0 -29
- package/.claude/momo-native-kits/references/HeaderTitle.md +0 -45
- package/.claude/momo-native-kits/references/HeaderType.md +0 -47
- package/.claude/momo-native-kits/references/Icon.md +0 -32
- package/.claude/momo-native-kits/references/Image.md +0 -38
- package/.claude/momo-native-kits/references/Information.md +0 -36
- package/.claude/momo-native-kits/references/Input.md +0 -334
- package/.claude/momo-native-kits/references/InputDropDown.md +0 -47
- package/.claude/momo-native-kits/references/InputMoney.md +0 -241
- package/.claude/momo-native-kits/references/InputOTP.md +0 -52
- package/.claude/momo-native-kits/references/InputPhoneNumber.md +0 -175
- package/.claude/momo-native-kits/references/InputSearch.md +0 -57
- package/.claude/momo-native-kits/references/InputTextArea.md +0 -46
- package/.claude/momo-native-kits/references/NavigationContainer.md +0 -51
- package/.claude/momo-native-kits/references/Navigator.md +0 -287
- package/.claude/momo-native-kits/references/PaginationDot.md +0 -28
- package/.claude/momo-native-kits/references/PaginationNumber.md +0 -28
- package/.claude/momo-native-kits/references/PopupNotify.md +0 -47
- package/.claude/momo-native-kits/references/Radio.md +0 -44
- package/.claude/momo-native-kits/references/Skeleton.md +0 -32
- package/.claude/momo-native-kits/references/Switch.md +0 -36
- package/.claude/momo-native-kits/references/Tag.md +0 -40
- package/.claude/momo-native-kits/references/Text.md +0 -37
- package/.claude/momo-native-kits/references/Title.md +0 -43
- package/.claude/momo-native-kits/references/Tooltip.md +0 -30
- package/building-skill-for-claude.md +0 -1190
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: input
|
|
3
|
-
description: Text input field with floating label support. Use when collecting text input from users.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Input
|
|
7
|
-
|
|
8
|
-
Text input field with floating label, validation, icons, and various states.
|
|
9
|
-
|
|
10
|
-
## API
|
|
11
|
-
|
|
12
|
-
```kotlin
|
|
13
|
-
@Composable
|
|
14
|
-
fun Input(
|
|
15
|
-
text: MutableState<String> = remember { mutableStateOf("") },
|
|
16
|
-
floatingValue: String = "",
|
|
17
|
-
floatingValueColor: Color = AppTheme.current.colors.text.hint,
|
|
18
|
-
floatingIcon: String = "",
|
|
19
|
-
floatingIconColor: Color = AppTheme.current.colors.text.default,
|
|
20
|
-
placeholder: String = "",
|
|
21
|
-
size: InputSize = InputSize.SMALL,
|
|
22
|
-
onChangeText: (String) -> Unit = {},
|
|
23
|
-
hintText: String = "",
|
|
24
|
-
error: String = "",
|
|
25
|
-
errorSpacing: Boolean = false,
|
|
26
|
-
disabled: Boolean = false,
|
|
27
|
-
readOnly: Boolean = false,
|
|
28
|
-
secureTextEntry: Boolean = false,
|
|
29
|
-
icon: String = "",
|
|
30
|
-
iconColor: Color = AppTheme.current.colors.text.default,
|
|
31
|
-
onRightIconPressed: () -> Unit = {},
|
|
32
|
-
leadingIcon: String = "",
|
|
33
|
-
leadingIconColor: Color = AppTheme.current.colors.text.hint,
|
|
34
|
-
onFocus: () -> Unit = {},
|
|
35
|
-
onBlur: () -> Unit = {},
|
|
36
|
-
loading: Boolean = false,
|
|
37
|
-
required: Boolean = false,
|
|
38
|
-
fontWeight: InputFontWeight = InputFontWeight.REGULAR,
|
|
39
|
-
keyboardType: KeyboardType = KeyboardType.Text,
|
|
40
|
-
modifier: Modifier = Modifier,
|
|
41
|
-
inputModifier: Modifier = Modifier,
|
|
42
|
-
)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Props
|
|
46
|
-
|
|
47
|
-
| Prop | Type | Default | Description |
|
|
48
|
-
|------|------|---------|-------------|
|
|
49
|
-
| `text` | `MutableState<String>` | `""` | Current text value (required) |
|
|
50
|
-
| `floatingValue` | `String` | `""` | Floating label text |
|
|
51
|
-
| `floatingValueColor` | `Color` | hint color | Floating label color |
|
|
52
|
-
| `floatingIcon` | `String` | `""` | Icon next to floating label |
|
|
53
|
-
| `floatingIconColor` | `Color` | default color | Floating icon color |
|
|
54
|
-
| `placeholder` | `String` | `""` | Placeholder text |
|
|
55
|
-
| `size` | `InputSize` | `SMALL` | Input height |
|
|
56
|
-
| `onChangeText` | `(String) -> Unit` | `{}` | Text change callback |
|
|
57
|
-
| `hintText` | `String` | `""` | Hint text below input |
|
|
58
|
-
| `error` | `String` | `""` | Error message |
|
|
59
|
-
| `errorSpacing` | `Boolean` | `false` | Show spacing for error |
|
|
60
|
-
| `disabled` | `Boolean` | `false` | Disabled state |
|
|
61
|
-
| `readOnly` | `Boolean` | `false` | Read-only state |
|
|
62
|
-
| `secureTextEntry` | `Boolean` | `false` | Password field |
|
|
63
|
-
| `icon` | `String` | `""` | Right icon name |
|
|
64
|
-
| `iconColor` | `Color` | default color | Right icon color |
|
|
65
|
-
| `onRightIconPressed` | `() -> Unit` | `{}` | Right icon click |
|
|
66
|
-
| `leadingIcon` | `String` | `""` | Left icon name |
|
|
67
|
-
| `leadingIconColor` | `Color` | hint color | Left icon color |
|
|
68
|
-
| `onFocus` | `() -> Unit` | `{}` | Focus callback |
|
|
69
|
-
| `onBlur` | `() -> Unit` | `{}` | Blur callback |
|
|
70
|
-
| `loading` | `Boolean` | `false` | Loading spinner |
|
|
71
|
-
| `required` | `Boolean` | `false` | Show required asterisk |
|
|
72
|
-
| `fontWeight` | `InputFontWeight` | `REGULAR` | Text font weight |
|
|
73
|
-
| `keyboardType` | `KeyboardType` | `Text` | Keyboard type |
|
|
74
|
-
| `modifier` | `Modifier` | `Modifier` | Outer modifier |
|
|
75
|
-
| `inputModifier` | `Modifier` | `Modifier` | Input field modifier |
|
|
76
|
-
|
|
77
|
-
## InputSize
|
|
78
|
-
|
|
79
|
-
| Size | Height | Border Radius |
|
|
80
|
-
|------|--------|---------------|
|
|
81
|
-
| `SMALL` | 48dp | Radius.S |
|
|
82
|
-
| `LARGE` | 56dp | Radius.S |
|
|
83
|
-
|
|
84
|
-
## InputFontWeight
|
|
85
|
-
|
|
86
|
-
| Value | Description |
|
|
87
|
-
|-------|-------------|
|
|
88
|
-
| `REGULAR` | FontWeight 400 |
|
|
89
|
-
| `BOLD` | FontWeight 700 |
|
|
90
|
-
|
|
91
|
-
## States
|
|
92
|
-
|
|
93
|
-
- **Default**: Normal border color
|
|
94
|
-
- **Focused**: Primary border color (1.5dp)
|
|
95
|
-
- **Error**: Error border color + error message
|
|
96
|
-
- **Disabled**: Disable border color, reduced opacity
|
|
97
|
-
- **ReadOnly**: No border highlight
|
|
98
|
-
|
|
99
|
-
## Examples
|
|
100
|
-
|
|
101
|
-
### Basic Usage
|
|
102
|
-
|
|
103
|
-
```kotlin
|
|
104
|
-
val text = remember { mutableStateOf("") }
|
|
105
|
-
|
|
106
|
-
Input(
|
|
107
|
-
text = text,
|
|
108
|
-
onChangeText = { text.value = it }
|
|
109
|
-
)
|
|
110
|
-
|
|
111
|
-
// With floating label
|
|
112
|
-
Input(
|
|
113
|
-
text = text,
|
|
114
|
-
floatingValue = "Name",
|
|
115
|
-
onChangeText = { text.value = it }
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
// With placeholder
|
|
119
|
-
Input(
|
|
120
|
-
text = text,
|
|
121
|
-
placeholder = "Enter your name",
|
|
122
|
-
onChangeText = { text.value = it }
|
|
123
|
-
)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### With Error
|
|
127
|
-
|
|
128
|
-
```kotlin
|
|
129
|
-
val email = remember { mutableStateOf("") }
|
|
130
|
-
val emailError = remember { mutableStateOf("") }
|
|
131
|
-
|
|
132
|
-
// Show error message
|
|
133
|
-
Input(
|
|
134
|
-
text = email,
|
|
135
|
-
floatingValue = "Email",
|
|
136
|
-
error = "Invalid email address",
|
|
137
|
-
errorSpacing = true,
|
|
138
|
-
onChangeText = { email.value = it }
|
|
139
|
-
)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Password Field
|
|
143
|
-
|
|
144
|
-
```kotlin
|
|
145
|
-
val password = remember { mutableStateOf("") }
|
|
146
|
-
|
|
147
|
-
Input(
|
|
148
|
-
text = password,
|
|
149
|
-
floatingValue = "Password",
|
|
150
|
-
secureTextEntry = true,
|
|
151
|
-
onChangeText = { password.value = it }
|
|
152
|
-
)
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### With Icons
|
|
156
|
-
|
|
157
|
-
```kotlin
|
|
158
|
-
val text = remember { mutableStateOf("") }
|
|
159
|
-
|
|
160
|
-
// Leading icon (left)
|
|
161
|
-
Input(
|
|
162
|
-
text = text,
|
|
163
|
-
floatingValue = "Username",
|
|
164
|
-
leadingIcon = "person",
|
|
165
|
-
leadingIconColor = AppTheme.current.colors.text.hint,
|
|
166
|
-
onChangeText = { text.value = it }
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
// Trailing icon (right)
|
|
170
|
-
Input(
|
|
171
|
-
text = text,
|
|
172
|
-
floatingValue = "Email",
|
|
173
|
-
icon = "close",
|
|
174
|
-
onRightIconPressed = { text.value = "" },
|
|
175
|
-
onChangeText = { text.value = it }
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
// Both icons
|
|
179
|
-
Input(
|
|
180
|
-
text = text,
|
|
181
|
-
floatingValue = "Search",
|
|
182
|
-
leadingIcon = "search",
|
|
183
|
-
icon = "clear",
|
|
184
|
-
onChangeText = { text.value = it }
|
|
185
|
-
)
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### With Floating Label Icon
|
|
189
|
-
|
|
190
|
-
```kotlin
|
|
191
|
-
Input(
|
|
192
|
-
text = text,
|
|
193
|
-
floatingValue = "Phone",
|
|
194
|
-
floatingIcon = "phone",
|
|
195
|
-
floatingIconColor = AppTheme.current.colors.primary,
|
|
196
|
-
onChangeText = { text.value = it }
|
|
197
|
-
)
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
### Required Field
|
|
201
|
-
|
|
202
|
-
```kotlin
|
|
203
|
-
Input(
|
|
204
|
-
text = text,
|
|
205
|
-
floatingValue = "Full Name",
|
|
206
|
-
required = true,
|
|
207
|
-
onChangeText = { text.value = it }
|
|
208
|
-
)
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Disabled / ReadOnly
|
|
212
|
-
|
|
213
|
-
```kotlin
|
|
214
|
-
// Disabled
|
|
215
|
-
Input(
|
|
216
|
-
text = text,
|
|
217
|
-
floatingValue = "Disabled",
|
|
218
|
-
disabled = true,
|
|
219
|
-
onChangeText = { }
|
|
220
|
-
)
|
|
221
|
-
|
|
222
|
-
// Read only
|
|
223
|
-
Input(
|
|
224
|
-
text = text,
|
|
225
|
-
floatingValue = "Read Only",
|
|
226
|
-
readOnly = true,
|
|
227
|
-
onChangeText = { }
|
|
228
|
-
)
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Keyboard Types
|
|
232
|
-
|
|
233
|
-
```kotlin
|
|
234
|
-
// Text keyboard (default)
|
|
235
|
-
Input(
|
|
236
|
-
text = text,
|
|
237
|
-
floatingValue = "Name",
|
|
238
|
-
keyboardType = KeyboardType.Text,
|
|
239
|
-
onChangeText = { }
|
|
240
|
-
)
|
|
241
|
-
|
|
242
|
-
// Number keyboard
|
|
243
|
-
Input(
|
|
244
|
-
text = text,
|
|
245
|
-
floatingValue = "Age",
|
|
246
|
-
keyboardType = KeyboardType.Number,
|
|
247
|
-
onChangeText = { }
|
|
248
|
-
)
|
|
249
|
-
|
|
250
|
-
// Email keyboard
|
|
251
|
-
Input(
|
|
252
|
-
text = text,
|
|
253
|
-
floatingValue = "Email",
|
|
254
|
-
keyboardType = KeyboardType.Email,
|
|
255
|
-
onChangeText = { }
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
// Phone keyboard
|
|
259
|
-
Input(
|
|
260
|
-
text = text,
|
|
261
|
-
floatingValue = "Phone",
|
|
262
|
-
keyboardType = KeyboardType.Phone,
|
|
263
|
-
onChangeText = { }
|
|
264
|
-
)
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Focus Callbacks
|
|
268
|
-
|
|
269
|
-
```kotlin
|
|
270
|
-
Input(
|
|
271
|
-
text = text,
|
|
272
|
-
floatingValue = "Name",
|
|
273
|
-
onFocus = { /* show keyboard */ },
|
|
274
|
-
onBlur = { /* hide keyboard, validate */ },
|
|
275
|
-
onChangeText = { text.value = it }
|
|
276
|
-
)
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Loading State
|
|
280
|
-
|
|
281
|
-
```kotlin
|
|
282
|
-
Input(
|
|
283
|
-
text = text,
|
|
284
|
-
floatingValue = "Loading",
|
|
285
|
-
loading = true,
|
|
286
|
-
onChangeText = { text.value = it }
|
|
287
|
-
)
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### Hint Text
|
|
291
|
-
|
|
292
|
-
```kotlin
|
|
293
|
-
Input(
|
|
294
|
-
text = text,
|
|
295
|
-
floatingValue = "Email",
|
|
296
|
-
hintText = "We will never share your email",
|
|
297
|
-
onChangeText = { text.value = it }
|
|
298
|
-
)
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
### Large Size
|
|
302
|
-
|
|
303
|
-
```kotlin
|
|
304
|
-
Input(
|
|
305
|
-
text = text,
|
|
306
|
-
floatingValue = "Large Input",
|
|
307
|
-
size = InputSize.LARGE,
|
|
308
|
-
onChangeText = { text.value = it }
|
|
309
|
-
)
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### Bold Font Weight
|
|
313
|
-
|
|
314
|
-
```kotlin
|
|
315
|
-
Input(
|
|
316
|
-
text = text,
|
|
317
|
-
floatingValue = "Bold Text",
|
|
318
|
-
fontWeight = InputFontWeight.BOLD,
|
|
319
|
-
onChangeText = { text.value = it }
|
|
320
|
-
)
|
|
321
|
-
```
|
|
322
|
-
|
|
323
|
-
## Auto-Clear Behavior
|
|
324
|
-
|
|
325
|
-
When focused with text:
|
|
326
|
-
- Clear icon appears on the right
|
|
327
|
-
- Clicking clears the text and triggers `onChangeText("")`
|
|
328
|
-
|
|
329
|
-
## Password Toggle
|
|
330
|
-
|
|
331
|
-
When `secureTextEntry = true`:
|
|
332
|
-
- Eye icon appears on the right
|
|
333
|
-
- Clicking toggles between show/hide password
|
|
334
|
-
- Default icon: `24_security_eye_open` (show) / `24_security_eye_off` (hide)
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: input-dropdown
|
|
3
|
-
description: Dropdown selection input. Use when user needs to select one option from a list.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# InputDropDown
|
|
7
|
-
|
|
8
|
-
Dropdown selection input.
|
|
9
|
-
|
|
10
|
-
## Keywords
|
|
11
|
-
|
|
12
|
-
dropdown, select, chọn, danh mục, picker
|
|
13
|
-
|
|
14
|
-
## API
|
|
15
|
-
|
|
16
|
-
```kotlin
|
|
17
|
-
@Composable
|
|
18
|
-
fun InputDropDown(
|
|
19
|
-
text: MutableState<String>,
|
|
20
|
-
items: List<String> = emptyList(),
|
|
21
|
-
onItemSelected: (String, Int) -> Unit = { _, _ -> },
|
|
22
|
-
floatingValue: String = "",
|
|
23
|
-
placeholder: String = "",
|
|
24
|
-
error: String = "",
|
|
25
|
-
)
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Features
|
|
29
|
-
|
|
30
|
-
- List of string items
|
|
31
|
-
- Returns selected item and index
|
|
32
|
-
|
|
33
|
-
## Examples
|
|
34
|
-
|
|
35
|
-
```kotlin
|
|
36
|
-
val selected = remember { mutableStateOf("") }
|
|
37
|
-
val items = listOf("Option 1", "Option 2", "Option 3")
|
|
38
|
-
|
|
39
|
-
InputDropDown(
|
|
40
|
-
text = selected,
|
|
41
|
-
items = items,
|
|
42
|
-
floatingValue = "Select",
|
|
43
|
-
onItemSelected = { item, index ->
|
|
44
|
-
selected.value = item
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
```
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: input-money
|
|
3
|
-
description: Money input with automatic formatting. Use when collecting monetary amounts with VND currency formatting.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# InputMoney
|
|
7
|
-
|
|
8
|
-
Money input field with automatic VND currency formatting and bold font weight.
|
|
9
|
-
|
|
10
|
-
## API
|
|
11
|
-
|
|
12
|
-
```kotlin
|
|
13
|
-
@Composable
|
|
14
|
-
fun InputMoney(
|
|
15
|
-
text: MutableState<String> = remember { mutableStateOf("0") },
|
|
16
|
-
floatingValue: String = "",
|
|
17
|
-
floatingValueColor: Color = AppTheme.current.colors.text.hint,
|
|
18
|
-
floatingIcon: String = "",
|
|
19
|
-
floatingIconColor: Color = AppTheme.current.colors.text.default,
|
|
20
|
-
placeholder: String = "0đ",
|
|
21
|
-
size: InputSize = InputSize.SMALL,
|
|
22
|
-
onChangeText: (String) -> Unit = {},
|
|
23
|
-
error: String = "",
|
|
24
|
-
errorSpacing: Boolean = false,
|
|
25
|
-
disabled: Boolean = false,
|
|
26
|
-
icon: String = "",
|
|
27
|
-
iconColor: Color = AppTheme.current.colors.text.default,
|
|
28
|
-
onPressIcon: () -> Unit = {},
|
|
29
|
-
leadingIcon: String = "",
|
|
30
|
-
leadingIconColor: Color = AppTheme.current.colors.text.hint,
|
|
31
|
-
onFocus: () -> Unit = {},
|
|
32
|
-
onBlur: () -> Unit = {},
|
|
33
|
-
loading: Boolean = false,
|
|
34
|
-
required: Boolean = false,
|
|
35
|
-
fontWeight: InputFontWeight = InputFontWeight.BOLD,
|
|
36
|
-
keyboardType: KeyboardType = KeyboardType.Number,
|
|
37
|
-
)
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Props
|
|
41
|
-
|
|
42
|
-
| Prop | Type | Default | Description |
|
|
43
|
-
|------|------|---------|-------------|
|
|
44
|
-
| `text` | `MutableState<String>` | `"0"` | Current text value (required) |
|
|
45
|
-
| `floatingValue` | `String` | `""` | Floating label text |
|
|
46
|
-
| `floatingValueColor` | `Color` | hint color | Floating label color |
|
|
47
|
-
| `floatingIcon` | `String` | `""` | Icon next to floating label |
|
|
48
|
-
| `floatingIconColor` | `Color` | default color | Floating icon color |
|
|
49
|
-
| `placeholder` | `String` | `"0đ"` | Placeholder text |
|
|
50
|
-
| `size` | `InputSize` | `SMALL` | Input height |
|
|
51
|
-
| `onChangeText` | `(String) -> Unit` | `{}` | Text change callback |
|
|
52
|
-
| `error` | `String` | `""` | Error message |
|
|
53
|
-
| `errorSpacing` | `Boolean` | `false` | Show spacing for error |
|
|
54
|
-
| `disabled` | `Boolean` | `false` | Disabled state |
|
|
55
|
-
| `icon` | `String` | `""` | Right icon name |
|
|
56
|
-
| `iconColor` | `Color` | default color | Right icon color |
|
|
57
|
-
| `onPressIcon` | `() -> Unit` | `{}` | Right icon click |
|
|
58
|
-
| `leadingIcon` | `String` | `""` | Left icon name |
|
|
59
|
-
| `leadingIconColor` | `Color` | hint color | Left icon color |
|
|
60
|
-
| `onFocus` | `() -> Unit` | `{}` | Focus callback |
|
|
61
|
-
| `onBlur` | `() -> Unit` | `{}` | Blur callback |
|
|
62
|
-
| `loading` | `Boolean` | `false` | Loading spinner |
|
|
63
|
-
| `required` | `Boolean` | `false` | Show required asterisk |
|
|
64
|
-
| `fontWeight` | `InputFontWeight` | `BOLD` | Text font weight |
|
|
65
|
-
| `keyboardType` | `KeyboardType` | `Number` | Keyboard type |
|
|
66
|
-
|
|
67
|
-
## InputSize
|
|
68
|
-
|
|
69
|
-
| Size | Height | Border Radius |
|
|
70
|
-
|------|--------|---------------|
|
|
71
|
-
| `SMALL` | 48dp | Radius.S |
|
|
72
|
-
| `LARGE` | 56dp | Radius.S |
|
|
73
|
-
|
|
74
|
-
## InputFontWeight
|
|
75
|
-
|
|
76
|
-
| Value | Description |
|
|
77
|
-
|-------|-------------|
|
|
78
|
-
| `REGULAR` | FontWeight 400 |
|
|
79
|
-
| `BOLD` | FontWeight 700 (default) |
|
|
80
|
-
|
|
81
|
-
## Features
|
|
82
|
-
|
|
83
|
-
- **Auto-formatting**: Automatically formats to "1.000.000đ" (VND format)
|
|
84
|
-
- **Number-only**: Filters non-digit characters
|
|
85
|
-
- **Bold font**: Default bold font weight (20sp)
|
|
86
|
-
- **Auto-clear**: Shows clear button when focused with text
|
|
87
|
-
|
|
88
|
-
## Examples
|
|
89
|
-
|
|
90
|
-
### Basic Usage
|
|
91
|
-
|
|
92
|
-
```kotlin
|
|
93
|
-
val amount = remember { mutableStateOf("0") }
|
|
94
|
-
|
|
95
|
-
InputMoney(
|
|
96
|
-
text = amount,
|
|
97
|
-
onChangeText = { amount.value = it }
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
// With floating label
|
|
101
|
-
InputMoney(
|
|
102
|
-
text = amount,
|
|
103
|
-
floatingValue = "Amount",
|
|
104
|
-
onChangeText = { amount.value = it }
|
|
105
|
-
)
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### With Error
|
|
109
|
-
|
|
110
|
-
```kotlin
|
|
111
|
-
val amount = remember { mutableStateOf("0") }
|
|
112
|
-
|
|
113
|
-
InputMoney(
|
|
114
|
-
text = amount,
|
|
115
|
-
floatingValue = "Amount",
|
|
116
|
-
error = "Minimum amount is 1,000đ",
|
|
117
|
-
errorSpacing = true,
|
|
118
|
-
onChangeText = { amount.value = it }
|
|
119
|
-
)
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Disabled State
|
|
123
|
-
|
|
124
|
-
```kotlin
|
|
125
|
-
InputMoney(
|
|
126
|
-
text = amount,
|
|
127
|
-
floatingValue = "Amount",
|
|
128
|
-
disabled = true,
|
|
129
|
-
onChangeText = { }
|
|
130
|
-
)
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### With Icons
|
|
134
|
-
|
|
135
|
-
```kotlin
|
|
136
|
-
// Leading icon
|
|
137
|
-
InputMoney(
|
|
138
|
-
text = amount,
|
|
139
|
-
floatingValue = "Transfer Amount",
|
|
140
|
-
leadingIcon = "wallet",
|
|
141
|
-
leadingIconColor = AppTheme.current.colors.primary,
|
|
142
|
-
onChangeText = { amount.value = it }
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
// Trailing icon
|
|
146
|
-
InputMoney(
|
|
147
|
-
text = amount,
|
|
148
|
-
floatingValue = "Amount",
|
|
149
|
-
icon = "close",
|
|
150
|
-
onPressIcon = { amount.value = "0" },
|
|
151
|
-
onChangeText = { amount.value = it }
|
|
152
|
-
)
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### With Floating Label Icon
|
|
156
|
-
|
|
157
|
-
```kotlin
|
|
158
|
-
InputMoney(
|
|
159
|
-
text = amount,
|
|
160
|
-
floatingValue = "Price",
|
|
161
|
-
floatingIcon = "tag",
|
|
162
|
-
floatingIconColor = AppTheme.current.colors.primary,
|
|
163
|
-
onChangeText = { amount.value = it }
|
|
164
|
-
)
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Required Field
|
|
168
|
-
|
|
169
|
-
```kotlin
|
|
170
|
-
InputMoney(
|
|
171
|
-
text = amount,
|
|
172
|
-
floatingValue = "Amount",
|
|
173
|
-
required = true,
|
|
174
|
-
onChangeText = { amount.value = it }
|
|
175
|
-
)
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Sizes
|
|
179
|
-
|
|
180
|
-
```kotlin
|
|
181
|
-
// Small (default - 48dp)
|
|
182
|
-
InputMoney(
|
|
183
|
-
text = amount,
|
|
184
|
-
size = InputSize.SMALL,
|
|
185
|
-
onChangeText = { amount.value = it }
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
// Large (56dp)
|
|
189
|
-
InputMoney(
|
|
190
|
-
text = amount,
|
|
191
|
-
size = InputSize.LARGE,
|
|
192
|
-
onChangeText = { amount.value = it }
|
|
193
|
-
)
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Focus Callbacks
|
|
197
|
-
|
|
198
|
-
```kotlin
|
|
199
|
-
InputMoney(
|
|
200
|
-
text = amount,
|
|
201
|
-
floatingValue = "Amount",
|
|
202
|
-
onFocus = { /* show keyboard */ },
|
|
203
|
-
onBlur = { /* validate amount */ },
|
|
204
|
-
onChangeText = { amount.value = it }
|
|
205
|
-
)
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Loading State
|
|
209
|
-
|
|
210
|
-
```kotlin
|
|
211
|
-
InputMoney(
|
|
212
|
-
text = amount,
|
|
213
|
-
floatingValue = "Amount",
|
|
214
|
-
loading = true,
|
|
215
|
-
onChangeText = { amount.value = it }
|
|
216
|
-
)
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Regular Font Weight
|
|
220
|
-
|
|
221
|
-
```kotlin
|
|
222
|
-
InputMoney(
|
|
223
|
-
text = amount,
|
|
224
|
-
floatingValue = "Amount",
|
|
225
|
-
fontWeight = InputFontWeight.REGULAR,
|
|
226
|
-
onChangeText = { amount.value = it }
|
|
227
|
-
)
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## How It Works
|
|
231
|
-
|
|
232
|
-
1. User types digits (e.g., "1000000")
|
|
233
|
-
2. Component automatically formats with thousand separators and "đ" suffix
|
|
234
|
-
3. Display shows: "1.000.000đ"
|
|
235
|
-
4. `onChangeText` returns raw numeric string (e.g., "1000000")
|
|
236
|
-
|
|
237
|
-
## Auto-Clear Behavior
|
|
238
|
-
|
|
239
|
-
When focused with text:
|
|
240
|
-
- Clear icon appears on the right
|
|
241
|
-
- Clicking clears the text to "0" and triggers `onChangeText("")`
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: input-otp
|
|
3
|
-
description: OTP (One-Time Password) input field. Use when user needs to enter verification code.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# InputOTP
|
|
7
|
-
|
|
8
|
-
OTP (One-Time Password) input field.
|
|
9
|
-
|
|
10
|
-
## Keywords
|
|
11
|
-
|
|
12
|
-
OTP, mã xác nhận, verification code, mã otp
|
|
13
|
-
|
|
14
|
-
## API
|
|
15
|
-
|
|
16
|
-
```kotlin
|
|
17
|
-
@Composable
|
|
18
|
-
fun InputOTP(
|
|
19
|
-
value: String,
|
|
20
|
-
length: Int? = null,
|
|
21
|
-
floatingValue: String = "Label",
|
|
22
|
-
onChangeText: (String) -> Unit,
|
|
23
|
-
errorMessage: String = "",
|
|
24
|
-
)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- Fixed length: specify `length` (e.g., 6)
|
|
30
|
-
- Flexible length: leave `length` as null
|
|
31
|
-
- Auto caret animation
|
|
32
|
-
|
|
33
|
-
## Examples
|
|
34
|
-
|
|
35
|
-
```kotlin
|
|
36
|
-
val otp = remember { mutableStateOf("") }
|
|
37
|
-
|
|
38
|
-
// Fixed 6-digit OTP
|
|
39
|
-
InputOTP(
|
|
40
|
-
value = otp.value,
|
|
41
|
-
length = 6,
|
|
42
|
-
floatingValue = "OTP Code",
|
|
43
|
-
onChangeText = { otp.value = it }
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// Flexible length
|
|
47
|
-
InputOTP(
|
|
48
|
-
value = otp.value,
|
|
49
|
-
floatingValue = "Confirmation Code",
|
|
50
|
-
onChangeText = { otp.value = it }
|
|
51
|
-
)
|
|
52
|
-
```
|