@morya-ui/setup 0.3.5 → 0.3.6
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/LICENSE +21 -21
- package/README.md +119 -107
- package/bin/morya-ui-setup.js +14 -14
- package/catalog/skills.json +46 -46
- package/package.json +4 -3
- package/src/__tests__/mcp.test.mjs +141 -0
- package/src/cli.mjs +330 -312
- package/src/copy-template.mjs +78 -78
- package/src/fs-utils.mjs +24 -24
- package/src/install.mjs +134 -134
- package/src/mcp.mjs +220 -50
- package/src/package-json.mjs +30 -30
- package/src/skills.mjs +224 -223
- package/src/styles.mjs +119 -119
- package/template/.agents/skills/morya-ui-pages/SKILL.md +191 -188
- 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/design-system.md +101 -101
- package/template/.agents/skills/morya-ui-pages/references/feedback.md +68 -68
- package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +62 -62
- package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +133 -133
- package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +76 -63
- package/template/.agents/skills/morya-ui-pages/references/style-presets.md +68 -45
- package/template/.agents/skills/morya-ui-pages/references/surfaces.md +91 -91
- package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +131 -129
- 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 +18 -17
- package/template/.cursor/rules/page-layout.mdc +97 -97
- package/template/AGENTS.md +33 -0
- package/template/DESIGN.md +81 -59
- package/template/scripts/check-raw-colors.mjs +74 -74
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
# Visual craft (distilled)
|
|
2
|
-
|
|
3
|
-
Portable craft for morya-ui consumers. Inspired by **Frontend Design**, **Impeccable**, and **UI-UX-Pro-Max** — without requiring those skills. Still honor the morya-ui contract. **No named style-preset catalog.**
|
|
4
|
-
|
|
5
|
-
## When to lean on craft
|
|
6
|
-
|
|
7
|
-
| Lane | Craft intensity | Default pass |
|
|
8
|
-
| --- | --- | --- |
|
|
9
|
-
| Ops CRUD | Low — clarity, density, golden structure | **Always** run § Ops polish |
|
|
10
|
-
| Account / Flow / System | Medium — trust, hierarchy, one calm brand cue | **Always** run § Shell recipes when relevant |
|
|
11
|
-
| Express | High — design plan + one signature risk | **Always** run design plan + anti-defaults |
|
|
12
|
-
|
|
13
|
-
**Style is not fixed to the golden look.** Resolve direction first ([style-presets.md](style-presets.md)): **user reference / description → prompt cues → ask when uncertain**.
|
|
14
|
-
|
|
15
|
-
## Companion bridge (distilled)
|
|
16
|
-
|
|
17
|
-
Run companions **after** structure + contract + **resolved style direction**, then remediate with `M*` + `--m-*`.
|
|
18
|
-
|
|
19
|
-
### Subject first (Frontend Design)
|
|
20
|
-
|
|
21
|
-
- Name **subject**, **audience**, **single job** before visual choices.
|
|
22
|
-
- Personality from the subject’s world — not a generic “SaaS aurora” board.
|
|
23
|
-
- **One signature** per surface; everything else quieter.
|
|
24
|
-
- Signature = type / layout / product artifact / motion — **not** a default gradient wash.
|
|
25
|
-
|
|
26
|
-
### Mode (Impeccable)
|
|
27
|
-
|
|
28
|
-
| Mode | Use when | Craft budget |
|
|
29
|
-
| --- | --- | --- |
|
|
30
|
-
| **Operate** | Ops lists, forms, settings | Clarity, density, resolved direction; no marketing hero |
|
|
31
|
-
| **Persuade** | Landing, pricing | Design plan + signature; controls still `M*` |
|
|
32
|
-
| **Read** | Docs / long detail | Typeset + measure |
|
|
33
|
-
| **Experience** | Gallery / showcase | Artifact leads |
|
|
34
|
-
|
|
35
|
-
### Design plan (Express & branded Account)
|
|
36
|
-
|
|
37
|
-
1. **Color** — roles mapped to `--m-*`. Companions may suggest hex — **map** to tokens.
|
|
38
|
-
2. **Type** — Ops stick to theme fonts.
|
|
39
|
-
3. **Layout** — one sentence + hierarchy.
|
|
40
|
-
4. **Signature** — one memorable element that fits the **user’s** direction.
|
|
41
|
-
|
|
42
|
-
If the plan looks like any-SaaS (purple wash, cream serif, neon glow) and the user did not ask for that, revise. **User reference / words win.**
|
|
43
|
-
|
|
44
|
-
## Ops polish (baseline)
|
|
45
|
-
|
|
46
|
-
1. **One primary** filled button in the main viewport.
|
|
47
|
-
2. **Sider icons** on every top-level `MMenu` item.
|
|
48
|
-
3. **Status** → `MStatus`; `MTag` for categories/filters only.
|
|
49
|
-
4. **Row actions** — text / outlined / small.
|
|
50
|
-
5. **Filter rhythm** — search ~`14rem`, selects ~`10–12rem`.
|
|
51
|
-
6. **Empty** — `MEmpty` with next action.
|
|
52
|
-
7. **No extra cards** around filters/table “for polish”.
|
|
53
|
-
8. **Domain copy**.
|
|
54
|
-
9. **Density** — follow user cues (`compact` / spacious); don’t invent a second scale.
|
|
55
|
-
10. **Quiet chrome** — no marketing heroes / glow unless the user asked.
|
|
56
|
-
|
|
57
|
-
Ops beauty = alignment + semantics + restraint, **not** gradients.
|
|
58
|
-
|
|
59
|
-
## Anti-default looks
|
|
60
|
-
|
|
61
|
-
Unless the user **asks** or a reference **shows** them, do not use:
|
|
62
|
-
|
|
63
|
-
1. Cream + serif + terracotta
|
|
64
|
-
2. Acid-green / dual neon on black
|
|
65
|
-
3. Broadsheet newspaper columns
|
|
66
|
-
4. Purple aurora / mesh washes (even via `color-mix`)
|
|
67
|
-
5. Glow stacks, pill clouds, emoji decoration
|
|
68
|
-
6. Unsolicited glass, neumorph on dense tables, full-page gradients
|
|
69
|
-
7. Stacked radial + linear “atmosphere” brand panels
|
|
70
|
-
|
|
71
|
-
**Token gradients are not a free pass** — only when the user/reference asks.
|
|
72
|
-
|
|
73
|
-
## Shell recipes (token-only — defaults are flat)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
| `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
- No
|
|
1
|
+
# Visual craft (distilled)
|
|
2
|
+
|
|
3
|
+
Portable craft for morya-ui consumers. Inspired by **Frontend Design**, **Impeccable**, and **UI-UX-Pro-Max** — without requiring those skills. Still honor the morya-ui contract. **No named style-preset catalog.**
|
|
4
|
+
|
|
5
|
+
## When to lean on craft
|
|
6
|
+
|
|
7
|
+
| Lane | Craft intensity | Default pass |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Ops CRUD | Low — clarity, density, golden structure | **Always** run § Ops polish |
|
|
10
|
+
| Account / Flow / System | Medium — trust, hierarchy, one calm brand cue | **Always** run § Shell recipes when relevant |
|
|
11
|
+
| Express | High — design plan + one signature risk | **Always** run design plan + anti-defaults |
|
|
12
|
+
|
|
13
|
+
**Style is not fixed to the golden look.** Resolve direction first ([style-presets.md](style-presets.md)): **user reference / description → prompt cues → ask when uncertain**.
|
|
14
|
+
|
|
15
|
+
## Companion bridge (distilled)
|
|
16
|
+
|
|
17
|
+
Run companions **after** structure + contract + **resolved style direction**, then remediate with `M*` + `--m-*`.
|
|
18
|
+
|
|
19
|
+
### Subject first (Frontend Design)
|
|
20
|
+
|
|
21
|
+
- Name **subject**, **audience**, **single job** before visual choices.
|
|
22
|
+
- Personality from the subject’s world — not a generic “SaaS aurora” board.
|
|
23
|
+
- **One signature** per surface; everything else quieter.
|
|
24
|
+
- Signature = type / layout / product artifact / motion — **not** a default gradient wash.
|
|
25
|
+
|
|
26
|
+
### Mode (Impeccable)
|
|
27
|
+
|
|
28
|
+
| Mode | Use when | Craft budget |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| **Operate** | Ops lists, forms, settings | Clarity, density, resolved direction; no marketing hero |
|
|
31
|
+
| **Persuade** | Landing, pricing | Design plan + signature; controls still `M*` |
|
|
32
|
+
| **Read** | Docs / long detail | Typeset + measure |
|
|
33
|
+
| **Experience** | Gallery / showcase | Artifact leads |
|
|
34
|
+
|
|
35
|
+
### Design plan (Express & branded Account)
|
|
36
|
+
|
|
37
|
+
1. **Color** — roles mapped to `--m-*`. Companions may suggest hex — **map** to tokens.
|
|
38
|
+
2. **Type** — Ops stick to theme fonts.
|
|
39
|
+
3. **Layout** — one sentence + hierarchy.
|
|
40
|
+
4. **Signature** — one memorable element that fits the **user’s** direction.
|
|
41
|
+
|
|
42
|
+
If the plan looks like any-SaaS (purple wash, cream serif, neon glow) and the user did not ask for that, revise. **User reference / words win.**
|
|
43
|
+
|
|
44
|
+
## Ops polish (baseline)
|
|
45
|
+
|
|
46
|
+
1. **One primary** filled button in the main viewport.
|
|
47
|
+
2. **Sider icons** on every top-level `MMenu` item.
|
|
48
|
+
3. **Status** → `MStatus`; `MTag` for categories/filters only.
|
|
49
|
+
4. **Row actions** — text / outlined / small.
|
|
50
|
+
5. **Filter rhythm** — search ~`14rem`, selects ~`10–12rem`.
|
|
51
|
+
6. **Empty** — `MEmpty` with next action.
|
|
52
|
+
7. **No extra cards** around filters/table “for polish”.
|
|
53
|
+
8. **Domain copy**.
|
|
54
|
+
9. **Density** — follow user cues (`compact` / spacious); don’t invent a second scale.
|
|
55
|
+
10. **Quiet chrome** — no marketing heroes / glow unless the user asked.
|
|
56
|
+
|
|
57
|
+
Ops beauty = alignment + semantics + restraint, **not** gradients.
|
|
58
|
+
|
|
59
|
+
## Anti-default looks
|
|
60
|
+
|
|
61
|
+
Unless the user **asks** or a reference **shows** them, do not use:
|
|
62
|
+
|
|
63
|
+
1. Cream + serif + terracotta
|
|
64
|
+
2. Acid-green / dual neon on black
|
|
65
|
+
3. Broadsheet newspaper columns
|
|
66
|
+
4. Purple aurora / mesh washes (even via `color-mix`)
|
|
67
|
+
5. Glow stacks, pill clouds, emoji decoration
|
|
68
|
+
6. Unsolicited glass, neumorph on dense tables, full-page gradients
|
|
69
|
+
7. Stacked radial + linear “atmosphere” brand panels
|
|
70
|
+
|
|
71
|
+
**Token gradients are not a free pass** — only when the user/reference asks.
|
|
72
|
+
|
|
73
|
+
## Shell recipes (token-only — defaults are flat)
|
|
74
|
+
|
|
75
|
+
Prefer MCP **`get_style_shells`** for pasteable CSS (`account-split`, `account-centered`, `express-hero`, `flow-empty-frame`, `flow-result-hero`, `ops-quiet`). Below are the same defaults for offline use.
|
|
76
|
+
|
|
77
|
+
### Account — split brand panel (`account-split`)
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
.login-brand {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
justify-content: flex-end;
|
|
84
|
+
gap: var(--m-space-4);
|
|
85
|
+
padding: clamp(2rem, 6vw, 4.5rem);
|
|
86
|
+
background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface));
|
|
87
|
+
border-right: 1px solid var(--m-color-border);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Express — hero plane (`express-hero`)
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
.landing-hero__visual {
|
|
95
|
+
margin-top: var(--m-space-5);
|
|
96
|
+
padding: var(--m-space-5);
|
|
97
|
+
border: 1px solid var(--m-color-border);
|
|
98
|
+
border-radius: var(--m-radius-md);
|
|
99
|
+
background: color-mix(in srgb, var(--m-color-primary) 8%, var(--m-color-surface));
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Flow — empty shell (`flow-empty-frame`)
|
|
104
|
+
|
|
105
|
+
Prefer stock `MEmpty`. Optional light frame:
|
|
106
|
+
|
|
107
|
+
```css
|
|
108
|
+
.empty-state-shell {
|
|
109
|
+
border: 1px dashed var(--m-color-border);
|
|
110
|
+
border-radius: var(--m-radius-md);
|
|
111
|
+
background: var(--m-color-surface);
|
|
112
|
+
padding: var(--m-space-6);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
If the user asked for glass / gradient / dark-tech, implement **that** request with `--m-*` — do not escalate into AI mesh. Brand palette changes belong in theme overrides (project `DESIGN.md` § 主题覆盖).
|
|
117
|
+
|
|
118
|
+
## Polish modes (Impeccable-inspired)
|
|
119
|
+
|
|
120
|
+
| Mode | Intent |
|
|
121
|
+
| --- | --- |
|
|
122
|
+
| `quieter` | Strip competing accents **and unearned gradients/glow/glass** |
|
|
123
|
+
| `bolder` | Strengthen one signature **inside** the user’s direction — do not invent a new face |
|
|
124
|
+
| `polish` / `clarify` / `typeset` / `adapt` / `delight` | As named |
|
|
125
|
+
|
|
126
|
+
## Quality floor
|
|
127
|
+
|
|
128
|
+
- Responsive, focus visible, keyboard to primary actions
|
|
129
|
+
- No raw hex theme colors
|
|
130
|
+
- Craft pass done; MCP `validate_usage` / `validate_page` when available
|
|
131
|
+
- No unearned AI atmosphere
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Vue 3 + TypeScript 业务代码风格(Morya UI 项目)
|
|
3
|
-
globs: "**/*.{ts,vue}"
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 编码风格
|
|
8
|
-
|
|
9
|
-
## Vue
|
|
10
|
-
|
|
11
|
-
- 使用 `<script setup lang="ts">`。
|
|
12
|
-
- 组件名 PascalCase;模板中用 `M*` 前缀组件。
|
|
13
|
-
- `v-model` 与组件库 emit 对齐(如 `v-model:page`)。
|
|
14
|
-
- 页面级样式 `scoped`;仅使用 `--m-*` 与设计令牌。
|
|
15
|
-
|
|
16
|
-
## TypeScript
|
|
17
|
-
|
|
18
|
-
- Props/emit 显式类型;避免 `any`。
|
|
19
|
-
- 异步提交:`loading` ref + `try/finally`。
|
|
20
|
-
|
|
21
|
-
## 文件组织
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
src/
|
|
25
|
-
views/ # 路由页面
|
|
26
|
-
components/ # 业务组件
|
|
27
|
-
composables/ # 复用逻辑
|
|
28
|
-
api/ # 请求层
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## 命名
|
|
32
|
-
|
|
33
|
-
- 页面:`UserListView.vue` / `UserFormView.vue`
|
|
34
|
-
- 路由 path kebab-case:`/users/create`
|
|
35
|
-
|
|
36
|
-
## 检查
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
pnpm check:colors # 裸色值扫描
|
|
40
|
-
pnpm typecheck
|
|
41
|
-
```
|
|
1
|
+
---
|
|
2
|
+
description: Vue 3 + TypeScript 业务代码风格(Morya UI 项目)
|
|
3
|
+
globs: "**/*.{ts,vue}"
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 编码风格
|
|
8
|
+
|
|
9
|
+
## Vue
|
|
10
|
+
|
|
11
|
+
- 使用 `<script setup lang="ts">`。
|
|
12
|
+
- 组件名 PascalCase;模板中用 `M*` 前缀组件。
|
|
13
|
+
- `v-model` 与组件库 emit 对齐(如 `v-model:page`)。
|
|
14
|
+
- 页面级样式 `scoped`;仅使用 `--m-*` 与设计令牌。
|
|
15
|
+
|
|
16
|
+
## TypeScript
|
|
17
|
+
|
|
18
|
+
- Props/emit 显式类型;避免 `any`。
|
|
19
|
+
- 异步提交:`loading` ref + `try/finally`。
|
|
20
|
+
|
|
21
|
+
## 文件组织
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
src/
|
|
25
|
+
views/ # 路由页面
|
|
26
|
+
components/ # 业务组件
|
|
27
|
+
composables/ # 复用逻辑
|
|
28
|
+
api/ # 请求层
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 命名
|
|
32
|
+
|
|
33
|
+
- 页面:`UserListView.vue` / `UserFormView.vue`
|
|
34
|
+
- 路由 path kebab-case:`/users/create`
|
|
35
|
+
|
|
36
|
+
## 检查
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm check:colors # 裸色值扫描
|
|
40
|
+
pnpm typecheck
|
|
41
|
+
```
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Morya UI 组件用法与选型(Vue 业务代码)
|
|
3
|
-
globs: src/**/*.vue
|
|
4
|
-
alwaysApply: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# 组件用法
|
|
8
|
-
|
|
9
|
-
## 引入
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import { MButton, MInput } from 'morya-ui'
|
|
13
|
-
// 按需:import MButton from 'morya-ui/button'
|
|
14
|
-
// import 'morya-ui/button/style'
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## 必选模式
|
|
18
|
-
|
|
19
|
-
- 表单:`MForm` + `MFormItem` + 字段组件;提交用 `@submit` + `type="submit"`。
|
|
20
|
-
- 表格:`MTable` 的 `columns` + `rows` + `row-key`;单元格用 `#cell-{key}` 插槽。没有 `data` prop。
|
|
21
|
-
- 浮层:详情/编辑 `MDialog`;侧栏 `MDrawer`;删除确认 `MConfirmDialog`。
|
|
22
|
-
- 反馈(**默认 Message**):
|
|
23
|
-
- 单行操作结果 → `message.success/info/warn/error('…')`
|
|
24
|
-
- 有标题 + 详情 / 异步通知 → `toast.*({ summary, detail })`
|
|
25
|
-
- 表单区常驻错误 → 字段 `errorMessage`,或 token 样式的 `role="alert"`(`<MMessage>` 只是 message 宿主,不是内嵌 Alert)
|
|
26
|
-
- 详见 skill `references/feedback.md`
|
|
27
|
-
|
|
28
|
-
## Props 约定
|
|
29
|
-
|
|
30
|
-
- 尺寸:`size="small" | "large"`(默认 medium)。
|
|
31
|
-
- 危险:`severity="danger"` 或 `invalid` + `errorMessage`。
|
|
32
|
-
- 清除:优先 `clearable`(Select 亦支持 `showClear` 别名)。
|
|
33
|
-
- 宽度:表单字段 `fluid`;页面级宽度用 layout CSS + `max-width`。
|
|
34
|
-
|
|
35
|
-
## 禁止
|
|
36
|
-
|
|
37
|
-
- 同一页面混用其他 UI 库。
|
|
38
|
-
- 用 `MDropdown` 代替 Select 做枚举选择。
|
|
39
|
-
- 手写 table/modal 替代 `MTable` / `MDialog`。
|
|
40
|
-
|
|
41
|
-
完整清单:MCP `recommend_component`(含 recipe),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
1
|
+
---
|
|
2
|
+
description: Morya UI 组件用法与选型(Vue 业务代码)
|
|
3
|
+
globs: src/**/*.vue
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 组件用法
|
|
8
|
+
|
|
9
|
+
## 引入
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { MButton, MInput } from 'morya-ui'
|
|
13
|
+
// 按需:import MButton from 'morya-ui/button'
|
|
14
|
+
// import 'morya-ui/button/style'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 必选模式
|
|
18
|
+
|
|
19
|
+
- 表单:`MForm` + `MFormItem` + 字段组件;提交用 `@submit` + `type="submit"`。
|
|
20
|
+
- 表格:`MTable` 的 `columns` + `rows` + `row-key`;单元格用 `#cell-{key}` 插槽。没有 `data` prop。
|
|
21
|
+
- 浮层:详情/编辑 `MDialog`;侧栏 `MDrawer`;删除确认 `MConfirmDialog`。
|
|
22
|
+
- 反馈(**默认 Message**):
|
|
23
|
+
- 单行操作结果 → `message.success/info/warn/error('…')`
|
|
24
|
+
- 有标题 + 详情 / 异步通知 → `toast.*({ summary, detail })`
|
|
25
|
+
- 表单区常驻错误 → 字段 `errorMessage`,或 token 样式的 `role="alert"`(`<MMessage>` 只是 message 宿主,不是内嵌 Alert)
|
|
26
|
+
- 详见 skill `references/feedback.md`
|
|
27
|
+
|
|
28
|
+
## Props 约定
|
|
29
|
+
|
|
30
|
+
- 尺寸:`size="small" | "large"`(默认 medium)。
|
|
31
|
+
- 危险:`severity="danger"` 或 `invalid` + `errorMessage`。
|
|
32
|
+
- 清除:优先 `clearable`(Select 亦支持 `showClear` 别名)。
|
|
33
|
+
- 宽度:表单字段 `fluid`;页面级宽度用 layout CSS + `max-width`。
|
|
34
|
+
|
|
35
|
+
## 禁止
|
|
36
|
+
|
|
37
|
+
- 同一页面混用其他 UI 库。
|
|
38
|
+
- 用 `MDropdown` 代替 Select 做枚举选择。
|
|
39
|
+
- 手写 table/modal 替代 `MTable` / `MDialog`。
|
|
40
|
+
|
|
41
|
+
完整清单:MCP `recommend_component`(含 recipe),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Morya UI 设计系统第一信源。生成或修改 UI 前必读 DESIGN.md。
|
|
3
|
-
alwaysApply: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Morya UI 设计系统
|
|
7
|
-
|
|
8
|
-
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP `recommend_component`(含 recipe + `relatedSnippets`),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
9
|
-
2. **只用** `morya-ui` 的 `M*` 组件;全局样式 `morya-ui/styles.css`。
|
|
10
|
-
3. **颜色/间距/圆角** 使用 `--m-*` CSS 变量,禁止裸 hex/rgb(见 `scripts/check-raw-colors.mjs
|
|
11
|
-
4. **页面组装(composition-first
|
|
12
|
-
5. **表单选项** 用 `MSelect` / `MTreeSelect`;**动作菜单** 用 `MDropdown`。
|
|
13
|
-
6. 不确定 API 时查文档站或 MCP `get_component`,**禁止臆造 prop**;写完后必须 `validate_usage`。
|
|
14
|
-
7. 根节点用 `MConfigProvider`;后台布局用 `MLayout` 系列。
|
|
15
|
-
8. **操作反馈默认 `message` API**;仅 `summary + detail` 或异步通知用 `toast`;表单常驻错误用字段 `errorMessage` 或 token 样式的 `role="alert"`(`<MMessage>` 只是 message 宿主)。见 skill `references/feedback.md`。
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Morya UI 设计系统第一信源。生成或修改 UI 前必读 DESIGN.md。
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Morya UI 设计系统
|
|
7
|
+
|
|
8
|
+
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP `recommend_component`(含 recipe + `relatedSnippets`),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
9
|
+
2. **只用** `morya-ui` 的 `M*` 组件;全局样式 `morya-ui/styles.css`。
|
|
10
|
+
3. **颜色/间距/圆角** 使用 `--m-*` CSS 变量,禁止裸 hex/rgb(见 `scripts/check-raw-colors.mjs`)。品牌差异优先主题覆盖 `--m-color-primary` / 字体(见 DESIGN.md § 主题覆盖)。
|
|
11
|
+
4. **页面组装(composition-first)**:有参考时先 `map_reference`(或 `recommend_page` + `brief` / `density`)→ 按 `mapping` / `suggestedSnippets` 用 `get_page_snippet` 拼装;`page-layouts` 作块顺序 checklist。`get_golden_page` **可选**。Account / Express / Flow 签名壳用 `get_style_shells`。**视觉方向**:明确参考/描述 → 跟用户;线索清晰 → 推断并说明;不确定 → 先问(`get_style_direction`)。**没有命名风格预设表。** 禁止未询问就套 AI 默认渐变/霓虹/毛玻璃。
|
|
12
|
+
5. **表单选项** 用 `MSelect` / `MTreeSelect`;**动作菜单** 用 `MDropdown`。
|
|
13
|
+
6. 不确定 API 时查文档站或 MCP `get_component`,**禁止臆造 prop**;写完后必须 `validate_usage`。
|
|
14
|
+
7. 根节点用 `MConfigProvider`;后台布局用 `MLayout` 系列。
|
|
15
|
+
8. **操作反馈默认 `message` API**;仅 `summary + detail` 或异步通知用 `toast`;表单常驻错误用字段 `errorMessage` 或 token 样式的 `role="alert"`(`<MMessage>` 只是 message 宿主)。见 skill `references/feedback.md`。
|
|
16
|
+
9. 交付前 `validate_page`(同一 `brief`):契约 `ok` 必须为 true;工艺建议可说明后放过。
|
|
17
|
+
|
|
18
|
+
Token / 风格 / companion:MCP `get_design_rules`、`get_style_direction`、`get_style_shells`、`map_reference`;skill `optional-companions.md`(运行时以 `morya-ui/styles.css` 为准)
|