@morya-ui/setup 0.3.3 → 0.3.4
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/README.md +103 -103
- package/bin/morya-ui-setup.js +14 -14
- package/catalog/skills.json +46 -46
- package/package.json +5 -3
- package/src/cli.mjs +335 -335
- package/src/copy-template.mjs +78 -78
- package/src/fs-utils.mjs +24 -24
- package/src/install.mjs +63 -63
- package/src/mcp.mjs +50 -50
- package/src/package-json.mjs +30 -30
- package/src/skills.mjs +223 -223
- package/src/styles.mjs +119 -119
- package/template/.agents/skills/morya-ui-pages/SKILL.md +184 -164
- package/template/.agents/skills/morya-ui-pages/evals/evals.json +89 -89
- package/template/.agents/skills/morya-ui-pages/references/component-index.md +99 -99
- package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +32 -0
- package/template/.agents/skills/morya-ui-pages/references/design-system.md +101 -100
- package/template/.agents/skills/morya-ui-pages/references/feedback.md +68 -68
- package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +107 -34
- package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +141 -119
- package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +64 -61
- package/template/.agents/skills/morya-ui-pages/references/style-presets.md +73 -0
- package/template/.agents/skills/morya-ui-pages/references/surfaces.md +91 -89
- package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +221 -196
- package/template/.cursor/rules/coding-style.mdc +41 -41
- package/template/.cursor/rules/component-usage.mdc +41 -41
- package/template/.cursor/rules/design-system.mdc +17 -17
- package/template/.cursor/rules/page-layout.mdc +97 -78
- package/template/DESIGN.md +59 -59
- package/template/scripts/check-raw-colors.mjs +74 -74
- package/LICENSE +0 -21
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
{
|
|
2
|
-
"skill_name": "morya-ui-pages",
|
|
3
|
-
"evals": [
|
|
4
|
-
{
|
|
5
|
-
"id": 1,
|
|
6
|
-
"prompt": "我们内部教务系统用 Vue3 + morya-ui。请做一个「课程列表」后台页:按课程名搜索、按开课状态(全部/开课中/已结课)筛选;表格列:名称、状态、学分、更新时间;行内「编辑」进抽屉表单,「删除」要二次确认;右上角「新建课程」。保存/删除成功只要一句话提示。输出单个 Vue SFC,结构对齐列表黄金样例,并做 Ops 精致化(侧栏图标、状态用 MStatus、空态用 MEmpty、行操作不要一排实心按钮)。",
|
|
7
|
-
"expected_output": "Ops list: MLayout/MPageHeader/MPageFilters/MTable rows, optional batch MPageToolbar, MSelect status, MDrawer edit, MConfirmDialog delete, message not toast, MStatus for status, MEmpty in #empty, menu icons, text/small row actions, craft pass applied, no second UI kit.",
|
|
8
|
-
"files": []
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"id": 2,
|
|
12
|
-
"prompt": "同一个 morya-ui 项目里,生成「新建员工」独立表单页:姓名、工作邮箱、部门(下拉)、入职日期;窄栏;页头有标题和一句说明;底栏保存(primary)/取消(secondary)。不要做成营销落地页,不要用 Toast 提示「已保存」。输出单个 Vue SFC。",
|
|
13
|
-
"expected_output": "Ops form golden: narrow MPageContent, MPageHeader, MPageSection form/actions, MForm + MSelect/MDatePicker, message for success if shown, one primary, no landing hero.",
|
|
14
|
-
"files": []
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"id": 3,
|
|
18
|
-
"prompt": "运营后台首页仪表盘:四个 KPI(今日订单、待处理、转化率、退款率)、中间一块图表占位、右侧或下方「最近告警」表格(级别、内容、时间)。Vue3 + morya-ui,可先用静态假数据;告警级别可用 Tag,状态用 MStatus。",
|
|
19
|
-
"expected_output": "Dashboard: MPageStat grid with domain labels, MCard shadow=always + MEmpty chart pending, recent MTable with MStatus, MLayout shell, --m-* only, spacious density.",
|
|
20
|
-
"files": []
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"id": 4,
|
|
24
|
-
"prompt": "给「青禾书房」这个独立书店品牌做登录页:左品牌、右表单(邮箱+密码+登录)。要有一点品牌感(token 氛围即可),但控件必须用 morya-ui;登录失败用表单区常驻错误(字段 errorMessage 或 token role=alert),不要一闪而过的 Toast,也不要把 MMessage 当成内嵌 Alert。输出单个 Vue SFC。",
|
|
25
|
-
"expected_output": "Account+craft: split shell, MForm/MInputPassword/MButton, token role=alert or field error for failure, brand panel with --m-* color-mix, no MMessage severity alert, no second UI kit.",
|
|
26
|
-
"files": []
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"id": 5,
|
|
30
|
-
"prompt": "课程列表在零数据时太空了。请设计一个空状态区块(可嵌在列表页内容区):说明还没有课程、引导「创建第一门课程」;视觉克制,用 morya-ui 默认空态即可,不要自定义 dashed 框或径向光晕。只要空状态相关模板片段或带空状态的列表 SFC 均可。",
|
|
31
|
-
"expected_output": "Flow empty: MPageHeader + MEmpty + next-action MButton, short copy, no custom dashed/radial shell, fits list content slot.",
|
|
32
|
-
"files": []
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"id": 6,
|
|
36
|
-
"prompt": "为「流水线 CI」产品写一个营销落地首页(不是后台):首屏只有品牌名、一句主标题、一句副文、一组 CTA;下面再分「为何选择」「能力」「客户」三节。技术实现用 Vue3 + morya-ui 组件做按钮/标签/折叠 FAQ;颜色走 --m-*,避免紫渐变和奶油衬线陶土那套 AI 默认脸。可有 1–2 个微动效,强度跟 useMotion / data-m-motion。输出单个 Vue SFC。",
|
|
37
|
-
"expected_output": "Express landing: single-job hero, MButton CTAs, sections with one job each, MAccordion FAQ optional, no purple/cream-terracotta defaults, no admin MPageFilters shell, motion gated by useMotion / data-m-motion.",
|
|
38
|
-
"files": []
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"id": 7,
|
|
42
|
-
"prompt": "做一个三步「创建工作空间」向导:1 名称与地区 2 邀请成员(邮箱标签)3 确认。用 morya-ui 的 Stepper + Form;每步一个主任务;最后提交成功进入结果页(查看工作空间 / 返回)。输出一个或两个 SFC。",
|
|
43
|
-
"expected_output": "Flow wizard: wizard-form golden — MStepper :steps, per-step MForm, MInputTags invites, clear next/back/submit, message success, validate_usage clean.",
|
|
44
|
-
"files": []
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"id": 8,
|
|
48
|
-
"prompt": "用户点了删除项目但权限不足:做一张「无权限」系统页(或全页占位),说明原因,并提供返回上一页、联系管理员。用 morya-ui,文案直接别玩梗。",
|
|
49
|
-
"expected_output": "System surface: result-page golden — MResult status=403, #footer escape actions, no jokey 404 essay, on-token, validate_usage clean.",
|
|
50
|
-
"files": []
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"id": 9,
|
|
54
|
-
"prompt": "把上面的课程列表再 polish 一轮:去掉多余实心按钮、保证只有一个主按钮、表格状态改成 MStatus、补上 MEmpty。不要改成营销页。",
|
|
55
|
-
"expected_output": "Ops quieter polish: one primary, MStatus, MEmpty, text row actions, still list golden structure.",
|
|
56
|
-
"files": []
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"id": 10,
|
|
60
|
-
"prompt": "给「用户管理」做资源详情页:面包屑、标题旁启用状态、编辑/返回/删除;摘要标签;基本信息属性网格;下方近期活动表。Vue3 + morya-ui,对齐详情黄金样例,不要做成落地页。",
|
|
61
|
-
"expected_output": "Ops detail: MPageHeader + MStatus, property MCard, related MTable rows, --m-* only, no marketing hero.",
|
|
62
|
-
"files": []
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"id": 11,
|
|
66
|
-
"prompt": "用户列表页上「新建/编辑」不要另开路由:同页 MDialog(约 32rem)里放短表单(姓名、邮箱、角色),页脚取消/保存;保存成功用 message 一句话。输出单个 Vue SFC。",
|
|
67
|
-
"expected_output": "form-in-dialog: list stays, MDialog + MForm + #footer, message.success not toast string, MTable rows.",
|
|
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": []
|
|
87
|
-
}
|
|
88
|
-
]
|
|
89
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "morya-ui-pages",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "我们内部教务系统用 Vue3 + morya-ui。请做一个「课程列表」后台页:按课程名搜索、按开课状态(全部/开课中/已结课)筛选;表格列:名称、状态、学分、更新时间;行内「编辑」进抽屉表单,「删除」要二次确认;右上角「新建课程」。保存/删除成功只要一句话提示。输出单个 Vue SFC,结构对齐列表黄金样例,并做 Ops 精致化(侧栏图标、状态用 MStatus、空态用 MEmpty、行操作不要一排实心按钮)。",
|
|
7
|
+
"expected_output": "Ops list: MLayout/MPageHeader/MPageFilters/MTable rows, optional batch MPageToolbar, MSelect status, MDrawer edit, MConfirmDialog delete, message not toast, MStatus for status, MEmpty in #empty, menu icons, text/small row actions, craft pass applied, no second UI kit.",
|
|
8
|
+
"files": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 2,
|
|
12
|
+
"prompt": "同一个 morya-ui 项目里,生成「新建员工」独立表单页:姓名、工作邮箱、部门(下拉)、入职日期;窄栏;页头有标题和一句说明;底栏保存(primary)/取消(secondary)。不要做成营销落地页,不要用 Toast 提示「已保存」。输出单个 Vue SFC。",
|
|
13
|
+
"expected_output": "Ops form golden: narrow MPageContent, MPageHeader, MPageSection form/actions, MForm + MSelect/MDatePicker, message for success if shown, one primary, no landing hero.",
|
|
14
|
+
"files": []
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": 3,
|
|
18
|
+
"prompt": "运营后台首页仪表盘:四个 KPI(今日订单、待处理、转化率、退款率)、中间一块图表占位、右侧或下方「最近告警」表格(级别、内容、时间)。Vue3 + morya-ui,可先用静态假数据;告警级别可用 Tag,状态用 MStatus。",
|
|
19
|
+
"expected_output": "Dashboard: MPageStat grid with domain labels, MCard shadow=always + MEmpty chart pending, recent MTable with MStatus, MLayout shell, --m-* only, spacious density.",
|
|
20
|
+
"files": []
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": 4,
|
|
24
|
+
"prompt": "给「青禾书房」这个独立书店品牌做登录页:左品牌、右表单(邮箱+密码+登录)。要有一点品牌感(token 氛围即可),但控件必须用 morya-ui;登录失败用表单区常驻错误(字段 errorMessage 或 token role=alert),不要一闪而过的 Toast,也不要把 MMessage 当成内嵌 Alert。输出单个 Vue SFC。",
|
|
25
|
+
"expected_output": "Account+craft: split shell, MForm/MInputPassword/MButton, token role=alert or field error for failure, brand panel with --m-* color-mix, no MMessage severity alert, no second UI kit.",
|
|
26
|
+
"files": []
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": 5,
|
|
30
|
+
"prompt": "课程列表在零数据时太空了。请设计一个空状态区块(可嵌在列表页内容区):说明还没有课程、引导「创建第一门课程」;视觉克制,用 morya-ui 默认空态即可,不要自定义 dashed 框或径向光晕。只要空状态相关模板片段或带空状态的列表 SFC 均可。",
|
|
31
|
+
"expected_output": "Flow empty: MPageHeader + MEmpty + next-action MButton, short copy, no custom dashed/radial shell, fits list content slot.",
|
|
32
|
+
"files": []
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": 6,
|
|
36
|
+
"prompt": "为「流水线 CI」产品写一个营销落地首页(不是后台):首屏只有品牌名、一句主标题、一句副文、一组 CTA;下面再分「为何选择」「能力」「客户」三节。技术实现用 Vue3 + morya-ui 组件做按钮/标签/折叠 FAQ;颜色走 --m-*,避免紫渐变和奶油衬线陶土那套 AI 默认脸。可有 1–2 个微动效,强度跟 useMotion / data-m-motion。输出单个 Vue SFC。",
|
|
37
|
+
"expected_output": "Express landing: single-job hero, MButton CTAs, sections with one job each, MAccordion FAQ optional, no purple/cream-terracotta defaults, no admin MPageFilters shell, motion gated by useMotion / data-m-motion.",
|
|
38
|
+
"files": []
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": 7,
|
|
42
|
+
"prompt": "做一个三步「创建工作空间」向导:1 名称与地区 2 邀请成员(邮箱标签)3 确认。用 morya-ui 的 Stepper + Form;每步一个主任务;最后提交成功进入结果页(查看工作空间 / 返回)。输出一个或两个 SFC。",
|
|
43
|
+
"expected_output": "Flow wizard: wizard-form golden — MStepper :steps, per-step MForm, MInputTags invites, clear next/back/submit, message success, validate_usage clean.",
|
|
44
|
+
"files": []
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": 8,
|
|
48
|
+
"prompt": "用户点了删除项目但权限不足:做一张「无权限」系统页(或全页占位),说明原因,并提供返回上一页、联系管理员。用 morya-ui,文案直接别玩梗。",
|
|
49
|
+
"expected_output": "System surface: result-page golden — MResult status=403, #footer escape actions, no jokey 404 essay, on-token, validate_usage clean.",
|
|
50
|
+
"files": []
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": 9,
|
|
54
|
+
"prompt": "把上面的课程列表再 polish 一轮:去掉多余实心按钮、保证只有一个主按钮、表格状态改成 MStatus、补上 MEmpty。不要改成营销页。",
|
|
55
|
+
"expected_output": "Ops quieter polish: one primary, MStatus, MEmpty, text row actions, still list golden structure.",
|
|
56
|
+
"files": []
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": 10,
|
|
60
|
+
"prompt": "给「用户管理」做资源详情页:面包屑、标题旁启用状态、编辑/返回/删除;摘要标签;基本信息属性网格;下方近期活动表。Vue3 + morya-ui,对齐详情黄金样例,不要做成落地页。",
|
|
61
|
+
"expected_output": "Ops detail: MPageHeader + MStatus, property MCard, related MTable rows, --m-* only, no marketing hero.",
|
|
62
|
+
"files": []
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": 11,
|
|
66
|
+
"prompt": "用户列表页上「新建/编辑」不要另开路由:同页 MDialog(约 32rem)里放短表单(姓名、邮箱、角色),页脚取消/保存;保存成功用 message 一句话。输出单个 Vue SFC。",
|
|
67
|
+
"expected_output": "form-in-dialog: list stays, MDialog + MForm + #footer, message.success not toast string, MTable rows.",
|
|
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": []
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
# Component index (scenario map)
|
|
2
|
-
|
|
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.
|
|
7
|
-
|
|
8
|
-
## Shell
|
|
9
|
-
|
|
10
|
-
| Component | Use |
|
|
11
|
-
| --- | --- |
|
|
12
|
-
| `MConfigProvider` | Root locale / theme / density / defaults |
|
|
13
|
-
| `MLayout` family | Admin chrome (`MLayoutSider` is the layout sider) |
|
|
14
|
-
| `MSidebar` | Standalone nav rail (not a `MDrawer`, not a substitute for `MLayoutSider` inside `MLayout`) |
|
|
15
|
-
| `MBreadcrumb` | Path |
|
|
16
|
-
| `MPageContent` / `MPageFilters` / `MPageToolbar` / `MPageHeader` / `MPageSection` / `MPageStat` / `MPagePlaceholder` | Page composition |
|
|
17
|
-
| `MDock` | App dock / launcher, not page actions |
|
|
18
|
-
|
|
19
|
-
## Actions
|
|
20
|
-
|
|
21
|
-
`MButton` / `MButtonGroup` (primary `severity="primary"`, danger `severity="danger"`), `MSplitButton` (main action + menu), `MSpeedDial` (floating action cluster)
|
|
22
|
-
|
|
23
|
-
## Forms · inputs
|
|
24
|
-
|
|
25
|
-
`MForm`, `MFormItem`, `MInput`, `MInputPassword`, `MInputNumber`, `MTextarea`, `MInputOtp`, `MInputColor`, `MInputGroup`, `MInputTags`, `MSelect`, `MTreeSelect`, `MCascadeSelect`, `MListbox`, `MSelectButton`, `MDatePicker`, `MAutoComplete`, `MCheckbox` / `MCheckboxGroup`, `MRadio` / `MRadioGroup`, `MSwitch`, `MToggleButton`, `MSlider`, `MRating`, `MKnob`, `MFileUpload`, `MFloatLabel`, `MIconField`, `MLabel`
|
|
26
|
-
|
|
27
|
-
## Layout helpers
|
|
28
|
-
|
|
29
|
-
`MGrid` / `MGridItem`, `MFlex`, `MSpace`, `MFluid`, `MDivider`, `MFieldset`, `MSplitter`, `MToolbar`
|
|
30
|
-
|
|
31
|
-
## Data
|
|
32
|
-
|
|
33
|
-
`MTable` (`columns` + **`rows`**, not `data`), `MTreeTable`, `MDataView`, `MTree`, `MPagination`, `MOrderList`, `MPickList`, `MStatus` / `MTag` / `MChip` / `MBadge`, `MAvatar` / `MAvatarGroup`, `MTimeline`, `MMeterGroup`, `MVirtualScroller`
|
|
34
|
-
|
|
35
|
-
## Feedback
|
|
36
|
-
|
|
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` |
|
|
50
|
-
|
|
51
|
-
## Overlays & menus
|
|
52
|
-
|
|
53
|
-
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu`, `MCommandMenu`, `MMenu` / `MMenubar` / `MTieredMenu` / `MMegaMenu`, `MTabs`, `MStepper`
|
|
54
|
-
|
|
55
|
-
## Surfaces / media
|
|
56
|
-
|
|
57
|
-
`MCard`, `MPanel`, `MAccordion`, `MCarousel`, `MGallery`, `MIcon`, `MScrollbar`, `MInplace`, `MScrollTop`, `MTerminal`
|
|
58
|
-
|
|
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**.
|
|
62
|
-
|
|
63
|
-
| Intent | Decision id |
|
|
64
|
-
| --- | --- |
|
|
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`) |
|
|
87
|
-
|
|
88
|
-
## Common mistakes
|
|
89
|
-
|
|
90
|
-
| Wrong | Right |
|
|
91
|
-
| --- | --- |
|
|
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`) |
|
|
95
|
-
| Hand `<table>` | `MTable` |
|
|
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` |
|
|
1
|
+
# Component index (scenario map)
|
|
2
|
+
|
|
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.
|
|
7
|
+
|
|
8
|
+
## Shell
|
|
9
|
+
|
|
10
|
+
| Component | Use |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| `MConfigProvider` | Root locale / theme / density / defaults |
|
|
13
|
+
| `MLayout` family | Admin chrome (`MLayoutSider` is the layout sider) |
|
|
14
|
+
| `MSidebar` | Standalone nav rail (not a `MDrawer`, not a substitute for `MLayoutSider` inside `MLayout`) |
|
|
15
|
+
| `MBreadcrumb` | Path |
|
|
16
|
+
| `MPageContent` / `MPageFilters` / `MPageToolbar` / `MPageHeader` / `MPageSection` / `MPageStat` / `MPagePlaceholder` | Page composition |
|
|
17
|
+
| `MDock` | App dock / launcher, not page actions |
|
|
18
|
+
|
|
19
|
+
## Actions
|
|
20
|
+
|
|
21
|
+
`MButton` / `MButtonGroup` (primary `severity="primary"`, danger `severity="danger"`), `MSplitButton` (main action + menu), `MSpeedDial` (floating action cluster)
|
|
22
|
+
|
|
23
|
+
## Forms · inputs
|
|
24
|
+
|
|
25
|
+
`MForm`, `MFormItem`, `MInput`, `MInputPassword`, `MInputNumber`, `MTextarea`, `MInputOtp`, `MInputColor`, `MInputGroup`, `MInputTags`, `MSelect`, `MTreeSelect`, `MCascadeSelect`, `MListbox`, `MSelectButton`, `MDatePicker`, `MAutoComplete`, `MCheckbox` / `MCheckboxGroup`, `MRadio` / `MRadioGroup`, `MSwitch`, `MToggleButton`, `MSlider`, `MRating`, `MKnob`, `MFileUpload`, `MFloatLabel`, `MIconField`, `MLabel`
|
|
26
|
+
|
|
27
|
+
## Layout helpers
|
|
28
|
+
|
|
29
|
+
`MGrid` / `MGridItem`, `MFlex`, `MSpace`, `MFluid`, `MDivider`, `MFieldset`, `MSplitter`, `MToolbar`
|
|
30
|
+
|
|
31
|
+
## Data
|
|
32
|
+
|
|
33
|
+
`MTable` (`columns` + **`rows`**, not `data`), `MTreeTable`, `MDataView`, `MTree`, `MPagination`, `MOrderList`, `MPickList`, `MStatus` / `MTag` / `MChip` / `MBadge`, `MAvatar` / `MAvatarGroup`, `MTimeline`, `MMeterGroup`, `MVirtualScroller`
|
|
34
|
+
|
|
35
|
+
## Feedback
|
|
36
|
+
|
|
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` |
|
|
50
|
+
|
|
51
|
+
## Overlays & menus
|
|
52
|
+
|
|
53
|
+
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu`, `MCommandMenu`, `MMenu` / `MMenubar` / `MTieredMenu` / `MMegaMenu`, `MTabs`, `MStepper`
|
|
54
|
+
|
|
55
|
+
## Surfaces / media
|
|
56
|
+
|
|
57
|
+
`MCard`, `MPanel`, `MAccordion`, `MCarousel`, `MGallery`, `MIcon`, `MScrollbar`, `MInplace`, `MScrollTop`, `MTerminal`
|
|
58
|
+
|
|
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**.
|
|
62
|
+
|
|
63
|
+
| Intent | Decision id |
|
|
64
|
+
| --- | --- |
|
|
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`) |
|
|
87
|
+
|
|
88
|
+
## Common mistakes
|
|
89
|
+
|
|
90
|
+
| Wrong | Right |
|
|
91
|
+
| --- | --- |
|
|
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`) |
|
|
95
|
+
| Hand `<table>` | `MTable` |
|
|
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` |
|
|
@@ -262,6 +262,7 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
262
262
|
|
|
263
263
|
- columns + rows(没有 data prop)
|
|
264
264
|
- row-key 默认 id;不稳定时显式指定
|
|
265
|
+
- 全视口主列表可 MPageContent fill + MTable fill;嵌入/短页跳过
|
|
265
266
|
- 分页:paginator + rows-per-page 或 v-model:page
|
|
266
267
|
- 行选择:selectionMode + v-model:selection
|
|
267
268
|
|
|
@@ -274,6 +275,7 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
274
275
|
|
|
275
276
|
- :data → :rows
|
|
276
277
|
- 手写 <table> → MTable
|
|
278
|
+
- 嵌入表硬套 fill → 去掉 fill
|
|
277
279
|
|
|
278
280
|
|
|
279
281
|
### DataView
|
|
@@ -882,6 +884,7 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
882
884
|
|
|
883
885
|
- MLayout fill-viewport(或 :fill-viewport="true")
|
|
884
886
|
- 内容放 MLayoutContent
|
|
887
|
+
- 是否再 fill 表格:见下方「MPageContent fill + MTable fill」判断
|
|
885
888
|
- 侧栏用 MLayoutSider + MMenu,不是随便一个 Drawer
|
|
886
889
|
|
|
887
890
|
**Anti-patterns**
|
|
@@ -889,6 +892,33 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
889
892
|
- 在 Layout 外再包一层 100vh 滚动 → 去掉
|
|
890
893
|
|
|
891
894
|
|
|
895
|
+
### MPageContent fill + MTable fill
|
|
896
|
+
|
|
897
|
+
**When**
|
|
898
|
+
|
|
899
|
+
- 全视口后台列表,页面主任务就是浏览一张表
|
|
900
|
+
- 内容高度表格会留下大块空白、分页悬在中间不好看
|
|
901
|
+
- 希望只有表体滚动、分页贴在页面最下方
|
|
902
|
+
|
|
903
|
+
**Avoid when**
|
|
904
|
+
|
|
905
|
+
- 仪表盘/详情里的嵌入小表
|
|
906
|
+
- 内容本身很短、内容高度即可
|
|
907
|
+
- 整页应作为文档滚动(长筛选+说明+表格)
|
|
908
|
+
- Dialog / Drawer 内表格
|
|
909
|
+
|
|
910
|
+
**Recipe · props**
|
|
911
|
+
|
|
912
|
+
- 先判断是否适合 fill,再写 MPageContent fill + MTable fill
|
|
913
|
+
- paginator 或同级 MPagination
|
|
914
|
+
- 适合时不要手写 min-height / calc
|
|
915
|
+
|
|
916
|
+
**Anti-patterns**
|
|
917
|
+
|
|
918
|
+
- 嵌入/短页硬套 fill → 去掉
|
|
919
|
+
- 适合 fill 却手写 calc → 改用 fill
|
|
920
|
+
|
|
921
|
+
|
|
892
922
|
### MScrollbar
|
|
893
923
|
|
|
894
924
|
**When**
|
|
@@ -957,11 +987,13 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
957
987
|
|
|
958
988
|
- MPageContent > MPageFilters + MTable
|
|
959
989
|
- 表格直接放 PageContent,不套 Card
|
|
990
|
+
- 高度:全视口主列表再考虑 fill;嵌入/短页跳过
|
|
960
991
|
- 空态用 Table #empty + MEmpty
|
|
961
992
|
|
|
962
993
|
**Anti-patterns**
|
|
963
994
|
|
|
964
995
|
- Table 外包 MCard → 去掉 Card
|
|
996
|
+
- 嵌入表硬套 fill → 去掉 fill
|
|
965
997
|
|
|
966
998
|
|
|
967
999
|
### MCard
|