@morya-ui/setup 0.3.5 → 0.3.7

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.
Files changed (33) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +119 -107
  3. package/bin/morya-ui-setup.js +14 -14
  4. package/catalog/skills.json +46 -46
  5. package/package.json +4 -3
  6. package/src/__tests__/mcp.test.mjs +141 -0
  7. package/src/cli.mjs +330 -312
  8. package/src/copy-template.mjs +78 -78
  9. package/src/fs-utils.mjs +24 -24
  10. package/src/install.mjs +134 -134
  11. package/src/mcp.mjs +220 -50
  12. package/src/package-json.mjs +30 -30
  13. package/src/skills.mjs +224 -223
  14. package/src/styles.mjs +119 -119
  15. package/template/.agents/skills/morya-ui-pages/SKILL.md +191 -188
  16. package/template/.agents/skills/morya-ui-pages/evals/evals.json +89 -89
  17. package/template/.agents/skills/morya-ui-pages/references/component-index.md +99 -99
  18. package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +6 -27
  19. package/template/.agents/skills/morya-ui-pages/references/design-system.md +101 -101
  20. package/template/.agents/skills/morya-ui-pages/references/feedback.md +68 -68
  21. package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +62 -62
  22. package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +133 -133
  23. package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +76 -63
  24. package/template/.agents/skills/morya-ui-pages/references/style-presets.md +68 -45
  25. package/template/.agents/skills/morya-ui-pages/references/surfaces.md +91 -91
  26. package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +131 -129
  27. package/template/.cursor/rules/coding-style.mdc +41 -41
  28. package/template/.cursor/rules/component-usage.mdc +41 -41
  29. package/template/.cursor/rules/design-system.mdc +18 -17
  30. package/template/.cursor/rules/page-layout.mdc +97 -97
  31. package/template/AGENTS.md +33 -0
  32. package/template/DESIGN.md +81 -59
  33. package/template/scripts/check-raw-colors.mjs +74 -74
@@ -1,91 +1,91 @@
1
- # Surface taxonomy
2
-
3
- Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the recipes below for everything else. Always implement interactive controls with `morya-ui`.
4
-
5
- ## Ops (admin / console)
6
-
7
- | Surface | Job | Compose from |
8
- | --- | --- | --- |
9
- | List | Scan, filter, act on many rows | Golden list + [page-layouts.md](page-layouts.md); **create/edit with ≤~8 fields → `MDialog` on the list** |
10
- | Form | Create / edit one entity as a **dedicated page** | Golden form — only when multi-section, many fields, or user asked for an independent form route |
11
- | Dashboard | Orient + jump to work | Golden dashboard |
12
- | Detail | Read-heavy record + secondary actions | `MPageHeader` + sections via `MCard`/`MPageSection`; edit via `MDialog` / `MDrawer` (prefer over a second form route) |
13
- | Settings | Grouped preferences | Narrow `MPageContent` + stacked `MPageSection` / `MTabs` + `MForm` |
14
- | Hybrid list | List + drawer/dialog | **Default Ops CRUD pattern**: list golden + `MDialog`/`MDrawer` form |
15
-
16
- ## Account
17
-
18
- | Surface | Job | Recipe |
19
- | --- | --- | --- |
20
- | Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm` (`MInput`, `MInputPassword`); form-level errors via token `role="alert"` (not Toast). Brand wash: [visual-craft.md](visual-craft.md) § Atmosphere |
21
- | Invite / accept | Join org | Same shell; show org name clearly |
22
- | Forgot / reset | Recover access | Short form + success state with next step |
23
- | Profile / account | Edit self | Settings-like sections; avatar via `MAvatar` |
24
-
25
- Keep credential forms quiet: one primary CTA, clear labels, no decorative noise beside the brand panel.
26
-
27
- ## Flow
28
-
29
- | Surface | Job | Recipe |
30
- | --- | --- | --- |
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
- | Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
33
- | Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
34
- | Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
35
-
36
- Copy must tell the user **what to do next**, not celebrate the system.
37
-
38
- ## System
39
-
40
- | Surface | Job | Recipe |
41
- | --- | --- | --- |
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
- | 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
-
46
- Avoid witty 404 essays that hide the exit paths.
47
-
48
- ## Express (marketing / public)
49
-
50
- Use when the brief is landing, pricing, launch, or docs marketing — **not** for Ops CRUD shells.
51
-
52
- | Surface | Job | Recipe |
53
- | --- | --- | --- |
54
- | Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion` |
55
- | Pricing | Choose a plan | Clear plan cards (`MCard`) + primary CTA; highlight recommended plan without clutter |
56
- | Feature showcase | Prove capability | Alternating media/copy; live `M*` demo only if lightweight |
57
- | Docs marketing chrome | Frame documentation | Header + nav using `M*` where suitable; content area stays readable |
58
-
59
- Before coding Express: short design plan in [visual-craft.md](visual-craft.md). Map colors to `--m-*` / theme overrides; do not paste a second kit.
60
-
61
- **Anti-patterns for Express:** inset hero cards instead of a full-bleed thesis; pill-stat strips in the first viewport; purple aurora / cream-terracotta / broadsheet / unsolicited glass-neon when the user did not ask.
62
-
63
- ## Overlay
64
-
65
- When the dialog/drawer **is** the task:
66
-
67
- | Surface | Recipe |
68
- | --- | --- |
69
- | Edit / create dialog | `MDialog` + compact `MForm` + footer actions |
70
- | Detail drawer | `MDrawer` + header + sections + optional edit |
71
- | Confirm | `MConfirmDialog` / `MConfirmPopup` — do not reinvent |
72
- | Command menu | `MCommandMenu` for keyboard-first jump / actions |
73
-
74
- Host page stays stable; focus management comes from the overlay component.
75
-
76
- ## Lane mixing
77
-
78
- | Ask | Treat as |
79
- | --- | --- |
80
- | “后台列表 + 好看一点” | Ops + ask once what “好看” means, or follow any reference they give |
81
- | “像附件截图一样” | Reference-first style resolution; still M* + `--m-*` |
82
- | “登录页有品牌感” | Account + Express craft on brand panel only |
83
- | “产品官网” | Express; Ops patterns do not apply |
84
- | “空状态设计精致一点” | Flow empty + visual-craft signature (one risk) |
85
-
86
- ## MCP hints
87
-
88
- - Ops whole page: `recommend_page({ style? })` → `get_golden_page` → apply `styleDirection` / reference
89
- - Style: `get_style_direction` (no preset catalog)
90
- - Section: `get_page_snippet`
91
- - Any lane: `search` / `get_component` before unfamiliar APIs
1
+ # Surface taxonomy
2
+
3
+ Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the recipes below for everything else. Always implement interactive controls with `morya-ui`.
4
+
5
+ ## Ops (admin / console)
6
+
7
+ | Surface | Job | Compose from |
8
+ | --- | --- | --- |
9
+ | List | Scan, filter, act on many rows | Golden list + [page-layouts.md](page-layouts.md); **create/edit with ≤~8 fields → `MDialog` on the list** |
10
+ | Form | Create / edit one entity as a **dedicated page** | Golden form — only when multi-section, many fields, or user asked for an independent form route |
11
+ | Dashboard | Orient + jump to work | Golden dashboard |
12
+ | Detail | Read-heavy record + secondary actions | `MPageHeader` + sections via `MCard`/`MPageSection`; edit via `MDialog` / `MDrawer` (prefer over a second form route) |
13
+ | Settings | Grouped preferences | Narrow `MPageContent` + stacked `MPageSection` / `MTabs` + `MForm` |
14
+ | Hybrid list | List + drawer/dialog | **Default Ops CRUD pattern**: list golden + `MDialog`/`MDrawer` form |
15
+
16
+ ## Account
17
+
18
+ | Surface | Job | Recipe |
19
+ | --- | --- | --- |
20
+ | Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm` (`MInput`, `MInputPassword`); form-level errors via token `role="alert"` (not Toast). Brand wash: [visual-craft.md](visual-craft.md) § Atmosphere |
21
+ | Invite / accept | Join org | Same shell; show org name clearly |
22
+ | Forgot / reset | Recover access | Short form + success state with next step |
23
+ | Profile / account | Edit self | Settings-like sections; avatar via `MAvatar` |
24
+
25
+ Keep credential forms quiet: one primary CTA, clear labels, no decorative noise beside the brand panel.
26
+
27
+ ## Flow
28
+
29
+ | Surface | Job | Recipe |
30
+ | --- | --- | --- |
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
+ | Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
33
+ | Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
34
+ | Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
35
+
36
+ Copy must tell the user **what to do next**, not celebrate the system.
37
+
38
+ ## System
39
+
40
+ | Surface | Job | Recipe |
41
+ | --- | --- | --- |
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
+ | 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
+
46
+ Avoid witty 404 essays that hide the exit paths.
47
+
48
+ ## Express (marketing / public)
49
+
50
+ Use when the brief is landing, pricing, launch, or docs marketing — **not** for Ops CRUD shells.
51
+
52
+ | Surface | Job | Recipe |
53
+ | --- | --- | --- |
54
+ | Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion` |
55
+ | Pricing | Choose a plan | Clear plan cards (`MCard`) + primary CTA; highlight recommended plan without clutter |
56
+ | Feature showcase | Prove capability | Alternating media/copy; live `M*` demo only if lightweight |
57
+ | Docs marketing chrome | Frame documentation | Header + nav using `M*` where suitable; content area stays readable |
58
+
59
+ Before coding Express: short design plan in [visual-craft.md](visual-craft.md). Map colors to `--m-*` / theme overrides; do not paste a second kit.
60
+
61
+ **Anti-patterns for Express:** inset hero cards instead of a full-bleed thesis; pill-stat strips in the first viewport; purple aurora / cream-terracotta / broadsheet / unsolicited glass-neon when the user did not ask.
62
+
63
+ ## Overlay
64
+
65
+ When the dialog/drawer **is** the task:
66
+
67
+ | Surface | Recipe |
68
+ | --- | --- |
69
+ | Edit / create dialog | `MDialog` + compact `MForm` + footer actions |
70
+ | Detail drawer | `MDrawer` + header + sections + optional edit |
71
+ | Confirm | `MConfirmDialog` / `MConfirmPopup` — do not reinvent |
72
+ | Command menu | `MCommandMenu` for keyboard-first jump / actions |
73
+
74
+ Host page stays stable; focus management comes from the overlay component.
75
+
76
+ ## Lane mixing
77
+
78
+ | Ask | Treat as |
79
+ | --- | --- |
80
+ | “后台列表 + 好看一点” | Ops + ask once what “好看” means, or follow any reference they give |
81
+ | “像附件截图一样” | Reference-first style resolution; still M* + `--m-*` |
82
+ | “登录页有品牌感” | Account + Express craft on brand panel only |
83
+ | “产品官网” | Express; Ops patterns do not apply |
84
+ | “空状态设计精致一点” | Flow empty + visual-craft signature (one risk) |
85
+
86
+ ## MCP hints
87
+
88
+ - Ops whole page: `recommend_page({ style? })` → `get_golden_page` → apply `styleDirection` / reference
89
+ - Style: `get_style_direction` (no preset catalog)
90
+ - Section: `get_page_snippet`
91
+ - Any lane: `search` / `get_component` before unfamiliar APIs
@@ -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
- ### Account — split brand panel
76
-
77
- ```css
78
- .login-brand {
79
- display: flex;
80
- flex-direction: column;
81
- justify-content: flex-end;
82
- gap: var(--m-space-4);
83
- padding: clamp(2rem, 6vw, 4.5rem);
84
- background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface));
85
- border-right: 1px solid var(--m-color-border);
86
- }
87
- ```
88
-
89
- ### Express — hero plane
90
-
91
- ```css
92
- .landing-hero__visual {
93
- margin-top: var(--m-space-5);
94
- padding: var(--m-space-5);
95
- border: 1px solid var(--m-color-border);
96
- border-radius: var(--m-radius-md);
97
- background: var(--m-color-surface);
98
- }
99
- ```
100
-
101
- ### Flow — empty shell
102
-
103
- Prefer stock `MEmpty`. Optional light frame:
104
-
105
- ```css
106
- .empty-state-shell {
107
- border: 1px dashed var(--m-color-border);
108
- border-radius: var(--m-radius-md);
109
- background: var(--m-color-surface);
110
- padding: var(--m-space-6);
111
- }
112
- ```
113
-
114
- If the user asked for glass / gradient / dark-tech, implement **that** request with `--m-*` — do not escalate into AI mesh.
115
-
116
- ## Polish modes (Impeccable-inspired)
117
-
118
- | Mode | Intent |
119
- | --- | --- |
120
- | `quieter` | Strip competing accents **and unearned gradients/glow/glass** |
121
- | `bolder` | Strengthen one signature **inside** the user’s direction — do not invent a new face |
122
- | `polish` / `clarify` / `typeset` / `adapt` / `delight` | As named |
123
-
124
- ## Quality floor
125
-
126
- - Responsive, focus visible, keyboard to primary actions
127
- - No raw hex theme colors
128
- - Craft pass done; MCP `validate_usage` / `validate_page` when available
129
- - No unearned AI atmosphere
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`。