@morya-ui/mcp 0.3.2 → 0.3.3
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/README.md +5 -3
- package/data/catalog.json +34 -28
- package/data/example-coverage.json +4 -4
- package/dist/__tests__/tools.test.js +17 -0
- package/dist/decisions.d.ts +14 -0
- package/dist/decisions.js +777 -41
- package/dist/tools.js +23 -12
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -119,8 +119,10 @@ For a starter Vue file, pass `includeScaffold: true` to `recommend_page`:
|
|
|
119
119
|
`recommend_component` modes:
|
|
120
120
|
|
|
121
121
|
- omit `query` and `decision` → list decision guides
|
|
122
|
-
- `decision` only → read one guide (e.g. `overlay-choice`, `selection-choice`, `
|
|
123
|
-
- `query` → recommend a
|
|
122
|
+
- `decision` only → read one guide with **when / avoidWhen / recipe (props, slots, events) / antiPatterns** (e.g. `overlay-choice`, `selection-choice`, `feedback-choice`, `confirm-choice`)
|
|
123
|
+
- `query` → recommend a guide for a UI question (same recipe payload)
|
|
124
|
+
|
|
125
|
+
Offline mirror for the page skill: `design-kit/.../references/decision-recipes.md` (regenerate with `pnpm --filter @morya-ui/mcp generate:recipes`).
|
|
124
126
|
|
|
125
127
|
## Develop
|
|
126
128
|
|
|
@@ -130,7 +132,7 @@ pnpm mcp:generate
|
|
|
130
132
|
pnpm mcp:build
|
|
131
133
|
```
|
|
132
134
|
|
|
133
|
-
|
|
135
|
+
After editing `src/decisions.ts`, run `pnpm --filter @morya-ui/mcp generate:recipes` (also runs as part of `build`) so the skill offline recipes stay in sync.
|
|
134
136
|
|
|
135
137
|
```bash
|
|
136
138
|
pnpm mcp:generate
|
package/data/catalog.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-09-
|
|
2
|
+
"generatedAt": "2026-09-24T08:45:45.036Z",
|
|
3
3
|
"library": {
|
|
4
4
|
"name": "morya-ui",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.3"
|
|
6
6
|
},
|
|
7
7
|
"mcp": {
|
|
8
8
|
"name": "@morya-ui/mcp",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.3"
|
|
10
10
|
},
|
|
11
11
|
"components": [
|
|
12
12
|
{
|
|
@@ -1460,11 +1460,17 @@
|
|
|
1460
1460
|
"default": "false",
|
|
1461
1461
|
"description": "链接按钮。"
|
|
1462
1462
|
},
|
|
1463
|
+
{
|
|
1464
|
+
"name": "underline",
|
|
1465
|
+
"type": "boolean",
|
|
1466
|
+
"default": "true",
|
|
1467
|
+
"description": "`link` 悬浮下划线。设为 `false` 可关闭。"
|
|
1468
|
+
},
|
|
1463
1469
|
{
|
|
1464
1470
|
"name": "ghost",
|
|
1465
1471
|
"type": "boolean",
|
|
1466
1472
|
"default": "false",
|
|
1467
|
-
"description": "
|
|
1473
|
+
"description": "浅色填充,等同于 `text` 的悬浮态。"
|
|
1468
1474
|
},
|
|
1469
1475
|
{
|
|
1470
1476
|
"name": "quaternary",
|
|
@@ -1476,7 +1482,7 @@
|
|
|
1476
1482
|
"name": "plain",
|
|
1477
1483
|
"type": "boolean",
|
|
1478
1484
|
"default": "false",
|
|
1479
|
-
"description": "
|
|
1485
|
+
"description": "浅色填充,等同于 `outlined` 的悬浮态;也可与 `text` / `outlined` 组合弱化。"
|
|
1480
1486
|
},
|
|
1481
1487
|
{
|
|
1482
1488
|
"name": "raised",
|
|
@@ -1511,14 +1517,14 @@
|
|
|
1511
1517
|
{
|
|
1512
1518
|
"name": "ripple",
|
|
1513
1519
|
"type": "boolean",
|
|
1514
|
-
"default": "
|
|
1515
|
-
"description": "点击水波纹。设为 `
|
|
1520
|
+
"default": "false",
|
|
1521
|
+
"description": "点击水波纹。设为 `true` 可开启。"
|
|
1516
1522
|
},
|
|
1517
1523
|
{
|
|
1518
1524
|
"name": "press",
|
|
1519
1525
|
"type": "boolean",
|
|
1520
|
-
"default": "
|
|
1521
|
-
"description": "按下时轻微缩放。设为 `
|
|
1526
|
+
"default": "false",
|
|
1527
|
+
"description": "按下时轻微缩放。设为 `true` 可开启。"
|
|
1522
1528
|
},
|
|
1523
1529
|
{
|
|
1524
1530
|
"name": "nativeType",
|
|
@@ -1604,7 +1610,7 @@
|
|
|
1604
1610
|
"sectionId": "styles",
|
|
1605
1611
|
"lang": "vue",
|
|
1606
1612
|
"preview": true,
|
|
1607
|
-
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"grid gap-4 w-full\">\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Outlined\" outlined />\n <MButton label=\"Success\" severity=\"success\" outlined />\n <MButton label=\"Danger\" severity=\"danger\" outlined />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Raised\" raised />\n <MButton label=\"Rounded\" rounded />\n <MButton label=\"Plain Text\" text plain />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Small\" size=\"small\" />\n <MButton label=\"Large\" size=\"large\" />\n <MButton label=\"Fluid\" fluid />\n </div>\n </div>\n</template>",
|
|
1613
|
+
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"grid gap-4 w-full\">\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Outlined\" outlined />\n <MButton label=\"Success\" severity=\"success\" outlined />\n <MButton label=\"Danger\" severity=\"danger\" outlined />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Raised\" raised />\n <MButton label=\"Rounded\" rounded />\n <MButton label=\"Plain\" plain />\n <MButton label=\"Plain Text\" text plain />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Small\" size=\"small\" />\n <MButton label=\"Large\" size=\"large\" />\n <MButton label=\"Fluid\" fluid />\n </div>\n </div>\n</template>",
|
|
1608
1614
|
"locale": "zh-CN"
|
|
1609
1615
|
},
|
|
1610
1616
|
{
|
|
@@ -1613,7 +1619,7 @@
|
|
|
1613
1619
|
"sectionId": "text-link",
|
|
1614
1620
|
"lang": "vue",
|
|
1615
1621
|
"preview": true,
|
|
1616
|
-
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Text\" text />\n <MButton label=\"Text Danger\" text severity=\"danger\" />\n <MButton label=\"Link\" link />\n <MButton label=\"Link Secondary\" link severity=\"secondary\" />\n </div>\n</template>",
|
|
1622
|
+
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Text\" text />\n <MButton label=\"Text Danger\" text severity=\"danger\" />\n <MButton label=\"Link\" link />\n <MButton label=\"Link No Underline\" link :underline=\"false\" />\n <MButton label=\"Link Secondary\" link severity=\"secondary\" />\n </div>\n</template>",
|
|
1617
1623
|
"locale": "zh-CN"
|
|
1618
1624
|
},
|
|
1619
1625
|
{
|
|
@@ -1694,7 +1700,7 @@
|
|
|
1694
1700
|
"sectionId": "styles",
|
|
1695
1701
|
"lang": "vue",
|
|
1696
1702
|
"preview": true,
|
|
1697
|
-
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"grid gap-4 w-full\">\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Outlined\" outlined />\n <MButton label=\"Success\" severity=\"success\" outlined />\n <MButton label=\"Danger\" severity=\"danger\" outlined />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Raised\" raised />\n <MButton label=\"Rounded\" rounded />\n <MButton label=\"Plain Text\" text plain />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Small\" size=\"small\" />\n <MButton label=\"Large\" size=\"large\" />\n <MButton label=\"Fluid\" fluid />\n </div>\n </div>\n</template>",
|
|
1703
|
+
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"grid gap-4 w-full\">\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Outlined\" outlined />\n <MButton label=\"Success\" severity=\"success\" outlined />\n <MButton label=\"Danger\" severity=\"danger\" outlined />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Raised\" raised />\n <MButton label=\"Rounded\" rounded />\n <MButton label=\"Plain\" plain />\n <MButton label=\"Plain Text\" text plain />\n </div>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Small\" size=\"small\" />\n <MButton label=\"Large\" size=\"large\" />\n <MButton label=\"Fluid\" fluid />\n </div>\n </div>\n</template>",
|
|
1698
1704
|
"locale": "en-US"
|
|
1699
1705
|
},
|
|
1700
1706
|
{
|
|
@@ -1703,7 +1709,7 @@
|
|
|
1703
1709
|
"sectionId": "text-link",
|
|
1704
1710
|
"lang": "vue",
|
|
1705
1711
|
"preview": true,
|
|
1706
|
-
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Text\" text />\n <MButton label=\"Text Danger\" text severity=\"danger\" />\n <MButton label=\"Link\" link />\n <MButton label=\"Link Secondary\" link severity=\"secondary\" />\n </div>\n</template>",
|
|
1712
|
+
"code": "<script setup lang=\"ts\">\nimport { MButton } from 'morya-ui'\n</script>\n\n<template>\n <div class=\"flex flex-wrap gap-3 items-center\">\n <MButton label=\"Text\" text />\n <MButton label=\"Text Danger\" text severity=\"danger\" />\n <MButton label=\"Link\" link />\n <MButton label=\"Link No Underline\" link :underline=\"false\" />\n <MButton label=\"Link Secondary\" link severity=\"secondary\" />\n </div>\n</template>",
|
|
1707
1713
|
"locale": "en-US"
|
|
1708
1714
|
},
|
|
1709
1715
|
{
|
|
@@ -1785,12 +1791,12 @@
|
|
|
1785
1791
|
{
|
|
1786
1792
|
"id": "text-link",
|
|
1787
1793
|
"title": "Text & Link",
|
|
1788
|
-
"body": "`text` 为轻量文字按钮;`link`
|
|
1794
|
+
"body": "`text` 为轻量文字按钮;`link` 呈现为无背景的内联链接样式,默认悬浮下划线,设 `:underline=\"false\"` 可关闭。二者均可与 `severity` 组合。\n\n```vue preview src=\"./demos/TextAndLink.vue\"\n```"
|
|
1789
1795
|
},
|
|
1790
1796
|
{
|
|
1791
1797
|
"id": "ghost-quaternary",
|
|
1792
1798
|
"title": "Ghost & Quaternary",
|
|
1793
|
-
"body": "`ghost`
|
|
1799
|
+
"body": "`ghost` 为浅色填充,等同于 `text` 的悬浮态;`quaternary` 更克制,适合工具栏次要操作。也可通过 `variant` 指定。\n\n```vue preview src=\"./demos/GhostAndQuaternary.vue\"\n```"
|
|
1794
1800
|
},
|
|
1795
1801
|
{
|
|
1796
1802
|
"id": "button-group",
|
|
@@ -1815,7 +1821,7 @@
|
|
|
1815
1821
|
{
|
|
1816
1822
|
"id": "props",
|
|
1817
1823
|
"title": "Props",
|
|
1818
|
-
"body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `label` | `string` | — | 按钮文案。存在默认插槽内容时以插槽为准。 |\n| `icon` | `IconName \\| Component` | — | 图标名称或自定义组件。 |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | 图标相对标签的位置。 |\n| `iconOnly` | `boolean` | `false` | 强制方形纯图标按钮。 |\n| `badge` | `string` | — | 徽标文本。 |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | 徽标语义色。 |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | 语义色。省略时为 primary。 |\n| `color` | `string` | — | 自定义颜色,覆盖 `severity`。 |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | 尺寸。默认中等;兼容 `sm` / `lg`。 |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | 样式变体快捷方式,等价于对应布尔 prop。 |\n| `outlined` | `boolean` | `false` | 描边按钮。 |\n| `text` | `boolean` | `false` | 文字按钮。 |\n| `link` | `boolean` | `false` | 链接按钮。 |\n| `ghost` | `boolean` | `false` |
|
|
1824
|
+
"body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `label` | `string` | — | 按钮文案。存在默认插槽内容时以插槽为准。 |\n| `icon` | `IconName \\| Component` | — | 图标名称或自定义组件。 |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | 图标相对标签的位置。 |\n| `iconOnly` | `boolean` | `false` | 强制方形纯图标按钮。 |\n| `badge` | `string` | — | 徽标文本。 |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | 徽标语义色。 |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | 语义色。省略时为 primary。 |\n| `color` | `string` | — | 自定义颜色,覆盖 `severity`。 |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | 尺寸。默认中等;兼容 `sm` / `lg`。 |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | 样式变体快捷方式,等价于对应布尔 prop。 |\n| `outlined` | `boolean` | `false` | 描边按钮。 |\n| `text` | `boolean` | `false` | 文字按钮。 |\n| `link` | `boolean` | `false` | 链接按钮。 |\n| `underline` | `boolean` | `true` | `link` 悬浮下划线。设为 `false` 可关闭。 |\n| `ghost` | `boolean` | `false` | 浅色填充,等同于 `text` 的悬浮态。 |\n| `quaternary` | `boolean` | `false` | 极轻量文字按钮。 |\n| `plain` | `boolean` | `false` | 浅色填充,等同于 `outlined` 的悬浮态;也可与 `text` / `outlined` 组合弱化。 |\n| `raised` | `boolean` | `false` | 浮起阴影。 |\n| `rounded` | `boolean` | `false` | 全圆角。 |\n| `fluid` | `boolean` | `false` | 宽度撑满容器。 |\n| `loading` | `boolean` | `false` | 加载中,禁用点击并显示 spinner。 |\n| `disabled` | `boolean` | `false` | 禁用。 |\n| `ripple` | `boolean` | `false` | 点击水波纹。设为 `true` 可开启。 |\n| `press` | `boolean` | `false` | 按下时轻微缩放。设为 `true` 可开启。 |\n| `nativeType` | `'button' \\| 'submit' \\| 'reset'` | `'button'` | 原生 button type。 |\n| `autofocus` | `boolean` | `false` | 原生 autofocus。 |\n| `ariaLabel` | `string` | — | 可访问名称;图标按钮建议提供。 |"
|
|
1819
1825
|
},
|
|
1820
1826
|
{
|
|
1821
1827
|
"id": "events",
|
|
@@ -1838,7 +1844,7 @@
|
|
|
1838
1844
|
"body": "- 渲染原生 `<button>`。\n- 纯图标按钮请设置 `ariaLabel`(或可访问的文本标签)。\n- `loading` 时设置 `aria-busy`,并禁用交互。"
|
|
1839
1845
|
}
|
|
1840
1846
|
],
|
|
1841
|
-
"markdown": "---\ntitle: Button\ncategory: 01 / BASIC\ndescription: 按钮用于触发即时动作。\n---\n\n# Button\n\n按钮用于触发即时动作。\n\n## 引入\n\n```ts\nimport { MButton } from 'morya-ui'\n```\n\n## 基础用法\n\n通过默认插槽或 `label` 展示按钮文案。\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Severity\n\n使用 `severity` 定义按钮语义色;省略时为 primary。\n\n```vue preview src=\"./demos/Severity.vue\"\n```\n\n## Styles\n\n`outlined`、`text`、`link`、`raised`、`rounded`、`plain` 可自由组合。\n\n```vue preview src=\"./demos/Styles.vue\"\n```\n\n## Text & Link\n\n`text` 为轻量文字按钮;`link`
|
|
1847
|
+
"markdown": "---\ntitle: Button\ncategory: 01 / BASIC\ndescription: 按钮用于触发即时动作。\n---\n\n# Button\n\n按钮用于触发即时动作。\n\n## 引入\n\n```ts\nimport { MButton } from 'morya-ui'\n```\n\n## 基础用法\n\n通过默认插槽或 `label` 展示按钮文案。\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Severity\n\n使用 `severity` 定义按钮语义色;省略时为 primary。\n\n```vue preview src=\"./demos/Severity.vue\"\n```\n\n## Styles\n\n`outlined`、`text`、`link`、`raised`、`rounded`、`plain` 可自由组合。\n\n```vue preview src=\"./demos/Styles.vue\"\n```\n\n## Text & Link\n\n`text` 为轻量文字按钮;`link` 呈现为无背景的内联链接样式,默认悬浮下划线,设 `:underline=\"false\"` 可关闭。二者均可与 `severity` 组合。\n\n```vue preview src=\"./demos/TextAndLink.vue\"\n```\n\n## Ghost & Quaternary\n\n`ghost` 为浅色填充,等同于 `text` 的悬浮态;`quaternary` 更克制,适合工具栏次要操作。也可通过 `variant` 指定。\n\n```vue preview src=\"./demos/GhostAndQuaternary.vue\"\n```\n\n## Button Group\n\n`MButtonGroup` 将相邻按钮拼成一组。\n\n```vue preview src=\"./demos/ButtonGroup.zh.vue\"\n```\n\n## Icons & Badge\n\n支持 `icon`、`iconPos`、`iconOnly`,以及 `badge` 徽标。\n\n```vue preview src=\"./demos/IconsAndBadge.vue\"\n```\n\n## Loading\n\n`loading` 状态下显示 spinner 并阻止点击。\n\n```vue preview src=\"./demos/Loading.vue\"\n```\n\n## Disabled\n\n```vue preview src=\"./demos/Disabled.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `label` | `string` | — | 按钮文案。存在默认插槽内容时以插槽为准。 |\n| `icon` | `IconName \\| Component` | — | 图标名称或自定义组件。 |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | 图标相对标签的位置。 |\n| `iconOnly` | `boolean` | `false` | 强制方形纯图标按钮。 |\n| `badge` | `string` | — | 徽标文本。 |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | 徽标语义色。 |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | 语义色。省略时为 primary。 |\n| `color` | `string` | — | 自定义颜色,覆盖 `severity`。 |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | 尺寸。默认中等;兼容 `sm` / `lg`。 |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | 样式变体快捷方式,等价于对应布尔 prop。 |\n| `outlined` | `boolean` | `false` | 描边按钮。 |\n| `text` | `boolean` | `false` | 文字按钮。 |\n| `link` | `boolean` | `false` | 链接按钮。 |\n| `underline` | `boolean` | `true` | `link` 悬浮下划线。设为 `false` 可关闭。 |\n| `ghost` | `boolean` | `false` | 浅色填充,等同于 `text` 的悬浮态。 |\n| `quaternary` | `boolean` | `false` | 极轻量文字按钮。 |\n| `plain` | `boolean` | `false` | 浅色填充,等同于 `outlined` 的悬浮态;也可与 `text` / `outlined` 组合弱化。 |\n| `raised` | `boolean` | `false` | 浮起阴影。 |\n| `rounded` | `boolean` | `false` | 全圆角。 |\n| `fluid` | `boolean` | `false` | 宽度撑满容器。 |\n| `loading` | `boolean` | `false` | 加载中,禁用点击并显示 spinner。 |\n| `disabled` | `boolean` | `false` | 禁用。 |\n| `ripple` | `boolean` | `false` | 点击水波纹。设为 `true` 可开启。 |\n| `press` | `boolean` | `false` | 按下时轻微缩放。设为 `true` 可开启。 |\n| `nativeType` | `'button' \\| 'submit' \\| 'reset'` | `'button'` | 原生 button type。 |\n| `autofocus` | `boolean` | `false` | 原生 autofocus。 |\n| `ariaLabel` | `string` | — | 可访问名称;图标按钮建议提供。 |\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `click` | `MouseEvent` | 启用状态下点击触发。 |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 按钮内容,优先于 `label`。 |\n| `icon` | 自定义图标。 |\n| `loadingicon` | 自定义加载图标。 |\n\n## Instance\n\n| 方法 / 属性 | 说明 |\n| --- | --- |\n| `focus()` | 聚焦底层 button。 |\n| `ref` | 底层 `HTMLButtonElement`。 |\n\n## 无障碍\n\n- 渲染原生 `<button>`。\n- 纯图标按钮请设置 `ariaLabel`(或可访问的文本标签)。\n- `loading` 时设置 `aria-busy`,并禁用交互。\n"
|
|
1842
1848
|
},
|
|
1843
1849
|
"en-US": {
|
|
1844
1850
|
"title": "Button",
|
|
@@ -1872,12 +1878,12 @@
|
|
|
1872
1878
|
{
|
|
1873
1879
|
"id": "text-link",
|
|
1874
1880
|
"title": "Text & Link",
|
|
1875
|
-
"body": "`text` is a lightweight text button; `link` renders as
|
|
1881
|
+
"body": "`text` is a lightweight text button; `link` renders as a backgroundless inline link style with underline on hover by default. Set `:underline=\"false\"` to disable. Both can be combined with `severity`.\n\n```vue preview src=\"./demos/TextAndLink.vue\"\n```"
|
|
1876
1882
|
},
|
|
1877
1883
|
{
|
|
1878
1884
|
"id": "ghost-quaternary",
|
|
1879
1885
|
"title": "Ghost & Quaternary",
|
|
1880
|
-
"body": "`ghost` is a
|
|
1886
|
+
"body": "`ghost` is a soft fill matching text hover; `quaternary` is quieter for secondary toolbar actions. Both can be set via `variant`.\n\n```vue preview src=\"./demos/GhostAndQuaternary.vue\"\n```"
|
|
1881
1887
|
},
|
|
1882
1888
|
{
|
|
1883
1889
|
"id": "button-group",
|
|
@@ -1902,7 +1908,7 @@
|
|
|
1902
1908
|
{
|
|
1903
1909
|
"id": "props",
|
|
1904
1910
|
"title": "Props",
|
|
1905
|
-
"body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | — | Button text. Default slot content takes precedence when present. |\n| `icon` | `IconName \\| Component` | — | Icon name or custom component. |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | Icon position relative to the label. |\n| `iconOnly` | `boolean` | `false` | Force a square icon-only button. |\n| `badge` | `string` | — | Badge text. |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | Badge semantic color. |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | Semantic color. Defaults to primary when omitted. |\n| `color` | `string` | — | Custom color; overrides `severity`. |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | Size. Medium by default; `sm` / `lg` aliases supported. |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | Style variant shortcut, equivalent to the matching boolean prop. |\n| `outlined` | `boolean` | `false` | Outlined button. |\n| `text` | `boolean` | `false` | Text button. |\n| `link` | `boolean` | `false` | Link button. |\n| `ghost` | `boolean` | `false` |
|
|
1911
|
+
"body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | — | Button text. Default slot content takes precedence when present. |\n| `icon` | `IconName \\| Component` | — | Icon name or custom component. |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | Icon position relative to the label. |\n| `iconOnly` | `boolean` | `false` | Force a square icon-only button. |\n| `badge` | `string` | — | Badge text. |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | Badge semantic color. |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | Semantic color. Defaults to primary when omitted. |\n| `color` | `string` | — | Custom color; overrides `severity`. |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | Size. Medium by default; `sm` / `lg` aliases supported. |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | Style variant shortcut, equivalent to the matching boolean prop. |\n| `outlined` | `boolean` | `false` | Outlined button. |\n| `text` | `boolean` | `false` | Text button. |\n| `link` | `boolean` | `false` | Link button. |\n| `underline` | `boolean` | `true` | Underline on hover for `link`. Set `false` to disable. |\n| `ghost` | `boolean` | `false` | Soft fill matching text hover. |\n| `quaternary` | `boolean` | `false` | Extra-quiet text button. |\n| `plain` | `boolean` | `false` | Soft fill matching outlined hover; can also mute `text` / `outlined`. |\n| `raised` | `boolean` | `false` | Raised shadow. |\n| `rounded` | `boolean` | `false` | Fully rounded. |\n| `fluid` | `boolean` | `false` | Stretch to full container width. |\n| `loading` | `boolean` | `false` | Loading state; disables clicks and shows a spinner. |\n| `disabled` | `boolean` | `false` | Disabled. |\n| `ripple` | `boolean` | `false` | Click ripple ink. Set `true` to enable. |\n| `press` | `boolean` | `false` | Slight scale while pressed. Set `true` to enable. |\n| `nativeType` | `'button' \\| 'submit' \\| 'reset'` | `'button'` | Native button type. |\n| `autofocus` | `boolean` | `false` | Native autofocus. |\n| `ariaLabel` | `string` | — | Accessible name; recommended for icon-only buttons. |"
|
|
1906
1912
|
},
|
|
1907
1913
|
{
|
|
1908
1914
|
"id": "events",
|
|
@@ -1925,7 +1931,7 @@
|
|
|
1925
1931
|
"body": "- Renders a native `<button>`.\n- For icon-only buttons, set `ariaLabel` (or provide an accessible text label).\n- Sets `aria-busy` while `loading` and disables interaction."
|
|
1926
1932
|
}
|
|
1927
1933
|
],
|
|
1928
|
-
"markdown": "---\ntitle: Button\ncategory: 01 / BASIC\ndescription: Button triggers an immediate action.\n---\n\n# Button\n\nButton triggers an immediate action.\n\n## Import\n\n```ts\nimport { MButton } from 'morya-ui'\n```\n\n## Basic\n\nShow button text via the default slot or the `label` prop.\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Severity\n\nUse `severity` for semantic color; defaults to primary when omitted.\n\n```vue preview src=\"./demos/Severity.vue\"\n```\n\n## Styles\n\n`outlined`, `text`, `link`, `raised`, `rounded`, and `plain` can be combined freely.\n\n```vue preview src=\"./demos/Styles.vue\"\n```\n\n## Text & Link\n\n`text` is a lightweight text button; `link` renders as
|
|
1934
|
+
"markdown": "---\ntitle: Button\ncategory: 01 / BASIC\ndescription: Button triggers an immediate action.\n---\n\n# Button\n\nButton triggers an immediate action.\n\n## Import\n\n```ts\nimport { MButton } from 'morya-ui'\n```\n\n## Basic\n\nShow button text via the default slot or the `label` prop.\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Severity\n\nUse `severity` for semantic color; defaults to primary when omitted.\n\n```vue preview src=\"./demos/Severity.vue\"\n```\n\n## Styles\n\n`outlined`, `text`, `link`, `raised`, `rounded`, and `plain` can be combined freely.\n\n```vue preview src=\"./demos/Styles.vue\"\n```\n\n## Text & Link\n\n`text` is a lightweight text button; `link` renders as a backgroundless inline link style with underline on hover by default. Set `:underline=\"false\"` to disable. Both can be combined with `severity`.\n\n```vue preview src=\"./demos/TextAndLink.vue\"\n```\n\n## Ghost & Quaternary\n\n`ghost` is a soft fill matching text hover; `quaternary` is quieter for secondary toolbar actions. Both can be set via `variant`.\n\n```vue preview src=\"./demos/GhostAndQuaternary.vue\"\n```\n\n## Button Group\n\n`MButtonGroup` joins adjacent buttons.\n\n```vue preview src=\"./demos/ButtonGroup.en.vue\"\n```\n\n## Icons & Badge\n\nSupports `icon`, `iconPos`, `iconOnly`, and a `badge`.\n\n```vue preview src=\"./demos/IconsAndBadge.vue\"\n```\n\n## Loading\n\nIn the `loading` state, a spinner is shown and clicks are blocked.\n\n```vue preview src=\"./demos/Loading.vue\"\n```\n\n## Disabled\n\n```vue preview src=\"./demos/Disabled.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | — | Button text. Default slot content takes precedence when present. |\n| `icon` | `IconName \\| Component` | — | Icon name or custom component. |\n| `iconPos` | `'left' \\| 'right' \\| 'top' \\| 'bottom'` | `'left'` | Icon position relative to the label. |\n| `iconOnly` | `boolean` | `false` | Force a square icon-only button. |\n| `badge` | `string` | — | Badge text. |\n| `badgeSeverity` | `'secondary' \\| 'info' \\| 'success' \\| 'warn' \\| 'danger' \\| 'contrast' \\| null` | `null` | Badge semantic color. |\n| `severity` | `'secondary' \\| 'success' \\| 'info' \\| 'warn' \\| 'help' \\| 'danger' \\| 'contrast'` | — | Semantic color. Defaults to primary when omitted. |\n| `color` | `string` | — | Custom color; overrides `severity`. |\n| `size` | `'small' \\| 'large' \\| 'sm' \\| 'md' \\| 'lg'` | — | Size. Medium by default; `sm` / `lg` aliases supported. |\n| `variant` | `'outlined' \\| 'text' \\| 'link' \\| 'ghost' \\| 'quaternary'` | — | Style variant shortcut, equivalent to the matching boolean prop. |\n| `outlined` | `boolean` | `false` | Outlined button. |\n| `text` | `boolean` | `false` | Text button. |\n| `link` | `boolean` | `false` | Link button. |\n| `underline` | `boolean` | `true` | Underline on hover for `link`. Set `false` to disable. |\n| `ghost` | `boolean` | `false` | Soft fill matching text hover. |\n| `quaternary` | `boolean` | `false` | Extra-quiet text button. |\n| `plain` | `boolean` | `false` | Soft fill matching outlined hover; can also mute `text` / `outlined`. |\n| `raised` | `boolean` | `false` | Raised shadow. |\n| `rounded` | `boolean` | `false` | Fully rounded. |\n| `fluid` | `boolean` | `false` | Stretch to full container width. |\n| `loading` | `boolean` | `false` | Loading state; disables clicks and shows a spinner. |\n| `disabled` | `boolean` | `false` | Disabled. |\n| `ripple` | `boolean` | `false` | Click ripple ink. Set `true` to enable. |\n| `press` | `boolean` | `false` | Slight scale while pressed. Set `true` to enable. |\n| `nativeType` | `'button' \\| 'submit' \\| 'reset'` | `'button'` | Native button type. |\n| `autofocus` | `boolean` | `false` | Native autofocus. |\n| `ariaLabel` | `string` | — | Accessible name; recommended for icon-only buttons. |\n\n## Events\n\n| Event | Prop | Description |\n| --- | --- | --- |\n| `click` | `MouseEvent` | Fired on click when enabled. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Button content; takes precedence over `label`. |\n| `icon` | Custom icon. |\n| `loadingicon` | Custom loading icon. |\n\n## Instance\n\n| Method / Property | Description |\n| --- | --- |\n| `focus()` | Focus the underlying button. |\n| `ref` | Underlying `HTMLButtonElement`. |\n\n## Accessibility\n\n- Renders a native `<button>`.\n- For icon-only buttons, set `ariaLabel` (or provide an accessible text label).\n- Sets `aria-busy` while `loading` and disables interaction.\n"
|
|
1929
1935
|
}
|
|
1930
1936
|
}
|
|
1931
1937
|
},
|
|
@@ -16324,7 +16330,7 @@
|
|
|
16324
16330
|
{
|
|
16325
16331
|
"name": "transition",
|
|
16326
16332
|
"type": "string | false",
|
|
16327
|
-
"default": "'
|
|
16333
|
+
"default": "'scale-fade'",
|
|
16328
16334
|
"description": "进出场动效预设;`false` / `'none'` 关闭。见[动效](/docs/motion)。"
|
|
16329
16335
|
},
|
|
16330
16336
|
{
|
|
@@ -16488,7 +16494,7 @@
|
|
|
16488
16494
|
{
|
|
16489
16495
|
"id": "props",
|
|
16490
16496
|
"title": "Props",
|
|
16491
|
-
"body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | 相对触发元素的位置。 |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | 打开方式。 |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | hover/focus 延迟(ms)。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'
|
|
16497
|
+
"body": "| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | 相对触发元素的位置。 |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | 打开方式。 |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | hover/focus 延迟(ms)。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'scale-fade'` | 进出场动效预设;`false` / `'none'` 关闭。见[动效](/docs/motion)。 |\n| `disabled` | `boolean` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |"
|
|
16492
16498
|
},
|
|
16493
16499
|
{
|
|
16494
16500
|
"id": "events",
|
|
@@ -16506,7 +16512,7 @@
|
|
|
16506
16512
|
"body": "| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 触发元素。 |\n| `content` | 浮层内容。 |"
|
|
16507
16513
|
}
|
|
16508
16514
|
],
|
|
16509
|
-
"markdown": "---\ntitle: Popover\ncategory: 05 / FEEDBACK\ndescription: 相对触发元素定位的浮层面板。支持 placement、Teleport;点击外部或 Esc 关闭。\n---\n\n# Popover\n\n相对触发元素显示的浮层,适合筛选、快捷操作或轻量表单。\n\n## 引入\n\n```ts\nimport { MButton, MPopover } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Placement\n\n```vue preview src=\"./demos/Placement.vue\"\n```\n\n## Hover\n\n`trigger` 默认 `manual`(仅 `v-model`)。设为 `hover` / `click` / `focus` 由组件自行开关。\n\n```vue preview src=\"./demos/Hover.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | 相对触发元素的位置。 |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | 打开方式。 |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | hover/focus 延迟(ms)。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'
|
|
16515
|
+
"markdown": "---\ntitle: Popover\ncategory: 05 / FEEDBACK\ndescription: 相对触发元素定位的浮层面板。支持 placement、Teleport;点击外部或 Esc 关闭。\n---\n\n# Popover\n\n相对触发元素显示的浮层,适合筛选、快捷操作或轻量表单。\n\n## 引入\n\n```ts\nimport { MButton, MPopover } from 'morya-ui'\n```\n\n## 基础用法\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Placement\n\n```vue preview src=\"./demos/Placement.vue\"\n```\n\n## Hover\n\n`trigger` 默认 `manual`(仅 `v-model`)。设为 `hover` / `click` / `focus` 由组件自行开关。\n\n```vue preview src=\"./demos/Hover.vue\"\n```\n\n## Props\n\n| 参数 | 类型 | 默认值 | 说明 |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | 可见性。配合 `v-model` 使用。 |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | 相对触发元素的位置。 |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | 打开方式。 |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | hover/focus 延迟(ms)。 |\n| `teleport` | `boolean` | `true` | 浮层 Teleport;默认挂到 `body`。 |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | 挂载目标;`'self'` / `false` 就地渲染。 |\n| `transition` | `string \\| false` | `'scale-fade'` | 进出场动效预设;`false` / `'none'` 关闭。见[动效](/docs/motion)。 |\n| `disabled` | `boolean` | — | — |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | DOM 透传,见 [样式与 attrs](/docs/attrs). |\n\n\n## Events\n\n| 事件名 | 参数 | 说明 |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | 可见性变化。 |\n| `show` | — | 打开时触发。 |\n| `hide` | — | 关闭后触发。 |\n\n## Methods\n\n| 方法 | 说明 |\n| --- | --- |\n| `show()` | 显示浮层。 |\n| `hide()` | 隐藏浮层。 |\n| `toggle()` | 切换显示状态。 |\n\n## Slots\n\n| 插槽名 | 说明 |\n| --- | --- |\n| `default` | 触发元素。 |\n| `content` | 浮层内容。 |\n"
|
|
16510
16516
|
},
|
|
16511
16517
|
"en-US": {
|
|
16512
16518
|
"title": "Popover",
|
|
@@ -16540,7 +16546,7 @@
|
|
|
16540
16546
|
{
|
|
16541
16547
|
"id": "props",
|
|
16542
16548
|
"title": "Props",
|
|
16543
|
-
"body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | Position relative to the trigger. |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | How it opens. |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | Hover/focus delay in ms. |\n| `teleport` | `boolean` | `true` | Overlay Teleport. Mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target. `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'
|
|
16549
|
+
"body": "| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | Position relative to the trigger. |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | How it opens. |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | Hover/focus delay in ms. |\n| `teleport` | `boolean` | `true` | Overlay Teleport. Mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target. `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'scale-fade'` | Enter/exit motion preset; `false` / `'none'` disables. See [Motion](/docs/motion). |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |"
|
|
16544
16550
|
},
|
|
16545
16551
|
{
|
|
16546
16552
|
"id": "events",
|
|
@@ -16558,7 +16564,7 @@
|
|
|
16558
16564
|
"body": "| Slot | Description |\n| --- | --- |\n| `default` | Trigger element. |\n| `content` | Overlay content. |"
|
|
16559
16565
|
}
|
|
16560
16566
|
],
|
|
16561
|
-
"markdown": "---\ntitle: Popover\ncategory: 05 / FEEDBACK\ndescription: Floating panel positioned relative to a trigger. Supports placement and Teleport. Closes on outside click or Esc.\n---\n\n# Popover\n\nOverlay positioned relative to a trigger. Use it for filters, quick actions, or lightweight forms.\n\n## Import\n\n```ts\nimport { MButton, MPopover } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Placement\n\n```vue preview src=\"./demos/Placement.vue\"\n```\n\n## Hover\n\n`trigger` defaults to `manual` (`v-model` only). Use `hover` / `click` / `focus` to let the component open itself.\n\n```vue preview src=\"./demos/Hover.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | Position relative to the trigger. |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | How it opens. |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | Hover/focus delay in ms. |\n| `teleport` | `boolean` | `true` | Overlay Teleport. Mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target. `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'
|
|
16567
|
+
"markdown": "---\ntitle: Popover\ncategory: 05 / FEEDBACK\ndescription: Floating panel positioned relative to a trigger. Supports placement and Teleport. Closes on outside click or Esc.\n---\n\n# Popover\n\nOverlay positioned relative to a trigger. Use it for filters, quick actions, or lightweight forms.\n\n## Import\n\n```ts\nimport { MButton, MPopover } from 'morya-ui'\n```\n\n## Basic\n\n```vue preview src=\"./demos/Basic.vue\"\n```\n\n## Placement\n\n```vue preview src=\"./demos/Placement.vue\"\n```\n\n## Hover\n\n`trigger` defaults to `manual` (`v-model` only). Use `hover` / `click` / `focus` to let the component open itself.\n\n```vue preview src=\"./demos/Hover.vue\"\n```\n\n## Props\n\n| Prop | Type | Default | Description |\n| --- | --- | --- | --- |\n| `modelValue` | `boolean` | `false` | Visibility. Use with `v-model`. |\n| `placement` | `'top' \\| 'bottom' \\| 'left' \\| 'right' \\| 'bottom-start' \\| 'bottom-end'` | `'bottom'` | Position relative to the trigger. |\n| `trigger` | `'manual' \\| 'click' \\| 'hover' \\| 'focus'` | `'manual'` | How it opens. |\n| `showDelay` / `hideDelay` | `number` | `0` / `200` | Hover/focus delay in ms. |\n| `teleport` | `boolean` | `true` | Overlay Teleport. Mounts to `body` by default. |\n| `appendTo` | `string \\| HTMLElement \\| 'self' \\| false` | `'body'` | Mount target. `'self'` / `false` renders in place. |\n| `transition` | `string \\| false` | `'scale-fade'` | Enter/exit motion preset; `false` / `'none'` disables. See [Motion](/docs/motion). |\n| `pt` | [RootPassThrough](/docs/types#RootPassThrough) `{ root? }` | — | Pass-through; see [Styling & attrs](/docs/attrs). |\n\n\n## Events\n\n| Event | Prop | Description |\n| --- | --- | --- |\n| `update:modelValue` | `boolean` | Emitted when visibility changes. |\n| `show` | — | Emitted when opened. |\n| `hide` | — | Emitted after close. |\n\n## Methods\n\n| Method | Description |\n| --- | --- |\n| `show()` | Show the popover. |\n| `hide()` | Hide the popover. |\n| `toggle()` | Toggle visibility. |\n\n## Slots\n\n| Slot | Description |\n| --- | --- |\n| `default` | Trigger element. |\n| `content` | Overlay content. |\n"
|
|
16562
16568
|
}
|
|
16563
16569
|
}
|
|
16564
16570
|
},
|
|
@@ -27859,7 +27865,7 @@
|
|
|
27859
27865
|
"zh-CN": {
|
|
27860
27866
|
"title": "Agent Skill",
|
|
27861
27867
|
"description": "消费方 morya-ui-pages skill:何时触发、与 rules/MCP 分工、页面类型地图。",
|
|
27862
|
-
"markdown": "---\ntitle: Agent Skill\norder: 13\ndescription: 消费方 morya-ui-pages skill:何时触发、与 rules/MCP 分工、页面类型地图。\n---\n\n# Agent Skill\n\n消费方用 AI 生成 **基于 `morya-ui` 的业务页面** 时,应加载 **`morya-ui-pages`** skill。它规定组件契约、页面类型与工作流;**不是**组件库源码里写新组件用的 skill。\n\n安装方式见 [一键接入](/docs/setup)(`npx @morya-ui/setup` 会复制到项目);AI 侧流程见 [AI 接入](/docs/ai-setup)。本文说明 skill **是什么、何时用、和其它配置怎么分工**。\n\n## 装到哪里\n\n```text\n.agents/skills/morya-ui-pages/\n├── SKILL.md\n└── references/ # 布局、表面、令牌、反馈、检查清单等\n```\n\n支持 Agent Skills 自动发现的客户端(如 Cursor)会从 `.agents/skills` 读取。生成列表 / 表单 / 登录 / 落地等页面前,应优先匹配本 skill。\n\n源文件在仓库 [`design-kit/.agents/skills/morya-ui-pages/`](https://github.com/morya-space/morya-ui/tree/main/design-kit/.agents/skills/morya-ui-pages),随 `@morya-ui/setup` 的 template 同步。可选 companion(`frontend-design`、`fixing-accessibility`、`impeccable`)由 setup 通过 skills CLI 安装**最新版**,见 [一键接入](/docs/setup)。\n\n## 何时触发\n\n典型话术或主题:\n\n- `morya-ui`、`M*` 组件、`--m-*` 令牌、黄金样例\n- 后台 / 列表 / 表单 / 仪表盘 / 详情 / 设置\n- 登录 / 注册 / 空状态 / 向导 / 落地页 / 官网\n\n**优先于**通用 `frontend-design`、Impeccable、UI-UX-Pro-Max 等:那些只能当审美参考;栈是 morya-ui 时以本 skill 为准。\n\n**不要**用于:纯后端、或在本仓库 `src/components` 里新增组件库组件。\n\n## 与其它配置的分工\n\n| 层 | 角色 |\n| --- | --- |\n| [一键接入](/docs/setup) / `@morya-ui/setup` | 一次性把库 + skill + rules + MCP 装进项目 |\n| [AI 接入](/docs/ai-setup) | 装好后如何配合 Agent 生成页面 |\n| **`morya-ui-pages` skill** | 按需工作流:选表面、读黄金样例、组 `M*`、自检 |\n| `.cursor/rules/` | 编辑器常驻短规则(设计系统、组件用法、布局) |\n| `DESIGN.md` | 项目设计第一信源;与 skill 冲突时以项目 `DESIGN.md` 为准 |\n| [Agent MCP](/docs/mcp) | 运行时查真实 Props / Events / 示例,禁止臆造 API |\n\n两层始终生效:\n\n1. **契约** — 只用 `M*` 与 `--m-*`,API 以 MCP / 文档为准 \n2. **工艺** — 先定表面类型,再做视觉;后台偏克制,落地 / 品牌向可有意表达,但仍上令牌、上组件\n\n## 页面类型(Surface)地图\n\n| 车道 | 典型表面 | 优先参考 |\n| --- | --- | --- |\n| **Ops** | 列表、表单、仪表盘、详情、设置、筛选抽屉 | 黄金样例 + skill `page-layouts` |\n| **Account** | 登录、注册、邀请、重置密码、个人资料 | skill `surfaces` § Account |\n| **Flow** | 引导、空状态、向导、成功页 | skill `surfaces` § Flow |\n| **System** | 404、无权限、维护中 | skill `surfaces` § System |\n| **Express** | 营销落地、定价、功能展示 | skill `surfaces` + `visual-craft` |\n| **Overlay** | 以 Dialog / Drawer / CommandMenu 为主界面 | skill `surfaces` § Overlay |\n\n不确定时:后台默认 Ops → 最近黄金样例;对外营销 → Express。\n\n## Agent 推荐工作流(摘要)\n\n1. 钉死主体、受众、表面、第一屏单一任务 \n2. 优先 MCP:`recommend_page` → **`get_golden_page`(镜像)** → `get_component` / `get_example` \n3. 无 MCP 时读 skill `references/`(布局、表面、反馈) \n4. 反馈默认 `message`;`toast` 仅 summary+detail / 异步感。表单常驻错误用字段 `errorMessage` 或 token 样式的 `role=\"alert\"`,不要把 `<MMessage>` 当成内嵌 Alert。表格行数据用 `rows`。交付前默认做一轮 craft(Ops polish / 氛围配方,见 skill `visual-craft`)。 \n5. **必须**跑 MCP `validate_usage`(API 准确)与 `validate_page`(布局/契约建议);对照 skill 检查清单\n\n细节与硬边界以项目内 `SKILL.md` 为准,本文不重复全文。\n\n## 下一步\n\n- [一键接入](/docs/setup):安装 skill 与其它配置 \n- [AI 接入](/docs/ai-setup):用 AI 生成页面时的流程 \n- [Agent MCP](/docs/mcp):工具与客户端配置 \n- [快速上手](/docs/quick-start):手写安装组件库 \n- [组件](/components):浏览 API\n",
|
|
27868
|
+
"markdown": "---\ntitle: Agent Skill\norder: 13\ndescription: 消费方 morya-ui-pages skill:何时触发、与 rules/MCP 分工、页面类型地图。\n---\n\n# Agent Skill\n\n消费方用 AI 生成 **基于 `morya-ui` 的业务页面** 时,应加载 **`morya-ui-pages`** skill。它规定组件契约、页面类型与工作流;**不是**组件库源码里写新组件用的 skill。\n\n安装方式见 [一键接入](/docs/setup)(`npx @morya-ui/setup` 会复制到项目);AI 侧流程见 [AI 接入](/docs/ai-setup)。本文说明 skill **是什么、何时用、和其它配置怎么分工**。\n\n## 装到哪里\n\n```text\n.agents/skills/morya-ui-pages/\n├── SKILL.md\n└── references/ # 布局、表面、令牌、反馈、检查清单等\n```\n\n支持 Agent Skills 自动发现的客户端(如 Cursor)会从 `.agents/skills` 读取。生成列表 / 表单 / 登录 / 落地等页面前,应优先匹配本 skill。\n\n源文件在仓库 [`design-kit/.agents/skills/morya-ui-pages/`](https://github.com/morya-space/morya-ui/tree/main/design-kit/.agents/skills/morya-ui-pages),随 `@morya-ui/setup` 的 template 同步。可选 companion(`frontend-design`、`fixing-accessibility`、`impeccable`)由 setup 通过 skills CLI 安装**最新版**,见 [一键接入](/docs/setup)。\n\n## 何时触发\n\n典型话术或主题:\n\n- `morya-ui`、`M*` 组件、`--m-*` 令牌、黄金样例\n- 后台 / 列表 / 表单 / 仪表盘 / 详情 / 设置\n- 登录 / 注册 / 空状态 / 向导 / 落地页 / 官网\n\n**优先于**通用 `frontend-design`、Impeccable、UI-UX-Pro-Max 等:那些只能当审美参考;栈是 morya-ui 时以本 skill 为准。\n\n**不要**用于:纯后端、或在本仓库 `src/components` 里新增组件库组件。\n\n## 与其它配置的分工\n\n| 层 | 角色 |\n| --- | --- |\n| [一键接入](/docs/setup) / `@morya-ui/setup` | 一次性把库 + skill + rules + MCP 装进项目 |\n| [AI 接入](/docs/ai-setup) | 装好后如何配合 Agent 生成页面 |\n| **`morya-ui-pages` skill** | 按需工作流:选表面、读黄金样例、组 `M*`、自检 |\n| `.cursor/rules/` | 编辑器常驻短规则(设计系统、组件用法、布局) |\n| `DESIGN.md` | 项目设计第一信源;与 skill 冲突时以项目 `DESIGN.md` 为准 |\n| [Agent MCP](/docs/mcp) | 运行时查真实 Props / Events / 示例,禁止臆造 API |\n\n两层始终生效:\n\n1. **契约** — 只用 `M*` 与 `--m-*`,API 以 MCP / 文档为准 \n2. **工艺** — 先定表面类型,再做视觉;后台偏克制,落地 / 品牌向可有意表达,但仍上令牌、上组件\n\n## 页面类型(Surface)地图\n\n| 车道 | 典型表面 | 优先参考 |\n| --- | --- | --- |\n| **Ops** | 列表、表单、仪表盘、详情、设置、筛选抽屉 | 黄金样例 + skill `page-layouts` |\n| **Account** | 登录、注册、邀请、重置密码、个人资料 | skill `surfaces` § Account |\n| **Flow** | 引导、空状态、向导、成功页 | skill `surfaces` § Flow |\n| **System** | 404、无权限、维护中 | skill `surfaces` § System |\n| **Express** | 营销落地、定价、功能展示 | skill `surfaces` + `visual-craft` |\n| **Overlay** | 以 Dialog / Drawer / CommandMenu 为主界面 | skill `surfaces` § Overlay |\n\n不确定时:后台默认 Ops → 最近黄金样例;对外营销 → Express。\n\n## Agent 推荐工作流(摘要)\n\n1. 钉死主体、受众、表面、第一屏单一任务 \n2. 优先 MCP:`recommend_page` → **`get_golden_page`(镜像)** → `get_component` / `get_example` \n3. 无 MCP 时读 skill `references/`(布局、表面、反馈) \n4. 反馈默认 `message`;`toast` 仅 summary+detail / 异步感。表单常驻错误用字段 `errorMessage` 或 token 样式的 `role=\"alert\"`,不要把 `<MMessage>` 当成内嵌 Alert。表格行数据用 `rows`。选型冲突面用 MCP `recommend_component`(返回 recipe),无 MCP 时读 skill `decision-recipes`。交付前默认做一轮 craft(Ops polish / 氛围配方,见 skill `visual-craft`)。 \n5. **必须**跑 MCP `validate_usage`(API 准确)与 `validate_page`(布局/契约建议);对照 skill 检查清单\n\n细节与硬边界以项目内 `SKILL.md` 为准,本文不重复全文。\n\n## 下一步\n\n- [一键接入](/docs/setup):安装 skill 与其它配置 \n- [AI 接入](/docs/ai-setup):用 AI 生成页面时的流程 \n- [Agent MCP](/docs/mcp):工具与客户端配置 \n- [快速上手](/docs/quick-start):手写安装组件库 \n- [组件](/components):浏览 API\n",
|
|
27863
27869
|
"sections": [
|
|
27864
27870
|
{
|
|
27865
27871
|
"title": "",
|
|
@@ -27889,7 +27895,7 @@
|
|
|
27889
27895
|
{
|
|
27890
27896
|
"title": "Agent 推荐工作流(摘要)",
|
|
27891
27897
|
"id": "agent-推荐工作流-摘要",
|
|
27892
|
-
"body": "1. 钉死主体、受众、表面、第一屏单一任务 \n2. 优先 MCP:`recommend_page` → **`get_golden_page`(镜像)** → `get_component` / `get_example` \n3. 无 MCP 时读 skill `references/`(布局、表面、反馈) \n4. 反馈默认 `message`;`toast` 仅 summary+detail / 异步感。表单常驻错误用字段 `errorMessage` 或 token 样式的 `role=\"alert\"`,不要把 `<MMessage>` 当成内嵌 Alert。表格行数据用 `rows`。交付前默认做一轮 craft(Ops polish / 氛围配方,见 skill `visual-craft`)。 \n5. **必须**跑 MCP `validate_usage`(API 准确)与 `validate_page`(布局/契约建议);对照 skill 检查清单\n\n细节与硬边界以项目内 `SKILL.md` 为准,本文不重复全文。"
|
|
27898
|
+
"body": "1. 钉死主体、受众、表面、第一屏单一任务 \n2. 优先 MCP:`recommend_page` → **`get_golden_page`(镜像)** → `get_component` / `get_example` \n3. 无 MCP 时读 skill `references/`(布局、表面、反馈) \n4. 反馈默认 `message`;`toast` 仅 summary+detail / 异步感。表单常驻错误用字段 `errorMessage` 或 token 样式的 `role=\"alert\"`,不要把 `<MMessage>` 当成内嵌 Alert。表格行数据用 `rows`。选型冲突面用 MCP `recommend_component`(返回 recipe),无 MCP 时读 skill `decision-recipes`。交付前默认做一轮 craft(Ops polish / 氛围配方,见 skill `visual-craft`)。 \n5. **必须**跑 MCP `validate_usage`(API 准确)与 `validate_page`(布局/契约建议);对照 skill 检查清单\n\n细节与硬边界以项目内 `SKILL.md` 为准,本文不重复全文。"
|
|
27893
27899
|
},
|
|
27894
27900
|
{
|
|
27895
27901
|
"title": "下一步",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-09-
|
|
3
|
-
"catalogGeneratedAt": "2026-09-
|
|
2
|
+
"generatedAt": "2026-09-24T08:45:50.660Z",
|
|
3
|
+
"catalogGeneratedAt": "2026-09-24T08:45:45.036Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"id": "Accordion",
|
|
@@ -198,8 +198,8 @@
|
|
|
198
198
|
"exportName": "MButton",
|
|
199
199
|
"examples": 20,
|
|
200
200
|
"props": {
|
|
201
|
-
"total":
|
|
202
|
-
"covered":
|
|
201
|
+
"total": 27,
|
|
202
|
+
"covered": 22,
|
|
203
203
|
"missing": [
|
|
204
204
|
"variant",
|
|
205
205
|
"ripple",
|
|
@@ -282,6 +282,23 @@ describe('@morya-ui/mcp handlers', () => {
|
|
|
282
282
|
expect(result.id).toBe('overlay-choice');
|
|
283
283
|
expect(result.options.some((option) => option.component === 'Drawer')).toBe(true);
|
|
284
284
|
});
|
|
285
|
+
it('returns L2 recipes and antiPatterns on decision reads', () => {
|
|
286
|
+
const result = read(handlers.recommendComponent({ decision: 'data-display-choice' }));
|
|
287
|
+
const table = result.options.find((option) => option.component === 'Table');
|
|
288
|
+
expect(table?.recipe?.props?.length).toBeGreaterThanOrEqual(3);
|
|
289
|
+
expect(table?.recipe?.props?.some((line) => /rows/i.test(line))).toBe(true);
|
|
290
|
+
expect(table?.antiPatterns?.length).toBeGreaterThan(0);
|
|
291
|
+
});
|
|
292
|
+
it('covers feedback and confirm decision guides', () => {
|
|
293
|
+
const feedback = read(handlers.recommendComponent({ decision: 'feedback-choice' }));
|
|
294
|
+
expect(feedback.options.map((option) => option.component)).toEqual(expect.arrayContaining(['message', 'toast', 'field errorMessage / role="alert"']));
|
|
295
|
+
expect(feedback.options.every((option) => (option.recipe?.props?.length ?? 0) >= 3)).toBe(true);
|
|
296
|
+
const confirm = read(handlers.recommendComponent({ decision: 'confirm-choice' }));
|
|
297
|
+
expect(confirm.options.map((option) => option.component)).toEqual([
|
|
298
|
+
'ConfirmDialog',
|
|
299
|
+
'ConfirmPopup',
|
|
300
|
+
]);
|
|
301
|
+
});
|
|
285
302
|
it('covers current selection, status, empty, and menu guides', () => {
|
|
286
303
|
const selection = read(handlers.recommendComponent({ decision: 'selection-choice' }));
|
|
287
304
|
expect(selection.options.map((option) => option.component)).toEqual(expect.arrayContaining(['Select', 'CascadeSelect', 'Listbox', 'SelectButton', 'Radio']));
|
package/dist/decisions.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
export interface ComponentDecisionRecipe {
|
|
2
|
+
/** 3–8 critical props / usage notes (zh). Not a full API manual. */
|
|
3
|
+
props: string[];
|
|
4
|
+
propsEn: string[];
|
|
5
|
+
slots?: string[];
|
|
6
|
+
slotsEn?: string[];
|
|
7
|
+
events?: string[];
|
|
8
|
+
eventsEn?: string[];
|
|
9
|
+
}
|
|
1
10
|
export interface ComponentDecisionOption {
|
|
2
11
|
component: string;
|
|
3
12
|
when: string[];
|
|
4
13
|
whenEn: string[];
|
|
5
14
|
avoidWhen: string[];
|
|
6
15
|
avoidWhenEn: string[];
|
|
16
|
+
recipe: ComponentDecisionRecipe;
|
|
17
|
+
antiPatterns: string[];
|
|
18
|
+
antiPatternsEn: string[];
|
|
7
19
|
}
|
|
8
20
|
export interface ComponentDecision {
|
|
9
21
|
id: string;
|
|
@@ -17,3 +29,5 @@ export interface ComponentDecision {
|
|
|
17
29
|
export declare const componentDecisions: ComponentDecision[];
|
|
18
30
|
export declare function findDecision(name: string): ComponentDecision | undefined;
|
|
19
31
|
export declare function scoreDecision(decision: ComponentDecision, query: string): number;
|
|
32
|
+
/** Ensures every option carries a non-empty L2 recipe (used by tests / generate script). */
|
|
33
|
+
export declare function assertDecisionRecipes(decisions?: ComponentDecision[]): void;
|