@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.
- package/.claude/settings.local.json +11 -0
- package/.claude/skills/design-system/SKILL.md +88 -0
- package/.claude/skills/design-system/references/components/avatar.md +134 -0
- package/.claude/skills/design-system/references/components/badge.md +127 -0
- package/.claude/skills/design-system/references/components/bottom-tab.md +177 -0
- package/.claude/skills/design-system/references/components/bottomsheet.md +170 -0
- package/.claude/skills/design-system/references/components/button.md +206 -0
- package/.claude/skills/design-system/references/components/carousel.md +117 -0
- package/.claude/skills/design-system/references/components/checkbox.md +98 -0
- package/.claude/skills/design-system/references/components/chip.md +146 -0
- package/.claude/skills/design-system/references/components/collapse.md +120 -0
- package/.claude/skills/design-system/references/components/date-picker.md +119 -0
- package/.claude/skills/design-system/references/components/divider.md +84 -0
- package/.claude/skills/design-system/references/components/icon.md +130 -0
- package/.claude/skills/design-system/references/components/image.md +81 -0
- package/.claude/skills/design-system/references/components/information.md +107 -0
- package/.claude/skills/design-system/references/components/input-dropdown.md +138 -0
- package/.claude/skills/design-system/references/components/input-money.md +157 -0
- package/.claude/skills/design-system/references/components/input-otp.md +132 -0
- package/.claude/skills/design-system/references/components/input-phone-number.md +140 -0
- package/.claude/skills/design-system/references/components/input-search.md +124 -0
- package/.claude/skills/design-system/references/components/input-text-area.md +133 -0
- package/.claude/skills/design-system/references/components/input.md +152 -0
- package/.claude/skills/design-system/references/components/loader.md +87 -0
- package/.claude/skills/design-system/references/components/pagination.md +105 -0
- package/.claude/skills/design-system/references/components/popup-notify.md +128 -0
- package/.claude/skills/design-system/references/components/progress-info.md +114 -0
- package/.claude/skills/design-system/references/components/radio.md +86 -0
- package/.claude/skills/design-system/references/components/rating.md +126 -0
- package/.claude/skills/design-system/references/components/skeleton.md +120 -0
- package/.claude/skills/design-system/references/components/slider.md +141 -0
- package/.claude/skills/design-system/references/components/snackbar.md +97 -0
- package/.claude/skills/design-system/references/components/stepper.md +100 -0
- package/.claude/skills/design-system/references/components/steps.md +91 -0
- package/.claude/skills/design-system/references/components/suggest-action.md +95 -0
- package/.claude/skills/design-system/references/components/swipe.md +121 -0
- package/.claude/skills/design-system/references/components/switch.md +98 -0
- package/.claude/skills/design-system/references/components/tab-view.md +120 -0
- package/.claude/skills/design-system/references/components/tag.md +118 -0
- package/.claude/skills/design-system/references/components/text.md +151 -0
- package/.claude/skills/design-system/references/components/toast.md +99 -0
- package/.claude/skills/design-system/references/components/tooltip.md +138 -0
- package/.claude/skills/design-system/references/components/top-nav-miniapp.md +94 -0
- package/.claude/skills/design-system/references/components/top-nav.md +226 -0
- package/.claude/skills/design-system/references/components/uploader.md +115 -0
- package/.claude/skills/design-system/references/navigation/bottom-tab.md +131 -0
- package/.claude/skills/design-system/references/navigation/bottomsheet.md +161 -0
- package/.claude/skills/design-system/references/navigation/modal.md +133 -0
- package/.claude/skills/design-system/references/navigation/navigation-options.md +225 -0
- package/.claude/skills/design-system/references/navigation/navigator.md +111 -0
- package/.claude/skills/design-system/references/navigation/setup.md +134 -0
- package/.claude/skills/design-system/references/navigation/stack.md +128 -0
- package/.claude/skills/design-system/references/spec-convention.md +80 -0
- package/.claude/skills/design-system/references/tokens/colors.md +131 -0
- package/.claude/skills/design-system/references/tokens/spacing-radius.md +144 -0
- package/.claude/skills/design-system/references/tokens/theme.md +125 -0
- package/.claude/skills/design-system/references/tokens/typography.md +135 -0
- package/.claude/skills/design-system-kits/SKILL.md +102 -0
- package/.claude/skills/design-system-kits/references/code-convention.md +118 -0
- package/.claude/skills/design-system-kits/references/components/avatar.md +45 -0
- package/.claude/skills/design-system-kits/references/components/badge.md +27 -0
- package/.claude/skills/design-system-kits/references/components/button.md +65 -0
- package/.claude/skills/design-system-kits/references/components/carousel.md +51 -0
- package/.claude/skills/design-system-kits/references/components/checkbox.md +39 -0
- package/.claude/skills/design-system-kits/references/components/chip.md +54 -0
- package/.claude/skills/design-system-kits/references/components/collapse.md +63 -0
- package/.claude/skills/design-system-kits/references/components/date-picker.md +36 -0
- package/.claude/skills/design-system-kits/references/components/divider.md +21 -0
- package/.claude/skills/design-system-kits/references/components/icon.md +382 -0
- package/.claude/skills/design-system-kits/references/components/image.md +62 -0
- package/.claude/skills/design-system-kits/references/components/information.md +61 -0
- package/.claude/skills/design-system-kits/references/components/input-dropdown.md +92 -0
- package/.claude/skills/design-system-kits/references/components/input-money.md +128 -0
- package/.claude/skills/design-system-kits/references/components/input-otp.md +85 -0
- package/.claude/skills/design-system-kits/references/components/input-phone-number.md +96 -0
- package/.claude/skills/design-system-kits/references/components/input-search.md +127 -0
- package/.claude/skills/design-system-kits/references/components/input-text-area.md +100 -0
- package/.claude/skills/design-system-kits/references/components/input.md +126 -0
- package/.claude/skills/design-system-kits/references/components/loader.md +41 -0
- package/.claude/skills/design-system-kits/references/components/pagination.md +47 -0
- package/.claude/skills/design-system-kits/references/components/popup-notify.md +69 -0
- package/.claude/skills/design-system-kits/references/components/popup-promotion.md +35 -0
- package/.claude/skills/design-system-kits/references/components/progress-info.md +55 -0
- package/.claude/skills/design-system-kits/references/components/radio.md +42 -0
- package/.claude/skills/design-system-kits/references/components/rating.md +36 -0
- package/.claude/skills/design-system-kits/references/components/skeleton.md +25 -0
- package/.claude/skills/design-system-kits/references/components/slider.md +53 -0
- package/.claude/skills/design-system-kits/references/components/snackbar.md +52 -0
- package/.claude/skills/design-system-kits/references/components/stepper.md +46 -0
- package/.claude/skills/design-system-kits/references/components/steps.md +57 -0
- package/.claude/skills/design-system-kits/references/components/suggest-action.md +44 -0
- package/.claude/skills/design-system-kits/references/components/swipe.md +44 -0
- package/.claude/skills/design-system-kits/references/components/switch.md +43 -0
- package/.claude/skills/design-system-kits/references/components/tab-view.md +56 -0
- package/.claude/skills/design-system-kits/references/components/tag.md +50 -0
- package/.claude/skills/design-system-kits/references/components/text.md +56 -0
- package/.claude/skills/design-system-kits/references/components/toast.md +51 -0
- package/.claude/skills/design-system-kits/references/components/tooltip.md +95 -0
- package/.claude/skills/design-system-kits/references/components/uploader.md +48 -0
- package/.claude/skills/design-system-kits/references/design-spec-structure.md +356 -0
- package/.claude/skills/design-system-kits/references/design-spec-to-code.md +596 -0
- package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +155 -0
- package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/modal.md +125 -0
- package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +430 -0
- package/.claude/skills/design-system-kits/references/navigation/navigator.md +177 -0
- package/.claude/skills/design-system-kits/references/navigation/setup.md +94 -0
- package/.claude/skills/design-system-kits/references/navigation/stack.md +152 -0
- package/.claude/skills/design-system-kits/references/screen-layout-rule.md +125 -0
- package/.claude/skills/design-system-kits/references/tokens/colors.md +183 -0
- package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +45 -0
- package/.claude/skills/design-system-kits/references/tokens/theme.md +97 -0
- package/.claude/skills/design-system-kits/references/tokens/typography.md +105 -0
- package/.claude/skills/vibe-design/SKILL.md +306 -0
- package/compose/build.gradle.kts +1 -1
- package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +7 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +2 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +3 -0
- package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +5 -2
- package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +2 -11
- package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +5 -1
- package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -0
- package/gradle.properties +1 -1
- package/ios/Popup/PopupPromotion.swift +2 -2
- package/local.properties +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(yarn react-native:*)",
|
|
5
|
+
"Read(//Users/phuc/.claude/skills/ai-skill-generator/**)",
|
|
6
|
+
"Bash(python3 scripts/install_skill.py --update)",
|
|
7
|
+
"Bash(cd /Users/phuc/momo-kits/.claude/skills/design-system-kits && mkdir -p .claude/skills/design-system-kits && mv SKILL.md README.md references .claude/skills/design-system-kits/)",
|
|
8
|
+
"Bash(mv .claude/skills/design-system-kits/* . && rmdir .claude/skills/design-system-kits && rmdir .claude/skills)"
|
|
9
|
+
]
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-system
|
|
3
|
+
description: Use this skill when designers need to create design specifications, usage guidelines, rules, or documentation for the MoMo KitX design system. Helps define visual specs, component usage rules, design patterns, and accessibility guidelines. Maps 1:1 with design-system-kits.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Prereqs
|
|
8
|
+
- Read [references/spec-convention.md](references/spec-convention.md) before generating design specs
|
|
9
|
+
|
|
10
|
+
## How to Use
|
|
11
|
+
|
|
12
|
+
1. **Identify the task**: spec, guideline, rule, or pattern documentation
|
|
13
|
+
2. **Find reference** in catalog tables below
|
|
14
|
+
3. **Load reference file** for visual specs, usage rules, and guidelines
|
|
15
|
+
4. **Generate documentation** with correct token names and component mapping
|
|
16
|
+
|
|
17
|
+
## References
|
|
18
|
+
|
|
19
|
+
### Design Tokens
|
|
20
|
+
| File | Load when... |
|
|
21
|
+
|------|-------------|
|
|
22
|
+
| `references/tokens/colors.md` | Color usage rules, palette, accessibility |
|
|
23
|
+
| `references/tokens/theme.md` | Light/dark theme specs, semantic colors |
|
|
24
|
+
| `references/tokens/typography.md` | Type scale, hierarchy, pairing rules |
|
|
25
|
+
| `references/tokens/spacing-radius.md` | Spacing system, radius, layout grid |
|
|
26
|
+
|
|
27
|
+
### Components
|
|
28
|
+
| File | Component | RN | Compose |
|
|
29
|
+
|------|-----------|:--:|:------:|
|
|
30
|
+
| `references/components/button.md` | Button | ✅ | ✅ |
|
|
31
|
+
| `references/components/text.md` | Text | ✅ | ✅ |
|
|
32
|
+
| `references/components/input.md` | Input | ✅ | ✅ |
|
|
33
|
+
| `references/components/input-search.md` | InputSearch | ✅ | ✅ |
|
|
34
|
+
| `references/components/input-text-area.md` | InputTextArea | ✅ | ✅ |
|
|
35
|
+
| `references/components/input-dropdown.md` | InputDropDown | ✅ | ✅ |
|
|
36
|
+
| `references/components/input-phone-number.md` | InputPhoneNumber | ✅ | ✅ |
|
|
37
|
+
| `references/components/input-money.md` | InputMoney | ✅ | ✅ |
|
|
38
|
+
| `references/components/input-otp.md` | InputOTP | ✅ | ✅ |
|
|
39
|
+
| `references/components/checkbox.md` | CheckBox | ✅ | ✅ |
|
|
40
|
+
| `references/components/radio.md` | Radio | ✅ | ✅ |
|
|
41
|
+
| `references/components/switch.md` | Switch | ✅ | ✅ |
|
|
42
|
+
| `references/components/icon.md` | Icon | ✅ | ✅ |
|
|
43
|
+
| `references/components/image.md` | Image | ✅ | ✅ |
|
|
44
|
+
| `references/components/badge.md` | Badge, BadgeDot | ✅ | ✅ |
|
|
45
|
+
| `references/components/tag.md` | Tag | ✅ | ✅ |
|
|
46
|
+
| `references/components/chip.md` | Chip | ✅ | ✅ |
|
|
47
|
+
| `references/components/popup-notify.md` | PopupNotify | ✅ | ✅ |
|
|
48
|
+
| `references/components/toast.md` | Toast | ✅ | ❌ |
|
|
49
|
+
| `references/components/snackbar.md` | SnackBar | ✅ | ✅ |
|
|
50
|
+
| `references/components/skeleton.md` | Skeleton | ✅ | ✅ |
|
|
51
|
+
| `references/components/loader.md` | Loader | ✅ | ❌ |
|
|
52
|
+
| `references/components/tooltip.md` | Tooltip | ✅ | ✅ |
|
|
53
|
+
| `references/components/avatar.md` | Avatar | ✅ | ❌ |
|
|
54
|
+
| `references/components/carousel.md` | Carousel | ✅ | ❌ |
|
|
55
|
+
| `references/components/tab-view.md` | TabView | ✅ | ❌ |
|
|
56
|
+
| `references/components/divider.md` | Divider | ✅ | ✅ |
|
|
57
|
+
| `references/components/pagination.md` | Pagination | ✅ | ✅ |
|
|
58
|
+
| `references/components/progress-info.md` | ProgressInfo | ✅ | ❌ |
|
|
59
|
+
| `references/components/rating.md` | Rating | ✅ | ❌ |
|
|
60
|
+
| `references/components/slider.md` | Slider | ✅ | ❌ |
|
|
61
|
+
| `references/components/stepper.md` | Stepper | ✅ | ❌ |
|
|
62
|
+
| `references/components/steps.md` | Steps | ✅ | ❌ |
|
|
63
|
+
| `references/components/collapse.md` | Collapse | ✅ | ❌ |
|
|
64
|
+
| `references/components/swipe.md` | Swipe | ✅ | ❌ |
|
|
65
|
+
| `references/components/suggest-action.md` | SuggestAction | ✅ | ❌ |
|
|
66
|
+
| `references/components/uploader.md` | Uploader | ✅ | ❌ |
|
|
67
|
+
| `references/components/date-picker.md` | DatePicker | ✅ | ✅ |
|
|
68
|
+
| `references/components/information.md` | Information | ✅ | ✅ |
|
|
69
|
+
|
|
70
|
+
### Navigation
|
|
71
|
+
| File | Load when... |
|
|
72
|
+
|------|------------------------------------------------|
|
|
73
|
+
| `references/navigation/setup.md` | Screen layout structure, containers |
|
|
74
|
+
| `references/navigation/stack.md` | Screen header, scroll behavior |
|
|
75
|
+
| `references/navigation/navigation-options.md` | Header title, background, right buttons |
|
|
76
|
+
| `references/navigation/navigator.md` | Screen transitions, push/pop patterns |
|
|
77
|
+
| `references/navigation/bottom-tab.md` | Bottom tab bar specs |
|
|
78
|
+
| `references/navigation/modal.md` | Modal overlay patterns |
|
|
79
|
+
| `references/navigation/bottomsheet.md` | Bottom sheet patterns |
|
|
80
|
+
|
|
81
|
+
## Important Rules
|
|
82
|
+
|
|
83
|
+
1. **Always use design tokens** — Never reference raw hex/px values without mapping to a token name
|
|
84
|
+
2. **Component mapping** — Every visual element must map to a KitX component
|
|
85
|
+
3. **State coverage** — Specs must define all states: default, pressed, disabled, error, loading
|
|
86
|
+
4. **Accessibility** — Include contrast ratios (WCAG AA min), touch targets (44pt min), screen reader notes
|
|
87
|
+
5. **Platform parity** — Note when specs differ between React Native and Compose Multiplatform
|
|
88
|
+
6. **Bilingual** — Use English for specs, add Vietnamese labels (tieng Viet) where relevant for MoMo team
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
> User/entity representation — profile photo, initials fallback, hoặc placeholder icon. Supports grouping.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/avatar`
|
|
6
|
+
**Platform:** RN ✅ | Compose ❌ (build with Image + Text)
|
|
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
|
+
| `source` | object | `{ uri: string }` | — | Image source. Khi `null`/error → fallback to initials hoặc placeholder |
|
|
17
|
+
| `name` | string | — | — | Full name — dùng để generate initials fallback (first letter of first + last word) |
|
|
18
|
+
| `size` | string | `"xxs"` \| `"xs"` \| `"s"` \| `"m"` \| `"l"` \| `"xl"` \| `"xxl"` | `"m"` | Avatar size. xxs=24dp, xs=28dp, s=32dp, m=40dp, l=48dp, xl=56dp, xxl=72dp [VERIFY] |
|
|
19
|
+
| `shape` | string | `"circle"` \| `"square"` | `"circle"` | Avatar shape [VERIFY] |
|
|
20
|
+
| `badge` | element | — | — | Optional Badge overlay (e.g., online indicator, verification) [VERIFY] |
|
|
21
|
+
| `onPress` | function | — | — | Callback khi tap avatar. `"onPress": "navigate://Profile"` |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Variants
|
|
26
|
+
|
|
27
|
+
| Variant | Display | Fallback Priority |
|
|
28
|
+
|---------|---------|-------------------|
|
|
29
|
+
| **Image** | Photo from `source.uri` | — |
|
|
30
|
+
| **Initials** | 1-2 letter initials from `name` on colored background | When `source` is null or fails to load |
|
|
31
|
+
| **Placeholder** | Generic person icon | When both `source` and `name` are absent |
|
|
32
|
+
|
|
33
|
+
### Initials Background Colors
|
|
34
|
+
|
|
35
|
+
Background color derived from `name` string hash — consistent color per user. Colors from predefined palette [VERIFY].
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## States
|
|
40
|
+
|
|
41
|
+
| State | Appearance | Interactive |
|
|
42
|
+
|-------|-----------|-------------|
|
|
43
|
+
| **Image loaded** | Photo displayed, clipped to shape | per onPress |
|
|
44
|
+
| **Loading** | Placeholder/shimmer while image loads | false |
|
|
45
|
+
| **Error / No image** | Initials (if `name` provided) or generic icon | per onPress |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Avatar Group
|
|
50
|
+
|
|
51
|
+
`AvatarGroup` renders multiple avatars overlapping horizontally.
|
|
52
|
+
|
|
53
|
+
| Prop | Type | Values | Default | Description |
|
|
54
|
+
|------|------|--------|---------|-------------|
|
|
55
|
+
| `avatars` | array | `[{ source, name }]` | required | List of avatar data |
|
|
56
|
+
| `max` | number | — | `3` | Maximum visible avatars. Overflow shown as `+N` circle [VERIFY] |
|
|
57
|
+
| `size` | string | Same as Avatar | `"s"` | Size for all avatars in group |
|
|
58
|
+
| `overlap` | number | dp value | `8` | Horizontal overlap between avatars [VERIFY] |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Variant-to-Context Map
|
|
63
|
+
|
|
64
|
+
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
65
|
+
|---------|-------------|-----------|-------------------|
|
|
66
|
+
| **Profile display** | Show user identity in header, list, card | Decorative/non-user images | Avatar trên profile screen, chat list |
|
|
67
|
+
| **Group display** | Show multiple participants | >5 visible → dùng list | Nhóm chia bill, nhóm chat |
|
|
68
|
+
| **Placeholder** | User chưa upload ảnh | — | New user onboarding |
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## SSR Pattern
|
|
73
|
+
|
|
74
|
+
### User Profile Row
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"id": "user_profile",
|
|
78
|
+
"type": "row",
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"component": "Avatar",
|
|
82
|
+
"props": {
|
|
83
|
+
"source": { "uri": "{{data.user.avatarUrl}}" },
|
|
84
|
+
"name": "{{data.user.fullName}}",
|
|
85
|
+
"size": "l"
|
|
86
|
+
},
|
|
87
|
+
"onPress": "navigate://Profile"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"component": "Text",
|
|
91
|
+
"props": {
|
|
92
|
+
"content": "{{data.user.fullName}}",
|
|
93
|
+
"typography": "body_default_bold"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Avatar Group
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"component": "AvatarGroup",
|
|
104
|
+
"props": {
|
|
105
|
+
"avatars": "{{data.participants}}",
|
|
106
|
+
"max": 3,
|
|
107
|
+
"size": "s"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Accessibility
|
|
115
|
+
|
|
116
|
+
- Announce avatar as: "Avatar of [name]" hoặc "Profile photo".
|
|
117
|
+
- Initials fallback announce full name, not just letters.
|
|
118
|
+
- onPress → announce as button with label.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Usage Guidelines
|
|
123
|
+
|
|
124
|
+
### Do
|
|
125
|
+
- Dùng cho user/entity representation.
|
|
126
|
+
- Always provide `name` — ensures initials fallback khi image fails.
|
|
127
|
+
- Consistent sizing within same list/context.
|
|
128
|
+
- AvatarGroup cho participant previews.
|
|
129
|
+
|
|
130
|
+
### Don't
|
|
131
|
+
- Không dùng cho product/brand images → dùng **Image** component.
|
|
132
|
+
- Không dùng square shape cho user profiles — circle là standard.
|
|
133
|
+
- Không dùng xxl trong lists — only for profile screens.
|
|
134
|
+
- Không show >5 avatars inline → dùng AvatarGroup with `max`.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
> Numeric or dot indicator — signal unread counts, notifications, hoặc status trên parent element.
|
|
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
|
+
| `type` | string | `"badge"` \| `"badgeDot"` \| `"badgeRibbon"` | `"badge"` | Badge variant [VERIFY] |
|
|
17
|
+
| `value` | string/number | — | — | Badge content. Number hoặc text ("Mới"). "99+" for overflow |
|
|
18
|
+
| `size` | string | `"small"` \| `"large"` | `"small"` | Size cho BadgeDot variant [VERIFY] |
|
|
19
|
+
| `backgroundColor` | string | `Colors.*` token | `"Colors.red_03"` | Badge background color [VERIFY] |
|
|
20
|
+
| `visible` | boolean | `true` \| `false` | `true` | Show/hide badge. Count = 0 → auto hide [VERIFY] |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Variants
|
|
25
|
+
|
|
26
|
+
| Variant | Description | Content | Color |
|
|
27
|
+
|---------|-----------|---------|-------|
|
|
28
|
+
| **badge** | Capsule với numeric/text value | Number hoặc short text ("99+", "Mới") | `Colors.red_03` bg, `Colors.white` text |
|
|
29
|
+
| **badgeDot** | Simple circle, no text | — | `Colors.red_03` |
|
|
30
|
+
| **badgeRibbon** | Ribbon-style label trên card/image edge | Short text | `Colors.red_03` bg, `Colors.white` text |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## States
|
|
35
|
+
|
|
36
|
+
| State | Appearance | Description |
|
|
37
|
+
|-------|-----------|-------------|
|
|
38
|
+
| **Visible** | Badge displayed | Count > 0 hoặc status active |
|
|
39
|
+
| **Hidden** | Badge removed entirely | Count = 0 → auto hide. Không show "0" |
|
|
40
|
+
|
|
41
|
+
Badge là non-interactive — chỉ display indicator.
|
|
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
|
+
| **badge** (numeric) | Unread message/notification count | Count = 0 → hide | Chat tab badge "3", Notification bell "12" |
|
|
50
|
+
| **badgeDot** | Signal new/unread status without count | Cần show số cụ thể → dùng badge | Profile tab có update mới, Setting có item mới |
|
|
51
|
+
| **badgeRibbon** | Promotional label trên card/image | Trong list item đơn giản → dùng Tag | "Giảm 50%" ribbon trên deal card |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## SSR Pattern
|
|
56
|
+
|
|
57
|
+
### Badge on Tab Icon
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"icon": "chat",
|
|
61
|
+
"label": "Chat",
|
|
62
|
+
"screen": "Chat",
|
|
63
|
+
"badge": "numericBadge",
|
|
64
|
+
"badgeValue": 3
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Badge Dot on Avatar
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"id": "user_avatar",
|
|
72
|
+
"type": "stack",
|
|
73
|
+
"children": [
|
|
74
|
+
{
|
|
75
|
+
"component": "Avatar",
|
|
76
|
+
"props": {
|
|
77
|
+
"source": "{{data.avatar}}",
|
|
78
|
+
"size": "medium"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"component": "Badge",
|
|
83
|
+
"props": {
|
|
84
|
+
"type": "badgeDot",
|
|
85
|
+
"size": "small"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Ribbon on Card
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"component": "Badge",
|
|
96
|
+
"props": {
|
|
97
|
+
"type": "badgeRibbon",
|
|
98
|
+
"value": "Giảm 50%",
|
|
99
|
+
"backgroundColor": "Colors.red_03"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Accessibility
|
|
107
|
+
|
|
108
|
+
- Badge value announce as part of parent element: "Chat, 3 thông báo mới".
|
|
109
|
+
- BadgeDot: convey "mới" hoặc "unread" status to screen readers.
|
|
110
|
+
- Không rely solely on badge color để convey meaning.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Usage Guidelines
|
|
115
|
+
|
|
116
|
+
### Do
|
|
117
|
+
- Dùng Badge cho unread message/notification counts.
|
|
118
|
+
- Dùng BadgeDot cho new/unread status without specific count.
|
|
119
|
+
- Dùng BadgeRibbon cho promotional labels trên cards.
|
|
120
|
+
- Hide badge khi count = 0.
|
|
121
|
+
- Keep badge text short.
|
|
122
|
+
|
|
123
|
+
### Don't
|
|
124
|
+
- Không dùng Badge cho categorization — dùng **Tag**.
|
|
125
|
+
- Không dùng Badge cho status text ("Active", "Pending") — dùng **Tag**.
|
|
126
|
+
- Không display large strings trong Badge.
|
|
127
|
+
- Không đặt multiple badges trên cùng element.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# BottomTabBar
|
|
2
|
+
|
|
3
|
+
> Fixed bottom navigation bar cho app-level navigation giữa top-level screens. 3–5 tabs + optional FAB.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/foundation`
|
|
6
|
+
**Platform:** RN ✅ | Compose ❌ (dùng BottomNavigation Material3)
|
|
7
|
+
**Completeness:** need_update — Figma node ID unresolved
|
|
8
|
+
**Figma node:** [VERIFY]
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Variant Axes
|
|
13
|
+
|
|
14
|
+
| Property | Type | Values | Description |
|
|
15
|
+
|----------|------|--------|-------------|
|
|
16
|
+
| type | variant | default · special | Default = standard tabs. Special = center FAB elevated |
|
|
17
|
+
| itemCount | variant | 2 · 3 · 4 · 5 | Số tabs. Special type chỉ support 3 hoặc 5 [VERIFY] |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Values | Default | Description |
|
|
24
|
+
|------|------|--------|---------|-------------|
|
|
25
|
+
| `type` | string | `"default"` \| `"special"` | `"default"` | Tab bar type |
|
|
26
|
+
| `tabs` | array | Tab objects (2-5) | required | Tab configuration. Mỗi tab: `{ icon, label, screen, badge }` |
|
|
27
|
+
| `activeTab` | number | index (0-based) | `0` | Currently active tab index |
|
|
28
|
+
| `itemCount` | number | `2` \| `3` \| `4` \| `5` | — | Số tabs [VERIFY] |
|
|
29
|
+
| `onTabPress` | function | — | — | Callback khi tap tab. `"onTabPress": "navigate://TabScreen"` |
|
|
30
|
+
|
|
31
|
+
### Tab Object
|
|
32
|
+
|
|
33
|
+
| Property | Type | Values | Description |
|
|
34
|
+
|----------|------|--------|-------------|
|
|
35
|
+
| `icon` | string | icon name | Tab icon |
|
|
36
|
+
| `label` | string | — | Tab text. 1 word max (2 short words). Nouns, not verbs |
|
|
37
|
+
| `screen` | string | screen name | Navigation target |
|
|
38
|
+
| `badge` | string | `"hidden"` \| `"smallDotBadge"` \| `"largeDotBadge"` \| `"numericBadge"` \| `"textBadge"` | Badge type per tab |
|
|
39
|
+
| `badgeValue` | string/number | — | Badge content. Number hoặc text ("Mới"). "99+" for overflow |
|
|
40
|
+
| `isFAB` | boolean | `true` \| `false` | Center tab là FAB (chỉ dùng với type=special) |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Variants
|
|
45
|
+
|
|
46
|
+
| Type | Description | Tab Count | Center Tab |
|
|
47
|
+
|------|-----------|-----------|------------|
|
|
48
|
+
| **default** | Standard evenly distributed tabs | 2-5 | Normal |
|
|
49
|
+
| **special** | Center tab elevated (FAB-style) cho primary action | 3 hoặc 5 only | Circular, elevated, `Colors.pink_03` background |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## States
|
|
54
|
+
|
|
55
|
+
### Tab States
|
|
56
|
+
|
|
57
|
+
| State | Icon Color | Label Color | Indicator |
|
|
58
|
+
|-------|-----------|------------|-----------|
|
|
59
|
+
| **Active** | `Colors.pink_03` | `Colors.pink_03` | 2px bar, `Colors.pink_03` |
|
|
60
|
+
| **Inactive** | `Colors.black_12` | `Colors.black_12` | Hidden |
|
|
61
|
+
|
|
62
|
+
- Active indicator: horizontal slide animation khi switch tabs.
|
|
63
|
+
- Chỉ 1 tab active tại mỗi thời điểm.
|
|
64
|
+
|
|
65
|
+
### Badge Types
|
|
66
|
+
|
|
67
|
+
| Badge | Color | Text | Use Case |
|
|
68
|
+
|-------|-------|------|----------|
|
|
69
|
+
| `hidden` | — | — | No badge |
|
|
70
|
+
| `smallDotBadge` | `Colors.red_03` | — | Unread/new indicator nhỏ |
|
|
71
|
+
| `largeDotBadge` | `Colors.red_03` | — | Unread indicator lớn hơn |
|
|
72
|
+
| `numericBadge` | `Colors.red_03` | `Colors.white`, count | Notification count. "99+" overflow |
|
|
73
|
+
| `textBadge` | `Colors.red_03` | `Colors.white`, text | Short text ("Mới") |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Variant-to-Context Map
|
|
78
|
+
|
|
79
|
+
| Type + Count | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
80
|
+
|-------------|-------------|-----------|-------------------|
|
|
81
|
+
| **Default, 5 tabs** | App chính MoMo với đầy đủ navigation | — | Home / Khám phá / [+] / Chat / Cá nhân |
|
|
82
|
+
| **Special, 5 tabs** | App chính với primary action (tạo mới, scan) | Primary action không cần prominence | Home / Search / [FAB Scan] / Chat / Profile |
|
|
83
|
+
| **Default, 3 tabs** | Feature đơn giản, ít destinations | Cần >3 top-level sections | Sub-feature với 3 sections |
|
|
84
|
+
| **Default, 4 tabs** | Balanced navigation | — | App có 4 main sections rõ ràng |
|
|
85
|
+
|
|
86
|
+
### Tab Count Rules
|
|
87
|
+
|
|
88
|
+
| Count | Recommendation |
|
|
89
|
+
|-------|---------------|
|
|
90
|
+
| 2 | Không recommended — dùng segmented control hoặc toggle |
|
|
91
|
+
| 3 | Ideal — clean layout |
|
|
92
|
+
| 4 | Good — balanced |
|
|
93
|
+
| 5 | Maximum — keep labels very short |
|
|
94
|
+
| 6+ | KHÔNG ĐƯỢC — dùng navigation pattern khác |
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## SSR Pattern
|
|
99
|
+
|
|
100
|
+
### Main App Shell
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"navigation": {
|
|
104
|
+
"headerType": "default",
|
|
105
|
+
"headerTitle": { "type": "text", "title": "Trang chủ" },
|
|
106
|
+
"backgroundType": "compact",
|
|
107
|
+
"bottomTab": {
|
|
108
|
+
"type": "special",
|
|
109
|
+
"activeTab": 0,
|
|
110
|
+
"tabs": [
|
|
111
|
+
{ "icon": "home", "label": "Trang chủ", "screen": "Home", "badge": "hidden" },
|
|
112
|
+
{ "icon": "search", "label": "Khám phá", "screen": "Explore", "badge": "hidden" },
|
|
113
|
+
{ "icon": "scan", "label": "Quét mã", "screen": "Scan", "isFAB": true },
|
|
114
|
+
{ "icon": "chat", "label": "Chat", "screen": "Chat", "badge": "numericBadge", "badgeValue": 3 },
|
|
115
|
+
{ "icon": "user", "label": "Cá nhân", "screen": "Profile", "badge": "smallDotBadge" }
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Simple 3-tab Navigation
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"navigation": {
|
|
126
|
+
"bottomTab": {
|
|
127
|
+
"type": "default",
|
|
128
|
+
"activeTab": 0,
|
|
129
|
+
"tabs": [
|
|
130
|
+
{ "icon": "list", "label": "Danh sách", "screen": "List", "badge": "hidden" },
|
|
131
|
+
{ "icon": "chart", "label": "Thống kê", "screen": "Stats", "badge": "hidden" },
|
|
132
|
+
{ "icon": "settings", "label": "Cài đặt", "screen": "Settings", "badge": "hidden" }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Composition with Other Components
|
|
142
|
+
|
|
143
|
+
| Component | Behavior |
|
|
144
|
+
|-----------|----------|
|
|
145
|
+
| **Toast** | Appears above BottomTabBar khi cả 2 visible |
|
|
146
|
+
| **TopNav** | TopNav top + BottomTabBar bottom = standard screen shell |
|
|
147
|
+
| **Popup** | Overlay full screen bao gồm BottomTabBar |
|
|
148
|
+
| **Badge** | Dùng built-in badge system — KHÔNG stack external Badge component lên |
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Accessibility
|
|
153
|
+
|
|
154
|
+
- Mỗi tab phải có accessible label: icon label + state ("Trang chủ, tab đang chọn").
|
|
155
|
+
- Badge count announce: "Chat, 3 thông báo mới".
|
|
156
|
+
- FAB: accessible label mô tả action ("Quét mã QR").
|
|
157
|
+
- Tab switch announce: "Đã chuyển sang Chat".
|
|
158
|
+
- Không hide tab bar khi scroll — luôn accessible.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Usage Guidelines
|
|
163
|
+
|
|
164
|
+
### Do
|
|
165
|
+
- Dùng cho primary app-level navigation (3–5 destinations).
|
|
166
|
+
- Keep labels 1 word (max 2 short words). Nouns, not verbs.
|
|
167
|
+
- Show badges CHỈ cho actionable unread notifications.
|
|
168
|
+
- Maintain scroll position per tab khi switching.
|
|
169
|
+
- All icons cùng style (outline HOẶC filled — không mix).
|
|
170
|
+
|
|
171
|
+
### Don't
|
|
172
|
+
- Không dùng >5 tabs.
|
|
173
|
+
- Không abbreviate labels ("LS.GD" → "Lịch sử").
|
|
174
|
+
- Không mix icon styles across tabs.
|
|
175
|
+
- Không dùng cho secondary/nested navigation — dùng back navigation.
|
|
176
|
+
- Không hide tab bar on scroll.
|
|
177
|
+
- Không đặt destructive actions trong tab bar.
|