kui-vue 6.1.0 → 6.2.1

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 (385) hide show
  1. package/AI.en-US.md +72 -4
  2. package/AI.md +70 -4
  3. package/ai/behaviors.json +23 -1
  4. package/ai/cli.mjs +180 -17
  5. package/ai/descriptions.json +28 -0
  6. package/ai/kui-components.json +10971 -9552
  7. package/ai/mcp.mjs +2 -188
  8. package/ai/query.mjs +192 -0
  9. package/ai/skills/kui-vue/SKILL.md +39 -18
  10. package/ai/skills/kui-vue/references/mcp.md +11 -1
  11. package/ai/skills/kui-vue/references/react-to-vue.md +110 -0
  12. package/ai/skills/kui-vue/references/vue-to-react.md +86 -0
  13. package/dist/index.js +2 -2
  14. package/es/index.js +2367 -2172
  15. package/es/locale/de.js +1 -1
  16. package/es/locale/el.js +1 -1
  17. package/es/locale/en.js +1 -1
  18. package/es/locale/fr.js +1 -1
  19. package/es/locale/it.js +1 -1
  20. package/es/locale/ja.js +1 -1
  21. package/es/locale/ko.js +1 -1
  22. package/es/locale/ru.js +1 -1
  23. package/es/locale/th.js +1 -1
  24. package/es/locale/uk.js +1 -1
  25. package/es/locale/vi.js +1 -1
  26. package/es/locale/zh-CN.js +1 -1
  27. package/es/locale/zh-TW.js +1 -1
  28. package/lib/index.cjs +2 -2
  29. package/lib/locale/de.cjs +1 -1
  30. package/lib/locale/el.cjs +1 -1
  31. package/lib/locale/en.cjs +1 -1
  32. package/lib/locale/fr.cjs +1 -1
  33. package/lib/locale/it.cjs +1 -1
  34. package/lib/locale/ja.cjs +1 -1
  35. package/lib/locale/ko.cjs +1 -1
  36. package/lib/locale/ru.cjs +1 -1
  37. package/lib/locale/th.cjs +1 -1
  38. package/lib/locale/uk.cjs +1 -1
  39. package/lib/locale/vi.cjs +1 -1
  40. package/lib/locale/zh-CN.cjs +1 -1
  41. package/lib/locale/zh-TW.cjs +1 -1
  42. package/package.json +40 -35
  43. package/style/base.css +1 -1
  44. package/style/components.css +2 -2
  45. package/style/index.css +2 -2
  46. package/style/motion.css +1 -1
  47. package/style/theme.css +2 -2
  48. package/types/alert/index.d.ts +2 -0
  49. package/types/auto-complete/index.d.ts +1 -5
  50. package/types/calendar/index.d.ts +3 -0
  51. package/types/carousel/{Carousel.d.ts → carousel.d.ts} +26 -0
  52. package/types/carousel/drag.d.ts +19 -0
  53. package/types/cascader/index.d.ts +11 -2
  54. package/types/cascader/types.d.ts +4 -0
  55. package/types/check-card/check-card-group.d.ts +3 -0
  56. package/types/check-card/check-card.d.ts +13 -0
  57. package/types/checkbox/checkbox-group.d.ts +13 -0
  58. package/types/checkbox/{Checkbox.d.ts → checkbox.d.ts} +1 -0
  59. package/types/checkbox/index.d.ts +1 -1
  60. package/types/color-picker/alpha.d.ts +5 -1
  61. package/types/color-picker/hue.d.ts +3 -0
  62. package/types/color-picker/index.d.ts +29 -15
  63. package/types/color-picker/mode.d.ts +1 -1
  64. package/types/color-picker/paint.d.ts +3 -0
  65. package/types/color-picker/types.d.ts +1 -0
  66. package/types/components.d.ts +21 -16
  67. package/types/date-picker/index.d.ts +36 -7
  68. package/types/drawer/index.d.ts +18 -5
  69. package/types/dropdown/{Dropdown.d.ts → dropdown.d.ts} +9 -13
  70. package/types/form/{Form.d.ts → form.d.ts} +3 -7
  71. package/types/form/index.d.ts +1 -1
  72. package/types/global.d.ts +2 -0
  73. package/types/input/index.d.ts +2 -2
  74. package/types/input/{Input.d.ts → input-base.d.ts} +37 -19
  75. package/types/input/input.d.ts +114 -0
  76. package/types/input/{TextArea.d.ts → textarea.d.ts} +13 -4
  77. package/types/input-number/index.d.ts +3 -0
  78. package/types/input-otp/input-otp.d.ts +13 -0
  79. package/types/mentions/index.d.ts +1 -1
  80. package/types/menu/{Menu.d.ts → menu.d.ts} +17 -10
  81. package/types/modal/index.d.ts +12 -7
  82. package/types/modal/{Modal.d.ts → modal.d.ts} +19 -91
  83. package/types/modal/toast.d.ts +5 -4
  84. package/types/notice/content.d.ts +3 -70
  85. package/types/page/index.d.ts +13 -0
  86. package/types/page/responsive.d.ts +1 -0
  87. package/types/popconfirm/index.d.ts +3 -40
  88. package/types/poptip/index.d.ts +4 -42
  89. package/types/popup/index.d.ts +251 -0
  90. package/types/popup/layers.d.ts +9 -0
  91. package/types/popup/types.d.ts +15 -0
  92. package/types/radio/index.d.ts +1 -0
  93. package/types/radio/radio-group.d.ts +1 -0
  94. package/types/segmented/index.d.ts +3 -1
  95. package/types/select/index.d.ts +1 -1
  96. package/types/select/{Option.d.ts → option.d.ts} +7 -8
  97. package/types/select/{Select.d.ts → select.d.ts} +5 -1
  98. package/types/slider/index.d.ts +6 -1
  99. package/types/slider/thumb.d.ts +1 -1
  100. package/types/spin/index.d.ts +13 -0
  101. package/types/stat-card/rollup.d.ts +3 -1
  102. package/types/stat-card/stat-number.d.ts +14 -1
  103. package/types/stat-card/utils/countup.d.ts +1 -1
  104. package/types/stat-card/utils/odometer.d.ts +8 -5
  105. package/types/switch/index.d.ts +1 -0
  106. package/types/table/index.d.ts +3 -16
  107. package/types/tabs/index.d.ts +1 -0
  108. package/types/tag/index.d.ts +2 -0
  109. package/types/tooltip/index.d.ts +18 -32
  110. package/types/tour/index.d.ts +29 -18
  111. package/types/transfer/index.d.ts +13 -0
  112. package/types/tree/index.d.ts +3 -0
  113. package/types/tree-select/index.d.ts +10 -3
  114. package/types/typography/index.d.ts +9 -0
  115. package/types/upload/index.d.ts +0 -13
  116. package/types/utils/model-value.d.ts +10 -0
  117. package/types/utils/popup.d.ts +11 -0
  118. package/types/utils/selection-tags.d.ts +18 -0
  119. package/types/utils/vue.d.ts +6 -0
  120. package/vetur/attributes.json +2367 -1415
  121. package/vetur/tags.json +441 -241
  122. package/vetur/web-types.json +7022 -5650
  123. package/types/affix/Affix.d.ts +0 -21
  124. package/types/affix/affix.d.ts.map +0 -1
  125. package/types/affix/index.d.ts.map +0 -1
  126. package/types/alert/Alert.d.ts +0 -34
  127. package/types/alert/alert.d.ts.map +0 -1
  128. package/types/alert/index.d.ts.map +0 -1
  129. package/types/anchor/AnchorLink.d.ts +0 -10
  130. package/types/anchor/anchor-link.d.ts.map +0 -1
  131. package/types/anchor/anchor.d.ts.map +0 -1
  132. package/types/anchor/index.d.ts.map +0 -1
  133. package/types/avatar/AvatarGroup.d.ts +0 -11
  134. package/types/avatar/avatar-group.d.ts.map +0 -1
  135. package/types/avatar/avatar.d.ts.map +0 -1
  136. package/types/avatar/index.d.ts.map +0 -1
  137. package/types/backtop/BackTop.d.ts +0 -24
  138. package/types/backtop/backtop.d.ts.map +0 -1
  139. package/types/backtop/index.d.ts +0 -4
  140. package/types/backtop/index.d.ts.map +0 -1
  141. package/types/badge/Badge.d.ts +0 -29
  142. package/types/badge/badge.d.ts.map +0 -1
  143. package/types/badge/index.d.ts.map +0 -1
  144. package/types/base/transition.d.ts.map +0 -1
  145. package/types/breadcrumb/BreadcrumbItem.d.ts +0 -10
  146. package/types/breadcrumb/breadcrumb-item.d.ts.map +0 -1
  147. package/types/breadcrumb/breadcrumb.d.ts.map +0 -1
  148. package/types/breadcrumb/index.d.ts.map +0 -1
  149. package/types/button/ButtonGroup.d.ts +0 -10
  150. package/types/button/button-group.d.ts.map +0 -1
  151. package/types/button/button.d.ts.map +0 -1
  152. package/types/button/index.d.ts.map +0 -1
  153. package/types/card/Card.d.ts +0 -19
  154. package/types/card/card.d.ts.map +0 -1
  155. package/types/card/index.d.ts.map +0 -1
  156. package/types/carousel/CarouselItem.d.ts +0 -7
  157. package/types/carousel/carousel-item.d.ts.map +0 -1
  158. package/types/carousel/carousel.d.ts.map +0 -1
  159. package/types/carousel/index.d.ts.map +0 -1
  160. package/types/checkbox/CheckboxGroup.d.ts +0 -17
  161. package/types/checkbox/checkbox-group.d.ts.map +0 -1
  162. package/types/checkbox/checkbox.d.ts.map +0 -1
  163. package/types/checkbox/index.d.ts.map +0 -1
  164. package/types/collapse/CollapsePanel.d.ts +0 -10
  165. package/types/collapse/collapse-panel.d.ts.map +0 -1
  166. package/types/collapse/collapse.d.ts.map +0 -1
  167. package/types/collapse/index.d.ts.map +0 -1
  168. package/types/color-picker/ColorPicker.d.ts +0 -26
  169. package/types/color-picker/alpha.d.ts.map +0 -1
  170. package/types/color-picker/color-picker.d.ts +0 -60
  171. package/types/color-picker/color-picker.d.ts.map +0 -1
  172. package/types/color-picker/hue.d.ts.map +0 -1
  173. package/types/color-picker/index.d.ts.map +0 -1
  174. package/types/color-picker/mode.d.ts.map +0 -1
  175. package/types/color-picker/paint.d.ts.map +0 -1
  176. package/types/color-picker/presets.d.ts.map +0 -1
  177. package/types/components.d.ts.map +0 -1
  178. package/types/config/context.d.ts.map +0 -1
  179. package/types/config/index.d.ts.map +0 -1
  180. package/types/const/var.d.ts.map +0 -1
  181. package/types/date-picker/DatePicker.d.ts +0 -44
  182. package/types/date-picker/date-picker.d.ts +0 -98
  183. package/types/date-picker/date-picker.d.ts.map +0 -1
  184. package/types/date-picker/index.d.ts.map +0 -1
  185. package/types/descriptions/DescriptionsItem.d.ts +0 -14
  186. package/types/descriptions/descriptions-item.d.ts.map +0 -1
  187. package/types/descriptions/descriptions.d.ts.map +0 -1
  188. package/types/descriptions/index.d.ts.map +0 -1
  189. package/types/directives/resize.d.ts.map +0 -1
  190. package/types/directives/scroll.d.ts.map +0 -1
  191. package/types/directives/transfer.d.ts +0 -2
  192. package/types/directives/transfer.d.ts.map +0 -1
  193. package/types/divider/Divider.d.ts +0 -23
  194. package/types/divider/divider.d.ts.map +0 -1
  195. package/types/divider/index.d.ts.map +0 -1
  196. package/types/drawer/Drawer.d.ts +0 -64
  197. package/types/drawer/drawer.d.ts.map +0 -1
  198. package/types/drawer/index.d.ts.map +0 -1
  199. package/types/dropdown/DropdownButton.d.ts +0 -17
  200. package/types/dropdown/dropdown-button.d.ts.map +0 -1
  201. package/types/dropdown/dropdown.d.ts.map +0 -1
  202. package/types/dropdown/index.d.ts.map +0 -1
  203. package/types/dropdown/trigger.d.ts.map +0 -1
  204. package/types/empty/Empty.d.ts +0 -19
  205. package/types/empty/empty.d.ts.map +0 -1
  206. package/types/empty/index.d.ts.map +0 -1
  207. package/types/flex/Flex.d.ts +0 -25
  208. package/types/flex/flex.d.ts.map +0 -1
  209. package/types/flex/index.d.ts.map +0 -1
  210. package/types/form/FormItem.d.ts +0 -13
  211. package/types/form/form-item.d.ts.map +0 -1
  212. package/types/form/form.d.ts.map +0 -1
  213. package/types/form/index.d.ts.map +0 -1
  214. package/types/form/types.d.ts.map +0 -1
  215. package/types/grid/GridItem.d.ts +0 -16
  216. package/types/grid/grid-item.d.ts.map +0 -1
  217. package/types/grid/grid.d.ts.map +0 -1
  218. package/types/grid/index.d.ts.map +0 -1
  219. package/types/grid/useBreakpoint.d.ts.map +0 -1
  220. package/types/icon/Icon.d.ts +0 -30
  221. package/types/icon/demo/search.d.ts +0 -2
  222. package/types/icon/demo/tags.d.ts +0 -4
  223. package/types/icon/icon.d.ts.map +0 -1
  224. package/types/icon/index.d.ts.map +0 -1
  225. package/types/image/ImageGroup.d.ts +0 -9
  226. package/types/image/KImage.d.ts +0 -18
  227. package/types/image/group.d.ts.map +0 -1
  228. package/types/image/image.d.ts.map +0 -1
  229. package/types/image/index.d.ts.map +0 -1
  230. package/types/image/instance.d.ts.map +0 -1
  231. package/types/image/preview.d.ts.map +0 -1
  232. package/types/image/utils.d.ts.map +0 -1
  233. package/types/index.d.ts.map +0 -1
  234. package/types/input/InputGroup.d.ts +0 -14
  235. package/types/input/index.d.ts.map +0 -1
  236. package/types/input/input-box.d.ts.map +0 -1
  237. package/types/input/input-group.d.ts.map +0 -1
  238. package/types/input/input.d.ts.map +0 -1
  239. package/types/input/textarea.d.ts.map +0 -1
  240. package/types/input-number/InputNumber.d.ts +0 -30
  241. package/types/input-number/index.d.ts.map +0 -1
  242. package/types/input-number/input-number.d.ts +0 -71
  243. package/types/input-number/input-number.d.ts.map +0 -1
  244. package/types/layout/index.d.ts.map +0 -1
  245. package/types/layout/layout.d.ts +0 -10
  246. package/types/layout/layout.d.ts.map +0 -1
  247. package/types/layout/sider.d.ts +0 -9
  248. package/types/loading/index.d.ts.map +0 -1
  249. package/types/loading/loading.d.ts +0 -18
  250. package/types/loading/loading.d.ts.map +0 -1
  251. package/types/locale/zh-CN.d.ts.map +0 -1
  252. package/types/menu/MenuDivider.d.ts +0 -7
  253. package/types/menu/MenuGroup.d.ts +0 -9
  254. package/types/menu/MenuItem.d.ts +0 -13
  255. package/types/menu/SubMenu.d.ts +0 -12
  256. package/types/menu/index.d.ts.map +0 -1
  257. package/types/menu/menu-divider.d.ts.map +0 -1
  258. package/types/menu/menu-group.d.ts.map +0 -1
  259. package/types/menu/menu-item.d.ts.map +0 -1
  260. package/types/menu/menu.d.ts.map +0 -1
  261. package/types/menu/recursive-menu.d.ts.map +0 -1
  262. package/types/menu/sub-menu.d.ts.map +0 -1
  263. package/types/message/index.d.ts.map +0 -1
  264. package/types/modal/index.d.ts.map +0 -1
  265. package/types/modal/modal.d.ts.map +0 -1
  266. package/types/modal/toast.d.ts.map +0 -1
  267. package/types/notice/Notice.d.ts +0 -50
  268. package/types/notice/group.d.ts +0 -7
  269. package/types/notice/group.d.ts.map +0 -1
  270. package/types/notice/index.d.ts.map +0 -1
  271. package/types/notice/instance.d.ts.map +0 -1
  272. package/types/notice/notice.d.ts.map +0 -1
  273. package/types/page/Page.d.ts +0 -48
  274. package/types/page/index.d.ts.map +0 -1
  275. package/types/page/page.d.ts.map +0 -1
  276. package/types/popconfirm/Popconfirm.d.ts +0 -37
  277. package/types/popconfirm/index.d.ts.map +0 -1
  278. package/types/popconfirm/popconfirm.d.ts.map +0 -1
  279. package/types/poptip/Poptip.d.ts +0 -35
  280. package/types/poptip/index.d.ts.map +0 -1
  281. package/types/poptip/poptip.d.ts.map +0 -1
  282. package/types/progress/Progress.d.ts +0 -56
  283. package/types/progress/index.d.ts.map +0 -1
  284. package/types/progress/progress.d.ts.map +0 -1
  285. package/types/radio/RadioButton.d.ts +0 -18
  286. package/types/radio/RadioGroup.d.ts +0 -18
  287. package/types/radio/index.d.ts.map +0 -1
  288. package/types/radio/radio-button.d.ts.map +0 -1
  289. package/types/radio/radio-group.d.ts.map +0 -1
  290. package/types/radio/radio.d.ts.map +0 -1
  291. package/types/rate/Rate.d.ts +0 -48
  292. package/types/rate/index.d.ts.map +0 -1
  293. package/types/rate/rate.d.ts.map +0 -1
  294. package/types/rate/star.d.ts.map +0 -1
  295. package/types/row-col/col.d.ts.map +0 -1
  296. package/types/row-col/index.d.ts.map +0 -1
  297. package/types/row-col/row.d.ts.map +0 -1
  298. package/types/select/index.d.ts.map +0 -1
  299. package/types/select/option.d.ts.map +0 -1
  300. package/types/select/select.d.ts.map +0 -1
  301. package/types/skeleton/SkeletonAvatar.d.ts +0 -15
  302. package/types/skeleton/SkeletonButton.d.ts +0 -16
  303. package/types/skeleton/SkeletonImage.d.ts +0 -14
  304. package/types/skeleton/SkeletonText.d.ts +0 -14
  305. package/types/skeleton/index.d.ts.map +0 -1
  306. package/types/skeleton/skeleton-avatar.d.ts.map +0 -1
  307. package/types/skeleton/skeleton-button.d.ts.map +0 -1
  308. package/types/skeleton/skeleton-image.d.ts.map +0 -1
  309. package/types/skeleton/skeleton-text.d.ts.map +0 -1
  310. package/types/skeleton/skeleton.d.ts.map +0 -1
  311. package/types/slider/Slider.d.ts +0 -60
  312. package/types/slider/index.d.ts.map +0 -1
  313. package/types/slider/slider.d.ts.map +0 -1
  314. package/types/slider/thumb.d.ts.map +0 -1
  315. package/types/space/Space.d.ts +0 -30
  316. package/types/space/index.d.ts.map +0 -1
  317. package/types/space/space.d.ts.map +0 -1
  318. package/types/spin/Spin.d.ts +0 -24
  319. package/types/spin/index.d.ts.map +0 -1
  320. package/types/spin/spin.d.ts.map +0 -1
  321. package/types/stat-card/StatCard.d.ts +0 -18
  322. package/types/stat-card/StatNumber.d.ts +0 -18
  323. package/types/stat-card/countup.d.ts.map +0 -1
  324. package/types/stat-card/index.d.ts.map +0 -1
  325. package/types/stat-card/rollup.d.ts.map +0 -1
  326. package/types/stat-card/stat-card.d.ts.map +0 -1
  327. package/types/stat-card/stat-number.d.ts.map +0 -1
  328. package/types/stat-card/utils/countup.d.ts.map +0 -1
  329. package/types/switch/Switch.d.ts +0 -35
  330. package/types/switch/index.d.ts.map +0 -1
  331. package/types/switch/switch.d.ts.map +0 -1
  332. package/types/table/Table.d.ts +0 -77
  333. package/types/table/index.d.ts.map +0 -1
  334. package/types/table/table.d.ts.map +0 -1
  335. package/types/tabs/TabPanel.d.ts +0 -13
  336. package/types/tabs/index.d.ts.map +0 -1
  337. package/types/tabs/tab-panel.d.ts.map +0 -1
  338. package/types/tabs/tabs.d.ts.map +0 -1
  339. package/types/tag/Tag.d.ts +0 -30
  340. package/types/tag/index.d.ts.map +0 -1
  341. package/types/tag/tag.d.ts.map +0 -1
  342. package/types/timeline/TimeLine.d.ts +0 -12
  343. package/types/timeline/TimeLineItem.d.ts +0 -12
  344. package/types/timeline/index.d.ts +0 -6
  345. package/types/timeline/index.d.ts.map +0 -1
  346. package/types/timeline/timeline-item.d.ts +0 -20
  347. package/types/timeline/timeline-item.d.ts.map +0 -1
  348. package/types/timeline/timeline.d.ts.map +0 -1
  349. package/types/tooltip/Tooltip.d.ts +0 -38
  350. package/types/tooltip/index.d.ts.map +0 -1
  351. package/types/tooltip/tooltip.d.ts.map +0 -1
  352. package/types/tree/Tree.d.ts +0 -82
  353. package/types/tree/index.d.ts.map +0 -1
  354. package/types/tree/tree.d.ts.map +0 -1
  355. package/types/tree/utils.d.ts.map +0 -1
  356. package/types/tree-select/TreeSelect.d.ts +0 -45
  357. package/types/tree-select/index.d.ts.map +0 -1
  358. package/types/tree-select/tree-select.d.ts +0 -128
  359. package/types/tree-select/tree-select.d.ts.map +0 -1
  360. package/types/upload/Upload.d.ts +0 -68
  361. package/types/upload/file-list.d.ts.map +0 -1
  362. package/types/upload/index.d.ts.map +0 -1
  363. package/types/upload/selector.d.ts.map +0 -1
  364. package/types/upload/types.d.ts.map +0 -1
  365. package/types/upload/upload.d.ts.map +0 -1
  366. package/types/utils/color.d.ts.map +0 -1
  367. package/types/utils/number.d.ts.map +0 -1
  368. package/types/utils/placement.d.ts.map +0 -1
  369. package/types/utils/size.d.ts +0 -3
  370. package/types/utils/size.d.ts.map +0 -1
  371. package/types/utils/theme.d.ts.map +0 -1
  372. package/types/utils/vnode.d.ts.map +0 -1
  373. package/types/utils/vue.d.ts.map +0 -1
  374. /package/types/anchor/{Anchor.d.ts → anchor.d.ts} +0 -0
  375. /package/types/avatar/{Avatar.d.ts → avatar.d.ts} +0 -0
  376. /package/types/breadcrumb/{Breadcrumb.d.ts → breadcrumb.d.ts} +0 -0
  377. /package/types/button/{Button.d.ts → button.d.ts} +0 -0
  378. /package/types/collapse/{Collapse.d.ts → collapse.d.ts} +0 -0
  379. /package/types/descriptions/{Descriptions.d.ts → descriptions.d.ts} +0 -0
  380. /package/types/grid/{Grid.d.ts → grid.d.ts} +0 -0
  381. /package/types/radio/{Radio.d.ts → radio.d.ts} +0 -0
  382. /package/types/row-col/{Col.d.ts → col.d.ts} +0 -0
  383. /package/types/row-col/{Row.d.ts → row.d.ts} +0 -0
  384. /package/types/skeleton/{Skeleton.d.ts → skeleton.d.ts} +0 -0
  385. /package/types/tabs/{Tabs.d.ts → tabs.d.ts} +0 -0
package/ai/mcp.mjs CHANGED
@@ -1,148 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import fs from "node:fs";
3
2
  import process from "node:process";
4
- import { validateUsage } from "./validate.mjs";
3
+ import { metadata, tools, prompts, promptText, byName, executeTool } from "./query.mjs";
5
4
 
6
- const metadata = JSON.parse(fs.readFileSync(new URL("./kui-components.json", import.meta.url)));
7
- const byName = new Map(metadata.components.map((item) => [item.name.toLowerCase(), item]));
8
- const byTag = new Map(
9
- metadata.components.flatMap((item) =>
10
- [item.name, ...item.tags].map((tag) => [tag.toLowerCase(), item]),
11
- ),
12
- );
13
- const templates = JSON.parse(fs.readFileSync(new URL("./templates/index.json", import.meta.url)));
14
- const tools = [
15
- ["search_components", "Search components by name, tag, or API description", "query"],
16
- ["get_component_api", "Get component API and behavior contracts without example source", "name"],
17
- ["list_component_examples", "List example IDs and titles for a component", "name"],
18
- [
19
- "get_component_example",
20
- "Read one complete example; pass its ID from list_component_examples",
21
- "name",
22
- ],
23
- ["list_templates", "List runnable business templates (optional search query)", "query"],
24
- ["get_template", "Read a complete runnable Vue business template", "id"],
25
- ["recommend_components", "Recommend components for a UI requirement", "requirement"],
26
- [
27
- "validate_kui_usage",
28
- "Check static props, values, events, models and known slots; reports skipped checks, not full type safety",
29
- "source",
30
- ],
31
- ].map(([name, description, argument]) => ({
32
- name,
33
- description,
34
- inputSchema: {
35
- type: "object",
36
- properties: {
37
- [argument]: { type: "string" },
38
- ...(["search_components", "list_component_examples"].includes(name)
39
- ? {
40
- offset: { type: "integer", minimum: 0 },
41
- limit: { type: "integer", minimum: 1, maximum: 20 },
42
- }
43
- : {}),
44
- ...(name === "get_component_api"
45
- ? {
46
- section: {
47
- type: "string",
48
- enum: ["all", "props", "events", "slots", "behavior", "models"],
49
- },
50
- }
51
- : {}),
52
- ...(name === "get_component_example" ? { id: { type: "string" } } : {}),
53
- },
54
- required:
55
- name === "list_templates"
56
- ? []
57
- : name === "get_component_example"
58
- ? [argument, "id"]
59
- : [argument],
60
- additionalProperties: false,
61
- },
62
- }));
63
- const prompts = [
64
- { name: "build_form", description: "Build a validated Kui Vue form", argument: "fields" },
65
- { name: "build_table", description: "Build a searchable Kui Vue table", argument: "columns" },
66
- { name: "build_modal_editor", description: "Build a modal form editor", argument: "entity" },
67
- ].map(({ name, description, argument }) => ({
68
- name,
69
- description,
70
- arguments: [{ name: argument, required: true }],
71
- }));
72
- const promptText = {
73
- build_form: ({ fields = "" }) =>
74
- `Adapt this runnable Kui Vue template for fields: ${fields}.\n${getTemplate("form").setup}\n${getTemplate("form").source}`,
75
- build_table: ({ columns = "" }) =>
76
- `Adapt this runnable Kui Vue template for columns: ${columns}.\n${getTemplate("table").setup}\n${getTemplate("table").source}`,
77
- build_modal_editor: ({ entity = "" }) =>
78
- `Adapt this runnable Kui Vue template for entity: ${entity}.\n${getTemplate("modal-editor").setup}\n${getTemplate("modal-editor").source}`,
79
- };
80
- const search = (query) => {
81
- const terms = String(query).toLowerCase().split(/\s+/).filter(Boolean);
82
- return metadata.components.filter((item) => {
83
- const text = JSON.stringify(item).toLowerCase();
84
- return terms.every((term) => text.includes(term));
85
- });
86
- };
87
- const recommend = (requirement) => {
88
- const groups = [
89
- [/(form|表单|edit|编辑)/i, ["Form", "FormItem", "Input", "Button"]],
90
- [/(table|列表|data|数据)/i, ["Table", "Page", "Input", "Button"]],
91
- [/(select|选择|dropdown|下拉)/i, ["Select", "Option", "TreeSelect"]],
92
- [/(modal|dialog|弹窗|对话框)/i, ["Modal", "Button"]],
93
- [/(upload|上传)/i, ["Upload"]],
94
- [/(layout|布局|admin|后台)/i, ["Layout", "Sider", "Header", "Content", "Menu"]],
95
- ];
96
- const names = new Set(
97
- groups.filter(([pattern]) => pattern.test(requirement)).flatMap(([, values]) => values),
98
- );
99
- if (!names.size)
100
- search(requirement)
101
- .slice(0, 8)
102
- .forEach((item) => names.add(item.name));
103
- return [...names].map((name) => byName.get(name.toLowerCase())).filter(Boolean);
104
- };
105
- const validate = (source) => validateUsage(source, metadata);
106
- const getComponent = (name) => {
107
- const item = byName.get(String(name).toLowerCase()) || byTag.get(String(name).toLowerCase());
108
- if (!item) throw new Error(`Unknown component: ${name}`);
109
- return item;
110
- };
111
- const pageOf = (items, args) => ({
112
- total: items.length,
113
- offset: args.offset || 0,
114
- items: items.slice(args.offset || 0, (args.offset || 0) + (args.limit || 10)),
115
- });
116
- const getTemplate = (id) => {
117
- const entry = templates.find((item) => item.id === id);
118
- if (!entry) throw new Error(`Unknown template: ${id}`);
119
- return {
120
- ...entry,
121
- setup:
122
- "Vue 3.5+ with kui-vue installed; import kui-vue/style/index.css once in main.ts. Save source as App.vue. Mock requests are local and must be replaced for production.",
123
- source: fs.readFileSync(new URL(`./templates/${entry.file}`, import.meta.url), "utf8"),
124
- };
125
- };
126
- const validateArguments = (name, args) => {
127
- const tool = tools.find((item) => item.name === name);
128
- if (!tool) throw new Error(`Unknown tool: ${name}`);
129
- if (!args || typeof args !== "object" || Array.isArray(args))
130
- throw new Error("Arguments must be an object");
131
- for (const key of tool.inputSchema.required)
132
- if (!(key in args)) throw new Error(`Missing argument: ${key}`);
133
- for (const [key, value] of Object.entries(args)) {
134
- const spec = tool.inputSchema.properties[key];
135
- if (!spec) throw new Error(`Unknown argument: ${key}`);
136
- if (spec.type === "string" && typeof value !== "string")
137
- throw new Error(`${key} must be a string`);
138
- if (
139
- spec.type === "integer" &&
140
- (!Number.isInteger(value) || value < spec.minimum || (spec.maximum && value > spec.maximum))
141
- )
142
- throw new Error(`${key} is out of range`);
143
- if (spec.enum && !spec.enum.includes(value)) throw new Error(`Invalid ${key}`);
144
- }
145
- };
146
5
  const toolResult = (value) => ({
147
6
  content: [{ type: "text", text: JSON.stringify(value, null, 2) }],
148
7
  structuredContent: { result: value },
@@ -219,52 +78,7 @@ process.stdin.on("data", (chunk) => {
219
78
  };
220
79
  } else if (request.method === "tools/call") {
221
80
  const { name, arguments: args = {} } = request.params || {};
222
- validateArguments(name, args);
223
- let value;
224
- if (name === "search_components") {
225
- value = pageOf(
226
- search(args.query).map(({ name, tags, documentation }) => ({
227
- name,
228
- tags,
229
- documentation,
230
- })),
231
- args,
232
- );
233
- } else if (name === "get_component_api") {
234
- const { examples, ...api } = getComponent(args.name);
235
- value =
236
- args.section && args.section !== "all"
237
- ? { name: api.name, version: metadata.version, [args.section]: api[args.section] }
238
- : { ...api, version: metadata.version, exampleCount: examples.length };
239
- } else if (name === "list_component_examples") {
240
- value = pageOf(
241
- getComponent(args.name).examples.map(({ title, file }) => ({ id: file, title })),
242
- args,
243
- );
244
- } else if (name === "get_component_example") {
245
- const example = getComponent(args.name).examples.find((item) => item.file === args.id);
246
- if (!example) throw new Error(`Unknown example: ${args.id}`);
247
- value = example;
248
- } else if (name === "list_templates") {
249
- value = templates.filter(
250
- (item) =>
251
- !args.query || JSON.stringify(item).toLowerCase().includes(args.query.toLowerCase()),
252
- );
253
- } else if (name === "get_template") {
254
- value = getTemplate(args.id);
255
- } else if (name === "recommend_components") {
256
- value = recommend(args.requirement).map(
257
- ({ name, tags, documentation, parent, children }) => ({
258
- name,
259
- tags,
260
- documentation,
261
- parent,
262
- children,
263
- }),
264
- );
265
- } else if (name === "validate_kui_usage") value = validate(args.source);
266
- else value = { error: `Unknown tool: ${name}` };
267
- result = toolResult(value);
81
+ result = toolResult(executeTool(name, args));
268
82
  } else if (!["notifications/initialized", "ping"].includes(request.method)) {
269
83
  if (request.id !== undefined)
270
84
  send({
package/ai/query.mjs ADDED
@@ -0,0 +1,192 @@
1
+ import fs from "node:fs";
2
+ import { validateUsage } from "./validate.mjs";
3
+
4
+ const metadata = JSON.parse(fs.readFileSync(new URL("./kui-components.json", import.meta.url)));
5
+ const byName = new Map(metadata.components.map((item) => [item.name.toLowerCase(), item]));
6
+ const byTag = new Map(
7
+ metadata.components.flatMap((item) =>
8
+ [item.name, ...item.tags].map((tag) => [tag.toLowerCase(), item]),
9
+ ),
10
+ );
11
+ const templates = JSON.parse(fs.readFileSync(new URL("./templates/index.json", import.meta.url)));
12
+ const tools = [
13
+ ["search_components", "Search components by name, tag, or API description", "query"],
14
+ ["get_component_api", "Get component API and behavior contracts without example source", "name"],
15
+ ["list_component_examples", "List example IDs and titles for a component", "name"],
16
+ [
17
+ "get_component_example",
18
+ "Read one complete example; pass its ID from list_component_examples",
19
+ "name",
20
+ ],
21
+ ["list_templates", "List runnable business templates (optional search query)", "query"],
22
+ ["get_template", "Read a complete runnable Vue business template", "id"],
23
+ ["recommend_components", "Recommend components for a UI requirement", "requirement"],
24
+ [
25
+ "validate_kui_usage",
26
+ "Check static props, values, events, models and known slots; reports skipped checks, not full type safety",
27
+ "source",
28
+ ],
29
+ ].map(([name, description, argument]) => ({
30
+ name,
31
+ description,
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ [argument]: { type: "string" },
36
+ ...(["search_components", "list_component_examples"].includes(name)
37
+ ? {
38
+ offset: { type: "integer", minimum: 0 },
39
+ limit: { type: "integer", minimum: 1, maximum: 20 },
40
+ }
41
+ : {}),
42
+ ...(name === "get_component_api"
43
+ ? {
44
+ section: {
45
+ type: "string",
46
+ enum: ["all", "props", "events", "slots", "behavior", "models"],
47
+ },
48
+ }
49
+ : {}),
50
+ ...(name === "get_component_example" ? { id: { type: "string" } } : {}),
51
+ },
52
+ required:
53
+ name === "list_templates"
54
+ ? []
55
+ : name === "get_component_example"
56
+ ? [argument, "id"]
57
+ : [argument],
58
+ additionalProperties: false,
59
+ },
60
+ }));
61
+ const prompts = [
62
+ { name: "build_form", description: "Build a validated Kui Vue form", argument: "fields" },
63
+ { name: "build_table", description: "Build a searchable Kui Vue table", argument: "columns" },
64
+ { name: "build_modal_editor", description: "Build a modal form editor", argument: "entity" },
65
+ ].map(({ name, description, argument }) => ({
66
+ name,
67
+ description,
68
+ arguments: [{ name: argument, required: true }],
69
+ }));
70
+ const promptText = {
71
+ build_form: ({ fields = "" }) =>
72
+ `Adapt this runnable Kui Vue template for fields: ${fields}.\n${getTemplate("form").setup}\n${getTemplate("form").source}`,
73
+ build_table: ({ columns = "" }) =>
74
+ `Adapt this runnable Kui Vue template for columns: ${columns}.\n${getTemplate("table").setup}\n${getTemplate("table").source}`,
75
+ build_modal_editor: ({ entity = "" }) =>
76
+ `Adapt this runnable Kui Vue template for entity: ${entity}.\n${getTemplate("modal-editor").setup}\n${getTemplate("modal-editor").source}`,
77
+ };
78
+ const search = (query) => {
79
+ const terms = String(query).toLowerCase().split(/\s+/).filter(Boolean);
80
+ return metadata.components.filter((item) => {
81
+ const text = JSON.stringify(item).toLowerCase();
82
+ return terms.every((term) => text.includes(term));
83
+ });
84
+ };
85
+ const recommend = (requirement) => {
86
+ const groups = [
87
+ [/(form|表单|edit|编辑)/i, ["Form", "FormItem", "Input", "Button"]],
88
+ [/(table|列表|data|数据)/i, ["Table", "Page", "Input", "Button"]],
89
+ [/(select|选择|dropdown|下拉)/i, ["Select", "Option", "TreeSelect"]],
90
+ [/(modal|dialog|弹窗|对话框)/i, ["Modal", "Button"]],
91
+ [/(upload|上传)/i, ["Upload"]],
92
+ [/(layout|布局|admin|后台)/i, ["Layout", "Sider", "Header", "Content", "Menu"]],
93
+ ];
94
+ const names = new Set(
95
+ groups.filter(([pattern]) => pattern.test(requirement)).flatMap(([, values]) => values),
96
+ );
97
+ if (!names.size)
98
+ search(requirement)
99
+ .slice(0, 8)
100
+ .forEach((item) => names.add(item.name));
101
+ return [...names].map((name) => byName.get(name.toLowerCase())).filter(Boolean);
102
+ };
103
+ const validate = (source) => validateUsage(source, metadata);
104
+ const getComponent = (name) => {
105
+ const item = byName.get(String(name).toLowerCase()) || byTag.get(String(name).toLowerCase());
106
+ if (!item) throw new Error(`Unknown component: ${name}`);
107
+ return item;
108
+ };
109
+ const pageOf = (items, args) => ({
110
+ total: items.length,
111
+ offset: args.offset || 0,
112
+ items: items.slice(args.offset || 0, (args.offset || 0) + (args.limit || 10)),
113
+ });
114
+ const getTemplate = (id) => {
115
+ const entry = templates.find((item) => item.id === id);
116
+ if (!entry) throw new Error(`Unknown template: ${id}`);
117
+ return {
118
+ ...entry,
119
+ setup:
120
+ "Vue 3.5+ with kui-vue installed; import kui-vue/style/index.css once in main.ts. Save source as App.vue. Mock requests are local and must be replaced for production.",
121
+ source: fs.readFileSync(new URL(`./templates/${entry.file}`, import.meta.url), "utf8"),
122
+ };
123
+ };
124
+ const validateArguments = (name, args) => {
125
+ const tool = tools.find((item) => item.name === name);
126
+ if (!tool) throw new Error(`Unknown tool: ${name}`);
127
+ if (!args || typeof args !== "object" || Array.isArray(args))
128
+ throw new Error("Arguments must be an object");
129
+ for (const key of tool.inputSchema.required)
130
+ if (!(key in args)) throw new Error(`Missing argument: ${key}`);
131
+ for (const [key, value] of Object.entries(args)) {
132
+ const spec = tool.inputSchema.properties[key];
133
+ if (!spec) throw new Error(`Unknown argument: ${key}`);
134
+ if (spec.type === "string" && typeof value !== "string")
135
+ throw new Error(`${key} must be a string`);
136
+ if (
137
+ spec.type === "integer" &&
138
+ (!Number.isInteger(value) || value < spec.minimum || (spec.maximum && value > spec.maximum))
139
+ )
140
+ throw new Error(`${key} is out of range`);
141
+ if (spec.enum && !spec.enum.includes(value)) throw new Error(`Invalid ${key}`);
142
+ }
143
+ };
144
+
145
+ export function executeTool(name, args = {}) {
146
+ validateArguments(name, args);
147
+ let value;
148
+ if (name === "search_components") {
149
+ value = pageOf(
150
+ search(args.query).map(({ name, tags, documentation }) => ({
151
+ name,
152
+ tags,
153
+ documentation,
154
+ })),
155
+ args,
156
+ );
157
+ } else if (name === "get_component_api") {
158
+ const { examples, ...api } = getComponent(args.name);
159
+ value =
160
+ args.section && args.section !== "all"
161
+ ? { name: api.name, version: metadata.version, [args.section]: api[args.section] }
162
+ : { ...api, version: metadata.version, exampleCount: examples.length };
163
+ } else if (name === "list_component_examples") {
164
+ value = pageOf(
165
+ getComponent(args.name).examples.map(({ title, file }) => ({ id: file, title })),
166
+ args,
167
+ );
168
+ } else if (name === "get_component_example") {
169
+ const example = getComponent(args.name).examples.find((item) => item.file === args.id);
170
+ if (!example) throw new Error(`Unknown example: ${args.id}`);
171
+ value = example;
172
+ } else if (name === "list_templates") {
173
+ value = templates.filter(
174
+ (item) =>
175
+ !args.query || JSON.stringify(item).toLowerCase().includes(args.query.toLowerCase()),
176
+ );
177
+ } else if (name === "get_template") {
178
+ value = getTemplate(args.id);
179
+ } else if (name === "recommend_components") {
180
+ value = recommend(args.requirement).map(({ name, tags, documentation, parent, children }) => ({
181
+ name,
182
+ tags,
183
+ documentation,
184
+ parent,
185
+ children,
186
+ }));
187
+ } else if (name === "validate_kui_usage") value = validate(args.source);
188
+ else value = { error: `Unknown tool: ${name}` };
189
+ return value;
190
+ }
191
+
192
+ export { metadata, tools, prompts, promptText, byName };
@@ -5,21 +5,42 @@ description: Build Vue 3 interfaces with Kui Vue components and APIs. Use when c
5
5
 
6
6
  # Kui Vue
7
7
 
8
- ## Instructions
9
-
10
- 1. Confirm the project uses Vue 3 and install `kui-vue` plus `kui-icons` when missing.
11
- 2. Import `kui-vue/style/index.css` once at the application entry.
12
- 3. Read `references/components.md` or `kui-vue/metadata` before choosing props, events, and slots. Do not invent APIs.
13
- 4. Prefer existing Kui Vue controls, layout primitives, popup behavior, theme, size, and shape conventions over custom replacements.
14
- 5. Use TypeScript types exported by `kui-vue`; avoid `any` and native-element substitutions when a library component exists.
15
- 6. After changes, run the consuming project's typecheck, lint, and relevant tests.
16
- 7. When MCP is available, query `get_component_api` for exact APIs and behavior/model contracts. Fetch only the needed example via `list_component_examples` and `get_component_example`; use `get_template` for common business flows.
17
- 8. Run `validate_kui_usage` before finishing, read its `skipped` checks, and still run application typecheck and relevant tests. Static `valid` does not mean the code is fully verified.
18
-
19
- ## Common patterns
20
-
21
- - Use `v-model` for controlled values and the documented update/change events.
22
- - Use `theme`, `size`, and `shape` consistently across related controls.
23
- - Use `ConfigProvider` for global configuration.
24
- - For large Select, Table, Tree, or TreeSelect data sets, consult the virtual scrolling examples.
25
- - For MCP resources, prompts, and client setup, read `references/mcp.md`.
8
+ ## Read installed-version resources
9
+
10
+ Run `pnpm exec kui-vue-ai paths` to locate the installed Skill and metadata.
11
+ `kui-vue/metadata` is a package export, not a directory. It resolves with
12
+ `node -p "require.resolve('kui-vue/metadata')"`. The physical fallback is
13
+ `node_modules/kui-vue/ai/kui-components.json`.
14
+
15
+ Without MCP, query `pnpm exec kui-vue-ai api Input --section props` and
16
+ `api Input --section behavior`. Use `search`, `examples`, and `example`
17
+ to fetch only relevant content; run `help` for exact arguments. Older releases
18
+ may only support init: use the metadata file or MCP rather than inventing commands.
19
+ Read [references/components.md](references/components.md) for resource boundaries;
20
+ read [references/mcp.md](references/mcp.md) only when configuring or using MCP.
21
+
22
+ ## Contracts that change implementation
23
+
24
+ - Import from `kui-vue`, icons from `kui-icons`, and `kui-vue/style/index.css` once.
25
+ - Button.icon takes IconType[] data (for example Search), not JSX, h(Icon), a VNode
26
+ or an icon-name string. Input prefix/suffix are renderable content, unlike icon.
27
+ - Use Vue 3 and the component's documented v-model argument. Prefer named slots
28
+ for complex prefix/suffix content in .vue files.
29
+ - FormItem prop binds its field through Form; check before adding a second binding.
30
+ - Utilities and type-only exports are not all listed in component metadata.
31
+ Check installed declarations before concluding an export is missing.
32
+
33
+ ## Migration and verification
34
+
35
+ For React → Vue migration, read [references/react-to-vue.md](references/react-to-vue.md).
36
+ The CLI exposes it with `migration react-to-vue`; use `migration vue-to-react`
37
+ for the other direction. Follow only the guide matching the requested target.
38
+
39
+ For Vue → React migration, read [references/vue-to-react.md](references/vue-to-react.md)
40
+ before choosing target APIs. Query both installed versions. Preserve business
41
+ behavior as well as layout; do not treat a successful typecheck as parity.
42
+
43
+ Run `pnpm exec kui-vue-ai validate <file>`, then application typecheck, lint and
44
+ relevant interaction tests. Inspect complete/skipped limitations. This validator
45
+ is partial and does not execute expressions. Templates are local mocks, not
46
+ production backends; adapt them only within the user's task.
@@ -1,6 +1,16 @@
1
1
  # Kui Vue MCP
2
2
 
3
- Start with `pnpm exec kui-vue-mcp` in the consuming project.
3
+ Transport: stdio. Use an absolute Node executable path and the absolute installed
4
+ `node_modules/kui-vue/ai/mcp.mjs` path as its argument; this avoids depending
5
+ on the client's working directory. Keep the full package and dependencies installed.
6
+ Get the executable path with `node -p "process.execPath"`.
7
+
8
+ For configuration examples, prerequisites and troubleshooting, read
9
+ [AI.en-US.md](../../../../AI.en-US.md#mcp-server).
10
+ The alternative `pnpm exec kui-vue-mcp` requires pnpm on the client's PATH
11
+ and an explicit working directory set to the consuming project.
12
+ Verify initialization, tools/list, and a get_component_api query after connecting.
13
+ Silent terminal startup only means the stdio process is waiting for input.
4
14
 
5
15
  - `search_components({ query, offset?, limit? })`: paginated component discovery (default 10, max 20).
6
16
  - `recommend_components({ requirement })`: suggested component names.
@@ -0,0 +1,110 @@
1
+ # React → Vue migration with KUI
2
+
3
+ Use this guide when moving react-kui to kui-vue. Record both installed versions
4
+ using each package's `*-ai paths` command. Query the target API and examples
5
+ before changing each component; do not infer Vue contracts from React prop names.
6
+ This guide describes the accompanying source version, not every older release.
7
+
8
+ ## Resource lookup
9
+
10
+ Run `pnpm exec kui-vue-ai api Input --section props`, then
11
+ `api Input --section behavior` and `examples Input`. Read an example with
12
+ `example Input <id>`. The React CLI supports the same queries.
13
+ Older releases may only support init: read their installed metadata and
14
+ declarations instead. Package exports such as `kui-vue/metadata` are not folders;
15
+ resolve them with `node -p "require.resolve('kui-vue/metadata')"`.
16
+
17
+ Metadata inventories components, not every utility or type export. Check
18
+ declarations for theme, message, notice, modal and other helpers.
19
+
20
+ ## State and events are not mechanical renames
21
+
22
+ - React value/onChange often becomes Vue `v-model`, which binds modelValue
23
+ and its update event. It is not merely `:value`.
24
+ - On Vue value-initialized controls such as Input and Select, value is read for
25
+ initialization; later external changes belong in modelValue/v-model.
26
+ Do not apply that rule to item identifiers such as Checkbox.value or Option.value.
27
+ - `v-model` already writes emitted updates back to the binding. Add `@change`
28
+ only for a business side effect, not a redundant assignment. Payloads differ
29
+ by component: Input change supplies a string, not a DOM event.
30
+ - Choose one state channel. Do not simultaneously bind modelValue and a named
31
+ checked/range channel unless the installed API explicitly requires it.
32
+ - React refs use current; Vue script refs use value and templates unwrap refs.
33
+ Query the target's exposed methods; an element ref is not a component handle.
34
+
35
+ ## Source-checked mappings
36
+
37
+ | React | Vue | Important distinction |
38
+ | --- | --- | --- |
39
+ | Input value/onChange | Input v-model | Preserve external updates, clear, readonly and Form ownership. |
40
+ | prefix/suffix ReactNode | #prefix / #suffix | Prefer named templates in .vue files instead of constructing nodes with h. |
41
+ | Button icon={Search} | :icon="Search" | Import icon data from kui-icons. Neither accepts a rendered Icon for this prop. Native submit uses htmlType. |
42
+ | Dropdown children / overlay | default / #overlay slots | Default content triggers the popup; v-model:show controls visibility. |
43
+ | Modal open/onOpenChange | v-model | Modal uses the default model, NOT v-model:open. |
44
+ | Popup open/onOpenChange | v-model:open | Preserve trigger/dismissal rules; avoid extra document-click handlers. |
45
+ | Menu value/onChange or selectedKeys | v-model | Selection is an array; preserve item identity. |
46
+ | Menu openKeys/onOpenChange | v-model:openKeys | Expansion is independent of selection. |
47
+ | MenuItem itemKey | MenuItem :key | Vue reads the vnode key. React's reconciliation key is not itemKey. Data-driven menu items use their key field. |
48
+ | DatePicker value/onChange | v-model | Range model is a pair; named startDate/endDate bindings are an alternative. Verify valueType, clear values and mode. |
49
+ | Checkbox/Radio checked state | v-model or documented named checked binding | value identifies a group item, label is display text. Do not replace them with a boolean. Inspect change payloads individually. |
50
+ | Switch checked state | v-model:checked for boolean state | Default v-model can use valueType conversion; do not assume its payload is always boolean. |
51
+ | Form model/onChange | reactive model passed with :model | FormItem prop can own field binding; do not add a competing v-model. Submit payload contains valid. |
52
+ | Select onChange / onSelect | @change / @select | Selected value and option information are different events; inspect single/multiple types. |
53
+ | KImage | Image | Verify actual named exports. |
54
+ | Table column render callbacks | Target column API / documented slots | Query exact row/index/column signatures; preserve rowKey, selection, pagination, loading and empty state. |
55
+ | className | class | Preserve scoped/global style boundaries rather than copying JSX styling blindly. |
56
+
57
+ Reset is not cancel: clearing registered Form fields does not restore an original
58
+ edit snapshot. Preserve the application draft separately if cancel means revert.
59
+ Modal confirmation likewise needs the application's save/error/close policy.
60
+
61
+ ## Prefer Vue templates
62
+
63
+ ```vue
64
+ <script setup lang="ts">
65
+ import { ref } from "vue";
66
+ import { Input, Icon, Tag } from "kui-vue";
67
+ import { Search } from "kui-icons";
68
+ const keyword = ref("");
69
+ </script>
70
+
71
+ <template>
72
+ <Input v-model="keyword" placeholder="Search">
73
+ <template #prefix><Icon :type="Search" /></template>
74
+ <template #suffix><Tag theme="outline">⌘K</Tag></template>
75
+ </Input>
76
+ </template>
77
+ ```
78
+
79
+ Import `kui-vue/style/index.css` once in the application entry. Slots may carry
80
+ scoped parameters: inspect the target example before replacing render props.
81
+ For lists use stable keys, not array indices when rows can move or be removed.
82
+
83
+ ## Theme and runtime
84
+
85
+ Vue exports `theme.setThemeMode` too. Call it from a client click handler with
86
+ the native MouseEvent, for example `@click="theme.setThemeMode($event)"` after
87
+ importing theme from kui-vue. Do not copy React's event.nativeEvent access.
88
+ The helper toggles the root theme-mode attribute and persistence; keep one
89
+ source of theme state. ConfigProvider appearance is not global light/dark mode.
90
+ Do not call browser-only helpers during server rendering.
91
+
92
+ Keep business logic and backend contracts unchanged. React hooks cannot simply
93
+ be renamed to Vue lifecycle APIs: check reactive dependencies, cleanup, async
94
+ request cancellation, router integration and component unmount behavior.
95
+
96
+ ## Acceptance
97
+
98
+ Migrate one representative page before expanding the change. Run application
99
+ typecheck/lint and CLI validate; inspect skipped/complete because static checks
100
+ do not prove runtime or visual parity. Compare against the React baseline:
101
+
102
+ - form input, external value updates, validation, submit, reset and cancel;
103
+ - disabled/readonly controls, clear actions and focus;
104
+ - menu identity, expansion and navigation;
105
+ - date ranges, formatting and empty values;
106
+ - nested popups, outside click, Escape and placement;
107
+ - table pagination/selection/loading and light/dark appearance.
108
+
109
+ State which flows were actually executed and which still need manual checks.
110
+