@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,141 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
> Range selection control — drag thumb along track to select value or range within min-max bounds.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/slider`
|
|
6
|
+
**Platform:** RN ✅ | Compose ❌ (use native Slider)
|
|
7
|
+
**Completeness:** need_update — thiếu Figma
|
|
8
|
+
**Figma node:** [VERIFY]
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Variant Axes
|
|
13
|
+
|
|
14
|
+
| Axis | Options | Default |
|
|
15
|
+
|------|---------|---------|
|
|
16
|
+
| **Mode** | `single` · `range` | `single` |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Values | Default | Description |
|
|
23
|
+
|------|------|--------|---------|-------------|
|
|
24
|
+
| `mode` | string | `"single"` \| `"range"` | `"single"` | Single thumb or dual-thumb range selection |
|
|
25
|
+
| `value` | number \| array | number (single) or `[min, max]` (range) | `0` | Current value. Single: number. Range: `[lowValue, highValue]` |
|
|
26
|
+
| `min` | number | — | `0` | Minimum bound |
|
|
27
|
+
| `max` | number | — | `100` | Maximum bound |
|
|
28
|
+
| `step` | number | — | `1` | Value increment. `0` for continuous [VERIFY] |
|
|
29
|
+
| `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
|
|
30
|
+
| `showLabel` | boolean | `true` \| `false` | `false` | Show value label above thumb [VERIFY] |
|
|
31
|
+
| `onChange` | function | — | — | Callback khi value changes. `"onChange": "setState://sliderValue"` |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Variants
|
|
36
|
+
|
|
37
|
+
| Mode | Thumbs | Track Fill | Usage |
|
|
38
|
+
|------|--------|-----------|-------|
|
|
39
|
+
| **single** | 1 thumb | Fill from min to thumb | Select single value (volume, brightness) |
|
|
40
|
+
| **range** | 2 thumbs | Fill between two thumbs | Select value range (price filter, age range) |
|
|
41
|
+
|
|
42
|
+
### Track Colors
|
|
43
|
+
|
|
44
|
+
| Part | Color |
|
|
45
|
+
|------|-------|
|
|
46
|
+
| Active fill | `Colors.pink_03` |
|
|
47
|
+
| Inactive track | `Colors.black_04` |
|
|
48
|
+
| Thumb | `Colors.white` with shadow [VERIFY] |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## States
|
|
53
|
+
|
|
54
|
+
| State | Appearance | Interactive |
|
|
55
|
+
|-------|-----------|-------------|
|
|
56
|
+
| **Default** | Pink fill + grey track, white thumb | true |
|
|
57
|
+
| **Dragging** | Thumb enlarged, optional value label shown | true |
|
|
58
|
+
| **Disabled** | All elements reduced opacity (0.4) | false |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Variant-to-Context Map
|
|
63
|
+
|
|
64
|
+
| Mode | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
65
|
+
|------|-------------|-----------|-------------------|
|
|
66
|
+
| **single** | Adjust single value in continuous range | Discrete options (3-5 choices) → dùng Radio | Volume, brightness, loan amount |
|
|
67
|
+
| **range** | Filter by range (min-max) | Single value selection | Lọc giá sản phẩm, khoảng tuổi |
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## SSR Pattern
|
|
72
|
+
|
|
73
|
+
### Price Range Filter
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"id": "price_filter",
|
|
77
|
+
"type": "section",
|
|
78
|
+
"children": [
|
|
79
|
+
{
|
|
80
|
+
"component": "Text",
|
|
81
|
+
"props": {
|
|
82
|
+
"content": "Khoảng giá",
|
|
83
|
+
"typography": "body_default_bold"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"component": "Slider",
|
|
88
|
+
"props": {
|
|
89
|
+
"mode": "range",
|
|
90
|
+
"value": [0, 1000000],
|
|
91
|
+
"min": 0,
|
|
92
|
+
"max": 5000000,
|
|
93
|
+
"step": 100000,
|
|
94
|
+
"showLabel": true
|
|
95
|
+
},
|
|
96
|
+
"onChange": "setState://priceRange"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Single Value Slider
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"component": "Slider",
|
|
106
|
+
"props": {
|
|
107
|
+
"mode": "single",
|
|
108
|
+
"value": "{{state.amount}}",
|
|
109
|
+
"min": 100000,
|
|
110
|
+
"max": 50000000,
|
|
111
|
+
"step": 100000
|
|
112
|
+
},
|
|
113
|
+
"onChange": "setState://amount"
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Accessibility
|
|
120
|
+
|
|
121
|
+
- Announce current value: "Slider: 500,000".
|
|
122
|
+
- Range mode: announce both values: "Range: 100,000 to 1,000,000".
|
|
123
|
+
- Thumb adjustable via accessibility actions (increment/decrement by step).
|
|
124
|
+
- Disabled state announced.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Usage Guidelines
|
|
129
|
+
|
|
130
|
+
### Do
|
|
131
|
+
- Dùng cho continuous value selection in a range.
|
|
132
|
+
- Range mode cho price/quantity filters.
|
|
133
|
+
- Show min/max labels at track ends.
|
|
134
|
+
- `showLabel` khi exact value matters to user.
|
|
135
|
+
- Reasonable step size — không quá fine-grained.
|
|
136
|
+
|
|
137
|
+
### Don't
|
|
138
|
+
- Không dùng cho small discrete options (1-5) → dùng **Stepper** hoặc **Radio**.
|
|
139
|
+
- Không dùng cho exact numeric input → dùng **Input** with numeric keyboard.
|
|
140
|
+
- Không set step=0 unless truly continuous control needed.
|
|
141
|
+
- Không hide value display khi precision matters — show label or pair with Text.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# SnackBar
|
|
2
|
+
|
|
3
|
+
> Transient notification with optional action — bottom-of-screen feedback. Compose equivalent of Toast.
|
|
4
|
+
|
|
5
|
+
**Package:** built-in Compose (`SnackbarHost`)
|
|
6
|
+
**Platform:** RN ❌ (use Toast) | 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
|
+
| `message` | string | — | required | Snackbar text content |
|
|
17
|
+
| `duration` | number | milliseconds | `3000` | Auto-dismiss duration [VERIFY] |
|
|
18
|
+
| `actionLabel` | string | — | — | Optional action button text (e.g., "Hoàn tác"). Omit for no action [VERIFY] |
|
|
19
|
+
| `onAction` | function | — | — | Callback khi tap action button. `"onAction": "action://undoDelete"` |
|
|
20
|
+
| `type` | string | `"default"` \| `"error"` | `"default"` | Snackbar style variant [VERIFY] |
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Variants
|
|
25
|
+
|
|
26
|
+
| Type | Background | Text Color | Action Color |
|
|
27
|
+
|------|-----------|-----------|-------------|
|
|
28
|
+
| **default** | `Colors.black_17` (dark) | `Colors.white` | `Colors.pink_03` [VERIFY] |
|
|
29
|
+
| **error** | `Colors.red_03` | `Colors.white` | `Colors.white` [VERIFY] |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## States
|
|
34
|
+
|
|
35
|
+
| State | Appearance |
|
|
36
|
+
|-------|-----------|
|
|
37
|
+
| **Entering** | Slide up from bottom with animation |
|
|
38
|
+
| **Visible** | Full opacity at bottom, countdown active |
|
|
39
|
+
| **Exiting** | Slide down with fade animation |
|
|
40
|
+
| **Dismissed** | Removed from view |
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Variant-to-Context Map
|
|
45
|
+
|
|
46
|
+
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
47
|
+
|---------|-------------|-----------|-------------------|
|
|
48
|
+
| **Action feedback** | Confirm action + offer undo | No undo possible | "Đã xóa. Hoàn tác?" |
|
|
49
|
+
| **Brief notification** | Non-critical info (no action needed) | Critical errors → dùng Information | "Đã lưu thay đổi" |
|
|
50
|
+
| **Error feedback** | Brief error on Compose | Error needs detail → dùng Information | "Lỗi kết nối" |
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## SSR Pattern
|
|
55
|
+
|
|
56
|
+
### SnackBar with Undo Action
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"id": "delete_feedback",
|
|
60
|
+
"type": "action",
|
|
61
|
+
"trigger": "onSuccess",
|
|
62
|
+
"snackbar": {
|
|
63
|
+
"component": "SnackBar",
|
|
64
|
+
"props": {
|
|
65
|
+
"message": "Đã xóa mục đã chọn",
|
|
66
|
+
"actionLabel": "Hoàn tác",
|
|
67
|
+
"duration": 5000
|
|
68
|
+
},
|
|
69
|
+
"onAction": "action://undoDelete"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Accessibility
|
|
77
|
+
|
|
78
|
+
- Announce snackbar content as live region.
|
|
79
|
+
- Action button must meet 44dp touch target.
|
|
80
|
+
- Duration sufficient for screen reader announcement + action interaction (~5s when action present).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Usage Guidelines
|
|
85
|
+
|
|
86
|
+
### Do
|
|
87
|
+
- Dùng cho Compose platform transient notifications.
|
|
88
|
+
- Include action button khi undo/retry is possible.
|
|
89
|
+
- Position at bottom of screen (standard Material placement).
|
|
90
|
+
- Extend duration khi có action button (5000ms vs 3000ms).
|
|
91
|
+
|
|
92
|
+
### Don't
|
|
93
|
+
- Không dùng trên RN → dùng **Toast**.
|
|
94
|
+
- Không dùng cho persistent messages → dùng **Information**.
|
|
95
|
+
- Không dùng cho blocking alerts → dùng **PopupNotify**.
|
|
96
|
+
- Không include more than 1 action.
|
|
97
|
+
- Không stack multiple snackbars.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
> Numeric increment/decrement control — minus/plus buttons để adjust value theo discrete steps.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/stepper`
|
|
6
|
+
**Platform:** RN ✅ | Compose ❌ (build with Row + Button)
|
|
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` | number | — | `1` | Current numeric value |
|
|
17
|
+
| `min` | number | — | `0` | Minimum value. Minus button disabled khi reached |
|
|
18
|
+
| `max` | number | — | — | Maximum value. Plus button disabled khi reached |
|
|
19
|
+
| `step` | number | — | `1` | Increment/decrement amount per tap [VERIFY] |
|
|
20
|
+
| `disabled` | boolean | `true` \| `false` | `false` | Both buttons disabled |
|
|
21
|
+
| `onChange` | function | — | — | Callback khi value change. `"onChange": "setState://quantity"` |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## States
|
|
26
|
+
|
|
27
|
+
| State | Minus Button | Plus Button | Value Color | Interactive |
|
|
28
|
+
|-------|-------------|-----------|------------|-------------|
|
|
29
|
+
| **Default** | `Colors.black_17` icon | `Colors.black_17` icon | `Colors.black_17` | true |
|
|
30
|
+
| **At minimum** | `Colors.black_08` (disabled) | `Colors.black_17` | `Colors.black_17` | partial |
|
|
31
|
+
| **At maximum** | `Colors.black_17` | `Colors.black_08` (disabled) | `Colors.black_17` | partial |
|
|
32
|
+
| **Pressed** | opacity 0.8 | opacity 0.8 | `Colors.black_17` | true |
|
|
33
|
+
| **Disabled** | `Colors.black_08` | `Colors.black_08` | `Colors.black_08` | false |
|
|
34
|
+
|
|
35
|
+
Value updates immediately on tap.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Variant-to-Context Map
|
|
40
|
+
|
|
41
|
+
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
42
|
+
|---------|-------------|-----------|-------------------|
|
|
43
|
+
| **Quantity picker** | Adjust số lượng items (1-10) | Range lớn (0-1000) → dùng Slider | Số lượng vé, số suất ăn |
|
|
44
|
+
| **Count adjustment** | Small numeric adjustments | Freeform numeric input → dùng Input | Số người trong nhóm, số tháng |
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## SSR Pattern
|
|
49
|
+
|
|
50
|
+
### Quantity Picker
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"id": "quantity_row",
|
|
54
|
+
"type": "row",
|
|
55
|
+
"children": [
|
|
56
|
+
{
|
|
57
|
+
"component": "Text",
|
|
58
|
+
"props": {
|
|
59
|
+
"content": "Số lượng",
|
|
60
|
+
"typography": "body_default_regular"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"component": "Stepper",
|
|
65
|
+
"props": {
|
|
66
|
+
"value": "{{state.quantity}}",
|
|
67
|
+
"min": 1,
|
|
68
|
+
"max": 10,
|
|
69
|
+
"step": 1
|
|
70
|
+
},
|
|
71
|
+
"onChange": "setState://quantity"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Accessibility
|
|
80
|
+
|
|
81
|
+
- Minus button: accessible label "Giảm".
|
|
82
|
+
- Plus button: accessible label "Tăng".
|
|
83
|
+
- Current value announce as live region — changes spoken aloud.
|
|
84
|
+
- Disabled buttons at boundaries announce disabled.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Usage Guidelines
|
|
89
|
+
|
|
90
|
+
### Do
|
|
91
|
+
- Dùng cho small numeric adjustments (1-10 range).
|
|
92
|
+
- Show current value rõ ràng between buttons.
|
|
93
|
+
- Disable button khi value reach min/max.
|
|
94
|
+
- Reasonable default value — user không cần tap nhiều.
|
|
95
|
+
|
|
96
|
+
### Don't
|
|
97
|
+
- Không dùng cho large ranges → dùng **Slider**.
|
|
98
|
+
- Không dùng cho freeform numeric → dùng **Input** numeric keyboard.
|
|
99
|
+
- Không hide value display.
|
|
100
|
+
- Không dùng cho non-numeric → dùng **Chip** / **Radio**.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Steps
|
|
2
|
+
|
|
3
|
+
> Step progress indicator — numbered circles + connecting lines for multi-step flows. Shows current position.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/step`
|
|
6
|
+
**Platform:** RN ✅ | Compose ❌ (build with Row)
|
|
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
|
+
| `steps` | array | `[{ label }]` | required | List of step definitions |
|
|
17
|
+
| `current` | number | 0-based index | `0` | Current active step index |
|
|
18
|
+
| `showLabels` | boolean | `true` \| `false` | `true` | Show text labels below circles [VERIFY] |
|
|
19
|
+
|
|
20
|
+
### Step Object
|
|
21
|
+
|
|
22
|
+
| Field | Type | Required | Description |
|
|
23
|
+
|-------|------|----------|-------------|
|
|
24
|
+
| `label` | string | yes | Step description text (e.g., "Chi tiết", "Thanh toán", "Xác nhận") |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## States (per step)
|
|
29
|
+
|
|
30
|
+
| State | Circle Background | Circle Content | Label Color | Connecting Line |
|
|
31
|
+
|-------|------------------|---------------|------------|----------------|
|
|
32
|
+
| **Completed** | `Colors.pink_03` | White check icon (✓) | `Colors.black_17` | `Colors.pink_03` (to next completed/current) |
|
|
33
|
+
| **Current** | `Colors.pink_03` | White step number | `Colors.black_17` | `Colors.black_04` (to next upcoming) |
|
|
34
|
+
| **Upcoming** | `Colors.black_04` | `Colors.black_17` step number | `Colors.black_08` | `Colors.black_04` |
|
|
35
|
+
|
|
36
|
+
Steps evenly distributed across full width. Labels centered below circles.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Variant-to-Context Map
|
|
41
|
+
|
|
42
|
+
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
43
|
+
|---------|-------------|-----------|-------------------|
|
|
44
|
+
| **Checkout flow** | Multi-step purchase/payment | Single page form | Thanh toán: Chi tiết → Xác nhận → Hoàn thành |
|
|
45
|
+
| **Registration** | Step-by-step onboarding | Simple 1-page signup | eKYC: Thông tin → CMND → Selfie → Hoàn thành |
|
|
46
|
+
| **Wizard** | Complex form broken into sections | ≤2 steps → just use buttons | Đăng ký dịch vụ mới |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## SSR Pattern
|
|
51
|
+
|
|
52
|
+
### Checkout Steps
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"component": "Steps",
|
|
56
|
+
"props": {
|
|
57
|
+
"steps": [
|
|
58
|
+
{ "label": "Chi tiết" },
|
|
59
|
+
{ "label": "Thanh toán" },
|
|
60
|
+
{ "label": "Xác nhận" }
|
|
61
|
+
],
|
|
62
|
+
"current": "{{state.currentStep}}"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Accessibility
|
|
70
|
+
|
|
71
|
+
- Each step announces: label + number + state ("Bước 1, Chi tiết, hoàn thành").
|
|
72
|
+
- Current step clearly identified: "Bước 2, Thanh toán, bước hiện tại".
|
|
73
|
+
- Overall progress context: "Bước 2 trong 4".
|
|
74
|
+
- Not rely solely on color — check icon (completed) + number (current/upcoming) provide distinction.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Usage Guidelines
|
|
79
|
+
|
|
80
|
+
### Do
|
|
81
|
+
- Dùng cho linear multi-step flows (checkout, registration, onboarding).
|
|
82
|
+
- Keep labels short — 1-2 words.
|
|
83
|
+
- Limit 3-5 steps for readability.
|
|
84
|
+
- Show completed check icon → user confidence.
|
|
85
|
+
|
|
86
|
+
### Don't
|
|
87
|
+
- Không dùng cho tab navigation → dùng **TabView**.
|
|
88
|
+
- Không dùng cho percentage progress → dùng **ProgressInfo**.
|
|
89
|
+
- Không allow tap upcoming steps to skip ahead (unless flow supports non-linear).
|
|
90
|
+
- Không >5 steps — break flow into sections or simplify.
|
|
91
|
+
- Không dùng cho page indicators → dùng **Pagination**.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# SuggestAction
|
|
2
|
+
|
|
3
|
+
> Tappable suggestion row — title + optional description + chevron. Quick-action entry point.
|
|
4
|
+
|
|
5
|
+
**Package:** `@momo-kits/suggest-action`
|
|
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
|
+
| `title` | string | — | required | Primary text — action label |
|
|
17
|
+
| `description` | string | — | — | Secondary text below title. Optional [VERIFY] |
|
|
18
|
+
| `icon` | string | icon name | — | Leading icon [VERIFY] |
|
|
19
|
+
| `showChevron` | boolean | `true` \| `false` | `true` | Show trailing chevron (→) indicator [VERIFY] |
|
|
20
|
+
| `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
|
|
21
|
+
| `onPress` | function | — | — | Callback khi tap. `"onPress": "navigate://Screen"` hoặc `"onPress": "action://doSomething"` |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## States
|
|
26
|
+
|
|
27
|
+
| State | Appearance | Interactive |
|
|
28
|
+
|-------|-----------|-------------|
|
|
29
|
+
| **Default** | Full opacity, chevron visible | true |
|
|
30
|
+
| **Pressed** | Opacity 0.8 (entire row) | true |
|
|
31
|
+
| **Disabled** | Reduced opacity (0.4), no press feedback | false |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Variant-to-Context Map
|
|
36
|
+
|
|
37
|
+
| Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
|
|
38
|
+
|---------|-------------|-----------|-------------------|
|
|
39
|
+
| **Quick action** | Suggest next action after completing flow | Primary CTA needed → dùng Button | "Xem lịch sử giao dịch" sau khi chuyển tiền |
|
|
40
|
+
| **Navigation shortcut** | Link to related screen/feature | Standalone navigation → dùng list item | "Mời bạn bè" suggestion |
|
|
41
|
+
| **Contextual suggestion** | AI/system-suggested action based on context | Static menu items | "Thanh toán điện nước" khi đến hạn |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## SSR Pattern
|
|
46
|
+
|
|
47
|
+
### Post-Transaction Suggestions
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"id": "suggest_actions",
|
|
51
|
+
"type": "section",
|
|
52
|
+
"children": [
|
|
53
|
+
{
|
|
54
|
+
"component": "SuggestAction",
|
|
55
|
+
"props": {
|
|
56
|
+
"title": "Xem lịch sử giao dịch",
|
|
57
|
+
"icon": "history"
|
|
58
|
+
},
|
|
59
|
+
"onPress": "navigate://TransactionHistory"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"component": "SuggestAction",
|
|
63
|
+
"props": {
|
|
64
|
+
"title": "Chuyển tiền cho người khác",
|
|
65
|
+
"description": "Gửi tiền nhanh đến số điện thoại"
|
|
66
|
+
},
|
|
67
|
+
"onPress": "navigate://Transfer"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Accessibility
|
|
76
|
+
|
|
77
|
+
- Announce as button: "[title], [description]".
|
|
78
|
+
- Chevron is decorative — not announced separately.
|
|
79
|
+
- Full row is single tap target.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Usage Guidelines
|
|
84
|
+
|
|
85
|
+
### Do
|
|
86
|
+
- Dùng cho contextual next-step suggestions.
|
|
87
|
+
- Keep title actionable — verb-first ("Xem...", "Mời...", "Thanh toán...").
|
|
88
|
+
- Description chỉ khi cần clarify action.
|
|
89
|
+
- Group 2-3 suggestions together maximum.
|
|
90
|
+
|
|
91
|
+
### Don't
|
|
92
|
+
- Không dùng cho primary actions → dùng **Button**.
|
|
93
|
+
- Không dùng cho navigation menus → dùng list với proper list items.
|
|
94
|
+
- Không show >3 suggestions — overwhelming.
|
|
95
|
+
- Không omit onPress — mỗi SuggestAction phải navigate/action.
|
|
@@ -0,0 +1,121 @@
|
|
|
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.
|