@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,63 +1,76 @@
|
|
|
1
|
-
# Review checklist
|
|
2
|
-
|
|
3
|
-
## Contract (all lanes)
|
|
4
|
-
|
|
5
|
-
- [ ] Only `morya-ui` UI primitives (no second kit)
|
|
6
|
-
- [ ] `morya-ui/styles.css` imported at app/demo entry
|
|
7
|
-
- [ ] `MConfigProvider` at a sensible root when building a full screen
|
|
8
|
-
- [ ] No invented props / events / slots (MCP `get_component` / docs checked)
|
|
9
|
-
- [ ] MCP **`validate_usage`** run; no unresolved `unknown-prop` / `unknown-event`
|
|
10
|
-
- [ ] Select vs Dropdown roles correct
|
|
11
|
-
- [ ] `MTable` uses `rows` (not `data`)
|
|
12
|
-
- [ ] One-line results use `message`; summary+detail / async use `toast`
|
|
13
|
-
- [ ] Destructive flows use confirm dialogs
|
|
14
|
-
- [ ] MCP **`validate_page`** run when generating a full page (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ]
|
|
21
|
-
- [ ]
|
|
22
|
-
- [ ]
|
|
23
|
-
- [ ]
|
|
24
|
-
- [ ]
|
|
25
|
-
- [ ]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- [ ]
|
|
30
|
-
- [ ]
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- [ ]
|
|
43
|
-
- [ ]
|
|
44
|
-
- [ ]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- [ ]
|
|
49
|
-
- [ ]
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- [ ]
|
|
57
|
-
- [ ]
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
# Review checklist
|
|
2
|
+
|
|
3
|
+
## Contract (all lanes)
|
|
4
|
+
|
|
5
|
+
- [ ] Only `morya-ui` UI primitives (no second kit)
|
|
6
|
+
- [ ] `morya-ui/styles.css` imported at app/demo entry
|
|
7
|
+
- [ ] `MConfigProvider` at a sensible root when building a full screen
|
|
8
|
+
- [ ] No invented props / events / slots (MCP `get_component` / docs checked)
|
|
9
|
+
- [ ] MCP **`validate_usage`** run; no unresolved `unknown-prop` / `unknown-event`
|
|
10
|
+
- [ ] Select vs Dropdown roles correct
|
|
11
|
+
- [ ] `MTable` uses `rows` (not `data`)
|
|
12
|
+
- [ ] One-line results use `message`; summary+detail / async use `toast`
|
|
13
|
+
- [ ] Destructive flows use confirm dialogs
|
|
14
|
+
- [ ] MCP **`validate_page`** run when generating a full page — **`ok` must be true** (contract); craft suggestions addressed or consciously waived
|
|
15
|
+
- [ ] Same **`brief`** as `map_reference` / `recommend_page` passed into `validate_page` when a reference exists
|
|
16
|
+
|
|
17
|
+
## Craft (all lanes — default pass)
|
|
18
|
+
|
|
19
|
+
- [ ] Style direction resolved: followed user reference/description, or inferred from clear cues, or **asked** when uncertain — never silent invent; **no preset catalog**
|
|
20
|
+
- [ ] Reference fidelity: `map_reference` mapping blocks present (filters/table/status/… as required)
|
|
21
|
+
- [ ] Signature shell from `get_style_shells` when Account / Express / Flow need presence
|
|
22
|
+
- [ ] Lane craft from [visual-craft.md](visual-craft.md) applied
|
|
23
|
+
- [ ] If companions ran: still only `M*` + `--m-*`; no second kit ([optional-companions.md](optional-companions.md))
|
|
24
|
+
- [ ] At most one primary filled button in the main viewport
|
|
25
|
+
- [ ] Copy is domain-real; empty / error states say what to do next
|
|
26
|
+
- [ ] Numeric table columns use `align: 'end'` + tabular nums when amounts/counts are shown
|
|
27
|
+
- [ ] No AI-default look clusters unless the user/reference asked for them
|
|
28
|
+
- [ ] No unearned atmosphere: stacked radial+linear washes, purple mesh, frosted glass, neon glow stacks
|
|
29
|
+
- [ ] Motion (if any) is 1–3 intentional moments and follows `useMotion` / `data-m-motion`
|
|
30
|
+
- [ ] Brand differences via theme `--m-*` overrides, not page hex
|
|
31
|
+
|
|
32
|
+
## Screenshot self-check (optional — when user gave a visual reference)
|
|
33
|
+
|
|
34
|
+
1. Start the consumer app locally (Vite / Nuxt preview).
|
|
35
|
+
2. Open the generated route; capture the first viewport.
|
|
36
|
+
3. Compare to the reference: block order, primary CTA, density, status treatment — not pixel-perfect chrome.
|
|
37
|
+
4. If blocks are missing, fix via snippets + re-run `validate_page({ brief })`.
|
|
38
|
+
|
|
39
|
+
If Playwright / `webapp-testing` is available in the project, prefer an automated screenshot; otherwise a manual capture is enough.
|
|
40
|
+
## Ops
|
|
41
|
+
|
|
42
|
+
- [ ] Matches [page-layouts.md](page-layouts.md) block order (snippets composed; golden page optional check only)
|
|
43
|
+
- [ ] `MPage*` used instead of ad-hoc page chrome where applicable
|
|
44
|
+
- [ ] List height: if this is a full-viewport main data list, consider `MPageContent fill` + `MTable fill`; if embedded/short/document-scroll, skip `fill`
|
|
45
|
+
- [ ] Tables not wrapped in decorative `MCard` solely for borders
|
|
46
|
+
- [ ] Filters / toolbar / form actions follow documented patterns
|
|
47
|
+
- [ ] Sider `MMenu` items have icons; status cells use `MStatus` (not decorative `MTag`)
|
|
48
|
+
- [ ] Empty table uses `MEmpty` (or equivalent next-action empty)
|
|
49
|
+
- [ ] No marketing hero bolted onto a CRUD shell
|
|
50
|
+
|
|
51
|
+
## Account / Flow / System
|
|
52
|
+
|
|
53
|
+
- [ ] Primary CTA obvious; escape paths present (back / home / support)
|
|
54
|
+
- [ ] Auth errors stay on the form via field `errorMessage` or a token `role="alert"`
|
|
55
|
+
- [ ] Empty uses `MEmpty`; success / HTTP errors use `MResult`
|
|
56
|
+
- [ ] Brand / empty atmosphere follows the **resolved direction** (defaults are flat token shells)
|
|
57
|
+
- [ ] Wizard steps: one job each; actions labeled clearly
|
|
58
|
+
|
|
59
|
+
## Express
|
|
60
|
+
|
|
61
|
+
- [ ] Short design plan existed (subject, palette roles, signature)
|
|
62
|
+
- [ ] First viewport has one job
|
|
63
|
+
- [ ] Controls still `M*`; colors/spacing map to `--m-*`
|
|
64
|
+
- [ ] Avoided AI-default looks unless user/reference requested them
|
|
65
|
+
- [ ] Motion limited and gated by `useMotion` / `data-m-motion`
|
|
66
|
+
|
|
67
|
+
## Tokens, a11y, responsive
|
|
68
|
+
|
|
69
|
+
- [ ] No raw hex/rgb theme colors in new CSS (control widths OK inline; `color-mix` from `--m-*` OK)
|
|
70
|
+
- [ ] Labels visible; icon buttons have `aria-label`
|
|
71
|
+
- [ ] Usable on a narrow viewport
|
|
72
|
+
- [ ] Focus visible on interactive elements
|
|
73
|
+
|
|
74
|
+
When MCP is available, contract checks (**`validate_usage`** / **`validate_page`**) are required.
|
|
75
|
+
|
|
76
|
+
If the project has `pnpm check:colors`, suggest running it after edits.
|
|
@@ -1,45 +1,68 @@
|
|
|
1
|
-
# Style direction (no preset catalog)
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
## Resolution order (required)
|
|
6
|
-
|
|
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.
|
|
10
|
-
|
|
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.
|
|
14
|
-
|
|
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.
|
|
18
|
-
|
|
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.
|
|
22
|
-
|
|
23
|
-
MCP: `get_style_direction` / `recommend_page({ style? })` → `styleDirection`.
|
|
24
|
-
`
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
# Style direction (no preset catalog)
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
## Resolution order (required)
|
|
6
|
+
|
|
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.
|
|
10
|
+
|
|
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.
|
|
14
|
+
|
|
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.
|
|
18
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
MCP: `get_style_direction` / `recommend_page({ style?, density?, brief? })` → `styleDirection` + optional `referenceMapping`.
|
|
24
|
+
`map_reference` turns a reference description / required blocks into snippet + shell mapping.
|
|
25
|
+
`resolution: "ask"` means **ask the user**, not free-style.
|
|
26
|
+
|
|
27
|
+
## Density (explicit)
|
|
28
|
+
|
|
29
|
+
Pass `density` to `recommend_page` / `map_reference` — do not rely only on regex in the intent string:
|
|
30
|
+
|
|
31
|
+
| Value | Effect |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `compact` | Prefer `list-filters-dense` / `list-page-dense` cues |
|
|
34
|
+
| `default` | Standard Ops polish |
|
|
35
|
+
| `spacious` | More section gap; avoid packing |
|
|
36
|
+
|
|
37
|
+
## What `style` means
|
|
38
|
+
|
|
39
|
+
- Free-text from the user (or a short paraphrase of their reference).
|
|
40
|
+
- **Not** a preset id.
|
|
41
|
+
- Optional craft cues for list goldens only: words like `dense` / `compact` / `高密` → `list-page-dense`; `rail` / `品牌侧栏` → `list-page-rail`.
|
|
42
|
+
|
|
43
|
+
## Reference brief (fidelity)
|
|
44
|
+
|
|
45
|
+
When the user provides a screenshot / mock / “像 XX”, call **`map_reference`** (or pass `brief` into `recommend_page`) with:
|
|
46
|
+
|
|
47
|
+
- `description` — what you see (layout, density, primary CTA)
|
|
48
|
+
- `requiredBlocks` — e.g. `filters`, `table`, `status`, `kpi`, `auth`
|
|
49
|
+
- `requiredComponents` — e.g. `Table`, `Status`
|
|
50
|
+
- `density` / `primaryAction` when visible
|
|
51
|
+
|
|
52
|
+
Then compose **only** via returned `mapping[].snippetId`. Pass the **same brief** to `validate_page` so missing blocks fail as contract issues.
|
|
53
|
+
|
|
54
|
+
## Anti-defaults (unless user/reference asks)
|
|
55
|
+
|
|
56
|
+
- Purple→indigo / aurora / mesh washes
|
|
57
|
+
- Warm cream + serif + terracotta kit
|
|
58
|
+
- Broadsheet newspaper columns
|
|
59
|
+
- Unsolicited glassmorphism, neon glow stacks, neumorph on dense tables
|
|
60
|
+
- Companion “atmosphere” that overrides the user’s words
|
|
61
|
+
|
|
62
|
+
## How to apply
|
|
63
|
+
|
|
64
|
+
1. Map reference → snippets (`map_reference` / `recommend_page.referenceMapping`).
|
|
65
|
+
2. Apply a signature shell when Account / Express / Flow need presence (`get_style_shells`).
|
|
66
|
+
3. Brand color via theme `--m-color-primary` (DESIGN.md § 主题覆盖), not page hex.
|
|
67
|
+
4. Run Ops polish when on Operate surfaces.
|
|
68
|
+
5. Companions deepen **inside** the resolved direction only ([optional-companions.md](optional-companions.md)).
|
|
@@ -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
|