@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.
@@ -15,17 +15,18 @@
15
15
 
16
16
  ## Craft (all lanes — default pass)
17
17
 
18
- - [ ] Style direction resolved (reference / named preset / inferred / offered) — not silent `quiet` every time
19
- - [ ] Lane craft from [visual-craft.md](visual-craft.md) + [style-presets.md](style-presets.md) applied
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 brief asked for them
24
- - [ ] Motion (if any) is 1–3 intentional moments and follows `useMotion` / `data-m-motion` (not OS `prefers-reduced-motion`)
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 golden / [page-layouts.md](page-layouts.md) block order
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"` (`<MMessage>` is the message host, not an inline alert)
41
- - [ ] Empty uses `MEmpty` (or table `#empty` with `MEmpty`); success / HTTP errors use `MResult`
42
- - [ ] Empty / success states tell the user the next action
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 (not a dashboard of promos)
51
- - [ ] Controls still `M*`; colors/spacing map to `--m-*` / theme
52
- - [ ] Avoided AI-default looks unless brief requested them ([visual-craft.md](visual-craft.md))
53
- - [ ] Motion limited and respectful of reduced-motion
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 above (**`validate_usage`** / **`validate_page`**) are required — not optional.
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 & presets
1
+ # Style direction (no preset catalog)
2
2
 
3
- Golden pages lock **block order and APIs**. They are **not** the only allowed look. Pick a visual direction **before** coding so generated pages stop looking identical and stiff.
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. **Reference first** — user supplied a screenshot, mock, existing page, URL, or “像 XX / like X”.
8
- - Extract: density, hierarchy, surfaces (flat vs filled), accent placement, copy tone.
9
- - Remap onto `--m-*` + `M*` only. Do **not** switch UI kits or copy hex themes.
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
- MCP: `list_style_presets` / `get_style_preset` / `recommend_page({ style })` → `styleDirection`.
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
- ## Presets (user-selectable)
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
- | Id | 中文 | Best for | Distinct craft | List golden |
19
- | --- | --- | --- | --- | --- |
20
- | `quiet` | 克制经典 | Serious enterprise admin | Flat chrome, golden-like Ops polish | `list-page` |
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
- Full apply/avoid lists: MCP `get_style_preset` or `@morya-ui/mcp` `style-presets`. `recommend_page({ style })` routes list scaffolds to the matching golden when a craft variant exists.
23
+ MCP: `get_style_direction` / `recommend_page({ style? })` → `styleDirection`.
24
+ `resolution: "ask"` means **ask the user**, not free-style.
28
25
 
29
- ### Domain heuristics (when user says “直接写”)
26
+ ## What `style` means
30
27
 
31
- | Cue in brief | Prefer |
32
- | --- | --- |
33
- | 金融 / 合规 / 政务 | `quiet` or `ink` |
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
- ## How to apply on Ops pages
32
+ ## Anti-defaults (unless user/reference asks)
41
33
 
42
- 1. Mirror golden **structure** via `recommend_page` / `get_golden_page` (list: `list-page` / `list-page-dense` / `list-page-rail` by style).
43
- 2. Apply the chosen preset’s density / filter surface / header copy / chrome wash (or follow the craft golden when one exists).
44
- 3. Still run [visual-craft.md](visual-craft.md) § Ops polish (one primary, menu icons, `MStatus`, designed empty).
45
- 4. Fill height remains **conditional** — see [page-layouts.md](page-layouts.md) § List height.
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
- ## Reference style checklist
40
+ ## How to apply
48
41
 
49
- When following a reference:
50
-
51
- - [ ] Hierarchy (what is loud vs quiet) matched with type/space, not random cards
52
- - [ ] Density matched (`compact` / default / `spacious`)
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-on-white / cream-terracotta / broadsheet defaults when the brief did not ask for them.
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 + pick a non-quiet preset (`soft`/`studio`) or ask once |
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
- - Styles: `list_style_presets` / `get_style_preset`
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 to be installed. Implementation must still honor the morya-ui contract.
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 § Atmosphere recipes when relevant |
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
- Do **not** skip craft because the page is “just admin”. Polished Ops is quiet, aligned, and specific — not decorative.
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
- Use these even when companions are **not** installed. If they **are** installed, run the matching companion pass **after** structure + contract, then remediate with `M*` + `--m-*`.
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 a concrete **subject**, **audience**, and **single job** before visual choices.
26
- - Pull personality from the subject’s world (materials, artifacts, vernacular) — not from a generic “SaaS admin” mood board.
27
- - **One signature risk** per surface; everything else quieter (Chanel: remove one accessory).
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, tools | Clarity, density, style preset; no marketing hero |
34
- | **Persuade** | Landing, pricing, campaign | Design plan + signature; controls still `M*` |
35
- | **Read** | Docs / long detail | Typeset + measure; calm chrome |
36
- | **Experience** | Gallery / showcase | Artifact leads; UI recedes |
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
- Critique the plan: if it looks like the plan you would write for *any* SaaS, revise until it fits **this** subject. Brief / reference / named style preset **wins** over companion defaults.
35
+ ### Design plan (Express & branded Account)
48
36
 
49
- ## Ops polish (baseline — every Operate / Ops page)
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
- Apply after the golden block order is correct **and** a style direction is resolved. These are **required** baseline rules; presets may change density/chrome on top:
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
- 1. **One primary** — exactly one filled `severity="primary"` in the main viewport (usually toolbar create / form save). Query can be primary; reset stays secondary.
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
- Ops beauty = **alignment + semantics + restraint**, not gradients.
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
- ## Anti-default looks (AI clusters)
57
+ Ops beauty = alignment + semantics + restraint, **not** gradients.
67
58
 
68
- Avoid spending free axes on these unless the brief asks:
59
+ ## Anti-default looks
69
60
 
70
- 1. Warm cream (~`#F4F1EA`) + high-contrast serif + terracotta
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
- Also avoid: Inter/Roboto/Arial as the *expressive* display choice on Express surfaces when the brief allows character (utility UI may keep system/theme fonts).
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
- ## Hierarchy & composition
71
+ **Token gradients are not a free pass** — only when the user/reference asks.
79
72
 
80
- - **Hero is a thesis** (Express): one job in the first viewport — not stats + schedule + promos together.
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
- Optional micro-motion (one signature only):
101
+ ### Flow — empty shell
145
102
 
146
- ```css
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 color-mix(in srgb, var(--m-color-border) 80%, var(--m-color-primary));
107
+ border: 1px dashed var(--m-color-border);
164
108
  border-radius: var(--m-radius-md);
165
- background:
166
- radial-gradient(
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
- Pair with `MEmpty` + primary next step + optional secondary text button. One memory cue (icon / wash) — no emoji collage.
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
- **Default:** after compose, run a lane-appropriate light pass (§ Ops polish and/or atmosphere / design plan).
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
- When the user asks to improve an existing surface — or when `impeccable` is installed — pick a named mode:
124
+ ## Quality floor
190
125
 
191
- | Mode | Intent | Companion command (if installed) |
192
- | --- | --- | --- |
193
- | `audit` | Hierarchy, contrast, a11y, spacing, anti-patterns — report then fix | `impeccable audit` / `critique` |
194
- | `clarify` | Labels, errors, empty copy, button verbs | `impeccable clarify` |
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),或 skill `references/decision-recipes.md` / `component-index.md`。
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. **页面结构** 用 MCP `get_golden_page` 对齐区块顺序与 API;**视觉方向**按参考样式 / 用户指定风格 / 提示词推断(`list_style_presets`:quiet、soft、dense、rail、studio、ink)。已安装 `frontend-design` / `impeccable` 时只加深审美与抛光,**不得**换组件库或推翻黄金结构。
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`、`list_style_presets`;skill `optional-companions.md`(运行时以 `morya-ui/styles.css` 为准)
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
- | 类型 | MCP `get_golden_page` |
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`(可选 `variant="filled"`、`collapsible` + `#advanced`;查询/重置用 secondary)
36
- 7. 可选 `MPageFilterChips` + 可关闭 `MTag`(有已选条件时,放在筛选与表格之间)
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`)→ `get_golden_page` → `get_design_rules` / `list_style_presets`
95
- - 风格:有参考则跟参考;否则按 `styleDirection` 或请用户从 quiet/soft/dense/rail/studio/ink 选
96
- - 局部:`get_page_snippet`(如 `filters` / `toolbar` / `form-actions` / `scrollable-panel`)
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`(参考建议,不阻断)