@morya-ui/mcp 0.3.4 → 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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +154 -151
  3. package/bin/morya-ui-mcp.js +2 -2
  4. package/data/catalog.json +40 -40
  5. package/data/example-coverage.json +2 -2
  6. package/data/golden-pages/dashboard-page.vue +138 -138
  7. package/data/golden-pages/detail-page.vue +178 -178
  8. package/data/golden-pages/empty-state.vue +56 -56
  9. package/data/golden-pages/form-in-dialog.vue +166 -166
  10. package/data/golden-pages/form-page.vue +107 -107
  11. package/data/golden-pages/landing-page.vue +358 -358
  12. package/data/golden-pages/list-page-dense.vue +168 -166
  13. package/data/golden-pages/list-page-rail.vue +272 -270
  14. package/data/golden-pages/list-page.vue +222 -220
  15. package/data/golden-pages/login-page.vue +231 -231
  16. package/data/golden-pages/result-page.vue +84 -84
  17. package/data/golden-pages/settings-page.vue +163 -163
  18. package/data/golden-pages/wizard-form.vue +182 -182
  19. package/dist/__tests__/fidelity.test.d.ts +1 -0
  20. package/dist/__tests__/fidelity.test.js +88 -0
  21. package/dist/__tests__/page-snippets.test.js +42 -5
  22. package/dist/__tests__/tools.test.js +49 -29
  23. package/dist/decisions.d.ts +2 -0
  24. package/dist/decisions.js +34 -6
  25. package/dist/golden-pages.d.ts +6 -1
  26. package/dist/golden-pages.js +34 -33
  27. package/dist/index.js +52 -9
  28. package/dist/page-snippets.js +1041 -280
  29. package/dist/patterns.d.ts +4 -2
  30. package/dist/patterns.js +35 -6
  31. package/dist/reference-brief.d.ts +55 -0
  32. package/dist/reference-brief.js +468 -0
  33. package/dist/style-presets.d.ts +13 -32
  34. package/dist/style-presets.js +100 -291
  35. package/dist/style-shells.d.ts +20 -0
  36. package/dist/style-shells.js +249 -0
  37. package/dist/tools.d.ts +21 -3
  38. package/dist/tools.js +496 -424
  39. package/package.json +11 -13
@@ -1,166 +1,168 @@
1
- <script setup lang="ts">
2
- /**
3
- * 黄金样例:列表页 · dense(高密度工具台)
4
- * structure: list · style: dense
5
- * 镜像区块顺序;气质跟 styleDirection / 参考走,不要把本文件当唯一审美。
6
- * @see list-page.vue · style-presets.md · page-layouts.md
7
- */
8
- import {
9
- MBreadcrumb,
10
- MButton,
11
- MConfigProvider,
12
- MEmpty,
13
- MInput,
14
- MLayout,
15
- MLayoutContent,
16
- MLayoutHeader,
17
- MLayoutSider,
18
- MMenu,
19
- MPageContent,
20
- MPageFilters,
21
- MPageHeader,
22
- MSelect,
23
- MSpace,
24
- MStatus,
25
- MTable,
26
- zhCN,
27
- } from 'morya-ui'
28
- import { ref } from 'vue'
29
-
30
- const keyword = ref('')
31
- const status = ref<string | undefined>()
32
- const siderCollapsed = ref(false)
33
-
34
- const menuModel = [
35
- { key: 'users', label: '用户管理', icon: 'user', to: '/users' },
36
- { key: 'roles', label: '角色管理', icon: 'shield', to: '/roles' },
37
- { key: 'settings', label: '系统设置', icon: 'settings', to: '/settings' },
38
- ]
39
-
40
- const statusOptions = [
41
- { label: '全部', value: '' },
42
- { label: '启用', value: 'active' },
43
- { label: '停用', value: 'inactive' },
44
- ]
45
-
46
- function resetFilters() {
47
- keyword.value = ''
48
- status.value = undefined
49
- }
50
-
51
- const columns = [
52
- { key: 'name', label: '名称' },
53
- { key: 'status', label: '状态', width: 96 },
54
- { key: 'updatedAt', label: '更新', width: 110 },
55
- { key: 'actions', label: '操作', width: 120 },
56
- ]
57
-
58
- const rows = [
59
- { id: '1', name: '示例项目 A', status: 'active', updatedAt: '09-01' },
60
- { id: '2', name: '示例项目 B', status: 'inactive', updatedAt: '08-28' },
61
- { id: '3', name: '示例项目 C', status: 'active', updatedAt: '08-25' },
62
- { id: '4', name: '示例项目 D', status: 'active', updatedAt: '08-20' },
63
- { id: '5', name: '示例项目 E', status: 'inactive', updatedAt: '08-15' },
64
- { id: '6', name: '示例项目 F', status: 'active', updatedAt: '08-12' },
65
- { id: '7', name: '示例项目 G', status: 'inactive', updatedAt: '08-10' },
66
- { id: '8', name: '示例项目 H', status: 'active', updatedAt: '08-08' },
67
- ]
68
- </script>
69
-
70
- <template>
71
- <MConfigProvider :locale="zhCN">
72
- <MLayout has-sider fill-viewport>
73
- <MLayoutSider v-model:collapsed="siderCollapsed" bordered :collapsed-width="64">
74
- <MMenu
75
- :model="menuModel"
76
- :collapsed="siderCollapsed"
77
- :collapsed-width="64"
78
- selected-key="users"
79
- />
80
- </MLayoutSider>
81
-
82
- <MLayout>
83
- <MLayoutHeader padding="var(--m-space-3) var(--m-space-4)">
84
- <MBreadcrumb :model="[{ label: '首页', to: '/' }, { label: '用户管理' }]" />
85
- </MLayoutHeader>
86
-
87
- <MLayoutContent>
88
- <MPageContent fill density="compact">
89
- <MPageHeader title="用户管理">
90
- <template #actions>
91
- <MButton severity="primary" size="small">
92
- 新建
93
- </MButton>
94
- </template>
95
- </MPageHeader>
96
-
97
- <MPageFilters aria-label="筛选" variant="plain">
98
- <MSpace wrap>
99
- <MInput
100
- v-model="keyword"
101
- placeholder="搜索"
102
- clearable
103
- size="small"
104
- style="width: 11rem"
105
- />
106
- <MSelect
107
- v-model="status"
108
- :options="statusOptions"
109
- placeholder="状态"
110
- clearable
111
- size="small"
112
- style="width: 8rem"
113
- />
114
- <MButton severity="secondary" size="small">
115
- 查询
116
- </MButton>
117
- <MButton severity="secondary" size="small" text @click="resetFilters">
118
- 重置
119
- </MButton>
120
- </MSpace>
121
- </MPageFilters>
122
-
123
- <MTable
124
- :columns="columns"
125
- :rows="rows"
126
- :rows-per-page="10"
127
- fill
128
- paginator
129
- size="small"
130
- striped
131
- bordered
132
- row-key="id"
133
- aria-label="用户列表"
134
- >
135
- <template #cell-status="{ value }">
136
- <MStatus
137
- :label="value === 'active' ? '启用' : '停用'"
138
- :severity="value === 'active' ? 'success' : 'secondary'"
139
- />
140
- </template>
141
- <template #cell-actions>
142
- <MSpace>
143
- <MButton severity="secondary" size="small" text>
144
- 编辑
145
- </MButton>
146
- <MButton severity="danger" size="small" text>
147
- 删除
148
- </MButton>
149
- </MSpace>
150
- </template>
151
- <template #empty>
152
- <MEmpty title="暂无数据" description="创建后在此浏览。" icon="user">
153
- <template #extra>
154
- <MButton severity="primary" size="small">
155
- 新建
156
- </MButton>
157
- </template>
158
- </MEmpty>
159
- </template>
160
- </MTable>
161
- </MPageContent>
162
- </MLayoutContent>
163
- </MLayout>
164
- </MLayout>
165
- </MConfigProvider>
166
- </template>
1
+ <script setup lang="ts">
2
+ /**
3
+ * 黄金样例:列表页 · dense(高密度工具台)
4
+ * structure: list · style: dense
5
+ * 镜像区块顺序;气质跟 styleDirection / 参考走,不要把本文件当唯一审美。
6
+ * @see list-page.vue · style-presets.md · page-layouts.md
7
+ */
8
+ import {
9
+ MBreadcrumb,
10
+ MButton,
11
+ MConfigProvider,
12
+ MEmpty,
13
+ MInput,
14
+ MLayout,
15
+ MLayoutContent,
16
+ MLayoutHeader,
17
+ MLayoutSider,
18
+ MMenu,
19
+ MPageContent,
20
+ MPageFilters,
21
+ MPageHeader,
22
+ MSelect,
23
+ MSpace,
24
+ MStatus,
25
+ MTable,
26
+ zhCN,
27
+ } from 'morya-ui'
28
+ import { ref } from 'vue'
29
+
30
+ const keyword = ref('')
31
+ const status = ref<string | undefined>()
32
+ const siderCollapsed = ref(false)
33
+
34
+ const menuModel = [
35
+ { key: 'users', label: '用户管理', icon: 'user', to: '/users' },
36
+ { key: 'roles', label: '角色管理', icon: 'shield', to: '/roles' },
37
+ { key: 'settings', label: '系统设置', icon: 'settings', to: '/settings' },
38
+ ]
39
+
40
+ const statusOptions = [
41
+ { label: '全部', value: '' },
42
+ { label: '启用', value: 'active' },
43
+ { label: '停用', value: 'inactive' },
44
+ ]
45
+
46
+ function resetFilters() {
47
+ keyword.value = ''
48
+ status.value = undefined
49
+ }
50
+
51
+ const columns = [
52
+ { key: 'name', label: '名称' },
53
+ { key: 'status', label: '状态', width: 96 },
54
+ { key: 'updatedAt', label: '更新', width: 110 },
55
+ { key: 'actions', label: '操作', width: 120 },
56
+ ]
57
+
58
+ const rows = [
59
+ { id: '1', name: '示例项目 A', status: 'active', updatedAt: '09-01' },
60
+ { id: '2', name: '示例项目 B', status: 'inactive', updatedAt: '08-28' },
61
+ { id: '3', name: '示例项目 C', status: 'active', updatedAt: '08-25' },
62
+ { id: '4', name: '示例项目 D', status: 'active', updatedAt: '08-20' },
63
+ { id: '5', name: '示例项目 E', status: 'inactive', updatedAt: '08-15' },
64
+ { id: '6', name: '示例项目 F', status: 'active', updatedAt: '08-12' },
65
+ { id: '7', name: '示例项目 G', status: 'inactive', updatedAt: '08-10' },
66
+ { id: '8', name: '示例项目 H', status: 'active', updatedAt: '08-08' },
67
+ ]
68
+ </script>
69
+
70
+ <template>
71
+ <MConfigProvider :locale="zhCN">
72
+ <MLayout has-sider fill-viewport>
73
+ <MLayoutSider v-model:collapsed="siderCollapsed" bordered :collapsed-width="64">
74
+ <MMenu
75
+ :model="menuModel"
76
+ :collapsed="siderCollapsed"
77
+ :collapsed-width="64"
78
+ selected-key="users"
79
+ />
80
+ </MLayoutSider>
81
+
82
+ <MLayout>
83
+ <MLayoutHeader padding="var(--m-space-3) var(--m-space-4)">
84
+ <MBreadcrumb :model="[{ label: '首页', to: '/' }, { label: '用户管理' }]" />
85
+ </MLayoutHeader>
86
+
87
+ <MLayoutContent>
88
+ <MPageContent fill density="compact">
89
+ <MPageHeader title="用户管理">
90
+ <template #actions>
91
+ <MButton severity="primary" size="small">
92
+ 新建
93
+ </MButton>
94
+ </template>
95
+ </MPageHeader>
96
+
97
+ <MPageFilters aria-label="筛选" variant="plain">
98
+ <MSpace wrap>
99
+ <MInput
100
+ v-model="keyword"
101
+ placeholder="搜索"
102
+ clearable
103
+ size="small"
104
+ style="width: 11rem"
105
+ />
106
+ <MSelect
107
+ v-model="status"
108
+ :options="statusOptions"
109
+ placeholder="状态"
110
+ clearable
111
+ size="small"
112
+ style="width: 8rem"
113
+ />
114
+ </MSpace>
115
+ <template #actions>
116
+ <MButton severity="secondary" size="small">
117
+ 查询
118
+ </MButton>
119
+ <MButton severity="secondary" size="small" text @click="resetFilters">
120
+ 重置
121
+ </MButton>
122
+ </template>
123
+ </MPageFilters>
124
+
125
+ <MTable
126
+ :columns="columns"
127
+ :rows="rows"
128
+ :rows-per-page="10"
129
+ fill
130
+ paginator
131
+ size="small"
132
+ striped
133
+ bordered
134
+ row-key="id"
135
+ aria-label="用户列表"
136
+ >
137
+ <template #cell-status="{ value }">
138
+ <MStatus
139
+ :label="value === 'active' ? '启用' : '停用'"
140
+ :severity="value === 'active' ? 'success' : 'secondary'"
141
+ />
142
+ </template>
143
+ <template #cell-actions>
144
+ <MSpace>
145
+ <MButton severity="secondary" size="small" text>
146
+ 编辑
147
+ </MButton>
148
+ <MButton severity="danger" size="small" text>
149
+ 删除
150
+ </MButton>
151
+ </MSpace>
152
+ </template>
153
+ <template #empty>
154
+ <MEmpty title="暂无数据" description="创建后在此浏览。" icon="user">
155
+ <template #extra>
156
+ <MButton severity="primary" size="small">
157
+ 新建
158
+ </MButton>
159
+ </template>
160
+ </MEmpty>
161
+ </template>
162
+ </MTable>
163
+ </MPageContent>
164
+ </MLayoutContent>
165
+ </MLayout>
166
+ </MLayout>
167
+ </MConfigProvider>
168
+ </template>