@morya-ui/setup 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +103 -103
  2. package/bin/morya-ui-setup.js +14 -14
  3. package/catalog/skills.json +46 -46
  4. package/package.json +5 -3
  5. package/src/cli.mjs +335 -335
  6. package/src/copy-template.mjs +78 -78
  7. package/src/fs-utils.mjs +24 -24
  8. package/src/install.mjs +63 -63
  9. package/src/mcp.mjs +50 -50
  10. package/src/package-json.mjs +30 -30
  11. package/src/skills.mjs +223 -223
  12. package/src/styles.mjs +119 -119
  13. package/template/.agents/skills/morya-ui-pages/SKILL.md +184 -164
  14. package/template/.agents/skills/morya-ui-pages/evals/evals.json +89 -89
  15. package/template/.agents/skills/morya-ui-pages/references/component-index.md +99 -99
  16. package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +32 -0
  17. package/template/.agents/skills/morya-ui-pages/references/design-system.md +101 -100
  18. package/template/.agents/skills/morya-ui-pages/references/feedback.md +68 -68
  19. package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +107 -34
  20. package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +141 -119
  21. package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +64 -61
  22. package/template/.agents/skills/morya-ui-pages/references/style-presets.md +73 -0
  23. package/template/.agents/skills/morya-ui-pages/references/surfaces.md +91 -89
  24. package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +221 -196
  25. package/template/.cursor/rules/coding-style.mdc +41 -41
  26. package/template/.cursor/rules/component-usage.mdc +41 -41
  27. package/template/.cursor/rules/design-system.mdc +17 -17
  28. package/template/.cursor/rules/page-layout.mdc +97 -78
  29. package/template/DESIGN.md +59 -59
  30. package/template/scripts/check-raw-colors.mjs +74 -74
  31. package/LICENSE +0 -21
@@ -1,119 +1,141 @@
1
- # Page layouts
2
-
3
- When generating a full page, pick a type and **mirror the golden-page block order**. Source: MCP `get_golden_page`.
4
-
5
- | Type | `get_golden_page` id |
6
- | --- | --- |
7
- | List | `list-page` |
8
- | Form (long / dedicated) | `form-page` |
9
- | List create/edit dialog | `form-in-dialog` |
10
- | Detail | `detail-page` |
11
- | Dashboard | `dashboard-page` |
12
- | Login | `login-page` |
13
- | Landing | `landing-page` |
14
- | Empty | `empty-state` |
15
- | Result / 403 / terminal | `result-page` |
16
- | Settings | `settings-page` |
17
- | Wizard | `wizard-form` |
18
-
19
- Via MCP: `recommend_page` → `get_golden_page`; local edits: `get_page_snippet` (`filters`, `toolbar`, `form-actions`, `scrollable-panel`, …).
20
-
21
- ## Product defaults
22
-
23
- - **Short create/edit** (about ≤8 fields, single section): same-page `MDialog` + `MForm` — do not invent a new route form for every entity.
24
- - **Long / multi-section / wizard**: dedicated form page (`form-page`) or `MDrawer`.
25
- - **One-line success/error**: `message` API; title + detail or async notify → `toast` (see [feedback.md](feedback.md)).
26
-
27
- ## List page — block order
28
-
29
- 1. `MLayout fillViewport` + optional `MLayoutSider bordered`
30
- 2. Sider `MMenu` (**every item has `icon`**)
31
- 3. `MLayoutHeader` → `MBreadcrumb`
32
- 4. `MLayoutContent` → `MPageContent`
33
- 5. `MPageHeader` — page title + `#actions` primary (**one** filled primary in viewport)
34
- 6. `MPageFilters` — `variant="filled"` optional; inner `MSpace wrap` + Input/Select + query/reset (query/reset → secondary); optional `collapsible` + `#advanced` for secondary fields
35
- 7. Optional `MPageFilterChips` + closable `MTag` when filters are applied (after filters, before table)
36
- 8. Optional `MPageToolbar` — batch actions only (no page title)
37
- 9. `MTable` directly in content (usually **no** wrapping `MCard`); status → `MStatus`; `#empty` → `MEmpty`
38
- 10. Pagination via `MTable` paginator or sibling `MPagination`
39
- 11. Short create/edit → `MDialog` + `MForm` on the same page (default)
40
-
41
- Craft: [visual-craft.md](visual-craft.md) § Ops polish.
42
-
43
- ## Form page — block order
44
-
45
- 1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
46
- 2. `MPageContent width="narrow"`
47
- 3. `MPageHeader` (title + description)
48
- 4. `MPageSection variant="form"` → `MForm`
49
- 5. `MPageSection variant="actions"` — save (`primary`) + cancel (`secondary`)
50
-
51
- ## Dashboard — block order
52
-
53
- 1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
54
- 2. `MPageContent density="spacious"` → `MPageHeader` (title + short domain description when useful)
55
- 3. KPI row: `MGrid` + `MPageStat` (4 columns or responsive) — real metric names, not “Metric 1”
56
- 4. Main split: `MCard shadow="always"` + `MEmpty` (chart pending) and/or recent `MTable` (row status → `MStatus`)
57
-
58
- Craft: spacious density + Ops polish; do not turn the first viewport into a marketing hero.
59
-
60
- ## Composition standards
61
-
62
- | Topic | Prefer | Usually avoid |
63
- | --- | --- | --- |
64
- | Shell | `MLayout fillViewport` + `MPageContent` | Padding on `MLayoutContent` |
65
- | Sections | `MPageFilters` / `MPageToolbar` / `MPageSection` | Custom `.page-*`; extra `MCard` wrappers |
66
- | List table | `MTable` in `MPageContent` | Border card solely to wrap the table |
67
- | Spacing | `MSpace` / `MFlex` for peers; page gap from `MPageContent` | Nested padded divs stacking gaps |
68
- | Scroll | Rely on layout scroll; explicit `MScrollbar` for local panes | Forcing overflow on every content slot |
69
- | Color | `--m-*` | Page-level hex / rgb |
70
- | Feedback | One-line → `message`; danger → confirm dialog | Toast for a single short string |
71
- | A11y | Labels + icon `aria-label` | Unlabeled icon controls |
72
-
73
- Inline style is acceptable for control widths (e.g. filter `width: 14rem`).
74
-
75
- ## Detail page — block order
76
-
77
- 1. Same admin chrome as list (breadcrumb → `MPageContent`)
78
- 2. `MPageHeader` — title, `MStatus` in `#actions` (or chip `MTag` for categories), primary/secondary/danger actions
79
- 3. Summary `MPageSection` + property `MCard` (definition grid with `--m-*` only)
80
- 4. Related data: `MCard` + `MTable` / tabs / timeline
81
- 5. Short edit → same-page `MDialog` (`form-in-dialog`); long edit → `form-page` / `MDrawer`
82
-
83
- Mirror MCP `get_golden_page` `detail-page`.
84
-
85
- ## List create/edit dialog — block order
86
-
87
- 1. Stay on the list page (`MPageHeader` + filters/table; optional batch `MPageToolbar`)
88
- 2. `MDialog` ~`28–36rem` + `MForm` fields
89
- 3. Actions in Dialog `#footer` (cancel secondary/text + save primary)
90
- 4. Success → `message.success` one-liner, then close
91
-
92
- Mirror MCP `get_golden_page` `form-in-dialog`.
93
-
94
- ## Settings page — block order
95
-
96
- 1. Admin chrome + `MPageContent width="narrow"`
97
- 2. `MPageHeader` (title + short description)
98
- 3. `MTabs` with **`v-model` + `:tabs`** (not `:items` / `:value`)
99
- 4. Per tab: `MPageSection variant="form"` + `MForm` + save in `variant="actions"`
100
- 5. Dangerous zone last: `severity="danger"` + confirm
101
-
102
- Mirror MCP `get_golden_page` `settings-page`.
103
-
104
- ## Wizard — block order
105
-
106
- 1. Narrow `MPageContent` + `MPageHeader`
107
- 2. `MStepper v-model` + **`:steps`** (not `:items`)
108
- 3. One form/job per step; sticky `上一步` / `下一步` / `创建`
109
- 4. Success → `result-page` / `MResult`
110
-
111
- Mirror MCP `get_golden_page` `wizard-form`.
112
-
113
- ## Hybrids
114
-
115
- - List + row edit dialog → `form-in-dialog` golden (or list golden + dialog body).
116
- - List + side detail → list + `MDrawer`.
117
- - Resource detail → `detail-page` golden.
118
- - Settings without admin chrome → still use `MPageContent` + `MPageSection`; omit sider only if the host app already provides chrome.
119
- - Non-Ops surfaces (auth, landing, empty, wizard) → [surfaces.md](surfaces.md), not these golden orders.
1
+ # Page layouts
2
+
3
+ When generating a full page, pick a type and **mirror the golden-page block order**. Source: MCP `get_golden_page`.
4
+
5
+ | Type | `get_golden_page` id |
6
+ | --- | --- |
7
+ | List (structure · soft) | `list-page` |
8
+ | List · dense craft | `list-page-dense` |
9
+ | List · rail craft | `list-page-rail` |
10
+ | Form (long / dedicated) | `form-page` |
11
+ | List create/edit dialog | `form-in-dialog` |
12
+ | Detail | `detail-page` |
13
+ | Dashboard | `dashboard-page` |
14
+ | Login | `login-page` |
15
+ | Landing | `landing-page` |
16
+ | Empty | `empty-state` |
17
+ | Result / 403 / terminal | `result-page` |
18
+ | Settings | `settings-page` |
19
+ | Wizard | `wizard-form` |
20
+
21
+ Via MCP: `recommend_page({ style? })` → resolves list craft (`dense`→`list-page-dense`, `rail`→`list-page-rail`, else `list-page`) → `get_golden_page`; then apply `styleDirection` (or a user reference). Local edits: `get_page_snippet` (`filters`, `toolbar`, `form-actions`, `scrollable-panel`, …). Styles: `list_style_presets` / `get_style_preset`.
22
+
23
+ **List craft variants** share the same block order; only density / chrome / copy change. Prefer `recommend_page` style routing over hand-picking unless the user named a variant id.
24
+
25
+ ## Product defaults
26
+
27
+ - **Short create/edit** (about ≤8 fields, single section): same-page `MDialog` + `MForm` — do not invent a new route form for every entity.
28
+ - **Long / multi-section / wizard**: dedicated form page (`form-page`) or `MDrawer`.
29
+ - **One-line success/error**: `message` API; title + detail or async notify → `toast` (see [feedback.md](feedback.md)).
30
+
31
+ ## List page — block order
32
+
33
+ 1. `MLayout fillViewport` + optional `MLayoutSider bordered`
34
+ 2. Sider `MMenu` (**every item has `icon`**)
35
+ 3. `MLayoutHeader` → `MBreadcrumb`
36
+ 4. `MLayoutContent` → `MPageContent` (**add `fill` only when the height rule below applies**)
37
+ 5. `MPageHeader` — page title + `#actions` primary (**one** filled primary in viewport)
38
+ 6. `MPageFilters` — `variant="filled"` optional; inner `MSpace wrap` + Input/Select + query/reset (query/reset → secondary); optional `collapsible` + `#advanced` for secondary fields
39
+ 7. Optional `MPageFilterChips` + closable `MTag` when filters are applied (after filters, before table)
40
+ 8. Optional `MPageToolbar` — batch actions only (no page title)
41
+ 9. `MTable` directly in content (usually **no** wrapping `MCard`); status → `MStatus`; `#empty` → `MEmpty`
42
+ 10. Pagination via `MTable paginator` or sibling `MPagination`
43
+ 11. Short create/edit → `MDialog` + `MForm` on the same page (default)
44
+
45
+ ### List height — decide, don’t always fill
46
+
47
+ Use **`MPageContent fill` + `MTable fill paginator`** only when **most** of these are true:
48
+
49
+ - The screen is a **full-viewport admin list** (`MLayout fillViewport`) whose **main job** is browsing one data table
50
+ - Leaving the table content-sized would leave a large empty band with pagination floating mid-page
51
+ - You want **table-body scroll** and pagination pinned to the **bottom of the page**
52
+
53
+ Skip `fill` when any of these apply:
54
+
55
+ - Embedded / secondary tables (dashboard “recent”, detail related lists, cards)
56
+ - Short or sparse pages where a content-sized table looks fine
57
+ - The page should **scroll as a whole document** (long filters + notes + table)
58
+ - Tables inside `MDialog` / `MDrawer`
59
+ - Mixed layouts where the table is not the sole middle region
60
+
61
+ Do not invent `min-height` / `calc` hacks when `fill` is the right tool — and do not force `fill` when it isn’t.
62
+
63
+ Craft: [visual-craft.md](visual-craft.md) § Ops polish.
64
+
65
+ ## Form page — block order
66
+
67
+ 1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
68
+ 2. `MPageContent width="narrow"`
69
+ 3. `MPageHeader` (title + description)
70
+ 4. `MPageSection variant="form"` → `MForm`
71
+ 5. `MPageSection variant="actions"` — save (`primary`) + cancel (`secondary`)
72
+
73
+ ## Dashboard — block order
74
+
75
+ 1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
76
+ 2. `MPageContent density="spacious"` → `MPageHeader` (title + short domain description when useful)
77
+ 3. KPI row: `MGrid` + `MPageStat` (4 columns or responsive) — real metric names, not “Metric 1”
78
+ 4. Main split: `MCard shadow="always"` + `MEmpty` (chart pending) and/or recent `MTable` (row status → `MStatus`)
79
+
80
+ Craft: spacious density + Ops polish; do not turn the first viewport into a marketing hero.
81
+
82
+ ## Composition standards
83
+
84
+ | Topic | Prefer | Usually avoid |
85
+ | --- | --- | --- |
86
+ | Shell | `MLayout fillViewport` + `MPageContent` | Padding on `MLayoutContent` |
87
+ | Sections | `MPageFilters` / `MPageToolbar` / `MPageSection` | Custom `.page-*`; extra `MCard` wrappers |
88
+ | List table | `MTable` in `MPageContent`; add `fill` only when the height rule applies | Border card solely to wrap the table; forcing `fill` on every table |
89
+ | Spacing | `MSpace` / `MFlex` for peers; page gap from `MPageContent` | Nested padded divs stacking gaps |
90
+ | Scroll | Full-viewport main lists may use table-body scroll via `fill`; otherwise layout / local `MScrollbar` | Forcing overflow on every content slot; stacked page + table scrollbars without reason |
91
+ | Color | `--m-*` | Page-level hex / rgb |
92
+ | Feedback | One-line → `message`; danger → confirm dialog | Toast for a single short string |
93
+ | A11y | Labels + icon `aria-label` | Unlabeled icon controls |
94
+
95
+ Inline style is acceptable for control widths (e.g. filter `width: 14rem`).
96
+
97
+ ## Detail page — block order
98
+
99
+ 1. Same admin chrome as list (breadcrumb → `MPageContent`)
100
+ 2. `MPageHeader` — title, `MStatus` in `#actions` (or chip `MTag` for categories), primary/secondary/danger actions
101
+ 3. Summary `MPageSection` + property `MCard` (definition grid with `--m-*` only)
102
+ 4. Related data: `MCard` + `MTable` / tabs / timeline
103
+ 5. Short edit → same-page `MDialog` (`form-in-dialog`); long edit → `form-page` / `MDrawer`
104
+
105
+ Mirror MCP `get_golden_page` `detail-page`.
106
+
107
+ ## List create/edit dialog — block order
108
+
109
+ 1. Stay on the list page (`MPageHeader` + filters/table; optional batch `MPageToolbar`)
110
+ 2. `MDialog` ~`28–36rem` + `MForm` fields
111
+ 3. Actions in Dialog `#footer` (cancel secondary/text + save primary)
112
+ 4. Success → `message.success` one-liner, then close
113
+
114
+ Mirror MCP `get_golden_page` `form-in-dialog`.
115
+
116
+ ## Settings page — block order
117
+
118
+ 1. Admin chrome + `MPageContent width="narrow"`
119
+ 2. `MPageHeader` (title + short description)
120
+ 3. `MTabs` with **`v-model` + `:tabs`** (not `:items` / `:value`)
121
+ 4. Per tab: `MPageSection variant="form"` + `MForm` + save in `variant="actions"`
122
+ 5. Dangerous zone last: `severity="danger"` + confirm
123
+
124
+ Mirror MCP `get_golden_page` `settings-page`.
125
+
126
+ ## Wizard — block order
127
+
128
+ 1. Narrow `MPageContent` + `MPageHeader`
129
+ 2. `MStepper v-model` + **`:steps`** (not `:items`)
130
+ 3. One form/job per step; sticky `上一步` / `下一步` / `创建`
131
+ 4. Success → `result-page` / `MResult`
132
+
133
+ Mirror MCP `get_golden_page` `wizard-form`.
134
+
135
+ ## Hybrids
136
+
137
+ - List + row edit dialog → `form-in-dialog` golden (or list golden + dialog body).
138
+ - List + side detail → list + `MDrawer`.
139
+ - Resource detail → `detail-page` golden.
140
+ - Settings without admin chrome → still use `MPageContent` + `MPageSection`; omit sider only if the host app already provides chrome.
141
+ - Non-Ops surfaces (auth, landing, empty, wizard) → [surfaces.md](surfaces.md), not these golden orders.
@@ -1,61 +1,64 @@
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 (advisory suggestions addressed or consciously waived)
15
-
16
- ## Craft (all lanes — default pass)
17
-
18
- - [ ] Lane craft from [visual-craft.md](visual-craft.md) applied (Ops polish and/or atmosphere)
19
- - [ ] At most one primary filled button in the main viewport
20
- - [ ] Copy is domain-real; empty / error states say what to do next
21
- - [ ] No AI-default look clusters unless the brief asked for them
22
- - [ ] Motion (if any) is 1–3 intentional moments and follows `useMotion` / `data-m-motion` (not OS `prefers-reduced-motion`)
23
-
24
- ## Ops
25
-
26
- - [ ] Matches golden / [page-layouts.md](page-layouts.md) block order
27
- - [ ] `MPage*` used instead of ad-hoc page chrome where applicable
28
- - [ ] Tables not wrapped in decorative `MCard` solely for borders
29
- - [ ] Filters / toolbar / form actions follow documented patterns
30
- - [ ] Sider `MMenu` items have icons; status cells use `MStatus` (not decorative `MTag`)
31
- - [ ] Empty table uses `MEmpty` (or equivalent next-action empty)
32
- - [ ] No marketing hero bolted onto a CRUD shell
33
-
34
- ## Account / Flow / System
35
-
36
- - [ ] Primary CTA obvious; escape paths present (back / home / support)
37
- - [ ] Auth errors stay on the form via field `errorMessage` or a token `role="alert"` (`<MMessage>` is the message host, not an inline alert)
38
- - [ ] Empty uses `MEmpty` (or table `#empty` with `MEmpty`); success / HTTP errors use `MResult`
39
- - [ ] Empty / success states tell the user the next action
40
- - [ ] Inline status prefers `MStatus`; chip-like labels use `MTag`
41
- - [ ] Wizard steps: one job each; actions labeled clearly
42
- - [ ] Brand / empty atmosphere uses token-only CSS (see visual-craft recipes)
43
-
44
- ## Express
45
-
46
- - [ ] Short design plan existed (subject, palette roles, signature)
47
- - [ ] First viewport has one job (not a dashboard of promos)
48
- - [ ] Controls still `M*`; colors/spacing map to `--m-*` / theme
49
- - [ ] Avoided AI-default looks unless brief requested them ([visual-craft.md](visual-craft.md))
50
- - [ ] Motion limited and respectful of reduced-motion
51
-
52
- ## Tokens, a11y, responsive
53
-
54
- - [ ] No raw hex/rgb theme colors in new CSS (control widths OK inline; `color-mix` from `--m-*` OK)
55
- - [ ] Labels visible; icon buttons have `aria-label`
56
- - [ ] Usable on a narrow viewport
57
- - [ ] Focus visible on interactive elements
58
-
59
- When MCP is available, contract checks above (**`validate_usage`** / **`validate_page`**) are required — not optional.
60
-
61
- If the project has `pnpm check:colors`, suggest running it after edits.
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 (advisory suggestions addressed or consciously waived)
15
+
16
+ ## Craft (all lanes — default pass)
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
20
+ - [ ] If companions ran: still only `M*` + `--m-*`; no second kit ([optional-companions.md](optional-companions.md))
21
+ - [ ] At most one primary filled button in the main viewport
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`)
25
+
26
+ ## Ops
27
+
28
+ - [ ] Matches golden / [page-layouts.md](page-layouts.md) block order
29
+ - [ ] `MPage*` used instead of ad-hoc page chrome where applicable
30
+ - [ ] List height: if this is a full-viewport main data list, consider `MPageContent fill` + `MTable fill`; if embedded/short/document-scroll, skip `fill`
31
+ - [ ] Tables not wrapped in decorative `MCard` solely for borders
32
+ - [ ] Filters / toolbar / form actions follow documented patterns
33
+ - [ ] Sider `MMenu` items have icons; status cells use `MStatus` (not decorative `MTag`)
34
+ - [ ] Empty table uses `MEmpty` (or equivalent next-action empty)
35
+ - [ ] No marketing hero bolted onto a CRUD shell
36
+
37
+ ## Account / Flow / System
38
+
39
+ - [ ] 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`
44
+ - [ ] Wizard steps: one job each; actions labeled clearly
45
+ - [ ] Brand / empty atmosphere uses token-only CSS (see visual-craft recipes)
46
+
47
+ ## Express
48
+
49
+ - [ ] 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
54
+
55
+ ## Tokens, a11y, responsive
56
+
57
+ - [ ] No raw hex/rgb theme colors in new CSS (control widths OK inline; `color-mix` from `--m-*` OK)
58
+ - [ ] Labels visible; icon buttons have `aria-label`
59
+ - [ ] Usable on a narrow viewport
60
+ - [ ] Focus visible on interactive elements
61
+
62
+ When MCP is available, contract checks above (**`validate_usage`** / **`validate_page`**) are required — not optional.
63
+
64
+ If the project has `pnpm check:colors`, suggest running it after edits.
@@ -0,0 +1,73 @@
1
+ # Style direction & presets
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.
4
+
5
+ ## Resolution order (required)
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`**.
13
+
14
+ MCP: `list_style_presets` / `get_style_preset` / `recommend_page({ style })` → `styleDirection`.
15
+
16
+ ## Presets (user-selectable)
17
+
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` |
26
+
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.
28
+
29
+ ### Domain heuristics (when user says “直接写”)
30
+
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 |
39
+
40
+ ## How to apply on Ops pages
41
+
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.
46
+
47
+ ## Reference style checklist
48
+
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` |