@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.
- package/compose/build.gradle.kts +1 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/BottomSheet.kt +15 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/ModalScreen.kt +15 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigation.kt +1 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/NavigationContainer.kt +4 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/Navigator.kt +11 -9
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/StackScreen.kt +56 -1
- package/compose/src/commonMain/kotlin/vn/momo/kits/navigation/tracking/ScreenTracker.kt +167 -0
- package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Example.xcscheme +32 -0
- package/example/ios/Example.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/WorkspaceSettings.xcsettings +16 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +6 -0
- package/example/ios/Example.xcworkspace/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +5 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/MoMoUIKits.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/Pods-Example.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImage.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SDWebImageSwiftUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/SkeletonUI.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios-LottiePrivacyInfo.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/lottie-ios.xcscheme +58 -0
- package/example/ios/Pods/Pods.xcodeproj/xcuserdata/sonnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +60 -0
- package/gradle.properties +1 -1
- package/local.properties +2 -2
- package/package.json +1 -1
- package/.claude/settings.local.json +0 -11
- package/.claude/skills/design-system/SKILL.md +0 -88
- package/.claude/skills/design-system/references/components/avatar.md +0 -134
- package/.claude/skills/design-system/references/components/badge.md +0 -127
- package/.claude/skills/design-system/references/components/bottom-tab.md +0 -177
- package/.claude/skills/design-system/references/components/bottomsheet.md +0 -170
- package/.claude/skills/design-system/references/components/button.md +0 -206
- package/.claude/skills/design-system/references/components/carousel.md +0 -117
- package/.claude/skills/design-system/references/components/checkbox.md +0 -98
- package/.claude/skills/design-system/references/components/chip.md +0 -146
- package/.claude/skills/design-system/references/components/collapse.md +0 -120
- package/.claude/skills/design-system/references/components/date-picker.md +0 -119
- package/.claude/skills/design-system/references/components/divider.md +0 -84
- package/.claude/skills/design-system/references/components/icon.md +0 -130
- package/.claude/skills/design-system/references/components/image.md +0 -81
- package/.claude/skills/design-system/references/components/information.md +0 -107
- package/.claude/skills/design-system/references/components/input-dropdown.md +0 -138
- package/.claude/skills/design-system/references/components/input-money.md +0 -157
- package/.claude/skills/design-system/references/components/input-otp.md +0 -132
- package/.claude/skills/design-system/references/components/input-phone-number.md +0 -140
- package/.claude/skills/design-system/references/components/input-search.md +0 -124
- package/.claude/skills/design-system/references/components/input-text-area.md +0 -133
- package/.claude/skills/design-system/references/components/input.md +0 -152
- package/.claude/skills/design-system/references/components/loader.md +0 -87
- package/.claude/skills/design-system/references/components/pagination.md +0 -105
- package/.claude/skills/design-system/references/components/popup-notify.md +0 -128
- package/.claude/skills/design-system/references/components/progress-info.md +0 -114
- package/.claude/skills/design-system/references/components/radio.md +0 -86
- package/.claude/skills/design-system/references/components/rating.md +0 -126
- package/.claude/skills/design-system/references/components/skeleton.md +0 -120
- package/.claude/skills/design-system/references/components/slider.md +0 -141
- package/.claude/skills/design-system/references/components/snackbar.md +0 -97
- package/.claude/skills/design-system/references/components/stepper.md +0 -100
- package/.claude/skills/design-system/references/components/steps.md +0 -91
- package/.claude/skills/design-system/references/components/suggest-action.md +0 -95
- package/.claude/skills/design-system/references/components/swipe.md +0 -121
- package/.claude/skills/design-system/references/components/switch.md +0 -98
- package/.claude/skills/design-system/references/components/tab-view.md +0 -120
- package/.claude/skills/design-system/references/components/tag.md +0 -118
- package/.claude/skills/design-system/references/components/text.md +0 -151
- package/.claude/skills/design-system/references/components/toast.md +0 -99
- package/.claude/skills/design-system/references/components/tooltip.md +0 -138
- package/.claude/skills/design-system/references/components/top-nav-miniapp.md +0 -94
- package/.claude/skills/design-system/references/components/top-nav.md +0 -226
- package/.claude/skills/design-system/references/components/uploader.md +0 -115
- package/.claude/skills/design-system/references/navigation/bottom-tab.md +0 -131
- package/.claude/skills/design-system/references/navigation/bottomsheet.md +0 -161
- package/.claude/skills/design-system/references/navigation/modal.md +0 -133
- package/.claude/skills/design-system/references/navigation/navigation-options.md +0 -225
- package/.claude/skills/design-system/references/navigation/navigator.md +0 -111
- package/.claude/skills/design-system/references/navigation/setup.md +0 -134
- package/.claude/skills/design-system/references/navigation/stack.md +0 -128
- package/.claude/skills/design-system/references/spec-convention.md +0 -80
- package/.claude/skills/design-system/references/tokens/colors.md +0 -131
- package/.claude/skills/design-system/references/tokens/spacing-radius.md +0 -144
- package/.claude/skills/design-system/references/tokens/theme.md +0 -125
- package/.claude/skills/design-system/references/tokens/typography.md +0 -135
- package/.claude/skills/design-system-kits/SKILL.md +0 -102
- package/.claude/skills/design-system-kits/references/code-convention.md +0 -118
- package/.claude/skills/design-system-kits/references/components/avatar.md +0 -45
- package/.claude/skills/design-system-kits/references/components/badge.md +0 -27
- package/.claude/skills/design-system-kits/references/components/button.md +0 -65
- package/.claude/skills/design-system-kits/references/components/carousel.md +0 -51
- package/.claude/skills/design-system-kits/references/components/checkbox.md +0 -39
- package/.claude/skills/design-system-kits/references/components/chip.md +0 -54
- package/.claude/skills/design-system-kits/references/components/collapse.md +0 -63
- package/.claude/skills/design-system-kits/references/components/date-picker.md +0 -36
- package/.claude/skills/design-system-kits/references/components/divider.md +0 -21
- package/.claude/skills/design-system-kits/references/components/icon.md +0 -382
- package/.claude/skills/design-system-kits/references/components/image.md +0 -62
- package/.claude/skills/design-system-kits/references/components/information.md +0 -61
- package/.claude/skills/design-system-kits/references/components/input-dropdown.md +0 -92
- package/.claude/skills/design-system-kits/references/components/input-money.md +0 -128
- package/.claude/skills/design-system-kits/references/components/input-otp.md +0 -85
- package/.claude/skills/design-system-kits/references/components/input-phone-number.md +0 -96
- package/.claude/skills/design-system-kits/references/components/input-search.md +0 -127
- package/.claude/skills/design-system-kits/references/components/input-text-area.md +0 -100
- package/.claude/skills/design-system-kits/references/components/input.md +0 -126
- package/.claude/skills/design-system-kits/references/components/loader.md +0 -41
- package/.claude/skills/design-system-kits/references/components/pagination.md +0 -47
- package/.claude/skills/design-system-kits/references/components/popup-notify.md +0 -69
- package/.claude/skills/design-system-kits/references/components/popup-promotion.md +0 -35
- package/.claude/skills/design-system-kits/references/components/progress-info.md +0 -55
- package/.claude/skills/design-system-kits/references/components/radio.md +0 -42
- package/.claude/skills/design-system-kits/references/components/rating.md +0 -36
- package/.claude/skills/design-system-kits/references/components/skeleton.md +0 -25
- package/.claude/skills/design-system-kits/references/components/slider.md +0 -53
- package/.claude/skills/design-system-kits/references/components/snackbar.md +0 -52
- package/.claude/skills/design-system-kits/references/components/stepper.md +0 -46
- package/.claude/skills/design-system-kits/references/components/steps.md +0 -57
- package/.claude/skills/design-system-kits/references/components/suggest-action.md +0 -44
- package/.claude/skills/design-system-kits/references/components/swipe.md +0 -44
- package/.claude/skills/design-system-kits/references/components/switch.md +0 -43
- package/.claude/skills/design-system-kits/references/components/tab-view.md +0 -56
- package/.claude/skills/design-system-kits/references/components/tag.md +0 -50
- package/.claude/skills/design-system-kits/references/components/text.md +0 -56
- package/.claude/skills/design-system-kits/references/components/toast.md +0 -51
- package/.claude/skills/design-system-kits/references/components/tooltip.md +0 -95
- package/.claude/skills/design-system-kits/references/components/uploader.md +0 -48
- package/.claude/skills/design-system-kits/references/design-spec-structure.md +0 -356
- package/.claude/skills/design-system-kits/references/design-spec-to-code.md +0 -596
- package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +0 -155
- package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +0 -94
- package/.claude/skills/design-system-kits/references/navigation/modal.md +0 -125
- package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +0 -430
- package/.claude/skills/design-system-kits/references/navigation/navigator.md +0 -177
- package/.claude/skills/design-system-kits/references/navigation/setup.md +0 -94
- package/.claude/skills/design-system-kits/references/navigation/stack.md +0 -152
- package/.claude/skills/design-system-kits/references/screen-layout-rule.md +0 -125
- package/.claude/skills/design-system-kits/references/tokens/colors.md +0 -183
- package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +0 -45
- package/.claude/skills/design-system-kits/references/tokens/theme.md +0 -97
- package/.claude/skills/design-system-kits/references/tokens/typography.md +0 -105
- package/.claude/skills/vibe-design/SKILL.md +0 -306
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# Swipe
|
|
2
|
-
|
|
3
|
-
> Swipeable list item — horizontal swipe reveals hidden action buttons (delete, edit, archive).
|
|
4
|
-
|
|
5
|
-
**Package:** `@momo-kits/swipe`
|
|
6
|
-
**Platform:** RN ✅ | Compose ❌ (use SwipeToDismissBox)
|
|
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
|
-
| `actions` | array | `[{ label, icon, color, onPress }]` | required | Right-side action buttons revealed on swipe |
|
|
17
|
-
| `leftActions` | array | `[{ label, icon, color, onPress }]` | — | Optional left-side actions (swipe right to reveal) [VERIFY] |
|
|
18
|
-
| `disabled` | boolean | `true` \| `false` | `false` | Disable swipe gesture |
|
|
19
|
-
| `children` | element | — | required | Content layer — the visible list item |
|
|
20
|
-
|
|
21
|
-
### Action Object
|
|
22
|
-
|
|
23
|
-
| Field | Type | Values | Required | Description |
|
|
24
|
-
|-------|------|--------|----------|-------------|
|
|
25
|
-
| `label` | string | — | yes | Action button text |
|
|
26
|
-
| `icon` | string | icon name | no | Action button icon [VERIFY] |
|
|
27
|
-
| `color` | string | color token | yes | Action button background color |
|
|
28
|
-
| `onPress` | function | — | yes | Callback. `"onPress": "action://deleteItem={{item.id}}"` |
|
|
29
|
-
|
|
30
|
-
### Common Action Colors
|
|
31
|
-
|
|
32
|
-
| Action | Background |
|
|
33
|
-
|--------|-----------|
|
|
34
|
-
| Delete | `Colors.red_03` |
|
|
35
|
-
| Archive | `Colors.blue_03` |
|
|
36
|
-
| Edit | `Colors.orange_03` |
|
|
37
|
-
| Pin | `Colors.pink_03` |
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## States
|
|
42
|
-
|
|
43
|
-
| State | Appearance | Interactive |
|
|
44
|
-
|-------|-----------|-------------|
|
|
45
|
-
| **Resting** | Content fully visible, actions hidden | true (swipeable) |
|
|
46
|
-
| **Swiping** | Content moves left, actions partially revealed | true |
|
|
47
|
-
| **Actions open** | Content offset, action buttons fully visible | true |
|
|
48
|
-
| **Action pressed** | Pressed action button opacity 0.8 | true |
|
|
49
|
-
| **Disabled** | No swipe gesture response | false |
|
|
50
|
-
|
|
51
|
-
Auto-close: opening another Swipe item closes previously open items.
|
|
52
|
-
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
## Variant-to-Context Map
|
|
56
|
-
|
|
57
|
-
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
58
|
-
|---------|-------------|-----------|-------------------|
|
|
59
|
-
| **List item actions** | Secondary actions on list items (delete, archive) | Primary actions → show visibly | Xóa tin nhắn, archive notification |
|
|
60
|
-
| **Quick edit** | Fast inline editing actions | Complex editing → navigate to edit screen | Sửa tên nhóm, pin conversation |
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## SSR Pattern
|
|
65
|
-
|
|
66
|
-
### Swipeable Notification List
|
|
67
|
-
```json
|
|
68
|
-
{
|
|
69
|
-
"id": "notification_list",
|
|
70
|
-
"type": "section",
|
|
71
|
-
"forEach": "{{data.notifications}}",
|
|
72
|
-
"render": {
|
|
73
|
-
"component": "Swipe",
|
|
74
|
-
"props": {
|
|
75
|
-
"actions": [
|
|
76
|
-
{
|
|
77
|
-
"label": "Xóa",
|
|
78
|
-
"color": "Colors.red_03",
|
|
79
|
-
"onPress": "action://deleteNotification={{item.id}}"
|
|
80
|
-
}
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
"children": [
|
|
84
|
-
{
|
|
85
|
-
"component": "Text",
|
|
86
|
-
"props": {
|
|
87
|
-
"content": "{{item.message}}",
|
|
88
|
-
"typography": "body_default_regular"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Accessibility
|
|
99
|
-
|
|
100
|
-
- Swipe actions PHẢI có alternative access (long-press menu hoặc accessible actions list).
|
|
101
|
-
- Each action button: clear accessible label ("Xóa mục", "Lưu trữ").
|
|
102
|
-
- Screen reader users cannot swipe — provide fallback interaction.
|
|
103
|
-
- Khi actions revealed → focusable by assistive technology.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Usage Guidelines
|
|
108
|
-
|
|
109
|
-
### Do
|
|
110
|
-
- Dùng cho secondary actions on list items — delete, archive, edit.
|
|
111
|
-
- Limit 2-3 action buttons per item.
|
|
112
|
-
- Distinct colors per action for quick identification.
|
|
113
|
-
- Destructive action (Delete) rightmost.
|
|
114
|
-
- Confirmation dialog cho destructive actions.
|
|
115
|
-
|
|
116
|
-
### Don't
|
|
117
|
-
- Không dùng cho primary actions → make them visible by default.
|
|
118
|
-
- Không dùng cho navigation → dùng tap.
|
|
119
|
-
- Không >3 action buttons — cramped and hard to target.
|
|
120
|
-
- Không rely solely on swipe — always provide accessible fallback.
|
|
121
|
-
- Không dùng on items with horizontal scrolling — gesture conflict.
|
|
@@ -1,98 +0,0 @@
|
|
|
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.
|
|
@@ -1,120 +0,0 @@
|
|
|
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.
|
|
@@ -1,118 +0,0 @@
|
|
|
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.
|
|
@@ -1,151 +0,0 @@
|
|
|
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.
|