@morya-ui/setup 0.2.9 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morya-ui/setup",
3
3
  "type": "module",
4
- "version": "0.2.9",
4
+ "version": "0.3.0",
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",
@@ -63,14 +63,14 @@ For Express / branded Account moments, also draft a tiny **design plan** (see [v
63
63
 
64
64
  | Need | Prefer (MCP) | Else read |
65
65
  | --- | --- | --- |
66
- | Ops pattern | `recommend_page` → `get_golden_page` | [page-layouts.md](references/page-layouts.md) |
67
- | Account / Express / empty | `recommend_page` → `get_golden_page` (`login-page` / `landing-page` / `empty-state`) | [surfaces.md](references/surfaces.md) |
66
+ | Ops pattern | `recommend_page` → **`get_golden_page`** (mirror; do not invent a parallel scaffold aesthetic) | [page-layouts.md](references/page-layouts.md) |
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 | `search` / `get_component` / `recommend_component` | [component-index.md](references/component-index.md) |
69
+ | Components / **API truth** | `search` / **`get_component`** / `get_example` / `recommend_component` | [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) |
73
- | Soft check | `validate_page` | [review-checklist.md](references/review-checklist.md) |
73
+ | **Required checks** | **`validate_usage`** (every `M*` you used) + `validate_page` | [review-checklist.md](references/review-checklist.md) |
74
74
 
75
75
  ### 3. Compose
76
76
 
@@ -90,6 +90,9 @@ For Express / branded Account moments, also draft a tiny **design plan** (see [v
90
90
  - Enums → `MSelect` / `MTreeSelect`; action menus → `MDropdown`.
91
91
  - Destructive → `MConfirmDialog` / `MConfirmPopup`.
92
92
  - Feedback → default **`message`**; `toast` only for summary+detail / async. See [feedback.md](references/feedback.md).
93
+ - 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
+ - **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
+ - `recommend_page(includeScaffold: true)` returns the **golden page source** when one exists — remap copy/data only; never treat generated fallback as the visual target.
93
96
 
94
97
  ### 5. Craft pass (always — lane-aware)
95
98
 
@@ -97,14 +100,21 @@ Run **before** delivery. Do not stop at a structurally correct shell.
97
100
 
98
101
  - **Ops:** apply [visual-craft.md](references/visual-craft.md) § Ops polish (one primary, menu icons, `MStatus` in tables, designed empty, no decorative cards).
99
102
  - **Account / Flow:** one calm brand or empty-state cue from § Atmosphere recipes; form errors via `errorMessage` / token `role="alert"`.
100
- - **Express:** short design plan + one signature; avoid AI-default looks; optional 1–2 token-only motions with `prefers-reduced-motion`.
103
+ - **Express:** short design plan + one signature; avoid AI-default looks; optional 1–2 token-only motions; honor `useMotion` / `prefers-reduced-motion` (or `respectReducedMotion`).
101
104
  - **All lanes:** responsive, focus visible, domain-real copy (active voice).
102
105
 
103
106
  Named polish modes (`quieter` | `bolder` | `clarify` | `audit` | …): use as an **extra** pass when the user asks to improve an existing screen. See [visual-craft.md](references/visual-craft.md) § Polish modes.
104
107
 
105
108
  ### 6. Review
106
109
 
107
- Use [review-checklist.md](references/review-checklist.md) (contract + craft sections). Run MCP `validate_page` when available (advisory).
110
+ Use [review-checklist.md](references/review-checklist.md) (contract + craft sections).
111
+
112
+ **Required when MCP is available:**
113
+
114
+ 1. `validate_usage` on the page (or per component) — API accuracy gate
115
+ 2. `validate_page` — layout / token / contract advisories
116
+
117
+ Do not deliver with unresolved `unknown-prop` / `unknown-event`.
108
118
 
109
119
  ## Hard boundaries
110
120
 
@@ -112,6 +122,7 @@ Use [review-checklist.md](references/review-checklist.md) (contract + craft sect
112
122
  - No hand-rolled table/modal when `MTable` / `MDialog` / `MDrawer` fit.
113
123
  - No invented props / events / slots.
114
124
  - No defaulting every success to `toast`.
125
+ - No substituting a generated scaffold for `get_golden_page` when a golden sample exists.
115
126
  - Ops surfaces follow golden layouts first — do not replace them with marketing heroes.
116
127
  - Express surfaces still use `M*` for controls and `--m-*` for color/space; do not introduce shadcn/Element/etc. stacks suggested by generic design skills.
117
128
  - Soft-load companions only; never require Impeccable / UI-UX-Pro-Max / Frontend Design to be installed.
@@ -40,13 +40,13 @@
40
40
  {
41
41
  "id": 7,
42
42
  "prompt": "做一个三步「创建工作空间」向导:1 名称与地区 2 邀请成员(邮箱标签)3 确认。用 morya-ui 的 Stepper + Form;每步一个主任务;最后提交成功进入结果页(查看工作空间 / 返回)。输出一个或两个 SFC。",
43
- "expected_output": "Flow wizard: MStepper, per-step MForm, MInputTags or similar for invites, clear next/back/submit, success with next actions, message/toast per feedback rules.",
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
44
  "files": []
45
45
  },
46
46
  {
47
47
  "id": 8,
48
48
  "prompt": "用户点了删除项目但权限不足:做一张「无权限」系统页(或全页占位),说明原因,并提供返回上一页、联系管理员。用 morya-ui,文案直接别玩梗。",
49
- "expected_output": "System surface: MResult 403 or equivalent, plain explanation, escape actions with MButton, no jokey 404 essay, on-token.",
49
+ "expected_output": "System surface: result-page golden — MResult status=403, #footer escape actions, no jokey 404 essay, on-token, validate_usage clean.",
50
50
  "files": []
51
51
  },
52
52
  {
@@ -54,6 +54,18 @@
54
54
  "prompt": "把上面的课程列表再 polish 一轮:去掉多余实心按钮、保证只有一个主按钮、表格状态改成 MStatus、补上 MEmpty。不要改成营销页。",
55
55
  "expected_output": "Ops quieter polish: one primary, MStatus, MEmpty, text row actions, still list golden structure.",
56
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": []
57
69
  }
58
70
  ]
59
71
  }
@@ -58,8 +58,9 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
58
58
  | Intent | Prefer |
59
59
  | --- | --- |
60
60
  | Searchable list + paging | `MPageFilters` + `MTable` (+ paginator) |
61
- | Create / edit from a list (few–medium fields) | **`MDialog` + `MForm`** (stay on the list) |
61
+ | Create / edit from a list (few–medium fields) | **`form-in-dialog`** golden (`MDialog` + `MForm`) |
62
62
  | Create / edit long / multi-section entity | Form golden page **or** `MDrawer` |
63
+ | Resource detail / profile | `detail-page` golden |
63
64
  | Delete | `MConfirmDialog` |
64
65
  | Lightweight inline status | `MStatus` (dot + label) |
65
66
  | Status chip / closable label | `MTag` severities |
@@ -69,9 +70,11 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
69
70
  | Login / auth | `login-page` golden + `MInputPassword` |
70
71
  | Marketing landing | `landing-page` golden + `MButton` / `MTag` / `MAccordion` |
71
72
  | Empty list / zero state | `MEmpty` (+ `empty-state` golden or `MTable` `#empty`) |
72
- | Submit success / HTTP error page | `MResult` |
73
+ | Preferences / settings | `settings-page` golden (`MTabs` + `tabs`) |
74
+ | Multi-step create | `wizard-form` golden (`MStepper` + `steps`) |
73
75
  | Region or page is waiting | `MLoading`, `v-loading`, or `loading.service`; known layout → `MSkeleton` |
74
76
  | Local capped scroll | Explicit `MScrollbar` |
77
+ | Resizable two-pane (editor / preview, master-detail) | `MSplitter` |
75
78
  | Admin sider nav | `MMenu` inside `MLayoutSider` (or `MSidebar` when the shell is not `MLayout`) |
76
79
  | Few options, all visible | `MRadio` or `MSelectButton` |
77
80
  | Always-visible option list | `MListbox` |
@@ -5,11 +5,16 @@ When generating a full page, pick a type and **mirror the golden-page block orde
5
5
  | Type | `get_golden_page` id |
6
6
  | --- | --- |
7
7
  | List | `list-page` |
8
- | Form | `form-page` |
8
+ | Form (long / dedicated) | `form-page` |
9
+ | List create/edit dialog | `form-in-dialog` |
10
+ | Detail | `detail-page` |
9
11
  | Dashboard | `dashboard-page` |
10
12
  | Login | `login-page` |
11
13
  | Landing | `landing-page` |
12
14
  | Empty | `empty-state` |
15
+ | Result / 403 / terminal | `result-page` |
16
+ | Settings | `settings-page` |
17
+ | Wizard | `wizard-form` |
13
18
 
14
19
  Via MCP: `recommend_page` → `get_golden_page`; local edits: `get_page_snippet` (`filters`, `toolbar`, `form-actions`, `scrollable-panel`, …).
15
20
 
@@ -65,24 +70,48 @@ Craft: spacious density + Ops polish; do not turn the first viewport into a mark
65
70
 
66
71
  Inline style is acceptable for control widths (e.g. filter `width: 14rem`).
67
72
 
68
- ## Detail page — suggested order
73
+ ## Detail page — block order
69
74
 
70
75
  1. Same admin chrome as list (breadcrumb → `MPageContent`)
71
- 2. `MPageHeader` — title, status via `MStatus` (light) or `MTag` (chip), primary/secondary actions
72
- 3. Summary `MCard` or definition sections via `MPageSection`
73
- 4. Related data: nested `MTabs` + `MTable` / timeline
74
- 5. Edit via route, or `MDrawer` / `MDialog` — do not turn detail into a marketing page
76
+ 2. `MPageHeader` — title, `MStatus` in `#actions` (or chip `MTag` for categories), primary/secondary/danger actions
77
+ 3. Summary `MPageSection` + property `MCard` (definition grid with `--m-*` only)
78
+ 4. Related data: `MCard` + `MTable` / tabs / timeline
79
+ 5. Short edit → same-page `MDialog` (`form-in-dialog`); long edit → `form-page` / `MDrawer`
75
80
 
76
- ## Settings page — suggested order
81
+ Mirror MCP `get_golden_page` `detail-page`.
77
82
 
78
- 1. Admin chrome + `MPageContent width="narrow"` (or split: side `MMenu`/`MTabs` + content)
79
- 2. Grouped `MPageSection` or `MTabs` by concern (资料 / 通知 / 安全)
80
- 3. Each group: `MForm` + save actions (section-level or page-level — be consistent)
81
- 4. Dangerous zone last: `severity="danger"` + confirm
83
+ ## List create/edit dialog — block order
84
+
85
+ 1. Stay on the list page (`MPageToolbar` + `MTable`)
86
+ 2. `MDialog` ~`28–36rem` + `MForm` fields
87
+ 3. Actions in Dialog `#footer` (cancel secondary/text + save primary)
88
+ 4. Success → `message.success` one-liner, then close
89
+
90
+ Mirror MCP `get_golden_page` `form-in-dialog`.
91
+
92
+ ## Settings page — block order
93
+
94
+ 1. Admin chrome + `MPageContent width="narrow"`
95
+ 2. `MPageHeader` (title + short description)
96
+ 3. `MTabs` with **`v-model` + `:tabs`** (not `:items` / `:value`)
97
+ 4. Per tab: `MPageSection variant="form"` + `MForm` + save in `variant="actions"`
98
+ 5. Dangerous zone last: `severity="danger"` + confirm
99
+
100
+ Mirror MCP `get_golden_page` `settings-page`.
101
+
102
+ ## Wizard — block order
103
+
104
+ 1. Narrow `MPageContent` + `MPageHeader`
105
+ 2. `MStepper v-model` + **`:steps`** (not `:items`)
106
+ 3. One form/job per step; sticky `上一步` / `下一步` / `创建`
107
+ 4. Success → `result-page` / `MResult`
108
+
109
+ Mirror MCP `get_golden_page` `wizard-form`.
82
110
 
83
111
  ## Hybrids
84
112
 
85
- - List + row edit dialog → list golden page + `MDialog` form body.
113
+ - List + row edit dialog → `form-in-dialog` golden (or list golden + dialog body).
86
114
  - List + side detail → list + `MDrawer`.
115
+ - Resource detail → `detail-page` golden.
87
116
  - Settings without admin chrome → still use `MPageContent` + `MPageSection`; omit sider only if the host app already provides chrome.
88
117
  - Non-Ops surfaces (auth, landing, empty, wizard) → [surfaces.md](surfaces.md), not these golden orders.
@@ -5,11 +5,13 @@
5
5
  - [ ] Only `morya-ui` UI primitives (no second kit)
6
6
  - [ ] `morya-ui/styles.css` imported at app/demo entry
7
7
  - [ ] `MConfigProvider` at a sensible root when building a full screen
8
- - [ ] No invented props / events / slots (MCP or docs checked)
8
+ - [ ] No invented props / events / slots (MCP `get_component` / docs checked)
9
+ - [ ] MCP **`validate_usage`** run; no unresolved `unknown-prop` / `unknown-event`
9
10
  - [ ] Select vs Dropdown roles correct
10
11
  - [ ] `MTable` uses `rows` (not `data`)
11
12
  - [ ] One-line results use `message`; summary+detail / async use `toast`
12
13
  - [ ] Destructive flows use confirm dialogs
14
+ - [ ] MCP **`validate_page`** run when generating a full page (advisory suggestions addressed or consciously waived)
13
15
 
14
16
  ## Craft (all lanes — default pass)
15
17
 
@@ -54,8 +56,6 @@
54
56
  - [ ] Usable on a narrow viewport
55
57
  - [ ] Focus visible on interactive elements
56
58
 
57
- ## Optional MCP
58
-
59
- - [ ] `validate_page` / `validate_usage` reviewed when available
59
+ When MCP is available, contract checks above (**`validate_usage`** / **`validate_page`**) are required — not optional.
60
60
 
61
61
  If the project has `pnpm check:colors`, suggest running it after edits.
@@ -31,7 +31,7 @@ Keep credential forms quiet: one primary CTA, clear labels, no decorative noise
31
31
  | Empty state | Invite first action | Golden: MCP `get_golden_page` `empty-state` — `MEmpty` + primary/secondary `MButton` in `#extra`; dashed shell + radial wash from visual-craft |
32
32
  | Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
33
33
  | Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
34
- | Success / result | Confirm completion | `MResult` (`status="success"` / `error` …) + next actions (`查看详情` / `返回列表`) |
34
+ | Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
35
35
 
36
36
  Copy must tell the user **what to do next**, not celebrate the system.
37
37
 
@@ -39,8 +39,8 @@ Copy must tell the user **what to do next**, not celebrate the system.
39
39
 
40
40
  | Surface | Job | Recipe |
41
41
  | --- | --- | --- |
42
- | 404 / not found | Reorient | `MResult status="404"` + `返回首页` / `返回上一页` |
43
- | Permission denied | Explain + escape | `MResult status="403"` + request access / switch account / go home |
42
+ | Permission denied | Explain + escape | Golden: MCP `get_golden_page` `result-page` — `MResult status="403"` + `#footer` (not `#extra`) |
43
+ | 404 / not found | Reorient | `MResult status="404"` + `返回首页` / `返回上一页` (mirror `result-page` shell) |
44
44
  | Maintenance / error | Honest status | `MResult status="500"`; what happened + retry + support. Persistent form errors: field `errorMessage` or a token `role="alert"`, not `<MMessage>` as an alert |
45
45
 
46
46
  Avoid witty 404 essays that hide the exit paths.
@@ -8,9 +8,9 @@ alwaysApply: true
8
8
  1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP,或 skill `references/component-index.md`。
9
9
  2. **只用** `morya-ui` 的 `M*` 组件;全局样式 `morya-ui/styles.css`。
10
10
  3. **颜色/间距/圆角** 使用 `--m-*` CSS 变量,禁止裸 hex/rgb(见 `scripts/check-raw-colors.mjs`)。
11
- 4. **页面结构** 用 MCP `get_golden_page`(`list-page` / `form-page` / `dashboard-page` / `login-page` / `landing-page` / `empty-state`),不要发明新布局范式。
11
+ 4. **页面结构** 用 MCP `get_golden_page`(`list-page` / `form-page` / `form-in-dialog` / `detail-page` / `dashboard-page` / `login-page` / `landing-page` / `empty-state` / `result-page` / `settings-page` / `wizard-form`),不要发明新布局范式。
12
12
  5. **表单选项** 用 `MSelect` / `MTreeSelect`;**动作菜单** 用 `MDropdown`。
13
- 6. 不确定 API 时查文档站或 MCP,**禁止臆造 prop**。
13
+ 6. 不确定 API 时查文档站或 MCP `get_component`,**禁止臆造 prop**;写完后必须 `validate_usage`。
14
14
  7. 根节点用 `MConfigProvider`;后台布局用 `MLayout` 系列。
15
15
  8. **操作反馈默认 `message` API**;仅 `summary + detail` 或异步通知用 `toast`;表单常驻错误用字段 `errorMessage` 或 token 样式的 `role="alert"`(`<MMessage>` 只是 message 宿主)。见 skill `references/feedback.md`。
16
16
 
@@ -11,6 +11,11 @@ alwaysApply: false
11
11
  | --- | --- |
12
12
  | 列表页 | `list-page` |
13
13
  | 表单页 | `form-page`(仅长表单 / 独立配置页) |
14
+ | 列表内弹窗表单 | `form-in-dialog` |
15
+ | 详情页 | `detail-page` |
16
+ | 结果 / 阻断页 | `result-page` |
17
+ | 设置页 | `settings-page` |
18
+ | 分步向导 | `wizard-form` |
14
19
  | 仪表盘 | `dashboard-page` |
15
20
  | 登录页 | `login-page` |
16
21
  | 营销落地 | `landing-page` |
@@ -31,6 +31,10 @@
31
31
  | 错误 | `--m-color-danger` |
32
32
  | 区块间距 | `--m-space-4` / `--m-space-6` |
33
33
  | 圆角 / 阴影 | `--m-radius-md` / `--m-shadow-md` |
34
+ | 动效时长 | `--m-motion-fast/normal/enter/exit` |
35
+ | 进出场位移 / 缓动 | `--m-motion-distance` / `--m-motion-ease` |
36
+
37
+ 动效强度用 `useMotion`(`data-m-motion`);进出场预设用 `motion.transitions` / 组件 `transition`(见文档站「动效」)。
34
38
 
35
39
  ## 4. 禁止项
36
40
 
@@ -52,3 +56,4 @@
52
56
  - 包:`morya-ui` · 样式:`morya-ui/styles.css`
53
57
  - 页面配方:`.agents/skills/morya-ui-pages/`(及 setup 时勾选的 companion)
54
58
  - 主题 API:`useTheme` / `useDensity` / `useMotion`
59
+ - 动效预设:`createMoryaUI({ motion })`、`componentDefaults.*.transition`、浮层 `transition` prop;详情见文档 `/docs/motion`