@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,130 +0,0 @@
1
- # Icon
2
-
3
- > Vector icon component — render icons từ design system icon set cho actions, navigation, và visual cues.
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
- | `name` | string | icon name | required | Icon identifier từ icon set [VERIFY] |
17
- | `size` | string | `"inline"` \| `"default"` \| `"standard"` \| `"featured"` \| `"hero"` | `"default"` | Icon size [VERIFY] |
18
- | `color` | string | `Colors.*` token | `"Colors.black_17"` | Icon color. Có thể inherit từ parent [VERIFY] |
19
-
20
- ---
21
-
22
- ## Variants
23
-
24
- | Size | Dimension | Usage |
25
- |------|-----------|-------|
26
- | **inline** | 16×16pt | Inline with text, small indicators |
27
- | **default** | 20×20pt | Default cho most UI contexts |
28
- | **standard** | 24×24pt | Navigation bars, action buttons, list items |
29
- | **featured** | 32×32pt | Emphasized icons, feature highlights |
30
- | **hero** | 48×48pt | Empty states, onboarding, large call-outs |
31
-
32
- ### Color Context
33
-
34
- | Context | Color Token |
35
- |---------|-----------|
36
- | Primary content | `Colors.black_17` |
37
- | Secondary | `Colors.black_15` |
38
- | Hint/placeholder | `Colors.black_12` |
39
- | Disabled | `Colors.black_08` |
40
- | Accent/interactive | `Colors.pink_03` |
41
- | Error | `Colors.red_03` |
42
- | On dark background | `Colors.white` |
43
-
44
- ---
45
-
46
- ## States
47
-
48
- | State | Color | Description |
49
- |-------|-------|-------------|
50
- | **Default** | per `color` prop | Normal display |
51
- | **Disabled** | `Colors.black_08` | Non-interactive context |
52
-
53
- Icon là static display. States chỉ ảnh hưởng color.
54
-
55
- ---
56
-
57
- ## Variant-to-Context Map
58
-
59
- | Size | Color | Khi nào dùng | Ví dụ trong MoMo |
60
- |------|-------|-------------|-------------------|
61
- | `standard` | `Colors.black_17` | Navigation bar, toolbar icons | Back arrow, search icon trong TopNav |
62
- | `inline` | `Colors.black_12` | Inline with text | Icon trước hint text |
63
- | `featured` | `Colors.pink_03` | Feature highlights | Service icons trên Home |
64
- | `hero` | `Colors.black_12` | Empty state illustrations | Empty transaction list icon |
65
-
66
- ---
67
-
68
- ## SSR Pattern
69
-
70
- ### Icon in Navigation Action
71
- ```json
72
- {
73
- "component": "Icon",
74
- "props": {
75
- "name": "navigation_search",
76
- "size": "standard",
77
- "color": "Colors.black_17"
78
- }
79
- }
80
- ```
81
-
82
- ### Icon Inline with Text
83
- ```json
84
- {
85
- "id": "info_row",
86
- "type": "row",
87
- "children": [
88
- {
89
- "component": "Icon",
90
- "props": {
91
- "name": "info_circle",
92
- "size": "inline",
93
- "color": "Colors.blue_03"
94
- }
95
- },
96
- {
97
- "component": "Text",
98
- "props": {
99
- "content": "Phí giao dịch miễn phí",
100
- "typography": "caption_default_regular",
101
- "color": "Colors.blue_03"
102
- }
103
- }
104
- ]
105
- }
106
- ```
107
-
108
- ---
109
-
110
- ## Accessibility
111
-
112
- - Interactive icons: PHẢI có text accessible label. Icon-only button → provide label.
113
- - Decorative icons (next to text label): ẩn khỏi screen readers.
114
- - Không rely solely on icon color để convey state — pair với indicators.
115
-
116
- ---
117
-
118
- ## Usage Guidelines
119
-
120
- ### Do
121
- - Dùng predefined sizes consistently.
122
- - Dùng `Colors.*` tokens cho tất cả icon colors.
123
- - Provide accessible labels cho tất cả interactive icons.
124
- - `standard` (24pt) cho navigation/toolbar. `inline` (16pt) cho text.
125
-
126
- ### Don't
127
- - Không dùng icon là sole means of communication without accessible label.
128
- - Không scale icons to arbitrary sizes giữa predefined steps.
129
- - Không dùng raw hex colors — luôn reference design tokens.
130
- - Không dùng overly detailed graphics làm icons.
@@ -1,81 +0,0 @@
1
- # Image
2
-
3
- ## Description
4
-
5
- An image display component for rendering photos, illustrations, and banners with built-in loading state support. Image handles URL-based loading, displays a skeleton or placeholder while content is being fetched, and supports aspect ratio control to maintain proper proportions.
6
-
7
- **Package:** `@momo-kits/foundation`
8
- **Platform support:** RN ✅ | Compose ✅
9
-
10
- ---
11
-
12
- ## Features
13
-
14
- | Feature | Description |
15
- |--------------------|--------------------------------------------------------------|
16
- | **URL loading** | Loads images from remote URLs with automatic caching |
17
- | **Aspect ratio** | Maintains image proportions via configurable aspect ratio |
18
- | **Loading state** | Displays a skeleton or placeholder while the image loads |
19
- | **Error fallback** | Shows a fallback placeholder if the image fails to load |
20
-
21
- ---
22
-
23
- ## Loading States
24
-
25
- | State | Visual |
26
- |-------------|--------------------------------------------------------------|
27
- | **Loading** | Skeleton placeholder (animated shimmer) matching the image dimensions |
28
- | **Loaded** | Full image displayed, skeleton fades out |
29
- | **Error** | Static fallback placeholder (generic image icon or custom) |
30
-
31
- - The skeleton placeholder should match the expected dimensions of the final image to prevent layout shifts
32
- - Transition from skeleton to loaded image should use a subtle fade-in
33
-
34
- ---
35
-
36
- ## Sizing
37
-
38
- - Image dimensions are constrained by the parent container
39
- - Aspect ratio can be explicitly set to maintain proportions regardless of container size
40
- - Common aspect ratios: 1:1 (square), 16:9 (banner), 4:3 (photo), 3:2 (landscape)
41
- - When only width or height is provided, the other dimension is calculated from the aspect ratio
42
- - If no aspect ratio is specified, the image uses its natural dimensions constrained by the parent
43
-
44
- ---
45
-
46
- ## Layout
47
-
48
- - Images fill their container by default (resize mode: cover)
49
- - Other resize modes: contain (fit within bounds), stretch (fill exactly), center (no scaling)
50
- - Corner radius can be applied for rounded images (use `Radius.*` tokens)
51
- - For circular images (e.g., avatars), apply a radius equal to half the width/height
52
- - Images should not overflow their container — clip content at the container bounds
53
-
54
- ---
55
-
56
- ## Accessibility
57
-
58
- - **Alt text required:** Always provide descriptive alt text that conveys the content or purpose of the image
59
- - **Decorative images:** If an image is purely decorative and adds no informational value, mark it as decorative so screen readers skip it
60
- - **Loading announcement:** Screen readers should not announce the loading state repeatedly — announce once when the image finishes loading if it is meaningful content
61
- - **Error state:** If the image fails to load, the fallback should convey that the content is unavailable
62
-
63
- ---
64
-
65
- ## Do's and Don'ts
66
-
67
- ### Do's
68
- - Always provide alt text that describes the image content or purpose
69
- - Set an explicit aspect ratio to prevent layout shifts during loading
70
- - Use the skeleton loading state for all remotely loaded images
71
- - Optimize image URLs for the target display size (avoid loading oversized assets)
72
- - Use appropriate resize mode based on context (cover for banners, contain for logos)
73
- - Apply `Radius.*` tokens for rounded corners
74
-
75
- ### Don'ts
76
- - Don't use Image for vector icons — use the Icon component instead
77
- - Don't leave alt text empty for meaningful images
78
- - Don't load full-resolution images when a thumbnail would suffice
79
- - Don't allow images to cause layout shifts by omitting dimensions or aspect ratio
80
- - Don't use stretch resize mode for photos — it distorts the content
81
- - Don't hard-code pixel dimensions when the layout should be responsive to the container
@@ -1,107 +0,0 @@
1
- # Information
2
-
3
- > Inline alert banner — contextual messages with type-based color coding. Info, warning, error, success.
4
-
5
- **Package:** `@momo-kits/information`
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 | `"info"` \| `"warning"` \| `"error"` \| `"success"` | `"info"` | Alert type — determines icon và color scheme |
17
- | `title` | string | — | — | Bold heading text. Optional — omit for simple messages [VERIFY] |
18
- | `description` | string | — | required | Body text content |
19
- | `dismissible` | boolean | `true` \| `false` | `false` | Show close (X) button to dismiss [VERIFY] |
20
- | `icon` | string | icon name | auto per type | Override default icon. Default: info=info-circle, warning=warning-triangle, error=error-circle, success=check-circle [VERIFY] |
21
- | `onDismiss` | function | — | — | Callback khi dismiss. `"onDismiss": "setState://hideInfo=true"` |
22
-
23
- ---
24
-
25
- ## Variants
26
-
27
- | Type | Background | Icon Color | Border | Default Icon |
28
- |------|-----------|-----------|--------|-------------|
29
- | **info** | `Colors.blue_01` (light blue) | `Colors.blue_03` | `Colors.blue_02` left border [VERIFY] | info-circle |
30
- | **warning** | `Colors.orange_01` (light orange) | `Colors.orange_03` | `Colors.orange_02` left border [VERIFY] | warning-triangle |
31
- | **error** | `Colors.red_01` (light red) | `Colors.red_03` | `Colors.red_02` left border [VERIFY] | error-circle |
32
- | **success** | `Colors.green_01` (light green) | `Colors.green_03` | `Colors.green_02` left border [VERIFY] | check-circle |
33
-
34
- Text color: `Colors.black_17` for all types.
35
-
36
- ---
37
-
38
- ## States
39
-
40
- | State | Appearance | Interactive |
41
- |-------|-----------|-------------|
42
- | **Visible** | Full banner with icon + text | dismissible only |
43
- | **Dismissed** | Hidden (removed from layout) | false |
44
-
45
- ---
46
-
47
- ## Variant-to-Context Map
48
-
49
- | Type | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
50
- |------|-------------|-----------|-------------------|
51
- | **info** | Neutral helpful information, tips | Urgent alerts | Thông tin khuyến mãi, hướng dẫn sử dụng |
52
- | **warning** | Caution — action may have consequences | Critical errors | "Số dư không đủ", cảnh báo phí |
53
- | **error** | Something failed or is invalid | Informational messages | Lỗi giao dịch, validation form errors |
54
- | **success** | Action completed successfully | Persistent status | "Thanh toán thành công", xác nhận đăng ký |
55
-
56
- ---
57
-
58
- ## SSR Pattern
59
-
60
- ### Inline Warning
61
- ```json
62
- {
63
- "component": "Information",
64
- "props": {
65
- "type": "warning",
66
- "title": "Lưu ý",
67
- "description": "Giao dịch trên 10 triệu cần xác thực bổ sung"
68
- }
69
- }
70
- ```
71
-
72
- ### Dismissible Info
73
- ```json
74
- {
75
- "component": "Information",
76
- "props": {
77
- "type": "info",
78
- "description": "{{data.promotionMessage}}",
79
- "dismissible": true
80
- },
81
- "onDismiss": "setState://hidePromoInfo=true"
82
- }
83
- ```
84
-
85
- ---
86
-
87
- ## Accessibility
88
-
89
- - Announce type + content: "Warning: Số dư không đủ".
90
- - Dismiss button: accessible label "Đóng thông báo".
91
- - Role: `alert` for error/warning, `status` for info/success.
92
-
93
- ---
94
-
95
- ## Usage Guidelines
96
-
97
- ### Do
98
- - Dùng cho contextual inline messages within page flow.
99
- - Match type to severity — info for tips, error for failures.
100
- - Keep description concise — 1-2 sentences max.
101
- - Place near relevant content (e.g., error near form field).
102
-
103
- ### Don't
104
- - Không dùng cho transient notifications → dùng **Toast** / **SnackBar**.
105
- - Không dùng cho blocking alerts → dùng **PopupNotify**.
106
- - Không stack multiple Information banners — consolidate messages.
107
- - Không dùng success type for persistent status — it implies transience.
@@ -1,138 +0,0 @@
1
- # InputDropDown
2
-
3
- > Non-editable input trigger picker/modal — dùng cho selection từ danh sách có sẵn.
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 | — | `""` | Selected value display text |
17
- | `floatingValue` | string | — | required | Floating label text |
18
- | `placeholder` | string | — | — | Hint text khi chưa chọn |
19
- | `hintText` | string | — | — | Helper text bên dưới |
20
- | `errorMessage` | string | — | — | Error text. "Vui lòng chọn" |
21
- | `size` | string | `"large"` \| `"medium"` | `"medium"` | Input size |
22
- | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive |
23
- | `required` | boolean | `true` \| `false` | `false` | Required indicator |
24
- | `trailingIcon` | node | icon | dropdown arrow | Dropdown arrow icon (built-in) [VERIFY] |
25
- | `onPress` | function | — | — | Callback khi tap — mở picker/modal. `"onPress": "action://openBankPicker"` |
26
-
27
- > **CRITICAL:** InputDropDown KHÔNG mở keyboard. Tap = trigger picker/modal/bottom-sheet. KHÔNG dùng cho free-text entry.
28
-
29
- ---
30
-
31
- ## States
32
-
33
- | State | Border | Text Color | Label Color | Arrow Color | Interactive |
34
- |-------|--------|-----------|------------|-------------|-------------|
35
- | **Default** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | `Colors.black_12` | true |
36
- | **Pressed** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | `Colors.black_12` | true |
37
- | **Filled** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | `Colors.black_12` | true |
38
- | **Error** | `Colors.red_03` | `Colors.black_17` | `Colors.black_17` | `Colors.black_12` | true |
39
- | **Disabled** | `Colors.black_03` | `Colors.black_08` | `Colors.black_08` | `Colors.black_08` | false |
40
-
41
- - Pressed state: chỉ flash khi tap, sau đó open picker → return to filled/default.
42
- - KHÔNG có Focused/Typing state (không editable).
43
-
44
- ---
45
-
46
- ## Variant-to-Context Map
47
-
48
- | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
49
- |---------|-------------|-----------|-------------------|
50
- | **Bank selection** | Chọn ngân hàng từ danh sách | User cần search trong list dài → combine với search trong picker | Chọn ngân hàng nhận trên form chuyển tiền |
51
- | **Province/City** | Chọn địa điểm | Free-text address → dùng Input standard | Chọn tỉnh/thành trên form KYC |
52
- | **Category** | Chọn loại dịch vụ/category | Ít options (2-3) → dùng Radio group | Chọn loại giao dịch trong báo cáo |
53
- | **Date trigger** | Trigger date picker | — | Chọn ngày sinh (tap → mở DatePicker modal) |
54
-
55
- ---
56
-
57
- ## SSR Pattern
58
-
59
- ### Bank Selection Form
60
- ```json
61
- {
62
- "id": "bank_form",
63
- "type": "section",
64
- "children": [
65
- {
66
- "component": "InputDropDown",
67
- "props": {
68
- "floatingValue": "Ngân hàng",
69
- "placeholder": "Chọn ngân hàng",
70
- "size": "medium",
71
- "required": true,
72
- "value": "{{state.selectedBankName}}"
73
- },
74
- "onPress": "action://openBankPicker"
75
- },
76
- {
77
- "component": "Input",
78
- "props": {
79
- "floatingValue": "Số tài khoản",
80
- "placeholder": "Nhập số tài khoản",
81
- "size": "medium",
82
- "required": true
83
- },
84
- "onChange": "setState://accountNumber"
85
- },
86
- {
87
- "component": "Button",
88
- "props": {
89
- "title": "Tiếp tục",
90
- "type": "primary",
91
- "size": "large",
92
- "full": true
93
- },
94
- "onPress": "action://verifyAccount"
95
- }
96
- ]
97
- }
98
- ```
99
-
100
- ### Date of Birth Picker
101
- ```json
102
- {
103
- "component": "InputDropDown",
104
- "props": {
105
- "floatingValue": "Ngày sinh",
106
- "placeholder": "DD/MM/YYYY",
107
- "size": "medium",
108
- "required": true,
109
- "value": "{{state.dateOfBirth}}"
110
- },
111
- "onPress": "action://openDatePicker"
112
- }
113
- ```
114
-
115
- ---
116
-
117
- ## Accessibility
118
-
119
- - Role: "button" hoặc "combobox" — screen reader announce là selectable, không phải text input.
120
- - Announce: "Ngân hàng, dropdown, double tap to open".
121
- - Khi có selected value: announce value ("Vietcombank selected").
122
- - Picker/modal phải manage focus — return focus to dropdown khi dismiss.
123
-
124
- ---
125
-
126
- ## Usage Guidelines
127
-
128
- ### Do
129
- - Luôn có floating label.
130
- - Show selected value rõ ràng sau khi chọn.
131
- - Dropdown arrow phải luôn visible — visual cue đây là selector.
132
- - Picker có search khi list dài (>10 options).
133
-
134
- ### Don't
135
- - **KHÔNG BAO GIỜ** dùng cho free-text entry — đây là hard rule.
136
- - Không hide dropdown arrow icon.
137
- - Không dùng khi chỉ có 2-3 options — dùng **Radio** group.
138
- - Không dùng cho toggle on/off — dùng **Switch**.
@@ -1,157 +0,0 @@
1
- # InputMoney
2
-
3
- > Currency input với auto-formatting và currency symbol — dùng cho mọi field nhập số tiền 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 (raw number string) |
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"` | Input size |
22
- | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
23
- | `required` | boolean | `true` \| `false` | `false` | Required indicator |
24
- | `currencySymbol` | string | `"đ"` \| `"VND"` \| custom | `"đ"` | Currency symbol hiển thị [VERIFY] |
25
- | `maxAmount` | number | — | — | Maximum allowed value. Show error khi vượt [VERIFY] |
26
- | `showClearButton` | boolean | `true` \| `false` | `true` | Clear button ở typing/filled/error [VERIFY] |
27
- | `onChange` | function | — | — | Callback khi value thay đổi. `"onChange": "setState://amount"` |
28
- | `onFocus` | function | — | — | Callback khi focus |
29
- | `onBlur` | function | — | — | Callback khi blur |
30
- | `onClear` | function | — | — | Callback khi clear [VERIFY] |
31
-
32
- > **Keyboard:** numeric. Auto-format với dấu phân cách hàng nghìn (1.000.000).
33
-
34
- ---
35
-
36
- ## States
37
-
38
- | State | Border | Text Color | Label Color | Error Color | Cursor | Clear Btn | Interactive |
39
- |-------|--------|-----------|------------|-------------|--------|-----------|-------------|
40
- | **Default** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | hidden | true |
41
- | **Focused** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | hidden | true |
42
- | **Typing** | `Colors.blue_03` | `Colors.black_17` | `Colors.black_17` | — | visible | visible | true |
43
- | **Filled** | `Colors.black_04` | `Colors.black_17` | `Colors.black_17` | — | hidden | visible | true |
44
- | **Error** | `Colors.red_03` | `Colors.black_17` | `Colors.black_17` | `Colors.red_03` | hidden | visible | true |
45
- | **Disabled** | `Colors.black_03` | `Colors.black_08` | `Colors.black_08` | — | hidden | hidden | false |
46
-
47
- ---
48
-
49
- ## Variant-to-Context Map
50
-
51
- | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
52
- |---------|-------------|-----------|-------------------|
53
- | **Transfer amount** | Nhập số tiền chuyển khoản | Nhập số lượng item — dùng Input standard | Màn hình chuyển tiền — field "Số tiền" |
54
- | **Top-up** | Nhập số tiền nạp | Amount cố định từ list — dùng Chip group | Nạp tiền điện thoại, nạp ví |
55
- | **Bill payment** | Nhập số tiền thanh toán | Amount auto-fill từ hóa đơn — show read-only | Thanh toán điện, nước, internet |
56
- | **Large prominent** | Amount là focus chính của screen | Trong form nhiều fields — dùng medium | Màn hình nhập tiền chuyển khoản (size large) |
57
-
58
- ---
59
-
60
- ## SSR Pattern
61
-
62
- ### Transfer Amount Screen
63
- ```json
64
- {
65
- "id": "amount_section",
66
- "type": "section",
67
- "children": [
68
- {
69
- "component": "InputMoney",
70
- "props": {
71
- "floatingValue": "Số tiền",
72
- "placeholder": "Nhập số tiền",
73
- "size": "large",
74
- "required": true,
75
- "errorMessage": "{{state.amountError}}"
76
- },
77
- "onChange": "setState://amount"
78
- },
79
- {
80
- "component": "Information",
81
- "props": {
82
- "type": "info",
83
- "content": "Số dư khả dụng: {{data.balance}}"
84
- }
85
- },
86
- {
87
- "component": "Button",
88
- "props": {
89
- "title": "Chuyển tiền",
90
- "type": "primary",
91
- "size": "large",
92
- "full": true
93
- },
94
- "onPress": "action://transfer"
95
- }
96
- ]
97
- }
98
- ```
99
-
100
- ### Quick Amount Chips + Input
101
- ```json
102
- {
103
- "id": "topup_section",
104
- "type": "section",
105
- "children": [
106
- {
107
- "id": "preset_amounts",
108
- "type": "row",
109
- "scrollable": true,
110
- "forEach": "{{data.presetAmounts}}",
111
- "render": {
112
- "component": "Chip",
113
- "props": {
114
- "label": "{{item.label}}",
115
- "size": "small",
116
- "selected": "{{state.amount == item.value}}"
117
- },
118
- "onPress": "setState://amount={{item.value}}"
119
- }
120
- },
121
- {
122
- "component": "InputMoney",
123
- "props": {
124
- "floatingValue": "Hoặc nhập số tiền khác",
125
- "size": "medium",
126
- "value": "{{state.amount}}"
127
- },
128
- "onChange": "setState://amount"
129
- }
130
- ]
131
- }
132
- ```
133
-
134
- ---
135
-
136
- ## Accessibility
137
-
138
- - Floating label required — screen reader phải announce "Số tiền" label.
139
- - Formatted value phải announce numeric value, không announce separators.
140
- - Error message linked — "Số tiền vượt hạn mức" phải announce khi validation fails.
141
- - Keyboard: numeric only.
142
-
143
- ---
144
-
145
- ## Usage Guidelines
146
-
147
- ### Do
148
- - Dùng `size="large"` khi amount là focus chính của screen.
149
- - Show balance/limit hint via `hintText` hoặc `Information` component bên dưới.
150
- - Auto-format thousands separator khi typing.
151
- - Show currency symbol rõ ràng.
152
-
153
- ### Don't
154
- - Không dùng cho nhập số lượng đơn vị — dùng **Input** standard.
155
- - Không dùng cho nhập mã code — dùng **InputOTP**.
156
- - Không remove formatting khi typing — user cần visual feedback.
157
- - Không hide currency symbol.