@momo-kits/native-kits 0.157.1-skill.3-debug → 0.157.1-skill.6-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/skills/momo-native-kits-skills/README.md +52 -0
- package/.claude/skills/momo-native-kits-skills/SKILL.md +32 -0
- package/.claude/skills/momo-native-kits-skills/data-display/SKILL.md +42 -0
- package/.claude/skills/momo-native-kits-skills/feedback/SKILL.md +43 -0
- package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/feedback}/references/popup.md +3 -10
- package/.claude/skills/momo-native-kits-skills/form-controls/SKILL.md +42 -0
- package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/form-controls}/references/button.md +2 -3
- package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/form-controls}/references/input.md +3 -7
- package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/form-controls}/references/radio.md +9 -9
- package/.claude/skills/momo-native-kits-skills/layout/SKILL.md +39 -0
- package/.claude/skills/momo-native-kits-skills/navigation/SKILL.md +38 -0
- package/.claude/skills/momo-native-kits-skills/output/test-report.json +12 -0
- package/.claude/skills/momo-native-kits-skills/output/validation-result.json +108 -0
- package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills}/references/constants.md +81 -6
- package/.claude/skills/momo-native-kits-skills/references/design-guidelines.md +130 -0
- package/.claude/skills/momo-native-kits-skills/references/developer/android-compose.md +29 -0
- package/.claude/skills/momo-native-kits-skills/references/developer/code-convention.md +118 -0
- package/.claude/skills/momo-native-kits-skills/references/developer/compose-multiplatform.md +29 -0
- package/.claude/skills/momo-native-kits-skills/scripts/logger.js +63 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/badge.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/bottomtab.js +19 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/button.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/card.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/checkbox.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/chip.js +59 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/divider.js +19 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/global.js +61 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/index.js +54 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/input.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/navigation.js +48 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/popup.js +45 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/radio.js +105 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/skeleton.js +20 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/snackbar.js +32 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/state.js +21 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/switch.js +45 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/text.js +19 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/tooltip.js +45 -0
- package/.claude/skills/momo-native-kits-skills/scripts/rules/trustbanner.js +22 -0
- package/.claude/skills/momo-native-kits-skills/scripts/test-on-device.sh +117 -0
- package/.claude/skills/momo-native-kits-skills/scripts/test-runner.js +167 -0
- package/.claude/skills/momo-native-kits-skills/scripts/validate-kits.js +131 -0
- package/.momo-agent.json +13 -0
- package/compose/build.gradle.kts +1 -1
- package/gradle.properties +1 -1
- package/package.json +1 -1
- package/.claude/momo-native-kits-skill/SKILL.md +0 -51
- package/.claude/momo-native-kits-skill/evals/evals.json +0 -95
- package/.claude/momo-native-kits-skill/workspace/iteration-1/benchmark.json +0 -20
- package/.claude/momo-native-kits-skill/workspace/iteration-1/benchmark.md +0 -13
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/with_skill/outputs/ButtonExample.kt +0 -55
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-0-button/without_skill/outputs/ButtonExample.kt +0 -45
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/with_skill/outputs/InputPhoneExample.kt +0 -40
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-1-input/without_skill/outputs/InputPhoneExample.kt +0 -42
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/with_skill/outputs/BottomTabExample.kt +0 -236
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-2-bottomtab/without_skill/outputs/BottomTabExample.kt +0 -152
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/with_skill/outputs/CheckBoxExample.kt +0 -49
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-3-checkbox/without_skill/outputs/CheckBoxExample.kt +0 -123
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/with_skill/outputs/DateTimePickerExample.kt +0 -318
- package/.claude/momo-native-kits-skill/workspace/iteration-1/eval-4-datetimepicker/without_skill/outputs/DateTimePickerExample.kt +0 -330
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-card/with_skill/outputs/CardExample.kt +0 -124
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-card/without_skill/outputs/CardExample.kt +0 -71
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-loginform/with_skill/outputs/LoginFormExample.kt +0 -134
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-loginform/without_skill/outputs/LoginFormExample.kt +0 -199
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-navcontainer/with_skill/outputs/NavigationContainerExample.kt +0 -224
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-navcontainer/without_skill/outputs/NavigationContainerExample.kt +0 -225
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-popup/with_skill/outputs/PopupExample.kt +0 -79
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-popup/without_skill/outputs/PopupExample.kt +0 -169
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/eval_metadata.json +0 -6
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/with_skill/outputs/SetOptionsExample.kt +0 -255
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-setoptions/without_skill/outputs/SetOptionsExample.kt +0 -212
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-skeleton/with_skill/outputs/SkeletonExample.kt +0 -199
- package/.claude/momo-native-kits-skill/workspace/iteration-2/eval-skeleton/without_skill/outputs/SkeletonExample.kt +0 -229
- package/.claude/momo-native-kits-skill/workspace/iteration-3/benchmark.json +0 -20
- package/.claude/momo-native-kits-skill/workspace/iteration-3/benchmark.md +0 -13
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/eval_metadata.json +0 -22
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/with_skill/outputs/PrimaryButtonExample.kt +0 -38
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/with_skill/timing.json +0 -5
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/without_skill/outputs/PrimaryButtonExample.kt +0 -83
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-button/without_skill/timing.json +0 -5
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/eval_metadata.json +0 -22
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/with_skill/outputs/NavigationContainerExample.kt +0 -547
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/with_skill/timing.json +0 -5
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/without_skill/outputs/MoMoNavigationContainer.kt +0 -519
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-navcontainer/without_skill/timing.json +0 -5
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/eval_metadata.json +0 -27
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/with_skill/outputs/SetOptionsExample.kt +0 -429
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/with_skill/timing.json +0 -5
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/without_skill/outputs/SetOptionsExample.kt +0 -353
- package/.claude/momo-native-kits-skill/workspace/iteration-3/eval-setoptions/without_skill/timing.json +0 -5
- package/.claude/settings.local.json +0 -41
- package/local.properties +0 -8
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/data-display}/references/badge.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/data-display}/references/chip.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/data-display}/references/skeleton.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/data-display}/references/text.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/feedback}/references/snackbar.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/feedback}/references/tooltip.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/feedback}/references/trustbanner.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/form-controls}/references/checkbox.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/form-controls}/references/switch.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/layout}/references/card.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/layout}/references/divider.md +0 -0
- /package/.claude/{momo-native-kits-skill → skills/momo-native-kits-skills/navigation}/references/navigation.md +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# MoMo Native Kits Skills
|
|
2
|
+
|
|
3
|
+
Generate production-ready Kotlin/Compose code using vn.momo.kits components. NEVER use Material Design.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Validate generated code
|
|
9
|
+
node scripts/validate-kits.js <file.kt>
|
|
10
|
+
|
|
11
|
+
# Run tests
|
|
12
|
+
node scripts/test-runner.js
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Skills
|
|
16
|
+
|
|
17
|
+
| Skill | Components |
|
|
18
|
+
|-------|------------|
|
|
19
|
+
| [form-controls](form-controls/) | Button, Input, CheckBox, Radio, Switch |
|
|
20
|
+
| [data-display](data-display/) | Text, Chip, Badge, Skeleton |
|
|
21
|
+
| [layout](layout/) | Card, Divider |
|
|
22
|
+
| [feedback](feedback/) | Popup, SnackBar, Tooltip, TrustBanner |
|
|
23
|
+
| [navigation](navigation/) | BottomTab, Header, NavigationContainer |
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
1. Identify component needed
|
|
28
|
+
2. Read component reference
|
|
29
|
+
3. Generate code per API
|
|
30
|
+
4. Add AI block markers
|
|
31
|
+
5. Validate
|
|
32
|
+
|
|
33
|
+
## Scripts
|
|
34
|
+
|
|
35
|
+
| Script | Purpose |
|
|
36
|
+
|--------|---------|
|
|
37
|
+
| `validate-kits.js` | Validate generated code |
|
|
38
|
+
| `test-runner.js` | Run skill tests |
|
|
39
|
+
| `test-on-device.sh` | Build & test on device |
|
|
40
|
+
|
|
41
|
+
## Rules
|
|
42
|
+
|
|
43
|
+
- Use `vn.momo.kits.components` and `vn.momo.kits.const`
|
|
44
|
+
- NO: `androidx.compose.material`, `Material3`, `Material2`
|
|
45
|
+
- Follow [code-convention.md](references/developer/code-convention.md)
|
|
46
|
+
|
|
47
|
+
## Test Results
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Validation Rules: 17/17 ✅
|
|
51
|
+
References: 21/21 ✅
|
|
52
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: momo-native-kits-skills
|
|
3
|
+
description: |
|
|
4
|
+
Generate Kotlin/Compose code using vn.momo.kits components. NEVER use Material Design.
|
|
5
|
+
|
|
6
|
+
Use when user mention:
|
|
7
|
+
- Button, Input, CheckBox, Radio, Switch, Text, Chip, Badge, Skeleton, Card, Divider, Popup, SnackBar, Tooltip, TrustBanner, BottomTab, Header, NavigationContainer
|
|
8
|
+
- nút bấm, ô nhập, ô tick, nút chọn, nút gạt, chữ, nhãn, thẻ, khung, đường kẻ, xác nhận, thông báo, gợi ý, bảo mật, thanh điều hướng, tiêu đề
|
|
9
|
+
|
|
10
|
+
IMPORTANT: Use ONLY MoMo Native Kits components from `vn.momo.kits.*`. NEVER use Material3, Material2.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# MoMo Native Kits
|
|
14
|
+
|
|
15
|
+
## Prereqs
|
|
16
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
17
|
+
- NO: `androidx.compose.material`, `Material3`, `Material2`
|
|
18
|
+
- Read [code-convention.md](references/developer/code-convention.md) before generating code
|
|
19
|
+
|
|
20
|
+
## Skills
|
|
21
|
+
|
|
22
|
+
| Skill | Components | Triggers |
|
|
23
|
+
|-------|------------|----------|
|
|
24
|
+
| [form-controls](form-controls/SKILL.md) | Button, Input, CheckBox, Radio, Switch | button/input/checkbox/radio/switch, nút bấm/ô nhập/ô tick |
|
|
25
|
+
| [data-display](data-display/SKILL.md) | Text, Chip, Badge, Skeleton | text/chip/badge/skeleton, chữ/nhãn/thông báo/loading |
|
|
26
|
+
| [layout](layout/SKILL.md) | Card, Divider | card/divider, thẻ/khung/đường kẻ |
|
|
27
|
+
| [feedback](feedback/SKILL.md) | Popup, SnackBar, Tooltip, TrustBanner | popup/snackbar/tooltip, xác nhận/thông báo/gợi ý |
|
|
28
|
+
| [navigation](navigation/SKILL.md) | BottomTab, Header, NavigationContainer | bottomtab/header, thanh điều hướng/tiêu đề |
|
|
29
|
+
|
|
30
|
+
## Quick Ref
|
|
31
|
+
- **Validate**: `node scripts/validate-kits.js <file.kt>`
|
|
32
|
+
- **Code Convention**: [references/developer/code-convention.md](references/developer/code-convention.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: data-display
|
|
3
|
+
description: |
|
|
4
|
+
Text, Title, Chip, Badge, Skeleton. Use vn.momo.kits. NEVER Material.
|
|
5
|
+
Triggers: text/title/chip/badge/skeleton | chữ/tiêu đề/nhãn/thông báo số/loading/hiển thị
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Data Display
|
|
9
|
+
|
|
10
|
+
## Prereqs
|
|
11
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
12
|
+
- NO: `Material3`, `Material2`
|
|
13
|
+
- Read [code-convention.md](../references/developer/code-convention.md)
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
| Component | Ref |
|
|
17
|
+
|-----------|-----|
|
|
18
|
+
| Text | [text.md](references/text.md) |
|
|
19
|
+
| Title | [text.md](references/text.md) |
|
|
20
|
+
| Chip | [chip.md](references/chip.md) |
|
|
21
|
+
| Badge | [badge.md](references/badge.md) |
|
|
22
|
+
| Skeleton | [skeleton.md](references/skeleton.md) |
|
|
23
|
+
| Constants | [constants.md](../references/constants.md) |
|
|
24
|
+
| Design | [design-guidelines.md](../references/design-guidelines.md) |
|
|
25
|
+
|
|
26
|
+
## Workflow (with logging)
|
|
27
|
+
1. **📥 Read** component ref + [constants.md](../references/constants.md) + [code-convention.md](../references/developer/code-convention.md)
|
|
28
|
+
2. **✏️ Generate** code per API
|
|
29
|
+
3. **🏷️ Apply AI Convention**: Add file header + AI-GENERATED START/END markers (per code-convention.md)
|
|
30
|
+
4. **✅ Validate**: `node ../../scripts/validate-kits.js <file.kt>`
|
|
31
|
+
5. **🔧 Fix** errors if any
|
|
32
|
+
|
|
33
|
+
## Example Log Output
|
|
34
|
+
```
|
|
35
|
+
🤖 data-display: Starting
|
|
36
|
+
📥 → references/text.md
|
|
37
|
+
📥 → ../references/constants.md
|
|
38
|
+
📥 → ../references/developer/code-convention.md
|
|
39
|
+
✏️ → Generating Text component
|
|
40
|
+
🏷️ → Applying AI Convention (header + markers)
|
|
41
|
+
✅ → Validating (5 passed)
|
|
42
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feedback
|
|
3
|
+
description: |
|
|
4
|
+
PopupNotify, PopupPromotion, SnackBar, Tooltip, TrustBanner, Information. Use vn.momo.kits. NEVER Material.
|
|
5
|
+
Triggers: popup/snackbar/tooltip/trustbanner/information/promotion | xác nhận/thông báo/gợi ý/bảo mật/khuyến mãi/cảnh báo
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Feedback
|
|
9
|
+
|
|
10
|
+
## Prereqs
|
|
11
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
12
|
+
- NO: `Material3`, `Material2`
|
|
13
|
+
- Read [code-convention.md](../references/developer/code-convention.md)
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
| Component | Ref |
|
|
17
|
+
|-----------|-----|
|
|
18
|
+
| PopupNotify | [popup.md](references/popup.md) |
|
|
19
|
+
| PopupPromotion | [popup.md](references/popup.md) |
|
|
20
|
+
| SnackBar | [snackbar.md](references/snackbar.md) |
|
|
21
|
+
| Tooltip | [tooltip.md](references/tooltip.md) |
|
|
22
|
+
| TrustBanner | [trustbanner.md](references/trustbanner.md) |
|
|
23
|
+
| Information | [trustbanner.md](references/trustbanner.md) |
|
|
24
|
+
| Constants | [constants.md](../references/constants.md) |
|
|
25
|
+
| Design | [design-guidelines.md](../references/design-guidelines.md) |
|
|
26
|
+
|
|
27
|
+
## Workflow (with logging)
|
|
28
|
+
1. **📥 Read** component ref + [constants.md](../references/constants.md) + [code-convention.md](../references/developer/code-convention.md)
|
|
29
|
+
2. **✏️ Generate** code per API
|
|
30
|
+
3. **🏷️ Apply AI Convention**: Add file header + AI-GENERATED START/END markers (per code-convention.md)
|
|
31
|
+
4. **✅ Validate**: `node ../../scripts/validate-kits.js <file.kt>`
|
|
32
|
+
5. **🔧 Fix** errors if any
|
|
33
|
+
|
|
34
|
+
## Example Log Output
|
|
35
|
+
```
|
|
36
|
+
🤖 feedback: Starting
|
|
37
|
+
📥 → references/popup.md
|
|
38
|
+
📥 → ../references/constants.md
|
|
39
|
+
📥 → ../references/developer/code-convention.md
|
|
40
|
+
✏️ → Generating Popup component
|
|
41
|
+
🏷️ → Applying AI Convention (header + markers)
|
|
42
|
+
✅ → Validating (6 passed)
|
|
43
|
+
```
|
|
@@ -12,8 +12,7 @@ fun PopupNotify(
|
|
|
12
12
|
|
|
13
13
|
data class PopupNotifyProps(
|
|
14
14
|
val title: String,
|
|
15
|
-
val
|
|
16
|
-
val type: PopupNotifyType = PopupNotifyType.INFO,
|
|
15
|
+
val description: String? = null,
|
|
17
16
|
val primary: PopupAction? = null,
|
|
18
17
|
val secondary: PopupAction? = null,
|
|
19
18
|
val onIconClose: (() -> Unit)? = null,
|
|
@@ -24,10 +23,6 @@ data class PopupAction(
|
|
|
24
23
|
val title: String,
|
|
25
24
|
val onPress: () -> Unit
|
|
26
25
|
)
|
|
27
|
-
|
|
28
|
-
enum class PopupNotifyType {
|
|
29
|
-
SUCCESS, ERROR, WARNING, INFO
|
|
30
|
-
}
|
|
31
26
|
```
|
|
32
27
|
|
|
33
28
|
## Basic
|
|
@@ -36,8 +31,7 @@ enum class PopupNotifyType {
|
|
|
36
31
|
PopupNotify(
|
|
37
32
|
props = PopupNotifyProps(
|
|
38
33
|
title = "Thành công",
|
|
39
|
-
|
|
40
|
-
type = PopupNotifyType.SUCCESS,
|
|
34
|
+
description = "Giao dịch đã được xử lý",
|
|
41
35
|
onIconClose = { showPopup = false }
|
|
42
36
|
)
|
|
43
37
|
)
|
|
@@ -49,8 +43,7 @@ PopupNotify(
|
|
|
49
43
|
PopupNotify(
|
|
50
44
|
props = PopupNotifyProps(
|
|
51
45
|
title = "Xác nhận",
|
|
52
|
-
|
|
53
|
-
type = PopupNotifyType.WARNING,
|
|
46
|
+
description = "Bạn có chắc muốn xóa?",
|
|
54
47
|
primary = PopupAction(title = "Xóa", onPress = { /* delete */ }),
|
|
55
48
|
secondary = PopupAction(title = "Hủy", onPress = { /* cancel */ }),
|
|
56
49
|
onIconClose = { showPopup = false }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: form-controls
|
|
3
|
+
description: |
|
|
4
|
+
Button, Input, CheckBox, Radio, Switch, InputSearch, InputOTP, InputMoney, InputDropDown, InputPhoneNumber. Use vn.momo.kits. NEVER Material.
|
|
5
|
+
Triggers: button/input/checkbox/radio/switch/search/otp/money/dropdown/phone | nút bấm/ô nhập/ô tick/nút chọn/nút gạt/tìm kiếm/mã xác thực/tiền/chọn danh sách/số điện thoại
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Form Controls
|
|
9
|
+
|
|
10
|
+
## Prereqs
|
|
11
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
12
|
+
- NO: `Material3`, `Material2`
|
|
13
|
+
- Read [code-convention.md](../references/developer/code-convention.md)
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
| Component | Ref |
|
|
17
|
+
|-----------|-----|
|
|
18
|
+
| Button | [button.md](references/button.md) |
|
|
19
|
+
| Input | [input.md](references/input.md) |
|
|
20
|
+
| CheckBox | [checkbox.md](references/checkbox.md) |
|
|
21
|
+
| Radio | [radio.md](references/radio.md) |
|
|
22
|
+
| Switch | [switch.md](references/switch.md) |
|
|
23
|
+
| Constants | [constants.md](../references/constants.md) |
|
|
24
|
+
| Design | [design-guidelines.md](../references/design-guidelines.md) |
|
|
25
|
+
|
|
26
|
+
## Workflow (with logging)
|
|
27
|
+
1. **📥 Read** component ref + [constants.md](../references/constants.md) + [code-convention.md](../references/developer/code-convention.md)
|
|
28
|
+
2. **✏️ Generate** code per API
|
|
29
|
+
3. **🏷️ Apply AI Convention**: Add file header + AI-GENERATED START/END markers (per code-convention.md)
|
|
30
|
+
4. **✅ Validate**: `node ../../scripts/validate-kits.js <file.kt>`
|
|
31
|
+
5. **🔧 Fix** errors if any
|
|
32
|
+
|
|
33
|
+
## Example Log Output
|
|
34
|
+
```
|
|
35
|
+
🤖 form-controls: Starting
|
|
36
|
+
📥 → references/switch.md
|
|
37
|
+
📥 → ../references/constants.md
|
|
38
|
+
📥 → ../references/developer/code-convention.md
|
|
39
|
+
✏️ → Generating Switch component
|
|
40
|
+
🏷️ → Applying AI Convention (header + markers)
|
|
41
|
+
✅ → Validating (9 passed)
|
|
42
|
+
```
|
|
@@ -121,8 +121,7 @@ Button(
|
|
|
121
121
|
Button(
|
|
122
122
|
onClick = { /* Will not trigger */ },
|
|
123
123
|
title = "Không thể click",
|
|
124
|
-
type = ButtonType.DISABLED
|
|
125
|
-
enabled = false
|
|
124
|
+
type = ButtonType.DISABLED
|
|
126
125
|
)
|
|
127
126
|
```
|
|
128
127
|
|
|
@@ -154,7 +153,7 @@ fun LoginScreen() {
|
|
|
154
153
|
modifier = Modifier.fillMaxWidth()
|
|
155
154
|
)
|
|
156
155
|
|
|
157
|
-
|
|
156
|
+
Button(
|
|
158
157
|
onClick = { /* Navigate to forgot password */ },
|
|
159
158
|
title = "Quên mật khẩu?",
|
|
160
159
|
type = ButtonType.TEXT
|
|
@@ -326,11 +326,9 @@ fun InputPhoneNumber(
|
|
|
326
326
|
text: MutableState<String>,
|
|
327
327
|
onChangeText: (String) -> Unit,
|
|
328
328
|
modifier: Modifier = Modifier,
|
|
329
|
-
floatingValue: String = "",
|
|
330
329
|
placeholder: String = "",
|
|
331
330
|
error: String = "",
|
|
332
|
-
enabled: Boolean = true
|
|
333
|
-
countryCode: String = "+84" // Default country code
|
|
331
|
+
enabled: Boolean = true
|
|
334
332
|
)
|
|
335
333
|
```
|
|
336
334
|
|
|
@@ -342,9 +340,7 @@ val phone = remember { mutableStateOf("") }
|
|
|
342
340
|
InputPhoneNumber(
|
|
343
341
|
text = phone,
|
|
344
342
|
onChangeText = { phone.value = it },
|
|
345
|
-
|
|
346
|
-
placeholder = "Nhập số điện thoại",
|
|
347
|
-
countryCode = "+84"
|
|
343
|
+
placeholder = "Nhập số điện thoại"
|
|
348
344
|
)
|
|
349
345
|
```
|
|
350
346
|
|
|
@@ -364,7 +360,7 @@ fun LoginForm() {
|
|
|
364
360
|
InputPhoneNumber(
|
|
365
361
|
text = phone,
|
|
366
362
|
onChangeText = { phone.value = it },
|
|
367
|
-
|
|
363
|
+
placeholder = "Số điện thoại"
|
|
368
364
|
)
|
|
369
365
|
|
|
370
366
|
Input(
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
```kotlin
|
|
8
8
|
@Composable
|
|
9
9
|
fun Radio(
|
|
10
|
-
value:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
label: String = "",
|
|
15
|
-
|
|
10
|
+
value: Any, // Required: This radio's value
|
|
11
|
+
groupValue: Any, // Required: Currently selected value
|
|
12
|
+
disabled: Boolean = false, // Disabled state
|
|
13
|
+
onChange: () -> Unit = {}, // Selection callback (no param)
|
|
14
|
+
label: String = "", // Label text
|
|
15
|
+
modifier: Modifier = Modifier
|
|
16
16
|
)
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -24,14 +24,14 @@ var selectedOption by remember { mutableStateOf("option1") }
|
|
|
24
24
|
Column {
|
|
25
25
|
Radio(
|
|
26
26
|
value = "option1",
|
|
27
|
-
onChange = { selectedOption =
|
|
27
|
+
onChange = { selectedOption = "option1" },
|
|
28
28
|
groupValue = selectedOption,
|
|
29
29
|
label = "Option 1"
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
Radio(
|
|
33
33
|
value = "option2",
|
|
34
|
-
onChange = { selectedOption =
|
|
34
|
+
onChange = { selectedOption = "option2" },
|
|
35
35
|
groupValue = selectedOption,
|
|
36
36
|
label = "Option 2"
|
|
37
37
|
)
|
|
@@ -48,7 +48,7 @@ var gender by remember { mutableStateOf(Gender.MALE) }
|
|
|
48
48
|
Gender.entries.forEach { g ->
|
|
49
49
|
Radio(
|
|
50
50
|
value = g,
|
|
51
|
-
onChange = { gender =
|
|
51
|
+
onChange = { gender = g },
|
|
52
52
|
groupValue = gender,
|
|
53
53
|
label = when (g) {
|
|
54
54
|
Gender.MALE -> "Nam"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: layout
|
|
3
|
+
description: |
|
|
4
|
+
Card, Divider. Use vn.momo.kits. NEVER Material.
|
|
5
|
+
Triggers: card/divider | thẻ/khung/đường kẻ/bố cục
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Layout
|
|
9
|
+
|
|
10
|
+
## Prereqs
|
|
11
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
12
|
+
- NO: `Material3`, `Material2`
|
|
13
|
+
- Read [code-convention.md](../references/developer/code-convention.md)
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
| Component | Ref |
|
|
17
|
+
|-----------|-----|
|
|
18
|
+
| Card | [card.md](references/card.md) |
|
|
19
|
+
| Divider | [divider.md](references/divider.md) |
|
|
20
|
+
| Constants | [constants.md](../references/constants.md) |
|
|
21
|
+
| Design | [design-guidelines.md](../references/design-guidelines.md) |
|
|
22
|
+
|
|
23
|
+
## Workflow (with logging)
|
|
24
|
+
1. **📥 Read** component ref + [constants.md](../references/constants.md) + [code-convention.md](../references/developer/code-convention.md)
|
|
25
|
+
2. **✏️ Generate** code per API
|
|
26
|
+
3. **🏷️ Apply AI Convention**: Add file header + AI-GENERATED START/END markers (per code-convention.md)
|
|
27
|
+
4. **✅ Validate**: `node ../../scripts/validate-kits.js <file.kt>`
|
|
28
|
+
5. **🔧 Fix** errors if any
|
|
29
|
+
|
|
30
|
+
## Example Log Output
|
|
31
|
+
```
|
|
32
|
+
🤖 layout: Starting
|
|
33
|
+
📥 → references/divider.md
|
|
34
|
+
📥 → ../references/constants.md
|
|
35
|
+
📥 → ../references/developer/code-convention.md
|
|
36
|
+
✏️ → Generating Divider component
|
|
37
|
+
🏷️ → Applying AI Convention (header + markers)
|
|
38
|
+
✅ → Validating (5 passed)
|
|
39
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: navigation
|
|
3
|
+
description: |
|
|
4
|
+
BottomTab, Header, NavigationContainer, setOptions. Use vn.momo.kits. NEVER Material.
|
|
5
|
+
Triggers: bottomtab/header/navigation/navigator/setOptions | thanh điều hướng/tiêu đề/điều hướng/chuyển màn hình
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Navigation
|
|
9
|
+
|
|
10
|
+
## Prereqs
|
|
11
|
+
- Import: `vn.momo.kits.components`, `vn.momo.kits.const`
|
|
12
|
+
- NO: `Material3`, `Material2`
|
|
13
|
+
- Read [code-convention.md](../references/developer/code-convention.md)
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
| Component | Ref |
|
|
17
|
+
|-----------|-----|
|
|
18
|
+
| Navigation | [navigation.md](references/navigation.md) |
|
|
19
|
+
| Constants | [constants.md](../references/constants.md) |
|
|
20
|
+
| Design | [design-guidelines.md](../references/design-guidelines.md) |
|
|
21
|
+
|
|
22
|
+
## Workflow (with logging)
|
|
23
|
+
1. **📥 Read** component ref + [constants.md](../references/constants.md) + [code-convention.md](../references/developer/code-convention.md)
|
|
24
|
+
2. **✏️ Generate** code per API
|
|
25
|
+
3. **🏷️ Apply AI Convention**: Add file header + AI-GENERATED START/END markers (per code-convention.md)
|
|
26
|
+
4. **✅ Validate**: `node ../../scripts/validate-kits.js <file.kt>`
|
|
27
|
+
5. **🔧 Fix** errors if any
|
|
28
|
+
|
|
29
|
+
## Example Log Output
|
|
30
|
+
```
|
|
31
|
+
🤖 navigation: Starting
|
|
32
|
+
📥 → references/navigation.md
|
|
33
|
+
📥 → ../references/constants.md
|
|
34
|
+
📥 → ../references/developer/code-convention.md
|
|
35
|
+
✏️ → Generating BottomTab component
|
|
36
|
+
🏷️ → Applying AI Convention (header + markers)
|
|
37
|
+
✅ → Validating (4 passed)
|
|
38
|
+
```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"file": "sample/shared/src/commonMain/kotlin/screens/TestComponents.kt",
|
|
3
|
+
"validatedAt": "2026-03-17T03:10:45.378Z",
|
|
4
|
+
"summary": {
|
|
5
|
+
"total": 12,
|
|
6
|
+
"passed": 12,
|
|
7
|
+
"errors": 0,
|
|
8
|
+
"warnings": 0
|
|
9
|
+
},
|
|
10
|
+
"results": [
|
|
11
|
+
{
|
|
12
|
+
"id": "no-material-import",
|
|
13
|
+
"category": "Global",
|
|
14
|
+
"name": "No Material Design imports",
|
|
15
|
+
"severity": "error",
|
|
16
|
+
"passed": true,
|
|
17
|
+
"evidence": "No Material imports found"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "no-material-components",
|
|
21
|
+
"category": "Global",
|
|
22
|
+
"name": "No Material components used",
|
|
23
|
+
"severity": "error",
|
|
24
|
+
"passed": true,
|
|
25
|
+
"evidence": "No Material components used"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "momo-kits-import",
|
|
29
|
+
"category": "Global",
|
|
30
|
+
"name": "Uses vn.momo.kits imports",
|
|
31
|
+
"severity": "warning",
|
|
32
|
+
"passed": true,
|
|
33
|
+
"evidence": "Found vn.momo.kits imports"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "button-no-text",
|
|
37
|
+
"category": "Button",
|
|
38
|
+
"name": "Button uses \"title\" (not \"text\")",
|
|
39
|
+
"severity": "error",
|
|
40
|
+
"passed": true,
|
|
41
|
+
"evidence": "Button uses correct param name"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "button-no-enabled",
|
|
45
|
+
"category": "Button",
|
|
46
|
+
"name": "Button has no \"enabled\" param",
|
|
47
|
+
"severity": "error",
|
|
48
|
+
"passed": true,
|
|
49
|
+
"evidence": "No invalid \"enabled\" param on Button"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": "checkbox-no-enabled",
|
|
53
|
+
"category": "CheckBox",
|
|
54
|
+
"name": "CheckBox uses \"disabled\" (not \"enabled\")",
|
|
55
|
+
"severity": "error",
|
|
56
|
+
"passed": true,
|
|
57
|
+
"evidence": "CheckBox uses correct \"disabled\" param"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "checkbox-no-modifier",
|
|
61
|
+
"category": "CheckBox",
|
|
62
|
+
"name": "CheckBox has no modifier param",
|
|
63
|
+
"severity": "warning",
|
|
64
|
+
"passed": true,
|
|
65
|
+
"evidence": "No invalid modifier on CheckBox"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "phone-no-floatingValue",
|
|
69
|
+
"category": "InputPhoneNumber",
|
|
70
|
+
"name": "InputPhoneNumber has no floatingValue",
|
|
71
|
+
"severity": "error",
|
|
72
|
+
"passed": true,
|
|
73
|
+
"evidence": "No invalid floatingValue usage"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "phone-no-countryCode",
|
|
77
|
+
"category": "InputPhoneNumber",
|
|
78
|
+
"name": "InputPhoneNumber has no countryCode",
|
|
79
|
+
"severity": "error",
|
|
80
|
+
"passed": true,
|
|
81
|
+
"evidence": "No invalid countryCode usage"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "text-no-fontSize",
|
|
85
|
+
"category": "Text",
|
|
86
|
+
"name": "Text uses \"style\" (not \"fontSize\")",
|
|
87
|
+
"severity": "warning",
|
|
88
|
+
"passed": true,
|
|
89
|
+
"evidence": "Text typography usage looks correct"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "state-remember",
|
|
93
|
+
"category": "State",
|
|
94
|
+
"name": "MutableState uses remember",
|
|
95
|
+
"severity": "warning",
|
|
96
|
+
"passed": true,
|
|
97
|
+
"evidence": "State properly wrapped in remember"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "nav-no-scaffold",
|
|
101
|
+
"category": "Navigation",
|
|
102
|
+
"name": "No Scaffold (use NavigationContainer)",
|
|
103
|
+
"severity": "error",
|
|
104
|
+
"passed": true,
|
|
105
|
+
"evidence": "No Scaffold usage"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|