@morya-ui/setup 0.3.4 → 0.3.5
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 -0
- package/README.md +11 -7
- package/bin/morya-ui-setup.js +0 -0
- package/package.json +3 -5
- package/src/cli.mjs +13 -36
- package/src/install.mjs +82 -11
- package/src/mcp.mjs +1 -1
- package/template/.agents/skills/morya-ui-pages/SKILL.md +50 -46
- package/template/.agents/skills/morya-ui-pages/evals/evals.json +16 -16
- package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +72 -5
- package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +38 -83
- package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +46 -54
- package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +14 -15
- package/template/.agents/skills/morya-ui-pages/references/style-presets.md +31 -59
- package/template/.agents/skills/morya-ui-pages/references/surfaces.md +3 -3
- package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +59 -151
- package/template/.cursor/rules/design-system.mdc +3 -3
- package/template/.cursor/rules/page-layout.mdc +23 -23
|
@@ -15,17 +15,18 @@
|
|
|
15
15
|
|
|
16
16
|
## Craft (all lanes — default pass)
|
|
17
17
|
|
|
18
|
-
- [ ] Style direction resolved
|
|
19
|
-
- [ ] Lane craft from [visual-craft.md](visual-craft.md)
|
|
18
|
+
- [ ] Style direction resolved: followed user reference/description, or inferred from clear cues, or **asked** when uncertain — never silent invent; **no preset catalog**
|
|
19
|
+
- [ ] Lane craft from [visual-craft.md](visual-craft.md) applied
|
|
20
20
|
- [ ] If companions ran: still only `M*` + `--m-*`; no second kit ([optional-companions.md](optional-companions.md))
|
|
21
21
|
- [ ] At most one primary filled button in the main viewport
|
|
22
22
|
- [ ] Copy is domain-real; empty / error states say what to do next
|
|
23
|
-
- [ ] No AI-default look clusters unless the
|
|
24
|
-
- [ ]
|
|
23
|
+
- [ ] No AI-default look clusters unless the user/reference asked for them
|
|
24
|
+
- [ ] No unearned atmosphere: stacked radial+linear washes, purple mesh, frosted glass, neon glow stacks
|
|
25
|
+
- [ ] Motion (if any) is 1–3 intentional moments and follows `useMotion` / `data-m-motion`
|
|
25
26
|
|
|
26
27
|
## Ops
|
|
27
28
|
|
|
28
|
-
- [ ] Matches
|
|
29
|
+
- [ ] Matches [page-layouts.md](page-layouts.md) block order (snippets composed; golden page optional check only)
|
|
29
30
|
- [ ] `MPage*` used instead of ad-hoc page chrome where applicable
|
|
30
31
|
- [ ] List height: if this is a full-viewport main data list, consider `MPageContent fill` + `MTable fill`; if embedded/short/document-scroll, skip `fill`
|
|
31
32
|
- [ ] Tables not wrapped in decorative `MCard` solely for borders
|
|
@@ -37,20 +38,18 @@
|
|
|
37
38
|
## Account / Flow / System
|
|
38
39
|
|
|
39
40
|
- [ ] Primary CTA obvious; escape paths present (back / home / support)
|
|
40
|
-
- [ ] Auth errors stay on the form via field `errorMessage` or a token `role="alert"`
|
|
41
|
-
- [ ] Empty uses `MEmpty
|
|
42
|
-
- [ ]
|
|
43
|
-
- [ ] Inline status prefers `MStatus`; chip-like labels use `MTag`
|
|
41
|
+
- [ ] Auth errors stay on the form via field `errorMessage` or a token `role="alert"`
|
|
42
|
+
- [ ] Empty uses `MEmpty`; success / HTTP errors use `MResult`
|
|
43
|
+
- [ ] Brand / empty atmosphere follows the **resolved direction** (defaults are flat token shells)
|
|
44
44
|
- [ ] Wizard steps: one job each; actions labeled clearly
|
|
45
|
-
- [ ] Brand / empty atmosphere uses token-only CSS (see visual-craft recipes)
|
|
46
45
|
|
|
47
46
|
## Express
|
|
48
47
|
|
|
49
48
|
- [ ] Short design plan existed (subject, palette roles, signature)
|
|
50
|
-
- [ ] First viewport has one job
|
|
51
|
-
- [ ] Controls still `M*`; colors/spacing map to `--m-*`
|
|
52
|
-
- [ ] Avoided AI-default looks unless
|
|
53
|
-
- [ ] Motion limited and
|
|
49
|
+
- [ ] First viewport has one job
|
|
50
|
+
- [ ] Controls still `M*`; colors/spacing map to `--m-*`
|
|
51
|
+
- [ ] Avoided AI-default looks unless user/reference requested them
|
|
52
|
+
- [ ] Motion limited and gated by `useMotion` / `data-m-motion`
|
|
54
53
|
|
|
55
54
|
## Tokens, a11y, responsive
|
|
56
55
|
|
|
@@ -59,6 +58,6 @@
|
|
|
59
58
|
- [ ] Usable on a narrow viewport
|
|
60
59
|
- [ ] Focus visible on interactive elements
|
|
61
60
|
|
|
62
|
-
When MCP is available, contract checks
|
|
61
|
+
When MCP is available, contract checks (**`validate_usage`** / **`validate_page`**) are required.
|
|
63
62
|
|
|
64
63
|
If the project has `pnpm check:colors`, suggest running it after edits.
|
|
@@ -1,73 +1,45 @@
|
|
|
1
|
-
# Style direction
|
|
1
|
+
# Style direction (no preset catalog)
|
|
2
2
|
|
|
3
|
-
Golden pages lock **block order and APIs**. They are **not** the only allowed look.
|
|
3
|
+
Golden pages lock **block order and APIs**. They are **not** the only allowed look. There is **no** named style-preset table (`simple` / `glass` / …). Resolve the look from the **user**, then map onto `M*` + `--m-*`.
|
|
4
4
|
|
|
5
5
|
## Resolution order (required)
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
2. **Named preset** — user asked for `soft` / 柔和留白 / `dense` / …
|
|
11
|
-
3. **Prompt cues** — industry or mood words in the brief → infer the closest preset and **name it** in the reply.
|
|
12
|
-
4. **Offer a choice** — still unclear → ask **one** short question with 3–4 options (ids below). If the user says “直接写 / just ship”, pick by domain heuristic — **do not always use `quiet`**.
|
|
7
|
+
1. **User reference or explicit description (highest)**
|
|
8
|
+
Screenshot / mock / existing page / URL / “像 XX”, or clear words (“毛玻璃一点”、“深蓝科技风”).
|
|
9
|
+
**Must follow.** Remap to `--m-*` + `M*`. Do not switch kits, do not “improve” into another face.
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
2. **Clear prompt cues (when not explicit)**
|
|
12
|
+
Industry / mood words in the brief → infer and **state your reading in one sentence**.
|
|
13
|
+
Decorative glass / neon / full-page gradients only when the prompt clearly asks.
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
3. **Uncertain → ask (required)**
|
|
16
|
+
No reference, vague cues → **ask once** for a short description or a reference.
|
|
17
|
+
Do not invent the full look in silence.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| `soft` | 柔和留白 | Ops / content admin | `density="spacious"`, filled filters, short descriptions | `list-page` |
|
|
22
|
-
| `dense` | 高密度工具台 | Monitoring / power users | `density="compact"`, `size="small"` table, tight filters | `list-page-dense` |
|
|
23
|
-
| `rail` | 侧栏强调 | Branded B2B shells | Token `color-mix` wash on sider/header only | `list-page-rail` |
|
|
24
|
-
| `studio` | 工作室呼吸感 | Design / collab / knowledge | Stronger header hierarchy; optional one radial wash | `list-page` |
|
|
25
|
-
| `ink` | 线框极简 | Tool / docs feel | Plain filters, bordered table, little fill | `list-page` |
|
|
19
|
+
4. **Only if user declines**
|
|
20
|
+
“你看着办 / 直接写” with still no cues → quiet flat on-token admin face, **say so**, continue.
|
|
21
|
+
Never default to aurora / neon / unsolicited glass / cream-serif-terracotta.
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
MCP: `get_style_direction` / `recommend_page({ style? })` → `styleDirection`.
|
|
24
|
+
`resolution: "ask"` means **ask the user**, not free-style.
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
## What `style` means
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| 运营 / 内容 / 教育 | `soft` |
|
|
35
|
-
| 监控 / 运维 / 交易 | `dense` |
|
|
36
|
-
| 强调品牌色 / LOGO | `rail` |
|
|
37
|
-
| 设计 / 协作 / 知识库 | `studio` |
|
|
38
|
-
| 登录 / 落地 / 品牌营销 | Account/Express atmosphere — not an Ops preset |
|
|
28
|
+
- Free-text from the user (or a short paraphrase of their reference).
|
|
29
|
+
- **Not** a preset id.
|
|
30
|
+
- Optional craft cues for list goldens only: words like `dense` / `compact` / `高密` → `list-page-dense`; `rail` / `品牌侧栏` → `list-page-rail`.
|
|
39
31
|
|
|
40
|
-
##
|
|
32
|
+
## Anti-defaults (unless user/reference asks)
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
- Purple→indigo / aurora / mesh washes
|
|
35
|
+
- Warm cream + serif + terracotta kit
|
|
36
|
+
- Broadsheet newspaper columns
|
|
37
|
+
- Unsolicited glassmorphism, neon glow stacks, neumorph on dense tables
|
|
38
|
+
- Companion “atmosphere” that overrides the user’s words
|
|
46
39
|
|
|
47
|
-
##
|
|
40
|
+
## How to apply
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- [ ] Surfaces matched (plain vs filled filters; bordered table or not)
|
|
54
|
-
- [ ] Accent placement matched (chrome only vs content) using `--m-*` / `color-mix`
|
|
55
|
-
- [ ] Interaction patterns stay morya-ui (`MTable` `rows`, `message`, etc.)
|
|
56
|
-
|
|
57
|
-
## Anti-patterns
|
|
58
|
-
|
|
59
|
-
- Treating the golden page as the only allowed aesthetic
|
|
60
|
-
- Asking nothing and always emitting `quiet`
|
|
61
|
-
- Inventing a second component library to “match the reference”
|
|
62
|
-
- Turning Ops into a marketing landing to “look less stiff”
|
|
63
|
-
- Letting Frontend Design / Impeccable / UI-UX-Pro-Max swap stacks or ignore `M*` / `--m-*` (see [optional-companions.md](optional-companions.md))
|
|
64
|
-
|
|
65
|
-
## Companion pairing
|
|
66
|
-
|
|
67
|
-
| Preset | Pairs well with |
|
|
68
|
-
| --- | --- |
|
|
69
|
-
| `quiet` / `ink` | Impeccable Operate + `quieter` / `polish` |
|
|
70
|
-
| `soft` / `studio` | Frontend Design hierarchy cues; Impeccable `bolder` (one signature only) |
|
|
71
|
-
| `dense` | Impeccable Operate — scanability over decoration |
|
|
72
|
-
| `rail` | Frontend Design brand panel taste on **chrome only** |
|
|
73
|
-
| Express (no Ops preset) | Frontend Design design plan → Impeccable `polish` |
|
|
42
|
+
1. Mirror golden **structure** via `recommend_page` / `get_golden_page`.
|
|
43
|
+
2. Apply the resolved direction with tokens + layout/type — see [visual-craft.md](visual-craft.md).
|
|
44
|
+
3. Run Ops polish when on Operate surfaces.
|
|
45
|
+
4. Companions deepen **inside** the resolved direction only ([optional-companions.md](optional-companions.md)).
|
|
@@ -58,7 +58,7 @@ Use when the brief is landing, pricing, launch, or docs marketing — **not** fo
|
|
|
58
58
|
|
|
59
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
60
|
|
|
61
|
-
**Anti-patterns for Express:** inset hero cards instead of a full-bleed thesis; pill-stat strips in the first viewport; purple
|
|
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
62
|
|
|
63
63
|
## Overlay
|
|
64
64
|
|
|
@@ -77,7 +77,7 @@ Host page stays stable; focus management comes from the overlay component.
|
|
|
77
77
|
|
|
78
78
|
| Ask | Treat as |
|
|
79
79
|
| --- | --- |
|
|
80
|
-
| “后台列表 + 好看一点” | Ops +
|
|
80
|
+
| “后台列表 + 好看一点” | Ops + ask once what “好看” means, or follow any reference they give |
|
|
81
81
|
| “像附件截图一样” | Reference-first style resolution; still M* + `--m-*` |
|
|
82
82
|
| “登录页有品牌感” | Account + Express craft on brand panel only |
|
|
83
83
|
| “产品官网” | Express; Ops patterns do not apply |
|
|
@@ -86,6 +86,6 @@ Host page stays stable; focus management comes from the overlay component.
|
|
|
86
86
|
## MCP hints
|
|
87
87
|
|
|
88
88
|
- Ops whole page: `recommend_page({ style? })` → `get_golden_page` → apply `styleDirection` / reference
|
|
89
|
-
-
|
|
89
|
+
- Style: `get_style_direction` (no preset catalog)
|
|
90
90
|
- Section: `get_page_snippet`
|
|
91
91
|
- Any lane: `search` / `get_component` before unfamiliar APIs
|
|
@@ -1,91 +1,76 @@
|
|
|
1
1
|
# Visual craft (distilled)
|
|
2
2
|
|
|
3
|
-
Portable craft for morya-ui consumers. Inspired by **Frontend Design**, **Impeccable**, and **UI-UX-Pro-Max** — without requiring those skills
|
|
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
4
|
|
|
5
5
|
## When to lean on craft
|
|
6
6
|
|
|
7
7
|
| Lane | Craft intensity | Default pass |
|
|
8
8
|
| --- | --- | --- |
|
|
9
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 §
|
|
10
|
+
| Account / Flow / System | Medium — trust, hierarchy, one calm brand cue | **Always** run § Shell recipes when relevant |
|
|
11
11
|
| Express | High — design plan + one signature risk | **Always** run design plan + anti-defaults |
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
**Style is not fixed to the golden look.** Resolve direction first ([style-presets.md](style-presets.md)): reference → named preset → prompt cues → offer a choice. Golden pages define structure; presets / references define craft variety so pages do not all look stiff and identical.
|
|
16
|
-
|
|
17
|
-
Market skills (**Frontend Design**, **Impeccable**, **UI-UX-Pro-Max**) deepen taste when installed — see [optional-companions.md](optional-companions.md). This file keeps a **distilled** subset so the skill stays standalone.
|
|
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**.
|
|
18
14
|
|
|
19
15
|
## Companion bridge (distilled)
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
Run companions **after** structure + contract + **resolved style direction**, then remediate with `M*` + `--m-*`.
|
|
22
18
|
|
|
23
19
|
### Subject first (Frontend Design)
|
|
24
20
|
|
|
25
|
-
- Name
|
|
26
|
-
-
|
|
27
|
-
- **One signature
|
|
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.
|
|
28
25
|
|
|
29
26
|
### Mode (Impeccable)
|
|
30
27
|
|
|
31
28
|
| Mode | Use when | Craft budget |
|
|
32
29
|
| --- | --- | --- |
|
|
33
|
-
| **Operate** | Ops lists, forms, settings
|
|
34
|
-
| **Persuade** | Landing, pricing
|
|
35
|
-
| **Read** | Docs / long detail | Typeset + measure
|
|
36
|
-
| **Experience** | Gallery / showcase | Artifact leads
|
|
37
|
-
|
|
38
|
-
### Design plan (Express & branded Account — Frontend Design)
|
|
39
|
-
|
|
40
|
-
Before code, decide:
|
|
41
|
-
|
|
42
|
-
1. **Color** — 4–6 roles (bg, surface, text, muted, accent, danger). Prefer existing `--m-*`. If the project already customizes theme, extend that system; do not invent a parallel hex soup in scoped CSS. (Companions may suggest hex — **map** them onto tokens.)
|
|
43
|
-
2. **Type** — display vs body vs utility. For Ops / Operate, stick to theme fonts. For Express / Persuade, a distinctive pairing is OK if fonts are loadable and fallbacks exist.
|
|
44
|
-
3. **Layout concept** — one sentence + rough hierarchy (ASCII wireframe optional). Structure encodes meaning; numbered `01/02/03` only when order is real information.
|
|
45
|
-
4. **Signature** — the single memorable element (motion, crop, editorial type, product artifact). Everything else quieter.
|
|
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 |
|
|
46
34
|
|
|
47
|
-
|
|
35
|
+
### Design plan (Express & branded Account)
|
|
48
36
|
|
|
49
|
-
|
|
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.
|
|
50
41
|
|
|
51
|
-
|
|
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.**
|
|
52
43
|
|
|
53
|
-
|
|
54
|
-
2. **Sider icons** — every top-level `MMenu` item has an `icon`; icons come from one set (built-in Tabler names). No random emoji.
|
|
55
|
-
3. **Status cells** — row business state → `MStatus` (dot + label). `MTag` only for categories, filters, or closable chips.
|
|
56
|
-
4. **Row actions** — secondary `text` / `outlined` / `size="small"`; danger only on destructive. Prefer `MSpace` with a consistent gap; avoid a wall of filled buttons.
|
|
57
|
-
5. **Filter rhythm** — search ~`14rem`, compact selects ~`10–12rem`; wrap with `MSpace wrap`. Do not stretch filters full-bleed. Secondary fields → `MPageFilters collapsible` + `#advanced`; active criteria → `MPageFilterChips` + closable `MTag`.
|
|
58
|
-
6. **Empty is designed** — `MEmpty` (or table `#empty` with `MEmpty`) with a next action; never a silent blank table or a lone muted sentence.
|
|
59
|
-
7. **No extra cards** — do not wrap `MPageFilters` / `MTable` in decorative `MCard` “for polish”. Dashboard chart/detail modules may use `MCard`.
|
|
60
|
-
8. **Domain copy** — column labels, placeholders, and empty titles use product vernacular, not “Name / Status / No data”.
|
|
61
|
-
9. **Density** — prefer theme default; use `size="small"` on dense tables inside cards. Do not invent a second spacing scale.
|
|
62
|
-
10. **Quiet chrome** — breadcrumb + toolbar title are enough hierarchy; skip marketing heroes, pill-stat strips, and glow on Ops shells.
|
|
44
|
+
## Ops polish (baseline)
|
|
63
45
|
|
|
64
|
-
|
|
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.
|
|
65
56
|
|
|
66
|
-
|
|
57
|
+
Ops beauty = alignment + semantics + restraint, **not** gradients.
|
|
67
58
|
|
|
68
|
-
|
|
59
|
+
## Anti-default looks
|
|
69
60
|
|
|
70
|
-
|
|
71
|
-
2. Near-black + single acid-green / vermilion accent
|
|
72
|
-
3. Broadsheet: hairline rules, zero radius, dense newspaper columns
|
|
73
|
-
4. Purple-on-white / purple-to-indigo gradient SaaS cliché
|
|
74
|
-
5. Glow stacks, pill chip clouds, emoji as decoration, multi-layer shadows as personality
|
|
61
|
+
Unless the user **asks** or a reference **shows** them, do not use:
|
|
75
62
|
|
|
76
|
-
|
|
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
|
|
77
70
|
|
|
78
|
-
|
|
71
|
+
**Token gradients are not a free pass** — only when the user/reference asks.
|
|
79
72
|
|
|
80
|
-
|
|
81
|
-
- **Structure encodes meaning**: numbered steps only when order is real information.
|
|
82
|
-
- **Cards**: default off for Express heroes; use `MCard` when it groups an interaction or plan choice.
|
|
83
|
-
- **Motion**: orchestrate 2–3 intentional moments max; gate custom CSS motion with `[data-m-motion="full"]` (library intensity from `useMotion`). Prefer transform/opacity over layout thrash.
|
|
84
|
-
- **Density**: Ops may be compact; Express needs breathing room — match the lane.
|
|
85
|
-
|
|
86
|
-
## Atmosphere recipes (token-only)
|
|
87
|
-
|
|
88
|
-
Copy patterns, remap brand copy. **No hex.** Prefer `color-mix` / gradients from `--m-*`. See golden pages `login-page`, `landing-page`, `empty-state`.
|
|
73
|
+
## Shell recipes (token-only — defaults are flat)
|
|
89
74
|
|
|
90
75
|
### Account — split brand panel
|
|
91
76
|
|
|
@@ -96,126 +81,49 @@ Copy patterns, remap brand copy. **No hex.** Prefer `color-mix` / gradients from
|
|
|
96
81
|
justify-content: flex-end;
|
|
97
82
|
gap: var(--m-space-4);
|
|
98
83
|
padding: clamp(2rem, 6vw, 4.5rem);
|
|
99
|
-
background:
|
|
100
|
-
radial-gradient(
|
|
101
|
-
80% 60% at 10% 20%,
|
|
102
|
-
color-mix(in srgb, var(--m-color-primary) 22%, transparent),
|
|
103
|
-
transparent 55%
|
|
104
|
-
),
|
|
105
|
-
linear-gradient(
|
|
106
|
-
165deg,
|
|
107
|
-
color-mix(in srgb, var(--m-color-primary) 16%, var(--m-color-surface)) 0%,
|
|
108
|
-
var(--m-color-surface) 55%,
|
|
109
|
-
color-mix(in srgb, var(--m-color-border) 35%, var(--m-color-surface)) 100%
|
|
110
|
-
);
|
|
84
|
+
background: color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface));
|
|
111
85
|
border-right: 1px solid var(--m-color-border);
|
|
112
86
|
}
|
|
113
|
-
.login-brand__title {
|
|
114
|
-
margin: 0;
|
|
115
|
-
max-width: 12em;
|
|
116
|
-
font-size: clamp(2rem, 4vw, 3rem);
|
|
117
|
-
font-weight: 650;
|
|
118
|
-
line-height: 1.15;
|
|
119
|
-
letter-spacing: -0.03em;
|
|
120
|
-
}
|
|
121
87
|
```
|
|
122
88
|
|
|
123
|
-
Form side stays calm: one panel ~`22rem`, token `role="alert"` for form-level errors (not Toast, not `<MMessage severity>`).
|
|
124
|
-
|
|
125
89
|
### Express — hero plane
|
|
126
90
|
|
|
127
|
-
Full-bleed thesis: brand mark (small) → one headline → one lead → CTA group → **one** dominant visual (timeline, product artifact, or edge-to-edge wash). Atmosphere:
|
|
128
|
-
|
|
129
91
|
```css
|
|
130
92
|
.landing-hero__visual {
|
|
131
93
|
margin-top: var(--m-space-5);
|
|
132
94
|
padding: var(--m-space-5);
|
|
133
95
|
border: 1px solid var(--m-color-border);
|
|
134
96
|
border-radius: var(--m-radius-md);
|
|
135
|
-
background:
|
|
136
|
-
linear-gradient(
|
|
137
|
-
135deg,
|
|
138
|
-
color-mix(in srgb, var(--m-color-primary) 12%, var(--m-color-surface)),
|
|
139
|
-
var(--m-color-surface) 60%
|
|
140
|
-
);
|
|
97
|
+
background: var(--m-color-surface);
|
|
141
98
|
}
|
|
142
99
|
```
|
|
143
100
|
|
|
144
|
-
|
|
101
|
+
### Flow — empty shell
|
|
145
102
|
|
|
146
|
-
|
|
147
|
-
[data-m-motion="full"] .landing-hero__track span {
|
|
148
|
-
animation: m-craft-fade-up 480ms ease both;
|
|
149
|
-
}
|
|
150
|
-
[data-m-motion="full"] .landing-hero__track span:nth-child(2) { animation-delay: 60ms; }
|
|
151
|
-
[data-m-motion="full"] .landing-hero__track span:nth-child(3) { animation-delay: 120ms; }
|
|
152
|
-
[data-m-motion="full"] .landing-hero__track span:nth-child(4) { animation-delay: 180ms; }
|
|
153
|
-
@keyframes m-craft-fade-up {
|
|
154
|
-
from { opacity: 0; transform: translateY(0.4rem); }
|
|
155
|
-
to { opacity: 1; transform: translateY(0); }
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Flow — empty state shell
|
|
103
|
+
Prefer stock `MEmpty`. Optional light frame:
|
|
160
104
|
|
|
161
105
|
```css
|
|
162
106
|
.empty-state-shell {
|
|
163
|
-
border: 1px dashed
|
|
107
|
+
border: 1px dashed var(--m-color-border);
|
|
164
108
|
border-radius: var(--m-radius-md);
|
|
165
|
-
background:
|
|
166
|
-
|
|
167
|
-
120% 80% at 50% 0%,
|
|
168
|
-
color-mix(in srgb, var(--m-color-primary) 10%, transparent),
|
|
169
|
-
transparent 55%
|
|
170
|
-
),
|
|
171
|
-
var(--m-color-surface);
|
|
109
|
+
background: var(--m-color-surface);
|
|
110
|
+
padding: var(--m-space-6);
|
|
172
111
|
}
|
|
173
112
|
```
|
|
174
113
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
## UX writing
|
|
178
|
-
|
|
179
|
-
- Name controls by user intent (`保存更改`), not system guts (`提交表单实体`).
|
|
180
|
-
- Active voice; same verb through the flow (Publish → Published).
|
|
181
|
-
- Errors: what failed + how to fix; no vague apology.
|
|
182
|
-
- Empty states: invitation to act, not a dead end.
|
|
183
|
-
- Ops copy stays plain; Express may have voice, still specific to the product.
|
|
114
|
+
If the user asked for glass / gradient / dark-tech, implement **that** request with `--m-*` — do not escalate into AI mesh.
|
|
184
115
|
|
|
185
116
|
## Polish modes (Impeccable-inspired)
|
|
186
117
|
|
|
187
|
-
|
|
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 |
|
|
188
123
|
|
|
189
|
-
|
|
124
|
+
## Quality floor
|
|
190
125
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
| `quieter` | Remove competing accents, chips, shadows; keep one focus | `impeccable quieter` |
|
|
196
|
-
| `bolder` | Strengthen the signature / style preset only; do not shout everywhere | `impeccable bolder` |
|
|
197
|
-
| `typeset` | Scale, weight, line-length, truncation | `impeccable typeset` |
|
|
198
|
-
| `adapt` | Responsive breakpoints; touch targets | `impeccable adapt` |
|
|
199
|
-
| `delight` | One tasteful micro-interaction — never clutter | `impeccable delight` / `animate` |
|
|
200
|
-
| `polish` | Final ship pass: Ops polish + style cues + a11y basics | `impeccable polish` |
|
|
201
|
-
|
|
202
|
-
Always remediate with `M*` + tokens, not raw replacement controls. Full routing: [optional-companions.md](optional-companions.md).
|
|
203
|
-
|
|
204
|
-
## Industry / mood (UI-UX-Pro-Max-inspired)
|
|
205
|
-
|
|
206
|
-
For Express briefs that only say “modern / professional / playful”:
|
|
207
|
-
|
|
208
|
-
1. Infer industry from the product (fintech ≠ kids education).
|
|
209
|
-
2. Pick mood keywords (e.g. “editorial + precise”, “warm workshop”, “clinical calm”).
|
|
210
|
-
3. Map mood → [style preset](style-presets.md) and/or token roles and signature — **then** implement with morya-ui.
|
|
211
|
-
4. If `ui-ux-pro-max` is installed, use it for **keyword / palette search only**; discard any suggestion to switch stacks (shadcn, generic Tailwind kit, etc.).
|
|
212
|
-
|
|
213
|
-
## Quality floor (all lanes)
|
|
214
|
-
|
|
215
|
-
- Responsive to a usable mobile layout
|
|
216
|
-
- Visible `:focus-visible`
|
|
217
|
-
- Keyboard reaches primary actions
|
|
218
|
-
- No raw theme colors that break dark mode when the app supports it
|
|
219
|
-
- Icons decorative vs informative handled correctly (`aria-hidden` vs `aria-label`)
|
|
220
|
-
- Craft pass completed for the lane (Ops polish and/or atmosphere / design plan) before delivery
|
|
221
|
-
- If a companion ran: still pass MCP `validate_usage` / `validate_page`
|
|
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
|
|
@@ -5,13 +5,13 @@ alwaysApply: true
|
|
|
5
5
|
|
|
6
6
|
# Morya UI 设计系统
|
|
7
7
|
|
|
8
|
-
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP `recommend_component`(含 recipe
|
|
8
|
+
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP `recommend_component`(含 recipe + `relatedSnippets`),或 skill `references/decision-recipes.md` / `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.
|
|
11
|
+
4. **页面组装(composition-first)**:用 MCP `recommend_page` → `suggestedSnippets` / `get_page_snippet` + `recommend_component` 拼装;`page-layouts` 块顺序作 checklist。`get_golden_page` **可选**(核对整页块顺序或用户明确要求对齐样例时)。**视觉方向**:有明确参考或明确描述 → 必须跟用户;提示词有清晰线索 → 推断并说明;不确定 → 先问(`get_style_direction`)。**没有命名风格预设表。** 禁止未询问就套 AI 默认渐变/霓虹/毛玻璃。已安装 `frontend-design` / `impeccable` 时只加深已定方向,**不得**换组件库或推翻块顺序 / 用户指定。
|
|
12
12
|
5. **表单选项** 用 `MSelect` / `MTreeSelect`;**动作菜单** 用 `MDropdown`。
|
|
13
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
|
|
|
17
|
-
Token / 风格 / companion:MCP `get_design_rules`、`
|
|
17
|
+
Token / 风格 / companion:MCP `get_design_rules`、`get_style_direction`;skill `optional-companions.md`(运行时以 `morya-ui/styles.css` 为准)
|
|
@@ -5,25 +5,25 @@ alwaysApply: false
|
|
|
5
5
|
|
|
6
6
|
# 页面布局(Agent Requested)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
| 类型 |
|
|
11
|
-
| --- | --- |
|
|
12
|
-
| 列表页 | `list-page` |
|
|
13
|
-
| 表单页 | `form-page`(仅长表单 / 独立配置页) |
|
|
14
|
-
| 列表内弹窗表单 | `form-in-dialog` |
|
|
15
|
-
| 详情页 | `detail-page` |
|
|
16
|
-
| 结果 / 阻断页 | `result-page` |
|
|
17
|
-
| 设置页 | `settings-page` |
|
|
18
|
-
| 分步向导 | `wizard-form` |
|
|
19
|
-
| 仪表盘 | `dashboard-page` |
|
|
20
|
-
| 登录页 | `login-page` |
|
|
21
|
-
| 营销落地 | `landing-page` |
|
|
22
|
-
| 空状态 | `empty-state` |
|
|
8
|
+
生成完整页面时,先确定类型,按 **块顺序 checklist** 用 MCP **`get_page_snippet`** / `recommend_page.suggestedSnippets` 拼装(composition-first)。仅在不确定整页顺序或用户要求对齐样例时再读 `get_golden_page`。
|
|
9
|
+
|
|
10
|
+
| 类型 | 主要 snippets | 可选黄金样例 |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| 列表页 | `layout-app-shell` / `page-header-actions` / **`list-filters-stack`**(dense → `list-filters-dense`)/ `list-table` / `form-in-dialog` / `confirm-delete` | `list-page` |
|
|
13
|
+
| 表单页 | `form-header` / `form-body` / `form-actions` | `form-page`(仅长表单 / 独立配置页) |
|
|
14
|
+
| 列表内弹窗表单 | **`form-in-dialog`** | `form-in-dialog` |
|
|
15
|
+
| 详情页 | `detail-toolbar` / `form-in-dialog` | `detail-page` |
|
|
16
|
+
| 结果 / 阻断页 | **`result-block`** | `result-page` |
|
|
17
|
+
| 设置页 | `form-header` / `form-body` / `form-actions` | `settings-page` |
|
|
18
|
+
| 分步向导 | **`wizard-steps`** | `wizard-form` |
|
|
19
|
+
| 仪表盘 | `dashboard-kpi-grid` / `dashboard-chart-card` / `dashboard-recent-table` | `dashboard-page` |
|
|
20
|
+
| 登录页 | **`auth-split-shell`** | `login-page` |
|
|
21
|
+
| 营销落地 | —(见 surfaces) | `landing-page` |
|
|
22
|
+
| 空状态 | **`empty-block`** | `empty-state` |
|
|
23
23
|
|
|
24
24
|
## 列表内新建 / 编辑(默认)
|
|
25
25
|
|
|
26
|
-
后台 CRUD **优先**:列表页 + `MDialog`(或 `MDrawer`)内 `MForm
|
|
26
|
+
后台 CRUD **优先**:列表页 + `MDialog`(或 `MDrawer`)内 `MForm`(snippets `form-in-dialog` / `form-in-drawer`),不要把「新建用户 / 编辑角色」做成单独路由,除非字段很多或多步骤。
|
|
27
27
|
|
|
28
28
|
## 列表页区块顺序
|
|
29
29
|
|
|
@@ -31,13 +31,13 @@ alwaysApply: false
|
|
|
31
31
|
2. 侧栏 `MMenu`
|
|
32
32
|
3. `MLayoutHeader` → `MBreadcrumb`
|
|
33
33
|
4. `MLayoutContent` → `MPageContent`(**仅在下方高度规则适用时**再加 `fill`)
|
|
34
|
-
5. `MPageHeader`(页面标题 + `#actions` 主操作;视口内 **唯一** filled primary
|
|
35
|
-
6. `MPageFilters
|
|
36
|
-
7.
|
|
34
|
+
5. `MPageHeader`(页面标题 + `#actions` 主操作;视口内 **唯一** filled primary)→ `page-header-actions`
|
|
35
|
+
6. `MPageFilters`(默认 **`list-filters-stack`**:折叠高级 + FilterChips;查询/重置 secondary;dense → `list-filters-dense`)
|
|
36
|
+
7. 可选独立 `MPageFilterChips`(若未用 stack)
|
|
37
37
|
8. 可选 `MPageToolbar`(仅批量操作,**不要**页面标题)
|
|
38
38
|
9. `MTable`(直接放置;`#empty` → `MEmpty`)
|
|
39
39
|
10. 分页由 `MTable paginator` 或同级 `MPagination`
|
|
40
|
-
11. 短新建/编辑:同页 `MDialog` + `MForm
|
|
40
|
+
11. 短新建/编辑:同页 `MDialog` + `MForm`;删除:`MConfirmDialog`(`confirm-delete`)
|
|
41
41
|
|
|
42
42
|
### 列表高度 — 先判断,再决定是否 fill
|
|
43
43
|
|
|
@@ -91,7 +91,7 @@ alwaysApply: false
|
|
|
91
91
|
|
|
92
92
|
## MCP
|
|
93
93
|
|
|
94
|
-
- 整页:`recommend_page`(可传 `style`)→ `
|
|
95
|
-
-
|
|
96
|
-
- 局部:`get_page_snippet`(如 `
|
|
94
|
+
- 整页:`recommend_page`(可传 `style`)→ **`suggestedSnippets` / `get_page_snippet`** + `recommend_component` → `get_design_rules` / `get_style_direction`;可选 `get_golden_page` 核对块顺序
|
|
95
|
+
- 风格:有明确参考或明确描述 → 跟用户;有提示词线索 → 推断并说明;不确定 → 先问(无预设表)
|
|
96
|
+
- 局部:`get_page_snippet`(如 `form-in-dialog` / `confirm-delete` / `list-filters` / `wizard-steps`)
|
|
97
97
|
- 可选:`validate_page`(参考建议,不阻断)
|