@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,98 @@
1
+ # Switch
2
+
3
+ > Toggle control cho binary on/off settings — state thay đổi ngay khi tap, không cần confirm.
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` | boolean | `true` \| `false` | `false` | Current on/off state |
17
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
18
+ | `label` | string | — | — | Title label alongside switch [VERIFY] |
19
+ | `onChange` | function | — | — | Callback khi toggle. `"onChange": "setState://settingName"` |
20
+
21
+ ---
22
+
23
+ ## States
24
+
25
+ | State | Track Color | Thumb Color | Opacity | Interactive |
26
+ |-------|-----------|-----------|---------|-------------|
27
+ | **Off** | `Colors.black_04` | `Colors.white` | 1 | true |
28
+ | **On** | `Colors.pink_03` | `Colors.white` | 1 | true |
29
+ | **Disabled Off** | `Colors.black_04` | `Colors.white` | reduced | false |
30
+ | **Disabled On** | `Colors.pink_03` | `Colors.white` | reduced | false |
31
+
32
+ Thumb slides smoothly between left (off) → right (on) with animation.
33
+
34
+ ---
35
+
36
+ ## Variant-to-Context Map
37
+
38
+ | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
39
+ |---------|-------------|-----------|-------------------|
40
+ | **Setting toggle** | Binary on/off setting có effect ngay | Cần submit → dùng CheckBox | Bật/tắt thông báo, bật/tắt sinh trắc học |
41
+ | **Feature enable** | Enable/disable feature | Chọn giữa 2 options khác nhau → dùng Radio | Bật Dark mode, bật Face ID |
42
+ | **Preference** | User preference có effect ngay | — | Ẩn số dư, hiển thị gợi ý |
43
+
44
+ ---
45
+
46
+ ## SSR Pattern
47
+
48
+ ### Settings List
49
+ ```json
50
+ {
51
+ "id": "settings_section",
52
+ "type": "section",
53
+ "forEach": "{{data.settings}}",
54
+ "render": {
55
+ "id": "setting_row",
56
+ "type": "row",
57
+ "children": [
58
+ {
59
+ "component": "Text",
60
+ "props": {
61
+ "content": "{{item.label}}",
62
+ "typography": "body_default_regular"
63
+ }
64
+ },
65
+ {
66
+ "component": "Switch",
67
+ "props": {
68
+ "value": "{{item.enabled}}",
69
+ "label": "{{item.label}}"
70
+ },
71
+ "onChange": "setState://setting_{{item.key}}"
72
+ }
73
+ ]
74
+ }
75
+ }
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Accessibility
81
+
82
+ - Screen readers announce: title label, current state (on/off), role (switch/toggle).
83
+ - Tapping toggles state và announce new state.
84
+ - Entire row (label + switch) tappable.
85
+
86
+ ---
87
+
88
+ ## Usage Guidelines
89
+
90
+ ### Do
91
+ - Dùng cho instant settings — effect ngay khi toggle.
92
+ - Provide title label mô tả what switch controls.
93
+ - Đặt trong settings screens / preference panels.
94
+
95
+ ### Don't
96
+ - Không dùng cho form selections cần submit → dùng **CheckBox**.
97
+ - Không dùng cho chọn giữa 2 distinct options → dùng **Radio** / segmented control.
98
+ - Không group switches mutual-exclusive → đó là Radio behavior.
@@ -0,0 +1,120 @@
1
+ # TabView
2
+
3
+ > Horizontal tab bar — switch between content panels. Categorized content within single screen.
4
+
5
+ **Package:** `@momo-kits/tab-view`
6
+ **Platform:** RN ✅ | Compose ❌ (use TabRow + HorizontalPager)
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Variant Axes
13
+
14
+ | Axis | Options | Default |
15
+ |------|---------|---------|
16
+ | **Layout** | `fixed` · `scrollable` | `fixed` (≤4 tabs), `scrollable` (>4 tabs) |
17
+
18
+ ---
19
+
20
+ ## Props
21
+
22
+ | Prop | Type | Values | Default | Description |
23
+ |------|------|--------|---------|-------------|
24
+ | `tabs` | array | `[{ label, key }]` | required | Tab definitions |
25
+ | `activeKey` | string | — | first tab's key | Currently active tab key |
26
+ | `layout` | string | `"fixed"` \| `"scrollable"` | auto per tab count | Fixed: equal width. Scrollable: intrinsic width, horizontal scroll [VERIFY] |
27
+ | `swipeable` | boolean | `true` \| `false` | `true` | Allow swipe gesture to switch content panels [VERIFY] |
28
+ | `onChange` | function | — | — | Callback khi tab changes. `"onChange": "setState://activeTab"` |
29
+
30
+ ### Tab Object
31
+
32
+ | Field | Type | Required | Description |
33
+ |-------|------|----------|-------------|
34
+ | `label` | string | yes | Tab text label (1-2 words) |
35
+ | `key` | string | yes | Unique identifier for tab |
36
+ | `badge` | number | no | Optional badge count on tab [VERIFY] |
37
+
38
+ ---
39
+
40
+ ## States
41
+
42
+ | State | Text Color | Indicator | Interactive |
43
+ |-------|-----------|-----------|-------------|
44
+ | **Active** | `Colors.pink_03` | 2dp pink underline | true |
45
+ | **Inactive** | `Colors.black_12` | None | true |
46
+ | **Pressed** | Opacity 0.8 | — | true |
47
+
48
+ Indicator slides smoothly between tabs on switch. Content panels transition via horizontal swipe or tap.
49
+
50
+ ---
51
+
52
+ ## Variant-to-Context Map
53
+
54
+ | Layout | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
55
+ |--------|-------------|-----------|-------------------|
56
+ | **fixed** | ≤4 tabs, equal importance | >4 tabs → cramped | "Tất cả" / "Đã gửi" / "Đã nhận" |
57
+ | **scrollable** | >4 tabs, variable label lengths | ≤4 tabs → use fixed | Category filters, nhiều loại giao dịch |
58
+
59
+ ---
60
+
61
+ ## SSR Pattern
62
+
63
+ ### Transaction History Tabs
64
+ ```json
65
+ {
66
+ "component": "TabView",
67
+ "props": {
68
+ "tabs": [
69
+ { "label": "Tất cả", "key": "all" },
70
+ { "label": "Chuyển tiền", "key": "transfer" },
71
+ { "label": "Thanh toán", "key": "payment" },
72
+ { "label": "Nhận tiền", "key": "receive" }
73
+ ],
74
+ "activeKey": "{{state.activeTab}}",
75
+ "layout": "fixed"
76
+ },
77
+ "onChange": "setState://activeTab"
78
+ }
79
+ ```
80
+
81
+ ### Scrollable Category Tabs
82
+ ```json
83
+ {
84
+ "component": "TabView",
85
+ "props": {
86
+ "tabs": "{{data.categories}}",
87
+ "activeKey": "{{state.selectedCategory}}",
88
+ "layout": "scrollable"
89
+ },
90
+ "onChange": "setState://selectedCategory"
91
+ }
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Accessibility
97
+
98
+ - Each tab announces: label + position ("Tab 2 trong 4") + state ("đang chọn").
99
+ - Content panels navigable by swiping.
100
+ - Tab labels descriptive and concise.
101
+ - Minimum 44dp touch target height per tab.
102
+
103
+ ---
104
+
105
+ ## Usage Guidelines
106
+
107
+ ### Do
108
+ - Dùng cho organizing related content into parallel categories.
109
+ - Tab labels short — 1-2 words.
110
+ - Default to most relevant tab active on first load.
111
+ - Scrollable variant khi >4 tabs.
112
+ - Consistent content structure across tab panels.
113
+
114
+ ### Don't
115
+ - Không dùng cho sequential steps → dùng **Steps**.
116
+ - Không dùng cho app-level navigation → dùng **BottomTab**.
117
+ - Không >6-7 tabs even in scrollable mode.
118
+ - Không mix icons and text in tab labels unless all tabs have both.
119
+ - Không nest TabView trong TabView — confusing navigation.
120
+ - Không truncate tab labels → shorten text or switch to scrollable.
@@ -0,0 +1,118 @@
1
+ # Tag
2
+
3
+ > Label indicator — classify content theo status, category, hoặc type. Non-interactive.
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
+ | `label` | string | — | required | Tag text. 1-2 words max |
17
+ | `variant` | string | `"default"` \| `"orange"` \| `"green"` \| `"red"` \| `"blue"` \| `"grey"` | `"default"` | Color variant [VERIFY] |
18
+ | `size` | string | `"large"` \| `"medium"` | `"medium"` | Tag size [VERIFY] |
19
+
20
+ ---
21
+
22
+ ## Variants
23
+
24
+ | Variant | Background | Text Color | Semantic |
25
+ |---------|-----------|-----------|----------|
26
+ | **default** | `Colors.black_04` | `Colors.black_17` | Neutral |
27
+ | **orange** | `Colors.orange_08` | `Colors.orange_03` | Warning, pending |
28
+ | **green** | `Colors.green_08` | `Colors.green_03` | Success, completed |
29
+ | **red** | `Colors.red_08` | `Colors.red_03` | Error, failed |
30
+ | **blue** | `Colors.blue_08` | `Colors.blue_03` | Informational |
31
+ | **grey** | `Colors.black_04` | `Colors.black_12` | Inactive, expired |
32
+
33
+ ---
34
+
35
+ ## States
36
+
37
+ | State | Appearance | Description |
38
+ |-------|-----------|-------------|
39
+ | **Default** | Static label với assigned color variant | Non-interactive |
40
+
41
+ Tag là **non-interactive** — chỉ display. Không respond to taps.
42
+
43
+ ---
44
+
45
+ ## Variant-to-Context Map
46
+
47
+ | Variant | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
48
+ |---------|-------------|-----------|-------------------|
49
+ | **green** | Trạng thái thành công/hoàn thành | — | "Thành công" trên giao dịch |
50
+ | **red** | Trạng thái lỗi/thất bại | Non-error status | "Thất bại" trên giao dịch |
51
+ | **orange** | Trạng thái chờ xử lý/cảnh báo | Already resolved | "Đang xử lý" trên giao dịch |
52
+ | **blue** | Thông tin/category | — | "Khuyến mãi" trên deal card |
53
+ | **default** | Neutral label không có semantic | Cần semantic color | "Tài chính" category label |
54
+ | **grey** | Inactive/expired | Active items | "Hết hạn" trên voucher |
55
+
56
+ ---
57
+
58
+ ## SSR Pattern
59
+
60
+ ### Transaction Status Tag
61
+ ```json
62
+ {
63
+ "component": "Tag",
64
+ "props": {
65
+ "label": "Thành công",
66
+ "variant": "green",
67
+ "size": "medium"
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### Tags in List Item
73
+ ```json
74
+ {
75
+ "id": "transaction_item",
76
+ "type": "row",
77
+ "children": [
78
+ {
79
+ "component": "Text",
80
+ "props": {
81
+ "content": "{{item.title}}",
82
+ "typography": "body_default_regular"
83
+ }
84
+ },
85
+ {
86
+ "component": "Tag",
87
+ "props": {
88
+ "label": "{{item.statusLabel}}",
89
+ "variant": "{{item.statusVariant}}",
90
+ "size": "medium"
91
+ }
92
+ }
93
+ ]
94
+ }
95
+ ```
96
+
97
+ ---
98
+
99
+ ## Accessibility
100
+
101
+ - Tag text provides accessible label — screen readers đọc content.
102
+ - Color alone không phải only indicator of meaning — text content convey status.
103
+
104
+ ---
105
+
106
+ ## Usage Guidelines
107
+
108
+ ### Do
109
+ - Dùng Tag cho status ("Thành công", "Đang xử lý", "Thất bại").
110
+ - Dùng Tag cho classification ("Tài chính", "Khuyến mãi").
111
+ - Chọn color variant match semantic meaning.
112
+ - Keep tag text short, scannable.
113
+
114
+ ### Don't
115
+ - Không dùng Tag cho interactive filtering — dùng **Chip**.
116
+ - Không dùng Tag cho numeric counts — dùng **Badge**.
117
+ - Không make Tag tappable — display-only.
118
+ - Không dùng long sentences làm tag text.
@@ -0,0 +1,151 @@
1
+ # Text
2
+
3
+ > Base typography component — render mọi nội dung text trong MoMo theo design tokens.
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
+ | `content` | string | — | required | Text content to display |
17
+ | `typography` | string | token name | `"body_default_regular"` | Typography token. Pattern: `{category}_{size}_{weight}` |
18
+ | `color` | string | `Colors.*` token | `"Colors.black_17"` | Text color token |
19
+ | `numberOfLines` | number | — | — | Max visible lines. Ellipsis khi truncated [VERIFY] |
20
+ | `align` | string | `"left"` \| `"center"` \| `"right"` | `"left"` | Text alignment [VERIFY] |
21
+ | `fontFamily` | string | `"SFProText"` \| `"AlegreyaSans"` \| `"BarlowCondensed"` | `"SFProText"` | Font family [VERIFY] |
22
+
23
+ ---
24
+
25
+ ## Variants
26
+
27
+ Text không có visual variants riêng — thay vào đó dùng typography tokens.
28
+
29
+ ### Typography Token Pattern
30
+
31
+ ```
32
+ {category}_{size}_{weight}
33
+ ```
34
+
35
+ | Category | Sizes | Dùng cho |
36
+ |----------|-------|---------|
37
+ | `heading` | `l`, `default`, `s` | Section titles, screen headers |
38
+ | `body` | `default`, `s` | Body content, descriptions |
39
+ | `action` | `default`, `s` | Button labels, interactive text |
40
+ | `caption` | `default`, `s` | Small supporting text, timestamps |
41
+ | `label` | `default`, `s` | Form labels, metadata |
42
+
43
+ **Weights:** `regular`, `medium`, `semibold`, `bold`
44
+
45
+ **Examples:** `body_default_regular`, `heading_l_bold`, `caption_s_medium`, `action_default_bold`
46
+
47
+ ### Color Pairing Rules
48
+
49
+ | Role | Token | Usage |
50
+ |------|-------|-------|
51
+ | **Default** | `Colors.black_17` | Primary content, headings, body |
52
+ | **Secondary** | `Colors.black_15` | Supporting text |
53
+ | **Hint** | `Colors.black_12` | Placeholder, helper text |
54
+ | **Disabled** | `Colors.black_08` | Non-interactive text |
55
+ | **Accent** | `Colors.pink_03` | Links, highlighted text |
56
+ | **Error** | `Colors.red_03` | Error messages |
57
+ | **Info** | `Colors.blue_03` | Informational text |
58
+
59
+ ---
60
+
61
+ ## States
62
+
63
+ | State | Color | Description |
64
+ |-------|-------|-------------|
65
+ | **Default** | per `color` prop | Normal display |
66
+ | **Disabled** | `Colors.black_08` | Non-interactive context |
67
+
68
+ Text là static, non-interactive component. States chỉ ảnh hưởng color.
69
+
70
+ ---
71
+
72
+ ## Variant-to-Context Map
73
+
74
+ | Typography | Color | Khi nào dùng | Ví dụ trong MoMo |
75
+ |-----------|-------|-------------|-------------------|
76
+ | `heading_l_bold` | `Colors.black_17` | Screen heading chính | "Chuyển tiền" title |
77
+ | `heading_default_bold` | `Colors.black_17` | Section title | "Người nhận gần đây" section header |
78
+ | `body_default_regular` | `Colors.black_17` | Body content | Mô tả giao dịch, hướng dẫn |
79
+ | `body_default_regular` | `Colors.black_12` | Helper/hint text | "Nhập số điện thoại người nhận" |
80
+ | `caption_s_regular` | `Colors.black_12` | Timestamp, metadata | "Hôm nay, 14:30" |
81
+ | `action_default_bold` | `Colors.pink_03` | Tappable text link | "Xem tất cả", "Chi tiết" |
82
+ | `body_default_regular` | `Colors.red_03` | Error message | "Số tiền vượt hạn mức" |
83
+
84
+ ---
85
+
86
+ ## SSR Pattern
87
+
88
+ ### Section with Heading + Body
89
+ ```json
90
+ {
91
+ "id": "info_section",
92
+ "type": "section",
93
+ "children": [
94
+ {
95
+ "component": "Text",
96
+ "props": {
97
+ "content": "Thông tin giao dịch",
98
+ "typography": "heading_default_bold"
99
+ }
100
+ },
101
+ {
102
+ "component": "Text",
103
+ "props": {
104
+ "content": "Vui lòng kiểm tra thông tin trước khi xác nhận",
105
+ "typography": "body_default_regular",
106
+ "color": "Colors.black_12"
107
+ }
108
+ }
109
+ ]
110
+ }
111
+ ```
112
+
113
+ ### Truncated List Item Text
114
+ ```json
115
+ {
116
+ "component": "Text",
117
+ "props": {
118
+ "content": "{{item.description}}",
119
+ "typography": "body_s_regular",
120
+ "color": "Colors.black_15",
121
+ "numberOfLines": 2
122
+ }
123
+ }
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Accessibility
129
+
130
+ - Text content accessible mặc định cho screen readers.
131
+ - Decorative text: ẩn khỏi assistive technology.
132
+ - Minimum font size: 10sp absolute, prefer 14sp+ cho body.
133
+ - Contrast: tất cả text-on-background meet WCAG AA (4.5:1 normal, 3:1 large text).
134
+ - Không convey meaning chỉ bằng color — pair với icon hoặc label.
135
+
136
+ ---
137
+
138
+ ## Usage Guidelines
139
+
140
+ ### Do
141
+ - Dùng typography tokens consistently — không set font size/weight manually.
142
+ - Dùng `Colors.black_17` cho primary readable content.
143
+ - Dùng truncation `numberOfLines` khi space constrained.
144
+ - Heading tokens cho titles, body tokens cho content.
145
+
146
+ ### Don't
147
+ - Không dùng font sizes dưới 10sp.
148
+ - Không override line height / letter spacing từ typography tokens.
149
+ - Không dùng `Colors.black_08` (Disabled) cho readable content — thiếu contrast.
150
+ - Không mix multiple font families trong cùng paragraph.
151
+ - Không dùng heading tokens cho body content hoặc ngược lại.
@@ -0,0 +1,99 @@
1
+ # Toast
2
+
3
+ > Transient notification — auto-dismiss message at top of screen. Non-interactive feedback for completed actions.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ❌ (use SnackBar)
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"` | Toast type — determines icon và color |
17
+ | `message` | string | — | required | Toast text content |
18
+ | `duration` | number | milliseconds | `3000` | Auto-dismiss duration [VERIFY] |
19
+ | `position` | string | `"top"` \| `"bottom"` | `"top"` | Screen position [VERIFY] |
20
+
21
+ ---
22
+
23
+ ## Variants
24
+
25
+ | Type | Icon | Icon Color | Background |
26
+ |------|------|-----------|-----------|
27
+ | **info** | info-circle | `Colors.blue_03` | `Colors.white` with shadow [VERIFY] |
28
+ | **warning** | warning-triangle | `Colors.orange_03` | `Colors.white` with shadow [VERIFY] |
29
+ | **error** | error-circle | `Colors.red_03` | `Colors.white` with shadow [VERIFY] |
30
+ | **success** | check-circle | `Colors.green_03` | `Colors.white` with shadow [VERIFY] |
31
+
32
+ Text color: `Colors.black_17` for all types.
33
+
34
+ ---
35
+
36
+ ## States
37
+
38
+ | State | Appearance |
39
+ |-------|-----------|
40
+ | **Entering** | Slide in from top with fade animation |
41
+ | **Visible** | Full opacity, countdown active |
42
+ | **Exiting** | Slide out with fade animation |
43
+ | **Dismissed** | Removed from view |
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
+ | **success** | Confirm completed action | Action needs follow-up | "Chuyển tiền thành công" |
52
+ | **error** | Brief error feedback | Error needs user action → dùng Information | "Không thể kết nối" |
53
+ | **warning** | Caution notification | Needs persistent visibility → dùng Information | "Mạng yếu" |
54
+ | **info** | Neutral notification | Critical information | "Đã copy mã giới thiệu" |
55
+
56
+ ---
57
+
58
+ ## SSR Pattern
59
+
60
+ ### Success Toast after Action
61
+ ```json
62
+ {
63
+ "id": "submit_action",
64
+ "type": "action",
65
+ "trigger": "onSuccess",
66
+ "toast": {
67
+ "component": "Toast",
68
+ "props": {
69
+ "type": "success",
70
+ "message": "Thanh toán thành công!"
71
+ }
72
+ }
73
+ }
74
+ ```
75
+
76
+ ---
77
+
78
+ ## Accessibility
79
+
80
+ - Announce toast content as live region — screen reader speaks message immediately.
81
+ - Auto-dismiss timing should be sufficient for screen reader to complete announcement (~3s minimum).
82
+ - Non-interactive — no tap targets within toast.
83
+
84
+ ---
85
+
86
+ ## Usage Guidelines
87
+
88
+ ### Do
89
+ - Dùng cho brief, non-critical feedback messages.
90
+ - Auto-dismiss — user không cần interact.
91
+ - Keep message short — 1 line.
92
+ - Success type cho completed actions.
93
+
94
+ ### Don't
95
+ - Không dùng cho errors requiring user action → dùng **Information** hoặc **PopupNotify**.
96
+ - Không dùng cho persistent status → dùng **Information**.
97
+ - Không include action buttons trong toast → dùng **SnackBar** (Compose).
98
+ - Không stack multiple toasts simultaneously.
99
+ - Không dùng trên Compose → dùng **SnackBar**.