@morya-ui/mcp 0.4.1 → 0.4.2

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.
@@ -32,8 +32,8 @@ function resetFilters() {
32
32
  />
33
33
  </MSpace>
34
34
  <template #actions>
35
- <MButton severity="secondary">查询</MButton>
36
- <MButton severity="secondary" text @click="resetFilters">重置</MButton>
35
+ <MButton>查询</MButton>
36
+ <MButton type="text" @click="resetFilters">重置</MButton>
37
37
  </template>
38
38
  </MPageFilters>`,
39
39
  rules: [
@@ -105,8 +105,8 @@ function resetFilters() {
105
105
  />
106
106
  </MSpace>
107
107
  <template #actions>
108
- <MButton severity="secondary">查询</MButton>
109
- <MButton severity="secondary" text @click="resetFilters">重置</MButton>
108
+ <MButton>查询</MButton>
109
+ <MButton type="text" @click="resetFilters">重置</MButton>
110
110
  </template>
111
111
  <template #advanced>
112
112
  <MSpace wrap>
@@ -300,8 +300,8 @@ function resetFilters() {
300
300
  />
301
301
  </MSpace>
302
302
  <template #actions>
303
- <MButton severity="secondary">查询</MButton>
304
- <MButton severity="secondary" text @click="resetFilters">重置</MButton>
303
+ <MButton>查询</MButton>
304
+ <MButton type="text" @click="resetFilters">重置</MButton>
305
305
  </template>
306
306
  <template #advanced>
307
307
  <MSpace wrap>
@@ -390,8 +390,8 @@ function resetFilters() {
390
390
  />
391
391
  </MSpace>
392
392
  <template #actions>
393
- <MButton severity="secondary" size="small">查询</MButton>
394
- <MButton severity="secondary" size="small" text @click="resetFilters">重置</MButton>
393
+ <MButton size="small">查询</MButton>
394
+ <MButton size="small" type="text" @click="resetFilters">重置</MButton>
395
395
  </template>
396
396
  </MPageFilters>`,
397
397
  rules: [
@@ -424,7 +424,7 @@ function resetFilters() {
424
424
  imports: ['MPageHeader', 'MButton'],
425
425
  template: `<MPageHeader title="用户管理" description="维护账号、角色与权限。">
426
426
  <template #actions>
427
- <MButton severity="primary">新建用户</MButton>
427
+ <MButton type="primary">新建用户</MButton>
428
428
  </template>
429
429
  </MPageHeader>`,
430
430
  rules: ['页级标题用 MPageHeader,不要用 MPageToolbar 当第二页头', '主操作放 #actions'],
@@ -444,12 +444,12 @@ function resetFilters() {
444
444
  template: `<MPageToolbar>
445
445
  <span style="color:var(--m-color-text-muted);font-size:var(--m-font-size-sm)">已选 0 项</span>
446
446
  <template #actions>
447
- <MButton severity="secondary" text>导出</MButton>
448
- <MButton severity="danger" text>删除</MButton>
447
+ <MButton type="text">导出</MButton>
448
+ <MButton danger type="text">删除</MButton>
449
449
  </template>
450
450
  </MPageToolbar>`,
451
- rules: ['左侧用 default 插槽展示已选数量', '批量操作用 text/outlined,danger 仅 destructive', '放在 FilterChips 之后、表格之前'],
452
- rulesEn: ['Use the default slot for selection count', 'Batch actions use text/outlined; danger only for destructive ops', 'Place after FilterChips and before the table'],
451
+ rules: ['左侧用 default 插槽展示已选数量', '批量操作用 type="text" / variant="outlined",danger 仅 destructive', '放在 FilterChips 之后、表格之前'],
452
+ rulesEn: ['Use the default slot for selection count', 'Batch actions use type="text" / variant="outlined"; danger only for destructive ops', 'Place after FilterChips and before the table'],
453
453
  avoid: ['不要用 Toolbar title 充当页面标题'],
454
454
  avoidEn: ['Do not use Toolbar title as the page heading'],
455
455
  },
@@ -508,8 +508,8 @@ const loading = ref(false)`,
508
508
  </template>
509
509
  <template #cell-actions>
510
510
  <MSpace>
511
- <MButton severity="secondary" size="small" text>编辑</MButton>
512
- <MButton severity="danger" size="small" text>删除</MButton>
511
+ <MButton size="small" type="text">编辑</MButton>
512
+ <MButton danger size="small" type="text">删除</MButton>
513
513
  </MSpace>
514
514
  </template>
515
515
  <template #empty>
@@ -519,7 +519,7 @@ const loading = ref(false)`,
519
519
  icon="inbox"
520
520
  >
521
521
  <template #extra>
522
- <MButton severity="primary">新建成员</MButton>
522
+ <MButton type="primary">新建成员</MButton>
523
523
  </template>
524
524
  </MEmpty>
525
525
  </template>
@@ -562,12 +562,12 @@ const loading = ref(false)`,
562
562
  imports: ['MSpace', 'MButton'],
563
563
  template: `<template #cell-actions>
564
564
  <MSpace>
565
- <MButton severity="secondary" size="small" text>编辑</MButton>
566
- <MButton severity="danger" size="small" text>删除</MButton>
565
+ <MButton size="small" type="text">编辑</MButton>
566
+ <MButton danger size="small" type="text">删除</MButton>
567
567
  </MSpace>
568
568
  </template>`,
569
- rules: ['行内操作用 size="small" + text/outlined,避免一排实心按钮', '危险操作使用 severity="danger" 并配合确认弹窗'],
570
- rulesEn: ['Use size="small" with text/outlined row actions', 'Use severity="danger" with confirmation for destructive actions'],
569
+ rules: ['行内操作用 size="small" + type="text" / variant="outlined",避免一排实心按钮', '危险操作使用 danger 并配合确认弹窗'],
570
+ rulesEn: ['Use size="small" with type="text" / variant="outlined" row actions', 'Use danger with confirmation for destructive actions'],
571
571
  avoid: ['不要用 Dropdown 代替明确的行内按钮组,除非操作很多'],
572
572
  avoidEn: ['Do not replace explicit row buttons with Dropdown unless there are many actions'],
573
573
  },
@@ -626,20 +626,20 @@ const loading = ref(false)`,
626
626
  illustration="no-content"
627
627
  >
628
628
  <template #extra>
629
- <MButton severity="primary">新建成员</MButton>
630
- <MButton severity="secondary" text>导入名单</MButton>
629
+ <MButton type="primary">新建成员</MButton>
630
+ <MButton type="text">导入名单</MButton>
631
631
  </template>
632
632
  </MEmpty>`,
633
633
  rules: [
634
634
  '正常无数据用 MEmpty,不要用错误色',
635
635
  '主区域空态优先 illustration(no-content / no-result / no-message / network-error…);轻量内嵌可用 icon',
636
- '主 CTA 用 severity="primary",次动作用 text/secondary',
636
+ '主 CTA 用 type="primary",次动作用 type="text"',
637
637
  '文案写清「现在可以做什么」,禁止「暂无数据 / No data / 示例」',
638
638
  ],
639
639
  rulesEn: [
640
640
  'Use MEmpty for normal emptiness, not error colors',
641
641
  'Main-region empties prefer illustration; light in-table empties may use icon',
642
- 'Primary CTA with severity="primary"; lesser actions text/secondary',
642
+ 'Primary CTA with type="primary"; lesser actions type="text"',
643
643
  'Copy says what to do next — no “暂无数据 / No data / 示例”',
644
644
  ],
645
645
  avoid: ['不要用手写 div 拼空态', '不要用 MResult 表达无数据', '不要放两个 filled primary'],
@@ -657,7 +657,7 @@ const loading = ref(false)`,
657
657
  template: `<MResult status="success" description="订单已创建,可在列表中查看详情。">
658
658
  <template #extra>
659
659
  <MButton label="查看订单" />
660
- <MButton label="返回列表" severity="secondary" text />
660
+ <MButton label="返回列表" type="text" />
661
661
  </template>
662
662
  </MResult>`,
663
663
  rules: ['流程终点用 MResult', '提供明确下一步操作'],
@@ -742,8 +742,8 @@ const roleOptions = [
742
742
  imports: ['MPageSection', 'MSpace', 'MButton'],
743
743
  template: `<MPageSection variant="actions">
744
744
  <MSpace>
745
- <MButton native-type="submit" severity="primary" :loading="submitting">保存</MButton>
746
- <MButton severity="secondary">取消</MButton>
745
+ <MButton html-type="submit" type="primary" :loading="submitting">保存</MButton>
746
+ <MButton>取消</MButton>
747
747
  </MSpace>
748
748
  </MPageSection>`,
749
749
  rules: ['提交按钮在前,取消 secondary', '保存中传 loading 防重复提交'],
@@ -855,7 +855,7 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
855
855
  template: `<MCard title="最近工单">
856
856
  <MTable :columns="recentColumns" :rows="recentRows" size="small" :paginator="false" bordered row-key="id">
857
857
  <template #cell-status="{ value }">
858
- <MStatus :label="String(value ?? '')" severity="secondary" />
858
+ <MStatus :label="String(value ?? '')" default / type="text" />
859
859
  </template>
860
860
  </MTable>
861
861
  </MCard>`,
@@ -915,8 +915,8 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
915
915
  <template #actions>
916
916
  <MSpace>
917
917
  <MStatus label="启用" severity="success" />
918
- <MButton severity="primary">编辑</MButton>
919
- <MButton severity="danger" text>删除</MButton>
918
+ <MButton type="primary">编辑</MButton>
919
+ <MButton danger type="text">删除</MButton>
920
920
  </MSpace>
921
921
  </template>
922
922
  </MPageHeader>`,
@@ -969,8 +969,8 @@ const recentRows = ref<Record<string, unknown>[]>([])`,
969
969
  template: `<MPageHeader title="用户管理" description="管理成员与角色。">
970
970
  <template #actions>
971
971
  <MSpace>
972
- <MButton severity="secondary" text>导入</MButton>
973
- <MButton severity="primary">新建用户</MButton>
972
+ <MButton type="text">导入</MButton>
973
+ <MButton type="primary">新建用户</MButton>
974
974
  </MSpace>
975
975
  </template>
976
976
  </MPageHeader>`,
@@ -1044,10 +1044,10 @@ async function onSave() {
1044
1044
  </MForm>
1045
1045
  <template #footer>
1046
1046
  <MSpace style="justify-content: flex-end; width: 100%">
1047
- <MButton severity="secondary" text :disabled="submitting" @click="dialogOpen = false">
1047
+ <MButton type="text" :disabled="submitting" @click="dialogOpen = false">
1048
1048
  取消
1049
1049
  </MButton>
1050
- <MButton severity="primary" :loading="submitting" @click="onSave">
1050
+ <MButton type="primary" :loading="submitting" @click="onSave">
1051
1051
  保存
1052
1052
  </MButton>
1053
1053
  </MSpace>
@@ -1113,10 +1113,10 @@ async function onSave() {
1113
1113
  </MForm>
1114
1114
  <template #footer>
1115
1115
  <MSpace style="justify-content: flex-end; width: 100%">
1116
- <MButton severity="secondary" text :disabled="submitting" @click="drawerOpen = false">
1116
+ <MButton type="text" :disabled="submitting" @click="drawerOpen = false">
1117
1117
  取消
1118
1118
  </MButton>
1119
- <MButton severity="primary" :loading="submitting" @click="onSave">
1119
+ <MButton type="primary" :loading="submitting" @click="onSave">
1120
1120
  保存
1121
1121
  </MButton>
1122
1122
  </MSpace>
@@ -1156,11 +1156,11 @@ function onAcceptDelete() {
1156
1156
  message="删除后不可恢复,确定继续?"
1157
1157
  accept-label="删除"
1158
1158
  reject-label="取消"
1159
- accept-severity="danger"
1159
+ accept-danger
1160
1160
  @accept="onAcceptDelete"
1161
1161
  />`,
1162
- rules: ['用 MConfirmDialog,不要手写 Dialog 确定/取消', 'acceptSeverity="danger"', '成功用 message.success,不要 toast'],
1163
- rulesEn: ['Use MConfirmDialog; do not hand-roll Dialog Yes/No', 'acceptSeverity="danger"', 'Success via message.success, not toast'],
1162
+ rules: ['用 MConfirmDialog,不要手写 Dialog 确定/取消', 'acceptColor="danger"', '成功用 message.success,不要 toast'],
1163
+ rulesEn: ['Use MConfirmDialog; do not hand-roll Dialog Yes/No', 'acceptColor="danger"', 'Success via message.success, not toast'],
1164
1164
  avoid: ['普通 Dialog 冒充删除确认', '编辑表单误用 ConfirmDialog'],
1165
1165
  avoidEn: ['Faking delete confirm with Dialog', 'Using ConfirmDialog for edit forms'],
1166
1166
  },
@@ -1180,7 +1180,7 @@ function onAcceptDelete() {
1180
1180
  ]`,
1181
1181
  template: `<template #cell-actions>
1182
1182
  <MDropdown :model="rowMenu">
1183
- <MButton severity="secondary" size="small" text icon="more-horizontal" aria-label="更多操作" />
1183
+ <MButton size="small" type="text" icon="more-horizontal" aria-label="更多操作" />
1184
1184
  </MDropdown>
1185
1185
  </template>`,
1186
1186
  rules: ['操作很多时再用 Dropdown;2–3 个明确操作用 text 按钮', '危险项走 confirm-delete', '图标按钮必须 aria-label'],
@@ -1232,9 +1232,9 @@ async function finish() {
1232
1232
  </MPageSection>
1233
1233
  <MPageSection variant="actions">
1234
1234
  <MSpace>
1235
- <MButton severity="secondary" text :disabled="activeStep === 0" @click="back">上一步</MButton>
1236
- <MButton v-if="activeStep < steps.length - 1" severity="primary" @click="next">下一步</MButton>
1237
- <MButton v-else severity="primary" :loading="submitting" @click="finish">创建</MButton>
1235
+ <MButton type="text" :disabled="activeStep === 0" @click="back">上一步</MButton>
1236
+ <MButton v-if="activeStep < steps.length - 1" type="primary" @click="next">下一步</MButton>
1237
+ <MButton v-else type="primary" :loading="submitting" @click="finish">创建</MButton>
1238
1238
  </MSpace>
1239
1239
  </MPageSection>`,
1240
1240
  rules: ['用 :steps(不是 :items)', '每步一个主任务;进入下一步前校验当前步', '完成文案与「下一步」区分'],
@@ -1289,8 +1289,8 @@ async function onSubmit() {
1289
1289
  <MInputPassword v-model="model.password" autocomplete="current-password" fluid />
1290
1290
  </MFormItem>
1291
1291
  <MSpace style="margin-top: var(--m-space-2)" alignment="center">
1292
- <MButton type="submit" label="登录" severity="primary" :loading="submitting" />
1293
- <MButton type="button" label="忘记密码" severity="secondary" text />
1292
+ <MButton html-type="submit" label="登录" type="primary" :loading="submitting" />
1293
+ <MButton html-type="button" label="忘记密码" type="text" />
1294
1294
  </MSpace>
1295
1295
  </MForm>
1296
1296
  </div>
@@ -75,20 +75,20 @@ export declare const designRules: {
75
75
  readonly actions: {
76
76
  readonly primary: {
77
77
  readonly component: "MButton";
78
- readonly props: readonly ["severity omitted or primary"];
78
+ readonly props: readonly ["type=\"primary\""];
79
79
  };
80
80
  readonly secondary: {
81
81
  readonly component: "MButton";
82
- readonly props: readonly ["severity=\"secondary\"", "outlined or text"];
82
+ readonly props: readonly ["default", "type=\"text\" or variant=\"outlined\""];
83
83
  };
84
84
  readonly destructive: {
85
85
  readonly component: "MButton";
86
- readonly props: readonly ["severity=\"danger\""];
86
+ readonly props: readonly ["danger"];
87
87
  readonly requiresConfirmation: true;
88
88
  };
89
89
  readonly cancel: {
90
90
  readonly component: "MButton";
91
- readonly props: readonly ["severity=\"secondary\"", "text"];
91
+ readonly props: readonly ["type=\"text\""];
92
92
  };
93
93
  };
94
94
  readonly status: {
package/dist/patterns.js CHANGED
@@ -76,7 +76,7 @@ export const pagePatterns = [
76
76
  },
77
77
  styleRules: [
78
78
  '新增、保存等主操作使用 primary MButton',
79
- '查询等次要操作使用 secondary 或 outlined MButton',
79
+ '查询等次要操作使用默认或 variant="outlined" MButton',
80
80
  '删除使用 danger MButton,并配合 MConfirmDialog',
81
81
  '业务状态优先使用 MStatus(圆点+文案)或 MTag(分类标签),不使用 Button severity 表达状态',
82
82
  '间距、颜色、圆角优先使用 --m-* 设计令牌,不直接硬编码色板',
@@ -468,7 +468,7 @@ export const pagePatterns = [
468
468
  styleRules: [
469
469
  '轻量状态优先 MStatus;需要芯片感或可关闭时用 MTag',
470
470
  '属性网格用 MDescriptions,不要手写 dl',
471
- '编辑使用 primary 或 outlined MButton,删除使用 danger',
471
+ '编辑使用 type="primary" 或 variant="outlined",删除使用 danger',
472
472
  '不使用大面积自定义背景色覆盖组件库 surface Token',
473
473
  ],
474
474
  interactionRules: [
@@ -762,10 +762,10 @@ export const designRules = {
762
762
  ],
763
763
  },
764
764
  actions: {
765
- primary: { component: 'MButton', props: ['severity omitted or primary'] },
766
- secondary: { component: 'MButton', props: ['severity="secondary"', 'outlined or text'] },
767
- destructive: { component: 'MButton', props: ['severity="danger"'], requiresConfirmation: true },
768
- cancel: { component: 'MButton', props: ['severity="secondary"', 'text'] },
765
+ primary: { component: 'MButton', props: ['type="primary"'] },
766
+ secondary: { component: 'MButton', props: ['default', 'type="text" or variant="outlined"'] },
767
+ destructive: { component: 'MButton', props: ['danger'], requiresConfirmation: true },
768
+ cancel: { component: 'MButton', props: ['type="text"'] },
769
769
  },
770
770
  status: {
771
771
  preferred: 'MStatus',
@@ -437,7 +437,7 @@ export function codeCoversBlock(code, block) {
437
437
  case 'form-body':
438
438
  return /<MForm\b/i.test(c);
439
439
  case 'form-actions':
440
- return /native-type=["']submit["']|type=["']submit["']|<MPageSection\b[^>]*variant=["']actions["']/i.test(c);
440
+ return /html-type=["']submit["']|native-type=["']submit["']|type=["']submit["']|<MPageSection\b[^>]*variant=["']actions["']/i.test(c);
441
441
  case 'kpi':
442
442
  return /<MPageStat\b/i.test(c);
443
443
  case 'chart':
package/dist/tools.js CHANGED
@@ -129,14 +129,14 @@ async function submit() {
129
129
  </script>`;
130
130
  const listContent = ` <MPageHeader :title="title">
131
131
  <template #actions>
132
- <MButton severity="primary">${zh ? '新建' : 'Create'}</MButton>
132
+ <MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
133
133
  </template>
134
134
  </MPageHeader>
135
135
  <MPageFilters variant="filled" :aria-label="${zh ? '筛选' : 'Filters'}">
136
136
  <MSpace wrap>
137
137
  <MInput v-model="keyword" placeholder="${zh ? '搜索关键词' : 'Search keyword'}" clearable style="width: 14rem" />
138
- <MButton severity="secondary">${zh ? '查询' : 'Search'}</MButton>
139
- <MButton severity="secondary">${zh ? '重置' : 'Reset'}</MButton>
138
+ <MButton>${zh ? '查询' : 'Search'}</MButton>
139
+ <MButton>${zh ? '重置' : 'Reset'}</MButton>
140
140
  </MSpace>
141
141
  </MPageFilters>
142
142
  <MTable :columns="columns" :rows="rows" :loading="loading" fill paginator :rows-per-page="10" striped bordered row-key="id">
@@ -149,7 +149,7 @@ async function submit() {
149
149
  :description="${zh ? '创建第一条记录开始使用。' : 'Create your first record to get started.'}"
150
150
  >
151
151
  <template #extra>
152
- <MButton severity="primary">${zh ? '新建' : 'Create'}</MButton>
152
+ <MButton type="primary">${zh ? '新建' : 'Create'}</MButton>
153
153
  </template>
154
154
  </MEmpty>
155
155
  </template>
@@ -161,8 +161,8 @@ async function submit() {
161
161
  <MInput v-model="model.name" fluid />
162
162
  </MFormItem>
163
163
  <MPageSection variant="actions">
164
- <MButton native-type="submit" severity="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
165
- <MButton severity="secondary">${zh ? '取消' : 'Cancel'}</MButton>
164
+ <MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
165
+ <MButton>${zh ? '取消' : 'Cancel'}</MButton>
166
166
  </MPageSection>
167
167
  </MForm>
168
168
  </MPageSection>`;
@@ -185,8 +185,8 @@ async function submit() {
185
185
  <template #actions>
186
186
  <MSpace>
187
187
  <MStatus :label="${zh ? '启用' : 'Active'}" severity="success" />
188
- <MButton severity="primary">${zh ? '编辑' : 'Edit'}</MButton>
189
- <MButton severity="secondary">${zh ? '返回' : 'Back'}</MButton>
188
+ <MButton type="primary">${zh ? '编辑' : 'Edit'}</MButton>
189
+ <MButton>${zh ? '返回' : 'Back'}</MButton>
190
190
  </MSpace>
191
191
  </template>
192
192
  </MPageHeader>
@@ -202,7 +202,7 @@ async function submit() {
202
202
  <MInput v-model="model.name" fluid />
203
203
  </MFormItem>
204
204
  <MPageSection variant="actions">
205
- <MButton native-type="submit" severity="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
205
+ <MButton html-type="submit" type="primary" :loading="loading">${zh ? '保存' : 'Save'}</MButton>
206
206
  </MPageSection>
207
207
  </MForm>
208
208
  </MPageSection>
@@ -217,8 +217,8 @@ async function submit() {
217
217
  </MFormItem>
218
218
  <MPageSection variant="actions">
219
219
  <MSpace>
220
- <MButton severity="secondary" text :disabled="activeStep === 0" @click="activeStep = Math.max(activeStep - 1, 0)">${zh ? '上一步' : 'Back'}</MButton>
221
- <MButton native-type="submit" severity="primary" :loading="loading">${zh ? '下一步' : 'Next'}</MButton>
220
+ <MButton type="text" :disabled="activeStep === 0" @click="activeStep = Math.max(activeStep - 1, 0)">${zh ? '上一步' : 'Back'}</MButton>
221
+ <MButton html-type="submit" type="primary" :loading="loading">${zh ? '下一步' : 'Next'}</MButton>
222
222
  </MSpace>
223
223
  </MPageSection>
224
224
  </MForm>
@@ -276,7 +276,7 @@ ${content}
276
276
  <MFormItem label="${zh ? '密码' : 'Password'}" name="password">
277
277
  <MInput type="password" fluid />
278
278
  </MFormItem>
279
- <MButton native-type="submit" severity="primary" :loading="loading" fluid>${zh ? '登录' : 'Sign in'}</MButton>
279
+ <MButton html-type="submit" type="primary" :loading="loading" block>${zh ? '登录' : 'Sign in'}</MButton>
280
280
  </MForm>
281
281
  </MCard>
282
282
  </main>
@@ -288,7 +288,7 @@ ${content}
288
288
  <MPageContent>
289
289
  <MPageHeader :title="title">
290
290
  <template #actions>
291
- <MButton severity="primary" @click="submit">${zh ? '新建' : 'Create'}</MButton>
291
+ <MButton type="primary" @click="submit">${zh ? '新建' : 'Create'}</MButton>
292
292
  </template>
293
293
  </MPageHeader>
294
294
  <MEmpty
@@ -297,7 +297,7 @@ ${content}
297
297
  icon="database"
298
298
  >
299
299
  <template #extra>
300
- <MButton severity="primary" @click="submit">${zh ? '创建' : 'Create'}</MButton>
300
+ <MButton type="primary" @click="submit">${zh ? '创建' : 'Create'}</MButton>
301
301
  </template>
302
302
  </MEmpty>
303
303
  </MPageContent>
@@ -1103,15 +1103,14 @@ export function createToolHandlers(catalog = loadCatalog()) {
1103
1103
  />\s*(?:示例|样例|No data|暂无数据|Lorem ipsum)\s*</i.test(code)) {
1104
1104
  push('craft', 'craft', 'placeholder-copy', '工艺建议:用领域真实文案,避免「示例 / Name / No data / 暂无数据」。', 'Craft: use domain-real copy — avoid “示例 / Name / No data / 暂无数据”.');
1105
1105
  }
1106
- // Craft: more than one filled primary in viewport (heuristic)
1106
+ // Craft: more than one solid primary in viewport (heuristic)
1107
1107
  {
1108
- const primaryFilled = code.match(/<MButton\b(?![^>]*(?:\btext\b|\boutlined\b|\blink\b))[^>]*\bseverity\s*=\s*["']primary["'][^>]*>|<MButton\b(?![^>]*(?:\btext\b|\boutlined\b|\blink\b|\bseverity\s*=))[^>]*>/gi);
1109
- // Count explicit severity="primary" without text/outlined
1110
- const explicitPrimary = (code.match(/<MButton\b(?![^>]*(?:\btext\b|\boutlined\b))[^>]*severity\s*=\s*["']primary["']/gi) || []).length;
1108
+ const nonPrimaryType = String.raw `type\s*=\s*["'](?:default|dashed|link|text)["']`;
1109
+ const nonSolidVariant = String.raw `variant\s*=\s*["'](?:outlined|dashed|filled|text|link)["']`;
1110
+ const explicitPrimary = (code.match(new RegExp(String.raw `<MButton\b(?![^>]*(?:${nonPrimaryType}|${nonSolidVariant}))[^>]*type\s*=\s*["']primary["']`, 'gi')) || []).length;
1111
1111
  if (explicitPrimary > 1) {
1112
- push('craft', 'craft', 'multiple-primary', '工艺建议:主视口内通常只需一个 filled primary 按钮。', 'Craft: usually only one filled primary button in the main viewport.');
1112
+ push('craft', 'craft', 'multiple-primary', '工艺建议:主视口内通常只需一个 type="primary" 实心按钮。', 'Craft: usually only one type="primary" solid button in the main viewport.');
1113
1113
  }
1114
- void primaryFilled;
1115
1114
  }
1116
1115
  // Craft: icon-only without accessible name
1117
1116
  {
@@ -1220,10 +1219,10 @@ export function createToolHandlers(catalog = loadCatalog()) {
1220
1219
  },
1221
1220
  composition: designRules.composition,
1222
1221
  actions: {
1223
- primary: { component: 'MButton', props: ['omit severity or use primary'] },
1224
- secondary: { component: 'MButton', props: ['severity="secondary"', 'outlined or text'] },
1225
- destructive: { component: 'MButton', props: ['severity="danger"'], requiresConfirmation: true },
1226
- cancel: { component: 'MButton', props: ['severity="secondary"', 'text'] },
1222
+ primary: { component: 'MButton', props: ['type="primary"'] },
1223
+ secondary: { component: 'MButton', props: ['default', 'type="text" or variant="outlined"'] },
1224
+ destructive: { component: 'MButton', props: ['danger'], requiresConfirmation: true },
1225
+ cancel: { component: 'MButton', props: ['type="text"'] },
1227
1226
  },
1228
1227
  status: {
1229
1228
  preferred: 'MStatus',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morya-ui/mcp",
3
3
  "type": "module",
4
- "version": "0.4.1",
4
+ "version": "0.4.2",
5
5
  "description": "MCP server for morya-ui — component docs, examples, and usage guidance for AI coding agents.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/morya-space/morya-ui/tree/main/packages/ui-mcp#readme",