@morya-ui/setup 0.3.2 → 0.3.3
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/package.json +1 -1
- package/template/.agents/skills/morya-ui-pages/SKILL.md +7 -5
- package/template/.agents/skills/morya-ui-pages/evals/evals.json +18 -0
- package/template/.agents/skills/morya-ui-pages/references/component-index.md +51 -50
- package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +1559 -0
- package/template/.agents/skills/morya-ui-pages/references/feedback.md +2 -0
- package/template/.cursor/rules/component-usage.mdc +1 -1
- package/template/.cursor/rules/design-system.mdc +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morya-ui/setup",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"description": "One-shot setup for morya-ui: install the library, Cursor MCP, Agent skills, and design config.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/morya-space/morya-ui/tree/main/packages/setup#readme",
|
|
@@ -66,7 +66,7 @@ For Express / branded Account moments, also draft a tiny **design plan** (see [v
|
|
|
66
66
|
| Ops pattern | `recommend_page` → **`get_golden_page`** (mirror; do not invent a parallel scaffold aesthetic) | [page-layouts.md](references/page-layouts.md) |
|
|
67
67
|
| Account / Express / empty / result | `recommend_page` → `get_golden_page` (`login-page` / `landing-page` / `empty-state` / `result-page`) | [surfaces.md](references/surfaces.md) |
|
|
68
68
|
| Visual direction | — | [visual-craft.md](references/visual-craft.md) (Ops polish / atmosphere / anti-defaults) |
|
|
69
|
-
| Components / **API truth** | `search` / **`get_component`** / `get_example` /
|
|
69
|
+
| Components / **API truth** | `search` / **`get_component`** / `get_example` / **`recommend_component`** (includes L2 recipes) | [decision-recipes.md](references/decision-recipes.md) + [component-index.md](references/component-index.md) |
|
|
70
70
|
| Tokens / rules | `get_design_rules` | [design-system.md](references/design-system.md) |
|
|
71
71
|
| Snippet | `get_page_snippet` | golden / surface excerpt |
|
|
72
72
|
| Feedback API | — | [feedback.md](references/feedback.md) |
|
|
@@ -85,11 +85,12 @@ For Express / branded Account moments, also draft a tiny **design plan** (see [v
|
|
|
85
85
|
### 4. Wire real API usage
|
|
86
86
|
|
|
87
87
|
- Import from `morya-ui` (or documented subpath + style).
|
|
88
|
-
-
|
|
88
|
+
- **Selection + key props:** call MCP **`recommend_component`** (by query or `decision` id) and apply the returned **recipe** (`props` / `slots` / `events`) and **antiPatterns**. Without MCP, read [decision-recipes.md](references/decision-recipes.md). Then confirm full API with `get_component` / `get_example`.
|
|
89
|
+
- Forms: `MForm` + fields; `@submit` + `type="submit"` (or documented footer button pattern on `form-in-dialog`).
|
|
89
90
|
- Tables: `columns` + `rows` + `row-key`; `#cell-{key}`. There is no `data` prop.
|
|
90
91
|
- Enums → `MSelect` / `MTreeSelect`; action menus → `MDropdown`.
|
|
91
|
-
- Destructive → `MConfirmDialog` / `MConfirmPopup
|
|
92
|
-
- Feedback → default **`message`**; `toast` only for summary+detail / async. See [feedback.md](references/feedback.md).
|
|
92
|
+
- Destructive → `MConfirmDialog` / `MConfirmPopup` (`confirm-choice`).
|
|
93
|
+
- Feedback → default **`message`**; `toast` only for summary+detail / async; persistent form errors → `errorMessage` / `role="alert"` (`feedback-choice`). See [feedback.md](references/feedback.md).
|
|
93
94
|
- Motion → intensity with `useMotion` (`full` / `reduced` / `none`); overlay enter/exit with `transition` prop or `createMoryaUI({ motion: { transitions } })` — do not invent a second animation stack. Prefer MCP / docs `motion` guide.
|
|
94
95
|
- **Before craft:** for each unfamiliar or newly written `M*` usage, call MCP **`get_component` / `get_example`**, then **`validate_usage`**. Fix every `unknown-prop` / `unknown-event` before delivery.
|
|
95
96
|
- `recommend_page(includeScaffold: true)` returns the **golden page source** when one exists — remap copy/data only; never treat generated fallback as the visual target.
|
|
@@ -156,7 +157,8 @@ Details: [optional-companions.md](references/optional-companions.md). Distilled
|
|
|
156
157
|
| [page-layouts.md](references/page-layouts.md) | Ops golden layouts |
|
|
157
158
|
| [visual-craft.md](references/visual-craft.md) | Ops polish, atmosphere recipes, anti-defaults, polish modes |
|
|
158
159
|
| [design-system.md](references/design-system.md) | Principles, tokens, bans |
|
|
159
|
-
| [component-index.md](references/component-index.md) |
|
|
160
|
+
| [component-index.md](references/component-index.md) | Catalog + decision-id index |
|
|
161
|
+
| [decision-recipes.md](references/decision-recipes.md) | Scenario → component → key props (generated; offline MCP mirror) |
|
|
160
162
|
| [feedback.md](references/feedback.md) | message / toast / MMessage |
|
|
161
163
|
| [review-checklist.md](references/review-checklist.md) | Pre-delivery checks |
|
|
162
164
|
| [optional-companions.md](references/optional-companions.md) | Combining with external design skills |
|
|
@@ -66,6 +66,24 @@
|
|
|
66
66
|
"prompt": "用户列表页上「新建/编辑」不要另开路由:同页 MDialog(约 32rem)里放短表单(姓名、邮箱、角色),页脚取消/保存;保存成功用 message 一句话。输出单个 Vue SFC。",
|
|
67
67
|
"expected_output": "form-in-dialog: list stays, MDialog + MForm + #footer, message.success not toast string, MTable rows.",
|
|
68
68
|
"files": []
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": 12,
|
|
72
|
+
"prompt": "做一个用户列表表格页:列姓名、角色、状态。状态列必须用 MStatus;行数据绑定用 rows(不要写 data prop);空表用 #empty + MEmpty。Vue3 + morya-ui,输出单个 SFC。",
|
|
73
|
+
"expected_output": "Prop accuracy: MTable columns+rows (not :data), #cell or Status for status, #empty+MEmpty, validate_usage clean.",
|
|
74
|
+
"files": []
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"id": 13,
|
|
78
|
+
"prompt": "列表行删除:点删除后用 MConfirmDialog(危险确认),确认后 message.success('已删除')。不要用 toast,也不要手写 Dialog 当确认框。输出片段或 SFC 均可。",
|
|
79
|
+
"expected_output": "confirm-choice + feedback-choice: MConfirmDialog v-model header/message acceptSeverity=danger @accept, message.success not toast, no hand Dialog confirm.",
|
|
80
|
+
"files": []
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": 14,
|
|
84
|
+
"prompt": "短新建弹窗:MDialog v-model + header + #footer(取消 secondary、保存 primary);表单字段 fluid。保存成功 message 一句话。不要用 v-model:visible。",
|
|
85
|
+
"expected_output": "form-surface Dialog recipe: v-model not visible, #footer actions, fluid fields, message.success.",
|
|
86
|
+
"files": []
|
|
69
87
|
}
|
|
70
88
|
]
|
|
71
89
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Component index (scenario map)
|
|
2
2
|
|
|
3
|
-
Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_usage`).
|
|
3
|
+
Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_usage`).
|
|
4
|
+
|
|
5
|
+
- **Selection + key props**: MCP `recommend_component`, or offline [decision-recipes.md](./decision-recipes.md) (generated from `packages/ui-mcp/src/decisions.ts`).
|
|
6
|
+
- This file is a **catalog + decision-id index**, not a prop manual.
|
|
4
7
|
|
|
5
8
|
## Shell
|
|
6
9
|
|
|
@@ -31,68 +34,66 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
|
|
|
31
34
|
|
|
32
35
|
## Feedback
|
|
33
36
|
|
|
34
|
-
| API / component | When |
|
|
35
|
-
| --- | --- |
|
|
36
|
-
| `message` | **Default** one-line CRUD result |
|
|
37
|
-
| `toast` | `summary` + `detail`, or async / background feel |
|
|
38
|
-
| `<MMessage>` | Optional host for the `message` service
|
|
39
|
-
| field `errorMessage` or token `role="alert"` | Persistent form / auth error |
|
|
40
|
-
| `MEmpty` | No-data / first-use / filtered empty
|
|
41
|
-
| `MResult` | Terminal outcome: success, failure, 403 / 404 / 500 |
|
|
42
|
-
| `MLoading` / `v-loading` / `loading.service` | **Default** region or fullscreen loading mask |
|
|
43
|
-
| `MSkeleton` | Layout
|
|
44
|
-
| `MProgressBar` | Determinate progress |
|
|
45
|
-
| `MProgressSpinner` | Inline spinner only, not a region mask |
|
|
46
|
-
| `MBlockUI` | Block interaction without a loading message |
|
|
37
|
+
| API / component | When | Decision |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| `message` | **Default** one-line CRUD result | `feedback-choice` |
|
|
40
|
+
| `toast` | `summary` + `detail`, or async / background feel | `feedback-choice` |
|
|
41
|
+
| `<MMessage>` | Optional host for the `message` service. **Not** an inline alert | `feedback-choice` |
|
|
42
|
+
| field `errorMessage` or token `role="alert"` | Persistent form / auth error | `feedback-choice` |
|
|
43
|
+
| `MEmpty` | No-data / first-use / filtered empty | `empty-result-choice` |
|
|
44
|
+
| `MResult` | Terminal outcome: success, failure, 403 / 404 / 500 | `empty-result-choice` |
|
|
45
|
+
| `MLoading` / `v-loading` / `loading.service` | **Default** region or fullscreen loading mask | `loading-choice` |
|
|
46
|
+
| `MSkeleton` | Layout known; placeholder while content arrives | `loading-choice` |
|
|
47
|
+
| `MProgressBar` | Determinate progress | `loading-choice` |
|
|
48
|
+
| `MProgressSpinner` | Inline spinner only, not a region mask | `loading-choice` |
|
|
49
|
+
| `MBlockUI` | Block interaction without a loading message | `loading-choice` |
|
|
47
50
|
|
|
48
51
|
## Overlays & menus
|
|
49
52
|
|
|
50
|
-
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu
|
|
53
|
+
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu`, `MCommandMenu`, `MMenu` / `MMenubar` / `MTieredMenu` / `MMegaMenu`, `MTabs`, `MStepper`
|
|
51
54
|
|
|
52
55
|
## Surfaces / media
|
|
53
56
|
|
|
54
57
|
`MCard`, `MPanel`, `MAccordion`, `MCarousel`, `MGallery`, `MIcon`, `MScrollbar`, `MInplace`, `MScrollTop`, `MTerminal`
|
|
55
58
|
|
|
56
|
-
## Scenario →
|
|
59
|
+
## Scenario → decision
|
|
60
|
+
|
|
61
|
+
Open MCP `recommend_component({ decision })` or the matching section in [decision-recipes.md](./decision-recipes.md) for **when / avoid / recipe props / anti-patterns**.
|
|
57
62
|
|
|
58
|
-
| Intent |
|
|
63
|
+
| Intent | Decision id |
|
|
59
64
|
| --- | --- |
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
| Right-click actions | `MContextMenu` |
|
|
83
|
-
| Global command search | `MCommandMenu` |
|
|
84
|
-
| Count or dot on a control | `MBadge` |
|
|
85
|
-
| Removable entity chip | `MChip` |
|
|
65
|
+
| Create / edit from a list (few–medium fields) vs long form page | `form-surface-choice` |
|
|
66
|
+
| Dialog vs Drawer vs Popover vs Tooltip | `overlay-choice` |
|
|
67
|
+
| Table vs DataView vs Tree / TreeTable | `data-display-choice` |
|
|
68
|
+
| Select vs TreeSelect vs AutoComplete vs Radio / … | `selection-choice` |
|
|
69
|
+
| Card vs Panel vs Fieldset | `surface-choice` |
|
|
70
|
+
| PageContent vs Flex vs Space vs Grid | `layout-spacing-choice` |
|
|
71
|
+
| PageFilters / Toolbar / Header / Section / Stat / Placeholder | `page-section-choice` |
|
|
72
|
+
| Layout scroll vs MScrollbar vs built-in | `page-scroll-choice` |
|
|
73
|
+
| Avoid double borders / extra Card wrappers | `surface-nesting-choice` |
|
|
74
|
+
| Loading vs Skeleton vs Progress* vs BlockUI | `loading-choice` |
|
|
75
|
+
| Status vs Tag vs Chip vs Badge | `status-label-choice` |
|
|
76
|
+
| Empty vs Result | `empty-result-choice` |
|
|
77
|
+
| Dropdown vs Menu vs ContextMenu vs CommandMenu | `action-menu-choice` |
|
|
78
|
+
| message vs toast vs field / form alert | `feedback-choice` |
|
|
79
|
+
| ConfirmDialog vs ConfirmPopup | `confirm-choice` |
|
|
80
|
+
| Searchable list + paging | `page-section-choice` + `data-display-choice` (+ list golden) |
|
|
81
|
+
| Delete / destructive | `confirm-choice` |
|
|
82
|
+
| Login / auth | `feedback-choice` + `login-page` golden |
|
|
83
|
+
| Marketing landing | `landing-page` golden (Express) |
|
|
84
|
+
| Multi-step create | `wizard-form` golden |
|
|
85
|
+
| Preferences / settings | `settings-page` golden |
|
|
86
|
+
| Resizable two-pane | use `MSplitter` (see docs / `get_component`) |
|
|
86
87
|
|
|
87
88
|
## Common mistakes
|
|
88
89
|
|
|
89
90
|
| Wrong | Right |
|
|
90
91
|
| --- | --- |
|
|
91
|
-
| `MDropdown` as form enum | `MSelect` |
|
|
92
|
-
| `MTable` `:data` | `:rows` (`
|
|
93
|
-
| `<MMessage severity>` as an inline alert | Field `errorMessage`, or
|
|
92
|
+
| `MDropdown` as form enum | `MSelect` (`selection-choice`) |
|
|
93
|
+
| `MTable` `:data` | `:rows` (`data-display-choice`) |
|
|
94
|
+
| `<MMessage severity>` as an inline alert | Field `errorMessage`, or token `role="alert"` (`feedback-choice`) |
|
|
94
95
|
| Hand `<table>` | `MTable` |
|
|
95
|
-
| Hand modal div | `MDialog` |
|
|
96
|
-
| Hand spinner or `MProgressSpinner` as a region / page mask | `MLoading` / `v-loading` |
|
|
97
|
-
| Extra `MCard` around every `MPage*` block |
|
|
98
|
-
| Assume undocumented props | MCP / docs lookup |
|
|
96
|
+
| Hand modal div | `MDialog` / `MConfirmDialog` |
|
|
97
|
+
| Hand spinner or `MProgressSpinner` as a region / page mask | `MLoading` / `v-loading` (`loading-choice`) |
|
|
98
|
+
| Extra `MCard` around every `MPage*` block | `surface-nesting-choice` |
|
|
99
|
+
| Assume undocumented props | MCP / docs lookup + `validate_usage` |
|