@morya-ui/setup 0.3.8 → 0.4.0
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/package.json +1 -1
- package/template/.agents/skills/morya-ui-pages/references/component-index.md +5 -4
- package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +1 -1
- package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +10 -7
- package/template/.agents/skills/morya-ui-pages/references/surfaces.md +5 -5
- package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +21 -2
- package/template/scripts/check-raw-colors.mjs +10 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morya-ui/setup",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "One-shot setup for morya-ui: install the library, multi-editor MCP, Agent skills, and design config.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/morya-space/morya-ui/tree/main/packages/setup#readme",
|
|
@@ -22,7 +22,7 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
|
|
|
22
22
|
|
|
23
23
|
## Forms · inputs
|
|
24
24
|
|
|
25
|
-
`MForm
|
|
25
|
+
`MForm` / `MFormItem` / `MFormList`, `MInput`, `MInputPassword`, `MInputNumber`, `MTextarea`, `MInputOtp`, `MInputColor`, `MInputGroup`, `MInputTags`, `MMentions`, `MSelect`, `MTreeSelect`, `MCascadeSelect`, `MListbox`, `MSelectButton`, `MDatePicker`, `MTimePicker`, `MCalendar`, `MAutoComplete`, `MCheckbox` / `MCheckboxGroup`, `MRadio` / `MRadioGroup`, `MSwitch`, `MToggleButton`, `MSlider`, `MRating`, `MKnob`, `MFileUpload`, `MFloatLabel`, `MIconField`, `MLabel`
|
|
26
26
|
|
|
27
27
|
## Layout helpers
|
|
28
28
|
|
|
@@ -30,7 +30,7 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
|
|
|
30
30
|
|
|
31
31
|
## Data
|
|
32
32
|
|
|
33
|
-
`MTable` (`columns` + **`rows`**, not `data`; optional `virtual`, `resizable`/`filterable`, `children`, `span-method`, `tree-config`), `MDataView`, `MTree`, `MPagination`, `MOrderList`, `MPickList`, `MStatus` / `MTag` / `MChip` / `MBadge`, `MAvatar` / `MAvatarGroup`, `MTimeline`, `MMeterGroup`, `MVirtualScroller`
|
|
33
|
+
`MTable` (`columns` + **`rows`**, not `data`; optional `virtual`, `resizable`/`filterable`, `children`, `span-method`, `tree-config`), `MDataView`, `MList` / `MListItem` / `MListItemMeta`, `MTree`, `MPagination`, `MOrderList`, `MPickList`, `MDescriptions`, `MStatistic`, `MStatus` / `MTag` / `MChip` / `MBadge`, `MAvatar` / `MAvatarGroup`, `MTimeline`, `MMeterGroup`, `MVirtualScroller`
|
|
34
34
|
|
|
35
35
|
## Feedback
|
|
36
36
|
|
|
@@ -40,6 +40,7 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
|
|
|
40
40
|
| `toast` | `summary` + `detail`, or async / background feel | `feedback-choice` |
|
|
41
41
|
| `<MMessage>` | Optional host for the `message` service. **Not** an inline alert | `feedback-choice` |
|
|
42
42
|
| field `errorMessage` or token `role="alert"` | Persistent form / auth error | `feedback-choice` |
|
|
43
|
+
| `MAlert` | Persistent in-page notice (not a toast) | `feedback-choice` |
|
|
43
44
|
| `MEmpty` | No-data / first-use / filtered empty | `empty-result-choice` |
|
|
44
45
|
| `MResult` | Terminal outcome: success, failure, 403 / 404 / 500 | `empty-result-choice` |
|
|
45
46
|
| `MLoading` / `v-loading` / `loading.service` | **Default** region or fullscreen loading mask | `loading-choice` |
|
|
@@ -50,11 +51,11 @@ Full API: docs site `/components` or MCP (`get_component`, `search`, `validate_u
|
|
|
50
51
|
|
|
51
52
|
## Overlays & menus
|
|
52
53
|
|
|
53
|
-
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu`, `MCommandMenu`, `MMenu` / `MMenubar` / `MTieredMenu` / `MMegaMenu`, `MTabs`, `MStepper`
|
|
54
|
+
`MDialog`, `MDrawer`, `MConfirmDialog` / `MConfirmPopup`, `MPopover`, `MTooltip`, `MDropdown` (**actions only**), `MContextMenu`, `MCommandMenu`, `MMenu` / `MMenubar` / `MTieredMenu` / `MMegaMenu`, `MTabs`, `MStepper`, `MTour`, `MAffix`, `MAnchor`
|
|
54
55
|
|
|
55
56
|
## Surfaces / media
|
|
56
57
|
|
|
57
|
-
`MCard`, `MPanel`, `MAccordion`, `MCarousel`, `MGallery`, `MIcon`, `MScrollbar`, `MInplace`, `MScrollTop`, `MTerminal`
|
|
58
|
+
`MCard`, `MPanel`, `MAccordion`, `MCarousel`, `MGallery`, `MImage`, `MIcon`, `MQRCode`, `MScrollbar`, `MInplace`, `MScrollTop`, `MTerminal`, `MTypography` / `MTitle` / `MText` / `MParagraph` / `MLink`, `MWatermark`
|
|
58
59
|
|
|
59
60
|
## Scenario → decision
|
|
60
61
|
|
|
@@ -1308,7 +1308,7 @@ This file is the **offline** mirror for agents without MCP.
|
|
|
1308
1308
|
**Recipe · props**
|
|
1309
1309
|
|
|
1310
1310
|
- title + description
|
|
1311
|
-
-
|
|
1311
|
+
- 主区域优先 illustration(no-content / no-result…)
|
|
1312
1312
|
- 表格内放在 #empty
|
|
1313
1313
|
|
|
1314
1314
|
**Recipe · slots**
|
|
@@ -9,7 +9,7 @@ Golden pages are **assembly demos / structure baselines**, not the default clone
|
|
|
9
9
|
| List | List page | `list-page` (`list-page-dense` / `list-page-rail` craft only) | `layout-app-shell`, `page-header-actions`, **`list-filters-stack`** (dense → `list-filters-dense`), `list-table`, `form-in-dialog`, `confirm-delete` |
|
|
10
10
|
| Form (long / dedicated) | Form page | `form-page` | `page-content-form`, `form-header`, `form-body`, `form-actions` |
|
|
11
11
|
| List create/edit dialog | List create/edit dialog | `form-in-dialog` | **`form-in-dialog`** (preferred) |
|
|
12
|
-
| Detail | Detail page | `detail-page` | `detail-toolbar`, `form-in-dialog` |
|
|
12
|
+
| Detail | Detail page | `detail-page` | `detail-toolbar`, `detail-descriptions`, `form-in-dialog` |
|
|
13
13
|
| Dashboard | Dashboard | `dashboard-page` | `dashboard-kpi-grid`, `dashboard-chart-card`, `dashboard-recent-table` |
|
|
14
14
|
| Login | — (see [surfaces.md](surfaces.md)) | `login-page` | **`auth-split-shell`** |
|
|
15
15
|
| Landing | — (see [surfaces.md](surfaces.md)) | `landing-page` | — |
|
|
@@ -74,8 +74,10 @@ Craft: [visual-craft.md](visual-craft.md) § Ops polish.
|
|
|
74
74
|
|
|
75
75
|
1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
|
|
76
76
|
2. `MPageContent density="spacious"` → `MPageHeader` (title + short domain description when useful)
|
|
77
|
-
3.
|
|
78
|
-
4.
|
|
77
|
+
3. Optional `MAlert` for ops tip / degraded dependency (dismissible when appropriate)
|
|
78
|
+
4. KPI row: `MGrid` + **`MPageStat`** (trend + icon) — `dashboard-kpi-grid`
|
|
79
|
+
5. Main split: `MCard shadow="always"` + **`MEmpty illustration`** (chart pending) and/or recent `MTable` / `MList` — `dashboard-chart-card` / `dashboard-recent-table`
|
|
80
|
+
6. Plain numeric callouts inside a card (no trend UI) → `MStatistic`, not a second custom KPI CSS
|
|
79
81
|
|
|
80
82
|
Craft: spacious density + Ops polish; do not turn the first viewport into a marketing hero.
|
|
81
83
|
|
|
@@ -89,7 +91,7 @@ Craft: spacious density + Ops polish; do not turn the first viewport into a mark
|
|
|
89
91
|
| Spacing | `MSpace` / `MFlex` for peers; page gap from `MPageContent` | Nested padded divs stacking gaps |
|
|
90
92
|
| 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
93
|
| Color | `--m-*` | Page-level hex / rgb |
|
|
92
|
-
| Feedback | One-line → `message`; danger → confirm dialog | Toast for a single short string |
|
|
94
|
+
| Feedback | One-line → `message`; danger → confirm dialog; sticky page tip → `MAlert` | Toast for a single short string |
|
|
93
95
|
| A11y | Labels + icon `aria-label` | Unlabeled icon controls |
|
|
94
96
|
|
|
95
97
|
Inline style is acceptable for control widths (e.g. filter `width: 14rem`).
|
|
@@ -98,9 +100,10 @@ Inline style is acceptable for control widths (e.g. filter `width: 14rem`).
|
|
|
98
100
|
|
|
99
101
|
1. Same admin chrome as list (breadcrumb → `MPageContent`)
|
|
100
102
|
2. `MPageHeader` — title, `MStatus` in `#actions`, primary/secondary/danger → `detail-toolbar`
|
|
101
|
-
3. Summary
|
|
102
|
-
4.
|
|
103
|
-
5.
|
|
103
|
+
3. Summary chips optional (`MTag`) — keep quiet
|
|
104
|
+
4. **Attributes** → `MDescriptions` / `MDescriptionsItem` (bordered when comparing many fields) — `detail-descriptions`
|
|
105
|
+
5. Related activity: prefer `MList` + `MListItemMeta` for narrative feeds; `MTable` when columns matter
|
|
106
|
+
6. Short edit → `form-in-dialog`; long edit → form page / `form-in-drawer`
|
|
104
107
|
|
|
105
108
|
## List create/edit dialog — block order
|
|
106
109
|
|
|
@@ -9,7 +9,7 @@ Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the re
|
|
|
9
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
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
11
|
| Dashboard | Orient + jump to work | Golden dashboard |
|
|
12
|
-
| Detail | Read-heavy record + secondary actions | `MPageHeader` +
|
|
12
|
+
| Detail | Read-heavy record + secondary actions | `MPageHeader` + **`MDescriptions`** for attributes; related feed via `MList` or `MTable`; edit via `MDialog` / `MDrawer` |
|
|
13
13
|
| Settings | Grouped preferences | Narrow `MPageContent` + stacked `MPageSection` / `MTabs` + `MForm` |
|
|
14
14
|
| Hybrid list | List + drawer/dialog | **Default Ops CRUD pattern**: list golden + `MDialog`/`MDrawer` form |
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ Pick a lane, then a surface. Prefer project golden pages for **Ops**; use the re
|
|
|
17
17
|
|
|
18
18
|
| Surface | Job | Recipe |
|
|
19
19
|
| --- | --- | --- |
|
|
20
|
-
| Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm
|
|
20
|
+
| Login / register | Authenticate with trust | Golden: MCP `get_golden_page` `login-page` — split brand + `MForm`; prefer `MConfigProvider input-variant="filled"`; optional `themeConfig` for brand seed; failures via `role="alert"` / `errorMessage` (not Toast). Brand wash: [visual-craft.md](visual-craft.md) § Shell recipes |
|
|
21
21
|
| Invite / accept | Join org | Same shell; show org name clearly |
|
|
22
22
|
| Forgot / reset | Recover access | Short form + success state with next step |
|
|
23
23
|
| Profile / account | Edit self | Settings-like sections; avatar via `MAvatar` |
|
|
@@ -28,8 +28,8 @@ Keep credential forms quiet: one primary CTA, clear labels, no decorative noise
|
|
|
28
28
|
|
|
29
29
|
| Surface | Job | Recipe |
|
|
30
30
|
| --- | --- | --- |
|
|
31
|
-
| Empty state | Invite first action | Golden: MCP `get_golden_page` `empty-state` — `MEmpty` +
|
|
32
|
-
| Onboarding | Teach the product path | `MStepper` or paced cards; one decision per step; finish → Ops home |
|
|
31
|
+
| Empty state | Invite first action | Golden: MCP `get_golden_page` `empty-state` — `MEmpty` + **`illustration`** (`no-content` / `no-result` / …) + primary/secondary in `#extra` |
|
|
32
|
+
| Onboarding | Teach the product path | `MStepper` or paced cards; optional `MTour` for in-app spotlight; one decision per step; finish → Ops home |
|
|
33
33
|
| Wizard | Multi-step create | `MStepper` + `MForm` per step + sticky actions (`上一步` / `下一步` / `提交`) |
|
|
34
34
|
| Success / result | Confirm completion | `MResult status="success"` / `error` + `#footer` next actions (`查看详情` / `返回列表`); same shell idea as `result-page` |
|
|
35
35
|
|
|
@@ -51,7 +51,7 @@ Use when the brief is landing, pricing, launch, or docs marketing — **not** fo
|
|
|
51
51
|
|
|
52
52
|
| Surface | Job | Recipe |
|
|
53
53
|
| --- | --- | --- |
|
|
54
|
-
| Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion` |
|
|
54
|
+
| Landing | Convert / explain product | Golden: MCP `get_golden_page` `landing-page` — one-job hero; CTAs → `MButton`; chips → `MTag`; FAQ → `MAccordion`; prefer `MTypography` / `MTitle` / `MParagraph` for hierarchy when available |
|
|
55
55
|
| Pricing | Choose a plan | Clear plan cards (`MCard`) + primary CTA; highlight recommended plan without clutter |
|
|
56
56
|
| Feature showcase | Prove capability | Alternating media/copy; live `M*` demo only if lightweight |
|
|
57
57
|
| Docs marketing chrome | Frame documentation | Header + nav using `M*` where suitable; content area stays readable |
|
|
@@ -48,13 +48,32 @@ If the plan looks like any-SaaS (purple wash, cream serif, neon glow) and the us
|
|
|
48
48
|
3. **Status** → `MStatus`; `MTag` for categories/filters only.
|
|
49
49
|
4. **Row actions** — text / outlined / small.
|
|
50
50
|
5. **Filter rhythm** — search ~`14rem`, selects ~`10–12rem`.
|
|
51
|
-
6. **Empty** — `MEmpty` with next
|
|
51
|
+
6. **Empty** — `MEmpty` with domain next-step copy + **one** primary in `#extra`. Prefer `illustration` (`no-content` / `no-result` / `no-message` / `network-error` / …) over a generic icon when the empty is a main region.
|
|
52
52
|
7. **No extra cards** around filters/table “for polish”.
|
|
53
53
|
8. **Domain copy**.
|
|
54
54
|
9. **Density** — follow user cues (`compact` / spacious); don’t invent a second scale.
|
|
55
55
|
10. **Quiet chrome** — no marketing heroes / glow unless the user asked.
|
|
56
|
+
11. **Page alerts** — persistent in-page notices → `MAlert` (not Toast, not `<MMessage>` as markup).
|
|
57
|
+
12. **Detail fields** — attribute grids → `MDescriptions` / `MDescriptionsItem` (not hand-rolled `<dl>`).
|
|
58
|
+
13. **Plain metrics** — numbers without trend chrome → `MStatistic` inside a section/card; KPI strips with trend → keep `MPageStat`.
|
|
59
|
+
14. **Activity / feed rows** — same-shape items without dense columns → `MList` + `MListItem` / `MListItemMeta`; tabular compare → `MTable`.
|
|
56
60
|
|
|
57
|
-
Ops beauty = alignment + semantics + restraint, **not** gradients.
|
|
61
|
+
Ops beauty = alignment + semantics + restraint + the right `M*` for the job, **not** gradients.
|
|
62
|
+
|
|
63
|
+
## Component craft map (post-library upgrades)
|
|
64
|
+
|
|
65
|
+
| Need | Prefer | Avoid |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| Admin KPI with trend | `MPageStat` (`dashboard-kpi-grid`) | Custom stat CSS |
|
|
68
|
+
| Inline / detail number | `MStatistic` | Fake big numbers with raw `<p>` |
|
|
69
|
+
| Detail attribute grid | `MDescriptions` (`detail-descriptions`) | Hand-written `<dl>` / nested tables |
|
|
70
|
+
| Lightweight feed | `MList` + Meta | Forcing a full `MTable` for 3–5 narrative rows |
|
|
71
|
+
| Empty main region | `MEmpty` + `illustration` | “暂无数据” + bare icon only |
|
|
72
|
+
| In-page notice | `MAlert` | Toast for sticky page tips |
|
|
73
|
+
| Auth / form inputs | `MConfigProvider input-variant="filled"` (or filled controls) | Mixing outlined/filled without reason |
|
|
74
|
+
| Brand seed | `themeConfig` / project theme CSS | Page-level hex |
|
|
75
|
+
| Express headings | `MTypography` / `MTitle` / `MParagraph` where it helps hierarchy | Second font kit |
|
|
76
|
+
| First-run teach | `MTour` after empty/onboarding | Modal essay walls |
|
|
58
77
|
|
|
59
78
|
## Anti-default looks
|
|
60
79
|
|
|
@@ -18,6 +18,12 @@ const HSL = /\bhsl\s*\(/g
|
|
|
18
18
|
/** Allow transparent, currentColor, inherit in CSS values */
|
|
19
19
|
const ALLOW_LINE = /var\s*\(\s*--m-|color-mix\s*\(|transparent|currentColor|inherit|none/
|
|
20
20
|
|
|
21
|
+
/** Theme seed / createTheme brand inputs must be concrete colors. */
|
|
22
|
+
const ALLOW_THEME_SEED = /\bcolorPrimary\s*:|\bseed\s*:\s*\{[^}]*colorPrimary/
|
|
23
|
+
|
|
24
|
+
/** Canvas / encoder fallbacks that must stay concrete for off-DOM drawing. */
|
|
25
|
+
const ALLOW_CANVAS_FALLBACK = /rgb\(\s*0\s*,\s*0\s*,\s*0\s*\)|rgb\(\s*255\s*,\s*255\s*,\s*255\s*\)/
|
|
26
|
+
|
|
21
27
|
/** Skip demo IDs like '#1024' or 'WO-1024' in script/template strings */
|
|
22
28
|
const DEMO_ID = /['"]#?[A-Z0-9-]{2,}['"]/
|
|
23
29
|
|
|
@@ -28,7 +34,7 @@ function walk(dir) {
|
|
|
28
34
|
const full = path.join(dir, name)
|
|
29
35
|
const st = statSync(full)
|
|
30
36
|
if (st.isDirectory()) {
|
|
31
|
-
if (IGNORE_DIRS.has(name)) continue
|
|
37
|
+
if (IGNORE_DIRS.has(name) || name === 'demos') continue
|
|
32
38
|
walk(full)
|
|
33
39
|
continue
|
|
34
40
|
}
|
|
@@ -36,12 +42,15 @@ function walk(dir) {
|
|
|
36
42
|
if (!EXT.has(ext)) continue
|
|
37
43
|
const normalized = full.replace(/\\/g, '/')
|
|
38
44
|
if (normalized.includes('design-tokens/') || normalized.includes('/theme/')) continue
|
|
45
|
+
if (normalized.includes('/docs/demos/')) continue
|
|
39
46
|
if (normalized.includes('.test.') || normalized.includes('/__tests__/')) continue
|
|
40
47
|
|
|
41
48
|
const text = readFileSync(full, 'utf8')
|
|
42
49
|
const lines = text.split(/\r?\n/)
|
|
43
50
|
lines.forEach((line, index) => {
|
|
44
51
|
if (ALLOW_LINE.test(line)) return
|
|
52
|
+
if (ALLOW_THEME_SEED.test(line)) return
|
|
53
|
+
if (ALLOW_CANVAS_FALLBACK.test(line)) return
|
|
45
54
|
if (DEMO_ID.test(line)) return
|
|
46
55
|
if (HEX.test(line) || RGB.test(line) || HSL.test(line)) {
|
|
47
56
|
HEX.lastIndex = 0
|