@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.
Files changed (139) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/.claude/skills/design-system/SKILL.md +88 -0
  3. package/.claude/skills/design-system/references/components/avatar.md +134 -0
  4. package/.claude/skills/design-system/references/components/badge.md +127 -0
  5. package/.claude/skills/design-system/references/components/bottom-tab.md +177 -0
  6. package/.claude/skills/design-system/references/components/bottomsheet.md +170 -0
  7. package/.claude/skills/design-system/references/components/button.md +206 -0
  8. package/.claude/skills/design-system/references/components/carousel.md +117 -0
  9. package/.claude/skills/design-system/references/components/checkbox.md +98 -0
  10. package/.claude/skills/design-system/references/components/chip.md +146 -0
  11. package/.claude/skills/design-system/references/components/collapse.md +120 -0
  12. package/.claude/skills/design-system/references/components/date-picker.md +119 -0
  13. package/.claude/skills/design-system/references/components/divider.md +84 -0
  14. package/.claude/skills/design-system/references/components/icon.md +130 -0
  15. package/.claude/skills/design-system/references/components/image.md +81 -0
  16. package/.claude/skills/design-system/references/components/information.md +107 -0
  17. package/.claude/skills/design-system/references/components/input-dropdown.md +138 -0
  18. package/.claude/skills/design-system/references/components/input-money.md +157 -0
  19. package/.claude/skills/design-system/references/components/input-otp.md +132 -0
  20. package/.claude/skills/design-system/references/components/input-phone-number.md +140 -0
  21. package/.claude/skills/design-system/references/components/input-search.md +124 -0
  22. package/.claude/skills/design-system/references/components/input-text-area.md +133 -0
  23. package/.claude/skills/design-system/references/components/input.md +152 -0
  24. package/.claude/skills/design-system/references/components/loader.md +87 -0
  25. package/.claude/skills/design-system/references/components/pagination.md +105 -0
  26. package/.claude/skills/design-system/references/components/popup-notify.md +128 -0
  27. package/.claude/skills/design-system/references/components/progress-info.md +114 -0
  28. package/.claude/skills/design-system/references/components/radio.md +86 -0
  29. package/.claude/skills/design-system/references/components/rating.md +126 -0
  30. package/.claude/skills/design-system/references/components/skeleton.md +120 -0
  31. package/.claude/skills/design-system/references/components/slider.md +141 -0
  32. package/.claude/skills/design-system/references/components/snackbar.md +97 -0
  33. package/.claude/skills/design-system/references/components/stepper.md +100 -0
  34. package/.claude/skills/design-system/references/components/steps.md +91 -0
  35. package/.claude/skills/design-system/references/components/suggest-action.md +95 -0
  36. package/.claude/skills/design-system/references/components/swipe.md +121 -0
  37. package/.claude/skills/design-system/references/components/switch.md +98 -0
  38. package/.claude/skills/design-system/references/components/tab-view.md +120 -0
  39. package/.claude/skills/design-system/references/components/tag.md +118 -0
  40. package/.claude/skills/design-system/references/components/text.md +151 -0
  41. package/.claude/skills/design-system/references/components/toast.md +99 -0
  42. package/.claude/skills/design-system/references/components/tooltip.md +138 -0
  43. package/.claude/skills/design-system/references/components/top-nav-miniapp.md +94 -0
  44. package/.claude/skills/design-system/references/components/top-nav.md +226 -0
  45. package/.claude/skills/design-system/references/components/uploader.md +115 -0
  46. package/.claude/skills/design-system/references/navigation/bottom-tab.md +131 -0
  47. package/.claude/skills/design-system/references/navigation/bottomsheet.md +161 -0
  48. package/.claude/skills/design-system/references/navigation/modal.md +133 -0
  49. package/.claude/skills/design-system/references/navigation/navigation-options.md +225 -0
  50. package/.claude/skills/design-system/references/navigation/navigator.md +111 -0
  51. package/.claude/skills/design-system/references/navigation/setup.md +134 -0
  52. package/.claude/skills/design-system/references/navigation/stack.md +128 -0
  53. package/.claude/skills/design-system/references/spec-convention.md +80 -0
  54. package/.claude/skills/design-system/references/tokens/colors.md +131 -0
  55. package/.claude/skills/design-system/references/tokens/spacing-radius.md +144 -0
  56. package/.claude/skills/design-system/references/tokens/theme.md +125 -0
  57. package/.claude/skills/design-system/references/tokens/typography.md +135 -0
  58. package/.claude/skills/design-system-kits/SKILL.md +102 -0
  59. package/.claude/skills/design-system-kits/references/code-convention.md +118 -0
  60. package/.claude/skills/design-system-kits/references/components/avatar.md +45 -0
  61. package/.claude/skills/design-system-kits/references/components/badge.md +27 -0
  62. package/.claude/skills/design-system-kits/references/components/button.md +65 -0
  63. package/.claude/skills/design-system-kits/references/components/carousel.md +51 -0
  64. package/.claude/skills/design-system-kits/references/components/checkbox.md +39 -0
  65. package/.claude/skills/design-system-kits/references/components/chip.md +54 -0
  66. package/.claude/skills/design-system-kits/references/components/collapse.md +63 -0
  67. package/.claude/skills/design-system-kits/references/components/date-picker.md +36 -0
  68. package/.claude/skills/design-system-kits/references/components/divider.md +21 -0
  69. package/.claude/skills/design-system-kits/references/components/icon.md +382 -0
  70. package/.claude/skills/design-system-kits/references/components/image.md +62 -0
  71. package/.claude/skills/design-system-kits/references/components/information.md +61 -0
  72. package/.claude/skills/design-system-kits/references/components/input-dropdown.md +92 -0
  73. package/.claude/skills/design-system-kits/references/components/input-money.md +128 -0
  74. package/.claude/skills/design-system-kits/references/components/input-otp.md +85 -0
  75. package/.claude/skills/design-system-kits/references/components/input-phone-number.md +96 -0
  76. package/.claude/skills/design-system-kits/references/components/input-search.md +127 -0
  77. package/.claude/skills/design-system-kits/references/components/input-text-area.md +100 -0
  78. package/.claude/skills/design-system-kits/references/components/input.md +126 -0
  79. package/.claude/skills/design-system-kits/references/components/loader.md +41 -0
  80. package/.claude/skills/design-system-kits/references/components/pagination.md +47 -0
  81. package/.claude/skills/design-system-kits/references/components/popup-notify.md +69 -0
  82. package/.claude/skills/design-system-kits/references/components/popup-promotion.md +35 -0
  83. package/.claude/skills/design-system-kits/references/components/progress-info.md +55 -0
  84. package/.claude/skills/design-system-kits/references/components/radio.md +42 -0
  85. package/.claude/skills/design-system-kits/references/components/rating.md +36 -0
  86. package/.claude/skills/design-system-kits/references/components/skeleton.md +25 -0
  87. package/.claude/skills/design-system-kits/references/components/slider.md +53 -0
  88. package/.claude/skills/design-system-kits/references/components/snackbar.md +52 -0
  89. package/.claude/skills/design-system-kits/references/components/stepper.md +46 -0
  90. package/.claude/skills/design-system-kits/references/components/steps.md +57 -0
  91. package/.claude/skills/design-system-kits/references/components/suggest-action.md +44 -0
  92. package/.claude/skills/design-system-kits/references/components/swipe.md +44 -0
  93. package/.claude/skills/design-system-kits/references/components/switch.md +43 -0
  94. package/.claude/skills/design-system-kits/references/components/tab-view.md +56 -0
  95. package/.claude/skills/design-system-kits/references/components/tag.md +50 -0
  96. package/.claude/skills/design-system-kits/references/components/text.md +56 -0
  97. package/.claude/skills/design-system-kits/references/components/toast.md +51 -0
  98. package/.claude/skills/design-system-kits/references/components/tooltip.md +95 -0
  99. package/.claude/skills/design-system-kits/references/components/uploader.md +48 -0
  100. package/.claude/skills/design-system-kits/references/design-spec-structure.md +356 -0
  101. package/.claude/skills/design-system-kits/references/design-spec-to-code.md +596 -0
  102. package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +155 -0
  103. package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +94 -0
  104. package/.claude/skills/design-system-kits/references/navigation/modal.md +125 -0
  105. package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +430 -0
  106. package/.claude/skills/design-system-kits/references/navigation/navigator.md +177 -0
  107. package/.claude/skills/design-system-kits/references/navigation/setup.md +94 -0
  108. package/.claude/skills/design-system-kits/references/navigation/stack.md +152 -0
  109. package/.claude/skills/design-system-kits/references/screen-layout-rule.md +125 -0
  110. package/.claude/skills/design-system-kits/references/tokens/colors.md +183 -0
  111. package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +45 -0
  112. package/.claude/skills/design-system-kits/references/tokens/theme.md +97 -0
  113. package/.claude/skills/design-system-kits/references/tokens/typography.md +105 -0
  114. package/.claude/skills/vibe-design/SKILL.md +306 -0
  115. package/compose/build.gradle.kts +1 -1
  116. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +7 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +2 -2
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +3 -0
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +5 -2
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +2 -11
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +5 -1
  135. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -0
  136. package/gradle.properties +1 -1
  137. package/ios/Popup/PopupPromotion.swift +2 -2
  138. package/local.properties +8 -0
  139. package/package.json +1 -1
@@ -0,0 +1,124 @@
1
+ # InputSearch
2
+
3
+ > Search bar với search icon prefix và cancel action — dùng cho mọi search flow trong MoMo.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `value` | string | — | `""` | Current search query |
17
+ | `placeholder` | string | — | `"Tìm kiếm"` | Hint text. Không dùng floating label [VERIFY] |
18
+ | `hintText` | string | — | — | Helper text bên dưới (hiếm dùng cho search) |
19
+ | `errorMessage` | string | — | — | Error text (hiếm dùng cho search) |
20
+ | `size` | string | `"large"` \| `"medium"` | `"medium"` | Search bar size |
21
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive |
22
+ | `showClearButton` | boolean | `true` \| `false` | `true` | Clear button khi có value [VERIFY] |
23
+ | `onChange` | function | — | — | Callback mỗi keystroke. `"onChange": "setState://searchQuery"` |
24
+ | `onFocus` | function | — | — | Callback khi focus — thường trigger search UI |
25
+ | `onBlur` | function | — | — | Callback khi blur |
26
+ | `onClear` | function | — | — | Callback khi clear [VERIFY] |
27
+ | `onCancel` | function | — | — | Callback khi tap Cancel button. Clear value + dismiss focus [VERIFY] |
28
+
29
+ > **Khác biệt:** InputSearch có search icon prefix built-in và Cancel button appears on focus. Có thể KHÔNG dùng `floatingValue` mà dùng `placeholder` trực tiếp [VERIFY].
30
+
31
+ ---
32
+
33
+ ## States
34
+
35
+ | State | Border | Text Color | Icon Color | Cancel Btn | Clear Btn | Interactive |
36
+ |-------|--------|-----------|-----------|------------|-----------|-------------|
37
+ | **Default** | `Colors.black_04` | `Colors.black_17` | `Colors.black_12` | hidden | hidden | true |
38
+ | **Focused** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_12` | visible | hidden | true |
39
+ | **Typing** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_12` | visible | visible | true |
40
+ | **Filled** | `Colors.black_04` | `Colors.black_17` | `Colors.black_12` | hidden | visible | true |
41
+ | **Disabled** | `Colors.black_03` | `Colors.black_08` | `Colors.black_08` | hidden | hidden | false |
42
+
43
+ ---
44
+
45
+ ## Variant-to-Context Map
46
+
47
+ | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
48
+ |---------|-------------|-----------|-------------------|
49
+ | **List search** | Tìm kiếm trong danh sách dài | Chỉ filter đơn giản 3-5 options — dùng Chip group | Search giao dịch lịch sử, search contacts |
50
+ | **Service search** | Tìm dịch vụ/merchant | Danh mục cố định — dùng tabs/chips | Search dịch vụ trên Home, search merchant |
51
+ | **Global search** | Search bar chính của app | — | Search bar trên Home screen MoMo |
52
+
53
+ ---
54
+
55
+ ## SSR Pattern
56
+
57
+ ### Search with Results List
58
+ ```json
59
+ {
60
+ "id": "search_section",
61
+ "type": "section",
62
+ "children": [
63
+ {
64
+ "component": "InputSearch",
65
+ "props": {
66
+ "placeholder": "Tìm kiếm giao dịch",
67
+ "size": "medium"
68
+ },
69
+ "onChange": "setState://searchQuery"
70
+ },
71
+ {
72
+ "id": "search_results",
73
+ "type": "section",
74
+ "forEach": "{{data.searchResults}}",
75
+ "render": {
76
+ "component": "ListItem",
77
+ "props": {
78
+ "title": "{{item.title}}",
79
+ "subtitle": "{{item.date}}",
80
+ "rightText": "{{item.amount}}"
81
+ },
82
+ "onPress": "navigate://TransactionDetail?id={{item.id}}"
83
+ }
84
+ }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ ### Global Search Bar
90
+ ```json
91
+ {
92
+ "component": "InputSearch",
93
+ "props": {
94
+ "placeholder": "Tìm dịch vụ, bạn bè...",
95
+ "size": "large"
96
+ },
97
+ "onFocus": "navigate://SearchScreen",
98
+ "onChange": "setState://globalSearch"
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Accessibility
105
+
106
+ - Search icon phải accessible — role "search".
107
+ - Placeholder announce: "Tìm kiếm giao dịch, search field".
108
+ - Cancel button: announce "Cancel search".
109
+ - Results count announce khi results change: "5 results found".
110
+
111
+ ---
112
+
113
+ ## Usage Guidelines
114
+
115
+ ### Do
116
+ - Dùng full width cho search bar.
117
+ - Show Cancel button khi focused — cho phép user dismiss nhanh.
118
+ - Implement live search (debounced) hoặc search on submit.
119
+ - Clear results khi query cleared.
120
+
121
+ ### Don't
122
+ - Không dùng cho simple filter — dùng **Chip** group.
123
+ - Không hide search icon — user cần visual cue đây là search.
124
+ - Không disable Cancel khi focused — luôn cho phép dismiss.
@@ -0,0 +1,133 @@
1
+ # InputTextArea
2
+
3
+ > Multiline text input — container grows vertically theo content cho đến max height.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `value` | string | — | `""` | Current input value (multiline) |
17
+ | `floatingValue` | string | — | required | Floating label text |
18
+ | `placeholder` | string | — | — | Hint text khi chưa có value |
19
+ | `hintText` | string | — | — | Helper text bên dưới container |
20
+ | `errorMessage` | string | — | — | Error text. Replaces hintText |
21
+ | `size` | string | `"large"` \| `"medium"` | `"medium"` | Initial input size |
22
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
23
+ | `editable` | boolean | `true` \| `false` | `true` | `false` = read-only [VERIFY] |
24
+ | `required` | boolean | `true` \| `false` | `false` | Required indicator |
25
+ | `maxLines` | number | — | — | Max dòng trước khi scroll [VERIFY] |
26
+ | `maxHeight` | number | — | — | Max chiều cao container [VERIFY] |
27
+ | `showClearButton` | boolean | `true` \| `false` | `true` | Clear button [VERIFY] |
28
+ | `onChange` | function | — | — | Callback khi value thay đổi |
29
+ | `onFocus` | function | — | — | Callback khi focus |
30
+ | `onBlur` | function | — | — | Callback khi blur |
31
+ | `onClear` | function | — | — | Callback khi clear [VERIFY] |
32
+
33
+ > **Khác biệt so với Input:** Container height KHÔNG cố định — grows vertically theo content. Keyboard default (multiline enter).
34
+
35
+ ---
36
+
37
+ ## States
38
+
39
+ | State | Border | Text Color | Label Color | Error Color | Cursor | Clear Btn | Interactive |
40
+ |-------|--------|-----------|------------|-------------|--------|-----------|-------------|
41
+ | **Default** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | hidden | true |
42
+ | **Focused** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | hidden | true |
43
+ | **Typing** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | visible | true |
44
+ | **Filled** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | visible | true |
45
+ | **Error** | `Colors.red_03` | `Colors.black_17` | `Colors.black_17` | `Colors.red_03` | hidden | visible | true |
46
+ | **Disabled** | `Colors.black_03` | `Colors.black_08` | `Colors.black_08` | — | hidden | hidden | false |
47
+
48
+ ---
49
+
50
+ ## Variant-to-Context Map
51
+
52
+ | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
53
+ |---------|-------------|-----------|-------------------|
54
+ | **Long note** | Nhập text dài nhiều dòng | Text ngắn 1 dòng — dùng Input standard | Ghi chú chuyển tiền dài, lý do hoàn tiền |
55
+ | **Description** | Mô tả chi tiết | Chỉ cần 1 field ngắn | Mô tả yêu cầu hỗ trợ, feedback |
56
+ | **Message** | Tin nhắn dạng freeform | Structured input — dùng form fields riêng | Nhắn tin cho merchant, comment |
57
+
58
+ ---
59
+
60
+ ## SSR Pattern
61
+
62
+ ### Feedback Form
63
+ ```json
64
+ {
65
+ "id": "feedback_section",
66
+ "type": "section",
67
+ "children": [
68
+ {
69
+ "component": "Rating",
70
+ "props": {
71
+ "value": "{{state.rating}}"
72
+ },
73
+ "onChange": "setState://rating"
74
+ },
75
+ {
76
+ "component": "InputTextArea",
77
+ "props": {
78
+ "floatingValue": "Nhận xét của bạn",
79
+ "placeholder": "Chia sẻ trải nghiệm...",
80
+ "size": "medium",
81
+ "maxLines": 5
82
+ },
83
+ "onChange": "setState://feedback"
84
+ },
85
+ {
86
+ "component": "Button",
87
+ "props": {
88
+ "title": "Gửi đánh giá",
89
+ "type": "primary",
90
+ "size": "large",
91
+ "full": true
92
+ },
93
+ "onPress": "action://submitFeedback"
94
+ }
95
+ ]
96
+ }
97
+ ```
98
+
99
+ ### Transfer Note
100
+ ```json
101
+ {
102
+ "component": "InputTextArea",
103
+ "props": {
104
+ "floatingValue": "Lời nhắn",
105
+ "placeholder": "Nhập ghi chú cho người nhận",
106
+ "size": "medium",
107
+ "maxLines": 3
108
+ },
109
+ "onChange": "setState://transferNote"
110
+ }
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Accessibility
116
+
117
+ - Floating label required cho screen readers.
118
+ - Announce multiline capability — "text area, 3 of 5 lines".
119
+ - Error message linked.
120
+ - Touch target: full container tappable.
121
+
122
+ ---
123
+
124
+ ## Usage Guidelines
125
+
126
+ ### Do
127
+ - Set `maxLines` hoặc `maxHeight` để tránh content chiếm toàn bộ screen.
128
+ - Dùng `placeholder` để guide content ("Chia sẻ trải nghiệm...").
129
+ - Show character count nếu có limit [VERIFY — cần check prop].
130
+
131
+ ### Don't
132
+ - Không dùng cho text ngắn 1 dòng — dùng **Input** standard.
133
+ - Không set maxLines quá nhỏ (1-2) — vô nghĩa, dùng Input standard.
@@ -0,0 +1,152 @@
1
+ # Input
2
+
3
+ > Single-line text input với floating label — form control cơ bản cho mọi dạng nhập text trong MoMo.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `value` | string | — | `""` | Current input value |
17
+ | `floatingValue` | string | — | required | Floating label text. Animates từ placeholder position lên trên khi focus/filled |
18
+ | `placeholder` | string | — | — | Hint text khi chưa có value |
19
+ | `hintText` | string | — | — | Helper text hiển thị bên dưới container |
20
+ | `errorMessage` | string | — | — | Error text bên dưới container. Khi có, replaces hintText |
21
+ | `size` | string | `"large"` \| `"medium"` | `"medium"` | Input size. Maps to `InputSize.Large` / `InputSize.Medium` |
22
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
23
+ | `editable` | boolean | `true` \| `false` | `true` | `false` = read-only state [VERIFY] |
24
+ | `required` | boolean | `true` \| `false` | `false` | Hiển thị required indicator bên cạnh label |
25
+ | `prefix` | node | icon \| text | — | Element ở đầu input |
26
+ | `trailingIcon` | node | icon | — | Icon ở cuối input |
27
+ | `showClearButton` | boolean | `true` \| `false` | `true` | Clear button xuất hiện ở typing/filled/error states [VERIFY] |
28
+ | `showInformationIcon` | boolean | `true` \| `false` | `false` | Optional info icon [VERIFY] |
29
+ | `image` | node | — | — | Optional image inside input [VERIFY] |
30
+ | `onChange` | function | — | — | Callback khi value thay đổi. `"onChange": "setState://fieldName"` |
31
+ | `onFocus` | function | — | — | Callback khi input nhận focus |
32
+ | `onBlur` | function | — | — | Callback khi input mất focus |
33
+ | `onClear` | function | — | — | Callback khi tap clear button [VERIFY] |
34
+
35
+ ---
36
+
37
+ ## States
38
+
39
+ | State | Border | Text Color | Label Color | Error Color | Cursor | Clear Btn | Interactive |
40
+ |-------|--------|-----------|------------|-------------|--------|-----------|-------------|
41
+ | **Default** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | hidden | true |
42
+ | **Focused** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | hidden | true |
43
+ | **Typing** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | visible | true |
44
+ | **Filled** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | visible | true |
45
+ | **Error** | `Colors.red_03` | `Colors.black_17` | `Colors.black_17` | `Colors.red_03` | hidden | visible | true |
46
+ | **Disabled** | `Colors.black_03` | `Colors.black_08` | `Colors.black_08` | — | hidden | hidden | false |
47
+ | **Read-only** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | hidden | false |
48
+
49
+ **Floating label behavior:**
50
+ - Default (no value): label inside at placeholder position
51
+ - Focus hoặc có value: label animates upward, reduces in size
52
+
53
+ **Support text priority:** Error > Read-only ("Không thể chỉnh sửa") > Hint
54
+
55
+ ---
56
+
57
+ ## Variant-to-Context Map
58
+
59
+ | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
60
+ |---------|-------------|-----------|-------------------|
61
+ | **Text entry** | Nhập text ngắn 1 dòng trong form | Cần nhập số tiền → `InputMoney`, SĐT → `InputPhoneNumber` | Họ tên form KYC, địa chỉ giao hàng |
62
+ | **With prefix** | Field có icon/label prefix | Icon không mang ý nghĩa → bỏ prefix | Email field với @ icon |
63
+ | **Read-only display** | Show value không cho edit | Cần interactive display → dùng Text component | Thông tin tài khoản đã xác thực |
64
+
65
+ ---
66
+
67
+ ## SSR Pattern
68
+
69
+ ### Standard Form
70
+ ```json
71
+ {
72
+ "id": "form_section",
73
+ "type": "section",
74
+ "children": [
75
+ {
76
+ "component": "Input",
77
+ "props": {
78
+ "floatingValue": "Họ và tên",
79
+ "placeholder": "Nhập họ và tên",
80
+ "size": "medium",
81
+ "required": true
82
+ },
83
+ "onChange": "setState://fullName"
84
+ },
85
+ {
86
+ "component": "Input",
87
+ "props": {
88
+ "floatingValue": "Email",
89
+ "placeholder": "example@email.com",
90
+ "size": "medium"
91
+ },
92
+ "onChange": "setState://email"
93
+ },
94
+ {
95
+ "component": "Button",
96
+ "props": {
97
+ "title": "Tiếp tục",
98
+ "type": "primary",
99
+ "size": "large",
100
+ "full": true,
101
+ "disabled": "{{state.fullName == ''}}"
102
+ },
103
+ "onPress": "action://submitForm"
104
+ }
105
+ ]
106
+ }
107
+ ```
108
+
109
+ ### Input with Validation Error
110
+ ```json
111
+ {
112
+ "component": "Input",
113
+ "props": {
114
+ "floatingValue": "Email",
115
+ "placeholder": "example@email.com",
116
+ "size": "medium",
117
+ "required": true,
118
+ "errorMessage": "{{state.emailError}}",
119
+ "value": "{{state.email}}"
120
+ },
121
+ "onChange": "setState://email"
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Accessibility
128
+
129
+ - Every input phải có floating label cho screen readers. Không dùng placeholder thay label.
130
+ - Error message phải programmatically associated với input.
131
+ - Tap label hoặc container area = focus input.
132
+ - Read-only: screen reader phải announce non-editable status.
133
+
134
+ ---
135
+
136
+ ## Usage Guidelines
137
+
138
+ ### Do
139
+ - Luôn cung cấp floating label — không dùng placeholder thay label.
140
+ - Error message inline bên dưới input, không dùng alert/toast.
141
+ - Dùng hint text để clarify format ("DD/MM/YYYY").
142
+ - Clear error state ngay khi user sửa input.
143
+ - Read-only PHẢI có support text.
144
+
145
+ ### Don't
146
+ - Không dùng disabled input để hiển thị read-only info — dùng **Text**.
147
+ - Không stack nhiều error messages cho 1 input.
148
+ - Không ẩn floating label khi input có value.
149
+ - Hint text không quá 2 dòng.
150
+ - Cần nhập tiền → dùng **InputMoney**, không dùng Input standard.
151
+ - Cần nhập SĐT → dùng **InputPhoneNumber**.
152
+ - Cần nhập OTP → dùng **InputOTP**.
@@ -0,0 +1,87 @@
1
+ # Loader
2
+
3
+ > Loading spinner/dot animation — full-screen loading states và initial data fetches.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ❌ (dùng `CircularProgressIndicator` hoặc Skeleton)
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `type` | string | `"spinner"` \| `"dot"` | `"spinner"` | Loader variant [VERIFY] |
17
+ | `color` | string | `Colors.*` token | `"Colors.pink_03"` | Loader color [VERIFY] |
18
+
19
+ ---
20
+
21
+ ## Variants
22
+
23
+ | Variant | Animation | Usage |
24
+ |---------|----------|-------|
25
+ | **spinner** | Continuous circular rotation | General-purpose loading |
26
+ | **dot** | Sequential pulsing/scaling dots | Lighter, playful contexts |
27
+
28
+ ---
29
+
30
+ ## States
31
+
32
+ | State | Color | Animation | Description |
33
+ |-------|-------|----------|-------------|
34
+ | **Loading** | `Colors.pink_03` | Active | Continuous animation |
35
+
36
+ ---
37
+
38
+ ## Variant-to-Context Map
39
+
40
+ | Variant | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
41
+ |---------|-------------|-----------|-------------------|
42
+ | **spinner** | Full-screen loading, screen transitions | Inline content loading → dùng Skeleton | App initialization, screen data fetch |
43
+ | **dot** | Lighter loading contexts | Formal/serious screens | Chat typing indicator, playful loading |
44
+
45
+ ---
46
+
47
+ ## SSR Pattern
48
+
49
+ ### Full-screen Loading
50
+ ```json
51
+ {
52
+ "id": "loading_screen",
53
+ "type": "center",
54
+ "children": [
55
+ {
56
+ "component": "Loader",
57
+ "props": {
58
+ "type": "spinner"
59
+ }
60
+ }
61
+ ]
62
+ }
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Accessibility
68
+
69
+ - Loader announce "Đang tải" cho screen readers.
70
+ - Khi loading complete → loaded content nhận focus.
71
+ - Loader không focusable hoặc interactive.
72
+
73
+ ---
74
+
75
+ ## Usage Guidelines
76
+
77
+ ### Do
78
+ - Dùng cho full-screen loading states.
79
+ - Dùng cho initial data fetches khi no layout structure known.
80
+ - Center loader trong available space.
81
+ - Spinner cho general-purpose, dot cho lighter contexts.
82
+
83
+ ### Don't
84
+ - Không dùng cho inline content loading → dùng **Skeleton**.
85
+ - Không dùng trong button → dùng **Button** loading prop.
86
+ - Không show Loader cho near-instant operations.
87
+ - Không dùng trên Compose → dùng native `CircularProgressIndicator`.
@@ -0,0 +1,105 @@
1
+ # Pagination
2
+
3
+ > Page/position indicators — dots, numbers, hoặc scroll bar cho carousels và paged content.
4
+
5
+ **Package:** `@momo-kits/carousel` (PaginationDot, PaginationScroll) / `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `type` | string | `"dot"` \| `"whiteDot"` \| `"number"` \| `"scroll"` | `"dot"` | Pagination variant [VERIFY] |
17
+ | `total` | number | — | required | Total number of pages |
18
+ | `current` | number | 0-based index | `0` | Current active page |
19
+ | `onChange` | function | — | — | Callback khi page change (for number variant) [VERIFY] |
20
+
21
+ ---
22
+
23
+ ## Variants
24
+
25
+ | Variant | Active Color | Inactive Color | Content | Usage |
26
+ |---------|-------------|---------------|---------|-------|
27
+ | **dot** | `Colors.pink_03` | `Colors.black_08` | Circles | Standard carousels, image galleries |
28
+ | **whiteDot** | `Colors.white` | `Colors.white` (50% opacity) | Circles | Dark/image backgrounds |
29
+ | **number** | `Colors.pink_03` | `Colors.black_12` | Page numbers | When exact page count matters |
30
+ | **scroll** | `Colors.pink_03` (indicator) | `Colors.black_08` (track) | Scroll bar | Large page counts |
31
+
32
+ ---
33
+
34
+ ## States
35
+
36
+ | State | Appearance |
37
+ |-------|-----------|
38
+ | **Active page** | Highlighted indicator (pink/white, larger dot) |
39
+ | **Inactive pages** | Subdued indicator (grey/translucent, smaller) |
40
+ | **Transitioning** | Animated interpolation between two page states |
41
+
42
+ ---
43
+
44
+ ## Variant-to-Context Map
45
+
46
+ | Variant | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
47
+ |---------|-------------|-----------|-------------------|
48
+ | **dot** | Standard carousel, ≤7 pages | >7 pages → dùng scroll | Banner carousel trên Home |
49
+ | **whiteDot** | Pagination trên dark/image background | Light background → dùng dot | Image gallery, hero banners |
50
+ | **number** | Exact page count matters to user | Decorative paging | Onboarding steps |
51
+ | **scroll** | Many pages, continuous scroll | ≤5 discrete pages → dùng dot | Feed với lazy loading |
52
+
53
+ ---
54
+
55
+ ## SSR Pattern
56
+
57
+ ### Carousel with Dot Pagination
58
+ ```json
59
+ {
60
+ "id": "banner_carousel",
61
+ "type": "section",
62
+ "children": [
63
+ {
64
+ "component": "Carousel",
65
+ "props": {
66
+ "items": "{{data.banners}}",
67
+ "autoPlay": true
68
+ }
69
+ },
70
+ {
71
+ "component": "Pagination",
72
+ "props": {
73
+ "type": "dot",
74
+ "total": "{{data.banners.length}}",
75
+ "current": "{{state.currentBanner}}"
76
+ }
77
+ }
78
+ ]
79
+ }
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Accessibility
85
+
86
+ - Announce current page position: "Trang 2 trong 5".
87
+ - Dot indicators là decorative khi paired with swipe navigation.
88
+ - Number pagination nếu tappable → meet 44dp touch target.
89
+
90
+ ---
91
+
92
+ ## Usage Guidelines
93
+
94
+ ### Do
95
+ - PaginationDot cho carousels / image galleries.
96
+ - PaginationWhiteDot cho dark backgrounds.
97
+ - PaginationNumber khi exact page count matters.
98
+ - PaginationScroll cho many pages.
99
+ - Center-align below associated content.
100
+
101
+ ### Don't
102
+ - Không dùng cho step-by-step progress → dùng **Steps**.
103
+ - Không dùng dot cho >7-8 pages → switch to scroll/number.
104
+ - Không đặt pagination xa content.
105
+ - Không mix variants trong cùng carousel.