react-kui 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.zh-CN.md +3 -1
  2. package/ai/kui-components.json +912 -318
  3. package/es/_virtual/_rolldown/runtime.js +1 -1
  4. package/es/affix/index.js +1 -1
  5. package/es/alert/index.js +11 -4
  6. package/es/anchor/anchor-context.js +1 -1
  7. package/es/anchor/anchor-link.js +1 -1
  8. package/es/anchor/anchor.js +1 -1
  9. package/es/auto-complete/index.js +371 -347
  10. package/es/avatar/avatar-group-context.js +1 -1
  11. package/es/avatar/avatar-group.js +1 -1
  12. package/es/avatar/avatar.js +1 -1
  13. package/es/back-top/index.js +1 -1
  14. package/es/badge/index.js +10 -8
  15. package/es/base/teleport.js +1 -1
  16. package/es/base/transition-props.js +1 -1
  17. package/es/base/transition.js +1 -1
  18. package/es/breadcrumb/breadcrumb-context.js +1 -1
  19. package/es/breadcrumb/breadcrumb-item.js +1 -1
  20. package/es/breadcrumb/breadcrumb.js +1 -1
  21. package/es/button/button-group-context.js +1 -1
  22. package/es/button/button-group.js +1 -1
  23. package/es/button/button.js +13 -6
  24. package/es/calendar/index.js +20 -6
  25. package/es/card/index.js +11 -4
  26. package/es/carousel/carousel-context.js +1 -1
  27. package/es/carousel/carousel-item.js +1 -1
  28. package/es/carousel/carousel.js +1 -1
  29. package/es/carousel/drag.js +1 -1
  30. package/es/cascader/index.js +13 -10
  31. package/es/check-card/check-card-group.js +3 -3
  32. package/es/check-card/check-card.js +155 -141
  33. package/es/check-card/context.js +1 -1
  34. package/es/checkbox/checkbox-group-context.js +1 -1
  35. package/es/checkbox/checkbox-group.js +3 -3
  36. package/es/checkbox/checkbox.js +64 -244
  37. package/es/checkbox/index.js +1 -1
  38. package/es/collapse/collapse-panel.js +1 -1
  39. package/es/collapse/collapse.js +96 -82
  40. package/es/color-picker/alpha.js +1 -1
  41. package/es/color-picker/hue.js +1 -1
  42. package/es/color-picker/index.js +7 -7
  43. package/es/color-picker/mode.js +2 -2
  44. package/es/color-picker/paint.js +1 -1
  45. package/es/color-picker/presets.js +1 -1
  46. package/es/components.js +4 -4
  47. package/es/config/config-context.js +16 -3
  48. package/es/config/context.js +29 -2
  49. package/es/config/index.js +31 -12
  50. package/es/config/popup-host.js +106 -0
  51. package/es/config/size-context.js +1 -1
  52. package/es/config/use-config-appearance.js +62 -2
  53. package/es/const/var.js +6 -2
  54. package/es/date-picker/index.js +404 -885
  55. package/es/descriptions/descriptions-item.js +1 -1
  56. package/es/descriptions/descriptions.js +1 -1
  57. package/es/divider/index.js +1 -1
  58. package/es/drawer/index.js +328 -240
  59. package/es/dropdown/dropdown-button.js +69 -51
  60. package/es/dropdown/dropdown-context.js +1 -1
  61. package/es/dropdown/dropdown.js +137 -93
  62. package/es/dropdown/trigger.js +85 -33
  63. package/es/empty/index.js +3 -4
  64. package/es/feature-card/index.js +15 -4
  65. package/es/feedback-panel/index.js +95 -81
  66. package/es/flame-wrap/index.js +116 -109
  67. package/es/flame-wrap/types.js +54 -6
  68. package/es/flex/index.js +1 -1
  69. package/es/form/field-context.js +16 -2
  70. package/es/form/form-context.js +1 -1
  71. package/es/form/form-item.js +7 -6
  72. package/es/form/form.js +1 -1
  73. package/es/form/utils.js +1 -1
  74. package/es/grid/grid-item.js +1 -1
  75. package/es/grid/grid.js +1 -1
  76. package/es/grid/useBreakpoint.js +1 -1
  77. package/es/icon/index.js +1 -1
  78. package/es/image/group.js +1 -1
  79. package/es/image/image-group-context.js +1 -1
  80. package/es/image/image.js +137 -123
  81. package/es/image/instance.js +1 -1
  82. package/es/image/preview.js +1 -1
  83. package/es/image/utils.js +1 -1
  84. package/es/index.js +3 -3
  85. package/es/input/index.js +3 -3
  86. package/es/input/input-base.js +7 -7
  87. package/es/input/input-box.js +2 -2
  88. package/es/input/input-group.js +43 -127
  89. package/es/input/input.js +1 -1
  90. package/es/input/textarea.js +28 -114
  91. package/es/input-number/index.js +7 -5
  92. package/es/input-otp/index.js +5 -5
  93. package/es/input-tag/index.js +5 -5
  94. package/es/kanban/index.js +79 -63
  95. package/es/layout/index.js +1 -1
  96. package/es/layout/layout-context.js +1 -1
  97. package/es/list-panel/index.js +96 -83
  98. package/es/loading/index.js +1 -1
  99. package/es/loading/loading-bar.js +1 -1
  100. package/es/locale/de.js +10 -2
  101. package/es/locale/el.js +10 -2
  102. package/es/locale/en.js +10 -2
  103. package/es/locale/fr.js +10 -2
  104. package/es/locale/it.js +10 -2
  105. package/es/locale/ja.js +10 -2
  106. package/es/locale/ko.js +10 -2
  107. package/es/locale/ru.js +10 -2
  108. package/es/locale/th.js +10 -2
  109. package/es/locale/uk.js +10 -2
  110. package/es/locale/vi.js +10 -2
  111. package/es/locale/zh-CN.js +10 -2
  112. package/es/locale/zh-TW.js +10 -2
  113. package/es/mentions/index.js +291 -286
  114. package/es/menu/menu-context.js +1 -1
  115. package/es/menu/menu-divider.js +1 -1
  116. package/es/menu/menu-group.js +1 -1
  117. package/es/menu/menu-item.js +1 -1
  118. package/es/menu/menu-keyboard.js +41 -2
  119. package/es/menu/menu.js +268 -222
  120. package/es/menu/recursive-menu.js +1 -1
  121. package/es/menu/sub-menu.js +81 -23
  122. package/es/message/index.js +1 -1
  123. package/es/modal/api.js +46 -12
  124. package/es/modal/modal.js +441 -345
  125. package/es/modal/toast.js +177 -64
  126. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +1 -1
  127. package/es/notice/container.js +1 -1
  128. package/es/notice/content.js +1 -1
  129. package/es/notice/index.js +1 -1
  130. package/es/notice/instance.js +1 -1
  131. package/es/page/index.js +13 -8
  132. package/es/page/responsive.js +1 -1
  133. package/es/page-header/index.js +1 -1
  134. package/es/popconfirm/index.js +36 -35
  135. package/es/poptip/index.js +47 -45
  136. package/es/popup/index.js +5 -2
  137. package/es/popup/layers.js +11 -2
  138. package/es/progress/index.js +1 -1
  139. package/es/qrcode/index.js +13 -7
  140. package/es/radio/radio-button.js +51 -44
  141. package/es/radio/radio-group-context.js +1 -1
  142. package/es/radio/radio-group.js +49 -52
  143. package/es/radio/radio.js +46 -197
  144. package/es/rate/index.js +1 -1
  145. package/es/rate/star.js +1 -1
  146. package/es/result/index.js +1 -1
  147. package/es/ripple/index.js +104 -97
  148. package/es/ripple/types.js +71 -18
  149. package/es/row-col/col.js +1 -1
  150. package/es/row-col/row.js +1 -1
  151. package/es/segmented/index.js +3 -3
  152. package/es/select/option.js +1 -1
  153. package/es/select/select.js +29 -29
  154. package/es/skeleton/skeleton-avatar.js +1 -1
  155. package/es/skeleton/skeleton-button.js +1 -1
  156. package/es/skeleton/skeleton-image.js +1 -1
  157. package/es/skeleton/skeleton-text.js +1 -1
  158. package/es/skeleton/skeleton.js +1 -1
  159. package/es/skeleton/use-skeleton-loading.js +1 -1
  160. package/es/slider/index.js +1 -1
  161. package/es/slider/thumb.js +1 -1
  162. package/es/space/index.js +1 -1
  163. package/es/spin/index.js +1 -1
  164. package/es/splitter/splitter-panel.js +1 -1
  165. package/es/splitter/splitter.js +1 -1
  166. package/es/stat-card/countup.js +2 -2
  167. package/es/stat-card/rollup.js +1 -1
  168. package/es/stat-card/stat-card.js +16 -7
  169. package/es/stat-card/stat-number.js +4 -3
  170. package/es/stat-card/utils/countup.js +1 -1
  171. package/es/stat-card/utils/odometer.js +1 -1
  172. package/es/stat-card/utils/stat-item-key.js +22 -0
  173. package/es/steps/index.js +1 -1
  174. package/es/switch/index.js +3 -3
  175. package/es/table/column-setting.js +104 -115
  176. package/es/table/index.js +544 -206
  177. package/es/table/utils.js +141 -3
  178. package/es/tabs/tab-panel.js +1 -1
  179. package/es/tabs/tabs.js +1 -1
  180. package/es/tag/index.js +12 -5
  181. package/es/time-line/timeline-item.js +1 -1
  182. package/es/time-line/timeline.js +1 -1
  183. package/es/tooltip/index.js +114 -94
  184. package/es/tour/index.js +1 -1
  185. package/es/transfer/index.js +190 -172
  186. package/es/tree/index.js +55 -44
  187. package/es/tree/utils.js +1 -1
  188. package/es/tree-select/index.js +259 -781
  189. package/es/typography/index.js +1 -1
  190. package/es/upload/file-list.js +1 -1
  191. package/es/upload/index.js +5 -6
  192. package/es/upload/picture-sort.js +1 -1
  193. package/es/upload/selector.js +1 -1
  194. package/es/utils/checked.js +1 -1
  195. package/es/utils/color.js +25 -2
  196. package/es/utils/css.js +19 -0
  197. package/es/utils/focus.js +63 -0
  198. package/es/utils/number.js +1 -1
  199. package/es/utils/overlay-order.js +18 -0
  200. package/es/utils/overlay-stack.js +33 -0
  201. package/es/utils/placement.js +1 -1
  202. package/es/utils/popup.js +1 -1
  203. package/es/utils/promise.js +18 -0
  204. package/es/utils/react-node.js +55 -30
  205. package/es/utils/selection-tags.js +6 -4
  206. package/es/utils/share.js +5 -2
  207. package/es/utils/theme.js +1 -1
  208. package/es/utils/transition.js +1 -1
  209. package/es/utils/use-value.js +1 -1
  210. package/es/virtual-list/index.js +1 -1
  211. package/es/virtual-list/range.js +3 -2
  212. package/es/watermark/index.js +1 -1
  213. package/lib/index.cjs +2 -2
  214. package/lib/locale/de.cjs +2 -2
  215. package/lib/locale/el.cjs +2 -2
  216. package/lib/locale/en.cjs +2 -2
  217. package/lib/locale/fr.cjs +2 -2
  218. package/lib/locale/it.cjs +2 -2
  219. package/lib/locale/ja.cjs +2 -2
  220. package/lib/locale/ko.cjs +2 -2
  221. package/lib/locale/ru.cjs +2 -2
  222. package/lib/locale/th.cjs +2 -2
  223. package/lib/locale/uk.cjs +2 -2
  224. package/lib/locale/vi.cjs +2 -2
  225. package/lib/locale/zh-CN.cjs +2 -2
  226. package/lib/locale/zh-TW.cjs +2 -2
  227. package/package.json +4 -3
  228. package/readme.md +3 -1
  229. package/style/base.css +2 -2
  230. package/style/components.css +2 -2
  231. package/style/index.css +2 -2
  232. package/style/theme.css +2 -2
  233. package/types/alert/index.d.cts +2 -2
  234. package/types/alert/index.d.ts +2 -2
  235. package/types/auto-complete/index.d.cts +7 -1
  236. package/types/auto-complete/index.d.ts +7 -1
  237. package/types/badge/index.d.cts +2 -1
  238. package/types/badge/index.d.ts +2 -1
  239. package/types/button/button.d.cts +2 -2
  240. package/types/button/button.d.ts +2 -2
  241. package/types/card/index.d.cts +3 -3
  242. package/types/card/index.d.ts +3 -3
  243. package/types/cascader/index.d.cts +1 -1
  244. package/types/cascader/index.d.ts +1 -1
  245. package/types/cascader/types.d.cts +2 -0
  246. package/types/cascader/types.d.ts +2 -0
  247. package/types/check-card/context.d.cts +4 -3
  248. package/types/check-card/context.d.ts +4 -3
  249. package/types/check-card/index.d.cts +1 -1
  250. package/types/check-card/index.d.ts +1 -1
  251. package/types/check-card/types.d.cts +3 -4
  252. package/types/check-card/types.d.ts +3 -4
  253. package/types/checkbox/checkbox-group.d.cts +2 -2
  254. package/types/checkbox/checkbox-group.d.ts +2 -2
  255. package/types/checkbox/checkbox.d.cts +2 -2
  256. package/types/checkbox/checkbox.d.ts +2 -2
  257. package/types/collapse/collapse.d.cts +3 -3
  258. package/types/collapse/collapse.d.ts +3 -3
  259. package/types/color-picker/index.d.cts +3 -1
  260. package/types/color-picker/index.d.ts +3 -1
  261. package/types/components.d.cts +2 -2
  262. package/types/components.d.ts +2 -2
  263. package/types/config/config-context.d.cts +15 -2
  264. package/types/config/config-context.d.ts +15 -2
  265. package/types/config/context.d.cts +6 -0
  266. package/types/config/context.d.ts +6 -0
  267. package/types/config/popup-host.d.cts +16 -0
  268. package/types/config/popup-host.d.ts +16 -0
  269. package/types/config/use-config-appearance.d.cts +41 -2
  270. package/types/config/use-config-appearance.d.ts +41 -2
  271. package/types/const/types.d.cts +30 -1
  272. package/types/const/types.d.ts +30 -1
  273. package/types/const/var.d.cts +6 -1
  274. package/types/const/var.d.ts +6 -1
  275. package/types/date-picker/index.d.cts +3 -1
  276. package/types/date-picker/index.d.ts +3 -1
  277. package/types/descriptions/descriptions.d.cts +2 -2
  278. package/types/descriptions/descriptions.d.ts +2 -2
  279. package/types/drawer/index.d.cts +1 -0
  280. package/types/drawer/index.d.ts +1 -0
  281. package/types/dropdown/dropdown-button.d.cts +5 -2
  282. package/types/dropdown/dropdown-button.d.ts +5 -2
  283. package/types/dropdown/dropdown-context.d.cts +6 -0
  284. package/types/dropdown/dropdown-context.d.ts +6 -0
  285. package/types/dropdown/dropdown.d.cts +2 -0
  286. package/types/dropdown/dropdown.d.ts +2 -0
  287. package/types/feature-card/index.d.cts +3 -3
  288. package/types/feature-card/index.d.ts +3 -3
  289. package/types/feedback-panel/index.d.cts +3 -3
  290. package/types/feedback-panel/index.d.ts +3 -3
  291. package/types/flame-wrap/types.d.cts +18 -0
  292. package/types/flame-wrap/types.d.ts +18 -0
  293. package/types/form/field-context.d.cts +2 -0
  294. package/types/form/field-context.d.ts +2 -0
  295. package/types/image/image.d.cts +2 -2
  296. package/types/image/image.d.ts +2 -2
  297. package/types/input/input-group.d.cts +2 -2
  298. package/types/input/input-group.d.ts +2 -2
  299. package/types/input-number/index.d.cts +2 -0
  300. package/types/input-number/index.d.ts +2 -0
  301. package/types/kanban/index.d.cts +3 -2
  302. package/types/kanban/index.d.ts +3 -2
  303. package/types/list-panel/index.d.cts +3 -3
  304. package/types/list-panel/index.d.ts +3 -3
  305. package/types/locale/de.d.cts +6 -0
  306. package/types/locale/de.d.ts +6 -0
  307. package/types/locale/el.d.cts +6 -0
  308. package/types/locale/el.d.ts +6 -0
  309. package/types/locale/en.d.cts +6 -0
  310. package/types/locale/en.d.ts +6 -0
  311. package/types/locale/fr.d.cts +6 -0
  312. package/types/locale/fr.d.ts +6 -0
  313. package/types/locale/it.d.cts +6 -0
  314. package/types/locale/it.d.ts +6 -0
  315. package/types/locale/ja.d.cts +6 -0
  316. package/types/locale/ja.d.ts +6 -0
  317. package/types/locale/ko.d.cts +6 -0
  318. package/types/locale/ko.d.ts +6 -0
  319. package/types/locale/ru.d.cts +6 -0
  320. package/types/locale/ru.d.ts +6 -0
  321. package/types/locale/th.d.cts +6 -0
  322. package/types/locale/th.d.ts +6 -0
  323. package/types/locale/uk.d.cts +6 -0
  324. package/types/locale/uk.d.ts +6 -0
  325. package/types/locale/vi.d.cts +6 -0
  326. package/types/locale/vi.d.ts +6 -0
  327. package/types/locale/zh-CN.d.cts +6 -0
  328. package/types/locale/zh-CN.d.ts +6 -0
  329. package/types/locale/zh-TW.d.cts +6 -0
  330. package/types/locale/zh-TW.d.ts +6 -0
  331. package/types/mentions/index.d.cts +2 -0
  332. package/types/mentions/index.d.ts +2 -0
  333. package/types/menu/menu-keyboard.d.cts +23 -0
  334. package/types/menu/menu-keyboard.d.ts +23 -0
  335. package/types/modal/api.d.cts +6 -1
  336. package/types/modal/api.d.ts +6 -1
  337. package/types/modal/modal.d.cts +1 -0
  338. package/types/modal/modal.d.ts +1 -0
  339. package/types/modal/toast.d.cts +8 -2
  340. package/types/modal/toast.d.ts +8 -2
  341. package/types/page/index.d.cts +2 -2
  342. package/types/page/index.d.ts +2 -2
  343. package/types/popconfirm/index.d.cts +2 -0
  344. package/types/popconfirm/index.d.ts +2 -0
  345. package/types/poptip/index.d.cts +2 -0
  346. package/types/poptip/index.d.ts +2 -0
  347. package/types/popup/layers.d.cts +2 -0
  348. package/types/popup/layers.d.ts +2 -0
  349. package/types/qrcode/index.d.cts +2 -2
  350. package/types/qrcode/index.d.ts +2 -2
  351. package/types/radio/radio-button.d.cts +2 -2
  352. package/types/radio/radio-button.d.ts +2 -2
  353. package/types/radio/radio-group.d.cts +2 -2
  354. package/types/radio/radio-group.d.ts +2 -2
  355. package/types/radio/radio.d.cts +2 -2
  356. package/types/radio/radio.d.ts +2 -2
  357. package/types/ripple/types.d.cts +18 -0
  358. package/types/ripple/types.d.ts +18 -0
  359. package/types/select/select.d.cts +2 -0
  360. package/types/select/select.d.ts +2 -0
  361. package/types/stat-card/stat-card.d.cts +3 -3
  362. package/types/stat-card/stat-card.d.ts +3 -3
  363. package/types/stat-card/utils/stat-item-key.d.cts +11 -0
  364. package/types/stat-card/utils/stat-item-key.d.ts +11 -0
  365. package/types/table/column-setting.d.cts +4 -4
  366. package/types/table/column-setting.d.ts +4 -4
  367. package/types/table/index.d.cts +2 -2
  368. package/types/table/index.d.ts +2 -2
  369. package/types/table/types.d.cts +21 -2
  370. package/types/table/types.d.ts +21 -2
  371. package/types/table/utils.d.cts +75 -0
  372. package/types/table/utils.d.ts +75 -0
  373. package/types/tag/index.d.cts +2 -2
  374. package/types/tag/index.d.ts +2 -2
  375. package/types/tooltip/index.d.cts +2 -0
  376. package/types/tooltip/index.d.ts +2 -0
  377. package/types/transfer/index.d.cts +3 -2
  378. package/types/transfer/index.d.ts +3 -2
  379. package/types/tree-select/index.d.cts +3 -1
  380. package/types/tree-select/index.d.ts +3 -1
  381. package/types/utils/checked.d.cts +1 -1
  382. package/types/utils/checked.d.ts +1 -1
  383. package/types/utils/color.d.cts +13 -0
  384. package/types/utils/color.d.ts +13 -0
  385. package/types/utils/css.d.cts +2 -0
  386. package/types/utils/css.d.ts +2 -0
  387. package/types/utils/focus.d.cts +5 -0
  388. package/types/utils/focus.d.ts +5 -0
  389. package/types/utils/overlay-order.d.cts +6 -0
  390. package/types/utils/overlay-order.d.ts +6 -0
  391. package/types/utils/overlay-stack.d.cts +13 -0
  392. package/types/utils/overlay-stack.d.ts +13 -0
  393. package/types/utils/promise.d.cts +5 -0
  394. package/types/utils/promise.d.ts +5 -0
  395. package/types/utils/react-node.d.cts +10 -0
  396. package/types/utils/react-node.d.ts +10 -0
@@ -137,7 +137,7 @@
137
137
  "default"
138
138
  ],
139
139
  "library": "react-kui",
140
- "version": "3.1.2",
140
+ "version": "3.2.0",
141
141
  "framework": "react",
142
142
  "components": [
143
143
  {
@@ -1400,7 +1400,7 @@
1400
1400
  ],
1401
1401
  "boolean": false,
1402
1402
  "defaultExpression": "\"warning\"",
1403
- "descriptionZh": "按钮类型,可选值为 `success`、`info`、`warning`、`error` 或者不设置",
1403
+ "descriptionZh": "警告类型,可选值为 `success`、`info`、`warning`、`error`,不设置时是 `warning`",
1404
1404
  "descriptionEn": "Alert type, optional values are `success`, `info`, `warning`, `error` or not set"
1405
1405
  },
1406
1406
  {
@@ -1468,20 +1468,19 @@
1468
1468
  },
1469
1469
  {
1470
1470
  "name": "theme",
1471
- "type": "ThemeType | undefined",
1471
+ "type": "SurfaceThemeType | undefined",
1472
1472
  "required": false,
1473
1473
  "enumValues": [
1474
1474
  "dashed",
1475
1475
  "solid",
1476
- "default",
1477
1476
  "fill",
1478
1477
  "outline",
1479
- "plain",
1480
- "underlined"
1478
+ "plain"
1481
1479
  ],
1482
1480
  "boolean": false,
1483
- "descriptionZh": "主题",
1484
- "descriptionEn": "Theme"
1481
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
1482
+ "descriptionZh": "外观主题",
1483
+ "descriptionEn": "Surface theme"
1485
1484
  },
1486
1485
  {
1487
1486
  "name": "shape",
@@ -1494,6 +1493,7 @@
1494
1493
  "circle"
1495
1494
  ],
1496
1495
  "boolean": false,
1496
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
1497
1497
  "descriptionZh": "形状",
1498
1498
  "descriptionEn": "Shape"
1499
1499
  },
@@ -1930,6 +1930,11 @@
1930
1930
  "id": "components/alert/demo/custom-icon.tsx",
1931
1931
  "title": "自定义图标",
1932
1932
  "source": "import { LogoAlipay, LogoApple, LogoGoogle, LogoWechat } from \"kui-icons\";\nimport { Space, Alert } from \"react-kui\";\n\nexport default function App() {\n return (\n <Space vertical block>\n <Alert type=\"success\" icon={LogoAlipay}>\n Success Text\n </Alert>\n <Alert type=\"info\" icon={LogoWechat}>\n Info Text\n </Alert>\n <Alert type=\"warning\" icon={LogoApple}>\n Warning Text\n </Alert>\n <Alert type=\"error\" icon={LogoGoogle}>\n Error Text\n </Alert>\n <Alert\n type=\"success\"\n icon={LogoAlipay}\n message=\"Success Tip\"\n description=\"Congratulations, the operation is successful.\"\n />\n <Alert\n type=\"info\"\n icon={LogoWechat}\n message=\"Informational Notes\"\n description=\"Congratulations, the operation is successful.\"\n />\n <Alert\n type=\"warning\"\n icon={LogoApple}\n message=\"Warning\"\n description=\"Nuclear bomb launching base, please do not approach!\"\n />\n <Alert\n type=\"error\"\n icon={LogoGoogle}\n message=\"Error\"\n description=\"Encountered an error, please press any key to continue.\"\n />\n </Space>\n );\n}"
1933
+ },
1934
+ {
1935
+ "id": "components/alert/demo/appearance.tsx",
1936
+ "title": "外观",
1937
+ "source": "import { Alert, Space, type SurfaceThemeType } from \"react-kui\";\n\n// The alert's colour comes from `type` and the tier only decides how much of it is shown, so the five rows\n// below keep one `type` and change nothing else: `fill` — the alert's own look — is that colour as a pale\n// plate, `solid` spreads the same colour over the whole bar and inverts its text, icon and close button,\n// `outline` and `plain` drop the plate and keep the border, `dashed` swaps that border for a dashed one.\n// An `error` alert stays red under `solid`; the primary is not involved.\nconst tiers: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Space vertical block>\n {tiers.map((tier) => (\n <Alert key={tier} type=\"info\" theme={tier}>\n theme: {tier}\n </Alert>\n ))}\n </Space>\n );\n}"
1933
1938
  }
1934
1939
  ]
1935
1940
  },
@@ -1990,6 +1995,7 @@
1990
1995
  "type": "string | undefined",
1991
1996
  "required": false,
1992
1997
  "boolean": false,
1998
+ "defaultExpression": "todayText ?? locale.k.datePicker.today ?? \"Today\"",
1993
1999
  "descriptionZh": "“今天”按钮的文本",
1994
2000
  "descriptionEn": "Text of the \"Today\" button"
1995
2001
  },
@@ -2553,16 +2559,19 @@
2553
2559
  },
2554
2560
  {
2555
2561
  "name": "theme",
2556
- "type": "\"fill\" | \"outline\" | undefined",
2562
+ "type": "SurfaceThemeType | undefined",
2557
2563
  "required": false,
2558
2564
  "enumValues": [
2565
+ "dashed",
2566
+ "solid",
2559
2567
  "fill",
2560
- "outline"
2568
+ "outline",
2569
+ "plain"
2561
2570
  ],
2562
2571
  "boolean": false,
2563
- "defaultExpression": "\"fill\"",
2564
- "descriptionZh": "主题",
2565
- "descriptionEn": "Theme"
2572
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
2573
+ "descriptionZh": "外观主题",
2574
+ "descriptionEn": "Surface theme"
2566
2575
  },
2567
2576
  {
2568
2577
  "name": "onMove",
@@ -3021,7 +3030,7 @@
3021
3030
  {
3022
3031
  "id": "components/kanban/demo/theme.tsx",
3023
3032
  "title": "主题",
3024
- "source": "import { useState } from \"react\";\nimport { Card, Kanban, RadioGroup, Space } from \"react-kui\";\nconst columns = [\n { key: \"todo\", title: \"Todo\", color: \"#87909c\" },\n { key: \"doing\", title: \"Doing\", color: \"#3a95ff\" },\n { key: \"done\", title: \"Done\", color: \"#22a06b\" },\n];\nconst tasks = [\n { id: 1, status: \"todo\", title: \"Define requirements\" },\n { id: 2, status: \"doing\", title: \"Build component\" },\n];\nexport default function App() {\n const [theme, setTheme] = useState<\"fill\" | \"outline\">(\"fill\");\n return (\n <Space vertical block>\n <RadioGroup\n type=\"button\"\n options={[\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ]}\n value={theme}\n onChange={(value) => setTheme(value as typeof theme)}\n />\n <Kanban\n columns={columns}\n data={tasks}\n theme={theme}\n item={(item) => (\n <Card size=\"small\" theme={theme}>\n {String(item.title)}\n </Card>\n )}\n />\n </Space>\n );\n}"
3033
+ "source": "import { useState } from \"react\";\nimport { Card, Kanban, RadioGroup, Space } from \"react-kui\";\nconst columns = [\n { key: \"todo\", title: \"Todo\", color: \"#87909c\" },\n { key: \"doing\", title: \"Doing\", color: \"#3a95ff\" },\n { key: \"done\", title: \"Done\", color: \"#22a06b\" },\n];\nconst tasks = [\n { id: 1, status: \"todo\", title: \"Define requirements\" },\n { id: 2, status: \"doing\", title: \"Build component\" },\n];\nexport default function App() {\n // The board offers the five tiers it paints; `underlined` is a control tier and would land back on `fill`.\n const [theme, setTheme] = useState<\"fill\" | \"outline\" | \"plain\" | \"solid\" | \"dashed\">(\"fill\");\n return (\n <Space vertical block>\n <RadioGroup\n type=\"button\"\n options={[\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n { label: \"Plain\", value: \"plain\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Dashed\", value: \"dashed\" },\n ]}\n value={theme}\n onChange={(value) => setTheme(value as typeof theme)}\n />\n <Kanban\n columns={columns}\n data={tasks}\n theme={theme}\n item={(item) => (\n <Card size=\"small\" theme={theme}>\n {String(item.title)}\n </Card>\n )}\n />\n </Space>\n );\n}"
3025
3034
  }
3026
3035
  ]
3027
3036
  },
@@ -3053,26 +3062,27 @@
3053
3062
  },
3054
3063
  {
3055
3064
  "name": "theme",
3056
- "type": "\"fill\" | \"outline\" | \"plain\" | undefined",
3065
+ "type": "SurfaceThemeType | undefined",
3057
3066
  "required": false,
3058
3067
  "enumValues": [
3068
+ "dashed",
3069
+ "solid",
3059
3070
  "fill",
3060
3071
  "outline",
3061
3072
  "plain"
3062
3073
  ],
3063
3074
  "boolean": false,
3064
- "descriptionZh": "主题",
3065
- "descriptionEn": "Theme"
3075
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"outline\"",
3076
+ "descriptionZh": "外观主题",
3077
+ "descriptionEn": "Appearance theme"
3066
3078
  },
3067
3079
  {
3068
3080
  "name": "shape",
3069
- "type": "ShapeType | undefined",
3081
+ "type": "SurfaceShapeType | undefined",
3070
3082
  "required": false,
3071
3083
  "enumValues": [
3072
3084
  "round",
3073
- "default",
3074
- "square",
3075
- "circle"
3085
+ "square"
3076
3086
  ],
3077
3087
  "boolean": false,
3078
3088
  "descriptionZh": "形状",
@@ -3088,6 +3098,7 @@
3088
3098
  "large"
3089
3099
  ],
3090
3100
  "boolean": false,
3101
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
3091
3102
  "descriptionZh": "尺寸",
3092
3103
  "descriptionEn": "Size"
3093
3104
  },
@@ -3533,6 +3544,11 @@
3533
3544
  "id": "components/list-panel/demo/selection.tsx",
3534
3545
  "title": "批量操作",
3535
3546
  "source": "import { Search } from \"kui-icons\";\nimport { Button, Input, ListPanel, Table } from \"react-kui\";\nimport { useState } from \"react\";\nconst columns = [\n { title: \"Name\", key: \"name\" },\n { title: \"Role\", key: \"role\" },\n];\nconst data = [\n { key: 1, name: \"Alex\", role: \"Admin\" },\n { key: 2, name: \"Mia\", role: \"Editor\" },\n { key: 3, name: \"Leo\", role: \"Viewer\" },\n];\nexport default function App() {\n const [selected, setSelected] = useState<(string | number)[]>([]);\n return (\n <ListPanel\n selectedCount={selected.length}\n selection={(count) => (\n <>\n <strong>{count} selected</strong>\n <Button size=\"small\" theme=\"plain\">\n Disable\n </Button>\n <Button size=\"small\" theme=\"plain\" onClick={() => setSelected([])}>\n Clear\n </Button>\n </>\n )}\n filters={<Input icon={Search} placeholder=\"Search users\" style={{ width: 200 }} />}\n >\n <Table\n checkable\n selectedKeys={selected}\n onSelectedKeysChange={setSelected}\n data={data}\n columns={columns}\n />\n </ListPanel>\n );\n}"
3547
+ },
3548
+ {
3549
+ "id": "components/list-panel/demo/appearance.tsx",
3550
+ "title": "外观",
3551
+ "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Button,\n Input,\n ListPanel,\n RadioGroup,\n Space,\n Table,\n type SurfaceThemeType,\n} from \"react-kui\";\n\nconst columns = [\n { title: \"Name\", key: \"name\" },\n { title: \"Role\", key: \"role\" },\n];\nconst data = [\n { key: 1, name: \"Alex\", role: \"Admin\" },\n { key: 2, name: \"Mia\", role: \"Editor\" },\n { key: 3, name: \"Leo\", role: \"Viewer\" },\n];\n\n// The panel does not plate itself: the tier it is given is painted on the card it renders under the header,\n// so the five options change the plate and frame of the whole panel rather than one part of it. `solid` is\n// the tier that moves content — the result summary turns to light-on-primary text and the bulk-action strip\n// swaps its grey plate for a pale one on the primary. Select a row to make that strip appear.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n const [tier, setTier] = useState<SurfaceThemeType>(\"outline\");\n const [selected, setSelected] = useState<(string | number)[]>([1]);\n return (\n <Space vertical block>\n <RadioGroup\n type=\"button\"\n options={tiers.map((value) => ({ label: value, value }))}\n value={tier}\n onChange={(value) => setTier(value as SurfaceThemeType)}\n />\n <ListPanel\n theme={tier}\n summary={`${data.length} users`}\n selectedCount={selected.length}\n selection={(count) => (\n <>\n <strong>{count} selected</strong>\n <Button size=\"small\" theme=\"plain\">\n Disable\n </Button>\n <Button size=\"small\" theme=\"plain\" onClick={() => setSelected([])}>\n Clear\n </Button>\n </>\n )}\n filters={<Input icon={Search} placeholder=\"Search users\" style={{ width: 200 }} />}\n >\n <Table\n checkable\n selectedKeys={selected}\n onSelectedKeysChange={setSelected}\n data={data}\n columns={columns}\n />\n </ListPanel>\n </Space>\n );\n}"
3536
3552
  }
3537
3553
  ]
3538
3554
  },
@@ -3554,6 +3570,7 @@
3554
3570
  "type": "(string | AutoCompleteOption)[] | undefined",
3555
3571
  "required": false,
3556
3572
  "boolean": false,
3573
+ "defaultExpression": "EMPTY_OPTIONS",
3557
3574
  "descriptionZh": "候选项",
3558
3575
  "descriptionEn": "Suggestions"
3559
3576
  },
@@ -3578,6 +3595,7 @@
3578
3595
  true
3579
3596
  ],
3580
3597
  "boolean": true,
3598
+ "defaultExpression": "false",
3581
3599
  "descriptionZh": "空输入聚焦时展示建议",
3582
3600
  "descriptionEn": "Show suggestions for an empty focused input"
3583
3601
  },
@@ -3590,6 +3608,7 @@
3590
3608
  true
3591
3609
  ],
3592
3610
  "boolean": true,
3611
+ "defaultExpression": "false",
3593
3612
  "descriptionZh": "有值且悬停时显示清除按钮",
3594
3613
  "descriptionEn": "Show clear button on hover"
3595
3614
  },
@@ -3602,6 +3621,7 @@
3602
3621
  true
3603
3622
  ],
3604
3623
  "boolean": true,
3624
+ "defaultExpression": "false",
3605
3625
  "descriptionZh": "是否正在加载",
3606
3626
  "descriptionEn": "Loading state"
3607
3627
  },
@@ -3613,6 +3633,38 @@
3613
3633
  "descriptionZh": "加载提示文字",
3614
3634
  "descriptionEn": "Loading text"
3615
3635
  },
3636
+ {
3637
+ "name": "addonBefore",
3638
+ "type": "React.ReactNode",
3639
+ "required": false,
3640
+ "boolean": false,
3641
+ "descriptionZh": "输入框外部前置附件",
3642
+ "descriptionEn": "Addon before the input"
3643
+ },
3644
+ {
3645
+ "name": "addonAfter",
3646
+ "type": "React.ReactNode",
3647
+ "required": false,
3648
+ "boolean": false,
3649
+ "descriptionZh": "输入框外部后置附件",
3650
+ "descriptionEn": "Addon after the input"
3651
+ },
3652
+ {
3653
+ "name": "prefix",
3654
+ "type": "React.ReactNode",
3655
+ "required": false,
3656
+ "boolean": false,
3657
+ "descriptionZh": "输入框内部前缀",
3658
+ "descriptionEn": "Inline prefix"
3659
+ },
3660
+ {
3661
+ "name": "suffix",
3662
+ "type": "React.ReactNode",
3663
+ "required": false,
3664
+ "boolean": false,
3665
+ "descriptionZh": "输入框内部后缀",
3666
+ "descriptionEn": "Inline suffix"
3667
+ },
3616
3668
  {
3617
3669
  "name": "size",
3618
3670
  "type": "SizeType | undefined",
@@ -3647,24 +3699,38 @@
3647
3699
  "enumValues": [
3648
3700
  "dashed",
3649
3701
  "solid",
3650
- "default",
3651
3702
  "fill",
3652
3703
  "outline",
3653
3704
  "plain",
3654
3705
  "underlined"
3655
3706
  ],
3656
3707
  "boolean": false,
3657
- "descriptionZh": "主题",
3658
- "descriptionEn": "Theme"
3708
+ "defaultExpression": "themeProp ?? inheritedAppearance.theme ?? \"fill\"",
3709
+ "descriptionZh": "主题,画在内部输入框上,可用档位与 Input 一致",
3710
+ "descriptionEn": "Theme, painted on the inner input box; supports the same tiers as Input"
3659
3711
  },
3660
3712
  {
3661
3713
  "name": "filterOption",
3662
3714
  "type": "boolean | ((input: string, option: AutoCompleteOption) => boolean) | undefined",
3663
3715
  "required": false,
3664
3716
  "boolean": false,
3717
+ "defaultExpression": "true",
3665
3718
  "descriptionZh": "是否过滤或自定义过滤",
3666
3719
  "descriptionEn": "Filter strategy"
3667
3720
  },
3721
+ {
3722
+ "name": "destroyOnClose",
3723
+ "type": "boolean | undefined",
3724
+ "required": false,
3725
+ "enumValues": [
3726
+ false,
3727
+ true
3728
+ ],
3729
+ "boolean": true,
3730
+ "defaultExpression": "true",
3731
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
3732
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
3733
+ },
3668
3734
  {
3669
3735
  "name": "onChange",
3670
3736
  "type": "((value: string) => void) | undefined",
@@ -3734,7 +3800,6 @@
3734
3800
  "content",
3735
3801
  "datatype",
3736
3802
  "inlist",
3737
- "prefix",
3738
3803
  "property",
3739
3804
  "rel",
3740
3805
  "resource",
@@ -4031,7 +4096,6 @@
4031
4096
  "about": "string",
4032
4097
  "content": "string",
4033
4098
  "datatype": "string",
4034
- "prefix": "string",
4035
4099
  "property": "string",
4036
4100
  "rel": "string",
4037
4101
  "resource": "string",
@@ -4156,6 +4220,10 @@
4156
4220
  }
4157
4221
  ],
4158
4222
  "renderProps": [
4223
+ "addonBefore",
4224
+ "addonAfter",
4225
+ "prefix",
4226
+ "suffix",
4159
4227
  "filterOption"
4160
4228
  ],
4161
4229
  "behavior": {
@@ -4168,6 +4236,11 @@
4168
4236
  "title": "基础用法",
4169
4237
  "source": "import { AutoComplete } from \"react-kui\";\nimport { useState } from \"react\";\nexport default function App() {\n const [value, setValue] = useState(\"\");\n return (\n <AutoComplete\n value={value}\n onChange={setValue}\n clearable\n placeholder=\"Please input\"\n options={[\"Vue\", \"React\", \"Solid\", \"Svelte\"]}\n />\n );\n}"
4170
4238
  },
4239
+ {
4240
+ "id": "components/auto-complete/demo/addon.tsx",
4241
+ "title": "附件与前后缀",
4242
+ "source": "import { useState } from \"react\";\nimport { AutoComplete, Button, Space } from \"react-kui\";\nexport default function App() {\n const [value, setValue] = useState(\"\");\n return (\n <Space vertical block>\n <AutoComplete\n value={value}\n onChange={setValue}\n addonBefore=\"https://\"\n addonAfter={<Button>OK</Button>}\n placeholder=\"Please input domain\"\n options={[\"kui\", \"kui-pro\", \"kui-admin\", \"kui-docs\"]}\n />\n <AutoComplete\n prefix=\"@\"\n suffix=\".cn\"\n placeholder=\"Please input handle\"\n options={[\"kui\", \"kui-pro\", \"kui-admin\", \"kui-docs\"]}\n />\n </Space>\n );\n}"
4243
+ },
4171
4244
  {
4172
4245
  "id": "components/auto-complete/demo/controlled.tsx",
4173
4246
  "title": "受控值",
@@ -4181,7 +4254,7 @@
4181
4254
  {
4182
4255
  "id": "components/auto-complete/demo/appearance.tsx",
4183
4256
  "title": "尺寸、主题与形状",
4184
- "source": "import { AutoComplete, Space } from \"react-kui\";\nconst options = [\"Vue\", \"Vite\", \"Vitest\"];\nexport default function App() {\n return (\n <Space vertical>\n <AutoComplete size=\"small\" theme=\"plain\" options={options} placeholder=\"small / plain\" />\n <AutoComplete\n shape=\"square\"\n theme=\"outline\"\n options={options}\n placeholder=\"square / outline\"\n />\n <AutoComplete size=\"large\" shape=\"circle\" options={options} placeholder=\"large / circle\" />\n </Space>\n );\n}"
4257
+ "source": "import { AutoComplete, Space } from \"react-kui\";\nconst options = [\"Vue\", \"Vite\", \"Vitest\"];\nexport default function App() {\n return (\n <Space vertical>\n <AutoComplete size=\"small\" theme=\"plain\" options={options} placeholder=\"small / plain\" />\n <AutoComplete theme=\"dashed\" options={options} placeholder=\"plain\" />\n <AutoComplete\n shape=\"square\"\n theme=\"outline\"\n options={options}\n placeholder=\"square / outline\"\n />\n <AutoComplete size=\"large\" shape=\"circle\" options={options} placeholder=\"large / circle\" />\n </Space>\n );\n}"
4185
4258
  },
4186
4259
  {
4187
4260
  "id": "components/auto-complete/demo/show-on-empty.tsx",
@@ -7365,8 +7438,8 @@
7365
7438
  "type": "string | undefined",
7366
7439
  "required": false,
7367
7440
  "boolean": false,
7368
- "descriptionZh": "徽标颜色",
7369
- "descriptionEn": "Badge color"
7441
+ "descriptionZh": "徽标颜色:预设色值名(与 `Tag` 同一套,如 `blue`)或任意可读色值",
7442
+ "descriptionEn": "Badge color: a preset name (the same set `Tag` uses, e.g. `blue`) or any readable color value"
7370
7443
  },
7371
7444
  {
7372
7445
  "name": "status",
@@ -7379,7 +7452,6 @@
7379
7452
  "error"
7380
7453
  ],
7381
7454
  "boolean": false,
7382
- "defaultExpression": "\"default\"",
7383
7455
  "descriptionZh": "将徽章设置为状态点",
7384
7456
  "descriptionEn": "Set Badge as a status dot"
7385
7457
  },
@@ -7811,7 +7883,7 @@
7811
7883
  {
7812
7884
  "id": "components/badge/demo/color.tsx",
7813
7885
  "title": "多彩徽标",
7814
- "source": "import { useState } from \"react\";\nimport { Badge, Space, Switch } from \"react-kui\";\nconst custom = [\"#c20\", \"#39f\", \"#e3f\", \"#6c0\"];\nconst colors = [\n \"pink\",\n \"red\",\n \"yellow\",\n \"orange\",\n \"cyan\",\n \"green\",\n \"blue\",\n \"purple\",\n \"magenta\",\n \"volcano\",\n \"gold\",\n \"lime\",\n];\nexport default function App() {\n const [active, setActive] = useState(false);\n return (\n <Space vertical block>\n <Space>\n Active : <Switch checked={active} onChange={(value) => setActive(Boolean(value))} />\n </Space>\n <code>Presets</code>\n <Space wrap>\n {colors.map((color) => (\n <Badge key={color} color={color} text={color} active={active} />\n ))}\n </Space>\n <br />\n <code>Custom</code>\n {custom.map((color) => (\n <div key={color}>\n <Badge color={color} text={color} active={active} />\n </div>\n ))}\n </Space>\n );\n}"
7886
+ "source": "import { useState } from \"react\";\nimport { Badge, Space, Switch } from \"react-kui\";\nconst custom = [\"#c20\", \"#39f\", \"#e3f\", \"#6c0\"];\nconst colors = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n \"gray\",\n];\nexport default function App() {\n const [active, setActive] = useState(false);\n return (\n <Space vertical block>\n <Space>\n Active : <Switch checked={active} onChange={(value) => setActive(Boolean(value))} />\n </Space>\n <code>Presets</code>\n <Space wrap>\n {colors.map((color) => (\n <Badge key={color} color={color} text={color} active={active} />\n ))}\n </Space>\n <br />\n <code>Custom</code>\n {custom.map((color) => (\n <div key={color}>\n <Badge color={color} text={color} active={active} />\n </div>\n ))}\n </Space>\n );\n}"
7815
7887
  }
7816
7888
  ]
7817
7889
  },
@@ -7865,6 +7937,7 @@
7865
7937
  "large"
7866
7938
  ],
7867
7939
  "boolean": false,
7940
+ "defaultExpression": "sizeProp ?? buttonGroup?.size ?? parentSize ?? size ?? \"default\"",
7868
7941
  "descriptionZh": "按钮尺寸,",
7869
7942
  "descriptionEn": "Button size,"
7870
7943
  },
@@ -7873,8 +7946,8 @@
7873
7946
  "type": "string | undefined",
7874
7947
  "required": false,
7875
7948
  "boolean": false,
7876
- "descriptionZh": "自定义按钮颜色",
7877
- "descriptionEn": "Custom button color"
7949
+ "descriptionZh": "按钮颜色:预设色值名(与 `Tag` / `Badge` 同一套,如 `blue`);写了 `theme` 就在这一档上上色,没写时它自带一张实心面;这套名字之外的颜色不改变按钮外观",
7950
+ "descriptionEn": "Button color: a preset name (the same set `Tag` / `Badge` use, e.g. `blue`); with `theme` it paints that tier, without one it brings its own solid surface; a color outside this set does not change the button's look"
7878
7951
  },
7879
7952
  {
7880
7953
  "name": "loading",
@@ -7921,20 +7994,18 @@
7921
7994
  },
7922
7995
  {
7923
7996
  "name": "theme",
7924
- "type": "ThemeType | undefined",
7997
+ "type": "SurfaceThemeType | undefined",
7925
7998
  "required": false,
7926
7999
  "enumValues": [
7927
8000
  "dashed",
7928
8001
  "solid",
7929
- "default",
7930
8002
  "fill",
7931
8003
  "outline",
7932
- "plain",
7933
- "underlined"
8004
+ "plain"
7934
8005
  ],
7935
8006
  "boolean": false,
7936
- "descriptionZh": "按钮主题",
7937
- "descriptionEn": "Button theme"
8007
+ "descriptionZh": "按钮主题,可用 `fill` / `outline` / `plain` / `solid` / `dashed`;不写 `theme` 就是按钮自身的外观,`underlined` 是给可输入的控件用的,按钮不会画下划线",
8008
+ "descriptionEn": "Button theme; `fill` / `outline` / `plain` / `solid` / `dashed` are drawn. Leaving `theme` unset keeps the button's own look, and `underlined` belongs to controls you type into, so a button never draws an underline"
7938
8009
  },
7939
8010
  {
7940
8011
  "name": "shape",
@@ -8382,7 +8453,7 @@
8382
8453
  {
8383
8454
  "id": "components/button/demo/color.tsx",
8384
8455
  "title": "多彩",
8385
- "source": "import { Button, Space } from \"react-kui\";\nconst colors = [\n \"default\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n];\nexport default function App() {\n return (\n <Space size=\"small\" wrap>\n {([\"solid\", \"outline\", \"dashed\"] as const).map((theme) => (\n <Space size=\"small\" wrap key={theme}>\n {colors.map((color) => (\n <Button color={color} key={color} theme={theme}>\n {theme}\n </Button>\n ))}\n </Space>\n ))}\n </Space>\n );\n}"
8456
+ "source": "import { Button, Space } from \"react-kui\";\nconst colors = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n \"gray\",\n];\nexport default function App() {\n return (\n <Space size=\"small\" wrap>\n {([undefined, \"solid\", \"fill\", \"outline\", \"dashed\"] as const).map((theme) => (\n <Space size=\"small\" wrap key={theme ?? \"no-theme\"}>\n {colors.map((color) => (\n <Button color={color} key={color} theme={theme}>\n {theme ?? \"no theme\"}\n </Button>\n ))}\n </Space>\n ))}\n </Space>\n );\n}"
8386
8457
  },
8387
8458
  {
8388
8459
  "id": "components/button/demo/with-icon.tsx",
@@ -8840,7 +8911,7 @@
8840
8911
  {
8841
8912
  "id": "components/button/demo/color.tsx",
8842
8913
  "title": "多彩",
8843
- "source": "import { Button, Space } from \"react-kui\";\nconst colors = [\n \"default\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n];\nexport default function App() {\n return (\n <Space size=\"small\" wrap>\n {([\"solid\", \"outline\", \"dashed\"] as const).map((theme) => (\n <Space size=\"small\" wrap key={theme}>\n {colors.map((color) => (\n <Button color={color} key={color} theme={theme}>\n {theme}\n </Button>\n ))}\n </Space>\n ))}\n </Space>\n );\n}"
8914
+ "source": "import { Button, Space } from \"react-kui\";\nconst colors = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n \"gray\",\n];\nexport default function App() {\n return (\n <Space size=\"small\" wrap>\n {([undefined, \"solid\", \"fill\", \"outline\", \"dashed\"] as const).map((theme) => (\n <Space size=\"small\" wrap key={theme ?? \"no-theme\"}>\n {colors.map((color) => (\n <Button color={color} key={color} theme={theme}>\n {theme ?? \"no theme\"}\n </Button>\n ))}\n </Space>\n ))}\n </Space>\n );\n}"
8844
8915
  },
8845
8916
  {
8846
8917
  "id": "components/button/demo/with-icon.tsx",
@@ -8894,30 +8965,27 @@
8894
8965
  },
8895
8966
  {
8896
8967
  "name": "theme",
8897
- "type": "ThemeType | undefined",
8968
+ "type": "SurfaceThemeType | undefined",
8898
8969
  "required": false,
8899
8970
  "enumValues": [
8900
8971
  "dashed",
8901
8972
  "solid",
8902
- "default",
8903
8973
  "fill",
8904
8974
  "outline",
8905
- "plain",
8906
- "underlined"
8975
+ "plain"
8907
8976
  ],
8908
8977
  "boolean": false,
8978
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
8909
8979
  "descriptionZh": "外观主题",
8910
8980
  "descriptionEn": "Surface theme"
8911
8981
  },
8912
8982
  {
8913
8983
  "name": "shape",
8914
- "type": "ShapeType | undefined",
8984
+ "type": "SurfaceShapeType | undefined",
8915
8985
  "required": false,
8916
8986
  "enumValues": [
8917
8987
  "round",
8918
- "default",
8919
- "square",
8920
- "circle"
8988
+ "square"
8921
8989
  ],
8922
8990
  "boolean": false,
8923
8991
  "descriptionZh": "外框形状",
@@ -8933,6 +9001,7 @@
8933
9001
  "large"
8934
9002
  ],
8935
9003
  "boolean": false,
9004
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
8936
9005
  "descriptionZh": "卡片尺寸",
8937
9006
  "descriptionEn": "Card size"
8938
9007
  },
@@ -9376,7 +9445,7 @@
9376
9445
  {
9377
9446
  "id": "components/card/demo/appearance.tsx",
9378
9447
  "title": "外观与形状",
9379
- "source": "import type { ShapeType, ThemeType } from \"react-kui\";\nimport { Card, Space } from \"react-kui\";\n\nconst shapes: ShapeType[] = [\"round\", \"square\", \"circle\"];\nconst themes: ThemeType[] = [\"default\", \"fill\", \"outline\", \"plain\"];\n\nexport default function Demo() {\n return (\n <Space vertical block>\n <Space>\n {shapes.map((shape) => (\n <Card key={shape} shape={shape} style={{ width: 180 }}>\n shape: {shape}\n </Card>\n ))}\n </Space>\n <Space>\n {themes.map((theme) => (\n <Card key={theme} theme={theme} shape=\"square\" style={{ width: 180 }}>\n theme: {theme}\n </Card>\n ))}\n </Space>\n </Space>\n );\n}"
9448
+ "source": "import type { SurfaceShapeType, SurfaceThemeType } from \"react-kui\";\nimport { Card, Space } from \"react-kui\";\n\nconst shapes: SurfaceShapeType[] = [\"round\", \"square\"];\nconst themes: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function Demo() {\n return (\n <Space vertical block>\n <Space>\n {shapes.map((shape) => (\n <Card key={shape} shape={shape} style={{ width: 180 }}>\n shape: {shape}\n </Card>\n ))}\n </Space>\n <Space>\n {themes.map((theme) => (\n <Card key={theme} theme={theme} shape=\"square\" style={{ width: 180 }}>\n theme: {theme}\n </Card>\n ))}\n </Space>\n </Space>\n );\n}"
9380
9449
  }
9381
9450
  ]
9382
9451
  },
@@ -9809,7 +9878,7 @@
9809
9878
  {
9810
9879
  "id": "components/card/demo/appearance.tsx",
9811
9880
  "title": "外观与形状",
9812
- "source": "import type { ShapeType, ThemeType } from \"react-kui\";\nimport { Card, Space } from \"react-kui\";\n\nconst shapes: ShapeType[] = [\"round\", \"square\", \"circle\"];\nconst themes: ThemeType[] = [\"default\", \"fill\", \"outline\", \"plain\"];\n\nexport default function Demo() {\n return (\n <Space vertical block>\n <Space>\n {shapes.map((shape) => (\n <Card key={shape} shape={shape} style={{ width: 180 }}>\n shape: {shape}\n </Card>\n ))}\n </Space>\n <Space>\n {themes.map((theme) => (\n <Card key={theme} theme={theme} shape=\"square\" style={{ width: 180 }}>\n theme: {theme}\n </Card>\n ))}\n </Space>\n </Space>\n );\n}"
9881
+ "source": "import type { SurfaceShapeType, SurfaceThemeType } from \"react-kui\";\nimport { Card, Space } from \"react-kui\";\n\nconst shapes: SurfaceShapeType[] = [\"round\", \"square\"];\nconst themes: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function Demo() {\n return (\n <Space vertical block>\n <Space>\n {shapes.map((shape) => (\n <Card key={shape} shape={shape} style={{ width: 180 }}>\n shape: {shape}\n </Card>\n ))}\n </Space>\n <Space>\n {themes.map((theme) => (\n <Card key={theme} theme={theme} shape=\"square\" style={{ width: 180 }}>\n theme: {theme}\n </Card>\n ))}\n </Space>\n </Space>\n );\n}"
9813
9882
  }
9814
9883
  ]
9815
9884
  },
@@ -10731,6 +10800,7 @@
10731
10800
  "boolean"
10732
10801
  ],
10733
10802
  "boolean": false,
10803
+ "defaultExpression": "\"boolean\"",
10734
10804
  "descriptionZh": "独立使用时的输出值类型",
10735
10805
  "descriptionEn": "Standalone output value type"
10736
10806
  },
@@ -10752,18 +10822,14 @@
10752
10822
  },
10753
10823
  {
10754
10824
  "name": "theme",
10755
- "type": "ThemeType | undefined",
10825
+ "type": "MarkThemeType | undefined",
10756
10826
  "required": false,
10757
10827
  "enumValues": [
10758
- "dashed",
10759
- "solid",
10760
- "default",
10761
10828
  "fill",
10762
- "outline",
10763
- "plain",
10764
- "underlined"
10829
+ "outline"
10765
10830
  ],
10766
10831
  "boolean": false,
10832
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? group?.theme ?? inheritedAppearance.theme, PAINTED_THEMES) ??\n \"fill\"",
10767
10833
  "descriptionZh": "组件呈现主题",
10768
10834
  "descriptionEn": "Component theme"
10769
10835
  },
@@ -10776,6 +10842,7 @@
10776
10842
  true
10777
10843
  ],
10778
10844
  "boolean": true,
10845
+ "defaultExpression": "false",
10779
10846
  "descriptionZh": "是否禁用当前项",
10780
10847
  "descriptionEn": "Whether the current item is disabled"
10781
10848
  },
@@ -10788,6 +10855,7 @@
10788
10855
  true
10789
10856
  ],
10790
10857
  "boolean": true,
10858
+ "defaultExpression": "false",
10791
10859
  "descriptionZh": "是否只读当前项",
10792
10860
  "descriptionEn": "Whether the current item is read-only"
10793
10861
  },
@@ -10800,6 +10868,7 @@
10800
10868
  true
10801
10869
  ],
10802
10870
  "boolean": true,
10871
+ "defaultExpression": "false",
10803
10872
  "descriptionZh": "组合辅助选项控制半选状态",
10804
10873
  "descriptionEn": "Combined auxiliary option controls the indeterminate state"
10805
10874
  },
@@ -11239,6 +11308,11 @@
11239
11308
  "id": "components/checkbox/demo/check-all.tsx",
11240
11309
  "title": "全选",
11241
11310
  "source": "import { useState } from \"react\";\nimport { Space, Checkbox, CheckboxGroup } from \"react-kui\";\nconst options = [\"Beijing\", \"Shenzhen\", \"Shanghai\", \"Guangzhou\", \"Wuhan\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\nexport default function App() {\n const [cities, setCities] = useState<string[]>([]);\n const checked = cities.length === options.length,\n indeterminate = cities.length > 0 && !checked;\n return (\n <Space vertical>\n <code>value: {cities.join(\", \")}</code>\n <Checkbox\n checked={checked}\n indeterminate={indeterminate}\n onChange={({ checked }) => setCities(checked ? options.map(({ value }) => value) : [])}\n >\n Check all\n </Checkbox>\n <CheckboxGroup options={options} value={cities} onChange={setCities} />\n </Space>\n );\n}"
11311
+ },
11312
+ {
11313
+ "id": "components/checkbox/demo/theme.tsx",
11314
+ "title": "外观档位",
11315
+ "source": "import { useState } from \"react\";\nimport { Checkbox, CheckboxGroup, Space, type CheckboxOption, type MarkThemeType } from \"react-kui\";\n\n// A check box paints two tiers, and both land on the square rather than on the label: `fill` — what it does\n// when nobody writes a theme — gives the box a pale plate, `outline` puts a border on it instead. Whatever the\n// tier, a checked box is still primary and a disabled one still reads as disabled, and a group hands its own\n// tier to every item that did not write one.\nconst tiers: MarkThemeType[] = [\"fill\", \"outline\"];\nconst options: CheckboxOption[] = [\"Apple\", \"Orange\", \"Banana\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\n\nexport default function App() {\n const [grouped, setGrouped] = useState<(string | number)[]>([\"apple\", \"banana\"]);\n const [single, setSingle] = useState(true);\n return (\n <Space vertical block>\n {tiers.map((tier) => (\n <Space key={tier} vertical>\n <code>theme: {tier}</code>\n <CheckboxGroup options={options} value={grouped} onChange={setGrouped} theme={tier} />\n <Space>\n <Checkbox\n label=\"Checked\"\n checked={single}\n onChange={({ checked }) => setSingle(checked)}\n theme={tier}\n />\n <Checkbox label=\"Disabled\" disabled theme={tier} />\n </Space>\n </Space>\n ))}\n </Space>\n );\n}"
11242
11316
  }
11243
11317
  ]
11244
11318
  },
@@ -11257,18 +11331,14 @@
11257
11331
  },
11258
11332
  {
11259
11333
  "name": "theme",
11260
- "type": "ThemeType | undefined",
11334
+ "type": "MarkThemeType | undefined",
11261
11335
  "required": false,
11262
11336
  "enumValues": [
11263
- "dashed",
11264
- "solid",
11265
- "default",
11266
11337
  "fill",
11267
- "outline",
11268
- "plain",
11269
- "underlined"
11338
+ "outline"
11270
11339
  ],
11271
11340
  "boolean": false,
11341
+ "defaultExpression": "themeProp ?? inheritedAppearance.theme ?? \"fill\"",
11272
11342
  "descriptionZh": "组件呈现主题",
11273
11343
  "descriptionEn": "Component theme"
11274
11344
  },
@@ -11281,6 +11351,7 @@
11281
11351
  true
11282
11352
  ],
11283
11353
  "boolean": true,
11354
+ "defaultExpression": "false",
11284
11355
  "descriptionZh": "是否禁用组件",
11285
11356
  "descriptionEn": "Whether the component is disabled"
11286
11357
  },
@@ -11293,6 +11364,7 @@
11293
11364
  true
11294
11365
  ],
11295
11366
  "boolean": true,
11367
+ "defaultExpression": "false",
11296
11368
  "descriptionZh": "是否只读组件",
11297
11369
  "descriptionEn": "Whether the component is read-only"
11298
11370
  },
@@ -11314,6 +11386,7 @@
11314
11386
  "vertical"
11315
11387
  ],
11316
11388
  "boolean": false,
11389
+ "defaultExpression": "\"horizontal\"",
11317
11390
  "descriptionZh": "布局方向",
11318
11391
  "descriptionEn": "Layout direction"
11319
11392
  },
@@ -11751,6 +11824,11 @@
11751
11824
  "id": "components/checkbox/demo/check-all.tsx",
11752
11825
  "title": "全选",
11753
11826
  "source": "import { useState } from \"react\";\nimport { Space, Checkbox, CheckboxGroup } from \"react-kui\";\nconst options = [\"Beijing\", \"Shenzhen\", \"Shanghai\", \"Guangzhou\", \"Wuhan\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\nexport default function App() {\n const [cities, setCities] = useState<string[]>([]);\n const checked = cities.length === options.length,\n indeterminate = cities.length > 0 && !checked;\n return (\n <Space vertical>\n <code>value: {cities.join(\", \")}</code>\n <Checkbox\n checked={checked}\n indeterminate={indeterminate}\n onChange={({ checked }) => setCities(checked ? options.map(({ value }) => value) : [])}\n >\n Check all\n </Checkbox>\n <CheckboxGroup options={options} value={cities} onChange={setCities} />\n </Space>\n );\n}"
11827
+ },
11828
+ {
11829
+ "id": "components/checkbox/demo/theme.tsx",
11830
+ "title": "外观档位",
11831
+ "source": "import { useState } from \"react\";\nimport { Checkbox, CheckboxGroup, Space, type CheckboxOption, type MarkThemeType } from \"react-kui\";\n\n// A check box paints two tiers, and both land on the square rather than on the label: `fill` — what it does\n// when nobody writes a theme — gives the box a pale plate, `outline` puts a border on it instead. Whatever the\n// tier, a checked box is still primary and a disabled one still reads as disabled, and a group hands its own\n// tier to every item that did not write one.\nconst tiers: MarkThemeType[] = [\"fill\", \"outline\"];\nconst options: CheckboxOption[] = [\"Apple\", \"Orange\", \"Banana\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\n\nexport default function App() {\n const [grouped, setGrouped] = useState<(string | number)[]>([\"apple\", \"banana\"]);\n const [single, setSingle] = useState(true);\n return (\n <Space vertical block>\n {tiers.map((tier) => (\n <Space key={tier} vertical>\n <code>theme: {tier}</code>\n <CheckboxGroup options={options} value={grouped} onChange={setGrouped} theme={tier} />\n <Space>\n <Checkbox\n label=\"Checked\"\n checked={single}\n onChange={({ checked }) => setSingle(checked)}\n theme={tier}\n />\n <Checkbox label=\"Disabled\" disabled theme={tier} />\n </Space>\n </Space>\n ))}\n </Space>\n );\n}"
11754
11832
  }
11755
11833
  ]
11756
11834
  },
@@ -11820,6 +11898,7 @@
11820
11898
  true
11821
11899
  ],
11822
11900
  "boolean": true,
11901
+ "defaultExpression": "true",
11823
11902
  "descriptionZh": "是否显示选中标记",
11824
11903
  "descriptionEn": "Whether to show the indicator"
11825
11904
  },
@@ -11832,6 +11911,7 @@
11832
11911
  true
11833
11912
  ],
11834
11913
  "boolean": true,
11914
+ "defaultExpression": "false",
11835
11915
  "descriptionZh": "是否禁用",
11836
11916
  "descriptionEn": "Whether disabled"
11837
11917
  },
@@ -11844,20 +11924,25 @@
11844
11924
  true
11845
11925
  ],
11846
11926
  "boolean": true,
11927
+ "defaultExpression": "false",
11847
11928
  "descriptionZh": "是否只读",
11848
11929
  "descriptionEn": "Whether read-only"
11849
11930
  },
11850
11931
  {
11851
11932
  "name": "theme",
11852
- "type": "CheckCardTheme | undefined",
11933
+ "type": "SurfaceThemeType | undefined",
11853
11934
  "required": false,
11854
11935
  "enumValues": [
11936
+ "dashed",
11937
+ "solid",
11855
11938
  "fill",
11856
- "outline"
11939
+ "outline",
11940
+ "plain"
11857
11941
  ],
11858
11942
  "boolean": false,
11859
- "descriptionZh": "主题",
11860
- "descriptionEn": "Theme"
11943
+ "defaultExpression": "resolvePaintedTheme(\n themeProp ?? group?.theme ?? inheritedAppearance.theme,\n PAINTED_THEMES,\n ) ?? \"outline\"",
11944
+ "descriptionZh": "外观主题",
11945
+ "descriptionEn": "Appearance theme"
11861
11946
  },
11862
11947
  {
11863
11948
  "name": "size",
@@ -11869,6 +11954,7 @@
11869
11954
  "large"
11870
11955
  ],
11871
11956
  "boolean": false,
11957
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
11872
11958
  "descriptionZh": "尺寸",
11873
11959
  "descriptionEn": "Size"
11874
11960
  },
@@ -11883,6 +11969,7 @@
11883
11969
  "circle"
11884
11970
  ],
11885
11971
  "boolean": false,
11972
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
11886
11973
  "descriptionZh": "形状",
11887
11974
  "descriptionEn": "Shape"
11888
11975
  },
@@ -12301,7 +12388,7 @@
12301
12388
  {
12302
12389
  "id": "components/check-card/demo/appearance.tsx",
12303
12390
  "title": "外观与禁用",
12304
- "source": "import { useState } from \"react\";\nimport { CheckCardGroup } from \"react-kui\";\n\nconst items = [\n { value: \"basic\", title: \"Basic\", description: \"Essential features\" },\n { value: \"pro\", title: \"Pro\", description: \"Advanced capabilities\" },\n];\n\nexport default function App() {\n const [outline, setOutline] = useState(\"basic\");\n const [fill, setFill] = useState(\"pro\");\n const [disabled, setDisabled] = useState(\"basic\");\n return (\n <div style={{ display: \"grid\", gap: 24 }}>\n <CheckCardGroup\n value={outline}\n onChange={(next) => setOutline(String(next))}\n theme=\"outline\"\n shape=\"square\"\n size=\"small\"\n options={items}\n />\n <CheckCardGroup\n value={fill}\n onChange={(next) => setFill(String(next))}\n theme=\"fill\"\n shape=\"circle\"\n size=\"large\"\n options={items}\n />\n <CheckCardGroup\n value={disabled}\n onChange={(next) => setDisabled(String(next))}\n disabled\n options={items}\n />\n </div>\n );\n}"
12391
+ "source": "import { useState } from \"react\";\nimport { CheckCardGroup, type CheckCardValue, type SurfaceThemeType } from \"react-kui\";\n\n// A check card paints all five surface tiers, and its own default is `outline` rather than the `fill` the\n// other cards start on — so the row is listed from `outline` and the tiers are shown side by side instead of\n// behind a switch. The last row is the disabled state: the tier still decides the shape of the box, but the\n// plate and the check mark both step back.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\nconst items = [\n { value: \"basic\", title: \"Basic\", description: \"Essential features\" },\n { value: \"pro\", title: \"Pro\", description: \"Advanced capabilities\" },\n];\n\nexport default function App() {\n const [selected, setSelected] = useState<Record<string, CheckCardValue>>(\n Object.fromEntries(tiers.map((tier) => [tier, \"basic\"])),\n );\n const [disabled, setDisabled] = useState<CheckCardValue>(\"basic\");\n\n return (\n <div style={{ display: \"grid\", gap: 24 }}>\n {tiers.map((tier) => (\n <CheckCardGroup\n key={tier}\n value={selected[tier]}\n onChange={(next) => setSelected((prev) => ({ ...prev, [tier]: next }))}\n theme={tier}\n shape=\"square\"\n size=\"small\"\n options={items}\n />\n ))}\n <CheckCardGroup\n value={disabled}\n onChange={(next) => setDisabled(next)}\n theme=\"solid\"\n shape=\"square\"\n size=\"small\"\n options={items}\n disabled\n />\n </div>\n );\n}"
12305
12392
  }
12306
12393
  ]
12307
12394
  },
@@ -12335,6 +12422,7 @@
12335
12422
  true
12336
12423
  ],
12337
12424
  "boolean": true,
12425
+ "defaultExpression": "false",
12338
12426
  "descriptionZh": "是否禁用该选项",
12339
12427
  "descriptionEn": "Whether this option is disabled"
12340
12428
  },
@@ -12347,6 +12435,7 @@
12347
12435
  true
12348
12436
  ],
12349
12437
  "boolean": true,
12438
+ "defaultExpression": "false",
12350
12439
  "descriptionZh": "是否只读该选项",
12351
12440
  "descriptionEn": "Whether this option is read-only"
12352
12441
  },
@@ -12359,18 +12448,23 @@
12359
12448
  "vertical"
12360
12449
  ],
12361
12450
  "boolean": false,
12451
+ "defaultExpression": "\"horizontal\"",
12362
12452
  "descriptionZh": "排列方向",
12363
12453
  "descriptionEn": "Layout direction"
12364
12454
  },
12365
12455
  {
12366
12456
  "name": "theme",
12367
- "type": "CheckCardTheme | undefined",
12457
+ "type": "SurfaceThemeType | undefined",
12368
12458
  "required": false,
12369
12459
  "enumValues": [
12460
+ "dashed",
12461
+ "solid",
12370
12462
  "fill",
12371
- "outline"
12463
+ "outline",
12464
+ "plain"
12372
12465
  ],
12373
12466
  "boolean": false,
12467
+ "defaultExpression": "themeProp ?? inheritedAppearance.theme ?? \"outline\"",
12374
12468
  "descriptionZh": "卡片主题",
12375
12469
  "descriptionEn": "Card theme"
12376
12470
  },
@@ -12384,6 +12478,7 @@
12384
12478
  "large"
12385
12479
  ],
12386
12480
  "boolean": false,
12481
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
12387
12482
  "descriptionZh": "卡片尺寸",
12388
12483
  "descriptionEn": "Card size"
12389
12484
  },
@@ -12398,6 +12493,7 @@
12398
12493
  "circle"
12399
12494
  ],
12400
12495
  "boolean": false,
12496
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
12401
12497
  "descriptionZh": "卡片形状",
12402
12498
  "descriptionEn": "Card shape"
12403
12499
  },
@@ -12816,7 +12912,7 @@
12816
12912
  {
12817
12913
  "id": "components/check-card/demo/appearance.tsx",
12818
12914
  "title": "外观与禁用",
12819
- "source": "import { useState } from \"react\";\nimport { CheckCardGroup } from \"react-kui\";\n\nconst items = [\n { value: \"basic\", title: \"Basic\", description: \"Essential features\" },\n { value: \"pro\", title: \"Pro\", description: \"Advanced capabilities\" },\n];\n\nexport default function App() {\n const [outline, setOutline] = useState(\"basic\");\n const [fill, setFill] = useState(\"pro\");\n const [disabled, setDisabled] = useState(\"basic\");\n return (\n <div style={{ display: \"grid\", gap: 24 }}>\n <CheckCardGroup\n value={outline}\n onChange={(next) => setOutline(String(next))}\n theme=\"outline\"\n shape=\"square\"\n size=\"small\"\n options={items}\n />\n <CheckCardGroup\n value={fill}\n onChange={(next) => setFill(String(next))}\n theme=\"fill\"\n shape=\"circle\"\n size=\"large\"\n options={items}\n />\n <CheckCardGroup\n value={disabled}\n onChange={(next) => setDisabled(String(next))}\n disabled\n options={items}\n />\n </div>\n );\n}"
12915
+ "source": "import { useState } from \"react\";\nimport { CheckCardGroup, type CheckCardValue, type SurfaceThemeType } from \"react-kui\";\n\n// A check card paints all five surface tiers, and its own default is `outline` rather than the `fill` the\n// other cards start on — so the row is listed from `outline` and the tiers are shown side by side instead of\n// behind a switch. The last row is the disabled state: the tier still decides the shape of the box, but the\n// plate and the check mark both step back.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\nconst items = [\n { value: \"basic\", title: \"Basic\", description: \"Essential features\" },\n { value: \"pro\", title: \"Pro\", description: \"Advanced capabilities\" },\n];\n\nexport default function App() {\n const [selected, setSelected] = useState<Record<string, CheckCardValue>>(\n Object.fromEntries(tiers.map((tier) => [tier, \"basic\"])),\n );\n const [disabled, setDisabled] = useState<CheckCardValue>(\"basic\");\n\n return (\n <div style={{ display: \"grid\", gap: 24 }}>\n {tiers.map((tier) => (\n <CheckCardGroup\n key={tier}\n value={selected[tier]}\n onChange={(next) => setSelected((prev) => ({ ...prev, [tier]: next }))}\n theme={tier}\n shape=\"square\"\n size=\"small\"\n options={items}\n />\n ))}\n <CheckCardGroup\n value={disabled}\n onChange={(next) => setDisabled(next)}\n theme=\"solid\"\n shape=\"square\"\n size=\"small\"\n options={items}\n disabled\n />\n </div>\n );\n}"
12820
12916
  }
12821
12917
  ]
12822
12918
  },
@@ -12861,30 +12957,27 @@
12861
12957
  },
12862
12958
  {
12863
12959
  "name": "theme",
12864
- "type": "ThemeType | undefined",
12960
+ "type": "SurfaceThemeType | undefined",
12865
12961
  "required": false,
12866
12962
  "enumValues": [
12867
12963
  "dashed",
12868
12964
  "solid",
12869
- "default",
12870
12965
  "fill",
12871
12966
  "outline",
12872
- "plain",
12873
- "underlined"
12967
+ "plain"
12874
12968
  ],
12875
12969
  "boolean": false,
12876
- "descriptionZh": "主题",
12877
- "descriptionEn": "Theme"
12970
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"outline\"",
12971
+ "descriptionZh": "外观主题",
12972
+ "descriptionEn": "Appearance theme"
12878
12973
  },
12879
12974
  {
12880
12975
  "name": "shape",
12881
- "type": "ShapeType | undefined",
12976
+ "type": "SurfaceShapeType | undefined",
12882
12977
  "required": false,
12883
12978
  "enumValues": [
12884
12979
  "round",
12885
- "default",
12886
- "square",
12887
- "circle"
12980
+ "square"
12888
12981
  ],
12889
12982
  "boolean": false,
12890
12983
  "descriptionZh": "形状",
@@ -13327,6 +13420,11 @@
13327
13420
  "id": "components/collapse/demo/sample.tsx",
13328
13421
  "title": "简洁模式",
13329
13422
  "source": "import { CollapseDemo } from \"./content\";\nexport default function App() {\n return <CollapseDemo sample />;\n}"
13423
+ },
13424
+ {
13425
+ "id": "components/collapse/demo/appearance.tsx",
13426
+ "title": "外观",
13427
+ "source": "import { Collapse, CollapsePanel, type SurfaceThemeType } from \"react-kui\";\n\n// A collapse paints all five tiers and starts on `outline` rather than the `fill` the cards start on. The tier\n// lands on the panel heads: `solid` plates the head on the primary and flips its title, `dashed` puts the head\n// row behind a dashed edge, and `plain` leaves the rows with no box at all. Only the first panel of each group\n// is opened, so the head — the part that changes — is what the row reads as.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\nconst text = \"面板内容跟着面板自己的外观走,档位只决定它露出多少。\";\n\nexport default function App() {\n return (\n <div style={{ display: \"grid\", gap: 16 }}>\n {tiers.map((tier) => (\n <Collapse key={tier} theme={tier} openKeys={[1]}>\n <CollapsePanel key={1} title={`theme: ${tier}`}>\n <div>{text}</div>\n </CollapsePanel>\n <CollapsePanel key={2} title=\"第二段\">\n <div>{text}</div>\n </CollapsePanel>\n </Collapse>\n ))}\n </div>\n );\n}"
13330
13428
  }
13331
13429
  ]
13332
13430
  },
@@ -13806,6 +13904,11 @@
13806
13904
  "id": "components/collapse/demo/sample.tsx",
13807
13905
  "title": "简洁模式",
13808
13906
  "source": "import { CollapseDemo } from \"./content\";\nexport default function App() {\n return <CollapseDemo sample />;\n}"
13907
+ },
13908
+ {
13909
+ "id": "components/collapse/demo/appearance.tsx",
13910
+ "title": "外观",
13911
+ "source": "import { Collapse, CollapsePanel, type SurfaceThemeType } from \"react-kui\";\n\n// A collapse paints all five tiers and starts on `outline` rather than the `fill` the cards start on. The tier\n// lands on the panel heads: `solid` plates the head on the primary and flips its title, `dashed` puts the head\n// row behind a dashed edge, and `plain` leaves the rows with no box at all. Only the first panel of each group\n// is opened, so the head — the part that changes — is what the row reads as.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\nconst text = \"面板内容跟着面板自己的外观走,档位只决定它露出多少。\";\n\nexport default function App() {\n return (\n <div style={{ display: \"grid\", gap: 16 }}>\n {tiers.map((tier) => (\n <Collapse key={tier} theme={tier} openKeys={[1]}>\n <CollapsePanel key={1} title={`theme: ${tier}`}>\n <div>{text}</div>\n </CollapsePanel>\n <CollapsePanel key={2} title=\"第二段\">\n <div>{text}</div>\n </CollapsePanel>\n </Collapse>\n ))}\n </div>\n );\n}"
13809
13912
  }
13810
13913
  ]
13811
13914
  },
@@ -13843,6 +13946,7 @@
13843
13946
  true
13844
13947
  ],
13845
13948
  "boolean": true,
13949
+ "defaultExpression": "false",
13846
13950
  "descriptionZh": "是否禁用",
13847
13951
  "descriptionEn": "Whether the picker is disabled"
13848
13952
  },
@@ -13855,6 +13959,7 @@
13855
13959
  true
13856
13960
  ],
13857
13961
  "boolean": true,
13962
+ "defaultExpression": "false",
13858
13963
  "descriptionZh": "是否只读",
13859
13964
  "descriptionEn": "Whether the picker is read-only"
13860
13965
  },
@@ -13867,6 +13972,7 @@
13867
13972
  true
13868
13973
  ],
13869
13974
  "boolean": true,
13975
+ "defaultExpression": "false",
13870
13976
  "descriptionZh": "是否禁用透明度",
13871
13977
  "descriptionEn": "Whether alpha editing is disabled"
13872
13978
  },
@@ -13879,6 +13985,7 @@
13879
13985
  true
13880
13986
  ],
13881
13987
  "boolean": true,
13988
+ "defaultExpression": "false",
13882
13989
  "descriptionZh": "是否展示颜色文字",
13883
13990
  "descriptionEn": "Whether to display the color text"
13884
13991
  },
@@ -13895,9 +14002,23 @@
13895
14002
  "bottom-right"
13896
14003
  ],
13897
14004
  "boolean": false,
14005
+ "defaultExpression": "\"bottom-left\"",
13898
14006
  "descriptionZh": "弹层位置",
13899
14007
  "descriptionEn": "Popup placement"
13900
14008
  },
14009
+ {
14010
+ "name": "destroyOnClose",
14011
+ "type": "boolean | undefined",
14012
+ "required": false,
14013
+ "enumValues": [
14014
+ false,
14015
+ true
14016
+ ],
14017
+ "boolean": true,
14018
+ "defaultExpression": "true",
14019
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
14020
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
14021
+ },
13901
14022
  {
13902
14023
  "name": "trigger",
13903
14024
  "type": "\"hover\" | \"click\" | undefined",
@@ -13907,6 +14028,7 @@
13907
14028
  "click"
13908
14029
  ],
13909
14030
  "boolean": false,
14031
+ "defaultExpression": "\"click\"",
13910
14032
  "descriptionZh": "弹层触发方式",
13911
14033
  "descriptionEn": "Popup trigger mode"
13912
14034
  },
@@ -13930,15 +14052,14 @@
13930
14052
  "enumValues": [
13931
14053
  "dashed",
13932
14054
  "solid",
13933
- "default",
13934
14055
  "fill",
13935
14056
  "outline",
13936
14057
  "plain",
13937
14058
  "underlined"
13938
14059
  ],
13939
14060
  "boolean": false,
13940
- "descriptionZh": "外观主题,支持 `outline`、`fill`、`plain`,未设置时可继承 Form 或 ConfigProvider",
13941
- "descriptionEn": "Appearance theme: `outline`, `fill`, or `plain`; inherits from Form or ConfigProvider"
14061
+ "descriptionZh": "主题,未设置时可继承 Form 或 ConfigProvider",
14062
+ "descriptionEn": "Theme; inherits from Form or ConfigProvider when unset"
13942
14063
  },
13943
14064
  {
13944
14065
  "name": "shape",
@@ -14016,6 +14137,7 @@
14016
14137
  true
14017
14138
  ],
14018
14139
  "boolean": true,
14140
+ "defaultExpression": "false",
14019
14141
  "descriptionZh": "只渲染颜色面板,不包含触发元素与弹层",
14020
14142
  "descriptionEn": "Render only the color panel, without a trigger or portal"
14021
14143
  }
@@ -14494,6 +14616,18 @@
14494
14616
  "descriptionZh": "弹层触发方式",
14495
14617
  "descriptionEn": "Popup trigger mode"
14496
14618
  },
14619
+ {
14620
+ "name": "destroyOnClose",
14621
+ "type": "boolean | undefined",
14622
+ "required": false,
14623
+ "enumValues": [
14624
+ false,
14625
+ true
14626
+ ],
14627
+ "boolean": true,
14628
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
14629
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
14630
+ },
14497
14631
  {
14498
14632
  "name": "onOpenChange",
14499
14633
  "type": "((open: boolean) => void) | undefined",
@@ -14542,15 +14676,14 @@
14542
14676
  "enumValues": [
14543
14677
  "dashed",
14544
14678
  "solid",
14545
- "default",
14546
14679
  "fill",
14547
14680
  "outline",
14548
14681
  "plain",
14549
14682
  "underlined"
14550
14683
  ],
14551
14684
  "boolean": false,
14552
- "descriptionZh": "外观主题,支持 `outline`、`fill`、`plain`,未设置时可继承 Form 或 ConfigProvider",
14553
- "descriptionEn": "Appearance theme: `outline`, `fill`, or `plain`; inherits from Form or ConfigProvider"
14685
+ "descriptionZh": "主题,未设置时可继承 Form 或 ConfigProvider",
14686
+ "descriptionEn": "Theme; inherits from Form or ConfigProvider when unset"
14554
14687
  },
14555
14688
  {
14556
14689
  "name": "shape",
@@ -15079,6 +15212,7 @@
15079
15212
  "unix"
15080
15213
  ],
15081
15214
  "boolean": false,
15215
+ "defaultExpression": "\"string\"",
15082
15216
  "descriptionZh": "输出值类型",
15083
15217
  "descriptionEn": "Output value type"
15084
15218
  },
@@ -15096,6 +15230,7 @@
15096
15230
  "dateTimeRange"
15097
15231
  ],
15098
15232
  "boolean": false,
15233
+ "defaultExpression": "\"date\"",
15099
15234
  "descriptionZh": "日期选择模式",
15100
15235
  "descriptionEn": "Date picker mode"
15101
15236
  },
@@ -15152,6 +15287,7 @@
15152
15287
  true
15153
15288
  ],
15154
15289
  "boolean": true,
15290
+ "defaultExpression": "true",
15155
15291
  "descriptionZh": "是否显示清除图标",
15156
15292
  "descriptionEn": "Whether to show the clear icon"
15157
15293
  },
@@ -15164,6 +15300,7 @@
15164
15300
  true
15165
15301
  ],
15166
15302
  "boolean": true,
15303
+ "defaultExpression": "true",
15167
15304
  "descriptionZh": "是否可编辑",
15168
15305
  "descriptionEn": "Whether it is editable"
15169
15306
  },
@@ -15172,6 +15309,7 @@
15172
15309
  "type": "string | string[] | undefined",
15173
15310
  "required": false,
15174
15311
  "boolean": false,
15312
+ "defaultExpression": "\"\"",
15175
15313
  "descriptionZh": "提示语",
15176
15314
  "descriptionEn": "Placeholder text"
15177
15315
  },
@@ -15180,14 +15318,15 @@
15180
15318
  "type": "string | undefined",
15181
15319
  "required": false,
15182
15320
  "boolean": false,
15183
- "descriptionZh": "设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [dayjs](http://day.js.org/)",
15184
- "descriptionEn": "Set the date format. When an array, supports multiple format matches, displayed according to the first one. Configuration reference http://day.js.org/"
15321
+ "descriptionZh": "设置日期格式,只接受单个格式(解析和展示都用它),不支持数组多格式匹配。配置参考 [dayjs](http://day.js.org/)",
15322
+ "descriptionEn": "Set the date format. A single format only: it drives both parsing and display, array format matching is not supported. Configuration reference http://day.js.org/"
15185
15323
  },
15186
15324
  {
15187
15325
  "name": "disabledDate",
15188
15326
  "type": "((date: Date) => boolean) | undefined",
15189
15327
  "required": false,
15190
15328
  "boolean": false,
15329
+ "defaultExpression": "() => false",
15191
15330
  "descriptionZh": "不可选择的日期",
15192
15331
  "descriptionEn": "Disabled dates"
15193
15332
  },
@@ -15196,6 +15335,7 @@
15196
15335
  "type": "((date: Date) => boolean) | undefined",
15197
15336
  "required": false,
15198
15337
  "boolean": false,
15338
+ "defaultExpression": "() => false",
15199
15339
  "descriptionZh": "不可选择的时间",
15200
15340
  "descriptionEn": "Disabled times"
15201
15341
  },
@@ -15217,6 +15357,7 @@
15217
15357
  "type": "IconType[] | undefined",
15218
15358
  "required": false,
15219
15359
  "boolean": false,
15360
+ "defaultExpression": "CalendarDays",
15220
15361
  "descriptionZh": "自定义图标",
15221
15362
  "descriptionEn": "Custom icon"
15222
15363
  },
@@ -15227,15 +15368,14 @@
15227
15368
  "enumValues": [
15228
15369
  "dashed",
15229
15370
  "solid",
15230
- "default",
15231
15371
  "fill",
15232
15372
  "outline",
15233
15373
  "plain",
15234
15374
  "underlined"
15235
15375
  ],
15236
15376
  "boolean": false,
15237
- "descriptionZh": "theme='fill' 时呈现浅色主题",
15238
- "descriptionEn": "When theme='fill', presents a fill theme"
15377
+ "descriptionZh": "主题",
15378
+ "descriptionEn": "Theme"
15239
15379
  },
15240
15380
  {
15241
15381
  "name": "shape",
@@ -15260,6 +15400,7 @@
15260
15400
  true
15261
15401
  ],
15262
15402
  "boolean": true,
15403
+ "defaultExpression": "true",
15263
15404
  "descriptionZh": "是否展示边框",
15264
15405
  "descriptionEn": "Whether to display the border"
15265
15406
  },
@@ -15276,9 +15417,23 @@
15276
15417
  "bottom-right"
15277
15418
  ],
15278
15419
  "boolean": false,
15420
+ "defaultExpression": "\"bottom-left\"",
15279
15421
  "descriptionZh": "下拉展示的方位",
15280
15422
  "descriptionEn": "Direction displayed when pulled down"
15281
15423
  },
15424
+ {
15425
+ "name": "destroyOnClose",
15426
+ "type": "boolean | undefined",
15427
+ "required": false,
15428
+ "enumValues": [
15429
+ false,
15430
+ true
15431
+ ],
15432
+ "boolean": true,
15433
+ "defaultExpression": "true",
15434
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
15435
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
15436
+ },
15282
15437
  {
15283
15438
  "name": "header",
15284
15439
  "type": "ReactNode | ((api: { emit: (value: DatePickerInput | DatePickerInput[]) => void; }) => ReactNode)",
@@ -15344,6 +15499,7 @@
15344
15499
  true
15345
15500
  ],
15346
15501
  "boolean": true,
15502
+ "defaultExpression": "false",
15347
15503
  "descriptionZh": "只渲染选择面板,不包含触发元素与弹层",
15348
15504
  "descriptionEn": "Render only the picker panel, without a trigger or portal"
15349
15505
  }
@@ -15852,6 +16008,18 @@
15852
16008
  "descriptionZh": "下拉展示的方位",
15853
16009
  "descriptionEn": "Direction displayed when pulled down"
15854
16010
  },
16011
+ {
16012
+ "name": "destroyOnClose",
16013
+ "type": "boolean | undefined",
16014
+ "required": false,
16015
+ "enumValues": [
16016
+ false,
16017
+ true
16018
+ ],
16019
+ "boolean": true,
16020
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
16021
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
16022
+ },
15855
16023
  {
15856
16024
  "name": "onOpenChange",
15857
16025
  "type": "((open: boolean) => void) | undefined",
@@ -15924,15 +16092,14 @@
15924
16092
  "enumValues": [
15925
16093
  "dashed",
15926
16094
  "solid",
15927
- "default",
15928
16095
  "fill",
15929
16096
  "outline",
15930
16097
  "plain",
15931
16098
  "underlined"
15932
16099
  ],
15933
16100
  "boolean": false,
15934
- "descriptionZh": "theme='fill' 时呈现浅色主题",
15935
- "descriptionEn": "When theme='fill', presents a fill theme"
16101
+ "descriptionZh": "主题",
16102
+ "descriptionEn": "Theme"
15936
16103
  },
15937
16104
  {
15938
16105
  "name": "shape",
@@ -16032,8 +16199,8 @@
16032
16199
  "type": "string | undefined",
16033
16200
  "required": false,
16034
16201
  "boolean": false,
16035
- "descriptionZh": "设置日期格式,为数组时支持多格式匹配,展示以第一个为准。配置参考 [dayjs](http://day.js.org/)",
16036
- "descriptionEn": "Set the date format. When an array, supports multiple format matches, displayed according to the first one. Configuration reference http://day.js.org/"
16202
+ "descriptionZh": "设置日期格式,只接受单个格式(解析和展示都用它),不支持数组多格式匹配。配置参考 [dayjs](http://day.js.org/)",
16203
+ "descriptionEn": "Set the date format. A single format only: it drives both parsing and display, array format matching is not supported. Configuration reference http://day.js.org/"
16037
16204
  },
16038
16205
  {
16039
16206
  "name": "disabledDate",
@@ -16628,13 +16795,11 @@
16628
16795
  },
16629
16796
  {
16630
16797
  "name": "shape",
16631
- "type": "ShapeType | undefined",
16798
+ "type": "SurfaceShapeType | undefined",
16632
16799
  "required": false,
16633
16800
  "enumValues": [
16634
16801
  "round",
16635
- "default",
16636
- "square",
16637
- "circle"
16802
+ "square"
16638
16803
  ],
16639
16804
  "boolean": false,
16640
16805
  "descriptionZh": "形状",
@@ -17147,9 +17312,8 @@
17147
17312
  "type": "React.ReactNode",
17148
17313
  "required": false,
17149
17314
  "boolean": false,
17150
- "defaultExpression": "\"Title\"",
17151
- "descriptionZh": "抽屉标题,为null或false时不显示标题",
17152
- "descriptionEn": "Drawer title. When null or false, the title is not displayed"
17315
+ "descriptionZh": "抽屉标题,不写就没有标题文本(不再有默认标题);标题栏仍留给右上角关闭按钮,`closable: false` 且没有标题才整条不收",
17316
+ "descriptionEn": "Drawer title. With none there is no title text (no built-in default); the header bar stays for the top-right close button and is only dropped when `closable` is off too"
17153
17317
  },
17154
17318
  {
17155
17319
  "name": "width",
@@ -17232,8 +17396,8 @@
17232
17396
  ],
17233
17397
  "boolean": true,
17234
17398
  "defaultExpression": "true",
17235
- "descriptionZh": "点击蒙层是否允许关闭",
17236
- "descriptionEn": "Whether clicking the mask allows closing"
17399
+ "descriptionZh": "是否点击遮罩关闭抽屉(只管遮罩,Esc 由 `escKey` 控制)",
17400
+ "descriptionEn": "Whether clicking the mask closes the drawer (mask only; Esc is gated by `escKey`)"
17237
17401
  },
17238
17402
  {
17239
17403
  "name": "target",
@@ -17283,6 +17447,19 @@
17283
17447
  "descriptionZh": "是否支持按 Esc 关闭",
17284
17448
  "descriptionEn": "Whether to support closing with Esc key"
17285
17449
  },
17450
+ {
17451
+ "name": "destroyOnClose",
17452
+ "type": "boolean | undefined",
17453
+ "required": false,
17454
+ "enumValues": [
17455
+ false,
17456
+ true
17457
+ ],
17458
+ "boolean": true,
17459
+ "defaultExpression": "true",
17460
+ "descriptionZh": "关闭后是否销毁抽屉内容。默认销毁(重开时重新挂载);设为 false 可保留抽屉内已填写的表单状态,代价是打开过的抽屉留一份隐藏 DOM",
17461
+ "descriptionEn": "Whether to destroy drawer content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened drawer"
17462
+ },
17286
17463
  {
17287
17464
  "name": "onOk",
17288
17465
  "type": "(() => void) | undefined",
@@ -17312,8 +17489,8 @@
17312
17489
  "type": "((opened: boolean) => void) | undefined",
17313
17490
  "required": false,
17314
17491
  "boolean": false,
17315
- "descriptionZh": "打开或抽屉关闭的回调",
17316
- "descriptionEn": "Callback for opening or closing the drawer"
17492
+ "descriptionZh": "抽屉关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
17493
+ "descriptionEn": "Fires when the drawer closes; opening is your own `open` flip, so it is never echoed back"
17317
17494
  },
17318
17495
  {
17319
17496
  "name": "children",
@@ -17356,8 +17533,8 @@
17356
17533
  "type": "((opened: boolean) => void) | undefined",
17357
17534
  "required": false,
17358
17535
  "boolean": false,
17359
- "descriptionZh": "打开或抽屉关闭的回调",
17360
- "descriptionEn": "Callback for opening or closing the drawer"
17536
+ "descriptionZh": "抽屉关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
17537
+ "descriptionEn": "Fires when the drawer closes; opening is your own `open` flip, so it is never echoed back"
17361
17538
  }
17362
17539
  ],
17363
17540
  "renderProps": [
@@ -17375,22 +17552,22 @@
17375
17552
  {
17376
17553
  "id": "components/drawer/demo/basic.tsx",
17377
17554
  "title": "基本用法",
17378
- "source": "import { useState } from \"react\";\nimport { Button, Space, Drawer } from \"react-kui\";\nconst Body = () => (\n <>\n <p>something ...</p>\n <p>something ...</p>\n <p>something ...</p>\n </>\n);\nexport default function App() {\n const [show, setShow] = useState(false),\n [show2, setShow2] = useState(false),\n [show3, setShow3] = useState(false),\n [show4, setShow4] = useState(false),\n [loading, setLoading] = useState(false);\n const submit = () => {\n setLoading(true);\n setTimeout(() => {\n setShow4(false);\n setLoading(false);\n }, 2000);\n };\n return (\n <div>\n <Space wrap>\n <Button onClick={() => setShow((v) => !v)}>Open</Button>\n <Button onClick={() => setShow2((v) => !v)}>Width 30%</Button>\n <Button onClick={() => setShow3((v) => !v)}>Click mask can't close</Button>\n <Button onClick={() => setShow4((v) => !v)}>No mask</Button>\n </Space>\n <Drawer open={show} footer={false} onClose={() => setShow(false)}>\n <Body />\n </Drawer>\n <Drawer\n open={show2}\n width=\"30%\"\n title=\"Width 30%\"\n onClose={() => setShow2(false)}\n onOk={() => setShow2(false)}\n >\n <Body />\n </Drawer>\n <Drawer\n open={show3}\n title=\"Click mask to close\"\n maskClosable={false}\n onClose={() => setShow3(false)}\n onOk={() => setShow3(false)}\n >\n <Body />\n </Drawer>\n <Drawer\n open={show4}\n title=\"No mask\"\n mask={false}\n onClose={() => setShow4(false)}\n onOk={submit}\n loading={loading}\n >\n <Body />\n </Drawer>\n </div>\n );\n}"
17555
+ "source": "import { useState } from \"react\";\nimport { Button, Drawer, Space } from \"react-kui\";\nconst Body = () => (\n <>\n <p>something ...</p>\n <p>something ...</p>\n <p>something ...</p>\n </>\n);\nexport default function App() {\n const [show, setShow] = useState(false),\n [show2, setShow2] = useState(false),\n [show3, setShow3] = useState(false),\n [show4, setShow4] = useState(false),\n [loading, setLoading] = useState(false);\n const submit = () => {\n setLoading(true);\n setTimeout(() => {\n setShow4(false);\n setLoading(false);\n }, 2000);\n };\n return (\n <div>\n <Space wrap>\n <Button onClick={() => setShow((v) => !v)}>Open</Button>\n <Button onClick={() => setShow2((v) => !v)}>Width 30%</Button>\n <Button onClick={() => setShow3((v) => !v)}>Click mask can't close</Button>\n <Button onClick={() => setShow4((v) => !v)}>No mask</Button>\n </Space>\n <Drawer open={show} footer={false} onOpenChange={setShow}>\n <Body />\n </Drawer>\n <Drawer\n open={show2}\n width=\"30%\"\n title=\"Width 30%\"\n onOpenChange={setShow2}\n onOk={() => setShow2(false)}\n >\n <Body />\n </Drawer>\n <Drawer\n open={show3}\n title=\"Click mask to close\"\n maskClosable={false}\n onOpenChange={setShow3}\n onOk={() => setShow3(false)}\n >\n <Body />\n </Drawer>\n <Drawer\n open={show4}\n title=\"No mask\"\n mask={false}\n onOpenChange={setShow4}\n onOk={submit}\n loading={loading}\n >\n <Body />\n </Drawer>\n </div>\n );\n}"
17379
17556
  },
17380
17557
  {
17381
17558
  "id": "components/drawer/demo/custom.tsx",
17382
17559
  "title": "自定义",
17383
- "source": "import { useState } from \"react\";\nimport {\n Button,\n Drawer,\n Segmented,\n Space,\n type DrawerPlacementsType,\n} from \"react-kui\";\nconst placements: DrawerPlacementsType[] = [\"left\", \"top\", \"right\", \"bottom\"];\nexport default function App() {\n const [open, setOpen] = useState(false),\n [placement, setPlacement] = useState<DrawerPlacementsType>(\"left\");\n return (\n <div>\n <Space wrap>\n <Segmented\n value={placement}\n options={placements.map((value) => ({ label: value, value }))}\n onChange={(v) => setPlacement(v as DrawerPlacementsType)}\n />\n <Button onClick={() => setOpen(true)}>Open</Button>\n </Space>\n <Drawer\n open={open}\n height={300}\n placement={placement}\n title=\"What's your name?\"\n cancelText=\"Cancel\"\n okText=\"Ok\"\n onClose={() => setOpen(false)}\n onCancel={() => setOpen(false)}\n onOk={() => setOpen(false)}\n >\n My name is Qiu.\n </Drawer>\n </div>\n );\n}"
17560
+ "source": "import { useState } from \"react\";\nimport { Button, Drawer, Segmented, Space, type DrawerPlacementsType } from \"react-kui\";\nconst placements: DrawerPlacementsType[] = [\"left\", \"top\", \"right\", \"bottom\"];\nexport default function App() {\n const [open, setOpen] = useState(false),\n [placement, setPlacement] = useState<DrawerPlacementsType>(\"left\");\n return (\n <div>\n <Space wrap>\n <Segmented\n value={placement}\n options={placements.map((value) => ({ label: value, value }))}\n onChange={(v) => setPlacement(v as DrawerPlacementsType)}\n />\n <Button onClick={() => setOpen(true)}>Open</Button>\n </Space>\n <Drawer\n open={open}\n height={300}\n placement={placement}\n title=\"What's your name?\"\n cancelText=\"Cancel\"\n okText=\"Ok\"\n onOpenChange={setOpen}\n onOk={() => setOpen(false)}\n >\n My name is Qiu.\n </Drawer>\n </div>\n );\n}"
17384
17561
  },
17385
17562
  {
17386
17563
  "id": "components/drawer/demo/with-form.tsx",
17387
17564
  "title": "表单模式",
17388
- "source": "import { House } from \"kui-icons\";\nimport { useRef, useState } from \"react\";\nimport {\n Button,\n Checkbox,\n CheckboxGroup,\n Drawer,\n Form,\n FormItem,\n Input,\n InputNumber,\n message,\n Radio,\n RadioGroup,\n Space,\n TextArea,\n type FormExpose,\n type FormRules,\n} from \"react-kui\";\nconst rules: FormRules = {\n input: [{ required: true }],\n number: [{ required: true }],\n radios: [{ required: true }],\n checkbox_group: [{ required: true }],\n textarea: [\n { required: true, message: \"必填\", trigger: \"blur\" },\n { min: 2, max: 5, message: \"长度为2-5个字符\" },\n ],\n};\nexport default function App() {\n const [show1, setShow1] = useState(false),\n [show2, setShow2] = useState(false),\n ref = useRef<FormExpose>(null),\n model = { input: \"\", number: \"\", radios: \"\", checkbox_group: [], textarea: \"\" };\n const submit = () =>\n ref.current?.validate(({ valid }) => {\n message[valid ? \"success\" : \"error\"](valid ? \"Successfully\" : \"Failed\");\n if (valid) setShow1(false);\n });\n return (\n <div>\n <Space>\n <Button onClick={() => setShow1(true)}>Drawer with forms</Button>\n <Button onClick={() => setShow2(true)}>Custom</Button>\n </Space>\n <Drawer\n open={show1}\n title=\"Forms valid\"\n onClose={() => setShow1(false)}\n onOk={submit}\n onCancel={() => ref.current?.reset()}\n >\n <Form\n ref={ref}\n model={model}\n rules={rules}\n labelCol={{ span: 5 }}\n wrapperCol={{ span: 19 }}\n >\n <FormItem label=\"Input\" prop=\"input\">\n <Input clearable icon={House} />\n </FormItem>\n <FormItem label=\"Number\" prop=\"number\">\n <InputNumber />\n </FormItem>\n <FormItem label=\"RadioGroup\" prop=\"radios\">\n <RadioGroup>\n <Radio value=\"0\" label=\"Wuhan\" />\n <Radio value=\"1\" label=\"Shenzhen\" />\n </RadioGroup>\n </FormItem>\n <FormItem label=\"CheckboxGroup\" prop=\"checkbox_group\">\n <CheckboxGroup>\n <Checkbox value=\"0\" label=\"Wuhan\" />\n <Checkbox value=\"1\" label=\"Hangzhou\" />\n </CheckboxGroup>\n </FormItem>\n <FormItem label=\"Text\" prop=\"textarea\">\n <TextArea placeholder=\"Please enter something...\" />\n </FormItem>\n </Form>\n </Drawer>\n <Drawer\n open={show2}\n title=\"I am custom title\"\n onClose={() => setShow2(false)}\n footer={\n <Space>\n <Button onClick={() => setShow2(false)}>Cancel</Button>\n <Button type=\"danger\">Reject</Button>\n <Button>Inject</Button>\n </Space>\n }\n >\n <p>Content...</p>\n </Drawer>\n </div>\n );\n}"
17565
+ "source": "import { House } from \"kui-icons\";\nimport { useRef, useState } from \"react\";\nimport {\n Button,\n Checkbox,\n CheckboxGroup,\n Drawer,\n Form,\n FormItem,\n Input,\n InputNumber,\n message,\n Radio,\n RadioGroup,\n Space,\n TextArea,\n type FormExpose,\n type FormRules,\n} from \"react-kui\";\nconst rules: FormRules = {\n input: [{ required: true }],\n number: [{ required: true }],\n radios: [{ required: true }],\n checkbox_group: [{ required: true }],\n textarea: [\n { required: true, message: \"必填\", trigger: \"blur\" },\n { min: 2, max: 5, message: \"长度为2-5个字符\" },\n ],\n};\nexport default function App() {\n const [show1, setShow1] = useState(false),\n [show2, setShow2] = useState(false),\n ref = useRef<FormExpose>(null),\n model = { input: \"\", number: \"\", radios: \"\", checkbox_group: [], textarea: \"\" };\n const submit = () =>\n ref.current?.validate(({ valid }) => {\n message[valid ? \"success\" : \"error\"](valid ? \"Successfully\" : \"Failed\");\n if (valid) setShow1(false);\n });\n return (\n <div>\n <Space>\n <Button onClick={() => setShow1(true)}>Drawer with forms</Button>\n <Button onClick={() => setShow2(true)}>Custom</Button>\n </Space>\n <Drawer\n open={show1}\n title=\"Forms valid\"\n onOpenChange={setShow1}\n onOk={submit}\n onCancel={() => ref.current?.reset()}\n >\n <Form\n ref={ref}\n model={model}\n rules={rules}\n labelCol={{ span: 5 }}\n wrapperCol={{ span: 19 }}\n >\n <FormItem label=\"Input\" prop=\"input\">\n <Input clearable icon={House} />\n </FormItem>\n <FormItem label=\"Number\" prop=\"number\">\n <InputNumber />\n </FormItem>\n <FormItem label=\"RadioGroup\" prop=\"radios\">\n <RadioGroup>\n <Radio value=\"0\" label=\"Wuhan\" />\n <Radio value=\"1\" label=\"Shenzhen\" />\n </RadioGroup>\n </FormItem>\n <FormItem label=\"CheckboxGroup\" prop=\"checkbox_group\">\n <CheckboxGroup>\n <Checkbox value=\"0\" label=\"Wuhan\" />\n <Checkbox value=\"1\" label=\"Hangzhou\" />\n </CheckboxGroup>\n </FormItem>\n <FormItem label=\"Text\" prop=\"textarea\">\n <TextArea placeholder=\"Please enter something...\" />\n </FormItem>\n </Form>\n </Drawer>\n <Drawer\n open={show2}\n title=\"I am custom title\"\n onOpenChange={setShow2}\n footer={\n <Space>\n <Button onClick={() => setShow2(false)}>Cancel</Button>\n <Button type=\"danger\">Reject</Button>\n <Button>Inject</Button>\n </Space>\n }\n >\n <p>Content...</p>\n </Drawer>\n </div>\n );\n}"
17389
17566
  },
17390
17567
  {
17391
17568
  "id": "components/drawer/demo/target.tsx",
17392
17569
  "title": "植入目标元素",
17393
- "source": "import { useRef, useState } from \"react\";\nimport { Button, Segmented, Space, Drawer, type DrawerPlacementsType } from \"react-kui\";\nconst options = [\"left\", \"top\", \"right\", \"bottom\"].map((value) => ({ label: value, value }));\nexport default function App() {\n const [open, setOpen] = useState(false),\n [placement, setPlacement] = useState<DrawerPlacementsType>(\"left\"),\n ref = useRef<HTMLDivElement>(null);\n return (\n <>\n <Space wrap>\n <Segmented\n value={placement}\n options={options}\n onChange={(v) => setPlacement(v as DrawerPlacementsType)}\n />\n <Button onClick={() => setOpen((v) => !v)}>Open</Button>\n </Space>\n <br />\n <br />\n <div\n ref={ref}\n style={{\n height: 300,\n overflow: \"hidden\",\n borderRadius: 8,\n background: \"rgba(130, 130, 130, 0.18)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <p style={{ color: \"#999\" }}>Drawer inside with target.</p>\n </div>\n <Drawer\n open={open}\n width=\"50%\"\n height=\"50%\"\n footer={false}\n placement={placement}\n target={ref}\n onClose={() => setOpen(false)}\n >\n <p>something ...</p>\n <p>something ...</p>\n <p>something ...</p>\n </Drawer>\n </>\n );\n}"
17570
+ "source": "import { useRef, useState } from \"react\";\nimport { Button, Drawer, Segmented, Space, type DrawerPlacementsType } from \"react-kui\";\nconst options = [\"left\", \"top\", \"right\", \"bottom\"].map((value) => ({ label: value, value }));\nexport default function App() {\n const [open, setOpen] = useState(false),\n [placement, setPlacement] = useState<DrawerPlacementsType>(\"left\"),\n ref = useRef<HTMLDivElement>(null);\n return (\n <>\n <Space wrap>\n <Segmented\n value={placement}\n options={options}\n onChange={(v) => setPlacement(v as DrawerPlacementsType)}\n />\n <Button onClick={() => setOpen((v) => !v)}>Open</Button>\n </Space>\n <br />\n <br />\n <div\n ref={ref}\n style={{\n height: 300,\n overflow: \"hidden\",\n borderRadius: 8,\n background: \"rgba(130, 130, 130, 0.18)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <p style={{ color: \"#999\" }}>Drawer inside with target.</p>\n </div>\n <Drawer\n open={open}\n width=\"50%\"\n height=\"50%\"\n footer={false}\n placement={placement}\n target={ref}\n onOpenChange={setOpen}\n >\n <p>something ...</p>\n <p>something ...</p>\n <p>something ...</p>\n </Drawer>\n </>\n );\n}"
17394
17571
  }
17395
17572
  ]
17396
17573
  },
@@ -17480,6 +17657,19 @@
17480
17657
  "descriptionZh": "下拉层位置",
17481
17658
  "descriptionEn": "Dropdown placement"
17482
17659
  },
17660
+ {
17661
+ "name": "destroyOnClose",
17662
+ "type": "boolean | undefined",
17663
+ "required": false,
17664
+ "enumValues": [
17665
+ false,
17666
+ true
17667
+ ],
17668
+ "boolean": true,
17669
+ "defaultExpression": "true",
17670
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
17671
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
17672
+ },
17483
17673
  {
17484
17674
  "name": "target",
17485
17675
  "type": "React.RefObject<HTMLElement | null> | undefined",
@@ -17987,20 +18177,18 @@
17987
18177
  },
17988
18178
  {
17989
18179
  "name": "theme",
17990
- "type": "ThemeType | undefined",
18180
+ "type": "SurfaceThemeType | undefined",
17991
18181
  "required": false,
17992
18182
  "enumValues": [
17993
18183
  "dashed",
17994
18184
  "solid",
17995
- "default",
17996
18185
  "fill",
17997
18186
  "outline",
17998
- "plain",
17999
- "underlined"
18187
+ "plain"
18000
18188
  ],
18001
18189
  "boolean": false,
18002
- "descriptionZh": "按钮主题",
18003
- "descriptionEn": "Button theme"
18190
+ "descriptionZh": "按钮主题,可用 `fill` / `outline` / `plain` / `solid` / `dashed`;不写 `theme` 就是按钮自身的外观,`underlined` 是给可输入的控件用的,按钮不会画下划线",
18191
+ "descriptionEn": "Button theme; `fill` / `outline` / `plain` / `solid` / `dashed` are drawn. Leaving `theme` unset keeps the button's own look, and `underlined` belongs to controls you type into, so a button never draws an underline"
18004
18192
  },
18005
18193
  {
18006
18194
  "name": "arrow",
@@ -18015,6 +18203,19 @@
18015
18203
  "descriptionZh": "是否显示下拉箭头",
18016
18204
  "descriptionEn": "Whether to show the dropdown arrow"
18017
18205
  },
18206
+ {
18207
+ "name": "trigger",
18208
+ "type": "TriggerType | undefined",
18209
+ "required": false,
18210
+ "enumValues": [
18211
+ "hover",
18212
+ "click",
18213
+ "contextmenu"
18214
+ ],
18215
+ "boolean": false,
18216
+ "descriptionZh": "触发方式",
18217
+ "descriptionEn": "Trigger mode"
18218
+ },
18018
18219
  {
18019
18220
  "name": "placement",
18020
18221
  "type": "DropPlacementsType | undefined",
@@ -18032,6 +18233,19 @@
18032
18233
  "descriptionZh": "下拉层位置",
18033
18234
  "descriptionEn": "Dropdown placement"
18034
18235
  },
18236
+ {
18237
+ "name": "destroyOnClose",
18238
+ "type": "boolean | undefined",
18239
+ "required": false,
18240
+ "enumValues": [
18241
+ false,
18242
+ true
18243
+ ],
18244
+ "boolean": true,
18245
+ "defaultExpression": "true",
18246
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
18247
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
18248
+ },
18035
18249
  {
18036
18250
  "name": "onClick",
18037
18251
  "type": "((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined",
@@ -19431,7 +19645,6 @@
19431
19645
  "enumValues": [
19432
19646
  "dashed",
19433
19647
  "solid",
19434
- "default",
19435
19648
  "fill",
19436
19649
  "outline",
19437
19650
  "plain",
@@ -19959,7 +20172,7 @@
19959
20172
  {
19960
20173
  "id": "components/form/demo/withmodal.tsx",
19961
20174
  "title": "多表单联动",
19962
- "source": "import { useRef, useState } from \"react\";\nimport {\n Button,\n Input,\n message,\n Modal,\n Space,\n Tag,\n Form,\n FormItem,\n type FormExpose,\n type FormSubmitEvent,\n type FormRule,\n} from \"react-kui\";\nconst labelCol = { span: 6 },\n wrapperCol = { span: 16 };\nexport default function App() {\n const ref = useRef<FormExpose>(null);\n const [visible, setVisible] = useState(false),\n [group, setGroup] = useState<{ name: string; list: { username: string; age: string }[] }>({\n name: \"\",\n list: [],\n }),\n [form, setForm] = useState({ username: \"\", age: \"\" });\n const rules = { name: [{ required: true, message: \"Please input the organization name\" }] };\n const userRules = {\n username: [{ required: true, message: \"Please input the organization name\" }],\n age: [\n { required: true, message: \"Please input the age.\" },\n { type: \"number\", message: \"Please input the valid age.\" },\n ],\n } as Record<string, FormRule[]>;\n const submitUser = ({ valid }: FormSubmitEvent) => {\n if (valid) {\n setGroup({ ...group, list: [...group.list, { ...form }] });\n ref.current?.reset();\n setForm({ username: \"\", age: \"\" });\n setVisible(false);\n }\n };\n const cancel = () => {\n ref.current?.reset();\n setVisible(false);\n };\n return (\n <div style={{ maxWidth: 512 }}>\n <Form\n name=\"with-modal\"\n model={group}\n onChange={(next) => setGroup(next as typeof group)}\n onSubmit={(e) => message[e.valid ? \"success\" : \"error\"](e.valid ? \"success\" : \"failed\")}\n rules={rules}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n >\n <FormItem label=\"Group\" prop=\"name\">\n <Input />\n </FormItem>\n <FormItem label=\"UserList\">\n <Space>\n {group.list.map((item, i) => (\n <Tag theme=\"fill\" key={i}>\n {item.username} - {item.age}\n </Tag>\n ))}\n </Space>\n </FormItem>\n <FormItem wrapperCol={{ offset: 6 }}>\n <Button type=\"primary\" htmlType=\"submit\">\n Submit\n </Button>\n <Button onClick={() => setVisible(true)} style={{ marginLeft: 10 }}>\n Add User\n </Button>\n </FormItem>\n </Form>\n <Modal\n open={visible}\n title=\"New User\"\n width={450}\n onClose={cancel}\n onCancel={cancel}\n onOk={() => ref.current?.submit()}\n >\n <Form\n ref={ref}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n name=\"modal\"\n model={form}\n onChange={(next) => setForm(next as typeof form)}\n rules={userRules}\n onSubmit={submitUser}\n >\n <FormItem label=\"Usename\" prop=\"username\">\n <Input placeholder=\"Please input username\" />\n </FormItem>\n <FormItem label=\"Age\" prop=\"age\">\n <Input placeholder=\"Please input age\" />\n </FormItem>\n </Form>\n </Modal>\n </div>\n );\n}"
20175
+ "source": "import { useRef, useState } from \"react\";\nimport {\n Button,\n Input,\n message,\n Modal,\n Space,\n Tag,\n Form,\n FormItem,\n type FormExpose,\n type FormSubmitEvent,\n type FormRule,\n} from \"react-kui\";\nconst labelCol = { span: 6 },\n wrapperCol = { span: 16 };\nexport default function App() {\n const ref = useRef<FormExpose>(null);\n const [visible, setVisible] = useState(false),\n [group, setGroup] = useState<{ name: string; list: { username: string; age: string }[] }>({\n name: \"\",\n list: [],\n }),\n [form, setForm] = useState({ username: \"\", age: \"\" });\n const rules = { name: [{ required: true, message: \"Please input the organization name\" }] };\n const userRules = {\n username: [{ required: true, message: \"Please input the organization name\" }],\n age: [\n { required: true, message: \"Please input the age.\" },\n { type: \"number\", message: \"Please input the valid age.\" },\n ],\n } as Record<string, FormRule[]>;\n const submitUser = ({ valid }: FormSubmitEvent) => {\n if (valid) {\n setGroup({ ...group, list: [...group.list, { ...form }] });\n ref.current?.reset();\n setForm({ username: \"\", age: \"\" });\n setVisible(false);\n }\n };\n // 开合状态只从 `onOpenChange` 回写(点「取消」不走 `onClose`);\n // 顺带在关掉那一刻清一次表单,X、Esc、取消三条路都覆盖到。\n const changeOpen = (next: boolean) => {\n setVisible(next);\n if (!next) ref.current?.reset();\n };\n return (\n <div style={{ maxWidth: 512 }}>\n <Form\n name=\"with-modal\"\n model={group}\n onChange={(next) => setGroup(next as typeof group)}\n onSubmit={(e) => message[e.valid ? \"success\" : \"error\"](e.valid ? \"success\" : \"failed\")}\n rules={rules}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n >\n <FormItem label=\"Group\" prop=\"name\">\n <Input />\n </FormItem>\n <FormItem label=\"UserList\">\n <Space>\n {group.list.map((item, i) => (\n <Tag theme=\"fill\" key={i}>\n {item.username} - {item.age}\n </Tag>\n ))}\n </Space>\n </FormItem>\n <FormItem wrapperCol={{ offset: 6 }}>\n <Button type=\"primary\" htmlType=\"submit\">\n Submit\n </Button>\n <Button onClick={() => setVisible(true)} style={{ marginLeft: 10 }}>\n Add User\n </Button>\n </FormItem>\n </Form>\n <Modal\n open={visible}\n title=\"New User\"\n width={450}\n onOpenChange={changeOpen}\n onOk={() => ref.current?.submit()}\n >\n <Form\n ref={ref}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n name=\"modal\"\n model={form}\n onChange={(next) => setForm(next as typeof form)}\n rules={userRules}\n onSubmit={submitUser}\n >\n <FormItem label=\"Usename\" prop=\"username\">\n <Input placeholder=\"Please input username\" />\n </FormItem>\n <FormItem label=\"Age\" prop=\"age\">\n <Input placeholder=\"Please input age\" />\n </FormItem>\n </Form>\n </Modal>\n </div>\n );\n}"
19963
20176
  },
19964
20177
  {
19965
20178
  "id": "components/form/demo/customvalid.tsx",
@@ -20077,7 +20290,7 @@
20077
20290
  {
20078
20291
  "id": "components/form/demo/withmodal.tsx",
20079
20292
  "title": "多表单联动",
20080
- "source": "import { useRef, useState } from \"react\";\nimport {\n Button,\n Input,\n message,\n Modal,\n Space,\n Tag,\n Form,\n FormItem,\n type FormExpose,\n type FormSubmitEvent,\n type FormRule,\n} from \"react-kui\";\nconst labelCol = { span: 6 },\n wrapperCol = { span: 16 };\nexport default function App() {\n const ref = useRef<FormExpose>(null);\n const [visible, setVisible] = useState(false),\n [group, setGroup] = useState<{ name: string; list: { username: string; age: string }[] }>({\n name: \"\",\n list: [],\n }),\n [form, setForm] = useState({ username: \"\", age: \"\" });\n const rules = { name: [{ required: true, message: \"Please input the organization name\" }] };\n const userRules = {\n username: [{ required: true, message: \"Please input the organization name\" }],\n age: [\n { required: true, message: \"Please input the age.\" },\n { type: \"number\", message: \"Please input the valid age.\" },\n ],\n } as Record<string, FormRule[]>;\n const submitUser = ({ valid }: FormSubmitEvent) => {\n if (valid) {\n setGroup({ ...group, list: [...group.list, { ...form }] });\n ref.current?.reset();\n setForm({ username: \"\", age: \"\" });\n setVisible(false);\n }\n };\n const cancel = () => {\n ref.current?.reset();\n setVisible(false);\n };\n return (\n <div style={{ maxWidth: 512 }}>\n <Form\n name=\"with-modal\"\n model={group}\n onChange={(next) => setGroup(next as typeof group)}\n onSubmit={(e) => message[e.valid ? \"success\" : \"error\"](e.valid ? \"success\" : \"failed\")}\n rules={rules}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n >\n <FormItem label=\"Group\" prop=\"name\">\n <Input />\n </FormItem>\n <FormItem label=\"UserList\">\n <Space>\n {group.list.map((item, i) => (\n <Tag theme=\"fill\" key={i}>\n {item.username} - {item.age}\n </Tag>\n ))}\n </Space>\n </FormItem>\n <FormItem wrapperCol={{ offset: 6 }}>\n <Button type=\"primary\" htmlType=\"submit\">\n Submit\n </Button>\n <Button onClick={() => setVisible(true)} style={{ marginLeft: 10 }}>\n Add User\n </Button>\n </FormItem>\n </Form>\n <Modal\n open={visible}\n title=\"New User\"\n width={450}\n onClose={cancel}\n onCancel={cancel}\n onOk={() => ref.current?.submit()}\n >\n <Form\n ref={ref}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n name=\"modal\"\n model={form}\n onChange={(next) => setForm(next as typeof form)}\n rules={userRules}\n onSubmit={submitUser}\n >\n <FormItem label=\"Usename\" prop=\"username\">\n <Input placeholder=\"Please input username\" />\n </FormItem>\n <FormItem label=\"Age\" prop=\"age\">\n <Input placeholder=\"Please input age\" />\n </FormItem>\n </Form>\n </Modal>\n </div>\n );\n}"
20293
+ "source": "import { useRef, useState } from \"react\";\nimport {\n Button,\n Input,\n message,\n Modal,\n Space,\n Tag,\n Form,\n FormItem,\n type FormExpose,\n type FormSubmitEvent,\n type FormRule,\n} from \"react-kui\";\nconst labelCol = { span: 6 },\n wrapperCol = { span: 16 };\nexport default function App() {\n const ref = useRef<FormExpose>(null);\n const [visible, setVisible] = useState(false),\n [group, setGroup] = useState<{ name: string; list: { username: string; age: string }[] }>({\n name: \"\",\n list: [],\n }),\n [form, setForm] = useState({ username: \"\", age: \"\" });\n const rules = { name: [{ required: true, message: \"Please input the organization name\" }] };\n const userRules = {\n username: [{ required: true, message: \"Please input the organization name\" }],\n age: [\n { required: true, message: \"Please input the age.\" },\n { type: \"number\", message: \"Please input the valid age.\" },\n ],\n } as Record<string, FormRule[]>;\n const submitUser = ({ valid }: FormSubmitEvent) => {\n if (valid) {\n setGroup({ ...group, list: [...group.list, { ...form }] });\n ref.current?.reset();\n setForm({ username: \"\", age: \"\" });\n setVisible(false);\n }\n };\n // 开合状态只从 `onOpenChange` 回写(点「取消」不走 `onClose`);\n // 顺带在关掉那一刻清一次表单,X、Esc、取消三条路都覆盖到。\n const changeOpen = (next: boolean) => {\n setVisible(next);\n if (!next) ref.current?.reset();\n };\n return (\n <div style={{ maxWidth: 512 }}>\n <Form\n name=\"with-modal\"\n model={group}\n onChange={(next) => setGroup(next as typeof group)}\n onSubmit={(e) => message[e.valid ? \"success\" : \"error\"](e.valid ? \"success\" : \"failed\")}\n rules={rules}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n >\n <FormItem label=\"Group\" prop=\"name\">\n <Input />\n </FormItem>\n <FormItem label=\"UserList\">\n <Space>\n {group.list.map((item, i) => (\n <Tag theme=\"fill\" key={i}>\n {item.username} - {item.age}\n </Tag>\n ))}\n </Space>\n </FormItem>\n <FormItem wrapperCol={{ offset: 6 }}>\n <Button type=\"primary\" htmlType=\"submit\">\n Submit\n </Button>\n <Button onClick={() => setVisible(true)} style={{ marginLeft: 10 }}>\n Add User\n </Button>\n </FormItem>\n </Form>\n <Modal\n open={visible}\n title=\"New User\"\n width={450}\n onOpenChange={changeOpen}\n onOk={() => ref.current?.submit()}\n >\n <Form\n ref={ref}\n labelCol={labelCol}\n wrapperCol={wrapperCol}\n name=\"modal\"\n model={form}\n onChange={(next) => setForm(next as typeof form)}\n rules={userRules}\n onSubmit={submitUser}\n >\n <FormItem label=\"Usename\" prop=\"username\">\n <Input placeholder=\"Please input username\" />\n </FormItem>\n <FormItem label=\"Age\" prop=\"age\">\n <Input placeholder=\"Please input age\" />\n </FormItem>\n </Form>\n </Modal>\n </div>\n );\n}"
20081
20294
  },
20082
20295
  {
20083
20296
  "id": "components/form/demo/customvalid.tsx",
@@ -20615,30 +20828,27 @@
20615
20828
  },
20616
20829
  {
20617
20830
  "name": "theme",
20618
- "type": "ThemeType | undefined",
20831
+ "type": "SurfaceThemeType | undefined",
20619
20832
  "required": false,
20620
20833
  "enumValues": [
20621
20834
  "dashed",
20622
20835
  "solid",
20623
- "default",
20624
20836
  "fill",
20625
20837
  "outline",
20626
- "plain",
20627
- "underlined"
20838
+ "plain"
20628
20839
  ],
20629
20840
  "boolean": false,
20841
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
20630
20842
  "descriptionZh": "外观主题",
20631
20843
  "descriptionEn": "Appearance theme"
20632
20844
  },
20633
20845
  {
20634
20846
  "name": "shape",
20635
- "type": "ShapeType | undefined",
20847
+ "type": "SurfaceShapeType | undefined",
20636
20848
  "required": false,
20637
20849
  "enumValues": [
20638
20850
  "round",
20639
- "default",
20640
- "square",
20641
- "circle"
20851
+ "square"
20642
20852
  ],
20643
20853
  "boolean": false,
20644
20854
  "descriptionZh": "卡片形状",
@@ -20654,6 +20864,7 @@
20654
20864
  "large"
20655
20865
  ],
20656
20866
  "boolean": false,
20867
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
20657
20868
  "descriptionZh": "卡片尺寸",
20658
20869
  "descriptionEn": "Card size"
20659
20870
  },
@@ -20709,8 +20920,8 @@
20709
20920
  "type": "string | undefined",
20710
20921
  "required": false,
20711
20922
  "boolean": false,
20712
- "descriptionZh": "图标容器背景;未设置时根据 `color` 自动生成",
20713
- "descriptionEn": "Icon background, generated from `color` when omitted"
20923
+ "descriptionZh": "图标容器背景;未设置时由 `color` 淡化生成,`color` 无法解析(如 `currentColor`、CSS 变量)时改用主题主色淡化",
20924
+ "descriptionEn": "Icon container background; a wash of `color`, or of the theme primary when `color` cannot be parsed (e.g. `currentColor`, a CSS variable)"
20714
20925
  },
20715
20926
  {
20716
20927
  "name": "children",
@@ -21110,6 +21321,11 @@
21110
21321
  "id": "components/feature-card/demo/interactive.tsx",
21111
21322
  "title": "功能入口",
21112
21323
  "source": "import { FolderKanban, ShoppingCart, Users, Wallet } from \"kui-icons\";\nimport { FeatureCard, Grid, GridItem, message } from \"react-kui\";\n\nconst entries = [\n { title: \"项目管理\", icon: FolderKanban, color: \"#3a95ff\" },\n { title: \"订单管理\", icon: ShoppingCart, color: \"#7b61ff\" },\n { title: \"客户管理\", icon: Users, color: \"#22a06b\" },\n { title: \"财务报表\", icon: Wallet, color: \"#f59e0b\" },\n];\n\nexport default function App() {\n return (\n <Grid cols={{ xs: 2, md: 4 }} xGap={12} yGap={12}>\n {entries.map((item) => (\n <GridItem key={item.title}>\n <FeatureCard\n icon={item.icon}\n title={item.title}\n color={item.color}\n size=\"small\"\n direction=\"vertical\"\n theme=\"outline\"\n clickable\n onClick={() => message.info(item.title)}\n />\n </GridItem>\n ))}\n </Grid>\n );\n}"
21324
+ },
21325
+ {
21326
+ "id": "components/feature-card/demo/appearance.tsx",
21327
+ "title": "外观",
21328
+ "source": "import { Zap } from \"kui-icons\";\nimport { FeatureCard, Grid, type SurfaceThemeType } from \"react-kui\";\n\n// The feature card paints the same five tiers as the plain card and starts on `fill`; `solid` puts the icon\n// plate and the title on the primary, which is the one tier that moves the text, and `plain` drops the box\n// around the content entirely. Kept to `direction=\"vertical\"` and one line of copy so the five read as a row\n// of the same card rather than five different layouts.\nconst tiers: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Grid cols={5} xGap={12} yGap={12}>\n {tiers.map((tier) => (\n <FeatureCard\n key={tier}\n icon={Zap}\n title={`theme: ${tier}`}\n direction=\"vertical\"\n size=\"small\"\n theme={tier}\n />\n ))}\n </Grid>\n );\n}"
21113
21329
  }
21114
21330
  ]
21115
21331
  },
@@ -21393,30 +21609,27 @@
21393
21609
  },
21394
21610
  {
21395
21611
  "name": "theme",
21396
- "type": "ThemeType | undefined",
21612
+ "type": "SurfaceThemeType | undefined",
21397
21613
  "required": false,
21398
21614
  "enumValues": [
21399
21615
  "dashed",
21400
21616
  "solid",
21401
- "default",
21402
21617
  "fill",
21403
21618
  "outline",
21404
- "plain",
21405
- "underlined"
21619
+ "plain"
21406
21620
  ],
21407
21621
  "boolean": false,
21408
- "descriptionZh": "主题样式",
21409
- "descriptionEn": "Appearance"
21622
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"outline\"",
21623
+ "descriptionZh": "外观主题",
21624
+ "descriptionEn": "Appearance theme"
21410
21625
  },
21411
21626
  {
21412
21627
  "name": "shape",
21413
- "type": "ShapeType | undefined",
21628
+ "type": "SurfaceShapeType | undefined",
21414
21629
  "required": false,
21415
21630
  "enumValues": [
21416
21631
  "round",
21417
- "default",
21418
- "square",
21419
- "circle"
21632
+ "square"
21420
21633
  ],
21421
21634
  "boolean": false,
21422
21635
  "descriptionZh": "形状",
@@ -21806,6 +22019,11 @@
21806
22019
  "id": "components/feedback-panel/demo/kinds.tsx",
21807
22020
  "title": "状态类型",
21808
22021
  "source": "import { FeedbackPanel, Space } from \"react-kui\";\n\nexport default function App() {\n return (\n <Space vertical block size=\"large\">\n <FeedbackPanel\n compact\n kind=\"positive\"\n heading=\"Sync Complete\"\n description=\"12 records updated.\"\n />\n <FeedbackPanel\n compact\n kind=\"neutral\"\n heading=\"Awaiting Confirmation\"\n description=\"The change will only be implemented upon confirmation.\"\n />\n <FeedbackPanel\n compact\n kind=\"caution\"\n heading=\"Partial Configuration Missing\"\n description=\"Please add the notification recipients.\"\n />\n <FeedbackPanel\n compact\n kind=\"negative\"\n heading=\"Connection Failed\"\n description=\"Unable to access the target service. Please try again later.\"\n />\n </Space>\n );\n}"
22022
+ },
22023
+ {
22024
+ "id": "components/feedback-panel/demo/appearance.tsx",
22025
+ "title": "外观",
22026
+ "source": "import { Button, FeedbackPanel, Space, type SurfaceThemeType } from \"react-kui\";\n\n// A feedback panel paints all five tiers and starts on `outline`. The tier only decides how much of the panel\n// shows: the four-pixel status stripe on the left and the `kind` colours stay put in every tier, while `solid`\n// plates the panel itself on the primary and moves the heading and the actions onto the light ink of the plate.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <div style={{ display: \"grid\", gap: 16 }}>\n {tiers.map((tier) => (\n <FeedbackPanel\n key={tier}\n theme={tier}\n kind=\"positive\"\n heading={`theme: ${tier}`}\n description=\"状态色带和图标不受档位影响,只有面板自己铺多少。\"\n actions={\n <Space>\n <Button type=\"primary\">继续</Button>\n <Button>查看设置</Button>\n </Space>\n }\n />\n ))}\n </div>\n );\n}"
21809
22027
  }
21810
22028
  ]
21811
22029
  },
@@ -23176,6 +23394,11 @@
23176
23394
  "id": "components/image/demo/extra.tsx",
23177
23395
  "title": "扩展",
23178
23396
  "source": "import { Heart, Star } from \"kui-icons\";\nimport { useRef } from \"react\";\nimport { Icon, message, Space, KImage, type ImageRef } from \"react-kui\";\nexport default function App() {\n const ref = useRef<ImageRef>(null),\n toggle = () => ref.current?.togglePanel();\n return (\n <Space vertical>\n <KImage\n width={120}\n height={120}\n src=\"https://cdn.chuchur.com/upload/demo/test_300.jpg\"\n onClose={() => message.info(\"close\")}\n ref={ref}\n tools={\n <>\n <Icon type={Heart} color=\"#3a95ff\" onClick={toggle} />\n <Icon type={Star} color=\"#3a95ff\" onClick={toggle} />\n </>\n }\n panel={<div>Some thing here.</div>}\n />\n </Space>\n );\n}"
23397
+ },
23398
+ {
23399
+ "id": "components/image/demo/appearance.tsx",
23400
+ "title": "外观",
23401
+ "source": "import { KImage, Space, type SurfaceThemeType } from \"react-kui\";\n\n// An image is a frame around a picture, so the tier lands on the frame: `fill` gives it a plate, `outline` and\n// `dashed` put a solid or dashed edge around it, `solid` plates the frame on the primary, and `plain` — the\n// image's own look — leaves the picture alone. Listed from `plain` because that is what an image does when\n// nobody tells it otherwise.\nconst tiers: SurfaceThemeType[] = [\"plain\", \"fill\", \"outline\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Space wrap size={16}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 8, justifyItems: \"center\" }}>\n <KImage\n width={104}\n height={104}\n theme={tier}\n src=\"https://cdn.chuchur.com/upload/demo/test_300.jpg\"\n />\n <code>theme: {tier}</code>\n </div>\n ))}\n </Space>\n );\n}"
23179
23402
  }
23180
23403
  ]
23181
23404
  },
@@ -23306,20 +23529,19 @@
23306
23529
  },
23307
23530
  {
23308
23531
  "name": "theme",
23309
- "type": "ThemeType | undefined",
23532
+ "type": "SurfaceThemeType | undefined",
23310
23533
  "required": false,
23311
23534
  "enumValues": [
23312
23535
  "dashed",
23313
23536
  "solid",
23314
- "default",
23315
23537
  "fill",
23316
23538
  "outline",
23317
- "plain",
23318
- "underlined"
23539
+ "plain"
23319
23540
  ],
23320
23541
  "boolean": false,
23321
- "descriptionZh": "主题",
23322
- "descriptionEn": "Theme"
23542
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"plain\"",
23543
+ "descriptionZh": "外观主题",
23544
+ "descriptionEn": "Appearance theme"
23323
23545
  },
23324
23546
  {
23325
23547
  "name": "shape",
@@ -23332,6 +23554,7 @@
23332
23554
  "circle"
23333
23555
  ],
23334
23556
  "boolean": false,
23557
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
23335
23558
  "descriptionZh": "形状",
23336
23559
  "descriptionEn": "Shape"
23337
23560
  }
@@ -23748,6 +23971,11 @@
23748
23971
  "id": "components/image/demo/extra.tsx",
23749
23972
  "title": "扩展",
23750
23973
  "source": "import { Heart, Star } from \"kui-icons\";\nimport { useRef } from \"react\";\nimport { Icon, message, Space, KImage, type ImageRef } from \"react-kui\";\nexport default function App() {\n const ref = useRef<ImageRef>(null),\n toggle = () => ref.current?.togglePanel();\n return (\n <Space vertical>\n <KImage\n width={120}\n height={120}\n src=\"https://cdn.chuchur.com/upload/demo/test_300.jpg\"\n onClose={() => message.info(\"close\")}\n ref={ref}\n tools={\n <>\n <Icon type={Heart} color=\"#3a95ff\" onClick={toggle} />\n <Icon type={Star} color=\"#3a95ff\" onClick={toggle} />\n </>\n }\n panel={<div>Some thing here.</div>}\n />\n </Space>\n );\n}"
23974
+ },
23975
+ {
23976
+ "id": "components/image/demo/appearance.tsx",
23977
+ "title": "外观",
23978
+ "source": "import { KImage, Space, type SurfaceThemeType } from \"react-kui\";\n\n// An image is a frame around a picture, so the tier lands on the frame: `fill` gives it a plate, `outline` and\n// `dashed` put a solid or dashed edge around it, `solid` plates the frame on the primary, and `plain` — the\n// image's own look — leaves the picture alone. Listed from `plain` because that is what an image does when\n// nobody tells it otherwise.\nconst tiers: SurfaceThemeType[] = [\"plain\", \"fill\", \"outline\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Space wrap size={16}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 8, justifyItems: \"center\" }}>\n <KImage\n width={104}\n height={104}\n theme={tier}\n src=\"https://cdn.chuchur.com/upload/demo/test_300.jpg\"\n />\n <code>theme: {tier}</code>\n </div>\n ))}\n </Space>\n );\n}"
23751
23979
  }
23752
23980
  ]
23753
23981
  },
@@ -24295,7 +24523,6 @@
24295
24523
  "enumValues": [
24296
24524
  "dashed",
24297
24525
  "solid",
24298
- "default",
24299
24526
  "fill",
24300
24527
  "outline",
24301
24528
  "plain",
@@ -24303,7 +24530,7 @@
24303
24530
  ],
24304
24531
  "boolean": false,
24305
24532
  "descriptionZh": "主题",
24306
- "descriptionEn": "The theme of Input"
24533
+ "descriptionEn": "Theme"
24307
24534
  },
24308
24535
  {
24309
24536
  "name": "shape",
@@ -24816,7 +25043,7 @@
24816
25043
  {
24817
25044
  "id": "components/input/demo/theme.tsx",
24818
25045
  "title": "主题",
24819
- "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Checkbox, type ShapeType, message, Space, Input, TextArea } from \"react-kui\";\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"theme='outline'\" theme=\"outline\" shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <TextArea placeholder=\"Please input\" rows={3} />\n </Space>\n );\n}"
25046
+ "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Checkbox,\n Input,\n message,\n Space,\n TextArea,\n type ShapeType,\n type ThemeType,\n} from \"react-kui\";\n\n// An input paints all six tiers, and the tier lands on the box itself: `fill` — what it does when nobody\n// writes a theme — plates it, `outline` and `dashed` put a solid or dashed edge on it instead, `plain` leaves\n// it bare, `solid` plates it on the primary and inverts the typed text, the placeholder and the icons, and\n// `underlined` keeps only the bottom rule. A text area and an input with an addon are drawn from the same\n// arms, so they take the same tiers. The addon is the group's own surface: a group that is not `fill` borders\n// the addon it wraps, which is why the second row of each pair reads differently from the first.\nconst tiers: ThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\", \"underlined\"];\n\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <br />\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 4 }}>\n <code>theme: {tier}</code>\n <TextArea theme={tier} rows={2} placeholder=\"Please input\" />\n <Input theme={tier} prefix=\"https://\" placeholder=\"Please input\" />\n </div>\n ))}\n </Space>\n );\n}"
24820
25047
  },
24821
25048
  {
24822
25049
  "id": "components/input/demo/icon.tsx",
@@ -24888,15 +25115,14 @@
24888
25115
  "enumValues": [
24889
25116
  "dashed",
24890
25117
  "solid",
24891
- "default",
24892
25118
  "fill",
24893
25119
  "outline",
24894
25120
  "plain",
24895
25121
  "underlined"
24896
25122
  ],
24897
25123
  "boolean": false,
24898
- "descriptionZh": "主题",
24899
- "descriptionEn": "Theme"
25124
+ "descriptionZh": "文本域主题",
25125
+ "descriptionEn": "Textarea theme"
24900
25126
  },
24901
25127
  {
24902
25128
  "name": "size",
@@ -25293,7 +25519,7 @@
25293
25519
  {
25294
25520
  "id": "components/input/demo/theme.tsx",
25295
25521
  "title": "主题",
25296
- "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Checkbox, type ShapeType, message, Space, Input, TextArea } from \"react-kui\";\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"theme='outline'\" theme=\"outline\" shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <TextArea placeholder=\"Please input\" rows={3} />\n </Space>\n );\n}"
25522
+ "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Checkbox,\n Input,\n message,\n Space,\n TextArea,\n type ShapeType,\n type ThemeType,\n} from \"react-kui\";\n\n// An input paints all six tiers, and the tier lands on the box itself: `fill` — what it does when nobody\n// writes a theme — plates it, `outline` and `dashed` put a solid or dashed edge on it instead, `plain` leaves\n// it bare, `solid` plates it on the primary and inverts the typed text, the placeholder and the icons, and\n// `underlined` keeps only the bottom rule. A text area and an input with an addon are drawn from the same\n// arms, so they take the same tiers. The addon is the group's own surface: a group that is not `fill` borders\n// the addon it wraps, which is why the second row of each pair reads differently from the first.\nconst tiers: ThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\", \"underlined\"];\n\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <br />\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 4 }}>\n <code>theme: {tier}</code>\n <TextArea theme={tier} rows={2} placeholder=\"Please input\" />\n <Input theme={tier} prefix=\"https://\" placeholder=\"Please input\" />\n </div>\n ))}\n </Space>\n );\n}"
25297
25523
  },
25298
25524
  {
25299
25525
  "id": "components/input/demo/icon.tsx",
@@ -25347,15 +25573,14 @@
25347
25573
  "enumValues": [
25348
25574
  "dashed",
25349
25575
  "solid",
25350
- "default",
25351
25576
  "fill",
25352
25577
  "outline",
25353
25578
  "plain",
25354
25579
  "underlined"
25355
25580
  ],
25356
25581
  "boolean": false,
25357
- "descriptionZh": "主题",
25358
- "descriptionEn": "Theme"
25582
+ "descriptionZh": "文本域主题",
25583
+ "descriptionEn": "Textarea theme"
25359
25584
  },
25360
25585
  {
25361
25586
  "name": "shape",
@@ -25806,7 +26031,7 @@
25806
26031
  {
25807
26032
  "id": "components/input/demo/theme.tsx",
25808
26033
  "title": "主题",
25809
- "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Checkbox, type ShapeType, message, Space, Input, TextArea } from \"react-kui\";\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"theme='outline'\" theme=\"outline\" shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <TextArea placeholder=\"Please input\" rows={3} />\n </Space>\n );\n}"
26034
+ "source": "import { Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Checkbox,\n Input,\n message,\n Space,\n TextArea,\n type ShapeType,\n type ThemeType,\n} from \"react-kui\";\n\n// An input paints all six tiers, and the tier lands on the box itself: `fill` — what it does when nobody\n// writes a theme — plates it, `outline` and `dashed` put a solid or dashed edge on it instead, `plain` leaves\n// it bare, `solid` plates it on the primary and inverts the typed text, the placeholder and the icons, and\n// `underlined` keeps only the bottom rule. A text area and an input with an addon are drawn from the same\n// arms, so they take the same tiers. The addon is the group's own surface: a group that is not `fill` borders\n// the addon it wraps, which is why the second row of each pair reads differently from the first.\nconst tiers: ThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\", \"underlined\"];\n\nexport default function App() {\n const [circle, setCircle] = useState(false);\n const shape: ShapeType | undefined = circle ? \"circle\" : undefined;\n const search = (value: string) => {\n message.info(\"This is search event\");\n console.log(value);\n };\n return (\n <Space vertical block>\n <Checkbox checked={circle} label=\"Circle\" onChange={(event) => setCircle(event.checked)} />\n <Input placeholder=\"Please input\" shape={shape} />\n <Input placeholder=\"Disabled\" disabled shape={shape} />\n <Input placeholder=\"Please input\" icon={Search} shape={shape} />\n <Input placeholder=\"Please input\" clearable={false} shape={shape} onSearch={search} />\n <br />\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 4 }}>\n <code>theme: {tier}</code>\n <TextArea theme={tier} rows={2} placeholder=\"Please input\" />\n <Input theme={tier} prefix=\"https://\" placeholder=\"Please input\" />\n </div>\n ))}\n </Space>\n );\n}"
25810
26035
  },
25811
26036
  {
25812
26037
  "id": "components/input/demo/icon.tsx",
@@ -25870,6 +26095,7 @@
25870
26095
  true
25871
26096
  ],
25872
26097
  "boolean": true,
26098
+ "defaultExpression": "false",
25873
26099
  "descriptionZh": "禁用",
25874
26100
  "descriptionEn": "Disabled state"
25875
26101
  },
@@ -25882,6 +26108,7 @@
25882
26108
  true
25883
26109
  ],
25884
26110
  "boolean": true,
26111
+ "defaultExpression": "false",
25885
26112
  "descriptionZh": "只读,允许聚焦和复制但不可修改",
25886
26113
  "descriptionEn": "Read-only while remaining focusable"
25887
26114
  },
@@ -25894,6 +26121,7 @@
25894
26121
  true
25895
26122
  ],
25896
26123
  "boolean": true,
26124
+ "defaultExpression": "true",
25897
26125
  "descriptionZh": "是否显示一键清空按钮",
25898
26126
  "descriptionEn": "Whether to show the clear button"
25899
26127
  },
@@ -25906,6 +26134,7 @@
25906
26134
  true
25907
26135
  ],
25908
26136
  "boolean": true,
26137
+ "defaultExpression": "false",
25909
26138
  "descriptionZh": "是否撑满父容器宽度",
25910
26139
  "descriptionEn": "Fill the parent width"
25911
26140
  },
@@ -25918,6 +26147,7 @@
25918
26147
  true
25919
26148
  ],
25920
26149
  "boolean": true,
26150
+ "defaultExpression": "false",
25921
26151
  "descriptionZh": "允许重复",
25922
26152
  "descriptionEn": "Allow duplicate tags"
25923
26153
  },
@@ -25942,6 +26172,7 @@
25942
26172
  "type": "string[] | undefined",
25943
26173
  "required": false,
25944
26174
  "boolean": false,
26175
+ "defaultExpression": "[\",\"]",
25945
26176
  "descriptionZh": "提交分隔键",
25946
26177
  "descriptionEn": "Commit keys"
25947
26178
  },
@@ -25955,6 +26186,7 @@
25955
26186
  "large"
25956
26187
  ],
25957
26188
  "boolean": false,
26189
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
25958
26190
  "descriptionZh": "尺寸",
25959
26191
  "descriptionEn": "Size"
25960
26192
  },
@@ -25979,7 +26211,6 @@
25979
26211
  "enumValues": [
25980
26212
  "dashed",
25981
26213
  "solid",
25982
- "default",
25983
26214
  "fill",
25984
26215
  "outline",
25985
26216
  "plain",
@@ -26451,7 +26682,7 @@
26451
26682
  {
26452
26683
  "id": "components/input-tag/demo/appearance.tsx",
26453
26684
  "title": "外观与禁用",
26454
- "source": "import { InputTag, Space } from \"react-kui\";\nexport default function App() {\n return (\n <Space vertical>\n <InputTag size=\"small\" theme=\"plain\" value={[\"Plain\"]} />\n <InputTag shape=\"square\" theme=\"outline\" value={[\"Outline\"]} />\n <InputTag size=\"large\" shape=\"circle\" value={[\"Circle\"]} />\n <InputTag disabled value={[\"Disabled\"]} />\n </Space>\n );\n}"
26685
+ "source": "import { InputTag, Space } from \"react-kui\";\nexport default function App() {\n return (\n <Space vertical>\n <InputTag size=\"small\" theme=\"plain\" value={[\"Plain\"]} />\n <InputTag theme=\"dashed\" value={[\"Outline\"]} />\n <InputTag shape=\"square\" theme=\"outline\" value={[\"Outline\"]} />\n <InputTag size=\"large\" shape=\"circle\" value={[\"Circle\"]} />\n <InputTag disabled value={[\"Disabled\"]} />\n </Space>\n );\n}"
26455
26686
  }
26456
26687
  ]
26457
26688
  },
@@ -26473,6 +26704,7 @@
26473
26704
  "type": "number | undefined",
26474
26705
  "required": false,
26475
26706
  "boolean": false,
26707
+ "defaultExpression": "-Infinity",
26476
26708
  "descriptionZh": "最小值",
26477
26709
  "descriptionEn": "Minimum value"
26478
26710
  },
@@ -26481,6 +26713,7 @@
26481
26713
  "type": "number | undefined",
26482
26714
  "required": false,
26483
26715
  "boolean": false,
26716
+ "defaultExpression": "Infinity",
26484
26717
  "descriptionZh": "最大值",
26485
26718
  "descriptionEn": "Maximum value"
26486
26719
  },
@@ -26489,6 +26722,7 @@
26489
26722
  "type": "string | number | undefined",
26490
26723
  "required": false,
26491
26724
  "boolean": false,
26725
+ "defaultExpression": "1",
26492
26726
  "descriptionZh": "每次改变步数,可以为小数",
26493
26727
  "descriptionEn": "Step value for each change, can be a decimal"
26494
26728
  },
@@ -26525,6 +26759,7 @@
26525
26759
  true
26526
26760
  ],
26527
26761
  "boolean": true,
26762
+ "defaultExpression": "false",
26528
26763
  "descriptionZh": "禁用",
26529
26764
  "descriptionEn": "Disabled"
26530
26765
  },
@@ -26537,6 +26772,7 @@
26537
26772
  true
26538
26773
  ],
26539
26774
  "boolean": true,
26775
+ "defaultExpression": "false",
26540
26776
  "descriptionZh": "是否只读",
26541
26777
  "descriptionEn": "Whether the input is read-only"
26542
26778
  },
@@ -26549,6 +26785,7 @@
26549
26785
  true
26550
26786
  ],
26551
26787
  "boolean": true,
26788
+ "defaultExpression": "true",
26552
26789
  "descriptionZh": "是否显示增减按钮",
26553
26790
  "descriptionEn": "Whether to show increase/decrease buttons"
26554
26791
  },
@@ -26561,6 +26798,7 @@
26561
26798
  true
26562
26799
  ],
26563
26800
  "boolean": true,
26801
+ "defaultExpression": "true",
26564
26802
  "descriptionZh": "是否允许通过上下方向键调整数值",
26565
26803
  "descriptionEn": "Whether the value can be adjusted with the up/down arrow keys"
26566
26804
  },
@@ -26580,6 +26818,22 @@
26580
26818
  "descriptionZh": "前缀内容",
26581
26819
  "descriptionEn": "Prefix content"
26582
26820
  },
26821
+ {
26822
+ "name": "addonBefore",
26823
+ "type": "React.ReactNode",
26824
+ "required": false,
26825
+ "boolean": false,
26826
+ "descriptionZh": "输入框外部前置附件",
26827
+ "descriptionEn": "Addon before the input"
26828
+ },
26829
+ {
26830
+ "name": "addonAfter",
26831
+ "type": "React.ReactNode",
26832
+ "required": false,
26833
+ "boolean": false,
26834
+ "descriptionZh": "输入框外部后置附件",
26835
+ "descriptionEn": "Addon after the input"
26836
+ },
26583
26837
  {
26584
26838
  "name": "theme",
26585
26839
  "type": "ThemeType | undefined",
@@ -26587,7 +26841,6 @@
26587
26841
  "enumValues": [
26588
26842
  "dashed",
26589
26843
  "solid",
26590
- "default",
26591
26844
  "fill",
26592
26845
  "outline",
26593
26846
  "plain",
@@ -27022,7 +27275,9 @@
27022
27275
  "formatter",
27023
27276
  "parser",
27024
27277
  "suffix",
27025
- "prefix"
27278
+ "prefix",
27279
+ "addonBefore",
27280
+ "addonAfter"
27026
27281
  ],
27027
27282
  "behavior": {
27028
27283
  "rules": []
@@ -27041,13 +27296,18 @@
27041
27296
  },
27042
27297
  {
27043
27298
  "id": "components/input-number/demo/ffix.tsx",
27044
- "title": "扩展, 前缀和后缀",
27045
- "source": "import { CircleQuestionMark, LogoYen, UserPlus } from \"kui-icons\";\nimport { Button, Divider, Space, Tooltip, InputNumber } from \"react-kui\";\nexport default function App() {\n return (\n <>\n <Space block vertical>\n <InputNumber placeholder=\"Please input amount\" suffix=\"元\" prefix=\"¥\" />\n <InputNumber placeholder=\"Please input amount\" step={50} suffix=\"元\" prefix=\"充值\" />\n <InputNumber placeholder=\"Please input amount\" suffix=\".00\" />\n </Space>\n <Divider text=\"React nodes\" />\n <Space vertical block>\n <InputNumber\n placeholder=\"请填写您的薪资\"\n icon={LogoYen}\n suffix={\n <Tooltip title=\"此处如果不知道怎么填,请咨询管理员\">\n <Button icon={CircleQuestionMark} />\n </Tooltip>\n }\n />\n <InputNumber\n placeholder=\"Please input amount\"\n prefix={<Button icon={UserPlus} />}\n suffix={<Button>Top up</Button>}\n />\n </Space>\n </>\n );\n}"
27299
+ "title": "扩展, 前缀、后缀与附件",
27300
+ "source": "import { CircleQuestionMark, LogoYen, UserPlus } from \"kui-icons\";\nimport { Button, Divider, InputNumber, Space, Tooltip } from \"react-kui\";\nexport default function App() {\n return (\n <>\n <Space block vertical>\n <InputNumber placeholder=\"Please input amount\" suffix=\"元\" prefix=\"¥\" />\n <InputNumber placeholder=\"Please input amount\" step={50} suffix=\"元\" prefix=\"充值\" />\n <InputNumber placeholder=\"Please input amount\" suffix=\".00\" />\n </Space>\n <Divider text=\"Addons\" />\n <Space vertical block>\n <InputNumber placeholder=\"Please input amount\" addonBefore=\"¥\" addonAfter=\"RMB\" />\n <InputNumber placeholder=\"Please input weight\" addonAfter=\"kg\" />\n </Space>\n <Divider text=\"React nodes\" />\n <Space vertical block>\n <InputNumber\n placeholder=\"请填写您的薪资\"\n icon={LogoYen}\n addonAfter={\n <Tooltip title=\"此处如果不知道怎么填,请咨询管理员\">\n <Button icon={CircleQuestionMark} />\n </Tooltip>\n }\n />\n <InputNumber\n placeholder=\"Please input amount\"\n addonBefore={<Button icon={UserPlus} />}\n addonAfter={<Button>Top up</Button>}\n />\n </Space>\n </>\n );\n}"
27046
27301
  },
27047
27302
  {
27048
27303
  "id": "components/input-number/demo/size.tsx",
27049
27304
  "title": "尺寸",
27050
27305
  "source": "import { LogoKui } from \"kui-icons\";\nimport { Space, InputNumber } from \"react-kui\";\nexport default function App() {\n return (\n <Space vertical block>\n <InputNumber placeholder=\"Large Input\" size=\"large\" icon={LogoKui} />\n <InputNumber placeholder=\"Base Input\" icon={LogoKui} />\n <InputNumber size=\"small\" placeholder=\"Small Input\" icon={LogoKui} />\n </Space>\n );\n}"
27306
+ },
27307
+ {
27308
+ "id": "components/input-number/demo/theme.tsx",
27309
+ "title": "外观档位",
27310
+ "source": "import { InputNumber, Space, type ThemeType } from \"react-kui\";\n\n// A number input is a text control, so it paints all six tiers: `fill` — what it does when nobody writes a\n// theme — plates the box, `outline` and `dashed` put a solid or dashed edge on it instead, `plain` leaves it\n// bare, `solid` plates it on the primary and inverts the digits, the placeholder and the steppers, and\n// `underlined` keeps only the bottom rule. The steppers are part of the box, so they follow the tier.\nconst tiers: ThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\", \"underlined\"];\n\nexport default function App() {\n return (\n <Space vertical block style={{ width: 220, maxWidth: \"100%\" }}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 4, justifyItems: \"start\" }}>\n <code>theme: {tier}</code>\n <InputNumber theme={tier} value={42} />\n </div>\n ))}\n </Space>\n );\n}"
27051
27311
  }
27052
27312
  ]
27053
27313
  },
@@ -27069,6 +27329,7 @@
27069
27329
  "type": "number | undefined",
27070
27330
  "required": false,
27071
27331
  "boolean": false,
27332
+ "defaultExpression": "6",
27072
27333
  "descriptionZh": "输入框数量,按非负整数处理",
27073
27334
  "descriptionEn": "Number of inputs, normalized to a non-negative integer"
27074
27335
  },
@@ -27081,6 +27342,7 @@
27081
27342
  "text"
27082
27343
  ],
27083
27344
  "boolean": false,
27345
+ "defaultExpression": "\"number\"",
27084
27346
  "descriptionZh": "字符类型",
27085
27347
  "descriptionEn": "Character type"
27086
27348
  },
@@ -27106,6 +27368,7 @@
27106
27368
  true
27107
27369
  ],
27108
27370
  "boolean": true,
27371
+ "defaultExpression": "false",
27109
27372
  "descriptionZh": "是否禁用",
27110
27373
  "descriptionEn": "Whether disabled"
27111
27374
  },
@@ -27118,6 +27381,7 @@
27118
27381
  true
27119
27382
  ],
27120
27383
  "boolean": true,
27384
+ "defaultExpression": "false",
27121
27385
  "descriptionZh": "是否只读",
27122
27386
  "descriptionEn": "Whether read-only"
27123
27387
  },
@@ -27130,6 +27394,7 @@
27130
27394
  true
27131
27395
  ],
27132
27396
  "boolean": true,
27397
+ "defaultExpression": "false",
27133
27398
  "descriptionZh": "是否隐藏内容",
27134
27399
  "descriptionEn": "Whether to mask the value"
27135
27400
  },
@@ -27142,6 +27407,7 @@
27142
27407
  true
27143
27408
  ],
27144
27409
  "boolean": true,
27410
+ "defaultExpression": "false",
27145
27411
  "descriptionZh": "是否自动聚焦",
27146
27412
  "descriptionEn": "Whether to focus automatically"
27147
27413
  },
@@ -27168,7 +27434,6 @@
27168
27434
  "enumValues": [
27169
27435
  "dashed",
27170
27436
  "solid",
27171
- "default",
27172
27437
  "fill",
27173
27438
  "outline",
27174
27439
  "plain",
@@ -30410,6 +30675,11 @@
30410
30675
  "id": "components/menu/demo/collapsed.tsx",
30411
30676
  "title": "缩起内嵌菜单",
30412
30677
  "source": "import { Heart, Mail, PanelLeftClose, PanelLeftOpen, Settings, Table } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Menu, Switch, type MenuOptionsProps } from \"react-kui\";\nconst items: MenuOptionsProps[] = [\n { title: \"Option 1\", key: \"1-1\", icon: Mail },\n { title: \"Option 2\", key: \"2-1\", icon: Table },\n {\n title: \"Navigation Two\",\n key: \"3-1\",\n icon: Heart,\n children: [\n { title: \"Option 5\", key: \"3-1-1\", icon: Mail },\n { title: \"Option 6\", key: \"3-1-2\", icon: Mail },\n {\n title: \"SubMenu\",\n key: \"3-1-3\",\n icon: Mail,\n children: [\n { title: \"Option 7\", key: \"3-1-3-1\", icon: Mail },\n { title: \"Option 8\", key: \"3-1-3-2\", icon: Mail },\n ],\n },\n ],\n },\n {\n title: \"Navigation Three\",\n key: \"4-1\",\n icon: Settings,\n children: [\n { title: \"Option 9\", key: \"4-1-1\", icon: Mail },\n { title: \"Option 10\", key: \"4-1-2\", icon: Mail },\n { title: \"Option 11\", key: \"4-1-3\", icon: Mail },\n { title: \"Option 12\", key: \"4-1-4\", icon: Mail },\n ],\n },\n];\nexport default function App() {\n const [collapsed, setCollapsed] = useState(false),\n [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"3-1\", \"3-1-3\"]),\n [collapsedTooltip, setCollapsedTooltip] = useState(true);\n return (\n <div style={{ width: 256 }}>\n <Button\n onClick={() => setCollapsed(!collapsed)}\n icon={collapsed ? PanelLeftOpen : PanelLeftClose}\n type=\"primary\"\n />\n <label style={{ display: \"inline-flex\", alignItems: \"center\", gap: 8, marginLeft: 12 }}>\n Tooltip\n <Switch\n checked={collapsedTooltip}\n onChange={(checked) => setCollapsedTooltip(Boolean(checked))}\n />\n </label>\n <br />\n <br />\n <Menu\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n theme=\"dark\"\n inlineCollapsed={collapsed}\n collapsedTooltip={collapsedTooltip}\n mode=\"inline\"\n items={items}\n />\n </div>\n );\n}"
30678
+ },
30679
+ {
30680
+ "id": "components/menu/demo/group.tsx",
30681
+ "title": "分组与分割线",
30682
+ "source": "import { Heart, Mail, Settings } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Menu, MenuDivider, MenuGroup, MenuItem, SubMenu } from \"react-kui\";\n\nexport default function App() {\n const [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"sub1\"]);\n return (\n <div style={{ width: 256 }}>\n <Menu\n mode=\"inline\"\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n >\n <MenuGroup title=\"Application\">\n <MenuItem itemKey=\"1-1\" icon={Mail}>\n Navigation One\n </MenuItem>\n <MenuItem itemKey=\"1-2\" icon={Heart}>\n Navigation Two\n </MenuItem>\n <MenuItem itemKey=\"1-3\" icon={Settings} disabled>\n Navigation Three\n </MenuItem>\n </MenuGroup>\n <MenuDivider />\n <SubMenu itemKey=\"sub1\" title=\"Navigation Four\" icon={Mail}>\n <MenuGroup title=\"Options\">\n <MenuItem itemKey=\"4-1\">Option 1</MenuItem>\n <MenuItem itemKey=\"4-2\">Option 2</MenuItem>\n </MenuGroup>\n <MenuDivider />\n <MenuItem itemKey=\"4-3\">Option 3</MenuItem>\n </SubMenu>\n </Menu>\n </div>\n );\n}"
30413
30683
  }
30414
30684
  ]
30415
30685
  },
@@ -30462,6 +30732,11 @@
30462
30732
  "id": "components/menu/demo/collapsed.tsx",
30463
30733
  "title": "缩起内嵌菜单",
30464
30734
  "source": "import { Heart, Mail, PanelLeftClose, PanelLeftOpen, Settings, Table } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Menu, Switch, type MenuOptionsProps } from \"react-kui\";\nconst items: MenuOptionsProps[] = [\n { title: \"Option 1\", key: \"1-1\", icon: Mail },\n { title: \"Option 2\", key: \"2-1\", icon: Table },\n {\n title: \"Navigation Two\",\n key: \"3-1\",\n icon: Heart,\n children: [\n { title: \"Option 5\", key: \"3-1-1\", icon: Mail },\n { title: \"Option 6\", key: \"3-1-2\", icon: Mail },\n {\n title: \"SubMenu\",\n key: \"3-1-3\",\n icon: Mail,\n children: [\n { title: \"Option 7\", key: \"3-1-3-1\", icon: Mail },\n { title: \"Option 8\", key: \"3-1-3-2\", icon: Mail },\n ],\n },\n ],\n },\n {\n title: \"Navigation Three\",\n key: \"4-1\",\n icon: Settings,\n children: [\n { title: \"Option 9\", key: \"4-1-1\", icon: Mail },\n { title: \"Option 10\", key: \"4-1-2\", icon: Mail },\n { title: \"Option 11\", key: \"4-1-3\", icon: Mail },\n { title: \"Option 12\", key: \"4-1-4\", icon: Mail },\n ],\n },\n];\nexport default function App() {\n const [collapsed, setCollapsed] = useState(false),\n [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"3-1\", \"3-1-3\"]),\n [collapsedTooltip, setCollapsedTooltip] = useState(true);\n return (\n <div style={{ width: 256 }}>\n <Button\n onClick={() => setCollapsed(!collapsed)}\n icon={collapsed ? PanelLeftOpen : PanelLeftClose}\n type=\"primary\"\n />\n <label style={{ display: \"inline-flex\", alignItems: \"center\", gap: 8, marginLeft: 12 }}>\n Tooltip\n <Switch\n checked={collapsedTooltip}\n onChange={(checked) => setCollapsedTooltip(Boolean(checked))}\n />\n </label>\n <br />\n <br />\n <Menu\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n theme=\"dark\"\n inlineCollapsed={collapsed}\n collapsedTooltip={collapsedTooltip}\n mode=\"inline\"\n items={items}\n />\n </div>\n );\n}"
30735
+ },
30736
+ {
30737
+ "id": "components/menu/demo/group.tsx",
30738
+ "title": "分组与分割线",
30739
+ "source": "import { Heart, Mail, Settings } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Menu, MenuDivider, MenuGroup, MenuItem, SubMenu } from \"react-kui\";\n\nexport default function App() {\n const [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"sub1\"]);\n return (\n <div style={{ width: 256 }}>\n <Menu\n mode=\"inline\"\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n >\n <MenuGroup title=\"Application\">\n <MenuItem itemKey=\"1-1\" icon={Mail}>\n Navigation One\n </MenuItem>\n <MenuItem itemKey=\"1-2\" icon={Heart}>\n Navigation Two\n </MenuItem>\n <MenuItem itemKey=\"1-3\" icon={Settings} disabled>\n Navigation Three\n </MenuItem>\n </MenuGroup>\n <MenuDivider />\n <SubMenu itemKey=\"sub1\" title=\"Navigation Four\" icon={Mail}>\n <MenuGroup title=\"Options\">\n <MenuItem itemKey=\"4-1\">Option 1</MenuItem>\n <MenuItem itemKey=\"4-2\">Option 2</MenuItem>\n </MenuGroup>\n <MenuDivider />\n <MenuItem itemKey=\"4-3\">Option 3</MenuItem>\n </SubMenu>\n </Menu>\n </div>\n );\n}"
30465
30740
  }
30466
30741
  ]
30467
30742
  },
@@ -30534,6 +30809,11 @@
30534
30809
  "id": "components/menu/demo/collapsed.tsx",
30535
30810
  "title": "缩起内嵌菜单",
30536
30811
  "source": "import { Heart, Mail, PanelLeftClose, PanelLeftOpen, Settings, Table } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Menu, Switch, type MenuOptionsProps } from \"react-kui\";\nconst items: MenuOptionsProps[] = [\n { title: \"Option 1\", key: \"1-1\", icon: Mail },\n { title: \"Option 2\", key: \"2-1\", icon: Table },\n {\n title: \"Navigation Two\",\n key: \"3-1\",\n icon: Heart,\n children: [\n { title: \"Option 5\", key: \"3-1-1\", icon: Mail },\n { title: \"Option 6\", key: \"3-1-2\", icon: Mail },\n {\n title: \"SubMenu\",\n key: \"3-1-3\",\n icon: Mail,\n children: [\n { title: \"Option 7\", key: \"3-1-3-1\", icon: Mail },\n { title: \"Option 8\", key: \"3-1-3-2\", icon: Mail },\n ],\n },\n ],\n },\n {\n title: \"Navigation Three\",\n key: \"4-1\",\n icon: Settings,\n children: [\n { title: \"Option 9\", key: \"4-1-1\", icon: Mail },\n { title: \"Option 10\", key: \"4-1-2\", icon: Mail },\n { title: \"Option 11\", key: \"4-1-3\", icon: Mail },\n { title: \"Option 12\", key: \"4-1-4\", icon: Mail },\n ],\n },\n];\nexport default function App() {\n const [collapsed, setCollapsed] = useState(false),\n [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"3-1\", \"3-1-3\"]),\n [collapsedTooltip, setCollapsedTooltip] = useState(true);\n return (\n <div style={{ width: 256 }}>\n <Button\n onClick={() => setCollapsed(!collapsed)}\n icon={collapsed ? PanelLeftOpen : PanelLeftClose}\n type=\"primary\"\n />\n <label style={{ display: \"inline-flex\", alignItems: \"center\", gap: 8, marginLeft: 12 }}>\n Tooltip\n <Switch\n checked={collapsedTooltip}\n onChange={(checked) => setCollapsedTooltip(Boolean(checked))}\n />\n </label>\n <br />\n <br />\n <Menu\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n theme=\"dark\"\n inlineCollapsed={collapsed}\n collapsedTooltip={collapsedTooltip}\n mode=\"inline\"\n items={items}\n />\n </div>\n );\n}"
30812
+ },
30813
+ {
30814
+ "id": "components/menu/demo/group.tsx",
30815
+ "title": "分组与分割线",
30816
+ "source": "import { Heart, Mail, Settings } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Menu, MenuDivider, MenuGroup, MenuItem, SubMenu } from \"react-kui\";\n\nexport default function App() {\n const [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"sub1\"]);\n return (\n <div style={{ width: 256 }}>\n <Menu\n mode=\"inline\"\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n >\n <MenuGroup title=\"Application\">\n <MenuItem itemKey=\"1-1\" icon={Mail}>\n Navigation One\n </MenuItem>\n <MenuItem itemKey=\"1-2\" icon={Heart}>\n Navigation Two\n </MenuItem>\n <MenuItem itemKey=\"1-3\" icon={Settings} disabled>\n Navigation Three\n </MenuItem>\n </MenuGroup>\n <MenuDivider />\n <SubMenu itemKey=\"sub1\" title=\"Navigation Four\" icon={Mail}>\n <MenuGroup title=\"Options\">\n <MenuItem itemKey=\"4-1\">Option 1</MenuItem>\n <MenuItem itemKey=\"4-2\">Option 2</MenuItem>\n </MenuGroup>\n <MenuDivider />\n <MenuItem itemKey=\"4-3\">Option 3</MenuItem>\n </SubMenu>\n </Menu>\n </div>\n );\n}"
30537
30817
  }
30538
30818
  ]
30539
30819
  },
@@ -30680,6 +30960,11 @@
30680
30960
  "id": "components/menu/demo/collapsed.tsx",
30681
30961
  "title": "缩起内嵌菜单",
30682
30962
  "source": "import { Heart, Mail, PanelLeftClose, PanelLeftOpen, Settings, Table } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Menu, Switch, type MenuOptionsProps } from \"react-kui\";\nconst items: MenuOptionsProps[] = [\n { title: \"Option 1\", key: \"1-1\", icon: Mail },\n { title: \"Option 2\", key: \"2-1\", icon: Table },\n {\n title: \"Navigation Two\",\n key: \"3-1\",\n icon: Heart,\n children: [\n { title: \"Option 5\", key: \"3-1-1\", icon: Mail },\n { title: \"Option 6\", key: \"3-1-2\", icon: Mail },\n {\n title: \"SubMenu\",\n key: \"3-1-3\",\n icon: Mail,\n children: [\n { title: \"Option 7\", key: \"3-1-3-1\", icon: Mail },\n { title: \"Option 8\", key: \"3-1-3-2\", icon: Mail },\n ],\n },\n ],\n },\n {\n title: \"Navigation Three\",\n key: \"4-1\",\n icon: Settings,\n children: [\n { title: \"Option 9\", key: \"4-1-1\", icon: Mail },\n { title: \"Option 10\", key: \"4-1-2\", icon: Mail },\n { title: \"Option 11\", key: \"4-1-3\", icon: Mail },\n { title: \"Option 12\", key: \"4-1-4\", icon: Mail },\n ],\n },\n];\nexport default function App() {\n const [collapsed, setCollapsed] = useState(false),\n [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"3-1\", \"3-1-3\"]),\n [collapsedTooltip, setCollapsedTooltip] = useState(true);\n return (\n <div style={{ width: 256 }}>\n <Button\n onClick={() => setCollapsed(!collapsed)}\n icon={collapsed ? PanelLeftOpen : PanelLeftClose}\n type=\"primary\"\n />\n <label style={{ display: \"inline-flex\", alignItems: \"center\", gap: 8, marginLeft: 12 }}>\n Tooltip\n <Switch\n checked={collapsedTooltip}\n onChange={(checked) => setCollapsedTooltip(Boolean(checked))}\n />\n </label>\n <br />\n <br />\n <Menu\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n theme=\"dark\"\n inlineCollapsed={collapsed}\n collapsedTooltip={collapsedTooltip}\n mode=\"inline\"\n items={items}\n />\n </div>\n );\n}"
30963
+ },
30964
+ {
30965
+ "id": "components/menu/demo/group.tsx",
30966
+ "title": "分组与分割线",
30967
+ "source": "import { Heart, Mail, Settings } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Menu, MenuDivider, MenuGroup, MenuItem, SubMenu } from \"react-kui\";\n\nexport default function App() {\n const [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"sub1\"]);\n return (\n <div style={{ width: 256 }}>\n <Menu\n mode=\"inline\"\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n >\n <MenuGroup title=\"Application\">\n <MenuItem itemKey=\"1-1\" icon={Mail}>\n Navigation One\n </MenuItem>\n <MenuItem itemKey=\"1-2\" icon={Heart}>\n Navigation Two\n </MenuItem>\n <MenuItem itemKey=\"1-3\" icon={Settings} disabled>\n Navigation Three\n </MenuItem>\n </MenuGroup>\n <MenuDivider />\n <SubMenu itemKey=\"sub1\" title=\"Navigation Four\" icon={Mail}>\n <MenuGroup title=\"Options\">\n <MenuItem itemKey=\"4-1\">Option 1</MenuItem>\n <MenuItem itemKey=\"4-2\">Option 2</MenuItem>\n </MenuGroup>\n <MenuDivider />\n <MenuItem itemKey=\"4-3\">Option 3</MenuItem>\n </SubMenu>\n </Menu>\n </div>\n );\n}"
30683
30968
  }
30684
30969
  ]
30685
30970
  },
@@ -30789,6 +31074,11 @@
30789
31074
  "id": "components/menu/demo/collapsed.tsx",
30790
31075
  "title": "缩起内嵌菜单",
30791
31076
  "source": "import { Heart, Mail, PanelLeftClose, PanelLeftOpen, Settings, Table } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Menu, Switch, type MenuOptionsProps } from \"react-kui\";\nconst items: MenuOptionsProps[] = [\n { title: \"Option 1\", key: \"1-1\", icon: Mail },\n { title: \"Option 2\", key: \"2-1\", icon: Table },\n {\n title: \"Navigation Two\",\n key: \"3-1\",\n icon: Heart,\n children: [\n { title: \"Option 5\", key: \"3-1-1\", icon: Mail },\n { title: \"Option 6\", key: \"3-1-2\", icon: Mail },\n {\n title: \"SubMenu\",\n key: \"3-1-3\",\n icon: Mail,\n children: [\n { title: \"Option 7\", key: \"3-1-3-1\", icon: Mail },\n { title: \"Option 8\", key: \"3-1-3-2\", icon: Mail },\n ],\n },\n ],\n },\n {\n title: \"Navigation Three\",\n key: \"4-1\",\n icon: Settings,\n children: [\n { title: \"Option 9\", key: \"4-1-1\", icon: Mail },\n { title: \"Option 10\", key: \"4-1-2\", icon: Mail },\n { title: \"Option 11\", key: \"4-1-3\", icon: Mail },\n { title: \"Option 12\", key: \"4-1-4\", icon: Mail },\n ],\n },\n];\nexport default function App() {\n const [collapsed, setCollapsed] = useState(false),\n [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"3-1\", \"3-1-3\"]),\n [collapsedTooltip, setCollapsedTooltip] = useState(true);\n return (\n <div style={{ width: 256 }}>\n <Button\n onClick={() => setCollapsed(!collapsed)}\n icon={collapsed ? PanelLeftOpen : PanelLeftClose}\n type=\"primary\"\n />\n <label style={{ display: \"inline-flex\", alignItems: \"center\", gap: 8, marginLeft: 12 }}>\n Tooltip\n <Switch\n checked={collapsedTooltip}\n onChange={(checked) => setCollapsedTooltip(Boolean(checked))}\n />\n </label>\n <br />\n <br />\n <Menu\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n theme=\"dark\"\n inlineCollapsed={collapsed}\n collapsedTooltip={collapsedTooltip}\n mode=\"inline\"\n items={items}\n />\n </div>\n );\n}"
31077
+ },
31078
+ {
31079
+ "id": "components/menu/demo/group.tsx",
31080
+ "title": "分组与分割线",
31081
+ "source": "import { Heart, Mail, Settings } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Menu, MenuDivider, MenuGroup, MenuItem, SubMenu } from \"react-kui\";\n\nexport default function App() {\n const [current, setCurrent] = useState([\"1-1\"]),\n [openKeys, setOpenKeys] = useState([\"sub1\"]);\n return (\n <div style={{ width: 256 }}>\n <Menu\n mode=\"inline\"\n value={current}\n onChange={setCurrent}\n openKeys={openKeys}\n onOpenChange={setOpenKeys}\n >\n <MenuGroup title=\"Application\">\n <MenuItem itemKey=\"1-1\" icon={Mail}>\n Navigation One\n </MenuItem>\n <MenuItem itemKey=\"1-2\" icon={Heart}>\n Navigation Two\n </MenuItem>\n <MenuItem itemKey=\"1-3\" icon={Settings} disabled>\n Navigation Three\n </MenuItem>\n </MenuGroup>\n <MenuDivider />\n <SubMenu itemKey=\"sub1\" title=\"Navigation Four\" icon={Mail}>\n <MenuGroup title=\"Options\">\n <MenuItem itemKey=\"4-1\">Option 1</MenuItem>\n <MenuItem itemKey=\"4-2\">Option 2</MenuItem>\n </MenuGroup>\n <MenuDivider />\n <MenuItem itemKey=\"4-3\">Option 3</MenuItem>\n </SubMenu>\n </Menu>\n </div>\n );\n}"
30792
31082
  }
30793
31083
  ]
30794
31084
  },
@@ -30810,6 +31100,7 @@
30810
31100
  "type": "(string | MentionOption)[] | undefined",
30811
31101
  "required": false,
30812
31102
  "boolean": false,
31103
+ "defaultExpression": "EMPTY_OPTIONS",
30813
31104
  "descriptionZh": "候选项",
30814
31105
  "descriptionEn": "Suggestions"
30815
31106
  },
@@ -30818,6 +31109,7 @@
30818
31109
  "type": "string[] | undefined",
30819
31110
  "required": false,
30820
31111
  "boolean": false,
31112
+ "defaultExpression": "[\"@\"]",
30821
31113
  "descriptionZh": "触发字符",
30822
31114
  "descriptionEn": "Trigger strings"
30823
31115
  },
@@ -30826,6 +31118,7 @@
30826
31118
  "type": "number | undefined",
30827
31119
  "required": false,
30828
31120
  "boolean": false,
31121
+ "defaultExpression": "1",
30829
31122
  "descriptionZh": "文本域行数",
30830
31123
  "descriptionEn": "Textarea rows"
30831
31124
  },
@@ -30842,9 +31135,23 @@
30842
31135
  "bottom-right"
30843
31136
  ],
30844
31137
  "boolean": false,
31138
+ "defaultExpression": "\"bottom-left\"",
30845
31139
  "descriptionZh": "下拉菜单优先位置",
30846
31140
  "descriptionEn": "Preferred dropdown placement"
30847
31141
  },
31142
+ {
31143
+ "name": "destroyOnClose",
31144
+ "type": "boolean | undefined",
31145
+ "required": false,
31146
+ "enumValues": [
31147
+ false,
31148
+ true
31149
+ ],
31150
+ "boolean": true,
31151
+ "defaultExpression": "true",
31152
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
31153
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
31154
+ },
30848
31155
  {
30849
31156
  "name": "size",
30850
31157
  "type": "SizeType | undefined",
@@ -30879,15 +31186,15 @@
30879
31186
  "enumValues": [
30880
31187
  "dashed",
30881
31188
  "solid",
30882
- "default",
30883
31189
  "fill",
30884
31190
  "outline",
30885
31191
  "plain",
30886
31192
  "underlined"
30887
31193
  ],
30888
31194
  "boolean": false,
30889
- "descriptionZh": "主题",
30890
- "descriptionEn": "Theme"
31195
+ "defaultExpression": "themeProp ?? inheritedAppearance.theme ?? \"fill\"",
31196
+ "descriptionZh": "主题,画在内部文本域上,可用档位与 TextArea 一致",
31197
+ "descriptionEn": "Theme, painted on the inner text area; supports the same tiers as TextArea"
30891
31198
  },
30892
31199
  {
30893
31200
  "name": "emptyText",
@@ -30906,6 +31213,7 @@
30906
31213
  true
30907
31214
  ],
30908
31215
  "boolean": true,
31216
+ "defaultExpression": "false",
30909
31217
  "descriptionZh": "是否显示加载状态",
30910
31218
  "descriptionEn": "Whether to show loading"
30911
31219
  },
@@ -30926,6 +31234,7 @@
30926
31234
  true
30927
31235
  ],
30928
31236
  "boolean": true,
31237
+ "defaultExpression": "true",
30929
31238
  "descriptionZh": "是否显示清除按钮",
30930
31239
  "descriptionEn": "Whether to show the clear button"
30931
31240
  },
@@ -31610,8 +31919,8 @@
31610
31919
  "type": "React.ReactNode",
31611
31920
  "required": false,
31612
31921
  "boolean": false,
31613
- "descriptionZh": "对话框标题",
31614
- "descriptionEn": "Dialog title"
31922
+ "descriptionZh": "对话框标题,字符串之外可给任意节点",
31923
+ "descriptionEn": "Dialog title, accepts nodes as well as text"
31615
31924
  },
31616
31925
  {
31617
31926
  "name": "okText",
@@ -31670,8 +31979,8 @@
31670
31979
  ],
31671
31980
  "boolean": true,
31672
31981
  "defaultExpression": "false",
31673
- "descriptionZh": "是否点击遮罩关闭弹窗",
31674
- "descriptionEn": "Whether clicking the mask closes the modal"
31982
+ "descriptionZh": "是否点击遮罩关闭弹窗(只管遮罩,Esc 由 `escKey` 控制)",
31983
+ "descriptionEn": "Whether clicking the mask closes the modal (mask only; Esc is gated by `escKey`)"
31675
31984
  },
31676
31985
  {
31677
31986
  "name": "maximized",
@@ -31744,8 +32053,8 @@
31744
32053
  "required": false,
31745
32054
  "boolean": false,
31746
32055
  "defaultExpression": "true",
31747
- "descriptionZh": "当`footer=false`时不展示底部按钮",
31748
- "descriptionEn": "When `footer=false`, the bottom button is not displayed."
32056
+ "descriptionZh": "当`footer=false`时不展示底部按钮,给节点时用它替换整个底部",
32057
+ "descriptionEn": "When `footer=false` the footer is hidden; pass a node to replace the whole footer."
31749
32058
  },
31750
32059
  {
31751
32060
  "name": "escKey",
@@ -31773,6 +32082,19 @@
31773
32082
  "descriptionZh": "只渲染弹窗面板本身,不包含遮罩、动画与全局事件",
31774
32083
  "descriptionEn": "Render only the modal panel, without mask, animation, or global events"
31775
32084
  },
32085
+ {
32086
+ "name": "destroyOnClose",
32087
+ "type": "boolean | undefined",
32088
+ "required": false,
32089
+ "enumValues": [
32090
+ false,
32091
+ true
32092
+ ],
32093
+ "boolean": true,
32094
+ "defaultExpression": "true",
32095
+ "descriptionZh": "关闭后是否销毁窗口内容。默认销毁(重开时重新挂载);设为 false 可保留窗口内已填写的表单状态,代价是打开过的窗口留一份隐藏 DOM",
32096
+ "descriptionEn": "Whether to destroy dialog content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened dialog"
32097
+ },
31776
32098
  {
31777
32099
  "name": "onClose",
31778
32100
  "type": "(() => void) | undefined",
@@ -31786,8 +32108,8 @@
31786
32108
  "type": "(() => void) | undefined",
31787
32109
  "required": false,
31788
32110
  "boolean": false,
31789
- "descriptionZh": "点击确定的回调",
31790
- "descriptionEn": "Callback when OK is clicked"
32111
+ "descriptionZh": "点击确定的回调;返回 Promise 时关闭时机交给组件:resolve 后关窗,reject 只停 loading 并保持窗口打开",
32112
+ "descriptionEn": "Callback when OK is clicked; returning a Promise hands the closing timing to the component — resolve closes it, reject only stops loading and keeps it open"
31791
32113
  },
31792
32114
  {
31793
32115
  "name": "onCancel",
@@ -31802,8 +32124,8 @@
31802
32124
  "type": "((opened: boolean) => void) | undefined",
31803
32125
  "required": false,
31804
32126
  "boolean": false,
31805
- "descriptionZh": "打开或者窗口关闭的回调",
31806
- "descriptionEn": "Callback for opening or closing a window"
32127
+ "descriptionZh": "窗口关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
32128
+ "descriptionEn": "Fires when the window closes; opening is your own `open` flip, so it is never echoed back"
31807
32129
  },
31808
32130
  {
31809
32131
  "name": "onAfterClose",
@@ -31818,8 +32140,8 @@
31818
32140
  "type": "React.ReactNode",
31819
32141
  "required": false,
31820
32142
  "boolean": false,
31821
- "descriptionZh": "对话框内容",
31822
- "descriptionEn": "Dialog content"
32143
+ "descriptionZh": "对话框内容,字符串之外可给任意节点",
32144
+ "descriptionEn": "Dialog content, accepts nodes as well as text"
31823
32145
  },
31824
32146
  {
31825
32147
  "name": "children",
@@ -31846,8 +32168,8 @@
31846
32168
  "type": "(() => void) | undefined",
31847
32169
  "required": false,
31848
32170
  "boolean": false,
31849
- "descriptionZh": "点击确定的回调",
31850
- "descriptionEn": "Callback when OK is clicked"
32171
+ "descriptionZh": "点击确定的回调;返回 Promise 时关闭时机交给组件:resolve 后关窗,reject 只停 loading 并保持窗口打开",
32172
+ "descriptionEn": "Callback when OK is clicked; returning a Promise hands the closing timing to the component — resolve closes it, reject only stops loading and keeps it open"
31851
32173
  },
31852
32174
  {
31853
32175
  "name": "onCancel",
@@ -31862,8 +32184,8 @@
31862
32184
  "type": "((opened: boolean) => void) | undefined",
31863
32185
  "required": false,
31864
32186
  "boolean": false,
31865
- "descriptionZh": "打开或者窗口关闭的回调",
31866
- "descriptionEn": "Callback for opening or closing a window"
32187
+ "descriptionZh": "窗口关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
32188
+ "descriptionEn": "Fires when the window closes; opening is your own `open` flip, so it is never echoed back"
31867
32189
  },
31868
32190
  {
31869
32191
  "name": "onAfterClose",
@@ -31892,17 +32214,17 @@
31892
32214
  {
31893
32215
  "id": "components/modal/demo/basic.tsx",
31894
32216
  "title": "基本用法",
31895
- "source": "import { useState } from \"react\";\nimport { Button, Space, Modal } from \"react-kui\";\n\nexport default function App() {\n const [visible, setVisible] = useState(false);\n const [overlayVisible, setOverlayVisible] = useState(false);\n return (\n <Space vertical>\n <Button onClick={() => setVisible(true)} type=\"primary\">\n Open\n </Button>\n <Button onClick={() => setOverlayVisible(true)} type=\"primary\">\n Click the overlay to close\n </Button>\n <Modal\n title=\"Basic Modal\"\n open={visible}\n onClose={() => setVisible(false)}\n onCancel={() => setVisible(false)}\n onOk={() => setVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n <Modal\n title=\"Basic Modal\"\n open={overlayVisible}\n maskClosable\n onClose={() => setOverlayVisible(false)}\n onCancel={() => setOverlayVisible(false)}\n onOk={() => setOverlayVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n </Space>\n );\n}"
32217
+ "source": "import { useState } from \"react\";\nimport { Button, Modal, Space } from \"react-kui\";\n\nexport default function App() {\n const [visible, setVisible] = useState(false);\n const [overlayVisible, setOverlayVisible] = useState(false);\n return (\n <Space vertical>\n <Button onClick={() => setVisible(true)} type=\"primary\">\n Open\n </Button>\n <Button onClick={() => setOverlayVisible(true)} type=\"primary\">\n Click the overlay to close\n </Button>\n <Modal\n title=\"Basic Modal\"\n open={visible}\n onOpenChange={setVisible}\n onOk={() => setVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n <Modal\n title=\"Basic Modal\"\n open={overlayVisible}\n maskClosable\n onOpenChange={setOverlayVisible}\n onOk={() => setOverlayVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n </Space>\n );\n}"
31896
32218
  },
31897
32219
  {
31898
32220
  "id": "components/modal/demo/custom.tsx",
31899
32221
  "title": "自定义",
31900
- "source": "import { Save } from \"kui-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Button, Input, Space, Modal } from \"react-kui\";\n\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const [loading, setLoading] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const close = () => {\n setOpen(null);\n setLoading(false);\n if (timer.current) clearTimeout(timer.current);\n };\n const submit = () => {\n setLoading(true);\n timer.current = setTimeout(() => {\n setLoading(false);\n setOpen(null);\n }, 2000);\n };\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n []\n );\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Width: 300px\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n Width: 50%\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n Width: calc(100% - 800px)\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Custom footer\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Internationalization\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Asynchronous shutdown\n </Button>\n <Modal\n title=\"Width 300px\"\n open={open === 1}\n width={300}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Width 50%\"\n open={open === 5}\n width=\"50%\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"calc(100% - 800px)\"\n open={open === 6}\n width=\"calc(100% - 800px)\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Custom footer\"\n open={open === 2}\n onClose={close}\n footer={\n <Button icon={Save} onClick={close} type=\"primary\">\n Save\n </Button>\n }\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Are you ok ?\"\n open={open === 3}\n okText=\"Ok\"\n cancelText=\"Cancel\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>Yes, I'm fine!</p>\n </Modal>\n <Modal\n title=\"Submit forms\"\n open={open === 4}\n loading={loading}\n onClose={close}\n onCancel={close}\n onOk={submit}\n >\n <p>\n Name: <Input placeholder=\"Please input your name\" style={{ width: 200 }} />\n </p>\n </Modal>\n </Space>\n );\n}"
32222
+ "source": "import { Save } from \"kui-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Button, Input, Modal, Space } from \"react-kui\";\n\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const [loading, setLoading] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const close = () => {\n setOpen(null);\n setLoading(false);\n };\n const submit = () => {\n setLoading(true);\n timer.current = setTimeout(() => {\n setLoading(false);\n setOpen(null);\n }, 2000);\n };\n const openChange = (id: number) => (next: boolean) => (next ? setOpen(id) : close());\n // 组件卸载时把还没跑完的异步保存停掉。\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Width: 300px\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n Width: 50%\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n Width: calc(100% - 800px)\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Custom footer\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Internationalization\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Asynchronous shutdown\n </Button>\n <Modal\n title=\"Width 300px\"\n open={open === 1}\n width={300}\n onOpenChange={openChange(1)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Width 50%\"\n open={open === 5}\n width=\"50%\"\n onOpenChange={openChange(5)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"calc(100% - 800px)\"\n open={open === 6}\n width=\"calc(100% - 800px)\"\n onOpenChange={openChange(6)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Custom footer\"\n open={open === 2}\n onOpenChange={openChange(2)}\n footer={\n <Button icon={Save} onClick={close} type=\"primary\">\n Save\n </Button>\n }\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Are you ok ?\"\n open={open === 3}\n okText=\"Ok\"\n cancelText=\"Cancel\"\n onOpenChange={openChange(3)}\n onOk={close}\n >\n <p>Yes, I'm fine!</p>\n </Modal>\n <Modal\n title=\"Submit forms\"\n open={open === 4}\n loading={loading}\n onOpenChange={openChange(4)}\n onOk={submit}\n >\n <p>\n Name: <Input placeholder=\"Please input your name\" style={{ width: 200 }} />\n </p>\n </Modal>\n </Space>\n );\n}"
31901
32223
  },
31902
32224
  {
31903
32225
  "id": "components/modal/demo/more.tsx",
31904
32226
  "title": "其它属性",
31905
- "source": "import { useState } from \"react\";\nimport { Button, Space, Modal } from \"react-kui\";\n\nconst text = `A long time ago, In a beautiful kingdom,\nthere lived a young king and queen,\nthe people loved them so much;`;\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const close = () => setOpen(null);\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Draggable\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Center-aligned\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Top 200px\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Maximize\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n No overlay\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n No footer\n </Button>\n <Modal\n title=\"Draggable\"\n open={open === 1}\n width=\"50%\"\n draggable\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Centered\"\n open={open === 2}\n centered\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Top 200px\"\n open={open === 3}\n top={200}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Maximized\"\n open={open === 4}\n maximized\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Click mask dont't be close\"\n open={open === 5}\n mask={false}\n maskClosable={false}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"No footer\"\n open={open === 6}\n footer={false}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n </Space>\n );\n}"
32227
+ "source": "import { useState } from \"react\";\nimport { Button, Modal, Space } from \"react-kui\";\n\nconst text = `A long time ago, In a beautiful kingdom,\nthere lived a young king and queen,\nthe people loved them so much;`;\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const close = () => setOpen(null);\n const openChange = (id: number) => (next: boolean) => setOpen(next ? id : null);\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Draggable\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Center-aligned\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Top 200px\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Maximize\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n No overlay\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n No footer\n </Button>\n <Modal\n title=\"Draggable\"\n open={open === 1}\n width=\"50%\"\n draggable\n onOpenChange={openChange(1)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal title=\"Centered\" open={open === 2} centered onOpenChange={openChange(2)} onOk={close}>\n {text}\n </Modal>\n <Modal\n title=\"Top 200px\"\n open={open === 3}\n top={200}\n onOpenChange={openChange(3)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Maximized\"\n open={open === 4}\n maximized\n onOpenChange={openChange(4)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Click mask dont't be close\"\n open={open === 5}\n mask={false}\n maskClosable={false}\n onOpenChange={openChange(5)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"No footer\"\n open={open === 6}\n footer={false}\n onOpenChange={openChange(6)}\n onOk={close}\n >\n {text}\n </Modal>\n </Space>\n );\n}"
31906
32228
  },
31907
32229
  {
31908
32230
  "id": "components/modal/demo/global.tsx",
@@ -31934,16 +32256,16 @@
31934
32256
  "type": "React.ReactNode",
31935
32257
  "required": false,
31936
32258
  "boolean": false,
31937
- "descriptionZh": "对话框标题",
31938
- "descriptionEn": "Dialog title"
32259
+ "descriptionZh": "对话框标题,字符串之外可给任意节点",
32260
+ "descriptionEn": "Dialog title, accepts nodes as well as text"
31939
32261
  },
31940
32262
  {
31941
32263
  "name": "content",
31942
32264
  "type": "React.ReactNode",
31943
32265
  "required": false,
31944
32266
  "boolean": false,
31945
- "descriptionZh": "对话框内容",
31946
- "descriptionEn": "Dialog content"
32267
+ "descriptionZh": "对话框内容,字符串之外可给任意节点",
32268
+ "descriptionEn": "Dialog content, accepts nodes as well as text"
31947
32269
  },
31948
32270
  {
31949
32271
  "name": "children",
@@ -31953,13 +32275,25 @@
31953
32275
  "descriptionZh": "独立面板的标准正文;真值 content 会替换整个标准内容区。",
31954
32276
  "descriptionEn": "Standard body of the standalone panel; truthy content replaces the entire standard content region."
31955
32277
  },
32278
+ {
32279
+ "name": "destroyOnClose",
32280
+ "type": "boolean | undefined",
32281
+ "required": false,
32282
+ "enumValues": [
32283
+ false,
32284
+ true
32285
+ ],
32286
+ "boolean": true,
32287
+ "descriptionZh": "关闭后是否销毁窗口内容。默认销毁(重开时重新挂载);设为 false 可保留窗口内已填写的表单状态,代价是打开过的窗口留一份隐藏 DOM",
32288
+ "descriptionEn": "Whether to destroy dialog content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened dialog"
32289
+ },
31956
32290
  {
31957
32291
  "name": "onOpenChange",
31958
32292
  "type": "((opened: boolean) => void) | undefined",
31959
32293
  "required": false,
31960
32294
  "boolean": false,
31961
- "descriptionZh": "打开或者窗口关闭的回调",
31962
- "descriptionEn": "Callback for opening or closing a window"
32295
+ "descriptionZh": "窗口关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
32296
+ "descriptionEn": "Fires when the window closes; opening is your own `open` flip, so it is never echoed back"
31963
32297
  },
31964
32298
  {
31965
32299
  "name": "onAfterClose",
@@ -31994,8 +32328,8 @@
31994
32328
  "type": "React.ReactNode",
31995
32329
  "required": false,
31996
32330
  "boolean": false,
31997
- "descriptionZh": "当`footer=false`时不展示底部按钮",
31998
- "descriptionEn": "When `footer=false`, the bottom button is not displayed."
32331
+ "descriptionZh": "当`footer=false`时不展示底部按钮,给节点时用它替换整个底部",
32332
+ "descriptionEn": "When `footer=false` the footer is hidden; pass a node to replace the whole footer."
31999
32333
  },
32000
32334
  {
32001
32335
  "name": "width",
@@ -32070,8 +32404,8 @@
32070
32404
  "type": "(() => void) | undefined",
32071
32405
  "required": false,
32072
32406
  "boolean": false,
32073
- "descriptionZh": "点击确定的回调",
32074
- "descriptionEn": "Callback when OK is clicked"
32407
+ "descriptionZh": "点击确定的回调;返回 Promise 时关闭时机交给组件:resolve 后关窗,reject 只停 loading 并保持窗口打开",
32408
+ "descriptionEn": "Callback when OK is clicked; returning a Promise hands the closing timing to the component — resolve closes it, reject only stops loading and keeps it open"
32075
32409
  },
32076
32410
  {
32077
32411
  "name": "onCancel",
@@ -32090,8 +32424,8 @@
32090
32424
  "type": "((opened: boolean) => void) | undefined",
32091
32425
  "required": false,
32092
32426
  "boolean": false,
32093
- "descriptionZh": "打开或者窗口关闭的回调",
32094
- "descriptionEn": "Callback for opening or closing a window"
32427
+ "descriptionZh": "窗口关闭时的回调;打开是调用方自己翻 `open`,不会再回传一次",
32428
+ "descriptionEn": "Fires when the window closes; opening is your own `open` flip, so it is never echoed back"
32095
32429
  },
32096
32430
  {
32097
32431
  "name": "onAfterClose",
@@ -32114,8 +32448,8 @@
32114
32448
  "type": "(() => void) | undefined",
32115
32449
  "required": false,
32116
32450
  "boolean": false,
32117
- "descriptionZh": "点击确定的回调",
32118
- "descriptionEn": "Callback when OK is clicked"
32451
+ "descriptionZh": "点击确定的回调;返回 Promise 时关闭时机交给组件:resolve 后关窗,reject 只停 loading 并保持窗口打开",
32452
+ "descriptionEn": "Callback when OK is clicked; returning a Promise hands the closing timing to the component — resolve closes it, reject only stops loading and keeps it open"
32119
32453
  },
32120
32454
  {
32121
32455
  "name": "onCancel",
@@ -32140,17 +32474,17 @@
32140
32474
  {
32141
32475
  "id": "components/modal/demo/basic.tsx",
32142
32476
  "title": "基本用法",
32143
- "source": "import { useState } from \"react\";\nimport { Button, Space, Modal } from \"react-kui\";\n\nexport default function App() {\n const [visible, setVisible] = useState(false);\n const [overlayVisible, setOverlayVisible] = useState(false);\n return (\n <Space vertical>\n <Button onClick={() => setVisible(true)} type=\"primary\">\n Open\n </Button>\n <Button onClick={() => setOverlayVisible(true)} type=\"primary\">\n Click the overlay to close\n </Button>\n <Modal\n title=\"Basic Modal\"\n open={visible}\n onClose={() => setVisible(false)}\n onCancel={() => setVisible(false)}\n onOk={() => setVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n <Modal\n title=\"Basic Modal\"\n open={overlayVisible}\n maskClosable\n onClose={() => setOverlayVisible(false)}\n onCancel={() => setOverlayVisible(false)}\n onOk={() => setOverlayVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n </Space>\n );\n}"
32477
+ "source": "import { useState } from \"react\";\nimport { Button, Modal, Space } from \"react-kui\";\n\nexport default function App() {\n const [visible, setVisible] = useState(false);\n const [overlayVisible, setOverlayVisible] = useState(false);\n return (\n <Space vertical>\n <Button onClick={() => setVisible(true)} type=\"primary\">\n Open\n </Button>\n <Button onClick={() => setOverlayVisible(true)} type=\"primary\">\n Click the overlay to close\n </Button>\n <Modal\n title=\"Basic Modal\"\n open={visible}\n onOpenChange={setVisible}\n onOk={() => setVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n <Modal\n title=\"Basic Modal\"\n open={overlayVisible}\n maskClosable\n onOpenChange={setOverlayVisible}\n onOk={() => setOverlayVisible(false)}\n >\n <p>This is the content of a basic modal.</p>\n <p>More content...</p>\n </Modal>\n </Space>\n );\n}"
32144
32478
  },
32145
32479
  {
32146
32480
  "id": "components/modal/demo/custom.tsx",
32147
32481
  "title": "自定义",
32148
- "source": "import { Save } from \"kui-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Button, Input, Space, Modal } from \"react-kui\";\n\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const [loading, setLoading] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const close = () => {\n setOpen(null);\n setLoading(false);\n if (timer.current) clearTimeout(timer.current);\n };\n const submit = () => {\n setLoading(true);\n timer.current = setTimeout(() => {\n setLoading(false);\n setOpen(null);\n }, 2000);\n };\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n []\n );\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Width: 300px\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n Width: 50%\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n Width: calc(100% - 800px)\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Custom footer\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Internationalization\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Asynchronous shutdown\n </Button>\n <Modal\n title=\"Width 300px\"\n open={open === 1}\n width={300}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Width 50%\"\n open={open === 5}\n width=\"50%\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"calc(100% - 800px)\"\n open={open === 6}\n width=\"calc(100% - 800px)\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Custom footer\"\n open={open === 2}\n onClose={close}\n footer={\n <Button icon={Save} onClick={close} type=\"primary\">\n Save\n </Button>\n }\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Are you ok ?\"\n open={open === 3}\n okText=\"Ok\"\n cancelText=\"Cancel\"\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n <p>Yes, I'm fine!</p>\n </Modal>\n <Modal\n title=\"Submit forms\"\n open={open === 4}\n loading={loading}\n onClose={close}\n onCancel={close}\n onOk={submit}\n >\n <p>\n Name: <Input placeholder=\"Please input your name\" style={{ width: 200 }} />\n </p>\n </Modal>\n </Space>\n );\n}"
32482
+ "source": "import { Save } from \"kui-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Button, Input, Modal, Space } from \"react-kui\";\n\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const [loading, setLoading] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const close = () => {\n setOpen(null);\n setLoading(false);\n };\n const submit = () => {\n setLoading(true);\n timer.current = setTimeout(() => {\n setLoading(false);\n setOpen(null);\n }, 2000);\n };\n const openChange = (id: number) => (next: boolean) => (next ? setOpen(id) : close());\n // 组件卸载时把还没跑完的异步保存停掉。\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Width: 300px\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n Width: 50%\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n Width: calc(100% - 800px)\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Custom footer\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Internationalization\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Asynchronous shutdown\n </Button>\n <Modal\n title=\"Width 300px\"\n open={open === 1}\n width={300}\n onOpenChange={openChange(1)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Width 50%\"\n open={open === 5}\n width=\"50%\"\n onOpenChange={openChange(5)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"calc(100% - 800px)\"\n open={open === 6}\n width=\"calc(100% - 800px)\"\n onOpenChange={openChange(6)}\n onOk={close}\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Custom footer\"\n open={open === 2}\n onOpenChange={openChange(2)}\n footer={\n <Button icon={Save} onClick={close} type=\"primary\">\n Save\n </Button>\n }\n >\n <p>content</p>\n </Modal>\n <Modal\n title=\"Are you ok ?\"\n open={open === 3}\n okText=\"Ok\"\n cancelText=\"Cancel\"\n onOpenChange={openChange(3)}\n onOk={close}\n >\n <p>Yes, I'm fine!</p>\n </Modal>\n <Modal\n title=\"Submit forms\"\n open={open === 4}\n loading={loading}\n onOpenChange={openChange(4)}\n onOk={submit}\n >\n <p>\n Name: <Input placeholder=\"Please input your name\" style={{ width: 200 }} />\n </p>\n </Modal>\n </Space>\n );\n}"
32149
32483
  },
32150
32484
  {
32151
32485
  "id": "components/modal/demo/more.tsx",
32152
32486
  "title": "其它属性",
32153
- "source": "import { useState } from \"react\";\nimport { Button, Space, Modal } from \"react-kui\";\n\nconst text = `A long time ago, In a beautiful kingdom,\nthere lived a young king and queen,\nthe people loved them so much;`;\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const close = () => setOpen(null);\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Draggable\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Center-aligned\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Top 200px\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Maximize\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n No overlay\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n No footer\n </Button>\n <Modal\n title=\"Draggable\"\n open={open === 1}\n width=\"50%\"\n draggable\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Centered\"\n open={open === 2}\n centered\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Top 200px\"\n open={open === 3}\n top={200}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Maximized\"\n open={open === 4}\n maximized\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Click mask dont't be close\"\n open={open === 5}\n mask={false}\n maskClosable={false}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"No footer\"\n open={open === 6}\n footer={false}\n onClose={close}\n onCancel={close}\n onOk={close}\n >\n {text}\n </Modal>\n </Space>\n );\n}"
32487
+ "source": "import { useState } from \"react\";\nimport { Button, Modal, Space } from \"react-kui\";\n\nconst text = `A long time ago, In a beautiful kingdom,\nthere lived a young king and queen,\nthe people loved them so much;`;\nexport default function App() {\n const [open, setOpen] = useState<number | null>(null);\n const close = () => setOpen(null);\n const openChange = (id: number) => (next: boolean) => setOpen(next ? id : null);\n return (\n <Space vertical>\n <Button onClick={() => setOpen(1)} type=\"primary\">\n Draggable\n </Button>\n <Button onClick={() => setOpen(2)} type=\"primary\">\n Center-aligned\n </Button>\n <Button onClick={() => setOpen(3)} type=\"primary\">\n Top 200px\n </Button>\n <Button onClick={() => setOpen(4)} type=\"primary\">\n Maximize\n </Button>\n <Button onClick={() => setOpen(5)} type=\"primary\">\n No overlay\n </Button>\n <Button onClick={() => setOpen(6)} type=\"primary\">\n No footer\n </Button>\n <Modal\n title=\"Draggable\"\n open={open === 1}\n width=\"50%\"\n draggable\n onOpenChange={openChange(1)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal title=\"Centered\" open={open === 2} centered onOpenChange={openChange(2)} onOk={close}>\n {text}\n </Modal>\n <Modal\n title=\"Top 200px\"\n open={open === 3}\n top={200}\n onOpenChange={openChange(3)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Maximized\"\n open={open === 4}\n maximized\n onOpenChange={openChange(4)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"Click mask dont't be close\"\n open={open === 5}\n mask={false}\n maskClosable={false}\n onOpenChange={openChange(5)}\n onOk={close}\n >\n {text}\n </Modal>\n <Modal\n title=\"No footer\"\n open={open === 6}\n footer={false}\n onOpenChange={openChange(6)}\n onOk={close}\n >\n {text}\n </Modal>\n </Space>\n );\n}"
32154
32488
  },
32155
32489
  {
32156
32490
  "id": "components/modal/demo/global.tsx",
@@ -32386,20 +32720,19 @@
32386
32720
  },
32387
32721
  {
32388
32722
  "name": "theme",
32389
- "type": "ThemeType | undefined",
32723
+ "type": "SurfaceThemeType | undefined",
32390
32724
  "required": false,
32391
32725
  "enumValues": [
32392
32726
  "dashed",
32393
32727
  "solid",
32394
- "default",
32395
32728
  "fill",
32396
32729
  "outline",
32397
- "plain",
32398
- "underlined"
32730
+ "plain"
32399
32731
  ],
32400
32732
  "boolean": false,
32401
- "descriptionZh": "主题",
32402
- "descriptionEn": "Theme"
32733
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
32734
+ "descriptionZh": "外观主题",
32735
+ "descriptionEn": "Surface theme"
32403
32736
  },
32404
32737
  {
32405
32738
  "name": "shape",
@@ -32412,6 +32745,7 @@
32412
32745
  "circle"
32413
32746
  ],
32414
32747
  "boolean": false,
32748
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
32415
32749
  "descriptionZh": "分页器形状",
32416
32750
  "descriptionEn": "Pagination shape"
32417
32751
  },
@@ -32876,6 +33210,11 @@
32876
33210
  "id": "components/page/demo/responsive.tsx",
32877
33211
  "title": "自适应分页",
32878
33212
  "source": "import { Page } from \"react-kui\";\n\nexport default function App() {\n return (\n <div\n style={{\n width: 720,\n maxWidth: \"100%\",\n minWidth: 180,\n resize: \"horizontal\",\n overflow: \"auto\",\n padding: 16,\n boxSizing: \"border-box\",\n border: \"1px solid var(--kui-color-border)\",\n }}\n >\n <Page total={10000} page={50} showSizer showElevator />\n </div>\n );\n}"
33213
+ },
33214
+ {
33215
+ "id": "components/page/demo/appearance.tsx",
33216
+ "title": "外观",
33217
+ "source": "import { Page, type SurfaceThemeType } from \"react-kui\";\n\n// The tier lands on the page-number cells, not on the bar around them: `fill` — the pager's own look — gives\n// each cell a pale plate, `outline` and `dashed` edge them instead, `plain` leaves them bare, and `solid`\n// plates them on the primary and inverts the digits and the ellipsis. The current page flips to a white cell\n// with primary digits under `solid`, and the total line plus the previous/next arrows keep the bar's own\n// background in every tier — they are not cells.\nconst tiers: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <div style={{ display: \"grid\", gap: 12 }}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 6, justifyItems: \"start\" }}>\n <code>theme: {tier}</code>\n <Page page={2} pageSize={10} total={80} theme={tier} showTotal={false} />\n </div>\n ))}\n </div>\n );\n}"
32879
33218
  }
32880
33219
  ]
32881
33220
  },
@@ -33426,6 +33765,19 @@
33426
33765
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
33427
33766
  "descriptionEn": "Position where the tooltip appears"
33428
33767
  },
33768
+ {
33769
+ "name": "destroyOnClose",
33770
+ "type": "boolean | undefined",
33771
+ "required": false,
33772
+ "enumValues": [
33773
+ false,
33774
+ true
33775
+ ],
33776
+ "boolean": true,
33777
+ "defaultExpression": "true",
33778
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
33779
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
33780
+ },
33429
33781
  {
33430
33782
  "name": "panelOnly",
33431
33783
  "type": "boolean | undefined",
@@ -33588,6 +33940,18 @@
33588
33940
  "descriptionZh": "触发方式,可选值为 `hover`(悬停)`click`(点击)",
33589
33941
  "descriptionEn": "Trigger method, optional values: `hover` (hover) `click` (click)"
33590
33942
  },
33943
+ {
33944
+ "name": "destroyOnClose",
33945
+ "type": "boolean | undefined",
33946
+ "required": false,
33947
+ "enumValues": [
33948
+ false,
33949
+ true
33950
+ ],
33951
+ "boolean": true,
33952
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
33953
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
33954
+ },
33591
33955
  {
33592
33956
  "name": "onOpenChange",
33593
33957
  "type": "((open: boolean) => void) | undefined",
@@ -33801,6 +34165,19 @@
33801
34165
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
33802
34166
  "descriptionEn": "Position where the tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
33803
34167
  },
34168
+ {
34169
+ "name": "destroyOnClose",
34170
+ "type": "boolean | undefined",
34171
+ "required": false,
34172
+ "enumValues": [
34173
+ false,
34174
+ true
34175
+ ],
34176
+ "boolean": true,
34177
+ "defaultExpression": "true",
34178
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
34179
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
34180
+ },
33804
34181
  {
33805
34182
  "name": "panelOnly",
33806
34183
  "type": "boolean | undefined",
@@ -33952,6 +34329,18 @@
33952
34329
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
33953
34330
  "descriptionEn": "Position where the tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
33954
34331
  },
34332
+ {
34333
+ "name": "destroyOnClose",
34334
+ "type": "boolean | undefined",
34335
+ "required": false,
34336
+ "enumValues": [
34337
+ false,
34338
+ true
34339
+ ],
34340
+ "boolean": true,
34341
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
34342
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
34343
+ },
33955
34344
  {
33956
34345
  "name": "onOpenChange",
33957
34346
  "type": "((open: boolean) => void) | undefined",
@@ -34817,8 +35206,8 @@
34817
35206
  ],
34818
35207
  "boolean": true,
34819
35208
  "defaultExpression": "true",
34820
- "descriptionZh": "是否保留外边框和内边距容器。",
34821
- "descriptionEn": "Whether to keep the outer border and padding container."
35209
+ "descriptionZh": "是否保留外边框和它托住的 12px 内边距。只想去掉表面(不留底色、边框透明)请写 `theme=\"plain\"`,内边距会保留。",
35210
+ "descriptionEn": "Whether to keep the outer frame and the 12px padding it holds. To only drop the surface — no plate, a transparent frame — write `theme=\"plain\"` instead, which keeps the padding."
34822
35211
  },
34823
35212
  {
34824
35213
  "name": "shape",
@@ -34831,25 +35220,25 @@
34831
35220
  "circle"
34832
35221
  ],
34833
35222
  "boolean": false,
35223
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
34834
35224
  "descriptionZh": "二维码形状",
34835
35225
  "descriptionEn": "Shape of the QR code"
34836
35226
  },
34837
35227
  {
34838
35228
  "name": "theme",
34839
- "type": "ThemeType | undefined",
35229
+ "type": "SurfaceThemeType | undefined",
34840
35230
  "required": false,
34841
35231
  "enumValues": [
34842
35232
  "dashed",
34843
35233
  "solid",
34844
- "default",
34845
35234
  "fill",
34846
35235
  "outline",
34847
- "plain",
34848
- "underlined"
35236
+ "plain"
34849
35237
  ],
34850
35238
  "boolean": false,
34851
- "descriptionZh": "二维码主题",
34852
- "descriptionEn": "Theme of the QR code"
35239
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"outline\"",
35240
+ "descriptionZh": "外观主题",
35241
+ "descriptionEn": "Appearance theme"
34853
35242
  },
34854
35243
  {
34855
35244
  "name": "status",
@@ -35369,6 +35758,11 @@
35369
35758
  "id": "components/qrcode/demo/custom-status.tsx",
35370
35759
  "title": "自定义状态",
35371
35760
  "source": "import { CircleCheck } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Icon, Space, Spin, QRCode, type QRCodeStatus } from \"react-kui\";\nexport default function App() {\n const [url, setUrl] = useState(\"https://react.k-ui.cn\"),\n [status, setStatus] = useState<QRCodeStatus>(\"expired\");\n const refresh = () => {\n setStatus(\"loading\");\n setTimeout(() => {\n setUrl(\"https://xxx.com/pay\");\n setStatus(\"active\");\n }, 1000);\n };\n return (\n <Space wrap>\n <QRCode value={url} size={100} />\n <QRCode\n value={url}\n status=\"loading\"\n size={100}\n loadingContent={\n <>\n <Spin mode=\"bounce\" />\n <p>疯狂加载中...</p>\n </>\n }\n />\n <QRCode\n value={url}\n status={status}\n size={100}\n expiredContent={\n <Button type=\"primary\" onClick={refresh} size=\"small\">\n 刷新二维码\n </Button>\n }\n />\n <QRCode\n value={url}\n status=\"scanned\"\n size={100}\n scannedContent={\n <>\n <Icon type={CircleCheck} color=\"green\" size={30} />\n <div>支付成功</div>\n </>\n }\n />\n </Space>\n );\n}"
35761
+ },
35762
+ {
35763
+ "id": "components/qrcode/demo/appearance.tsx",
35764
+ "title": "外观",
35765
+ "source": "import { QRCode, Space, type SurfaceThemeType } from \"react-kui\";\n\n// A code is a frame around a canvas, so its tiers read the same way an image's do, and its own look is\n// `outline` — the ring it draws when nobody writes a theme. The modules inside stay the same ink in every\n// tier; only the frame around them changes.\nconst tiers: SurfaceThemeType[] = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Space wrap size={16}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 8, justifyItems: \"center\" }}>\n <QRCode value=\"https://react.k-ui.cn\" size={104} theme={tier} />\n <code>theme: {tier}</code>\n </div>\n ))}\n </Space>\n );\n}"
35372
35766
  }
35373
35767
  ]
35374
35768
  },
@@ -35407,20 +35801,16 @@
35407
35801
  },
35408
35802
  {
35409
35803
  "name": "theme",
35410
- "type": "ThemeType | undefined",
35804
+ "type": "MarkThemeType | undefined",
35411
35805
  "required": false,
35412
35806
  "enumValues": [
35413
- "dashed",
35414
- "solid",
35415
- "default",
35416
35807
  "fill",
35417
- "outline",
35418
- "plain",
35419
- "underlined"
35808
+ "outline"
35420
35809
  ],
35421
35810
  "boolean": false,
35422
- "descriptionZh": "`button` 的主题",
35423
- "descriptionEn": "Button theme"
35811
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? group?.theme ?? inheritedAppearance.theme, PAINTED_THEMES) ??\n \"fill\"",
35812
+ "descriptionZh": "组件呈现主题",
35813
+ "descriptionEn": "Component theme"
35424
35814
  },
35425
35815
  {
35426
35816
  "name": "size",
@@ -35460,6 +35850,7 @@
35460
35850
  true
35461
35851
  ],
35462
35852
  "boolean": true,
35853
+ "defaultExpression": "false",
35463
35854
  "descriptionZh": "是否禁用当前项",
35464
35855
  "descriptionEn": "Whether current item is disabled"
35465
35856
  },
@@ -35472,6 +35863,7 @@
35472
35863
  true
35473
35864
  ],
35474
35865
  "boolean": true,
35866
+ "defaultExpression": "false",
35475
35867
  "descriptionZh": "是否只读当前项",
35476
35868
  "descriptionEn": "Whether current item is read-only"
35477
35869
  }
@@ -35880,7 +36272,12 @@
35880
36272
  {
35881
36273
  "id": "components/radio/demo/radio-buttons.tsx",
35882
36274
  "title": "组合Button使用",
35883
- "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type { DirectionType, RadioType, ShapeType, SizeType, ThemeType } from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [\n { label: \"Default\", value: \"default\" },\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<ThemeType>(\"default\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
36275
+ "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type {\n DirectionType,\n RadioType,\n ShapeType,\n SizeType,\n SurfaceThemeType,\n} from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [{ label: \"Fill\", value: \"fill\" }, { label: \"Outline\", value: \"outline\" }];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<SurfaceThemeType>(\"fill\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
36276
+ },
36277
+ {
36278
+ "id": "components/radio/demo/theme.tsx",
36279
+ "title": "外观档位",
36280
+ "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, type MarkThemeType, type SurfaceThemeType } from \"react-kui\";\n\n// A radio dot paints the two tiers a mark has, and the tier lands on the dot rather than on the label: `fill`\n// — what it does when nobody writes a theme — gives it a pale plate, `outline` puts a border on it instead.\n// `type=\"button\"` is a different surface entirely: the group renders buttons, so it paints the five tiers a\n// button has, and writing no theme at all keeps the buttons' own type-driven look — the checked one primary,\n// the rest outlined. Only `fill` changes how the buttons are joined; the others keep their adjacent borders.\nconst marks: MarkThemeType[] = [\"fill\", \"outline\"];\nconst buttons: (SurfaceThemeType | undefined)[] = [\n undefined,\n \"fill\",\n \"outline\",\n \"plain\",\n \"solid\",\n \"dashed\",\n];\nconst fruits = [\"Apple\", \"Orange\", \"Banana\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\n\nexport default function App() {\n const [dot, setDot] = useState(\"apple\");\n const [button, setButton] = useState(\"apple\");\n return (\n <Space vertical block>\n {marks.map((tier) => (\n <Space key={`dot-${tier}`} vertical>\n <code>theme: {tier}</code>\n <RadioGroup options={fruits} value={dot} onChange={setDot} theme={tier} />\n </Space>\n ))}\n {buttons.map((tier) => (\n <Space key={`button-${tier}`} vertical>\n <code>{tier ? `theme: ${tier}` : \"no theme\"}</code>\n <RadioGroup\n type=\"button\"\n options={fruits}\n value={button}\n onChange={setButton}\n theme={tier}\n />\n </Space>\n ))}\n </Space>\n );\n}"
35884
36281
  }
35885
36282
  ]
35886
36283
  },
@@ -35907,16 +36304,14 @@
35907
36304
  },
35908
36305
  {
35909
36306
  "name": "theme",
35910
- "type": "ThemeType | undefined",
36307
+ "type": "SurfaceThemeType | undefined",
35911
36308
  "required": false,
35912
36309
  "enumValues": [
35913
36310
  "dashed",
35914
36311
  "solid",
35915
- "default",
35916
36312
  "fill",
35917
36313
  "outline",
35918
- "plain",
35919
- "underlined"
36314
+ "plain"
35920
36315
  ],
35921
36316
  "boolean": false,
35922
36317
  "descriptionZh": "按钮外观",
@@ -35931,6 +36326,7 @@
35931
36326
  true
35932
36327
  ],
35933
36328
  "boolean": true,
36329
+ "defaultExpression": "false",
35934
36330
  "descriptionZh": "是否禁用整个单选组",
35935
36331
  "descriptionEn": "Disable the entire group"
35936
36332
  },
@@ -35943,6 +36339,7 @@
35943
36339
  true
35944
36340
  ],
35945
36341
  "boolean": true,
36342
+ "defaultExpression": "false",
35946
36343
  "descriptionZh": "是否只读",
35947
36344
  "descriptionEn": "Whether the group is read-only"
35948
36345
  },
@@ -36414,7 +36811,12 @@
36414
36811
  {
36415
36812
  "id": "components/radio/demo/radio-buttons.tsx",
36416
36813
  "title": "组合Button使用",
36417
- "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type { DirectionType, RadioType, ShapeType, SizeType, ThemeType } from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [\n { label: \"Default\", value: \"default\" },\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<ThemeType>(\"default\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
36814
+ "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type {\n DirectionType,\n RadioType,\n ShapeType,\n SizeType,\n SurfaceThemeType,\n} from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [{ label: \"Fill\", value: \"fill\" }, { label: \"Outline\", value: \"outline\" }];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<SurfaceThemeType>(\"fill\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
36815
+ },
36816
+ {
36817
+ "id": "components/radio/demo/theme.tsx",
36818
+ "title": "外观档位",
36819
+ "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, type MarkThemeType, type SurfaceThemeType } from \"react-kui\";\n\n// A radio dot paints the two tiers a mark has, and the tier lands on the dot rather than on the label: `fill`\n// — what it does when nobody writes a theme — gives it a pale plate, `outline` puts a border on it instead.\n// `type=\"button\"` is a different surface entirely: the group renders buttons, so it paints the five tiers a\n// button has, and writing no theme at all keeps the buttons' own type-driven look — the checked one primary,\n// the rest outlined. Only `fill` changes how the buttons are joined; the others keep their adjacent borders.\nconst marks: MarkThemeType[] = [\"fill\", \"outline\"];\nconst buttons: (SurfaceThemeType | undefined)[] = [\n undefined,\n \"fill\",\n \"outline\",\n \"plain\",\n \"solid\",\n \"dashed\",\n];\nconst fruits = [\"Apple\", \"Orange\", \"Banana\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\n\nexport default function App() {\n const [dot, setDot] = useState(\"apple\");\n const [button, setButton] = useState(\"apple\");\n return (\n <Space vertical block>\n {marks.map((tier) => (\n <Space key={`dot-${tier}`} vertical>\n <code>theme: {tier}</code>\n <RadioGroup options={fruits} value={dot} onChange={setDot} theme={tier} />\n </Space>\n ))}\n {buttons.map((tier) => (\n <Space key={`button-${tier}`} vertical>\n <code>{tier ? `theme: ${tier}` : \"no theme\"}</code>\n <RadioGroup\n type=\"button\"\n options={fruits}\n value={button}\n onChange={setButton}\n theme={tier}\n />\n </Space>\n ))}\n </Space>\n );\n}"
36418
36820
  }
36419
36821
  ]
36420
36822
  },
@@ -36440,6 +36842,7 @@
36440
36842
  true
36441
36843
  ],
36442
36844
  "boolean": true,
36845
+ "defaultExpression": "false",
36443
36846
  "descriptionZh": "是否禁用整个单选组",
36444
36847
  "descriptionEn": "Disable the entire group"
36445
36848
  },
@@ -36452,6 +36855,7 @@
36452
36855
  true
36453
36856
  ],
36454
36857
  "boolean": true,
36858
+ "defaultExpression": "false",
36455
36859
  "descriptionZh": "是否只读",
36456
36860
  "descriptionEn": "Whether the group is read-only"
36457
36861
  },
@@ -36465,6 +36869,7 @@
36465
36869
  "vertical"
36466
36870
  ],
36467
36871
  "boolean": false,
36872
+ "defaultExpression": "\"horizontal\"",
36468
36873
  "descriptionZh": "布局方向",
36469
36874
  "descriptionEn": "Layout direction"
36470
36875
  },
@@ -36483,20 +36888,18 @@
36483
36888
  },
36484
36889
  {
36485
36890
  "name": "theme",
36486
- "type": "ThemeType | undefined",
36891
+ "type": "SurfaceThemeType | undefined",
36487
36892
  "required": false,
36488
36893
  "enumValues": [
36489
36894
  "dashed",
36490
36895
  "solid",
36491
- "default",
36492
36896
  "fill",
36493
36897
  "outline",
36494
- "plain",
36495
- "underlined"
36898
+ "plain"
36496
36899
  ],
36497
36900
  "boolean": false,
36498
- "descriptionZh": "`button` 的主题",
36499
- "descriptionEn": "Button theme"
36901
+ "descriptionZh": "单选项外观,`type=\"button\"` 时为按钮主题",
36902
+ "descriptionEn": "Radio option appearance; the button's theme when `type=\"button\"`"
36500
36903
  },
36501
36904
  {
36502
36905
  "name": "shape",
@@ -36953,7 +37356,12 @@
36953
37356
  {
36954
37357
  "id": "components/radio/demo/radio-buttons.tsx",
36955
37358
  "title": "组合Button使用",
36956
- "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type { DirectionType, RadioType, ShapeType, SizeType, ThemeType } from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [\n { label: \"Default\", value: \"default\" },\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<ThemeType>(\"default\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
37359
+ "source": "import { LogoApple } from \"kui-icons\";\nimport { useState } from \"react\";\nimport type {\n DirectionType,\n RadioType,\n ShapeType,\n SizeType,\n SurfaceThemeType,\n} from \"react-kui\";\nimport { RadioGroup, Space } from \"react-kui\";\nconst dates = [\n { label: \"1 week\", value: 0 },\n { label: \"1 month\", value: 1 },\n { label: \"Q1\", value: 2 },\n { label: \"1 year\", value: 3 },\n { label: \"5 years\", value: 4, disabled: true },\n ],\n sizes = [\n { label: \"Large\", value: \"large\", icon: LogoApple },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n directions = [\n { label: \"Horizontal\", value: \"horizontal\" },\n { label: \"Vertical\", value: \"vertical\" },\n ],\n types = [\n { label: \"Radio\", value: \"radio\" },\n { label: \"Button\", value: \"button\" },\n ],\n shapes = [\n { label: \"Round\", value: \"round\" },\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [{ label: \"Fill\", value: \"fill\" }, { label: \"Outline\", value: \"outline\" }];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"medium\"),\n [shape, setShape] = useState<ShapeType>(\"round\"),\n [theme, setTheme] = useState<SurfaceThemeType>(\"fill\"),\n [direction, setDirection] = useState<DirectionType>(\"horizontal\"),\n [type, setType] = useState<RadioType>(\"button\"),\n [value, setValue] = useState(0);\n return (\n <Space vertical>\n <RadioGroup value={shape} size=\"small\" type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} size=\"small\" type=\"button\" options={themes} onChange={setTheme} />\n <RadioGroup value={size} type=\"button\" size=\"small\" options={sizes} onChange={setSize} />\n <RadioGroup\n value={direction}\n type=\"button\"\n size=\"small\"\n options={directions}\n onChange={setDirection}\n />\n <RadioGroup value={type} type=\"button\" size=\"small\" options={types} onChange={setType} />\n <br />\n <RadioGroup\n value={value}\n onChange={setValue}\n size={size}\n theme={theme}\n shape={shape}\n options={dates}\n direction={direction}\n type={type}\n />\n </Space>\n );\n}"
37360
+ },
37361
+ {
37362
+ "id": "components/radio/demo/theme.tsx",
37363
+ "title": "外观档位",
37364
+ "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, type MarkThemeType, type SurfaceThemeType } from \"react-kui\";\n\n// A radio dot paints the two tiers a mark has, and the tier lands on the dot rather than on the label: `fill`\n// — what it does when nobody writes a theme — gives it a pale plate, `outline` puts a border on it instead.\n// `type=\"button\"` is a different surface entirely: the group renders buttons, so it paints the five tiers a\n// button has, and writing no theme at all keeps the buttons' own type-driven look — the checked one primary,\n// the rest outlined. Only `fill` changes how the buttons are joined; the others keep their adjacent borders.\nconst marks: MarkThemeType[] = [\"fill\", \"outline\"];\nconst buttons: (SurfaceThemeType | undefined)[] = [\n undefined,\n \"fill\",\n \"outline\",\n \"plain\",\n \"solid\",\n \"dashed\",\n];\nconst fruits = [\"Apple\", \"Orange\", \"Banana\"].map((label) => ({\n label,\n value: label.toLowerCase(),\n}));\n\nexport default function App() {\n const [dot, setDot] = useState(\"apple\");\n const [button, setButton] = useState(\"apple\");\n return (\n <Space vertical block>\n {marks.map((tier) => (\n <Space key={`dot-${tier}`} vertical>\n <code>theme: {tier}</code>\n <RadioGroup options={fruits} value={dot} onChange={setDot} theme={tier} />\n </Space>\n ))}\n {buttons.map((tier) => (\n <Space key={`button-${tier}`} vertical>\n <code>{tier ? `theme: ${tier}` : \"no theme\"}</code>\n <RadioGroup\n type=\"button\"\n options={fruits}\n value={button}\n onChange={setButton}\n theme={tier}\n />\n </Space>\n ))}\n </Space>\n );\n}"
36957
37365
  }
36958
37366
  ]
36959
37367
  },
@@ -36975,6 +37383,7 @@
36975
37383
  "type": "SegmentedOption[] | undefined",
36976
37384
  "required": false,
36977
37385
  "boolean": false,
37386
+ "defaultExpression": "[]",
36978
37387
  "descriptionZh": "选项数据",
36979
37388
  "descriptionEn": "Option data"
36980
37389
  },
@@ -36987,6 +37396,7 @@
36987
37396
  true
36988
37397
  ],
36989
37398
  "boolean": true,
37399
+ "defaultExpression": "false",
36990
37400
  "descriptionZh": "是否禁用",
36991
37401
  "descriptionEn": "Disable this option"
36992
37402
  },
@@ -36999,6 +37409,7 @@
36999
37409
  true
37000
37410
  ],
37001
37411
  "boolean": true,
37412
+ "defaultExpression": "false",
37002
37413
  "descriptionZh": "是否只读",
37003
37414
  "descriptionEn": "Read-only state"
37004
37415
  },
@@ -37011,6 +37422,7 @@
37011
37422
  true
37012
37423
  ],
37013
37424
  "boolean": true,
37425
+ "defaultExpression": "false",
37014
37426
  "descriptionZh": "是否撑满父容器",
37015
37427
  "descriptionEn": "Fill the parent width"
37016
37428
  },
@@ -37023,6 +37435,7 @@
37023
37435
  "vertical"
37024
37436
  ],
37025
37437
  "boolean": false,
37438
+ "defaultExpression": "\"horizontal\"",
37026
37439
  "descriptionZh": "排列方向",
37027
37440
  "descriptionEn": "Layout direction"
37028
37441
  },
@@ -37036,6 +37449,7 @@
37036
37449
  "large"
37037
37450
  ],
37038
37451
  "boolean": false,
37452
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
37039
37453
  "descriptionZh": "尺寸",
37040
37454
  "descriptionEn": "Size"
37041
37455
  },
@@ -37050,6 +37464,7 @@
37050
37464
  "circle"
37051
37465
  ],
37052
37466
  "boolean": false,
37467
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
37053
37468
  "descriptionZh": "形状",
37054
37469
  "descriptionEn": "Shape"
37055
37470
  },
@@ -37493,6 +37908,7 @@
37493
37908
  true
37494
37909
  ],
37495
37910
  "boolean": true,
37911
+ "defaultExpression": "true",
37496
37912
  "descriptionZh": "是否允许再次点击后清除",
37497
37913
  "descriptionEn": "Whether to allow clearing by clicking again"
37498
37914
  },
@@ -37505,6 +37921,7 @@
37505
37921
  true
37506
37922
  ],
37507
37923
  "boolean": true,
37924
+ "defaultExpression": "false",
37508
37925
  "descriptionZh": "是否允许半选",
37509
37926
  "descriptionEn": "Whether to allow half selection"
37510
37927
  },
@@ -37533,6 +37950,7 @@
37533
37950
  true
37534
37951
  ],
37535
37952
  "boolean": true,
37953
+ "defaultExpression": "false",
37536
37954
  "descriptionZh": "是否显示分数",
37537
37955
  "descriptionEn": "Whether to show score"
37538
37956
  },
@@ -37541,6 +37959,7 @@
37541
37959
  "type": "string[] | undefined",
37542
37960
  "required": false,
37543
37961
  "boolean": false,
37962
+ "defaultExpression": "[]",
37544
37963
  "descriptionZh": "自定义每项的提示信息",
37545
37964
  "descriptionEn": "Custom prompt information for each item"
37546
37965
  },
@@ -37553,6 +37972,7 @@
37553
37972
  true
37554
37973
  ],
37555
37974
  "boolean": true,
37975
+ "defaultExpression": "false",
37556
37976
  "descriptionZh": "只读,无法进行交互",
37557
37977
  "descriptionEn": "Read-only, cannot interact"
37558
37978
  },
@@ -37565,6 +37985,7 @@
37565
37985
  true
37566
37986
  ],
37567
37987
  "boolean": true,
37988
+ "defaultExpression": "false",
37568
37989
  "descriptionZh": "只读,保持正常外观但无法修改",
37569
37990
  "descriptionEn": "Read-only with normal appearance"
37570
37991
  },
@@ -37573,6 +37994,7 @@
37573
37994
  "type": "number | undefined",
37574
37995
  "required": false,
37575
37996
  "boolean": false,
37997
+ "defaultExpression": "5",
37576
37998
  "descriptionZh": "star 总数",
37577
37999
  "descriptionEn": "Total number of stars"
37578
38000
  },
@@ -37601,6 +38023,7 @@
37601
38023
  true
37602
38024
  ],
37603
38025
  "boolean": true,
38026
+ "defaultExpression": "false",
37604
38027
  "descriptionZh": "符号反相填充颜色",
37605
38028
  "descriptionEn": "Symbol Inverted Fill Color"
37606
38029
  },
@@ -37609,6 +38032,7 @@
37609
38032
  "type": "number | undefined",
37610
38033
  "required": false,
37611
38034
  "boolean": false,
38035
+ "defaultExpression": "1",
37612
38036
  "descriptionZh": "符号边框单位",
37613
38037
  "descriptionEn": "Symbol Border Unit"
37614
38038
  },
@@ -39044,9 +39468,23 @@
39044
39468
  "bottom-right"
39045
39469
  ],
39046
39470
  "boolean": false,
39471
+ "defaultExpression": "\"bottom-left\"",
39047
39472
  "descriptionZh": "下拉框弹出位置",
39048
39473
  "descriptionEn": "Dropdown placement"
39049
39474
  },
39475
+ {
39476
+ "name": "destroyOnClose",
39477
+ "type": "boolean | undefined",
39478
+ "required": false,
39479
+ "enumValues": [
39480
+ false,
39481
+ true
39482
+ ],
39483
+ "boolean": true,
39484
+ "defaultExpression": "true",
39485
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
39486
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
39487
+ },
39050
39488
  {
39051
39489
  "name": "width",
39052
39490
  "type": "number | undefined",
@@ -39092,6 +39530,7 @@
39092
39530
  true
39093
39531
  ],
39094
39532
  "boolean": true,
39533
+ "defaultExpression": "true",
39095
39534
  "descriptionZh": "是否可以清空选项",
39096
39535
  "descriptionEn": "Whether options can be cleared"
39097
39536
  },
@@ -39104,6 +39543,7 @@
39104
39543
  true
39105
39544
  ],
39106
39545
  "boolean": true,
39546
+ "defaultExpression": "false",
39107
39547
  "descriptionZh": "是否允许搜索过滤",
39108
39548
  "descriptionEn": "Whether search filtering is enabled"
39109
39549
  },
@@ -39116,6 +39556,7 @@
39116
39556
  true
39117
39557
  ],
39118
39558
  "boolean": true,
39559
+ "defaultExpression": "false",
39119
39560
  "descriptionZh": "多选时是否允许输入并创建新选项",
39120
39561
  "descriptionEn": "Allow creating a unique option from input in multiple mode"
39121
39562
  },
@@ -39128,6 +39569,7 @@
39128
39569
  true
39129
39570
  ],
39130
39571
  "boolean": true,
39572
+ "defaultExpression": "false",
39131
39573
  "descriptionZh": "是否撑满父容器宽度",
39132
39574
  "descriptionEn": "Whether to fill the parent width"
39133
39575
  },
@@ -39140,6 +39582,7 @@
39140
39582
  true
39141
39583
  ],
39142
39584
  "boolean": true,
39585
+ "defaultExpression": "false",
39143
39586
  "descriptionZh": "是否禁用当前项",
39144
39587
  "descriptionEn": "Whether current item is disabled"
39145
39588
  },
@@ -39152,6 +39595,7 @@
39152
39595
  true
39153
39596
  ],
39154
39597
  "boolean": true,
39598
+ "defaultExpression": "false",
39155
39599
  "descriptionZh": "是否只读",
39156
39600
  "descriptionEn": "Whether the component is read-only"
39157
39601
  },
@@ -39164,6 +39608,7 @@
39164
39608
  true
39165
39609
  ],
39166
39610
  "boolean": true,
39611
+ "defaultExpression": "false",
39167
39612
  "descriptionZh": "是否呈现多选模式",
39168
39613
  "descriptionEn": "Whether to display in multiple selection mode"
39169
39614
  },
@@ -39176,6 +39621,7 @@
39176
39621
  true
39177
39622
  ],
39178
39623
  "boolean": true,
39624
+ "defaultExpression": "false",
39179
39625
  "descriptionZh": "是否显示异步加载",
39180
39626
  "descriptionEn": "Whether to show asynchronous loading"
39181
39627
  },
@@ -39188,6 +39634,7 @@
39188
39634
  true
39189
39635
  ],
39190
39636
  "boolean": true,
39637
+ "defaultExpression": "true",
39191
39638
  "descriptionZh": "是否显示边框",
39192
39639
  "descriptionEn": "Whether to show border"
39193
39640
  },
@@ -39200,6 +39647,7 @@
39200
39647
  true
39201
39648
  ],
39202
39649
  "boolean": true,
39650
+ "defaultExpression": "true",
39203
39651
  "descriptionZh": "下拉框的宽度是否与input一致",
39204
39652
  "descriptionEn": "Whether dropdown width matches input width"
39205
39653
  },
@@ -39212,6 +39660,7 @@
39212
39660
  true
39213
39661
  ],
39214
39662
  "boolean": true,
39663
+ "defaultExpression": "true",
39215
39664
  "descriptionZh": "是否显示下拉按钮",
39216
39665
  "descriptionEn": "Whether to show dropdown button"
39217
39666
  },
@@ -39230,7 +39679,6 @@
39230
39679
  "enumValues": [
39231
39680
  "dashed",
39232
39681
  "solid",
39233
- "default",
39234
39682
  "fill",
39235
39683
  "outline",
39236
39684
  "plain",
@@ -39238,7 +39686,7 @@
39238
39686
  ],
39239
39687
  "boolean": false,
39240
39688
  "descriptionZh": "主题",
39241
- "descriptionEn": "The theme of Select"
39689
+ "descriptionEn": "Theme"
39242
39690
  },
39243
39691
  {
39244
39692
  "name": "emptyText",
@@ -39287,6 +39735,7 @@
39287
39735
  true
39288
39736
  ],
39289
39737
  "boolean": true,
39738
+ "defaultExpression": "false",
39290
39739
  "descriptionZh": "是否开启虚拟滚动,用于高效渲染大量选项",
39291
39740
  "descriptionEn": "Whether to enable virtual scrolling for large option lists"
39292
39741
  },
@@ -39295,6 +39744,7 @@
39295
39744
  "type": "number | undefined",
39296
39745
  "required": false,
39297
39746
  "boolean": false,
39747
+ "defaultExpression": "33",
39298
39748
  "descriptionZh": "虚拟滚动时每个选项的高度,单位 `px`",
39299
39749
  "descriptionEn": "Height of each option in pixels when virtual scrolling is enabled"
39300
39750
  },
@@ -39303,6 +39753,7 @@
39303
39753
  "type": "number | undefined",
39304
39754
  "required": false,
39305
39755
  "boolean": false,
39756
+ "defaultExpression": "5",
39306
39757
  "descriptionZh": "虚拟滚动时视口外额外渲染的选项数量",
39307
39758
  "descriptionEn": "Number of extra options rendered outside the viewport"
39308
39759
  },
@@ -39874,7 +40325,6 @@
39874
40325
  "enumValues": [
39875
40326
  "dashed",
39876
40327
  "solid",
39877
- "default",
39878
40328
  "fill",
39879
40329
  "outline",
39880
40330
  "plain",
@@ -42353,8 +42803,8 @@
42353
42803
  "type": "ReactNode",
42354
42804
  "required": false,
42355
42805
  "boolean": false,
42356
- "descriptionZh": "卡片标题",
42357
- "descriptionEn": "Card title"
42806
+ "descriptionZh": "卡片标题;传 `false`、空字符串等空内容时不渲染标题行",
42807
+ "descriptionEn": "Card title; empty content such as `false` or an empty string renders no title row"
42358
42808
  },
42359
42809
  {
42360
42810
  "name": "precision",
@@ -42423,30 +42873,31 @@
42423
42873
  },
42424
42874
  {
42425
42875
  "name": "theme",
42426
- "type": "\"fill\" | \"outline\" | \"plain\" | undefined",
42876
+ "type": "SurfaceThemeType | undefined",
42427
42877
  "required": false,
42428
42878
  "enumValues": [
42879
+ "dashed",
42880
+ "solid",
42429
42881
  "fill",
42430
42882
  "outline",
42431
42883
  "plain"
42432
42884
  ],
42433
42885
  "boolean": false,
42434
- "descriptionZh": "主题",
42435
- "descriptionEn": "Theme"
42886
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
42887
+ "descriptionZh": "外观主题",
42888
+ "descriptionEn": "Appearance theme"
42436
42889
  },
42437
42890
  {
42438
42891
  "name": "shape",
42439
- "type": "ShapeType | undefined",
42892
+ "type": "SurfaceShapeType | undefined",
42440
42893
  "required": false,
42441
42894
  "enumValues": [
42442
42895
  "round",
42443
- "default",
42444
- "square",
42445
- "circle"
42896
+ "square"
42446
42897
  ],
42447
42898
  "boolean": false,
42448
- "descriptionZh": "形状",
42449
- "descriptionEn": "Shape"
42899
+ "descriptionZh": "卡片形状,只支持 `square` / `round`;圆形会裁掉内容,继承到 `circle` 时按 `round` 处理",
42900
+ "descriptionEn": "Card shape; only `square` / `round` apply — a circle would clip the content, so an inherited `circle` falls back to `round`"
42450
42901
  },
42451
42902
  {
42452
42903
  "name": "size",
@@ -42458,6 +42909,7 @@
42458
42909
  "large"
42459
42910
  ],
42460
42911
  "boolean": false,
42912
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"medium\"",
42461
42913
  "descriptionZh": "尺寸",
42462
42914
  "descriptionEn": "Size"
42463
42915
  },
@@ -42850,7 +43302,7 @@
42850
43302
  {
42851
43303
  "id": "components/stat-card/demo/card.tsx",
42852
43304
  "title": "卡片展示",
42853
- "source": "import { Heart, Star } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Checkbox,\n Grid,\n GridItem,\n Icon,\n Segmented,\n Space,\n StatCard,\n type SizeType,\n type StatNumberItem,\n type StatCardProps,\n} from \"react-kui\";\nconst sizes = [\"small\", \"medium\", \"large\"].map((value) => ({ value, label: value }));\nconst themeOptions = [\"outline\", \"fill\", \"plain\"].map((value) => ({ value, label: value }));\nconst items = [\n { value: 5872, desc: \"Number of orders\" },\n { value: 9873672, desc: \"Total Order Amount\", prefix: \"¥\" },\n];\nconst items1 = [\n { value: 5872, desc: \"Alipay Revenue\", prefix: \"$\", precision: 2 },\n { value: 9873672, desc: \"WeChat Revenue\", prefix: \"¥\", precision: 2 },\n];\nconst items2: StatNumberItem[] = [\n { value: 5872, desc: \"Number of likes\", prefix: <Icon type={Heart} /> },\n { value: 9873672, desc: \"Number of Favorites\", prefix: <Icon type={Star} /> },\n];\nexport default function App() {\n const [showTitle, setShowTitle] = useState(true),\n [theme, setTheme] = useState<NonNullable<StatCardProps[\"theme\"]>>(\"fill\"),\n [reverse, setReverse] = useState(false),\n [size, setSize] = useState<SizeType>(\"medium\");\n const check =\n (setter: (value: boolean) => void) =>\n ({ checked }: { checked: boolean }) =>\n setter(checked);\n return (\n <Space vertical block>\n <Space>\n <Checkbox checked={showTitle} onChange={check(setShowTitle)}>\n Show Title\n </Checkbox>\n <Checkbox checked={reverse} onChange={check(setReverse)}>\n Reverse\n </Checkbox>\n <Segmented value={size} options={sizes} onChange={(value) => setSize(value as SizeType)} />\n <Segmented\n value={theme}\n options={themeOptions}\n onChange={(value) => setTheme(value as typeof theme)}\n />\n </Space>\n <Grid cols={{ xs: 1, sm: 2, md: 3 }} xGap={16} yGap={16}>\n <GridItem>\n <StatCard\n title={showTitle ? \"Today's Orders\" : undefined}\n reverse={reverse}\n items={items}\n theme={theme}\n size={size}\n />\n </GridItem>\n <GridItem>\n <StatCard\n statNumberType=\"rollup\"\n title={showTitle ? \"Today's income\" : undefined}\n items={items1}\n theme={theme}\n reverse={reverse}\n size={size}\n />\n </GridItem>\n <GridItem span={{ xs: 1, sm: 2, md: 1 }}>\n <StatCard\n reverse={reverse}\n statNumberType=\"rollup\"\n title={showTitle ? \"Media data\" : undefined}\n items={items2}\n theme={theme}\n size={size}\n />\n </GridItem>\n </Grid>\n </Space>\n );\n}"
43305
+ "source": "import { Heart, Star } from \"kui-icons\";\nimport { useState } from \"react\";\nimport {\n Checkbox,\n Grid,\n GridItem,\n Icon,\n Segmented,\n Space,\n StatCard,\n type SizeType,\n type StatNumberItem,\n type StatCardProps,\n} from \"react-kui\";\nconst sizes = [\"small\", \"medium\", \"large\"].map((value) => ({ value, label: value }));\nconst themeOptions = [\"outline\", \"fill\", \"plain\", \"solid\", \"dashed\"].map((value) => ({ value, label: value }));\nconst items = [\n { value: 5872, desc: \"Number of orders\" },\n { value: 9873672, desc: \"Total Order Amount\", prefix: \"¥\" },\n];\nconst items1 = [\n { value: 5872, desc: \"Alipay Revenue\", prefix: \"$\", precision: 2 },\n { value: 9873672, desc: \"WeChat Revenue\", prefix: \"¥\", precision: 2 },\n];\nconst items2: StatNumberItem[] = [\n { value: 5872, desc: \"Number of likes\", prefix: <Icon type={Heart} /> },\n { value: 9873672, desc: \"Number of Favorites\", prefix: <Icon type={Star} /> },\n];\nexport default function App() {\n const [showTitle, setShowTitle] = useState(true),\n [theme, setTheme] = useState<NonNullable<StatCardProps[\"theme\"]>>(\"fill\"),\n [reverse, setReverse] = useState(false),\n [size, setSize] = useState<SizeType>(\"medium\");\n const check =\n (setter: (value: boolean) => void) =>\n ({ checked }: { checked: boolean }) =>\n setter(checked);\n return (\n <Space vertical block>\n <Space>\n <Checkbox checked={showTitle} onChange={check(setShowTitle)}>\n Show Title\n </Checkbox>\n <Checkbox checked={reverse} onChange={check(setReverse)}>\n Reverse\n </Checkbox>\n <Segmented value={size} options={sizes} onChange={(value) => setSize(value as SizeType)} />\n <Segmented\n value={theme}\n options={themeOptions}\n onChange={(value) => setTheme(value as typeof theme)}\n />\n </Space>\n <Grid cols={{ xs: 1, sm: 2, md: 3 }} xGap={16} yGap={16}>\n <GridItem>\n <StatCard\n title={showTitle ? \"Today's Orders\" : undefined}\n reverse={reverse}\n items={items}\n theme={theme}\n size={size}\n />\n </GridItem>\n <GridItem>\n <StatCard\n statNumberType=\"rollup\"\n title={showTitle ? \"Today's income\" : undefined}\n items={items1}\n theme={theme}\n reverse={reverse}\n size={size}\n />\n </GridItem>\n <GridItem span={{ xs: 1, sm: 2, md: 1 }}>\n <StatCard\n reverse={reverse}\n statNumberType=\"rollup\"\n title={showTitle ? \"Media data\" : undefined}\n items={items2}\n theme={theme}\n size={size}\n />\n </GridItem>\n </Grid>\n </Space>\n );\n}"
42854
43306
  },
42855
43307
  {
42856
43308
  "id": "components/stat-card/demo/trend.tsx",
@@ -42861,6 +43313,11 @@
42861
43313
  "id": "components/stat-card/demo/with-card.tsx",
42862
43314
  "title": "组合展示",
42863
43315
  "source": "import { ArrowDown, ArrowUp } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Card, Icon, Space, StatNumber } from \"react-kui\";\nconst initialValue = Math.random() * 100000;\n\nexport default function App() {\n const [value, setValue] = useState(initialValue);\n return (\n <Space vertical className=\"demo-view-fill\">\n <Card>\n <StatNumber value={value} prefix=\"$\" suffix=\"%\" style={{ fontSize: \"2em\" }} />\n </Card>\n <Card title=\"Today's Trends\">\n <StatNumber\n value={value}\n suffix=\"%\"\n style={{ fontSize: \"2em\", color: \"green\" }}\n prefix={<Icon type={ArrowUp} />}\n />\n </Card>\n <Card title=\"Yesterday's Trend\">\n <StatNumber\n value={value}\n suffix=\"%\"\n style={{ fontSize: \"2em\", color: \"red\" }}\n type=\"rollup\"\n prefix={<Icon type={ArrowDown} />}\n />\n </Card>\n <Button onClick={() => setValue(Math.random() * 100000)}>change</Button>\n </Space>\n );\n}"
43316
+ },
43317
+ {
43318
+ "id": "components/stat-card/demo/appearance.tsx",
43319
+ "title": "外观",
43320
+ "source": "import { StatCard, Grid, type StatNumberItem, type SurfaceThemeType } from \"react-kui\";\n\n// The stat card takes the same five tiers as the other cards and starts on `fill`. `solid` is the tier worth\n// looking at here: the numbers and their captions both go to the light ink of the plate, and `plain` leaves\n// them with no box at all. One short item list, so the only thing moving down the row is the surface.\nconst tiers: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\nconst items: StatNumberItem[] = [{ value: 5872, desc: \"订单数\" }];\n\nexport default function App() {\n return (\n <Grid cols={5} xGap={12} yGap={12}>\n {tiers.map((tier) => (\n <StatCard key={tier} title={`theme: ${tier}`} items={items} theme={tier} size=\"small\" />\n ))}\n </Grid>\n );\n}"
42864
43321
  }
42865
43322
  ]
42866
43323
  },
@@ -42890,7 +43347,6 @@
42890
43347
  "type": "number | undefined",
42891
43348
  "required": false,
42892
43349
  "boolean": false,
42893
- "defaultExpression": "1.2",
42894
43350
  "descriptionZh": "数值动态展示时间(秒)",
42895
43351
  "descriptionEn": "Numerical dynamic display time (seconds)"
42896
43352
  },
@@ -43359,6 +43815,7 @@
43359
43815
  "type": "number | undefined",
43360
43816
  "required": false,
43361
43817
  "boolean": false,
43818
+ "defaultExpression": "0",
43362
43819
  "descriptionZh": "最小值",
43363
43820
  "descriptionEn": "Minimum value"
43364
43821
  },
@@ -43367,6 +43824,7 @@
43367
43824
  "type": "number | undefined",
43368
43825
  "required": false,
43369
43826
  "boolean": false,
43827
+ "defaultExpression": "100",
43370
43828
  "descriptionZh": "最大值",
43371
43829
  "descriptionEn": "Maximum value"
43372
43830
  },
@@ -43375,6 +43833,7 @@
43375
43833
  "type": "number | null | undefined",
43376
43834
  "required": false,
43377
43835
  "boolean": false,
43836
+ "defaultExpression": "1",
43378
43837
  "descriptionZh": "间距大小 , 步长,取值必须大于 0,并且可被 (max - min) 整除",
43379
43838
  "descriptionEn": "Step size, must be greater than 0 and divisible by (max - min)"
43380
43839
  },
@@ -43387,6 +43846,7 @@
43387
43846
  true
43388
43847
  ],
43389
43848
  "boolean": true,
43849
+ "defaultExpression": "false",
43390
43850
  "descriptionZh": "滑块是否禁用",
43391
43851
  "descriptionEn": "Whether the slider is disabled"
43392
43852
  },
@@ -43399,6 +43859,7 @@
43399
43859
  true
43400
43860
  ],
43401
43861
  "boolean": true,
43862
+ "defaultExpression": "false",
43402
43863
  "descriptionZh": "滑块是否只读",
43403
43864
  "descriptionEn": "Whether the slider is read-only"
43404
43865
  },
@@ -43411,6 +43872,7 @@
43411
43872
  true
43412
43873
  ],
43413
43874
  "boolean": true,
43875
+ "defaultExpression": "false",
43414
43876
  "descriptionZh": "是否设置方向为垂直",
43415
43877
  "descriptionEn": "Whether to set direction to vertical"
43416
43878
  },
@@ -43423,6 +43885,7 @@
43423
43885
  true
43424
43886
  ],
43425
43887
  "boolean": true,
43888
+ "defaultExpression": "false",
43426
43889
  "descriptionZh": "是否倒序排列",
43427
43890
  "descriptionEn": "Sort in reverse order"
43428
43891
  },
@@ -43435,6 +43898,7 @@
43435
43898
  true
43436
43899
  ],
43437
43900
  "boolean": true,
43901
+ "defaultExpression": "false",
43438
43902
  "descriptionZh": "是否支持两边同时可滑动",
43439
43903
  "descriptionEn": "Whether to support sliding on both sides simultaneously"
43440
43904
  },
@@ -43463,6 +43927,7 @@
43463
43927
  true
43464
43928
  ],
43465
43929
  "boolean": true,
43930
+ "defaultExpression": "true",
43466
43931
  "descriptionZh": "marks 不为空对象时有效,值为 true 时表示值为包含关系,false 表示并列",
43467
43932
  "descriptionEn": "Effective when marks is not empty object, true means inclusive relationship, false means parallel"
43468
43933
  },
@@ -43479,6 +43944,7 @@
43479
43944
  "type": "boolean | null | undefined",
43480
43945
  "required": false,
43481
43946
  "boolean": false,
43947
+ "defaultExpression": "null",
43482
43948
  "descriptionZh": "值为true时,Tooltip 将会始终显示;否则始终不显示,哪怕在拖拽及移入时。",
43483
43949
  "descriptionEn": "When true, Tooltip will always display; otherwise never display, even when dragging and hovering"
43484
43950
  },
@@ -45497,6 +45963,7 @@
45497
45963
  "boolean"
45498
45964
  ],
45499
45965
  "boolean": false,
45966
+ "defaultExpression": "\"boolean\"",
45500
45967
  "descriptionZh": "输出值类型",
45501
45968
  "descriptionEn": "Output value type"
45502
45969
  },
@@ -45525,6 +45992,7 @@
45525
45992
  true
45526
45993
  ],
45527
45994
  "boolean": true,
45995
+ "defaultExpression": "false",
45528
45996
  "descriptionZh": "禁用开关",
45529
45997
  "descriptionEn": "Disable switch"
45530
45998
  },
@@ -45537,6 +46005,7 @@
45537
46005
  true
45538
46006
  ],
45539
46007
  "boolean": true,
46008
+ "defaultExpression": "false",
45540
46009
  "descriptionZh": "只读开关",
45541
46010
  "descriptionEn": "Make the switch read-only"
45542
46011
  },
@@ -45549,6 +46018,7 @@
45549
46018
  true
45550
46019
  ],
45551
46020
  "boolean": true,
46021
+ "defaultExpression": "false",
45552
46022
  "descriptionZh": "加载状态,加载时不可操作",
45553
46023
  "descriptionEn": "Loading state; interaction is disabled while loading"
45554
46024
  },
@@ -45576,6 +46046,7 @@
45576
46046
  "circle"
45577
46047
  ],
45578
46048
  "boolean": false,
46049
+ "defaultExpression": "shapeProp ?? inheritedAppearance.shape ?? \"round\"",
45579
46050
  "descriptionZh": "形状",
45580
46051
  "descriptionEn": "Shape"
45581
46052
  },
@@ -46916,7 +47387,7 @@
46916
47387
  "type": "T[] | undefined",
46917
47388
  "required": false,
46918
47389
  "boolean": false,
46919
- "defaultExpression": "[]",
47390
+ "defaultExpression": "EMPTY_DATA",
46920
47391
  "descriptionZh": "显示的结构化数据",
46921
47392
  "descriptionEn": "Structured data to be displayed"
46922
47393
  },
@@ -46925,10 +47396,18 @@
46925
47396
  "type": "Column<T>[] | undefined",
46926
47397
  "required": false,
46927
47398
  "boolean": false,
46928
- "defaultExpression": "[]",
47399
+ "defaultExpression": "EMPTY_COLUMNS",
46929
47400
  "descriptionZh": "表格列的配置描述,",
46930
47401
  "descriptionEn": "Configuration description of table columns"
46931
47402
  },
47403
+ {
47404
+ "name": "ellipsis",
47405
+ "type": "number | boolean | TableEllipsisOptions | undefined",
47406
+ "required": false,
47407
+ "boolean": false,
47408
+ "descriptionZh": "一次给所有列打开省略号,省得一列列写 `ellipsis`;`true` 单行,数字或 `rows` 是多行,`tooltip` 定制悬停提示。某一列想显示完整内容,就在那列写 `ellipsis: false` 单独关掉。",
47409
+ "descriptionEn": "Turn on the ellipsis for every column at once, so you do not have to write `ellipsis` on each one; `true` is a single line, a number or `rows` clamps to several lines, and `tooltip` customizes the hover tip. A column that must show its full content opts out with `ellipsis: false`."
47410
+ },
46932
47411
  {
46933
47412
  "name": "selectedKeys",
46934
47413
  "type": "TableKey[] | undefined",
@@ -46942,7 +47421,7 @@
46942
47421
  "type": "TableKey[] | undefined",
46943
47422
  "required": false,
46944
47423
  "boolean": false,
46945
- "defaultExpression": "[]",
47424
+ "defaultExpression": "EMPTY_KEYS",
46946
47425
  "descriptionZh": "禁用的key集合",
46947
47426
  "descriptionEn": "Disabled key set"
46948
47427
  },
@@ -46952,8 +47431,8 @@
46952
47431
  "required": false,
46953
47432
  "boolean": false,
46954
47433
  "defaultExpression": "\"key\"",
46955
- "descriptionZh": "勾选时的依据",
46956
- "descriptionEn": "Basis for selection"
47434
+ "descriptionZh": "行的唯一标识,勾选与展开都以它为准;可传字段名,或传函数从记录中取值",
47435
+ "descriptionEn": "Unique row identity used by selection and expansion; a field name or an accessor function reading the key from a record"
46957
47436
  },
46958
47437
  {
46959
47438
  "name": "childrenColumnName",
@@ -46982,8 +47461,8 @@
46982
47461
  ],
46983
47462
  "boolean": true,
46984
47463
  "defaultExpression": "false",
46985
- "descriptionZh": "初始化及属性变化时展开所有树节点(expandedKeys 优先)",
46986
- "descriptionEn": "Expand every tree node on initialization or when this prop changes (explicit expandedKeys takes precedence)"
47464
+ "descriptionZh": "初始化时展开所有树节点;`data` 后续变化时只补新增的父行,用户手动展开或折叠过的行保持不变(expandedKeys 优先)",
47465
+ "descriptionEn": "Expand every tree node on initialization; when `data` changes later only newly arrived parent rows are expanded, while rows the user expanded or collapsed by hand are kept (explicit expandedKeys takes precedence)"
46987
47466
  },
46988
47467
  {
46989
47468
  "name": "expandRowByClick",
@@ -47012,9 +47491,9 @@
47012
47491
  "type": "{ x?: number | string; y?: number | string; } | undefined",
47013
47492
  "required": false,
47014
47493
  "boolean": false,
47015
- "defaultExpression": "{}",
47016
- "descriptionZh": "表格滚动区域",
47017
- "descriptionEn": "Scrollable table area"
47494
+ "defaultExpression": "EMPTY_SCROLL",
47495
+ "descriptionZh": "滚动配置;`x` 为内容最小宽度,`y` 为表体的纵向滚动区域高度",
47496
+ "descriptionEn": "Scroll configuration; `x` is the minimum content width and `y` is the vertical viewport height of the body"
47018
47497
  },
47019
47498
  {
47020
47499
  "name": "size",
@@ -47056,13 +47535,11 @@
47056
47535
  },
47057
47536
  {
47058
47537
  "name": "shape",
47059
- "type": "ShapeType | undefined",
47538
+ "type": "SurfaceShapeType | undefined",
47060
47539
  "required": false,
47061
47540
  "enumValues": [
47062
47541
  "round",
47063
- "default",
47064
- "square",
47065
- "circle"
47542
+ "square"
47066
47543
  ],
47067
47544
  "boolean": false,
47068
47545
  "descriptionZh": "形状",
@@ -47152,7 +47629,7 @@
47152
47629
  "type": "(string | number)[] | undefined",
47153
47630
  "required": false,
47154
47631
  "boolean": false,
47155
- "defaultExpression": "[]",
47632
+ "defaultExpression": "EMPTY_KEYS",
47156
47633
  "descriptionZh": "隐藏的列 key 集合",
47157
47634
  "descriptionEn": "Hidden column key collection"
47158
47635
  },
@@ -47649,7 +48126,7 @@
47649
48126
  {
47650
48127
  "id": "components/table/demo/basic.tsx",
47651
48128
  "title": "基本用法",
47652
- "source": "import { ArrowDown, ArrowUp, Moon, Sun, Trash2 } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Icon, message, modal, Space, Tag, Table, type Column } from \"react-kui\";\nimport { people, type Person } from \"./data\";\nexport default function App() {\n const [data, setData] = useState([...people]);\n const move = (index: number, offset: number) => {\n const target = index + offset;\n if (target < 0 || target >= data.length) return;\n const next = [...data];\n [next[index], next[target]] = [next[target], next[index]];\n setData(next);\n };\n const columns: Column<Person>[] = [\n { title: \"Name\", key: \"name\" },\n { title: \"Age\", key: \"age\" },\n {\n title: \"Gender\",\n key: \"gender\",\n render: (v) => (\n <Icon type={v === 1 ? Sun : Moon} color={v === 1 ? \"blue\" : \"#f50cff\"} size={15} />\n ),\n },\n { title: \"Address\", key: \"address\" },\n {\n title: \"Tags\",\n key: \"tags\",\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n },\n {\n title: \"Operate\",\n key: \"action\",\n render: (_, record, index) => (\n <Space>\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, -1);\n }}\n icon={ArrowUp}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, 1);\n }}\n icon={ArrowDown}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setData(data.filter((_, i) => i !== index));\n }}\n icon={Trash2}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n modal.info({ title: \"Hi\", content: `My name is ${record.name}` });\n }}\n >\n more\n </Button>\n </Space>\n ),\n },\n ];\n return (\n <Table\n data={data}\n columns={columns}\n onRowClick={(record) => message.info(\"Test row click: \" + record.name)}\n />\n );\n}"
48129
+ "source": "import { ArrowDown, ArrowUp, Moon, Sun, Trash2 } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Icon, message, modal, Space, Table, Tag, type Column } from \"react-kui\";\nimport { people, type Person } from \"./data\";\nexport default function App() {\n const [data, setData] = useState([...people]);\n const move = (index: number, offset: number) => {\n const target = index + offset;\n if (target < 0 || target >= data.length) return;\n const next = [...data];\n [next[index], next[target]] = [next[target], next[index]];\n setData(next);\n };\n const columns: Column<Person>[] = [\n { title: \"Name\", key: \"name\" },\n { title: \"Age\", key: \"age\" },\n {\n title: \"Gender\",\n key: \"gender\",\n render: (v) => (\n <Icon type={v === 1 ? Sun : Moon} color={v === 1 ? \"blue\" : \"#f50cff\"} size={15} />\n ),\n },\n { title: \"Address\", key: \"address\" },\n {\n title: \"Tags\",\n key: \"tags\",\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n },\n {\n title: \"Operate\",\n key: \"action\",\n width: 200,\n render: (_, record, index) => (\n <Space>\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, -1);\n }}\n icon={ArrowUp}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, 1);\n }}\n icon={ArrowDown}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setData(data.filter((_, i) => i !== index));\n }}\n icon={Trash2}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n modal.info({ title: \"Hi\", content: `My name is ${record.name}` });\n }}\n >\n more\n </Button>\n </Space>\n ),\n },\n ];\n return (\n <Table\n data={data}\n columns={columns}\n onRowClick={(record) => message.info(\"Test row click: \" + record.name)}\n />\n );\n}"
47653
48130
  },
47654
48131
  {
47655
48132
  "id": "components/table/demo/tree.tsx",
@@ -47689,18 +48166,23 @@
47689
48166
  {
47690
48167
  "id": "components/table/demo/fixed-col-header.tsx",
47691
48168
  "title": "固定头/列",
47692
- "source": "import { Button, Table, type Column } from \"react-kui\";\nconst middle: Column[] = [];\nconst values: Record<string, string> = {};\nfor (let i = 0; i < 20; i++) {\n middle.push({ title: `Col${i}`, key: `address${i}`, width: 150 });\n values[`address${i}`] = \"Hubei Wuhan SoftBase No.128\";\n}\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"Han Mei\",\n age: 28,\n ...values,\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", fixed: \"left\" },\n { title: \"Age\", key: \"age\", fixed: \"left\" },\n ...middle,\n {\n title: \"Operate\",\n key: \"action\",\n fixed: \"right\",\n render: () => <Button size=\"small\">test</Button>,\n },\n {\n title: \"Operate\",\n key: \"action1\",\n fixed: \"right\",\n render: () => <Button size=\"small\">test2</Button>,\n },\n];\nexport default function App() {\n return <Table data={data} columns={columns} scroll={{ y: 300 }} />;\n}"
48169
+ "source": "import { Button, Table, type Column } from \"react-kui\";\nconst middle: Column[] = [];\nconst values: Record<string, string> = {};\nfor (let i = 0; i < 20; i++) {\n middle.push({ title: `Col${i}`, key: `address${i}`, width: 150 });\n values[`address${i}`] = \"Hubei Wuhan SoftBase No.128\";\n}\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"Han Mei\",\n age: 28,\n ...values,\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", fixed: \"left\" },\n { title: \"Age\", key: \"age\", fixed: \"left\" },\n ...middle,\n // 分组父列上的 `fixed` 会继承给它的每个叶子列,整组一起固定\n {\n title: \"Operate\",\n key: \"operate\",\n fixed: \"right\",\n children: [\n {\n title: \"Edit\",\n key: \"action\",\n render: () => <Button size=\"small\">test</Button>,\n },\n {\n title: \"More\",\n key: \"action1\",\n render: () => <Button size=\"small\">test2</Button>,\n },\n ],\n },\n];\nexport default function App() {\n return <Table data={data} columns={columns} scroll={{ y: 300 }} />;\n}"
47693
48170
  },
47694
48171
  {
47695
48172
  "id": "components/table/demo/header-span.tsx",
47696
48173
  "title": "表头分组",
47697
- "source": "import { Table, type Column } from \"react-kui\";\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"John Brown\",\n age: i + 1,\n street: \"Lake Park\",\n building: \"C\",\n number: 2035,\n companyAddress: \"Lake Street 42\",\n companyName: \"SoftLake Co\",\n gender: \"M\",\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", width: 120, fixed: \"left\" },\n {\n title: \"Other\",\n key: \"other\",\n children: [\n { title: \"Age\", key: \"age\", sorter: true },\n {\n title: \"Address\",\n key: \"address\",\n children: [\n { title: \"Street\", key: \"street\" },\n {\n title: \"Block\",\n key: \"block\",\n children: [\n { title: \"Building\", key: \"building\" },\n { title: \"Door No.\", key: \"number\" },\n ],\n },\n ],\n },\n ],\n },\n {\n title: \"Company\",\n key: \"company\",\n children: [\n { title: \"Company Address\", key: \"companyAddress\", width: 200 },\n { title: \"Company Name\", key: \"companyName\", width: 200 },\n ],\n },\n { title: \"Gender\", key: \"gender\", width: 100, fixed: \"right\" },\n];\nexport default function App() {\n return <Table data={data} columns={columns} bordered scroll={{ y: 300 }} />;\n}"
48174
+ "source": "import { Table, type Column } from \"react-kui\";\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"John Brown\",\n age: i + 1,\n street: \"Lake Park\",\n building: \"C\",\n number: 2035,\n companyAddress: \"Lake Street 42\",\n companyName: \"SoftLake Co\",\n gender: \"M\",\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", width: 120, fixed: \"left\" },\n {\n title: \"Other\",\n key: \"other\",\n children: [\n { title: \"Age\", key: \"age\", width: 100, sorter: true },\n {\n title: \"Address\",\n key: \"address\",\n children: [\n { title: \"Street\", key: \"street\", width: 140 },\n {\n title: \"Block\",\n key: \"block\",\n children: [\n { title: \"Building\", key: \"building\", width: 120 },\n { title: \"Door No.\", key: \"number\", width: 120 },\n ],\n },\n ],\n },\n ],\n },\n {\n title: \"Company\",\n key: \"company\",\n children: [\n { title: \"Company Address\", key: \"companyAddress\", width: 200 },\n { title: \"Company Name\", key: \"companyName\", width: 200 },\n ],\n },\n { title: \"Gender\", key: \"gender\", width: 100, fixed: \"right\" },\n];\nexport default function App() {\n // `scroll.x` 按叶子列宽度之和给(120+100+140+120+120+200+200+100 = 1_100)。\n // 不给的话这些窄列会被挤到十几个像素,表头文字竖排换行,四层表头能长到 400 多 px,\n // 比 `scroll.y` 的可视高度还高,等于把表体整个顶出可视区。\n return <Table data={data} columns={columns} bordered scroll={{ x: 1_100, y: 300 }} />;\n}"
47698
48175
  },
47699
48176
  {
47700
48177
  "id": "components/table/demo/table-check.tsx",
47701
48178
  "title": "勾选",
47702
48179
  "source": "import { useState } from \"react\";\nimport { Space, Tag, Table, type Column } from \"react-kui\";\nimport { basicColumns, people, type Person } from \"./data\";\nconst columns: Column<Person>[] = [\n ...basicColumns.map((column) =>\n column.key === \"tags\"\n ? {\n ...column,\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n }\n : column\n ),\n {\n title: \"Operate\",\n key: \"action\",\n render: () => (\n <Space>\n <a href=\"#\">Edit</a>\n <a href=\"#\">Delete</a>\n </Space>\n ),\n },\n];\nexport default function App() {\n const [selectedKeys, setSelectedKeys] = useState<Array<string | number>>([]);\n return (\n <>\n <code>selectedKeys: {selectedKeys.join(\", \")}</code>\n <Table\n data={people}\n columns={columns}\n checkable\n selectedKeys={selectedKeys}\n onSelectedKeysChange={setSelectedKeys}\n />\n </>\n );\n}"
47703
48180
  },
48181
+ {
48182
+ "id": "components/table/demo/nested-value.tsx",
48183
+ "title": "嵌套取值",
48184
+ "source": "import { Table, type Column } from \"react-kui\";\n\n/**\n * 嵌套数据不需要先拍平:列 `key`、`rowKey`、`childrenColumnName` 都可以写成 `a.b` 点路径。\n * 整名优先,所以字段名本身带点号时仍按整名取值;下钻途中缺字段只会渲染成空,不会抛错。\n */\ninterface Member {\n meta: { uid: string };\n profile: { name: string; city?: string };\n tags?: string[];\n rows?: { items: Member[] };\n}\n\nconst data: Member[] = [\n {\n meta: { uid: \"design\" },\n profile: { name: \"Design Guild\", city: \"Hangzhou\" },\n tags: [\"Studio\", \"Brand\"],\n rows: {\n items: [\n { meta: { uid: \"ann\" }, profile: { name: \"Ann\", city: \"Hangzhou\" }, tags: [\"Studio\"] },\n { meta: { uid: \"bob\" }, profile: { name: \"Bob\" } },\n ],\n },\n },\n {\n meta: { uid: \"front-end\" },\n profile: { name: \"Front-end Guild\", city: \"Shanghai\" },\n tags: [\"Kui\"],\n rows: {\n items: [\n {\n meta: { uid: \"cara\" },\n profile: { name: \"Cara\", city: \"Shanghai\" },\n tags: [\"Kui\", \"Charts\"],\n },\n ],\n },\n },\n];\n\nconst columns: Column<Member>[] = [\n { title: \"Name\", key: \"profile.name\", sorter: true },\n { title: \"City\", key: \"profile.city\" },\n { title: \"Primary tag\", key: \"tags.0\" },\n { title: \"Secondary tag\", key: \"tags.1\" },\n];\n\nexport default function NestedValueDemo() {\n return (\n <Table\n data={data}\n columns={columns}\n rowKey=\"meta.uid\"\n childrenColumnName=\"rows.items\"\n expandAllRows\n />\n );\n}"
48185
+ },
47704
48186
  {
47705
48187
  "id": "components/table/demo/control.tsx",
47706
48188
  "title": "动态控制表格属性",
@@ -47709,12 +48191,17 @@
47709
48191
  {
47710
48192
  "id": "components/table/demo/virtual.tsx",
47711
48193
  "title": "虚拟滚动",
47712
- "source": "import { Table, type Column } from \"react-kui\";\n\nconst data = Array.from({ length: 10000 }, (_, index) => ({\n key: index + 1,\n name: `User ${index + 1}`,\n email: `user${index + 1}@example.com`,\n status: index % 3 === 0 ? \"Active\" : \"Pending\",\n}));\n\nconst columns: Column[] = [\n { title: \"ID\", key: \"key\", width: 100 },\n { title: \"Name\", key: \"name\" },\n { title: \"Email\", key: \"email\", width: 200 },\n { title: \"Email1\", key: \"email1\" },\n { title: \"Email2\", key: \"email2\" },\n { title: \"Email3\", key: \"email3\" },\n { title: \"Email4\", key: \"email4\" },\n { title: \"Email5\", key: \"email5\" },\n { title: \"Status\", key: \"status\", width: 140, fixed: \"right\" },\n];\n\nexport default function VirtualDemo() {\n return (\n <Table\n virtual\n striped\n data={data}\n columns={columns}\n scroll={{ x: 900, y: 360 }}\n itemHeight={44}\n overscan={6}\n />\n );\n}"
48194
+ "source": "import { Table, type Column } from \"react-kui\";\n\nconst data = Array.from({ length: 10000 }, (_, index) => ({\n key: index + 1,\n name: `User ${index + 1}`,\n email: `user${index + 1}@example.com`,\n status: index % 3 === 0 ? \"Active\" : \"Pending\",\n}));\n\nconst columns: Column[] = [\n { title: \"ID\", key: \"key\", width: 100 },\n { title: \"Name\", key: \"name\", width: 200 },\n { title: \"Email\", key: \"email\", width: 200 },\n { title: \"Email1\", key: \"email1\", width: 100 },\n { title: \"Email2\", key: \"email2\", width: 100 },\n { title: \"Email3\", key: \"email3\", width: 100 },\n { title: \"Email4\", key: \"email4\", width: 100 },\n { title: \"Email5\", key: \"email5\", width: 100 },\n { title: \"Status\", key: \"status\", width: 140, fixed: \"right\" },\n];\n\nexport default function VirtualDemo() {\n return (\n <Table\n virtual\n striped\n data={data}\n columns={columns}\n scroll={{ x: 900, y: 360 }}\n itemHeight={44}\n overscan={6}\n />\n );\n}"
47713
48195
  },
47714
48196
  {
47715
48197
  "id": "components/table/demo/column-setting.tsx",
47716
48198
  "title": "列设置",
47717
- "source": "import { useState } from \"react\";\nimport { Space, Table, TableColumnSetting, type Column } from \"react-kui\";\n\nconst columns: Column[] = [\n { title: \"姓名\", key: \"name\" },\n { title: \"部门\", key: \"department\" },\n { title: \"状态\", key: \"status\" },\n];\n\nconst data = [\n { key: 1, name: \"林晓\", department: \"产品中心\", status: \"正常\" },\n { key: 2, name: \"张三\", department: \"技术中心\", status: \"正常\" },\n { key: 3, name: \"李四\", department: \"市场中心\", status: \"暂停\" },\n];\n\nexport default function ColumnSettingDemo() {\n const [hiddenKeys, setHiddenKeys] = useState<(string | number)[]>([]);\n\n return (\n <Space vertical>\n <TableColumnSetting\n columns={columns}\n hiddenColumnKeys={hiddenKeys}\n onHiddenColumnKeysChange={setHiddenKeys}\n disabledKeys={[\"name\"]}\n title=\"显示列\"\n resetText=\"重置\"\n />\n <Table data={data} columns={columns} hiddenColumnKeys={hiddenKeys} />\n </Space>\n );\n}"
48199
+ "source": "import { useState } from \"react\";\nimport { Space, Table, TableColumnSetting, type Column } from \"react-kui\";\n\nconst columns: Column[] = [\n { title: \"姓名\", key: \"name\" },\n { title: \"部门\", key: \"department\" },\n { title: \"状态\", key: \"status\" },\n];\n\nconst data = [\n { key: 1, name: \"林晓\", department: \"产品中心\", status: \"正常\" },\n { key: 2, name: \"张三\", department: \"技术中心\", status: \"正常\" },\n { key: 3, name: \"李四\", department: \"市场中心\", status: \"暂停\" },\n];\n\nexport default function ColumnSettingDemo() {\n const [hiddenKeys, setHiddenKeys] = useState<(string | number)[]>([]);\n\n return (\n <Space vertical>\n <TableColumnSetting\n columns={columns}\n hiddenKeys={hiddenKeys}\n onHiddenKeysChange={setHiddenKeys}\n disabledKeys={[\"name\"]}\n title=\"显示列\"\n resetText=\"重置\"\n />\n <Table data={data} columns={columns} hiddenColumnKeys={hiddenKeys} />\n </Space>\n );\n}"
48200
+ },
48201
+ {
48202
+ "id": "components/table/demo/ellipsis.tsx",
48203
+ "title": "省略号",
48204
+ "source": "import { Space, Switch, Table, type Column } from \"react-kui\";\nimport { useState } from \"react\";\n\n/**\n * 单元格内容超出列宽时截断成省略号:表格级 `ellipsis` 一次管所有列,列上的 `ellipsis` 覆盖它,\n * 那一列想留完整内容就写 `ellipsis: false`。\n *\n * 悬停提示默认就有,但只在真的被截断时才弹(没截断的格子不会多出气泡),内容默认是截断的那段文本。\n */\ninterface Task {\n key: string;\n title: string;\n owner: string;\n note: string;\n}\n\nconst data: Task[] = [\n {\n key: \"1\",\n title: \"把双仓的表格样式对齐到同一份 LESS\",\n owner: \"Qiu\",\n note: \"固定列的宽度基准、相邻固定列的 sticky 偏移、滚动条槽位的占位三处必须用同一份数据,少同步一处就会在临界宽度上露馅,横向能滚的距离也会跟着变。\",\n },\n {\n key: \"2\",\n title: \"分组表头 + 固定列 + scroll.y\",\n owner: \"Ann\",\n note: \"分组表头配上固定列和纵向滚动时,边框、圆角和右下角的空白块最容易出问题,表头分栏之后每格的裁剪范围不同,得逐个组合回归。\",\n },\n {\n key: \"3\",\n title: \"虚拟滚动窗口\",\n owner: \"Bob\",\n note: \"虚拟滚动的窗口起点要按总行数钳上界,否则滚过头会渲染出一段空窗口,保留区高度也会算错,滚动条跟着突然抖动一下。\",\n },\n];\n\nconst columns: Column<Task>[] = [\n // 没有 `ellipsis`:跟着表格级走,单行截断。\n { title: \"任务\", key: \"title\", width: 160 },\n // 这一列单独关掉:负责人一般很短,被截断反而难看。\n { title: \"负责人\", key: \"owner\", width: 100, ellipsis: false },\n // 说明截到三行,提示换成指定内容。\n {\n title: \"说明\",\n key: \"note\",\n width: 200,\n ellipsis: { rows: 3, tooltip: \"完整说明请进需求单\" },\n },\n];\n\nexport default function EllipsisDemo() {\n const [global, setGlobal] = useState(true);\n return (\n <Space vertical>\n <Space>\n <Switch checked={global} onChange={(value) => setGlobal(Boolean(value))} />\n <span>表格级 ellipsis</span>\n </Space>\n {/* 容器压到 480px,列宽不够才看得到省略号。 */}\n <div style={{ maxWidth: 480 }}>\n <Table data={data} columns={columns} ellipsis={global} rowKey=\"key\" />\n </div>\n </Space>\n );\n}"
47718
48205
  }
47719
48206
  ]
47720
48207
  },
@@ -47729,20 +48216,19 @@
47729
48216
  "required": false,
47730
48217
  "boolean": false,
47731
48218
  "defaultExpression": "[]",
47732
- "descriptionZh": "列定义;设置面板仅列出顶层无子列的列。",
47733
- "descriptionEn": "Column definitions; only top-level columns without children appear in the settings."
48219
+ "descriptionZh": "列定义;设置面板递归列出所有叶子列,包含分组表头下的子列。",
48220
+ "descriptionEn": "Column definitions; the settings list every leaf column recursively, including children of grouped headers."
47734
48221
  },
47735
48222
  {
47736
- "name": "hiddenColumnKeys",
48223
+ "name": "hiddenKeys",
47737
48224
  "type": "(string | number)[] | undefined",
47738
48225
  "required": false,
47739
48226
  "boolean": false,
47740
- "defaultExpression": "[]",
47741
- "descriptionZh": "隐藏列的 key 集合;在变更回调中更新,并将同一值传给 Table。",
47742
- "descriptionEn": "Hidden column keys. Update this value in the change callback and pass the same value to Table."
48227
+ "descriptionZh": "隐藏列的 key 集合;在变更回调中更新,并把同一值传给 Table 的 `hiddenColumnKeys`。",
48228
+ "descriptionEn": "Hidden column keys. Update this value in the change callback and pass the same value to Table's `hiddenColumnKeys`."
47743
48229
  },
47744
48230
  {
47745
- "name": "onHiddenColumnKeysChange",
48231
+ "name": "onHiddenKeysChange",
47746
48232
  "type": "((keys: (string | number)[]) => void) | undefined",
47747
48233
  "required": false,
47748
48234
  "boolean": false,
@@ -47763,7 +48249,7 @@
47763
48249
  "type": "string | undefined",
47764
48250
  "required": false,
47765
48251
  "boolean": false,
47766
- "defaultExpression": "\"Column settings\"",
48252
+ "defaultExpression": "titleProp || locale?.k?.table?.columnSettings || \"Column settings\"",
47767
48253
  "descriptionZh": "弹层标题及默认触发按钮文案。",
47768
48254
  "descriptionEn": "Popup title and default trigger button text."
47769
48255
  },
@@ -47772,7 +48258,7 @@
47772
48258
  "type": "string | undefined",
47773
48259
  "required": false,
47774
48260
  "boolean": false,
47775
- "defaultExpression": "\"Reset\"",
48261
+ "defaultExpression": "resetTextProp || locale?.k?.table?.resetColumns || \"Reset\"",
47776
48262
  "descriptionZh": "重置按钮文案;重置会显示所有可配置列。",
47777
48263
  "descriptionEn": "Reset button text. Reset shows all configurable columns."
47778
48264
  },
@@ -47815,7 +48301,7 @@
47815
48301
  "nativeValueTypes": {},
47816
48302
  "events": [
47817
48303
  {
47818
- "name": "onHiddenColumnKeysChange",
48304
+ "name": "onHiddenKeysChange",
47819
48305
  "type": "((keys: (string | number)[]) => void) | undefined",
47820
48306
  "required": false,
47821
48307
  "boolean": false,
@@ -47834,7 +48320,7 @@
47834
48320
  {
47835
48321
  "id": "components/table/demo/basic.tsx",
47836
48322
  "title": "基本用法",
47837
- "source": "import { ArrowDown, ArrowUp, Moon, Sun, Trash2 } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Icon, message, modal, Space, Tag, Table, type Column } from \"react-kui\";\nimport { people, type Person } from \"./data\";\nexport default function App() {\n const [data, setData] = useState([...people]);\n const move = (index: number, offset: number) => {\n const target = index + offset;\n if (target < 0 || target >= data.length) return;\n const next = [...data];\n [next[index], next[target]] = [next[target], next[index]];\n setData(next);\n };\n const columns: Column<Person>[] = [\n { title: \"Name\", key: \"name\" },\n { title: \"Age\", key: \"age\" },\n {\n title: \"Gender\",\n key: \"gender\",\n render: (v) => (\n <Icon type={v === 1 ? Sun : Moon} color={v === 1 ? \"blue\" : \"#f50cff\"} size={15} />\n ),\n },\n { title: \"Address\", key: \"address\" },\n {\n title: \"Tags\",\n key: \"tags\",\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n },\n {\n title: \"Operate\",\n key: \"action\",\n render: (_, record, index) => (\n <Space>\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, -1);\n }}\n icon={ArrowUp}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, 1);\n }}\n icon={ArrowDown}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setData(data.filter((_, i) => i !== index));\n }}\n icon={Trash2}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n modal.info({ title: \"Hi\", content: `My name is ${record.name}` });\n }}\n >\n more\n </Button>\n </Space>\n ),\n },\n ];\n return (\n <Table\n data={data}\n columns={columns}\n onRowClick={(record) => message.info(\"Test row click: \" + record.name)}\n />\n );\n}"
48323
+ "source": "import { ArrowDown, ArrowUp, Moon, Sun, Trash2 } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Button, Icon, message, modal, Space, Table, Tag, type Column } from \"react-kui\";\nimport { people, type Person } from \"./data\";\nexport default function App() {\n const [data, setData] = useState([...people]);\n const move = (index: number, offset: number) => {\n const target = index + offset;\n if (target < 0 || target >= data.length) return;\n const next = [...data];\n [next[index], next[target]] = [next[target], next[index]];\n setData(next);\n };\n const columns: Column<Person>[] = [\n { title: \"Name\", key: \"name\" },\n { title: \"Age\", key: \"age\" },\n {\n title: \"Gender\",\n key: \"gender\",\n render: (v) => (\n <Icon type={v === 1 ? Sun : Moon} color={v === 1 ? \"blue\" : \"#f50cff\"} size={15} />\n ),\n },\n { title: \"Address\", key: \"address\" },\n {\n title: \"Tags\",\n key: \"tags\",\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n },\n {\n title: \"Operate\",\n key: \"action\",\n width: 200,\n render: (_, record, index) => (\n <Space>\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, -1);\n }}\n icon={ArrowUp}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n move(index, 1);\n }}\n icon={ArrowDown}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n setData(data.filter((_, i) => i !== index));\n }}\n icon={Trash2}\n />\n <Button\n size=\"small\"\n onClick={(e) => {\n e.stopPropagation();\n modal.info({ title: \"Hi\", content: `My name is ${record.name}` });\n }}\n >\n more\n </Button>\n </Space>\n ),\n },\n ];\n return (\n <Table\n data={data}\n columns={columns}\n onRowClick={(record) => message.info(\"Test row click: \" + record.name)}\n />\n );\n}"
47838
48324
  },
47839
48325
  {
47840
48326
  "id": "components/table/demo/tree.tsx",
@@ -47874,18 +48360,23 @@
47874
48360
  {
47875
48361
  "id": "components/table/demo/fixed-col-header.tsx",
47876
48362
  "title": "固定头/列",
47877
- "source": "import { Button, Table, type Column } from \"react-kui\";\nconst middle: Column[] = [];\nconst values: Record<string, string> = {};\nfor (let i = 0; i < 20; i++) {\n middle.push({ title: `Col${i}`, key: `address${i}`, width: 150 });\n values[`address${i}`] = \"Hubei Wuhan SoftBase No.128\";\n}\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"Han Mei\",\n age: 28,\n ...values,\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", fixed: \"left\" },\n { title: \"Age\", key: \"age\", fixed: \"left\" },\n ...middle,\n {\n title: \"Operate\",\n key: \"action\",\n fixed: \"right\",\n render: () => <Button size=\"small\">test</Button>,\n },\n {\n title: \"Operate\",\n key: \"action1\",\n fixed: \"right\",\n render: () => <Button size=\"small\">test2</Button>,\n },\n];\nexport default function App() {\n return <Table data={data} columns={columns} scroll={{ y: 300 }} />;\n}"
48363
+ "source": "import { Button, Table, type Column } from \"react-kui\";\nconst middle: Column[] = [];\nconst values: Record<string, string> = {};\nfor (let i = 0; i < 20; i++) {\n middle.push({ title: `Col${i}`, key: `address${i}`, width: 150 });\n values[`address${i}`] = \"Hubei Wuhan SoftBase No.128\";\n}\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"Han Mei\",\n age: 28,\n ...values,\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", fixed: \"left\" },\n { title: \"Age\", key: \"age\", fixed: \"left\" },\n ...middle,\n // 分组父列上的 `fixed` 会继承给它的每个叶子列,整组一起固定\n {\n title: \"Operate\",\n key: \"operate\",\n fixed: \"right\",\n children: [\n {\n title: \"Edit\",\n key: \"action\",\n render: () => <Button size=\"small\">test</Button>,\n },\n {\n title: \"More\",\n key: \"action1\",\n render: () => <Button size=\"small\">test2</Button>,\n },\n ],\n },\n];\nexport default function App() {\n return <Table data={data} columns={columns} scroll={{ y: 300 }} />;\n}"
47878
48364
  },
47879
48365
  {
47880
48366
  "id": "components/table/demo/header-span.tsx",
47881
48367
  "title": "表头分组",
47882
- "source": "import { Table, type Column } from \"react-kui\";\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"John Brown\",\n age: i + 1,\n street: \"Lake Park\",\n building: \"C\",\n number: 2035,\n companyAddress: \"Lake Street 42\",\n companyName: \"SoftLake Co\",\n gender: \"M\",\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", width: 120, fixed: \"left\" },\n {\n title: \"Other\",\n key: \"other\",\n children: [\n { title: \"Age\", key: \"age\", sorter: true },\n {\n title: \"Address\",\n key: \"address\",\n children: [\n { title: \"Street\", key: \"street\" },\n {\n title: \"Block\",\n key: \"block\",\n children: [\n { title: \"Building\", key: \"building\" },\n { title: \"Door No.\", key: \"number\" },\n ],\n },\n ],\n },\n ],\n },\n {\n title: \"Company\",\n key: \"company\",\n children: [\n { title: \"Company Address\", key: \"companyAddress\", width: 200 },\n { title: \"Company Name\", key: \"companyName\", width: 200 },\n ],\n },\n { title: \"Gender\", key: \"gender\", width: 100, fixed: \"right\" },\n];\nexport default function App() {\n return <Table data={data} columns={columns} bordered scroll={{ y: 300 }} />;\n}"
48368
+ "source": "import { Table, type Column } from \"react-kui\";\nconst data = Array.from({ length: 10 }, (_, i) => ({\n key: i,\n name: \"John Brown\",\n age: i + 1,\n street: \"Lake Park\",\n building: \"C\",\n number: 2035,\n companyAddress: \"Lake Street 42\",\n companyName: \"SoftLake Co\",\n gender: \"M\",\n}));\nconst columns: Column[] = [\n { title: \"Name\", key: \"name\", width: 120, fixed: \"left\" },\n {\n title: \"Other\",\n key: \"other\",\n children: [\n { title: \"Age\", key: \"age\", width: 100, sorter: true },\n {\n title: \"Address\",\n key: \"address\",\n children: [\n { title: \"Street\", key: \"street\", width: 140 },\n {\n title: \"Block\",\n key: \"block\",\n children: [\n { title: \"Building\", key: \"building\", width: 120 },\n { title: \"Door No.\", key: \"number\", width: 120 },\n ],\n },\n ],\n },\n ],\n },\n {\n title: \"Company\",\n key: \"company\",\n children: [\n { title: \"Company Address\", key: \"companyAddress\", width: 200 },\n { title: \"Company Name\", key: \"companyName\", width: 200 },\n ],\n },\n { title: \"Gender\", key: \"gender\", width: 100, fixed: \"right\" },\n];\nexport default function App() {\n // `scroll.x` 按叶子列宽度之和给(120+100+140+120+120+200+200+100 = 1_100)。\n // 不给的话这些窄列会被挤到十几个像素,表头文字竖排换行,四层表头能长到 400 多 px,\n // 比 `scroll.y` 的可视高度还高,等于把表体整个顶出可视区。\n return <Table data={data} columns={columns} bordered scroll={{ x: 1_100, y: 300 }} />;\n}"
47883
48369
  },
47884
48370
  {
47885
48371
  "id": "components/table/demo/table-check.tsx",
47886
48372
  "title": "勾选",
47887
48373
  "source": "import { useState } from \"react\";\nimport { Space, Tag, Table, type Column } from \"react-kui\";\nimport { basicColumns, people, type Person } from \"./data\";\nconst columns: Column<Person>[] = [\n ...basicColumns.map((column) =>\n column.key === \"tags\"\n ? {\n ...column,\n render: (tags: string[]) => (\n <Space>\n {tags.map((tag) => (\n <Tag key={tag} color={tag === \"Python\" ? \"green\" : \"blue\"}>\n {tag}\n </Tag>\n ))}\n </Space>\n ),\n }\n : column\n ),\n {\n title: \"Operate\",\n key: \"action\",\n render: () => (\n <Space>\n <a href=\"#\">Edit</a>\n <a href=\"#\">Delete</a>\n </Space>\n ),\n },\n];\nexport default function App() {\n const [selectedKeys, setSelectedKeys] = useState<Array<string | number>>([]);\n return (\n <>\n <code>selectedKeys: {selectedKeys.join(\", \")}</code>\n <Table\n data={people}\n columns={columns}\n checkable\n selectedKeys={selectedKeys}\n onSelectedKeysChange={setSelectedKeys}\n />\n </>\n );\n}"
47888
48374
  },
48375
+ {
48376
+ "id": "components/table/demo/nested-value.tsx",
48377
+ "title": "嵌套取值",
48378
+ "source": "import { Table, type Column } from \"react-kui\";\n\n/**\n * 嵌套数据不需要先拍平:列 `key`、`rowKey`、`childrenColumnName` 都可以写成 `a.b` 点路径。\n * 整名优先,所以字段名本身带点号时仍按整名取值;下钻途中缺字段只会渲染成空,不会抛错。\n */\ninterface Member {\n meta: { uid: string };\n profile: { name: string; city?: string };\n tags?: string[];\n rows?: { items: Member[] };\n}\n\nconst data: Member[] = [\n {\n meta: { uid: \"design\" },\n profile: { name: \"Design Guild\", city: \"Hangzhou\" },\n tags: [\"Studio\", \"Brand\"],\n rows: {\n items: [\n { meta: { uid: \"ann\" }, profile: { name: \"Ann\", city: \"Hangzhou\" }, tags: [\"Studio\"] },\n { meta: { uid: \"bob\" }, profile: { name: \"Bob\" } },\n ],\n },\n },\n {\n meta: { uid: \"front-end\" },\n profile: { name: \"Front-end Guild\", city: \"Shanghai\" },\n tags: [\"Kui\"],\n rows: {\n items: [\n {\n meta: { uid: \"cara\" },\n profile: { name: \"Cara\", city: \"Shanghai\" },\n tags: [\"Kui\", \"Charts\"],\n },\n ],\n },\n },\n];\n\nconst columns: Column<Member>[] = [\n { title: \"Name\", key: \"profile.name\", sorter: true },\n { title: \"City\", key: \"profile.city\" },\n { title: \"Primary tag\", key: \"tags.0\" },\n { title: \"Secondary tag\", key: \"tags.1\" },\n];\n\nexport default function NestedValueDemo() {\n return (\n <Table\n data={data}\n columns={columns}\n rowKey=\"meta.uid\"\n childrenColumnName=\"rows.items\"\n expandAllRows\n />\n );\n}"
48379
+ },
47889
48380
  {
47890
48381
  "id": "components/table/demo/control.tsx",
47891
48382
  "title": "动态控制表格属性",
@@ -47894,12 +48385,17 @@
47894
48385
  {
47895
48386
  "id": "components/table/demo/virtual.tsx",
47896
48387
  "title": "虚拟滚动",
47897
- "source": "import { Table, type Column } from \"react-kui\";\n\nconst data = Array.from({ length: 10000 }, (_, index) => ({\n key: index + 1,\n name: `User ${index + 1}`,\n email: `user${index + 1}@example.com`,\n status: index % 3 === 0 ? \"Active\" : \"Pending\",\n}));\n\nconst columns: Column[] = [\n { title: \"ID\", key: \"key\", width: 100 },\n { title: \"Name\", key: \"name\" },\n { title: \"Email\", key: \"email\", width: 200 },\n { title: \"Email1\", key: \"email1\" },\n { title: \"Email2\", key: \"email2\" },\n { title: \"Email3\", key: \"email3\" },\n { title: \"Email4\", key: \"email4\" },\n { title: \"Email5\", key: \"email5\" },\n { title: \"Status\", key: \"status\", width: 140, fixed: \"right\" },\n];\n\nexport default function VirtualDemo() {\n return (\n <Table\n virtual\n striped\n data={data}\n columns={columns}\n scroll={{ x: 900, y: 360 }}\n itemHeight={44}\n overscan={6}\n />\n );\n}"
48388
+ "source": "import { Table, type Column } from \"react-kui\";\n\nconst data = Array.from({ length: 10000 }, (_, index) => ({\n key: index + 1,\n name: `User ${index + 1}`,\n email: `user${index + 1}@example.com`,\n status: index % 3 === 0 ? \"Active\" : \"Pending\",\n}));\n\nconst columns: Column[] = [\n { title: \"ID\", key: \"key\", width: 100 },\n { title: \"Name\", key: \"name\", width: 200 },\n { title: \"Email\", key: \"email\", width: 200 },\n { title: \"Email1\", key: \"email1\", width: 100 },\n { title: \"Email2\", key: \"email2\", width: 100 },\n { title: \"Email3\", key: \"email3\", width: 100 },\n { title: \"Email4\", key: \"email4\", width: 100 },\n { title: \"Email5\", key: \"email5\", width: 100 },\n { title: \"Status\", key: \"status\", width: 140, fixed: \"right\" },\n];\n\nexport default function VirtualDemo() {\n return (\n <Table\n virtual\n striped\n data={data}\n columns={columns}\n scroll={{ x: 900, y: 360 }}\n itemHeight={44}\n overscan={6}\n />\n );\n}"
47898
48389
  },
47899
48390
  {
47900
48391
  "id": "components/table/demo/column-setting.tsx",
47901
48392
  "title": "列设置",
47902
- "source": "import { useState } from \"react\";\nimport { Space, Table, TableColumnSetting, type Column } from \"react-kui\";\n\nconst columns: Column[] = [\n { title: \"姓名\", key: \"name\" },\n { title: \"部门\", key: \"department\" },\n { title: \"状态\", key: \"status\" },\n];\n\nconst data = [\n { key: 1, name: \"林晓\", department: \"产品中心\", status: \"正常\" },\n { key: 2, name: \"张三\", department: \"技术中心\", status: \"正常\" },\n { key: 3, name: \"李四\", department: \"市场中心\", status: \"暂停\" },\n];\n\nexport default function ColumnSettingDemo() {\n const [hiddenKeys, setHiddenKeys] = useState<(string | number)[]>([]);\n\n return (\n <Space vertical>\n <TableColumnSetting\n columns={columns}\n hiddenColumnKeys={hiddenKeys}\n onHiddenColumnKeysChange={setHiddenKeys}\n disabledKeys={[\"name\"]}\n title=\"显示列\"\n resetText=\"重置\"\n />\n <Table data={data} columns={columns} hiddenColumnKeys={hiddenKeys} />\n </Space>\n );\n}"
48393
+ "source": "import { useState } from \"react\";\nimport { Space, Table, TableColumnSetting, type Column } from \"react-kui\";\n\nconst columns: Column[] = [\n { title: \"姓名\", key: \"name\" },\n { title: \"部门\", key: \"department\" },\n { title: \"状态\", key: \"status\" },\n];\n\nconst data = [\n { key: 1, name: \"林晓\", department: \"产品中心\", status: \"正常\" },\n { key: 2, name: \"张三\", department: \"技术中心\", status: \"正常\" },\n { key: 3, name: \"李四\", department: \"市场中心\", status: \"暂停\" },\n];\n\nexport default function ColumnSettingDemo() {\n const [hiddenKeys, setHiddenKeys] = useState<(string | number)[]>([]);\n\n return (\n <Space vertical>\n <TableColumnSetting\n columns={columns}\n hiddenKeys={hiddenKeys}\n onHiddenKeysChange={setHiddenKeys}\n disabledKeys={[\"name\"]}\n title=\"显示列\"\n resetText=\"重置\"\n />\n <Table data={data} columns={columns} hiddenColumnKeys={hiddenKeys} />\n </Space>\n );\n}"
48394
+ },
48395
+ {
48396
+ "id": "components/table/demo/ellipsis.tsx",
48397
+ "title": "省略号",
48398
+ "source": "import { Space, Switch, Table, type Column } from \"react-kui\";\nimport { useState } from \"react\";\n\n/**\n * 单元格内容超出列宽时截断成省略号:表格级 `ellipsis` 一次管所有列,列上的 `ellipsis` 覆盖它,\n * 那一列想留完整内容就写 `ellipsis: false`。\n *\n * 悬停提示默认就有,但只在真的被截断时才弹(没截断的格子不会多出气泡),内容默认是截断的那段文本。\n */\ninterface Task {\n key: string;\n title: string;\n owner: string;\n note: string;\n}\n\nconst data: Task[] = [\n {\n key: \"1\",\n title: \"把双仓的表格样式对齐到同一份 LESS\",\n owner: \"Qiu\",\n note: \"固定列的宽度基准、相邻固定列的 sticky 偏移、滚动条槽位的占位三处必须用同一份数据,少同步一处就会在临界宽度上露馅,横向能滚的距离也会跟着变。\",\n },\n {\n key: \"2\",\n title: \"分组表头 + 固定列 + scroll.y\",\n owner: \"Ann\",\n note: \"分组表头配上固定列和纵向滚动时,边框、圆角和右下角的空白块最容易出问题,表头分栏之后每格的裁剪范围不同,得逐个组合回归。\",\n },\n {\n key: \"3\",\n title: \"虚拟滚动窗口\",\n owner: \"Bob\",\n note: \"虚拟滚动的窗口起点要按总行数钳上界,否则滚过头会渲染出一段空窗口,保留区高度也会算错,滚动条跟着突然抖动一下。\",\n },\n];\n\nconst columns: Column<Task>[] = [\n // 没有 `ellipsis`:跟着表格级走,单行截断。\n { title: \"任务\", key: \"title\", width: 160 },\n // 这一列单独关掉:负责人一般很短,被截断反而难看。\n { title: \"负责人\", key: \"owner\", width: 100, ellipsis: false },\n // 说明截到三行,提示换成指定内容。\n {\n title: \"说明\",\n key: \"note\",\n width: 200,\n ellipsis: { rows: 3, tooltip: \"完整说明请进需求单\" },\n },\n];\n\nexport default function EllipsisDemo() {\n const [global, setGlobal] = useState(true);\n return (\n <Space vertical>\n <Space>\n <Switch checked={global} onChange={(value) => setGlobal(Boolean(value))} />\n <span>表格级 ellipsis</span>\n </Space>\n {/* 容器压到 480px,列宽不够才看得到省略号。 */}\n <div style={{ maxWidth: 480 }}>\n <Table data={data} columns={columns} ellipsis={global} rowKey=\"key\" />\n </div>\n </Space>\n );\n}"
47903
48399
  }
47904
48400
  ]
47905
48401
  },
@@ -48005,6 +48501,19 @@
48005
48501
  "descriptionZh": "提示框出现的位置,可选值为`top`,`top-left`,`top-right`,`bottom`,`bottom-left`,`bottom-right`,`left`,`left-top`,`left-bottom`,`right`,`right-top`,`right-bottom`",
48006
48502
  "descriptionEn": "Position where tooltip appears, optional values: `top`, `top-left`, `top-right`, `bottom`, `bottom-left`, `bottom-right`, `left`, `left-top`, `left-bottom`, `right`, `right-top`, `right-bottom`"
48007
48503
  },
48504
+ {
48505
+ "name": "destroyOnClose",
48506
+ "type": "boolean | undefined",
48507
+ "required": false,
48508
+ "enumValues": [
48509
+ false,
48510
+ true
48511
+ ],
48512
+ "boolean": true,
48513
+ "defaultExpression": "true",
48514
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
48515
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
48516
+ },
48008
48517
  {
48009
48518
  "name": "panelOnly",
48010
48519
  "type": "boolean | undefined",
@@ -48156,6 +48665,18 @@
48156
48665
  "descriptionZh": "自动悬停触发或手动控制显隐",
48157
48666
  "descriptionEn": "Automatic hover or manual visibility"
48158
48667
  },
48668
+ {
48669
+ "name": "destroyOnClose",
48670
+ "type": "boolean | undefined",
48671
+ "required": false,
48672
+ "enumValues": [
48673
+ false,
48674
+ true
48675
+ ],
48676
+ "boolean": true,
48677
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
48678
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
48679
+ },
48159
48680
  {
48160
48681
  "name": "onOpenChange",
48161
48682
  "type": "((open: boolean) => void) | undefined",
@@ -50325,8 +50846,8 @@
50325
50846
  true
50326
50847
  ],
50327
50848
  "boolean": true,
50328
- "descriptionZh": "是不显示为目录树",
50329
- "descriptionEn": "Does not display as a directory tree"
50849
+ "descriptionZh": "是否显示为目录树",
50850
+ "descriptionEn": "Whether to display a directory tree"
50330
50851
  },
50331
50852
  {
50332
50853
  "name": "disabled",
@@ -50623,8 +51144,8 @@
50623
51144
  "type": "((node: TreeNode) => Promise<unknown>) | undefined",
50624
51145
  "required": false,
50625
51146
  "boolean": false,
50626
- "descriptionZh": "异步加载数据的方法",
50627
- "descriptionEn": "Method to asynchronously load data"
51147
+ "descriptionZh": "异步加载数据的方法;成功后同一节点不会重复加载",
51148
+ "descriptionEn": "Method to asynchronously load data; a successfully loaded node is not requested again"
50628
51149
  }
50629
51150
  ],
50630
51151
  "nativeProps": [
@@ -51178,9 +51699,23 @@
51178
51699
  "bottom-right"
51179
51700
  ],
51180
51701
  "boolean": false,
51702
+ "defaultExpression": "\"bottom-left\"",
51181
51703
  "descriptionZh": "下拉框弹出位置",
51182
51704
  "descriptionEn": "Dropdown placement"
51183
51705
  },
51706
+ {
51707
+ "name": "destroyOnClose",
51708
+ "type": "boolean | undefined",
51709
+ "required": false,
51710
+ "enumValues": [
51711
+ false,
51712
+ true
51713
+ ],
51714
+ "boolean": true,
51715
+ "defaultExpression": "true",
51716
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
51717
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
51718
+ },
51184
51719
  {
51185
51720
  "name": "width",
51186
51721
  "type": "number | undefined",
@@ -51226,6 +51761,7 @@
51226
51761
  true
51227
51762
  ],
51228
51763
  "boolean": true,
51764
+ "defaultExpression": "true",
51229
51765
  "descriptionZh": "是否可以清空选项",
51230
51766
  "descriptionEn": "Whether options can be cleared"
51231
51767
  },
@@ -51310,6 +51846,7 @@
51310
51846
  true
51311
51847
  ],
51312
51848
  "boolean": true,
51849
+ "defaultExpression": "true",
51313
51850
  "descriptionZh": "是否显示边框",
51314
51851
  "descriptionEn": "Whether to show border"
51315
51852
  },
@@ -51322,6 +51859,7 @@
51322
51859
  true
51323
51860
  ],
51324
51861
  "boolean": true,
51862
+ "defaultExpression": "true",
51325
51863
  "descriptionZh": "是否显示下拉按钮",
51326
51864
  "descriptionEn": "Whether to show dropdown button"
51327
51865
  },
@@ -51340,7 +51878,6 @@
51340
51878
  "enumValues": [
51341
51879
  "dashed",
51342
51880
  "solid",
51343
- "default",
51344
51881
  "fill",
51345
51882
  "outline",
51346
51883
  "plain",
@@ -51348,7 +51885,7 @@
51348
51885
  ],
51349
51886
  "boolean": false,
51350
51887
  "descriptionZh": "主题",
51351
- "descriptionEn": "The theme of TreeSelect"
51888
+ "descriptionEn": "Theme"
51352
51889
  },
51353
51890
  {
51354
51891
  "name": "emptyText",
@@ -51385,6 +51922,7 @@
51385
51922
  "type": "IconType[] | undefined",
51386
51923
  "required": false,
51387
51924
  "boolean": false,
51925
+ "defaultExpression": "ChevronDown",
51388
51926
  "descriptionZh": "自定义下拉箭头图标",
51389
51927
  "descriptionEn": "Custom dropdown arrow icon"
51390
51928
  },
@@ -51429,6 +51967,7 @@
51429
51967
  true
51430
51968
  ],
51431
51969
  "boolean": true,
51970
+ "defaultExpression": "true",
51432
51971
  "descriptionZh": "是否展示图标",
51433
51972
  "descriptionEn": "Whether to show icons"
51434
51973
  },
@@ -51505,6 +52044,7 @@
51505
52044
  true
51506
52045
  ],
51507
52046
  "boolean": true,
52047
+ "defaultExpression": "false",
51508
52048
  "descriptionZh": "是否启用虚拟滚动",
51509
52049
  "descriptionEn": "Whether to enable virtual scrolling"
51510
52050
  },
@@ -51513,6 +52053,7 @@
51513
52053
  "type": "number | undefined",
51514
52054
  "required": false,
51515
52055
  "boolean": false,
52056
+ "defaultExpression": "260",
51516
52057
  "descriptionZh": "虚拟滚动视口高度",
51517
52058
  "descriptionEn": "Virtual scrolling viewport height"
51518
52059
  },
@@ -51521,6 +52062,7 @@
51521
52062
  "type": "number | undefined",
51522
52063
  "required": false,
51523
52064
  "boolean": false,
52065
+ "defaultExpression": "28",
51524
52066
  "descriptionZh": "虚拟滚动节点高度",
51525
52067
  "descriptionEn": "Virtual node height"
51526
52068
  },
@@ -51529,6 +52071,7 @@
51529
52071
  "type": "number | undefined",
51530
52072
  "required": false,
51531
52073
  "boolean": false,
52074
+ "defaultExpression": "5",
51532
52075
  "descriptionZh": "可视区域外预渲染的节点数量",
51533
52076
  "descriptionEn": "Extra nodes rendered outside the viewport"
51534
52077
  },
@@ -52113,15 +52656,14 @@
52113
52656
  "enumValues": [
52114
52657
  "dashed",
52115
52658
  "solid",
52116
- "default",
52117
52659
  "fill",
52118
52660
  "outline",
52119
52661
  "plain",
52120
52662
  "underlined"
52121
52663
  ],
52122
52664
  "boolean": false,
52123
- "descriptionZh": "组件主题。",
52124
- "descriptionEn": "Component theme."
52665
+ "descriptionZh": "主题",
52666
+ "descriptionEn": "Theme"
52125
52667
  },
52126
52668
  {
52127
52669
  "name": "bordered",
@@ -52132,6 +52674,7 @@
52132
52674
  true
52133
52675
  ],
52134
52676
  "boolean": true,
52677
+ "defaultExpression": "true",
52135
52678
  "descriptionZh": "是否显示边框。",
52136
52679
  "descriptionEn": "Whether to display the border."
52137
52680
  },
@@ -52158,6 +52701,7 @@
52158
52701
  true
52159
52702
  ],
52160
52703
  "boolean": true,
52704
+ "defaultExpression": "true",
52161
52705
  "descriptionZh": "是否显示下拉箭头。",
52162
52706
  "descriptionEn": "Whether to display the dropdown arrow."
52163
52707
  },
@@ -52182,6 +52726,7 @@
52182
52726
  "type": "IconType[] | undefined",
52183
52727
  "required": false,
52184
52728
  "boolean": false,
52729
+ "defaultExpression": "ChevronDown",
52185
52730
  "descriptionZh": "自定义下拉箭头。",
52186
52731
  "descriptionEn": "Custom dropdown arrow."
52187
52732
  },
@@ -52234,6 +52779,7 @@
52234
52779
  true
52235
52780
  ],
52236
52781
  "boolean": true,
52782
+ "defaultExpression": "true",
52237
52783
  "descriptionZh": "是否支持一键清空所选路径。",
52238
52784
  "descriptionEn": "Whether to support clearing the selected path with one click."
52239
52785
  },
@@ -52259,6 +52805,7 @@
52259
52805
  "click"
52260
52806
  ],
52261
52807
  "boolean": false,
52808
+ "defaultExpression": "\"click\"",
52262
52809
  "descriptionZh": "下一级菜单的展开交互触发方式。可选值:`'click'` (点击) 或 `'hover'` (鼠标悬浮即展开)。",
52263
52810
  "descriptionEn": "Interaction mode for expanding the next-level menu. Options: `'click'` or `'hover'`."
52264
52811
  },
@@ -52271,6 +52818,7 @@
52271
52818
  true
52272
52819
  ],
52273
52820
  "boolean": true,
52821
+ "defaultExpression": "true",
52274
52822
  "descriptionZh": "是否展示完整选中的祖先路径。若为 `false` 则仅在输入框内显示最终的末端叶子节点。",
52275
52823
  "descriptionEn": "Whether to display the full selected ancestor path. If `false`, only the final leaf node is shown in the input box."
52276
52824
  },
@@ -52279,6 +52827,7 @@
52279
52827
  "type": "string | undefined",
52280
52828
  "required": false,
52281
52829
  "boolean": false,
52830
+ "defaultExpression": "\" / \"",
52282
52831
  "descriptionZh": "当 `showAllLevels` 开启时,各层级标签之间的多级分隔符。",
52283
52832
  "descriptionEn": "Separator between labels of different levels when `showAllLevels` is enabled."
52284
52833
  },
@@ -52295,9 +52844,23 @@
52295
52844
  "bottom-right"
52296
52845
  ],
52297
52846
  "boolean": false,
52847
+ "defaultExpression": "\"bottom-left\"",
52298
52848
  "descriptionZh": "弹层位置。",
52299
52849
  "descriptionEn": "Popup placement."
52300
52850
  },
52851
+ {
52852
+ "name": "destroyOnClose",
52853
+ "type": "boolean | undefined",
52854
+ "required": false,
52855
+ "enumValues": [
52856
+ false,
52857
+ true
52858
+ ],
52859
+ "boolean": true,
52860
+ "defaultExpression": "true",
52861
+ "descriptionZh": "关闭后是否销毁面板内容。默认销毁(重开时重新挂载);设为 false 可保留面板内已填写的表单状态,代价是每个打开过的实例留一份隐藏 DOM",
52862
+ "descriptionEn": "Whether to destroy panel content after closing. Destroyed by default (remounted on reopen); set false to keep form state at the cost of one hidden DOM node per opened instance"
52863
+ },
52301
52864
  {
52302
52865
  "name": "onChange",
52303
52866
  "type": "((value: CascaderValue) => void) | undefined",
@@ -52740,6 +53303,11 @@
52740
53303
  "id": "components/cascader/demo/size.tsx",
52741
53304
  "title": "尺寸/形态",
52742
53305
  "source": "import { ArrowDown, Search } from \"kui-icons\";\nimport { useState } from \"react\";\nimport { Cascader, Space, type CascaderOption, type CascaderValue } from \"react-kui\";\n\nconst simpleOptions: CascaderOption[] = [\n {\n value: \"1\",\n label: \"选项一\",\n children: [\n { value: \"1-1\", label: \"子选项 A\" },\n { value: \"1-2\", label: \"子选项 B\" },\n ],\n },\n { value: \"2\", label: \"选项二\", children: [{ value: \"2-1\", label: \"子选项 C\" }] },\n];\n\nexport default function App() {\n const [value, setValue] = useState<CascaderValue>([]);\n const common = { value, onChange: setValue, options: simpleOptions, style: { width: 240 } };\n return (\n <Space vertical size={12}>\n <Cascader {...common} shape=\"circle\" placeholder=\"Circle\" />\n <Cascader {...common} showArrow={false} placeholder=\"No Arrow\" />\n <Cascader {...common} arrowIcon={ArrowDown} placeholder=\"Custom Arrow\" />\n <Cascader {...common} icon={Search} placeholder=\"With Icon\" />\n <Cascader {...common} theme=\"solid\" placeholder=\"Solid\" />\n <Cascader {...common} theme=\"plain\" placeholder=\"Plain\" />\n <Cascader {...common} size=\"large\" placeholder=\"Large Size (38px)\" />\n <Cascader {...common} placeholder=\"Default Size (32px)\" />\n <Cascader {...common} size=\"small\" placeholder=\"Small Size (24px)\" />\n </Space>\n );\n}"
53306
+ },
53307
+ {
53308
+ "id": "components/cascader/demo/theme.tsx",
53309
+ "title": "外观档位",
53310
+ "source": "import { useState } from \"react\";\nimport {\n Cascader,\n Space,\n type CascaderOption,\n type CascaderValue,\n type ThemeType,\n} from \"react-kui\";\n\nconst areaOptions: CascaderOption[] = [\n {\n value: \"hubei\",\n label: \"湖北省\",\n children: [\n { value: \"wuhan\", label: \"武汉市\", children: [{ value: \"hongshan\", label: \"洪山区\" }] },\n { value: \"huanggang\", label: \"黄冈市\" },\n ],\n },\n {\n value: \"guangdong\",\n label: \"广东省\",\n children: [\n { value: \"shenzhen\", label: \"深圳市\", children: [{ value: \"nanshan\", label: \"南山区\" }] },\n { value: \"guangzhou\", label: \"广州市\" },\n ],\n },\n];\n\n// A cascader is a text control with a tree behind it, so it paints the same six tiers an input does: `fill`\n// — its own look — plates the box, `outline` and `dashed` edge it, `plain` leaves it bare, `solid` plates it\n// on the primary and inverts the chosen path and the arrow, `underlined` keeps only the bottom rule. Only the\n// trigger box takes a tier; the popup it opens keeps the library's popup surface in every one of them.\nconst tiers: ThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\", \"underlined\"];\n\nexport default function App() {\n const [selected, setSelected] = useState<CascaderValue>([\"guangdong\", \"shenzhen\", \"nanshan\"]);\n return (\n <Space vertical block style={{ width: 260, maxWidth: \"100%\" }}>\n {tiers.map((tier) => (\n <div key={tier} style={{ display: \"grid\", gap: 4, justifyItems: \"start\" }}>\n <code>theme: {tier}</code>\n <Cascader\n value={selected}\n onChange={setSelected}\n options={areaOptions}\n theme={tier}\n placeholder=\"请选择省市区\"\n style={{ width: \"100%\" }}\n />\n </div>\n ))}\n </Space>\n );\n}"
52743
53311
  }
52744
53312
  ]
52745
53313
  },
@@ -52779,8 +53347,8 @@
52779
53347
  "type": "string | undefined",
52780
53348
  "required": false,
52781
53349
  "boolean": false,
52782
- "descriptionZh": "标签的颜色",
52783
- "descriptionEn": "Tag color"
53350
+ "descriptionZh": "标签颜色:预设色值名(与 `Badge` 同一套,如 `blue`)或任意可读色值",
53351
+ "descriptionEn": "Tag color: a preset name (the same set `Badge` uses, e.g. `blue`) or any readable color value"
52784
53352
  },
52785
53353
  {
52786
53354
  "name": "shape",
@@ -52814,23 +53382,23 @@
52814
53382
  "large"
52815
53383
  ],
52816
53384
  "boolean": false,
52817
- "descriptionZh": "按钮尺寸,可选值 `small`、`large`,默认不选",
52818
- "descriptionEn": "Button size, optional values `small`, `large`, default not selected"
53385
+ "defaultExpression": "sizeProp ?? inheritedAppearance.size ?? \"small\"",
53386
+ "descriptionZh": "标签尺寸,可选值 `small`、`medium`、`large`",
53387
+ "descriptionEn": "Tag size, optional values `small`, `medium`, `large`"
52819
53388
  },
52820
53389
  {
52821
53390
  "name": "theme",
52822
- "type": "ThemeType | undefined",
53391
+ "type": "SurfaceThemeType | undefined",
52823
53392
  "required": false,
52824
53393
  "enumValues": [
52825
53394
  "dashed",
52826
53395
  "solid",
52827
- "default",
52828
53396
  "fill",
52829
53397
  "outline",
52830
- "plain",
52831
- "underlined"
53398
+ "plain"
52832
53399
  ],
52833
53400
  "boolean": false,
53401
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"fill\"",
52834
53402
  "descriptionZh": "组件呈现主题",
52835
53403
  "descriptionEn": "The component renders the theme"
52836
53404
  },
@@ -53252,7 +53820,7 @@
53252
53820
  {
53253
53821
  "id": "components/tag/demo/size.tsx",
53254
53822
  "title": "尺寸和形状",
53255
- "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, Tag } from \"react-kui\";\nimport type { ShapeType, SizeType, ThemeType } from \"react-kui\";\nconst sizes = [\n { label: \"Large\", value: \"large\" },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n shapes = [\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"small\"),\n [shape, setShape] = useState<ShapeType>(\"circle\"),\n [theme, setTheme] = useState<ThemeType>(\"fill\");\n return (\n <Space vertical>\n <RadioGroup value={size} type=\"button\" options={sizes} onChange={setSize} />\n <RadioGroup value={shape} type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} type=\"button\" options={themes} onChange={setTheme} />\n {[1, 2, 3].map((x) => (\n <Tag key={x} size={size} shape={shape} theme={theme}>\n Tag{x}\n </Tag>\n ))}\n </Space>\n );\n}"
53823
+ "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, Tag } from \"react-kui\";\nimport type { ShapeType, SizeType, SurfaceThemeType } from \"react-kui\";\nconst sizes = [\n { label: \"Large\", value: \"large\" },\n { label: \"Medium\", value: \"medium\" },\n { label: \"Small\", value: \"small\" },\n ],\n shapes = [\n { label: \"Circle\", value: \"circle\" },\n { label: \"Square\", value: \"square\" },\n ],\n themes = [\n { label: \"Fill\", value: \"fill\" },\n { label: \"Outline\", value: \"outline\" },\n ];\nexport default function App() {\n const [size, setSize] = useState<SizeType>(\"small\"),\n [shape, setShape] = useState<ShapeType>(\"circle\"),\n [theme, setTheme] = useState<SurfaceThemeType>(\"fill\");\n return (\n <Space vertical>\n <RadioGroup value={size} type=\"button\" options={sizes} onChange={setSize} />\n <RadioGroup value={shape} type=\"button\" options={shapes} onChange={setShape} />\n <RadioGroup value={theme} type=\"button\" options={themes} onChange={setTheme} />\n {[1, 2, 3].map((x) => (\n <Tag key={x} size={size} shape={shape} theme={theme}>\n Tag{x}\n </Tag>\n ))}\n </Space>\n );\n}"
53256
53824
  },
53257
53825
  {
53258
53826
  "id": "components/tag/demo/icon.tsx",
@@ -53262,12 +53830,17 @@
53262
53830
  {
53263
53831
  "id": "components/tag/demo/color.tsx",
53264
53832
  "title": "多彩标签",
53265
- "source": "import { Space, Tag } from \"react-kui\";\nconst colors = [\n \"pink\",\n \"red\",\n \"yellow\",\n \"orange\",\n \"cyan\",\n \"green\",\n \"blue\",\n \"purple\",\n \"magenta\",\n \"volcano\",\n \"gold\",\n \"lime\",\n ],\n custom = [\"#c20\", \"#39f\", \"#e3f\", \"#6c0\"];\nexport default function App() {\n return (\n <div>\n <h4 style={{ marginBottom: 16 }}>Presets:</h4>\n <Space wrap>\n {colors.map((color) => (\n <Tag key={color} color={color}>\n {color}\n </Tag>\n ))}\n </Space>\n <h4 style={{ margin: \"16px 0\" }}>Custom:</h4>\n <Space>\n {custom.map((color) => (\n <Tag key={color} color={color}>\n {color}\n </Tag>\n ))}\n </Space>\n </div>\n );\n}"
53833
+ "source": "import { Space, Tag } from \"react-kui\";\nconst colors = [\n \"red\",\n \"orange\",\n \"yellow\",\n \"olive\",\n \"green\",\n \"teal\",\n \"blue\",\n \"volcano\",\n \"violet\",\n \"cyan\",\n \"gold\",\n \"lime\",\n \"magenta\",\n \"purple\",\n \"pink\",\n \"brown\",\n \"gray\",\n ],\n custom = [\"#c20\", \"#39f\", \"#e3f\", \"#6c0\"];\nexport default function App() {\n return (\n <div>\n <h4 style={{ marginBottom: 16 }}>Presets:</h4>\n <Space wrap>\n {colors.map((color) => (\n <Tag key={color} color={color}>\n {color}\n </Tag>\n ))}\n </Space>\n <h4 style={{ margin: \"16px 0\" }}>Custom:</h4>\n <Space>\n {custom.map((color) => (\n <Tag key={color} color={color}>\n {color}\n </Tag>\n ))}\n </Space>\n </div>\n );\n}"
53266
53834
  },
53267
53835
  {
53268
53836
  "id": "components/tag/demo/dynamic.tsx",
53269
53837
  "title": "动态添加和删除",
53270
53838
  "source": "import { Bookmark } from \"kui-icons\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { Button, Input, Space, Tag } from \"react-kui\";\nexport default function App() {\n const [tags, setTags] = useState([\"Apple\", \"Banana\", \"Cat\", \"Dog\"]),\n [showInput, setShowInput] = useState(false),\n [tag, setTag] = useState(\"\"),\n ref = useRef<HTMLInputElement>(null);\n useEffect(() => {\n if (showInput) ref.current?.focus();\n }, [showInput]);\n const add = () => {\n const value = tag.trim();\n if (value && !tags.includes(value)) setTags((items) => [...items, value]);\n setTag(\"\");\n setShowInput(false);\n };\n return (\n <Space wrap>\n {tags.map((value) => (\n <Tag\n color=\"blue\"\n closeable\n key={value}\n onAfterClose={() => setTags((items) => items.filter((item) => item !== value))}\n >\n {value}\n </Tag>\n ))}\n {showInput ? (\n <Input\n ref={ref}\n value={tag}\n onChange={setTag}\n onBlur={add}\n onKeyDown={(e) => e.key === \"Enter\" && add()}\n size=\"small\"\n style={{ width: 81 }}\n />\n ) : (\n <Button onClick={() => setShowInput(true)} size=\"small\" icon={Bookmark}>\n New Tag\n </Button>\n )}\n </Space>\n );\n}"
53839
+ },
53840
+ {
53841
+ "id": "components/tag/demo/appearance.tsx",
53842
+ "title": "外观",
53843
+ "source": "import { Space, Tag, type SurfaceThemeType } from \"react-kui\";\n\n// A tag paints the same five tiers as any other surface and starts on `fill`. `solid` is the tier that moves\n// the text: the chip goes to the primary and the label and close button invert with it. A `color` written on\n// the tag outranks the tier, which the colour demo shows, so this one leaves it out and keeps one chip per\n// tier.\nconst tiers: SurfaceThemeType[] = [\"fill\", \"outline\", \"plain\", \"solid\", \"dashed\"];\n\nexport default function App() {\n return (\n <Space wrap size={16}>\n {tiers.map((tier) => (\n <Tag key={tier} theme={tier} closeable>\n theme: {tier}\n </Tag>\n ))}\n </Space>\n );\n}"
53271
53844
  }
53272
53845
  ]
53273
53846
  },
@@ -54260,6 +54833,7 @@
54260
54833
  "type": "string | undefined",
54261
54834
  "required": false,
54262
54835
  "boolean": false,
54836
+ "defaultExpression": "\"post\"",
54263
54837
  "descriptionZh": "上传请求的 http method",
54264
54838
  "descriptionEn": "HTTP method for upload request"
54265
54839
  },
@@ -54268,6 +54842,7 @@
54268
54842
  "type": "string | undefined",
54269
54843
  "required": false,
54270
54844
  "boolean": false,
54845
+ "defaultExpression": "\"file\"",
54271
54846
  "descriptionZh": "发到后台的文件参数名,默认`file`",
54272
54847
  "descriptionEn": "File parameter name sent to backend, default `file`"
54273
54848
  },
@@ -54288,6 +54863,7 @@
54288
54863
  "picture"
54289
54864
  ],
54290
54865
  "boolean": false,
54866
+ "defaultExpression": "\"list\"",
54291
54867
  "descriptionZh": "选择上传文件之后所呈现的形式",
54292
54868
  "descriptionEn": "Display style after selecting files"
54293
54869
  },
@@ -54296,6 +54872,7 @@
54296
54872
  "type": "Record<string, string | number | boolean | Blob> | undefined",
54297
54873
  "required": false,
54298
54874
  "boolean": false,
54875
+ "defaultExpression": "{}",
54299
54876
  "descriptionZh": "上传可能所需的其它参数",
54300
54877
  "descriptionEn": "Other parameters that may be required for upload"
54301
54878
  },
@@ -54372,6 +54949,7 @@
54372
54949
  true
54373
54950
  ],
54374
54951
  "boolean": true,
54952
+ "defaultExpression": "false",
54375
54953
  "descriptionZh": "跨域请求是否携带凭证",
54376
54954
  "descriptionEn": "Include credentials in cross-origin requests"
54377
54955
  },
@@ -54380,6 +54958,7 @@
54380
54958
  "type": "number | undefined",
54381
54959
  "required": false,
54382
54960
  "boolean": false,
54961
+ "defaultExpression": "0",
54383
54962
  "descriptionZh": "请求超时时间(毫秒),`0` 表示不限制",
54384
54963
  "descriptionEn": "Request timeout in milliseconds"
54385
54964
  },
@@ -54408,6 +54987,7 @@
54408
54987
  true
54409
54988
  ],
54410
54989
  "boolean": true,
54990
+ "defaultExpression": "true",
54411
54991
  "descriptionZh": "是否显示上传列表",
54412
54992
  "descriptionEn": "Whether to show upload list"
54413
54993
  },
@@ -54436,6 +55016,7 @@
54436
55016
  true
54437
55017
  ],
54438
55018
  "boolean": true,
55019
+ "defaultExpression": "true",
54439
55020
  "descriptionZh": "是否自动上传",
54440
55021
  "descriptionEn": "Whether to auto upload"
54441
55022
  },
@@ -54520,6 +55101,7 @@
54520
55101
  true
54521
55102
  ],
54522
55103
  "boolean": true,
55104
+ "defaultExpression": "true",
54523
55105
  "descriptionZh": "点击照片是否打开图片预览",
54524
55106
  "descriptionEn": "Whether clicking a picture opens image preview"
54525
55107
  },
@@ -54532,6 +55114,7 @@
54532
55114
  true
54533
55115
  ],
54534
55116
  "boolean": true,
55117
+ "defaultExpression": "true",
54535
55118
  "descriptionZh": "是否校验文件类型",
54536
55119
  "descriptionEn": "Whether to validate file types"
54537
55120
  },
@@ -54540,6 +55123,7 @@
54540
55123
  "type": "number | undefined",
54541
55124
  "required": false,
54542
55125
  "boolean": false,
55126
+ "defaultExpression": "Infinity",
54543
55127
  "descriptionZh": "最大并发上传数",
54544
55128
  "descriptionEn": "Maximum concurrent uploads"
54545
55129
  },
@@ -55621,7 +56205,7 @@
55621
56205
  {
55622
56206
  "id": "components/watermark/demo/in-modal-drawer.tsx",
55623
56207
  "title": "Modal 与 Drawer 中使用",
55624
- "source": "import { useState } from \"react\";\nimport { Button, Drawer, Flex, Modal, Space, Watermark } from \"react-kui\";\nconst content = [\"审批专用\", \"张三 2026-07-10\", \"IP: 192.168.1.100\"],\n body = (\n <Flex style={{ backgroundColor: \"#f5f5f510\", height: 500 }} align=\"center\" justify=\"center\">\n <p>核心敏感数据</p>\n </Flex>\n );\nexport default function App() {\n const [modal, setModal] = useState(false),\n [drawer, setDrawer] = useState(false);\n return (\n <>\n <Modal\n open={modal}\n title=\"涉密核心资产审批\"\n onClose={() => setModal(false)}\n onCancel={() => setModal(false)}\n >\n <Watermark content={content}>{body}</Watermark>\n </Modal>\n <Drawer\n open={drawer}\n title=\"涉密核心资产审批\"\n onClose={() => setDrawer(false)}\n onCancel={() => setDrawer(false)}\n >\n <Watermark content={content}>{body}</Watermark>\n </Drawer>\n <Space>\n <Button onClick={() => setModal(true)}>Show in Modal</Button>\n <Button onClick={() => setDrawer(true)}>Show in Drawer</Button>\n </Space>\n </>\n );\n}"
56208
+ "source": "import { useState } from \"react\";\nimport { Button, Drawer, Flex, Modal, Space, Watermark } from \"react-kui\";\nconst content = [\"审批专用\", \"张三 2026-07-10\", \"IP: 192.168.1.100\"],\n body = (\n <Flex style={{ backgroundColor: \"#f5f5f510\", height: 500 }} align=\"center\" justify=\"center\">\n <p>核心敏感数据</p>\n </Flex>\n );\nexport default function App() {\n const [modal, setModal] = useState(false),\n [drawer, setDrawer] = useState(false);\n return (\n <>\n <Modal open={modal} title=\"涉密核心资产审批\" onOpenChange={setModal}>\n <Watermark content={content}>{body}</Watermark>\n </Modal>\n <Drawer open={drawer} title=\"涉密核心资产审批\" onOpenChange={setDrawer}>\n <Watermark content={content}>{body}</Watermark>\n </Drawer>\n <Space>\n <Button onClick={() => setModal(true)}>Show in Modal</Button>\n <Button onClick={() => setDrawer(true)}>Show in Drawer</Button>\n </Space>\n </>\n );\n}"
55625
56209
  },
55626
56210
  {
55627
56211
  "id": "components/watermark/demo/custom.tsx",
@@ -56090,6 +56674,7 @@
56090
56674
  "type": "TransferItem[] | undefined",
56091
56675
  "required": false,
56092
56676
  "boolean": false,
56677
+ "defaultExpression": "EMPTY_ITEMS",
56093
56678
  "descriptionZh": "数据源",
56094
56679
  "descriptionEn": "Source data"
56095
56680
  },
@@ -56106,6 +56691,7 @@
56106
56691
  "type": "[ReactNode, ReactNode] | undefined",
56107
56692
  "required": false,
56108
56693
  "boolean": false,
56694
+ "defaultExpression": "[\"Source\", \"Target\"]",
56109
56695
  "descriptionZh": "两侧标题",
56110
56696
  "descriptionEn": "Titles for both lists"
56111
56697
  },
@@ -56114,6 +56700,7 @@
56114
56700
  "type": "[string, string] | undefined",
56115
56701
  "required": false,
56116
56702
  "boolean": false,
56703
+ "defaultExpression": "[\"\", \"\"]",
56117
56704
  "descriptionZh": "向右、向左按钮文案",
56118
56705
  "descriptionEn": "Right and left operation labels"
56119
56706
  },
@@ -56126,6 +56713,7 @@
56126
56713
  true
56127
56714
  ],
56128
56715
  "boolean": true,
56716
+ "defaultExpression": "false",
56129
56717
  "descriptionZh": "是否可搜索",
56130
56718
  "descriptionEn": "Whether searchable"
56131
56719
  },
@@ -56138,6 +56726,7 @@
56138
56726
  true
56139
56727
  ],
56140
56728
  "boolean": true,
56729
+ "defaultExpression": "false",
56141
56730
  "descriptionZh": "是否禁用此项",
56142
56731
  "descriptionEn": "Disable this item"
56143
56732
  },
@@ -56150,18 +56739,23 @@
56150
56739
  true
56151
56740
  ],
56152
56741
  "boolean": true,
56742
+ "defaultExpression": "false",
56153
56743
  "descriptionZh": "是否只读",
56154
56744
  "descriptionEn": "Whether read-only"
56155
56745
  },
56156
56746
  {
56157
56747
  "name": "theme",
56158
- "type": "\"fill\" | \"outline\" | undefined",
56748
+ "type": "SurfaceThemeType | undefined",
56159
56749
  "required": false,
56160
56750
  "enumValues": [
56751
+ "dashed",
56752
+ "solid",
56161
56753
  "fill",
56162
- "outline"
56754
+ "outline",
56755
+ "plain"
56163
56756
  ],
56164
56757
  "boolean": false,
56758
+ "defaultExpression": "resolvePaintedTheme(themeProp ?? inheritedAppearance.theme, PAINTED_THEMES) ?? \"outline\"",
56165
56759
  "descriptionZh": "外观主题",
56166
56760
  "descriptionEn": "Appearance theme"
56167
56761
  },
@@ -56625,7 +57219,7 @@
56625
57219
  {
56626
57220
  "id": "components/transfer/demo/theme.tsx",
56627
57221
  "title": "主题",
56628
- "source": "import { useState } from \"react\";\nimport { Transfer } from \"react-kui\";\nconst items = [\"Design\", \"Development\", \"Testing\", \"Deployment\"].map((title, key) => ({\n key: key + 1,\n title,\n}));\nexport default function App() {\n const [outline, setOutline] = useState<(string | number)[]>([4]);\n const [fill, setFill] = useState<(string | number)[]>([4]);\n return (\n <div style={{ display: \"grid\", gap: 24 }}>\n <Transfer\n targetKeys={outline}\n onChange={(event) => setOutline(event.targetKeys)}\n searchable\n theme=\"outline\"\n dataSource={items}\n />\n <Transfer\n targetKeys={fill}\n onChange={(event) => setFill(event.targetKeys)}\n searchable\n theme=\"fill\"\n dataSource={items}\n />\n </div>\n );\n}"
57222
+ "source": "import { useState } from \"react\";\nimport { RadioGroup, Space, Transfer } from \"react-kui\";\nconst items = [\"Design\", \"Development\", \"Testing\", \"Deployment\"].map((title, key) => ({\n key: key + 1,\n title,\n}));\nexport default function App() {\n // The panels offer the five tiers they paint; `underlined` is a control tier and lands back on `outline`.\n const [theme, setTheme] = useState<\"fill\" | \"outline\" | \"plain\" | \"solid\" | \"dashed\">(\"outline\");\n const [targetKeys, setTargetKeys] = useState<(string | number)[]>([4]);\n return (\n <Space vertical block>\n <RadioGroup\n type=\"button\"\n options={[\n { label: \"Outline\", value: \"outline\" },\n { label: \"Fill\", value: \"fill\" },\n { label: \"Plain\", value: \"plain\" },\n { label: \"Solid\", value: \"solid\" },\n { label: \"Dashed\", value: \"dashed\" },\n ]}\n value={theme}\n onChange={(value) => setTheme(value as typeof theme)}\n />\n <Transfer\n targetKeys={targetKeys}\n onChange={(event) => setTargetKeys(event.targetKeys)}\n searchable\n theme={theme}\n dataSource={items}\n />\n </Space>\n );\n}"
56629
57223
  },
56630
57224
  {
56631
57225
  "id": "components/transfer/demo/disabled.tsx",