@momo-kits/native-kits 0.157.5-debug → 0.158.1-beta.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/settings.local.json +11 -0
- package/.claude/skills/design-system/SKILL.md +88 -0
- package/.claude/skills/design-system/references/components/avatar.md +134 -0
- package/.claude/skills/design-system/references/components/badge.md +127 -0
- package/.claude/skills/design-system/references/components/bottom-tab.md +177 -0
- package/.claude/skills/design-system/references/components/bottomsheet.md +170 -0
- package/.claude/skills/design-system/references/components/button.md +206 -0
- package/.claude/skills/design-system/references/components/carousel.md +117 -0
- package/.claude/skills/design-system/references/components/checkbox.md +98 -0
- package/.claude/skills/design-system/references/components/chip.md +146 -0
- package/.claude/skills/design-system/references/components/collapse.md +120 -0
- package/.claude/skills/design-system/references/components/date-picker.md +119 -0
- package/.claude/skills/design-system/references/components/divider.md +84 -0
- package/.claude/skills/design-system/references/components/icon.md +130 -0
- package/.claude/skills/design-system/references/components/image.md +81 -0
- package/.claude/skills/design-system/references/components/information.md +107 -0
- package/.claude/skills/design-system/references/components/input-dropdown.md +138 -0
- package/.claude/skills/design-system/references/components/input-money.md +157 -0
- package/.claude/skills/design-system/references/components/input-otp.md +132 -0
- package/.claude/skills/design-system/references/components/input-phone-number.md +140 -0
- package/.claude/skills/design-system/references/components/input-search.md +124 -0
- package/.claude/skills/design-system/references/components/input-text-area.md +133 -0
- package/.claude/skills/design-system/references/components/input.md +152 -0
- package/.claude/skills/design-system/references/components/loader.md +87 -0
- package/.claude/skills/design-system/references/components/pagination.md +105 -0
- package/.claude/skills/design-system/references/components/popup-notify.md +128 -0
- package/.claude/skills/design-system/references/components/progress-info.md +114 -0
- package/.claude/skills/design-system/references/components/radio.md +86 -0
- package/.claude/skills/design-system/references/components/rating.md +126 -0
- package/.claude/skills/design-system/references/components/skeleton.md +120 -0
- package/.claude/skills/design-system/references/components/slider.md +141 -0
- package/.claude/skills/design-system/references/components/snackbar.md +97 -0
- package/.claude/skills/design-system/references/components/stepper.md +100 -0
- package/.claude/skills/design-system/references/components/steps.md +91 -0
- package/.claude/skills/design-system/references/components/suggest-action.md +95 -0
- package/.claude/skills/design-system/references/components/swipe.md +121 -0
- package/.claude/skills/design-system/references/components/switch.md +98 -0
- package/.claude/skills/design-system/references/components/tab-view.md +120 -0
- package/.claude/skills/design-system/references/components/tag.md +118 -0
- package/.claude/skills/design-system/references/components/text.md +151 -0
- package/.claude/skills/design-system/references/components/toast.md +99 -0
- package/.claude/skills/design-system/references/components/tooltip.md +138 -0
- package/.claude/skills/design-system/references/components/top-nav-miniapp.md +94 -0
- package/.claude/skills/design-system/references/components/top-nav.md +226 -0
- package/.claude/skills/design-system/references/components/uploader.md +115 -0
- package/.claude/skills/design-system/references/navigation/bottom-tab.md +131 -0
- package/.claude/skills/design-system/references/navigation/bottomsheet.md +161 -0
- package/.claude/skills/design-system/references/navigation/modal.md +133 -0
- package/.claude/skills/design-system/references/navigation/navigation-options.md +225 -0
- package/.claude/skills/design-system/references/navigation/navigator.md +111 -0
- package/.claude/skills/design-system/references/navigation/setup.md +134 -0
- package/.claude/skills/design-system/references/navigation/stack.md +128 -0
- package/.claude/skills/design-system/references/spec-convention.md +80 -0
- package/.claude/skills/design-system/references/tokens/colors.md +131 -0
- package/.claude/skills/design-system/references/tokens/spacing-radius.md +144 -0
- package/.claude/skills/design-system/references/tokens/theme.md +125 -0
- package/.claude/skills/design-system/references/tokens/typography.md +135 -0
- package/.claude/skills/design-system-kits/SKILL.md +102 -0
- package/.claude/skills/design-system-kits/references/code-convention.md +118 -0
- package/.claude/skills/design-system-kits/references/components/avatar.md +45 -0
- package/.claude/skills/design-system-kits/references/components/badge.md +27 -0
- package/.claude/skills/design-system-kits/references/components/button.md +65 -0
- package/.claude/skills/design-system-kits/references/components/carousel.md +51 -0
- package/.claude/skills/design-system-kits/references/components/checkbox.md +39 -0
- package/.claude/skills/design-system-kits/references/components/chip.md +54 -0
- package/.claude/skills/design-system-kits/references/components/collapse.md +63 -0
- package/.claude/skills/design-system-kits/references/components/date-picker.md +36 -0
- package/.claude/skills/design-system-kits/references/components/divider.md +21 -0
- package/.claude/skills/design-system-kits/references/components/icon.md +382 -0
- package/.claude/skills/design-system-kits/references/components/image.md +62 -0
- package/.claude/skills/design-system-kits/references/components/information.md +61 -0
- package/.claude/skills/design-system-kits/references/components/input-dropdown.md +92 -0
- package/.claude/skills/design-system-kits/references/components/input-money.md +128 -0
- package/.claude/skills/design-system-kits/references/components/input-otp.md +85 -0
- package/.claude/skills/design-system-kits/references/components/input-phone-number.md +96 -0
- package/.claude/skills/design-system-kits/references/components/input-search.md +127 -0
- package/.claude/skills/design-system-kits/references/components/input-text-area.md +100 -0
- package/.claude/skills/design-system-kits/references/components/input.md +126 -0
- package/.claude/skills/design-system-kits/references/components/loader.md +41 -0
- package/.claude/skills/design-system-kits/references/components/pagination.md +47 -0
- package/.claude/skills/design-system-kits/references/components/popup-notify.md +69 -0
- package/.claude/skills/design-system-kits/references/components/popup-promotion.md +35 -0
- package/.claude/skills/design-system-kits/references/components/progress-info.md +55 -0
- package/.claude/skills/design-system-kits/references/components/radio.md +42 -0
- package/.claude/skills/design-system-kits/references/components/rating.md +36 -0
- package/.claude/skills/design-system-kits/references/components/skeleton.md +25 -0
- package/.claude/skills/design-system-kits/references/components/slider.md +53 -0
- package/.claude/skills/design-system-kits/references/components/snackbar.md +52 -0
- package/.claude/skills/design-system-kits/references/components/stepper.md +46 -0
- package/.claude/skills/design-system-kits/references/components/steps.md +57 -0
- package/.claude/skills/design-system-kits/references/components/suggest-action.md +44 -0
- package/.claude/skills/design-system-kits/references/components/swipe.md +44 -0
- package/.claude/skills/design-system-kits/references/components/switch.md +43 -0
- package/.claude/skills/design-system-kits/references/components/tab-view.md +56 -0
- package/.claude/skills/design-system-kits/references/components/tag.md +50 -0
- package/.claude/skills/design-system-kits/references/components/text.md +56 -0
- package/.claude/skills/design-system-kits/references/components/toast.md +51 -0
- package/.claude/skills/design-system-kits/references/components/tooltip.md +95 -0
- package/.claude/skills/design-system-kits/references/components/uploader.md +48 -0
- package/.claude/skills/design-system-kits/references/design-spec-structure.md +356 -0
- package/.claude/skills/design-system-kits/references/design-spec-to-code.md +596 -0
- package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +155 -0
- package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/modal.md +125 -0
- package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +430 -0
- package/.claude/skills/design-system-kits/references/navigation/navigator.md +177 -0
- package/.claude/skills/design-system-kits/references/navigation/setup.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/stack.md +152 -0
- package/.claude/skills/design-system-kits/references/screen-layout-rule.md +125 -0
- package/.claude/skills/design-system-kits/references/tokens/colors.md +183 -0
- package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +45 -0
- package/.claude/skills/design-system-kits/references/tokens/theme.md +97 -0
- package/.claude/skills/design-system-kits/references/tokens/typography.md +105 -0
- package/.claude/skills/vibe-design/SKILL.md +306 -0
- package/compose/build.gradle.kts +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +5 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +2 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +5 -1
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -0
- package/gradle.properties +1 -1
- package/ios/Popup/PopupPromotion.swift +2 -2
- package/local.properties +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# InputMoney Reference
|
|
2
|
+
|
|
3
|
+
Currency-formatted numeric input with automatic number formatting and currency symbol.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InputMoney } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const moneyRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<InputMoney
|
|
13
|
+
ref={moneyRef}
|
|
14
|
+
value={amount} // current value (numeric string without separators)
|
|
15
|
+
onChangeText={setAmount} // called with raw numeric value on change
|
|
16
|
+
floatingValue="Amount" // floating label text
|
|
17
|
+
floatingIcon="" // optional icon name next to floating label
|
|
18
|
+
floatingIconColor={} // floating icon color
|
|
19
|
+
size="small" // 'small' | 'large' (default: 'small')
|
|
20
|
+
placeholder="0đ" // placeholder text (default: '0đ')
|
|
21
|
+
currency="đ" // currency symbol appended after number (default: 'đ')
|
|
22
|
+
errorMessage="" // error message text
|
|
23
|
+
errorSpacing={false} // reserve space for error even when no error
|
|
24
|
+
hintText="" // hint text below input
|
|
25
|
+
trailing="" // trailing icon name
|
|
26
|
+
trailingColor={} // trailing icon color
|
|
27
|
+
onPressTrailing={() => {}} // trailing icon pressed callback
|
|
28
|
+
required={false} // show required indicator on floating label
|
|
29
|
+
disabled={false} // disable input
|
|
30
|
+
loading={false} // show loading indicator on trailing icon
|
|
31
|
+
showClearIcon={true} // show clear icon when focused and has value
|
|
32
|
+
onFocus={() => {}} // focus callback
|
|
33
|
+
onBlur={() => {}} // blur callback
|
|
34
|
+
onPressFloatingIcon={() => {}} // floating icon pressed callback
|
|
35
|
+
style={{}} // optional custom styles
|
|
36
|
+
params={{}} // auto tracking params
|
|
37
|
+
maxLength={15} // max digit length
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
// Ref methods
|
|
41
|
+
moneyRef.current?.clear(); // clear input
|
|
42
|
+
moneyRef.current?.focus(); // focus input
|
|
43
|
+
moneyRef.current?.blur(); // blur input
|
|
44
|
+
moneyRef.current?.setText('100000'); // set input value programmatically
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Input automatically formats numbers with thousand separators (e.g., `1,000,000đ`). Only accepts numeric input.
|
|
48
|
+
|
|
49
|
+
### Props
|
|
50
|
+
|
|
51
|
+
Extends `InputProps` with money-specific additions.
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Default | Description |
|
|
54
|
+
|------|------|---------|-------------|
|
|
55
|
+
| `value` | `string` | — | Current value (raw numeric string without separators) |
|
|
56
|
+
| `onChangeText` | `(value: string) => void` | — | Callback with raw numeric value on change |
|
|
57
|
+
| `currency` | `string` | `'đ'` | Currency symbol |
|
|
58
|
+
| `size` | `'small' \| 'large'` | `'small'` | Input size variant |
|
|
59
|
+
| `floatingValue` | `string` | — | Floating label text |
|
|
60
|
+
| `floatingIcon` | `string` | — | Icon name next to floating label |
|
|
61
|
+
| `floatingIconColor` | `string` | — | Floating icon color |
|
|
62
|
+
| `placeholder` | `string` | `'0đ'` | Placeholder text |
|
|
63
|
+
| `maxLength` | `number` | — | Max digit length |
|
|
64
|
+
| `trailing` | `string` | — | Trailing icon name |
|
|
65
|
+
| `trailingColor` | `string` | — | Trailing icon color |
|
|
66
|
+
| `onPressTrailing` | `() => void` | — | Trailing icon press handler |
|
|
67
|
+
| `errorMessage` | `string` | — | Error message |
|
|
68
|
+
| `errorSpacing` | `boolean` | `false` | Reserve space for error |
|
|
69
|
+
| `hintText` | `string` | — | Hint text |
|
|
70
|
+
| `required` | `boolean` | `false` | Show required indicator |
|
|
71
|
+
| `disabled` | `boolean` | `false` | Disable input |
|
|
72
|
+
| `loading` | `boolean` | `false` | Show loading indicator |
|
|
73
|
+
| `showClearIcon` | `boolean` | `true` | Show clear icon |
|
|
74
|
+
| `onFocus` | `() => void` | — | Focus callback |
|
|
75
|
+
| `onBlur` | `() => void` | — | Blur callback |
|
|
76
|
+
| `onPressFloatingIcon` | `() => void` | — | Floating icon press handler |
|
|
77
|
+
| `style` | `StyleProp<ViewStyle>` | — | Custom styles |
|
|
78
|
+
| `params` | `any` | — | Auto tracking params |
|
|
79
|
+
|
|
80
|
+
## Compose
|
|
81
|
+
|
|
82
|
+
```kotlin
|
|
83
|
+
import vn.momo.kits.components.InputMoney
|
|
84
|
+
import vn.momo.kits.components.InputSize
|
|
85
|
+
import vn.momo.kits.components.InputFontWeight
|
|
86
|
+
import androidx.compose.runtime.MutableState
|
|
87
|
+
|
|
88
|
+
val amount = remember { mutableStateOf("0") }
|
|
89
|
+
|
|
90
|
+
InputMoney(
|
|
91
|
+
text = amount, // MutableState<String> holding raw numeric value
|
|
92
|
+
floatingValue = "Amount", // floating label text (default: "")
|
|
93
|
+
floatingValueColor = Color.Unspecified, // floating label color (default: theme hint)
|
|
94
|
+
floatingIcon = "", // optional icon name next to floating label
|
|
95
|
+
floatingIconColor = Color.Unspecified, // floating icon color (default: theme default)
|
|
96
|
+
placeholder = "0đ", // placeholder text (default: "0đ")
|
|
97
|
+
size = InputSize.SMALL, // SMALL | LARGE (default: SMALL)
|
|
98
|
+
onChangeText = { value -> }, // called with raw numeric value on change
|
|
99
|
+
error = "", // error message text
|
|
100
|
+
errorSpacing = false, // reserve space for error even when no error
|
|
101
|
+
disabled = false, // disable input
|
|
102
|
+
icon = "", // trailing icon name
|
|
103
|
+
iconColor = Color.Unspecified, // trailing icon color
|
|
104
|
+
onPressIcon = {}, // trailing icon pressed callback
|
|
105
|
+
leadingIcon = "", // leading icon name (left side)
|
|
106
|
+
leadingIconColor = Color.Unspecified, // leading icon color
|
|
107
|
+
onFocus = {}, // focus callback
|
|
108
|
+
onBlur = {}, // blur callback
|
|
109
|
+
loading = false, // show loading indicator on trailing icon
|
|
110
|
+
required = false, // show required indicator on floating label
|
|
111
|
+
fontWeight = InputFontWeight.BOLD, // REGULAR | BOLD (default: BOLD)
|
|
112
|
+
keyboardType = KeyboardType.Number, // Compose KeyboardType
|
|
113
|
+
)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Key Differences
|
|
117
|
+
|
|
118
|
+
| Feature | React Native | Compose |
|
|
119
|
+
|---------|-------------|---------|
|
|
120
|
+
| Value binding | `value` + `onChangeText` | `MutableState<String>` via `text` param |
|
|
121
|
+
| Error prop | `errorMessage` | `error` |
|
|
122
|
+
| Size type | String (`'small' \| 'large'`) | Enum (`InputSize.SMALL \| LARGE`) |
|
|
123
|
+
| Font weight | `fontWeight` (string) | `InputFontWeight` enum |
|
|
124
|
+
| Imperative ref | `clear`, `focus`, `blur`, `setText` | Not available |
|
|
125
|
+
| Leading icon | Via `leadingIcon` prop | Via `leadingIcon` param |
|
|
126
|
+
| Max length | `maxLength` prop | Not available |
|
|
127
|
+
| Currency customization | `currency` prop | Not available (hardcoded `đ` via visual transformation) |
|
|
128
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# InputOTP Reference
|
|
2
|
+
|
|
3
|
+
One-Time Password input with individual character boxes and animated caret.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InputOTP } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const otpRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<InputOTP
|
|
13
|
+
ref={otpRef}
|
|
14
|
+
length={6}
|
|
15
|
+
floatingValue="Enter OTP"
|
|
16
|
+
value={otp}
|
|
17
|
+
onChangeText={value => {
|
|
18
|
+
setOtp(value);
|
|
19
|
+
if (value.length === 6) {
|
|
20
|
+
verifyOTP(value);
|
|
21
|
+
}
|
|
22
|
+
}}
|
|
23
|
+
dataType="number"
|
|
24
|
+
placeholder=""
|
|
25
|
+
errorMessage=""
|
|
26
|
+
hintText="Check your SMS for the code"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
// Ref methods
|
|
30
|
+
otpRef.current?.focus();
|
|
31
|
+
otpRef.current?.blur();
|
|
32
|
+
otpRef.current?.setText('123456');
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Props
|
|
36
|
+
|
|
37
|
+
Extends `InputProps` without `size`, `icon`, `iconColor`.
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Default | Description |
|
|
40
|
+
|------|------|---------|-------------|
|
|
41
|
+
| `length` | `2 \| 4 \| 6 \| 8 \| 10` | `6` | Number of OTP digits |
|
|
42
|
+
| `floatingValue` | `string` | **required** | Floating label text |
|
|
43
|
+
| `dataType` | `'string' \| 'number'` | `'number'` | Input data type |
|
|
44
|
+
| `value` | `string` | — | Controlled value |
|
|
45
|
+
| `onChangeText` | `(text: string) => void` | — | Text change handler |
|
|
46
|
+
| `placeholder` | `string` | — | Placeholder character |
|
|
47
|
+
| `errorMessage` | `string` | — | Error message below input |
|
|
48
|
+
| `errorSpacing` | `boolean` | `false` | Reserve space for error |
|
|
49
|
+
| `hintText` | `string` | — | Hint text below input |
|
|
50
|
+
| `params` | `any` | — | Auto tracking params |
|
|
51
|
+
| `onFocus` | `(e: TextInputFocusEvent) => void` | — | Focus handler |
|
|
52
|
+
| `onBlur` | `(e: TextInputFocusEvent) => void` | — | Blur handler |
|
|
53
|
+
| `style` | `ViewStyle` | — | Container style |
|
|
54
|
+
|
|
55
|
+
## Compose
|
|
56
|
+
|
|
57
|
+
```kotlin
|
|
58
|
+
import vn.momo.kits.components.InputOTP
|
|
59
|
+
|
|
60
|
+
InputOTP(
|
|
61
|
+
value = otpValue,
|
|
62
|
+
length = 6,
|
|
63
|
+
floatingValue = "Enter OTP",
|
|
64
|
+
placeholder = "",
|
|
65
|
+
errorMessage = "",
|
|
66
|
+
errorSpacing = false,
|
|
67
|
+
hintText = "Check your SMS for the code",
|
|
68
|
+
dataType = "number",
|
|
69
|
+
onChangeText = { value ->
|
|
70
|
+
otpValue = value
|
|
71
|
+
if (value.length == 6) {
|
|
72
|
+
// handle verification
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
onFocus = { /* focus handler */ },
|
|
76
|
+
onBlur = { /* blur handler */ },
|
|
77
|
+
modifier = Modifier,
|
|
78
|
+
)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Key Differences
|
|
82
|
+
|
|
83
|
+
| Feature | React Native | Compose |
|
|
84
|
+
|---------|-------------|---------|
|
|
85
|
+
| `ref` for imperative methods (`focus`, `blur`, `setText`) | Supported | Not available |
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# InputPhoneNumber Reference
|
|
2
|
+
|
|
3
|
+
Phone number input with +84 country code prefix and number formatting.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InputPhoneNumber } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const phoneRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<InputPhoneNumber
|
|
13
|
+
ref={phoneRef}
|
|
14
|
+
size="small"
|
|
15
|
+
value={phone}
|
|
16
|
+
onChangeText={setPhone}
|
|
17
|
+
placeholder="0123456789"
|
|
18
|
+
trailing="24_check_circle"
|
|
19
|
+
trailingColor={theme.colors.success.primary}
|
|
20
|
+
onPressTrailing={() => {}}
|
|
21
|
+
errorMessage=""
|
|
22
|
+
hintText=""
|
|
23
|
+
disabled={false}
|
|
24
|
+
loading={false}
|
|
25
|
+
showClearIcon={true}
|
|
26
|
+
editable={true}
|
|
27
|
+
secureTextEntry={false}
|
|
28
|
+
keyboardType="number-pad"
|
|
29
|
+
params={{}}
|
|
30
|
+
accessibilityLabel="phone_input"
|
|
31
|
+
/>
|
|
32
|
+
|
|
33
|
+
// Ref methods
|
|
34
|
+
phoneRef.current?.clear();
|
|
35
|
+
phoneRef.current?.focus();
|
|
36
|
+
phoneRef.current?.blur();
|
|
37
|
+
phoneRef.current?.setText('0901234567');
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Props
|
|
41
|
+
|
|
42
|
+
Extends `InputProps` with phone-specific defaults.
|
|
43
|
+
|
|
44
|
+
| Prop | Type | Default | Description |
|
|
45
|
+
|------|------|---------|-------------|
|
|
46
|
+
| `size` | `'small' \| 'large'` | `'small'` | Input size variant |
|
|
47
|
+
| `placeholder` | `string` | `'0123456789'` | Placeholder text |
|
|
48
|
+
| `keyboardType` | `string` | `'number-pad'` | Keyboard type |
|
|
49
|
+
| `trailing` | `string` | — | Trailing icon name |
|
|
50
|
+
| `trailingColor` | `string` | — | Trailing icon color |
|
|
51
|
+
| `onPressTrailing` | `() => void` | — | Trailing icon press handler |
|
|
52
|
+
| `errorMessage` | `string` | — | Error message |
|
|
53
|
+
| `errorSpacing` | `boolean` | `false` | Reserve space for error |
|
|
54
|
+
| `hintText` | `string` | — | Hint text |
|
|
55
|
+
| `disabled` | `boolean` | `false` | Disable input |
|
|
56
|
+
| `loading` | `boolean` | `false` | Show loading indicator on trailing |
|
|
57
|
+
| `showClearIcon` | `boolean` | `true` | Show clear icon when focused |
|
|
58
|
+
| `editable` | `boolean` | `true` | Allow text editing |
|
|
59
|
+
| `secureTextEntry` | `boolean` | `false` | Mask input text |
|
|
60
|
+
| `params` | `any` | — | Auto tracking params |
|
|
61
|
+
| `accessibilityLabel` | `string` | — | Accessibility label |
|
|
62
|
+
| `defaultValue` | `string` | — | Initial value (uncontrolled) |
|
|
63
|
+
|
|
64
|
+
### Utility
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { checkValidPhoneNumber } from '@momo-kits/foundation';
|
|
68
|
+
|
|
69
|
+
const isValid = checkValidPhoneNumber('0901234567'); // true
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Compose
|
|
73
|
+
|
|
74
|
+
```kotlin
|
|
75
|
+
import vn.momo.kits.components.InputPhoneNumber
|
|
76
|
+
import vn.momo.kits.components.InputPhoneNumberSize
|
|
77
|
+
|
|
78
|
+
val phone = remember { mutableStateOf("") }
|
|
79
|
+
|
|
80
|
+
InputPhoneNumber(
|
|
81
|
+
text = phone,
|
|
82
|
+
onChangeText = { phone.value = it },
|
|
83
|
+
placeholder = "0123456789",
|
|
84
|
+
size = InputPhoneNumberSize.SMALL, // InputPhoneNumberSize.SMALL | LARGE; default: SMALL
|
|
85
|
+
hintText = "",
|
|
86
|
+
error = "", // error message; default: ""
|
|
87
|
+
errorSpacing = false,
|
|
88
|
+
icon = "", // trailing icon name
|
|
89
|
+
iconColor = AppTheme.current.colors.text.default,
|
|
90
|
+
onRightIconPressed = { },
|
|
91
|
+
onFocus = { },
|
|
92
|
+
onBlur = { },
|
|
93
|
+
loading = false,
|
|
94
|
+
inputModifier = Modifier,
|
|
95
|
+
)
|
|
96
|
+
```
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# InputSearch Reference
|
|
2
|
+
|
|
3
|
+
Search bar input with cancel button, clear icon, and typing animation support.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InputSearch } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const searchRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<InputSearch
|
|
13
|
+
ref={searchRef}
|
|
14
|
+
placeholder="Search..."
|
|
15
|
+
value={query}
|
|
16
|
+
onChangeText={setQuery}
|
|
17
|
+
defaultValue="initial query" // uncontrolled default value
|
|
18
|
+
buttonText="Cancel"
|
|
19
|
+
showButtonText={true}
|
|
20
|
+
onPressButtonText={() => navigation.goBack()}
|
|
21
|
+
trailing="24_qr_code"
|
|
22
|
+
trailingColor={theme.colors.primary}
|
|
23
|
+
onPressTrailing={() => openScanner()}
|
|
24
|
+
backgroundColor={theme.colors.background.surface}
|
|
25
|
+
onFocus={() => {}}
|
|
26
|
+
onBlur={() => {}}
|
|
27
|
+
style={{}}
|
|
28
|
+
params={{ action: 'search' }}
|
|
29
|
+
/>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### With Typing Animation
|
|
33
|
+
|
|
34
|
+
When `typingData` is provided, the input becomes non-editable and shows an animated typing effect. Tap triggers `onPress`.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<InputSearch
|
|
38
|
+
typingData={['Search for food...', 'Search for drinks...', 'Search for deals...']}
|
|
39
|
+
onPress={() => navigateToFullSearch()}
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Props
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
|------|------|---------|-------------|
|
|
47
|
+
| `placeholder` | `string` | — | Placeholder text |
|
|
48
|
+
| `value` | `string` | — | Controlled value |
|
|
49
|
+
| `onChangeText` | `(text: string) => void` | — | Text change handler |
|
|
50
|
+
| `defaultValue` | `string` | — | Uncontrolled default value |
|
|
51
|
+
| `buttonText` | `string` | `'Hủy'` | Cancel button text |
|
|
52
|
+
| `showButtonText` | `boolean` | `true` | Show/hide cancel button |
|
|
53
|
+
| `onPressButtonText` | `() => void` | — | Cancel button press handler |
|
|
54
|
+
| `trailing` | `string` | — | Trailing icon name |
|
|
55
|
+
| `trailingColor` | `string` | — | Trailing icon color |
|
|
56
|
+
| `onPressTrailing` | `() => void` | — | Trailing icon press handler |
|
|
57
|
+
| `backgroundColor` | `string` | `theme.colors.background.surface` | Background color |
|
|
58
|
+
| `typingData` | `string[]` | — | Array of strings for typing animation |
|
|
59
|
+
| `onPress` | `(e) => void` | — | Press handler (used with typingData) |
|
|
60
|
+
| `onFocus` | `(e) => void` | — | Focus handler |
|
|
61
|
+
| `onBlur` | `(e) => void` | — | Blur handler |
|
|
62
|
+
| `style` | `StyleProp<ViewStyle>` | — | Custom styles |
|
|
63
|
+
| `params` | `any` | — | Auto tracking params |
|
|
64
|
+
|
|
65
|
+
### Ref Methods
|
|
66
|
+
|
|
67
|
+
```tsx
|
|
68
|
+
searchRef.current?.clear();
|
|
69
|
+
searchRef.current?.focus();
|
|
70
|
+
searchRef.current?.blur();
|
|
71
|
+
searchRef.current?.setText('new text');
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Compose
|
|
75
|
+
|
|
76
|
+
```kotlin
|
|
77
|
+
import vn.momo.kits.components.InputSearch
|
|
78
|
+
import vn.momo.kits.components.InputSearchProps
|
|
79
|
+
import vn.momo.kits.components.InputFontWeight
|
|
80
|
+
import androidx.compose.runtime.MutableState
|
|
81
|
+
|
|
82
|
+
val text = remember { mutableStateOf("") }
|
|
83
|
+
|
|
84
|
+
InputSearch(
|
|
85
|
+
inputSearchProps = InputSearchProps(
|
|
86
|
+
text = text, // MutableState<String> holding the text value
|
|
87
|
+
placeholder = "Search...", // placeholder text (default: "")
|
|
88
|
+
onChangeText = { value -> }, // called when text changes
|
|
89
|
+
buttonText = "Cancel", // cancel button text (default: "")
|
|
90
|
+
showButtonText = false, // show/hide cancel button (default: false)
|
|
91
|
+
onPressButtonText = {}, // cancel button pressed callback
|
|
92
|
+
disabled = false, // disable input (default: false)
|
|
93
|
+
icon = "", // trailing icon name (right side)
|
|
94
|
+
iconColor = Color.Unspecified, // trailing icon color (default: Color.Unspecified)
|
|
95
|
+
onRightIconPressed = {}, // trailing icon pressed callback
|
|
96
|
+
onFocus = {}, // focus callback
|
|
97
|
+
onBlur = {}, // blur callback
|
|
98
|
+
loading = false, // show loading indicator on trailing icon
|
|
99
|
+
fontWeight = InputFontWeight.REGULAR, // REGULAR | BOLD (default: REGULAR)
|
|
100
|
+
keyboardType = KeyboardType.Text, // Compose KeyboardType (default: Text)
|
|
101
|
+
backgroundColor = Color.Black, // background color (default: Colors.black_01)
|
|
102
|
+
clearCondition = { true }, // custom condition to show clear icon
|
|
103
|
+
onClearPress = {}, // called when clear icon is pressed
|
|
104
|
+
keyboardOptions = KeyboardOptions.Default, // Compose KeyboardOptions
|
|
105
|
+
keyboardActions = KeyboardActions.Default, // Compose KeyboardActions
|
|
106
|
+
modifier = Modifier, // optional modifier
|
|
107
|
+
iconModifier = Modifier, // modifier for trailing icon
|
|
108
|
+
leftPosition = null, // custom left position (Dp?)
|
|
109
|
+
),
|
|
110
|
+
)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
> **Note:** Compose `InputSearch` does **not** support `typingData` (animated typing) or `defaultValue` — these are RN-only.
|
|
114
|
+
|
|
115
|
+
## Key Differences
|
|
116
|
+
|
|
117
|
+
| Feature | React Native | Compose |
|
|
118
|
+
|---------|-------------|---------|
|
|
119
|
+
| Value binding | `value` + `onChangeText` | `MutableState<String>` via `InputSearchProps.text` |
|
|
120
|
+
| Trailing icon | `trailing` + `trailingColor` + `onPressTrailing` | `icon` + `iconColor` + `onRightIconPressed` |
|
|
121
|
+
| Button visibility | `showButtonText` default `true` | `showButtonText` default `false` |
|
|
122
|
+
| Imperative ref | `clear`, `focus`, `blur`, `setText` | Not available |
|
|
123
|
+
| Font weight | Via `style` | `InputFontWeight` enum |
|
|
124
|
+
| Clear icon | Auto-shown when focused and has value | Via `clearCondition` callback |
|
|
125
|
+
| Modifier | `style` prop | `modifier` + `iconModifier` |
|
|
126
|
+
| Typing animation | Supported via `typingData` | Not available |
|
|
127
|
+
| Default value | `defaultValue` prop (uncontrolled) | Not available |
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# InputTextArea Reference
|
|
2
|
+
|
|
3
|
+
Multi-line text input with character counting and max length.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { InputTextArea } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const textAreaRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<InputTextArea
|
|
13
|
+
ref={textAreaRef}
|
|
14
|
+
floatingValue="Description"
|
|
15
|
+
floatingIcon="info_small"
|
|
16
|
+
floatingIconColor={theme.colors.text.hint}
|
|
17
|
+
value={text}
|
|
18
|
+
onChangeText={setText}
|
|
19
|
+
placeholder="Enter description..."
|
|
20
|
+
height={120}
|
|
21
|
+
maxLength={500}
|
|
22
|
+
errorMessage=""
|
|
23
|
+
hintText="Max 500 characters"
|
|
24
|
+
required={false}
|
|
25
|
+
disabled={false}
|
|
26
|
+
onFocus={(e) => {}}
|
|
27
|
+
onBlur={(e) => {}}
|
|
28
|
+
defaultValue=""
|
|
29
|
+
style={{}}
|
|
30
|
+
accessibilityLabel="description_input"
|
|
31
|
+
params={{ field: 'description' }}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
// Ref methods
|
|
35
|
+
textAreaRef.current?.clear();
|
|
36
|
+
textAreaRef.current?.focus();
|
|
37
|
+
textAreaRef.current?.blur();
|
|
38
|
+
textAreaRef.current?.setText('new text');
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Props
|
|
42
|
+
|
|
43
|
+
Extends `InputProps` (same as Input) but **without `size`**.
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
|------|------|---------|-------------|
|
|
47
|
+
| `height` | `number` | — | Custom height for the text area |
|
|
48
|
+
| `maxLength` | `number` | `300` | Character limit (shows counter) |
|
|
49
|
+
| `floatingValue` | `string` | — | Floating label text |
|
|
50
|
+
| `floatingIcon` | `string` | — | Icon shown beside floating label |
|
|
51
|
+
| `floatingIconColor` | `string` | — | Color of floating icon |
|
|
52
|
+
| `errorMessage` | `string` | — | Error message below input |
|
|
53
|
+
| `errorSpacing` | `boolean` | `false` | Reserve space for error |
|
|
54
|
+
| `hintText` | `string` | — | Hint text below input |
|
|
55
|
+
| `required` | `boolean` | `false` | Show required indicator |
|
|
56
|
+
| `disabled` | `boolean` | `false` | Disable input |
|
|
57
|
+
| `onFocus` | `(e) => void` | — | Focus event handler |
|
|
58
|
+
| `onBlur` | `(e) => void` | — | Blur event handler |
|
|
59
|
+
| `placeholder` | `string` | — | Placeholder text |
|
|
60
|
+
| `defaultValue` | `string` | — | Initial value (uncontrolled) |
|
|
61
|
+
| `style` | `ViewStyle` | — | Custom wrapper style |
|
|
62
|
+
| `params` | `any` | — | Auto tracking params |
|
|
63
|
+
| `accessibilityLabel` | `string` | — | Accessibility label |
|
|
64
|
+
|
|
65
|
+
## Compose
|
|
66
|
+
|
|
67
|
+
```kotlin
|
|
68
|
+
import vn.momo.kits.components.InputTextArea
|
|
69
|
+
import vn.momo.kits.components.InputSize
|
|
70
|
+
import vn.momo.kits.components.InputFontWeight
|
|
71
|
+
|
|
72
|
+
val text = remember { mutableStateOf("") }
|
|
73
|
+
|
|
74
|
+
InputTextArea(
|
|
75
|
+
text = text,
|
|
76
|
+
floatingValue = "Description",
|
|
77
|
+
floatingIcon = "",
|
|
78
|
+
floatingIconColor = AppTheme.current.colors.text.default,
|
|
79
|
+
placeholder = "Enter description...",
|
|
80
|
+
height = 104.dp,
|
|
81
|
+
maxLength = 300,
|
|
82
|
+
size = InputSize.SMALL,
|
|
83
|
+
onChangeText = { },
|
|
84
|
+
error = "",
|
|
85
|
+
errorSpacing = false,
|
|
86
|
+
required = false,
|
|
87
|
+
disabled = false,
|
|
88
|
+
loading = false,
|
|
89
|
+
icon = "",
|
|
90
|
+
iconColor = AppTheme.current.colors.text.default,
|
|
91
|
+
onRightIconPressed = { },
|
|
92
|
+
onFocus = { },
|
|
93
|
+
onBlur = { },
|
|
94
|
+
fontWeight = InputFontWeight.REGULAR,
|
|
95
|
+
keyboardType = KeyboardType.Text,
|
|
96
|
+
modifier = Modifier,
|
|
97
|
+
)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
> **Note:** Compose uses `MutableState<String>` for `text` and `error` (String, not `errorMessage`). Height defaults to `104.dp`. Max character count and clear icon are shown automatically when focused.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Input Reference
|
|
2
|
+
|
|
3
|
+
Base text input with floating label, leading/trailing icons, and validation.
|
|
4
|
+
|
|
5
|
+
## React Native
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Input } from '@momo-kits/foundation';
|
|
9
|
+
|
|
10
|
+
const inputRef = useRef<InputRef>(null);
|
|
11
|
+
|
|
12
|
+
<Input
|
|
13
|
+
ref={inputRef}
|
|
14
|
+
size="large"
|
|
15
|
+
floatingValue="Email"
|
|
16
|
+
value={text}
|
|
17
|
+
onChangeText={setText}
|
|
18
|
+
placeholder="Enter email"
|
|
19
|
+
leadingIcon="24_mail"
|
|
20
|
+
leadingIconColor={theme.colors.text.hint}
|
|
21
|
+
onPressLeadingIcon={() => {}}
|
|
22
|
+
trailing="24_check_circle"
|
|
23
|
+
trailingColor={theme.colors.success.primary}
|
|
24
|
+
onPressTrailing={() => {}}
|
|
25
|
+
errorMessage="Invalid email"
|
|
26
|
+
errorSpacing={true}
|
|
27
|
+
hintText="We'll never share your email"
|
|
28
|
+
required={true}
|
|
29
|
+
disabled={false}
|
|
30
|
+
loading={false}
|
|
31
|
+
showClearIcon={true}
|
|
32
|
+
secureTextEntry={false}
|
|
33
|
+
keyboardType="email-address"
|
|
34
|
+
accessibilityLabel="email_input"
|
|
35
|
+
params={{ field: 'email' }}
|
|
36
|
+
/>
|
|
37
|
+
|
|
38
|
+
// Ref methods
|
|
39
|
+
inputRef.current?.clear();
|
|
40
|
+
inputRef.current?.focus();
|
|
41
|
+
inputRef.current?.blur();
|
|
42
|
+
inputRef.current?.setText('new text');
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Props
|
|
46
|
+
|
|
47
|
+
Extends `TextInputProps` — supports `value`, `onChangeText`, `placeholder`, `defaultValue`, `editable`, `secureTextEntry`, `keyboardType`, etc.
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
|------|------|---------|-------------|
|
|
51
|
+
| `size` | `'small' \| 'large'` | `'small'` | Input size variant |
|
|
52
|
+
| `floatingValue` | `string` | — | Floating label text |
|
|
53
|
+
| `floatingIcon` | `string` | — | Icon next to floating label |
|
|
54
|
+
| `floatingIconColor` | `string` | — | Color of floating icon |
|
|
55
|
+
| `onPressFloatingIcon` | `() => void` | — | Floating icon press handler |
|
|
56
|
+
| `leadingIcon` | `string` | — | Leading icon name |
|
|
57
|
+
| `leadingIconColor` | `string` | — | Leading icon color |
|
|
58
|
+
| `onPressLeadingIcon` | `() => void` | — | Leading icon press handler |
|
|
59
|
+
| `trailing` | `string` | — | Trailing icon name |
|
|
60
|
+
| `trailingColor` | `string` | — | Trailing icon color |
|
|
61
|
+
| `onPressTrailing` | `() => void` | — | Trailing icon press handler |
|
|
62
|
+
| `errorMessage` | `string` | — | Error message below input |
|
|
63
|
+
| `errorSpacing` | `boolean` | `false` | Reserve space for error when empty |
|
|
64
|
+
| `hintText` | `string` | — | Hint text below input |
|
|
65
|
+
| `required` | `boolean` | `false` | Show required indicator |
|
|
66
|
+
| `disabled` | `boolean` | `false` | Disable input |
|
|
67
|
+
| `loading` | `boolean` | `false` | Show loading indicator |
|
|
68
|
+
| `showClearIcon` | `boolean` | `true` | Show clear text icon |
|
|
69
|
+
| `params` | `any` | — | Auto tracking params |
|
|
70
|
+
|
|
71
|
+
## Compose
|
|
72
|
+
|
|
73
|
+
```kotlin
|
|
74
|
+
import vn.momo.kits.components.Input
|
|
75
|
+
import vn.momo.kits.components.InputSize
|
|
76
|
+
import vn.momo.kits.components.InputFontWeight
|
|
77
|
+
import androidx.compose.runtime.MutableState
|
|
78
|
+
|
|
79
|
+
val text = remember { mutableStateOf("") }
|
|
80
|
+
|
|
81
|
+
Input(
|
|
82
|
+
text = text, // MutableState<String> holding the text value
|
|
83
|
+
floatingValue = "Email", // floating label text (default: "")
|
|
84
|
+
floatingValueColor = Color.Unspecified, // floating label color (default: theme hint)
|
|
85
|
+
floatingIcon = "", // icon next to floating label
|
|
86
|
+
floatingIconColor = Color.Unspecified, // floating icon color (default: theme default)
|
|
87
|
+
placeholder = "", // placeholder text (default: "")
|
|
88
|
+
size = InputSize.SMALL, // SMALL | LARGE (default: SMALL)
|
|
89
|
+
onChangeText = { value -> }, // called when text changes
|
|
90
|
+
hintText = "", // hint text below input
|
|
91
|
+
error = "", // error message text (note: not errorMessage)
|
|
92
|
+
errorSpacing = false, // reserve space for error when empty
|
|
93
|
+
disabled = false, // disable input
|
|
94
|
+
readOnly = false, // make input read-only
|
|
95
|
+
secureTextEntry = false, // hide text (password mode)
|
|
96
|
+
icon = "", // trailing icon name
|
|
97
|
+
iconColor = Color.Unspecified, // trailing icon color
|
|
98
|
+
onRightIconPressed = {}, // trailing icon pressed callback
|
|
99
|
+
leadingIcon = "", // leading icon name (left side)
|
|
100
|
+
leadingIconColor = Color.Unspecified, // leading icon color
|
|
101
|
+
onFocus = {}, // focus callback
|
|
102
|
+
onBlur = {}, // blur callback
|
|
103
|
+
loading = false, // show loading indicator on trailing icon
|
|
104
|
+
required = false, // show required indicator on floating label
|
|
105
|
+
fontWeight = InputFontWeight.REGULAR, // REGULAR | BOLD (default: REGULAR)
|
|
106
|
+
keyboardType = KeyboardType.Text, // Compose KeyboardType (default: Text)
|
|
107
|
+
modifier = Modifier, // optional modifier
|
|
108
|
+
inputModifier = Modifier, // modifier for the input field itself
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
> **Note:** Compose `Input` uses `MutableState<String>` for `text` (controlled). The `error` param is `String` (not `errorMessage`). The trailing icon doubles as a password visibility toggle when `secureTextEntry` is enabled.
|
|
113
|
+
|
|
114
|
+
## Key Differences
|
|
115
|
+
|
|
116
|
+
| Feature | React Native | Compose |
|
|
117
|
+
|---------|-------------|---------|
|
|
118
|
+
| Value binding | `value` + `onChangeText` | `MutableState<String>` via `text` param |
|
|
119
|
+
| Error prop | `errorMessage` | `error` |
|
|
120
|
+
| Size type | String (`'small' \| 'large'`) | Enum (`InputSize.SMALL \| LARGE`) |
|
|
121
|
+
| Font weight | `fontWeight` (string) | `InputFontWeight` enum |
|
|
122
|
+
| Floating label color | Via `floatingIconColor` only | Via `floatingValueColor` + `floatingIconColor` |
|
|
123
|
+
| Trailing icon | `trailing` + `trailingColor` + `onPressTrailing` | `icon` + `iconColor` + `onRightIconPressed` |
|
|
124
|
+
| Password toggle | Native `secureTextEntry` | Auto-handled (icon doubles as visibility toggle) |
|
|
125
|
+
| Imperative ref | `clear`, `focus`, `blur`, `setText` | Not available |
|
|
126
|
+
| Modifier | `style` prop | `modifier` + `inputModifier` |
|