@momo-kits/native-kits 0.158.1-beta.1-debug → 0.158.1-beta.2-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/compose/build.gradle.kts +1 -1
  2. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +15 -1
  3. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +15 -1
  4. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +1 -0
  5. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +4 -1
  6. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +11 -9
  7. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +56 -1
  8. package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +167 -0
  9. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +32 -0
  10. package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  11. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  12. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +16 -0
  13. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +6 -0
  14. package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
  15. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
  16. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
  17. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
  18. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
  19. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
  20. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +58 -0
  21. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +58 -0
  22. package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +60 -0
  23. package/gradle.properties +1 -1
  24. package/local.properties +2 -2
  25. package/package.json +1 -1
  26. package/.claude/settings.local.json +0 -11
  27. package/.claude/skills/design-system/SKILL.md +0 -88
  28. package/.claude/skills/design-system/references/components/avatar.md +0 -134
  29. package/.claude/skills/design-system/references/components/badge.md +0 -127
  30. package/.claude/skills/design-system/references/components/bottom-tab.md +0 -177
  31. package/.claude/skills/design-system/references/components/bottomsheet.md +0 -170
  32. package/.claude/skills/design-system/references/components/button.md +0 -206
  33. package/.claude/skills/design-system/references/components/carousel.md +0 -117
  34. package/.claude/skills/design-system/references/components/checkbox.md +0 -98
  35. package/.claude/skills/design-system/references/components/chip.md +0 -146
  36. package/.claude/skills/design-system/references/components/collapse.md +0 -120
  37. package/.claude/skills/design-system/references/components/date-picker.md +0 -119
  38. package/.claude/skills/design-system/references/components/divider.md +0 -84
  39. package/.claude/skills/design-system/references/components/icon.md +0 -130
  40. package/.claude/skills/design-system/references/components/image.md +0 -81
  41. package/.claude/skills/design-system/references/components/information.md +0 -107
  42. package/.claude/skills/design-system/references/components/input-dropdown.md +0 -138
  43. package/.claude/skills/design-system/references/components/input-money.md +0 -157
  44. package/.claude/skills/design-system/references/components/input-otp.md +0 -132
  45. package/.claude/skills/design-system/references/components/input-phone-number.md +0 -140
  46. package/.claude/skills/design-system/references/components/input-search.md +0 -124
  47. package/.claude/skills/design-system/references/components/input-text-area.md +0 -133
  48. package/.claude/skills/design-system/references/components/input.md +0 -152
  49. package/.claude/skills/design-system/references/components/loader.md +0 -87
  50. package/.claude/skills/design-system/references/components/pagination.md +0 -105
  51. package/.claude/skills/design-system/references/components/popup-notify.md +0 -128
  52. package/.claude/skills/design-system/references/components/progress-info.md +0 -114
  53. package/.claude/skills/design-system/references/components/radio.md +0 -86
  54. package/.claude/skills/design-system/references/components/rating.md +0 -126
  55. package/.claude/skills/design-system/references/components/skeleton.md +0 -120
  56. package/.claude/skills/design-system/references/components/slider.md +0 -141
  57. package/.claude/skills/design-system/references/components/snackbar.md +0 -97
  58. package/.claude/skills/design-system/references/components/stepper.md +0 -100
  59. package/.claude/skills/design-system/references/components/steps.md +0 -91
  60. package/.claude/skills/design-system/references/components/suggest-action.md +0 -95
  61. package/.claude/skills/design-system/references/components/swipe.md +0 -121
  62. package/.claude/skills/design-system/references/components/switch.md +0 -98
  63. package/.claude/skills/design-system/references/components/tab-view.md +0 -120
  64. package/.claude/skills/design-system/references/components/tag.md +0 -118
  65. package/.claude/skills/design-system/references/components/text.md +0 -151
  66. package/.claude/skills/design-system/references/components/toast.md +0 -99
  67. package/.claude/skills/design-system/references/components/tooltip.md +0 -138
  68. package/.claude/skills/design-system/references/components/top-nav-miniapp.md +0 -94
  69. package/.claude/skills/design-system/references/components/top-nav.md +0 -226
  70. package/.claude/skills/design-system/references/components/uploader.md +0 -115
  71. package/.claude/skills/design-system/references/navigation/bottom-tab.md +0 -131
  72. package/.claude/skills/design-system/references/navigation/bottomsheet.md +0 -161
  73. package/.claude/skills/design-system/references/navigation/modal.md +0 -133
  74. package/.claude/skills/design-system/references/navigation/navigation-options.md +0 -225
  75. package/.claude/skills/design-system/references/navigation/navigator.md +0 -111
  76. package/.claude/skills/design-system/references/navigation/setup.md +0 -134
  77. package/.claude/skills/design-system/references/navigation/stack.md +0 -128
  78. package/.claude/skills/design-system/references/spec-convention.md +0 -80
  79. package/.claude/skills/design-system/references/tokens/colors.md +0 -131
  80. package/.claude/skills/design-system/references/tokens/spacing-radius.md +0 -144
  81. package/.claude/skills/design-system/references/tokens/theme.md +0 -125
  82. package/.claude/skills/design-system/references/tokens/typography.md +0 -135
  83. package/.claude/skills/design-system-kits/SKILL.md +0 -102
  84. package/.claude/skills/design-system-kits/references/code-convention.md +0 -118
  85. package/.claude/skills/design-system-kits/references/components/avatar.md +0 -45
  86. package/.claude/skills/design-system-kits/references/components/badge.md +0 -27
  87. package/.claude/skills/design-system-kits/references/components/button.md +0 -65
  88. package/.claude/skills/design-system-kits/references/components/carousel.md +0 -51
  89. package/.claude/skills/design-system-kits/references/components/checkbox.md +0 -39
  90. package/.claude/skills/design-system-kits/references/components/chip.md +0 -54
  91. package/.claude/skills/design-system-kits/references/components/collapse.md +0 -63
  92. package/.claude/skills/design-system-kits/references/components/date-picker.md +0 -36
  93. package/.claude/skills/design-system-kits/references/components/divider.md +0 -21
  94. package/.claude/skills/design-system-kits/references/components/icon.md +0 -382
  95. package/.claude/skills/design-system-kits/references/components/image.md +0 -62
  96. package/.claude/skills/design-system-kits/references/components/information.md +0 -61
  97. package/.claude/skills/design-system-kits/references/components/input-dropdown.md +0 -92
  98. package/.claude/skills/design-system-kits/references/components/input-money.md +0 -128
  99. package/.claude/skills/design-system-kits/references/components/input-otp.md +0 -85
  100. package/.claude/skills/design-system-kits/references/components/input-phone-number.md +0 -96
  101. package/.claude/skills/design-system-kits/references/components/input-search.md +0 -127
  102. package/.claude/skills/design-system-kits/references/components/input-text-area.md +0 -100
  103. package/.claude/skills/design-system-kits/references/components/input.md +0 -126
  104. package/.claude/skills/design-system-kits/references/components/loader.md +0 -41
  105. package/.claude/skills/design-system-kits/references/components/pagination.md +0 -47
  106. package/.claude/skills/design-system-kits/references/components/popup-notify.md +0 -69
  107. package/.claude/skills/design-system-kits/references/components/popup-promotion.md +0 -35
  108. package/.claude/skills/design-system-kits/references/components/progress-info.md +0 -55
  109. package/.claude/skills/design-system-kits/references/components/radio.md +0 -42
  110. package/.claude/skills/design-system-kits/references/components/rating.md +0 -36
  111. package/.claude/skills/design-system-kits/references/components/skeleton.md +0 -25
  112. package/.claude/skills/design-system-kits/references/components/slider.md +0 -53
  113. package/.claude/skills/design-system-kits/references/components/snackbar.md +0 -52
  114. package/.claude/skills/design-system-kits/references/components/stepper.md +0 -46
  115. package/.claude/skills/design-system-kits/references/components/steps.md +0 -57
  116. package/.claude/skills/design-system-kits/references/components/suggest-action.md +0 -44
  117. package/.claude/skills/design-system-kits/references/components/swipe.md +0 -44
  118. package/.claude/skills/design-system-kits/references/components/switch.md +0 -43
  119. package/.claude/skills/design-system-kits/references/components/tab-view.md +0 -56
  120. package/.claude/skills/design-system-kits/references/components/tag.md +0 -50
  121. package/.claude/skills/design-system-kits/references/components/text.md +0 -56
  122. package/.claude/skills/design-system-kits/references/components/toast.md +0 -51
  123. package/.claude/skills/design-system-kits/references/components/tooltip.md +0 -95
  124. package/.claude/skills/design-system-kits/references/components/uploader.md +0 -48
  125. package/.claude/skills/design-system-kits/references/design-spec-structure.md +0 -356
  126. package/.claude/skills/design-system-kits/references/design-spec-to-code.md +0 -596
  127. package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +0 -155
  128. package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +0 -94
  129. package/.claude/skills/design-system-kits/references/navigation/modal.md +0 -125
  130. package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +0 -430
  131. package/.claude/skills/design-system-kits/references/navigation/navigator.md +0 -177
  132. package/.claude/skills/design-system-kits/references/navigation/setup.md +0 -94
  133. package/.claude/skills/design-system-kits/references/navigation/stack.md +0 -152
  134. package/.claude/skills/design-system-kits/references/screen-layout-rule.md +0 -125
  135. package/.claude/skills/design-system-kits/references/tokens/colors.md +0 -183
  136. package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +0 -45
  137. package/.claude/skills/design-system-kits/references/tokens/theme.md +0 -97
  138. package/.claude/skills/design-system-kits/references/tokens/typography.md +0 -105
  139. package/.claude/skills/vibe-design/SKILL.md +0 -306
@@ -1,128 +0,0 @@
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
-
@@ -1,85 +0,0 @@
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 |
@@ -1,96 +0,0 @@
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
- ```
@@ -1,127 +0,0 @@
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 |
@@ -1,100 +0,0 @@
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.
@@ -1,126 +0,0 @@
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` |