@momo-kits/native-kits 0.157.5-debug → 0.158.1-beta.1-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/.claude/settings.local.json +11 -0
  2. package/.claude/skills/design-system/SKILL.md +88 -0
  3. package/.claude/skills/design-system/references/components/avatar.md +134 -0
  4. package/.claude/skills/design-system/references/components/badge.md +127 -0
  5. package/.claude/skills/design-system/references/components/bottom-tab.md +177 -0
  6. package/.claude/skills/design-system/references/components/bottomsheet.md +170 -0
  7. package/.claude/skills/design-system/references/components/button.md +206 -0
  8. package/.claude/skills/design-system/references/components/carousel.md +117 -0
  9. package/.claude/skills/design-system/references/components/checkbox.md +98 -0
  10. package/.claude/skills/design-system/references/components/chip.md +146 -0
  11. package/.claude/skills/design-system/references/components/collapse.md +120 -0
  12. package/.claude/skills/design-system/references/components/date-picker.md +119 -0
  13. package/.claude/skills/design-system/references/components/divider.md +84 -0
  14. package/.claude/skills/design-system/references/components/icon.md +130 -0
  15. package/.claude/skills/design-system/references/components/image.md +81 -0
  16. package/.claude/skills/design-system/references/components/information.md +107 -0
  17. package/.claude/skills/design-system/references/components/input-dropdown.md +138 -0
  18. package/.claude/skills/design-system/references/components/input-money.md +157 -0
  19. package/.claude/skills/design-system/references/components/input-otp.md +132 -0
  20. package/.claude/skills/design-system/references/components/input-phone-number.md +140 -0
  21. package/.claude/skills/design-system/references/components/input-search.md +124 -0
  22. package/.claude/skills/design-system/references/components/input-text-area.md +133 -0
  23. package/.claude/skills/design-system/references/components/input.md +152 -0
  24. package/.claude/skills/design-system/references/components/loader.md +87 -0
  25. package/.claude/skills/design-system/references/components/pagination.md +105 -0
  26. package/.claude/skills/design-system/references/components/popup-notify.md +128 -0
  27. package/.claude/skills/design-system/references/components/progress-info.md +114 -0
  28. package/.claude/skills/design-system/references/components/radio.md +86 -0
  29. package/.claude/skills/design-system/references/components/rating.md +126 -0
  30. package/.claude/skills/design-system/references/components/skeleton.md +120 -0
  31. package/.claude/skills/design-system/references/components/slider.md +141 -0
  32. package/.claude/skills/design-system/references/components/snackbar.md +97 -0
  33. package/.claude/skills/design-system/references/components/stepper.md +100 -0
  34. package/.claude/skills/design-system/references/components/steps.md +91 -0
  35. package/.claude/skills/design-system/references/components/suggest-action.md +95 -0
  36. package/.claude/skills/design-system/references/components/swipe.md +121 -0
  37. package/.claude/skills/design-system/references/components/switch.md +98 -0
  38. package/.claude/skills/design-system/references/components/tab-view.md +120 -0
  39. package/.claude/skills/design-system/references/components/tag.md +118 -0
  40. package/.claude/skills/design-system/references/components/text.md +151 -0
  41. package/.claude/skills/design-system/references/components/toast.md +99 -0
  42. package/.claude/skills/design-system/references/components/tooltip.md +138 -0
  43. package/.claude/skills/design-system/references/components/top-nav-miniapp.md +94 -0
  44. package/.claude/skills/design-system/references/components/top-nav.md +226 -0
  45. package/.claude/skills/design-system/references/components/uploader.md +115 -0
  46. package/.claude/skills/design-system/references/navigation/bottom-tab.md +131 -0
  47. package/.claude/skills/design-system/references/navigation/bottomsheet.md +161 -0
  48. package/.claude/skills/design-system/references/navigation/modal.md +133 -0
  49. package/.claude/skills/design-system/references/navigation/navigation-options.md +225 -0
  50. package/.claude/skills/design-system/references/navigation/navigator.md +111 -0
  51. package/.claude/skills/design-system/references/navigation/setup.md +134 -0
  52. package/.claude/skills/design-system/references/navigation/stack.md +128 -0
  53. package/.claude/skills/design-system/references/spec-convention.md +80 -0
  54. package/.claude/skills/design-system/references/tokens/colors.md +131 -0
  55. package/.claude/skills/design-system/references/tokens/spacing-radius.md +144 -0
  56. package/.claude/skills/design-system/references/tokens/theme.md +125 -0
  57. package/.claude/skills/design-system/references/tokens/typography.md +135 -0
  58. package/.claude/skills/design-system-kits/SKILL.md +102 -0
  59. package/.claude/skills/design-system-kits/references/code-convention.md +118 -0
  60. package/.claude/skills/design-system-kits/references/components/avatar.md +45 -0
  61. package/.claude/skills/design-system-kits/references/components/badge.md +27 -0
  62. package/.claude/skills/design-system-kits/references/components/button.md +65 -0
  63. package/.claude/skills/design-system-kits/references/components/carousel.md +51 -0
  64. package/.claude/skills/design-system-kits/references/components/checkbox.md +39 -0
  65. package/.claude/skills/design-system-kits/references/components/chip.md +54 -0
  66. package/.claude/skills/design-system-kits/references/components/collapse.md +63 -0
  67. package/.claude/skills/design-system-kits/references/components/date-picker.md +36 -0
  68. package/.claude/skills/design-system-kits/references/components/divider.md +21 -0
  69. package/.claude/skills/design-system-kits/references/components/icon.md +382 -0
  70. package/.claude/skills/design-system-kits/references/components/image.md +62 -0
  71. package/.claude/skills/design-system-kits/references/components/information.md +61 -0
  72. package/.claude/skills/design-system-kits/references/components/input-dropdown.md +92 -0
  73. package/.claude/skills/design-system-kits/references/components/input-money.md +128 -0
  74. package/.claude/skills/design-system-kits/references/components/input-otp.md +85 -0
  75. package/.claude/skills/design-system-kits/references/components/input-phone-number.md +96 -0
  76. package/.claude/skills/design-system-kits/references/components/input-search.md +127 -0
  77. package/.claude/skills/design-system-kits/references/components/input-text-area.md +100 -0
  78. package/.claude/skills/design-system-kits/references/components/input.md +126 -0
  79. package/.claude/skills/design-system-kits/references/components/loader.md +41 -0
  80. package/.claude/skills/design-system-kits/references/components/pagination.md +47 -0
  81. package/.claude/skills/design-system-kits/references/components/popup-notify.md +69 -0
  82. package/.claude/skills/design-system-kits/references/components/popup-promotion.md +35 -0
  83. package/.claude/skills/design-system-kits/references/components/progress-info.md +55 -0
  84. package/.claude/skills/design-system-kits/references/components/radio.md +42 -0
  85. package/.claude/skills/design-system-kits/references/components/rating.md +36 -0
  86. package/.claude/skills/design-system-kits/references/components/skeleton.md +25 -0
  87. package/.claude/skills/design-system-kits/references/components/slider.md +53 -0
  88. package/.claude/skills/design-system-kits/references/components/snackbar.md +52 -0
  89. package/.claude/skills/design-system-kits/references/components/stepper.md +46 -0
  90. package/.claude/skills/design-system-kits/references/components/steps.md +57 -0
  91. package/.claude/skills/design-system-kits/references/components/suggest-action.md +44 -0
  92. package/.claude/skills/design-system-kits/references/components/swipe.md +44 -0
  93. package/.claude/skills/design-system-kits/references/components/switch.md +43 -0
  94. package/.claude/skills/design-system-kits/references/components/tab-view.md +56 -0
  95. package/.claude/skills/design-system-kits/references/components/tag.md +50 -0
  96. package/.claude/skills/design-system-kits/references/components/text.md +56 -0
  97. package/.claude/skills/design-system-kits/references/components/toast.md +51 -0
  98. package/.claude/skills/design-system-kits/references/components/tooltip.md +95 -0
  99. package/.claude/skills/design-system-kits/references/components/uploader.md +48 -0
  100. package/.claude/skills/design-system-kits/references/design-spec-structure.md +356 -0
  101. package/.claude/skills/design-system-kits/references/design-spec-to-code.md +596 -0
  102. package/.claude/skills/design-system-kits/references/navigation/bottom-tab.md +155 -0
  103. package/.claude/skills/design-system-kits/references/navigation/bottomsheet.md +94 -0
  104. package/.claude/skills/design-system-kits/references/navigation/modal.md +125 -0
  105. package/.claude/skills/design-system-kits/references/navigation/navigation-options.md +430 -0
  106. package/.claude/skills/design-system-kits/references/navigation/navigator.md +177 -0
  107. package/.claude/skills/design-system-kits/references/navigation/setup.md +94 -0
  108. package/.claude/skills/design-system-kits/references/navigation/stack.md +152 -0
  109. package/.claude/skills/design-system-kits/references/screen-layout-rule.md +125 -0
  110. package/.claude/skills/design-system-kits/references/tokens/colors.md +183 -0
  111. package/.claude/skills/design-system-kits/references/tokens/spacing-radius.md +45 -0
  112. package/.claude/skills/design-system-kits/references/tokens/theme.md +97 -0
  113. package/.claude/skills/design-system-kits/references/tokens/typography.md +105 -0
  114. package/.claude/skills/vibe-design/SKILL.md +306 -0
  115. package/compose/build.gradle.kts +1 -1
  116. package/compose/src/androidMain/kotlin/vn/momo/kits/platform/Platform.android.kt +7 -0
  117. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Avatar.kt +157 -0
  118. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Carousel.kt +123 -0
  119. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Collapse.kt +224 -0
  120. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Loader.kt +108 -0
  121. package/compose/src/commonMain/kotlin/vn/momo/kits/components/PopupPromotion.kt +2 -2
  122. package/compose/src/commonMain/kotlin/vn/momo/kits/components/ProgressInfo.kt +338 -0
  123. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Rating.kt +87 -0
  124. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Slider.kt +348 -0
  125. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Stepper.kt +256 -0
  126. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Steps.kt +494 -0
  127. package/compose/src/commonMain/kotlin/vn/momo/kits/components/SuggestAction.kt +131 -0
  128. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Swipe.kt +215 -0
  129. package/compose/src/commonMain/kotlin/vn/momo/kits/components/TabView.kt +531 -0
  130. package/compose/src/commonMain/kotlin/vn/momo/kits/components/Uploader.kt +192 -0
  131. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Spacing.kt +3 -0
  132. package/compose/src/commonMain/kotlin/vn/momo/kits/const/Theme.kt +5 -2
  133. package/compose/src/commonMain/kotlin/vn/momo/kits/modifier/AutomationId.kt +2 -11
  134. package/compose/src/commonMain/kotlin/vn/momo/kits/platform/Platform.kt +5 -1
  135. package/compose/src/iosMain/kotlin/vn/momo/kits/platform/Platform.ios.kt +12 -0
  136. package/gradle.properties +1 -1
  137. package/ios/Popup/PopupPromotion.swift +2 -2
  138. package/local.properties +8 -0
  139. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ # PopupNotify
2
+
3
+ > Modal dialog — confirmation, alert, decision point. Requires user interaction before proceeding.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅ (via `navigator.showModal`)
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 message or question |
17
+ | `description` | string | — | — | Supporting detail text |
18
+ | `image` | object | `{ uri: string }` | — | Optional illustration/image above title [VERIFY] |
19
+ | `primaryButton` | object | `{ label, onPress }` | required | Main action button (filled style) |
20
+ | `secondaryButton` | object | `{ label, onPress }` | — | Alternative/cancel button (outlined/text style) |
21
+ | `showClose` | boolean | `true` \| `false` | `false` | Show close (X) icon at top-right [VERIFY] |
22
+ | `barrierDismissible` | boolean | `true` \| `false` | `false` | Tap overlay to dismiss. Default false — prevents accidental dismissal [VERIFY] |
23
+ | `onDismiss` | function | — | — | Callback khi dismissed. `"onDismiss": "action://closePopup"` |
24
+
25
+ ### Button Object
26
+
27
+ | Field | Type | Required | Description |
28
+ |-------|------|----------|-------------|
29
+ | `label` | string | yes | Button text — use strong verbs ("Xóa", "Xác nhận"), not generic "Yes"/"No" |
30
+ | `onPress` | function | yes | Callback. `"onPress": "action://confirm"` |
31
+
32
+ ---
33
+
34
+ ## Variants
35
+
36
+ | Layout | Khi nào | Description |
37
+ |--------|---------|-------------|
38
+ | **Row (side-by-side)** | Both labels short, fit in single row | Secondary left, Primary right |
39
+ | **Column (stacked)** | Labels long, would truncate in row | Primary top, Secondary below |
40
+
41
+ Layout auto-detected based on combined button text length. Column is safer default.
42
+
43
+ ---
44
+
45
+ ## States
46
+
47
+ | State | Appearance |
48
+ |-------|-----------|
49
+ | **Appearing** | Fade in overlay + scale up container from center |
50
+ | **Visible** | Static — user must interact to proceed |
51
+ | **Dismissing** | Fade out overlay + container |
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
+ | **Destructive confirmation** | Confirm delete/cancel actions | Non-destructive feedback → dùng Toast | "Xóa giao dịch này?" |
60
+ | **Important alert** | Alert requiring acknowledgment | Non-critical info → dùng Information | "Phiên đăng nhập hết hạn" |
61
+ | **Binary decision** | Two-choice decision point | >2 choices → dùng BottomSheet | "Lưu thay đổi?" Lưu / Hủy |
62
+
63
+ ---
64
+
65
+ ## SSR Pattern
66
+
67
+ ### Destructive Confirmation
68
+ ```json
69
+ {
70
+ "component": "PopupNotify",
71
+ "props": {
72
+ "title": "Xóa giao dịch?",
73
+ "description": "Hành động này không thể hoàn tác",
74
+ "primaryButton": {
75
+ "label": "Xóa",
76
+ "onPress": "action://deleteTransaction"
77
+ },
78
+ "secondaryButton": {
79
+ "label": "Hủy",
80
+ "onPress": "action://closePopup"
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### Alert with Image
87
+ ```json
88
+ {
89
+ "component": "PopupNotify",
90
+ "props": {
91
+ "title": "Cập nhật thành công!",
92
+ "description": "Thông tin của bạn đã được cập nhật",
93
+ "image": { "uri": "{{assets.successIllustration}}" },
94
+ "primaryButton": {
95
+ "label": "Đóng",
96
+ "onPress": "action://closePopup"
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Accessibility
105
+
106
+ - Focus trap: keyboard/screen reader focus trapped within dialog khi open.
107
+ - Title announced by screen reader on open.
108
+ - ESC / hardware back dismisses dialog.
109
+ - Button labels must be clear, descriptive.
110
+ - Role: `alertdialog`.
111
+
112
+ ---
113
+
114
+ ## Usage Guidelines
115
+
116
+ ### Do
117
+ - Dùng cho destructive action confirmations ("Xóa mục này?").
118
+ - Dùng cho important alerts requiring acknowledgment.
119
+ - Dùng cho binary decision points ("Lưu / Hủy").
120
+ - Strong verb labels on buttons — "Xóa", "Xác nhận", not "Yes"/"No".
121
+ - Keep title clear, description concise.
122
+
123
+ ### Don't
124
+ - Không dùng cho simple feedback → dùng **Toast** / **SnackBar**.
125
+ - Không dùng cho form input → navigate to dedicated screen.
126
+ - Không stack multiple PopupNotify dialogs.
127
+ - Không >2 action buttons.
128
+ - Không dùng cho informational messages without decision → dùng **Information**.
@@ -0,0 +1,114 @@
1
+ # Progress Info
2
+
3
+ > Linear progress bar with optional label, used to display completion status, upload progress, or goal tracking.
4
+
5
+ **Package:** `@momo-kits/progress-info`
6
+ **Platform support:** RN ✅ | Compose ❌ (use LinearProgressIndicator)
7
+
8
+ ---
9
+
10
+ ## Anatomy
11
+
12
+ ```
13
+ Title Label (optional)
14
+ ┌──────────────────────────────────────┐
15
+ │████████████░░░░░░░░░░░░░░░░░░░░░░░░░│ ← Track with fill
16
+ └──────────────────────────────────────┘
17
+ ```
18
+
19
+ | Part | Description | Required |
20
+ |-------------|-----------------------------------------------------|----------|
21
+ | Track | Full-width background bar | Yes |
22
+ | Fill | Colored portion representing progress | Yes |
23
+ | Title | Text label above the bar describing what is tracked | No |
24
+
25
+ ---
26
+
27
+ ## Visual Specs
28
+
29
+ ### Track
30
+
31
+ | Property | Token / Value |
32
+ |---------------|------------------------------|
33
+ | Background | `Colors.black_04` |
34
+ | Height | 4-8 dp |
35
+ | Corner radius | `Radius.XS` |
36
+ | Width | Full width of parent |
37
+
38
+ ### Fill
39
+
40
+ | Property | Token / Value |
41
+ |---------------|--------------------------------------------|
42
+ | Color | `Colors.pink_03` (default, themeable) |
43
+ | Height | Same as track height |
44
+ | Corner radius | `Radius.XS` |
45
+ | Min width | 0 dp (at 0% progress) |
46
+ | Max width | Full track width (at 100% progress) |
47
+
48
+ ### Title
49
+
50
+ | Property | Token / Value |
51
+ |---------------|------------------------------|
52
+ | Typography | `body_default_regular` |
53
+ | Color | Default text color |
54
+ | Position | Above the progress bar |
55
+ | Spacing below | `Spacing.XS` (4) to track |
56
+
57
+ ---
58
+
59
+ ## Progress Value
60
+
61
+ | Property | Value |
62
+ |--------------|------------------------------------------|
63
+ | Range | 0.0 (empty) to 1.0 (full) |
64
+ | Direction | Left-to-right fill |
65
+
66
+ ---
67
+
68
+ ## Animation
69
+
70
+ | Property | Value |
71
+ |----------------|-----------------------------------------------|
72
+ | Fill animation | Smooth animated transition when value changes |
73
+ | Direction | Left-to-right |
74
+
75
+ - When the progress value updates, the fill bar should animate smoothly to its new width.
76
+ - The animation should feel responsive but not jarring.
77
+
78
+ ---
79
+
80
+ ## States
81
+
82
+ | State | Appearance |
83
+ |------------------|--------------------------------------------------|
84
+ | **Empty (0.0)** | Track only, no fill visible |
85
+ | **In progress** | Partial fill proportional to value |
86
+ | **Complete (1.0)**| Fill covers entire track |
87
+
88
+ ---
89
+
90
+ ## Accessibility
91
+
92
+ - Announce the progress value as a percentage to screen readers (e.g., "Progress: 65%").
93
+ - If a title label is present, associate it with the progress bar for context (e.g., "Upload progress: 65%").
94
+ - Progress updates should be announced when they change significantly (not on every frame).
95
+
96
+ ---
97
+
98
+ ## Usage Guidelines
99
+
100
+ ### Do's
101
+
102
+ - Use for upload or download progress indicators.
103
+ - Use for goal completion tracking (e.g., savings goals, profile completeness).
104
+ - Use for step completion within a process.
105
+ - Provide a title label for context when the progress meaning is not obvious from surrounding content.
106
+ - Use animated transitions when the progress value changes.
107
+
108
+ ### Don'ts
109
+
110
+ - Don't use for indeterminate loading states — use a Loader or Skeleton component instead.
111
+ - Don't use values outside the 0.0-1.0 range.
112
+ - Don't use a progress bar for tiny increments that won't be visually perceptible — consider a numeric display instead.
113
+ - Don't use multiple fill colors within a single progress bar — keep it simple.
114
+ - Don't place progress bars where they might be confused with dividers — include a title or surrounding context.
@@ -0,0 +1,86 @@
1
+ # Radio
2
+
3
+ > Selection control — chọn exactly 1 option từ mutually exclusive set. Value + groupValue pattern.
4
+
5
+ **Package:** `@momo-kits/foundation`
6
+ **Platform:** RN ✅ | Compose ✅
7
+ **Completeness:** need_update — thiếu Figma
8
+ **Figma node:** [VERIFY]
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Values | Default | Description |
15
+ |------|------|--------|---------|-------------|
16
+ | `value` | string | — | required | Unique identifier cho radio option này |
17
+ | `groupValue` | string | — | — | Currently selected value trong group. Radio selected khi `value == groupValue` |
18
+ | `label` | string | — | — | Text label bên phải radio circle |
19
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive state |
20
+ | `onChange` | function | — | — | Callback khi selected. `"onChange": "setState://selectedOption"` |
21
+
22
+ ---
23
+
24
+ ## States
25
+
26
+ | State | Circle Border | Inner Dot | Label Color | Interactive |
27
+ |-------|-------------|----------|------------|-------------|
28
+ | **Unselected** | `Colors.black_04` | none | `Colors.black_17` | true |
29
+ | **Selected** | `Colors.pink_03` | `Colors.pink_03` fill | `Colors.black_17` | true |
30
+ | **Disabled Unselected** | `Colors.black_08` | none | `Colors.black_08` | false |
31
+ | **Disabled Selected** | `Colors.black_08` | `Colors.black_08` fill | `Colors.black_08` | 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
+ | **Single selection** | Chọn 1 từ 2-5 mutually exclusive options | >5 options → dùng InputDropDown | Chọn phương thức thanh toán, chọn lý do hủy |
40
+ | **Default pre-selected** | Recommend 1 option | Không muốn bias user | Chọn gói cước với recommended option |
41
+
42
+ ---
43
+
44
+ ## SSR Pattern
45
+
46
+ ### Radio Group
47
+ ```json
48
+ {
49
+ "id": "payment_method",
50
+ "type": "section",
51
+ "forEach": "{{data.paymentMethods}}",
52
+ "render": {
53
+ "component": "Radio",
54
+ "props": {
55
+ "value": "{{item.id}}",
56
+ "groupValue": "{{state.selectedMethod}}",
57
+ "label": "{{item.name}}"
58
+ },
59
+ "onChange": "setState://selectedMethod={{item.id}}"
60
+ }
61
+ }
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Accessibility
67
+
68
+ - Screen readers announce: label, state (selected/unselected), role (radio button), position ("1 of 3").
69
+ - Entire row (circle + label) tappable.
70
+ - Radio groups PHẢI có group label.
71
+
72
+ ---
73
+
74
+ ## Usage Guidelines
75
+
76
+ ### Do
77
+ - Dùng cho single selection từ 2-5 mutually exclusive options.
78
+ - Luôn display trong group — single radio alone vô nghĩa.
79
+ - Pre-select default option khi có recommendation.
80
+ - Vertical list layout cho clarity.
81
+
82
+ ### Don't
83
+ - Không dùng cho multiple selection → dùng **CheckBox**.
84
+ - Không dùng cho >5 options → dùng **InputDropDown**.
85
+ - Không dùng cho on/off toggle → dùng **Switch**.
86
+ - Radio selections không toggle off — once selected, phải chọn option khác.
@@ -0,0 +1,126 @@
1
+ # Rating
2
+
3
+ > Star-based rating display và input — product reviews, service feedback, quality indicators.
4
+
5
+ **Package:** `@momo-kits/rating`
6
+ **Platform:** RN ✅ | Compose ❌ (build with Row of Icons)
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 | `0` - `5` | `0` | Current rating value. Supports 0.5 increments for display mode |
17
+ | `size` | string | `"small"` \| `"medium"` \| `"large"` | `"medium"` | Star size [VERIFY] |
18
+ | `interactive` | boolean | `true` \| `false` | `true` | Interactive (input) vs display-only (read-only) [VERIFY] |
19
+ | `disabled` | boolean | `true` \| `false` | `false` | Non-interactive, reduced opacity |
20
+ | `onChange` | function | — | — | Callback khi tap star. `"onChange": "setState://rating"` |
21
+
22
+ ---
23
+
24
+ ## Variants
25
+
26
+ | Mode | Granularity | Half-star | Tappable |
27
+ |------|-----------|----------|---------|
28
+ | **Interactive** | Whole stars only (1-5) | No | Yes |
29
+ | **Display-only** | 0.5 increments (0.0-5.0) | Yes | No |
30
+
31
+ ### Star Colors
32
+
33
+ | Part | Color |
34
+ |------|-------|
35
+ | Active (filled) | `Colors.gold_03` |
36
+ | Inactive (outline) | `Colors.black_08` |
37
+ | Half-star left | `Colors.gold_03` filled |
38
+ | Half-star right | `Colors.black_08` outline |
39
+
40
+ ---
41
+
42
+ ## States
43
+
44
+ | State | Appearance | Interactive |
45
+ |-------|-----------|-------------|
46
+ | **Empty (0)** | All 5 stars outlined | per mode |
47
+ | **Partial (1-4)** | N filled + remaining outlined | per mode |
48
+ | **Full (5)** | All 5 stars filled | per mode |
49
+ | **Disabled** | All stars reduced opacity (0.4) | false |
50
+
51
+ ---
52
+
53
+ ## Variant-to-Context Map
54
+
55
+ | Mode | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
56
+ |------|-------------|-----------|-------------------|
57
+ | **Interactive** | User submit feedback/review | Read-only display | Đánh giá merchant sau giao dịch, feedback dịch vụ |
58
+ | **Display-only** | Show aggregate/existing rating | User cần input | Rating trung bình merchant, review score |
59
+
60
+ ---
61
+
62
+ ## SSR Pattern
63
+
64
+ ### Interactive Rating in Feedback Form
65
+ ```json
66
+ {
67
+ "component": "Rating",
68
+ "props": {
69
+ "value": "{{state.rating}}",
70
+ "size": "large",
71
+ "interactive": true
72
+ },
73
+ "onChange": "setState://rating"
74
+ }
75
+ ```
76
+
77
+ ### Display Rating with Number
78
+ ```json
79
+ {
80
+ "id": "rating_display",
81
+ "type": "row",
82
+ "children": [
83
+ {
84
+ "component": "Rating",
85
+ "props": {
86
+ "value": "{{data.averageRating}}",
87
+ "size": "small",
88
+ "interactive": false
89
+ }
90
+ },
91
+ {
92
+ "component": "Text",
93
+ "props": {
94
+ "content": "{{data.averageRating}} / 5",
95
+ "typography": "body_s_regular",
96
+ "color": "Colors.black_12"
97
+ }
98
+ }
99
+ ]
100
+ }
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Accessibility
106
+
107
+ - Announce current rating: "Rating: 4 out of 5 stars".
108
+ - Interactive mode: each star individually selectable.
109
+ - Display-only: announce as informational text.
110
+
111
+ ---
112
+
113
+ ## Usage Guidelines
114
+
115
+ ### Do
116
+ - Dùng cho product/service reviews.
117
+ - Display-only cho aggregate ratings. Pair với numeric label khi precision matters.
118
+ - Half-star display cho averaged ratings (4.3 → 4.5 stars).
119
+ - Consistent sizing within same context.
120
+
121
+ ### Don't
122
+ - Không dùng cho binary like/dislike → dùng **Button** / **Switch**.
123
+ - Không dùng cho non-quality metrics — stars imply quality.
124
+ - Không allow half-star input — interactive chỉ whole stars.
125
+ - Không dùng >5 hoặc <5 stars.
126
+ - Không change star color from gold.
@@ -0,0 +1,120 @@
1
+ # Skeleton
2
+
3
+ > Loading placeholder mimics content shape — shimmer animation khi data đang fetch.
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
+ | `width` | number/string | dp \| `"100%"` | `"100%"` | Skeleton width [VERIFY] |
17
+ | `height` | number | dp | required | Skeleton height [VERIFY] |
18
+ | `borderRadius` | number/string | dp \| `"circle"` | `0` | Corner radius. `"circle"` cho avatar shape [VERIFY] |
19
+ | `animated` | boolean | `true` \| `false` | `true` | Enable shimmer animation [VERIFY] |
20
+
21
+ > **Compose:** Skeletons dùng `BoxWithConstraints` — auto-adapt to parent size.
22
+
23
+ ---
24
+
25
+ ## Variants
26
+
27
+ Skeleton không có visual variants — shape phụ thuộc content nó replace.
28
+
29
+ | Content Type | Shape | borderRadius |
30
+ |-------------|-------|-------------|
31
+ | Text line | Rectangle narrow | small |
32
+ | Avatar | Circle | `"circle"` |
33
+ | Thumbnail/Image | Rectangle matching aspect ratio | medium |
34
+ | Card | Rounded rectangle | card radius |
35
+ | Button | Rounded rectangle matching button | pill |
36
+
37
+ ---
38
+
39
+ ## States
40
+
41
+ | State | Base Color | Highlight Color | Animation |
42
+ |-------|-----------|----------------|-----------|
43
+ | **Loading** | `Colors.black_03` | `Colors.black_04` | Pulsing shimmer, continuous loop |
44
+
45
+ ---
46
+
47
+ ## Variant-to-Context Map
48
+
49
+ | Context | Khi nào dùng | Tránh khi | Ví dụ trong MoMo |
50
+ |---------|-------------|-----------|-------------------|
51
+ | **Content loading** | Data đang fetch, layout structure known | Content loads instantly → không cần | Transaction list loading, feed loading |
52
+ | **Lazy section** | Section lazy-loaded within screen | Full-screen initial load → dùng Loader | Card section loading trên Home |
53
+ | **Image placeholder** | Image đang download | — | Avatar loading, banner loading |
54
+
55
+ ---
56
+
57
+ ## SSR Pattern
58
+
59
+ ### User Card Skeleton
60
+ ```json
61
+ {
62
+ "id": "user_skeleton",
63
+ "type": "row",
64
+ "children": [
65
+ {
66
+ "component": "Skeleton",
67
+ "props": {
68
+ "width": 48,
69
+ "height": 48,
70
+ "borderRadius": "circle"
71
+ }
72
+ },
73
+ {
74
+ "id": "text_skeleton",
75
+ "type": "section",
76
+ "children": [
77
+ {
78
+ "component": "Skeleton",
79
+ "props": {
80
+ "width": "60%",
81
+ "height": 16,
82
+ "borderRadius": 4
83
+ }
84
+ },
85
+ {
86
+ "component": "Skeleton",
87
+ "props": {
88
+ "width": "40%",
89
+ "height": 12,
90
+ "borderRadius": 4
91
+ }
92
+ }
93
+ ]
94
+ }
95
+ ]
96
+ }
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Accessibility
102
+
103
+ - Skeleton areas announce "Đang tải" cho screen readers.
104
+ - Khi content loaded → loaded content nhận focus và announce.
105
+ - Skeleton không focusable hoặc interactive.
106
+
107
+ ---
108
+
109
+ ## Usage Guidelines
110
+
111
+ ### Do
112
+ - Dùng cho content loading states khi layout structure known.
113
+ - Match skeleton shapes to actual content layout.
114
+ - Group multiple skeletons cho full content block (avatar circle + text rectangles).
115
+
116
+ ### Don't
117
+ - Không dùng cho action loading (button submit) → dùng **Button** loading state.
118
+ - Không dùng cho full-screen initial load → dùng **Loader**.
119
+ - Không để skeleton visible indefinitely — show error/empty state nếu loading fails.
120
+ - Không dùng cho content loads instantly — unnecessary visual noise.