react-kui 2.0.0 → 3.0.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 (700) hide show
  1. package/AI.en-US.md +23 -0
  2. package/AI.md +76 -0
  3. package/LICENSE +21 -21
  4. package/README.zh-CN.md +142 -0
  5. package/ai/behaviors.json +16 -0
  6. package/ai/cli.mjs +27 -0
  7. package/ai/evals/README.md +59 -0
  8. package/ai/evals/cases.json +207 -0
  9. package/ai/evals/config.json +4 -0
  10. package/ai/evals/evaluate.mjs +267 -0
  11. package/ai/evals/run.mjs +118 -0
  12. package/ai/kui-components.json +58292 -0
  13. package/ai/kui-components.schema.json +143 -0
  14. package/ai/mcp.mjs +290 -0
  15. package/ai/skills/react-kui/SKILL.md +16 -0
  16. package/ai/skills/react-kui/references/components.md +9 -0
  17. package/ai/skills/react-kui/references/mcp.md +14 -0
  18. package/ai/templates/form.tsx +69 -0
  19. package/ai/templates/index.json +23 -0
  20. package/ai/templates/modal-editor.tsx +80 -0
  21. package/ai/templates/table.tsx +85 -0
  22. package/ai/validate.d.mts +16 -0
  23. package/ai/validate.mjs +184 -0
  24. package/es/_virtual/_rolldown/runtime.js +21 -0
  25. package/es/affix/index.js +222 -0
  26. package/es/alert/index.js +71 -0
  27. package/es/anchor/anchor-context.js +13 -0
  28. package/es/anchor/anchor-link.js +121 -0
  29. package/es/anchor/anchor.js +431 -0
  30. package/es/auto-complete/index.js +692 -0
  31. package/es/avatar/avatar-group-context.js +13 -0
  32. package/es/avatar/avatar-group.js +145 -0
  33. package/es/avatar/avatar.js +204 -0
  34. package/es/back-top/index.js +224 -0
  35. package/es/badge/index.js +66 -0
  36. package/es/base/teleport.js +83 -0
  37. package/es/base/transition-props.js +56 -0
  38. package/es/base/transition.js +108 -0
  39. package/es/breadcrumb/breadcrumb-context.js +13 -0
  40. package/es/breadcrumb/breadcrumb-item.js +128 -0
  41. package/es/breadcrumb/breadcrumb.js +75 -0
  42. package/es/button/button-group-context.js +13 -0
  43. package/es/button/button-group.js +100 -0
  44. package/es/button/button.js +99 -0
  45. package/es/calendar/index.js +271 -0
  46. package/es/card/index.js +157 -0
  47. package/es/carousel/carousel-context.js +17 -0
  48. package/es/carousel/carousel-item.js +71 -0
  49. package/es/carousel/carousel.js +453 -0
  50. package/es/cascader/index.js +435 -0
  51. package/es/check-card/check-card-group.js +211 -0
  52. package/es/check-card/check-card.js +326 -0
  53. package/es/check-card/context.js +13 -0
  54. package/es/checkbox/checkbox-group-context.js +13 -0
  55. package/es/checkbox/checkbox-group.js +168 -0
  56. package/es/checkbox/checkbox.js +270 -0
  57. package/es/checkbox/index.js +14 -0
  58. package/es/collapse/collapse-panel.js +233 -0
  59. package/es/collapse/collapse.js +186 -0
  60. package/es/color-picker/alpha.js +131 -0
  61. package/es/color-picker/hue.js +111 -0
  62. package/es/color-picker/index.js +329 -0
  63. package/es/color-picker/mode.js +178 -0
  64. package/es/color-picker/paint.js +175 -0
  65. package/es/color-picker/presets.js +80 -0
  66. package/es/components.js +260 -0
  67. package/es/config/config-context.js +13 -0
  68. package/es/config/context.js +26 -0
  69. package/es/config/index.js +52 -0
  70. package/es/config/size-context.js +13 -0
  71. package/es/config/use-config-appearance.js +39 -0
  72. package/es/const/var.js +31 -0
  73. package/es/date-picker/index.js +1257 -0
  74. package/es/descriptions/descriptions-item.js +25 -0
  75. package/es/descriptions/descriptions.js +285 -0
  76. package/es/divider/index.js +38 -0
  77. package/es/drawer/index.js +432 -0
  78. package/es/dropdown/dropdown-button.js +139 -0
  79. package/es/dropdown/dropdown-context.js +16 -0
  80. package/es/dropdown/dropdown.js +351 -0
  81. package/es/dropdown/trigger.js +88 -0
  82. package/es/empty/index.js +133 -0
  83. package/es/feature-card/index.js +74 -0
  84. package/es/feedback-panel/index.js +179 -0
  85. package/es/flame-wrap/index.js +262 -0
  86. package/es/flame-wrap/types.js +593 -0
  87. package/es/flex/index.js +46 -0
  88. package/es/form/field-context.js +102 -0
  89. package/es/form/form-context.js +13 -0
  90. package/es/form/form-item.js +327 -0
  91. package/es/form/form.js +303 -0
  92. package/es/form/utils.js +44 -0
  93. package/es/grid/grid-item.js +130 -0
  94. package/es/grid/grid.js +177 -0
  95. package/es/grid/useBreakpoint.js +64 -0
  96. package/es/icon/index.js +161 -0
  97. package/es/image/group.js +121 -0
  98. package/es/image/image-group-context.js +13 -0
  99. package/es/image/image.js +314 -0
  100. package/es/image/instance.js +47 -0
  101. package/es/image/preview.js +383 -0
  102. package/es/image/utils.js +39 -0
  103. package/es/index.js +129 -0
  104. package/es/input/index.js +15 -0
  105. package/es/input/input-box.js +40 -0
  106. package/es/input/input-group.js +150 -0
  107. package/es/input/input.js +203 -0
  108. package/es/input/textarea.js +135 -0
  109. package/es/input-number/index.js +153 -0
  110. package/es/input-otp/index.js +142 -0
  111. package/es/input-tag/index.js +178 -0
  112. package/es/kanban/index.js +254 -0
  113. package/es/layout/index.js +256 -0
  114. package/es/layout/layout-context.js +13 -0
  115. package/es/list-panel/index.js +194 -0
  116. package/es/loading/index.js +69 -0
  117. package/es/loading/loading-bar.js +133 -0
  118. package/es/locale/de.js +69 -0
  119. package/es/locale/el.js +69 -0
  120. package/es/locale/en.js +69 -0
  121. package/es/locale/fr.js +69 -0
  122. package/es/locale/it.js +69 -0
  123. package/es/locale/ja.js +69 -0
  124. package/es/locale/ko.js +69 -0
  125. package/es/locale/ru.js +69 -0
  126. package/es/locale/th.js +69 -0
  127. package/es/locale/uk.js +69 -0
  128. package/es/locale/vi.js +69 -0
  129. package/es/locale/zh-CN.js +69 -0
  130. package/es/locale/zh-TW.js +69 -0
  131. package/es/mentions/index.js +710 -0
  132. package/es/menu/menu-context.js +20 -0
  133. package/es/menu/menu-divider.js +29 -0
  134. package/es/menu/menu-group.js +49 -0
  135. package/es/menu/menu-item.js +79 -0
  136. package/es/menu/menu-keyboard.js +35 -0
  137. package/es/menu/menu.js +484 -0
  138. package/es/menu/recursive-menu.js +68 -0
  139. package/es/menu/sub-menu.js +256 -0
  140. package/es/message/index.js +67 -0
  141. package/es/modal/api.js +62 -0
  142. package/es/modal/modal.js +589 -0
  143. package/es/modal/toast.js +99 -0
  144. package/es/node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js +189 -0
  145. package/es/notice/container.js +123 -0
  146. package/es/notice/content.js +92 -0
  147. package/es/notice/index.js +52 -0
  148. package/es/notice/instance.js +65 -0
  149. package/es/page/index.js +275 -0
  150. package/es/page-header/index.js +134 -0
  151. package/es/popconfirm/index.js +275 -0
  152. package/es/poptip/index.js +270 -0
  153. package/es/progress/index.js +253 -0
  154. package/es/qrcode/index.js +204 -0
  155. package/es/radio/radio-button.js +158 -0
  156. package/es/radio/radio-group-context.js +13 -0
  157. package/es/radio/radio-group.js +264 -0
  158. package/es/radio/radio.js +232 -0
  159. package/es/rate/index.js +253 -0
  160. package/es/rate/star.js +150 -0
  161. package/es/result/index.js +147 -0
  162. package/es/ripple/index.js +245 -0
  163. package/es/ripple/types.js +433 -0
  164. package/es/row-col/col.js +163 -0
  165. package/es/row-col/row.js +37 -0
  166. package/es/segmented/index.js +240 -0
  167. package/es/select/option.js +124 -0
  168. package/es/select/select.js +655 -0
  169. package/es/skeleton/skeleton-avatar.js +44 -0
  170. package/es/skeleton/skeleton-button.js +43 -0
  171. package/es/skeleton/skeleton-image.js +131 -0
  172. package/es/skeleton/skeleton-text.js +113 -0
  173. package/es/skeleton/skeleton.js +148 -0
  174. package/es/skeleton/use-skeleton-loading.js +53 -0
  175. package/es/slider/index.js +484 -0
  176. package/es/slider/thumb.js +158 -0
  177. package/es/space/index.js +94 -0
  178. package/es/spin/index.js +61 -0
  179. package/es/splitter/splitter-panel.js +50 -0
  180. package/es/splitter/splitter.js +310 -0
  181. package/es/stat-card/countup.js +157 -0
  182. package/es/stat-card/stat-card.js +63 -0
  183. package/es/stat-card/stat-number.js +125 -0
  184. package/es/stat-card/utils/countup.js +291 -0
  185. package/es/stat-card/utils/odometer.js +129 -0
  186. package/es/steps/index.js +139 -0
  187. package/es/switch/index.js +72 -0
  188. package/es/table/column-setting.js +179 -0
  189. package/es/table/index.js +506 -0
  190. package/es/table/utils.js +34 -0
  191. package/es/tabs/tab-panel.js +86 -0
  192. package/es/tabs/tabs.js +263 -0
  193. package/es/tag/index.js +74 -0
  194. package/es/time-line/timeline-item.js +133 -0
  195. package/es/time-line/timeline.js +55 -0
  196. package/es/tooltip/index.js +278 -0
  197. package/es/tour/index.js +379 -0
  198. package/es/transfer/index.js +511 -0
  199. package/es/tree/index.js +488 -0
  200. package/es/tree/utils.js +101 -0
  201. package/es/tree-select/index.js +938 -0
  202. package/es/typography/index.js +359 -0
  203. package/es/upload/file-list.js +143 -0
  204. package/es/upload/index.js +434 -0
  205. package/es/upload/picture-sort.js +142 -0
  206. package/es/upload/selector.js +207 -0
  207. package/es/utils/checked.js +24 -0
  208. package/es/utils/color.js +15 -0
  209. package/es/utils/number.js +74 -0
  210. package/es/utils/placement.js +151 -0
  211. package/es/utils/react-node.js +63 -0
  212. package/es/utils/share.js +12 -0
  213. package/es/utils/theme.js +57 -0
  214. package/es/utils/transition.js +58 -0
  215. package/es/utils/use-value.js +60 -0
  216. package/es/virtual-list/index.js +252 -0
  217. package/es/virtual-list/range.js +27 -0
  218. package/es/watermark/index.js +313 -0
  219. package/lib/index.cjs +9 -0
  220. package/lib/locale/de.cjs +9 -0
  221. package/lib/locale/el.cjs +9 -0
  222. package/lib/locale/en.cjs +9 -0
  223. package/lib/locale/fr.cjs +9 -0
  224. package/lib/locale/it.cjs +9 -0
  225. package/lib/locale/ja.cjs +9 -0
  226. package/lib/locale/ko.cjs +9 -0
  227. package/lib/locale/ru.cjs +9 -0
  228. package/lib/locale/th.cjs +9 -0
  229. package/lib/locale/uk.cjs +9 -0
  230. package/lib/locale/vi.cjs +9 -0
  231. package/lib/locale/zh-CN.cjs +9 -0
  232. package/lib/locale/zh-TW.cjs +9 -0
  233. package/package.json +175 -94
  234. package/readme.md +142 -82
  235. package/style/base.css +9 -0
  236. package/style/components.css +9 -0
  237. package/style/index.css +9 -0
  238. package/style/theme.css +9 -0
  239. package/types/affix/index.d.cts +9 -0
  240. package/types/affix/index.d.ts +9 -0
  241. package/types/alert/index.d.cts +18 -0
  242. package/types/alert/index.d.ts +18 -0
  243. package/types/anchor/anchor-context.d.cts +7 -0
  244. package/types/anchor/anchor-context.d.ts +7 -0
  245. package/types/anchor/anchor-link.d.cts +6 -0
  246. package/types/anchor/anchor-link.d.ts +6 -0
  247. package/types/anchor/anchor.d.cts +10 -0
  248. package/types/anchor/anchor.d.ts +10 -0
  249. package/types/anchor/index.d.cts +5 -0
  250. package/types/anchor/index.d.ts +5 -0
  251. package/types/auto-complete/index.d.cts +28 -0
  252. package/types/auto-complete/index.d.ts +28 -0
  253. package/types/avatar/avatar-group-context.d.cts +7 -0
  254. package/types/avatar/avatar-group-context.d.ts +7 -0
  255. package/types/avatar/avatar-group.d.cts +11 -0
  256. package/types/avatar/avatar-group.d.ts +11 -0
  257. package/types/avatar/avatar.d.cts +14 -0
  258. package/types/avatar/avatar.d.ts +14 -0
  259. package/types/avatar/index.d.cts +5 -0
  260. package/types/avatar/index.d.ts +5 -0
  261. package/types/back-top/index.d.cts +11 -0
  262. package/types/back-top/index.d.ts +11 -0
  263. package/types/badge/index.d.cts +15 -0
  264. package/types/badge/index.d.ts +15 -0
  265. package/types/base/teleport.d.cts +13 -0
  266. package/types/base/teleport.d.ts +13 -0
  267. package/types/base/transition-props.d.cts +4 -0
  268. package/types/base/transition-props.d.ts +4 -0
  269. package/types/base/transition.d.cts +27 -0
  270. package/types/base/transition.d.ts +27 -0
  271. package/types/breadcrumb/breadcrumb-context.d.cts +2 -0
  272. package/types/breadcrumb/breadcrumb-context.d.ts +2 -0
  273. package/types/breadcrumb/breadcrumb-item.d.cts +11 -0
  274. package/types/breadcrumb/breadcrumb-item.d.ts +11 -0
  275. package/types/breadcrumb/breadcrumb.d.cts +7 -0
  276. package/types/breadcrumb/breadcrumb.d.ts +7 -0
  277. package/types/breadcrumb/index.d.cts +5 -0
  278. package/types/breadcrumb/index.d.ts +5 -0
  279. package/types/button/button-group-context.d.cts +6 -0
  280. package/types/button/button-group-context.d.ts +6 -0
  281. package/types/button/button-group.d.cts +9 -0
  282. package/types/button/button-group.d.ts +9 -0
  283. package/types/button/button.d.cts +20 -0
  284. package/types/button/button.d.ts +20 -0
  285. package/types/button/index.d.cts +5 -0
  286. package/types/button/index.d.ts +5 -0
  287. package/types/calendar/index.d.cts +36 -0
  288. package/types/calendar/index.d.ts +36 -0
  289. package/types/card/index.d.cts +22 -0
  290. package/types/card/index.d.ts +22 -0
  291. package/types/carousel/carousel-context.d.cts +6 -0
  292. package/types/carousel/carousel-context.d.ts +6 -0
  293. package/types/carousel/carousel-item.d.cts +3 -0
  294. package/types/carousel/carousel-item.d.ts +3 -0
  295. package/types/carousel/carousel.d.cts +18 -0
  296. package/types/carousel/carousel.d.ts +18 -0
  297. package/types/carousel/index.d.cts +5 -0
  298. package/types/carousel/index.d.ts +5 -0
  299. package/types/cascader/index.d.cts +5 -0
  300. package/types/cascader/index.d.ts +5 -0
  301. package/types/cascader/types.d.cts +38 -0
  302. package/types/cascader/types.d.ts +38 -0
  303. package/types/check-card/check-card-group.d.cts +4 -0
  304. package/types/check-card/check-card-group.d.ts +4 -0
  305. package/types/check-card/check-card.d.cts +4 -0
  306. package/types/check-card/check-card.d.ts +4 -0
  307. package/types/check-card/context.d.cts +14 -0
  308. package/types/check-card/context.d.ts +14 -0
  309. package/types/check-card/index.d.cts +4 -0
  310. package/types/check-card/index.d.ts +4 -0
  311. package/types/check-card/types.d.cts +46 -0
  312. package/types/check-card/types.d.ts +46 -0
  313. package/types/checkbox/checkbox-group-context.d.cts +11 -0
  314. package/types/checkbox/checkbox-group-context.d.ts +11 -0
  315. package/types/checkbox/checkbox-group.d.cts +22 -0
  316. package/types/checkbox/checkbox-group.d.ts +22 -0
  317. package/types/checkbox/checkbox.d.cts +23 -0
  318. package/types/checkbox/checkbox.d.ts +23 -0
  319. package/types/checkbox/index.d.cts +6 -0
  320. package/types/checkbox/index.d.ts +6 -0
  321. package/types/collapse/collapse-panel.d.cts +12 -0
  322. package/types/collapse/collapse-panel.d.ts +12 -0
  323. package/types/collapse/collapse.d.cts +15 -0
  324. package/types/collapse/collapse.d.ts +15 -0
  325. package/types/collapse/index.d.cts +6 -0
  326. package/types/collapse/index.d.ts +6 -0
  327. package/types/color-picker/alpha.d.cts +6 -0
  328. package/types/color-picker/alpha.d.ts +6 -0
  329. package/types/color-picker/hue.d.cts +5 -0
  330. package/types/color-picker/hue.d.ts +5 -0
  331. package/types/color-picker/index.d.cts +30 -0
  332. package/types/color-picker/index.d.ts +30 -0
  333. package/types/color-picker/mode.d.cts +10 -0
  334. package/types/color-picker/mode.d.ts +10 -0
  335. package/types/color-picker/paint.d.cts +7 -0
  336. package/types/color-picker/paint.d.ts +7 -0
  337. package/types/color-picker/presets.d.cts +7 -0
  338. package/types/color-picker/presets.d.ts +7 -0
  339. package/types/components.d.cts +165 -0
  340. package/types/components.d.ts +165 -0
  341. package/types/config/config-context.d.cts +11 -0
  342. package/types/config/config-context.d.ts +11 -0
  343. package/types/config/context.d.cts +7 -0
  344. package/types/config/context.d.ts +7 -0
  345. package/types/config/index.d.cts +14 -0
  346. package/types/config/index.d.ts +14 -0
  347. package/types/config/size-context.d.cts +3 -0
  348. package/types/config/size-context.d.ts +3 -0
  349. package/types/config/use-config-appearance.d.cts +7 -0
  350. package/types/config/use-config-appearance.d.ts +7 -0
  351. package/types/const/types.d.cts +22 -0
  352. package/types/const/types.d.ts +22 -0
  353. package/types/const/var.d.cts +1 -0
  354. package/types/const/var.d.ts +1 -0
  355. package/types/date-picker/index.d.cts +54 -0
  356. package/types/date-picker/index.d.ts +54 -0
  357. package/types/descriptions/descriptions-item.d.cts +5 -0
  358. package/types/descriptions/descriptions-item.d.ts +5 -0
  359. package/types/descriptions/descriptions.d.cts +21 -0
  360. package/types/descriptions/descriptions.d.ts +21 -0
  361. package/types/descriptions/index.d.cts +4 -0
  362. package/types/descriptions/index.d.ts +4 -0
  363. package/types/directives/outsiteclick.d.cts +3 -0
  364. package/types/directives/outsiteclick.d.ts +3 -0
  365. package/types/directives/resize.d.cts +3 -0
  366. package/types/directives/resize.d.ts +3 -0
  367. package/types/directives/scroll.d.cts +3 -0
  368. package/types/directives/scroll.d.ts +3 -0
  369. package/types/directives/transfer.d.cts +2 -0
  370. package/types/directives/transfer.d.ts +2 -0
  371. package/types/divider/index.d.cts +14 -0
  372. package/types/divider/index.d.ts +14 -0
  373. package/types/drawer/index.d.cts +27 -0
  374. package/types/drawer/index.d.ts +27 -0
  375. package/types/dropdown/dropdown-button.d.cts +17 -0
  376. package/types/dropdown/dropdown-button.d.ts +17 -0
  377. package/types/dropdown/dropdown-context.d.cts +11 -0
  378. package/types/dropdown/dropdown-context.d.ts +11 -0
  379. package/types/dropdown/dropdown.d.cts +18 -0
  380. package/types/dropdown/dropdown.d.ts +18 -0
  381. package/types/dropdown/index.d.cts +4 -0
  382. package/types/dropdown/index.d.ts +4 -0
  383. package/types/dropdown/trigger.d.cts +9 -0
  384. package/types/dropdown/trigger.d.ts +9 -0
  385. package/types/empty/index.d.cts +9 -0
  386. package/types/empty/index.d.ts +9 -0
  387. package/types/feature-card/index.d.cts +20 -0
  388. package/types/feature-card/index.d.ts +20 -0
  389. package/types/feedback-panel/index.d.cts +15 -0
  390. package/types/feedback-panel/index.d.ts +15 -0
  391. package/types/flame-wrap/index.d.cts +3 -0
  392. package/types/flame-wrap/index.d.ts +3 -0
  393. package/types/flame-wrap/types.d.cts +71 -0
  394. package/types/flame-wrap/types.d.ts +71 -0
  395. package/types/flex/index.d.cts +15 -0
  396. package/types/flex/index.d.ts +15 -0
  397. package/types/form/field-context.d.cts +39 -0
  398. package/types/form/field-context.d.ts +39 -0
  399. package/types/form/form-context.d.cts +22 -0
  400. package/types/form/form-context.d.ts +22 -0
  401. package/types/form/form-item.d.cts +12 -0
  402. package/types/form/form-item.d.ts +12 -0
  403. package/types/form/form.d.cts +40 -0
  404. package/types/form/form.d.ts +40 -0
  405. package/types/form/index.d.cts +7 -0
  406. package/types/form/index.d.ts +7 -0
  407. package/types/form/types.d.cts +20 -0
  408. package/types/form/types.d.ts +20 -0
  409. package/types/form/utils.d.cts +6 -0
  410. package/types/form/utils.d.ts +6 -0
  411. package/types/grid/grid-item.d.cts +10 -0
  412. package/types/grid/grid-item.d.ts +10 -0
  413. package/types/grid/grid.d.cts +17 -0
  414. package/types/grid/grid.d.ts +17 -0
  415. package/types/grid/index.d.cts +6 -0
  416. package/types/grid/index.d.ts +6 -0
  417. package/types/grid/useBreakpoint.d.cts +11 -0
  418. package/types/grid/useBreakpoint.d.ts +11 -0
  419. package/types/icon/index.d.cts +15 -0
  420. package/types/icon/index.d.ts +15 -0
  421. package/types/image/group.d.cts +5 -0
  422. package/types/image/group.d.ts +5 -0
  423. package/types/image/image-group-context.d.cts +8 -0
  424. package/types/image/image-group-context.d.ts +8 -0
  425. package/types/image/image.d.cts +28 -0
  426. package/types/image/image.d.ts +28 -0
  427. package/types/image/index.d.cts +6 -0
  428. package/types/image/index.d.ts +6 -0
  429. package/types/image/instance.d.cts +5 -0
  430. package/types/image/instance.d.ts +5 -0
  431. package/types/image/preview.d.cts +19 -0
  432. package/types/image/preview.d.ts +19 -0
  433. package/types/image/utils.d.cts +6 -0
  434. package/types/image/utils.d.ts +6 -0
  435. package/types/index.d.cts +8 -0
  436. package/types/index.d.ts +8 -0
  437. package/types/input/index.d.cts +8 -0
  438. package/types/input/index.d.ts +8 -0
  439. package/types/input/input-box.d.cts +14 -0
  440. package/types/input/input-box.d.ts +14 -0
  441. package/types/input/input-group.d.cts +11 -0
  442. package/types/input/input-group.d.ts +11 -0
  443. package/types/input/input.d.cts +28 -0
  444. package/types/input/input.d.ts +28 -0
  445. package/types/input/textarea.d.cts +11 -0
  446. package/types/input/textarea.d.ts +11 -0
  447. package/types/input-number/index.d.cts +27 -0
  448. package/types/input-number/index.d.ts +27 -0
  449. package/types/input-otp/index.d.cts +27 -0
  450. package/types/input-otp/index.d.ts +27 -0
  451. package/types/input-tag/index.d.cts +23 -0
  452. package/types/input-tag/index.d.ts +23 -0
  453. package/types/kanban/index.d.cts +31 -0
  454. package/types/kanban/index.d.ts +31 -0
  455. package/types/layout/index.d.cts +29 -0
  456. package/types/layout/index.d.ts +29 -0
  457. package/types/layout/layout-context.d.cts +1 -0
  458. package/types/layout/layout-context.d.ts +1 -0
  459. package/types/list-panel/index.d.cts +16 -0
  460. package/types/list-panel/index.d.ts +16 -0
  461. package/types/loading/index.d.cts +10 -0
  462. package/types/loading/index.d.ts +10 -0
  463. package/types/loading/loading-bar.d.cts +12 -0
  464. package/types/loading/loading-bar.d.ts +12 -0
  465. package/types/locale/de.d.cts +65 -0
  466. package/types/locale/de.d.ts +65 -0
  467. package/types/locale/el.d.cts +65 -0
  468. package/types/locale/el.d.ts +65 -0
  469. package/types/locale/en.d.cts +65 -0
  470. package/types/locale/en.d.ts +65 -0
  471. package/types/locale/fr.d.cts +65 -0
  472. package/types/locale/fr.d.ts +65 -0
  473. package/types/locale/it.d.cts +65 -0
  474. package/types/locale/it.d.ts +65 -0
  475. package/types/locale/ja.d.cts +65 -0
  476. package/types/locale/ja.d.ts +65 -0
  477. package/types/locale/ko.d.cts +65 -0
  478. package/types/locale/ko.d.ts +65 -0
  479. package/types/locale/ru.d.cts +65 -0
  480. package/types/locale/ru.d.ts +65 -0
  481. package/types/locale/th.d.cts +65 -0
  482. package/types/locale/th.d.ts +65 -0
  483. package/types/locale/uk.d.cts +65 -0
  484. package/types/locale/uk.d.ts +65 -0
  485. package/types/locale/vi.d.cts +65 -0
  486. package/types/locale/vi.d.ts +65 -0
  487. package/types/locale/zh-CN.d.cts +65 -0
  488. package/types/locale/zh-CN.d.ts +65 -0
  489. package/types/locale/zh-TW.d.cts +65 -0
  490. package/types/locale/zh-TW.d.ts +65 -0
  491. package/types/mentions/index.d.cts +28 -0
  492. package/types/mentions/index.d.ts +28 -0
  493. package/types/menu/index.d.cts +7 -0
  494. package/types/menu/index.d.ts +7 -0
  495. package/types/menu/menu-context.d.cts +24 -0
  496. package/types/menu/menu-context.d.ts +24 -0
  497. package/types/menu/menu-divider.d.cts +3 -0
  498. package/types/menu/menu-divider.d.ts +3 -0
  499. package/types/menu/menu-group.d.cts +7 -0
  500. package/types/menu/menu-group.d.ts +7 -0
  501. package/types/menu/menu-item.d.cts +15 -0
  502. package/types/menu/menu-item.d.ts +15 -0
  503. package/types/menu/menu-keyboard.d.cts +7 -0
  504. package/types/menu/menu-keyboard.d.ts +7 -0
  505. package/types/menu/menu.d.cts +33 -0
  506. package/types/menu/menu.d.ts +33 -0
  507. package/types/menu/recursive-menu.d.cts +7 -0
  508. package/types/menu/recursive-menu.d.ts +7 -0
  509. package/types/menu/sub-menu.d.cts +12 -0
  510. package/types/menu/sub-menu.d.ts +12 -0
  511. package/types/message/index.d.cts +24 -0
  512. package/types/message/index.d.ts +24 -0
  513. package/types/modal/api.d.cts +26 -0
  514. package/types/modal/api.d.ts +26 -0
  515. package/types/modal/index.d.cts +4 -0
  516. package/types/modal/index.d.ts +4 -0
  517. package/types/modal/modal.d.cts +32 -0
  518. package/types/modal/modal.d.ts +32 -0
  519. package/types/modal/toast.d.cts +15 -0
  520. package/types/modal/toast.d.ts +15 -0
  521. package/types/notice/container.d.cts +9 -0
  522. package/types/notice/container.d.ts +9 -0
  523. package/types/notice/content.d.cts +22 -0
  524. package/types/notice/content.d.ts +22 -0
  525. package/types/notice/index.d.cts +24 -0
  526. package/types/notice/index.d.ts +24 -0
  527. package/types/notice/instance.d.cts +7 -0
  528. package/types/notice/instance.d.ts +7 -0
  529. package/types/page/index.d.cts +19 -0
  530. package/types/page/index.d.ts +19 -0
  531. package/types/page-header/index.d.cts +10 -0
  532. package/types/page-header/index.d.ts +10 -0
  533. package/types/popconfirm/index.d.cts +27 -0
  534. package/types/popconfirm/index.d.ts +27 -0
  535. package/types/poptip/index.d.cts +25 -0
  536. package/types/poptip/index.d.ts +25 -0
  537. package/types/progress/index.d.cts +21 -0
  538. package/types/progress/index.d.ts +21 -0
  539. package/types/qrcode/index.d.cts +28 -0
  540. package/types/qrcode/index.d.ts +28 -0
  541. package/types/radio/index.d.cts +7 -0
  542. package/types/radio/index.d.ts +7 -0
  543. package/types/radio/radio-button.d.cts +20 -0
  544. package/types/radio/radio-button.d.ts +20 -0
  545. package/types/radio/radio-group-context.d.cts +13 -0
  546. package/types/radio/radio-group-context.d.ts +13 -0
  547. package/types/radio/radio-group.d.cts +26 -0
  548. package/types/radio/radio-group.d.ts +26 -0
  549. package/types/radio/radio.d.cts +17 -0
  550. package/types/radio/radio.d.ts +17 -0
  551. package/types/radio/types.d.cts +5 -0
  552. package/types/radio/types.d.ts +5 -0
  553. package/types/rate/index.d.cts +22 -0
  554. package/types/rate/index.d.ts +22 -0
  555. package/types/rate/star.d.cts +19 -0
  556. package/types/rate/star.d.ts +19 -0
  557. package/types/result/index.d.cts +12 -0
  558. package/types/result/index.d.ts +12 -0
  559. package/types/ripple/index.d.cts +10 -0
  560. package/types/ripple/index.d.ts +10 -0
  561. package/types/ripple/types.d.cts +48 -0
  562. package/types/ripple/types.d.ts +48 -0
  563. package/types/row-col/col.d.cts +26 -0
  564. package/types/row-col/col.d.ts +26 -0
  565. package/types/row-col/index.d.cts +5 -0
  566. package/types/row-col/index.d.ts +5 -0
  567. package/types/row-col/row.d.cts +9 -0
  568. package/types/row-col/row.d.ts +9 -0
  569. package/types/segmented/index.d.cts +25 -0
  570. package/types/segmented/index.d.ts +25 -0
  571. package/types/select/index.d.cts +5 -0
  572. package/types/select/index.d.ts +5 -0
  573. package/types/select/option.d.cts +17 -0
  574. package/types/select/option.d.ts +17 -0
  575. package/types/select/select.d.cts +51 -0
  576. package/types/select/select.d.ts +51 -0
  577. package/types/skeleton/index.d.cts +11 -0
  578. package/types/skeleton/index.d.ts +11 -0
  579. package/types/skeleton/skeleton-avatar.d.cts +13 -0
  580. package/types/skeleton/skeleton-avatar.d.ts +13 -0
  581. package/types/skeleton/skeleton-button.d.cts +14 -0
  582. package/types/skeleton/skeleton-button.d.ts +14 -0
  583. package/types/skeleton/skeleton-image.d.cts +11 -0
  584. package/types/skeleton/skeleton-image.d.ts +11 -0
  585. package/types/skeleton/skeleton-text.d.cts +12 -0
  586. package/types/skeleton/skeleton-text.d.ts +12 -0
  587. package/types/skeleton/skeleton.d.cts +19 -0
  588. package/types/skeleton/skeleton.d.ts +19 -0
  589. package/types/skeleton/use-skeleton-loading.d.cts +1 -0
  590. package/types/skeleton/use-skeleton-loading.d.ts +1 -0
  591. package/types/slider/index.d.cts +21 -0
  592. package/types/slider/index.d.ts +21 -0
  593. package/types/slider/thumb.d.cts +17 -0
  594. package/types/slider/thumb.d.ts +17 -0
  595. package/types/space/index.d.cts +15 -0
  596. package/types/space/index.d.ts +15 -0
  597. package/types/spin/index.d.cts +11 -0
  598. package/types/spin/index.d.ts +11 -0
  599. package/types/splitter/index.d.cts +4 -0
  600. package/types/splitter/index.d.ts +4 -0
  601. package/types/splitter/splitter-panel.d.cts +7 -0
  602. package/types/splitter/splitter-panel.d.ts +7 -0
  603. package/types/splitter/splitter.d.cts +9 -0
  604. package/types/splitter/splitter.d.ts +9 -0
  605. package/types/stat-card/countup.d.cts +11 -0
  606. package/types/stat-card/countup.d.ts +11 -0
  607. package/types/stat-card/index.d.cts +5 -0
  608. package/types/stat-card/index.d.ts +5 -0
  609. package/types/stat-card/rollup.d.cts +7 -0
  610. package/types/stat-card/rollup.d.ts +7 -0
  611. package/types/stat-card/stat-card.d.cts +31 -0
  612. package/types/stat-card/stat-card.d.ts +31 -0
  613. package/types/stat-card/stat-number.d.cts +13 -0
  614. package/types/stat-card/stat-number.d.ts +13 -0
  615. package/types/stat-card/utils/countup.d.cts +128 -0
  616. package/types/stat-card/utils/countup.d.ts +128 -0
  617. package/types/stat-card/utils/odometer.d.cts +14 -0
  618. package/types/stat-card/utils/odometer.d.ts +14 -0
  619. package/types/steps/index.d.cts +20 -0
  620. package/types/steps/index.d.ts +20 -0
  621. package/types/switch/index.d.cts +21 -0
  622. package/types/switch/index.d.ts +21 -0
  623. package/types/table/column-setting.d.cts +28 -0
  624. package/types/table/column-setting.d.ts +28 -0
  625. package/types/table/index.d.cts +5 -0
  626. package/types/table/index.d.ts +5 -0
  627. package/types/table/types.d.cts +66 -0
  628. package/types/table/types.d.ts +66 -0
  629. package/types/table/utils.d.cts +14 -0
  630. package/types/table/utils.d.ts +14 -0
  631. package/types/tabs/index.d.cts +5 -0
  632. package/types/tabs/index.d.ts +5 -0
  633. package/types/tabs/tab-panel.d.cts +17 -0
  634. package/types/tabs/tab-panel.d.ts +17 -0
  635. package/types/tabs/tabs.d.cts +16 -0
  636. package/types/tabs/tabs.d.ts +16 -0
  637. package/types/tabs/types.d.cts +16 -0
  638. package/types/tabs/types.d.ts +16 -0
  639. package/types/tag/index.d.cts +16 -0
  640. package/types/tag/index.d.ts +16 -0
  641. package/types/time-line/index.d.cts +5 -0
  642. package/types/time-line/index.d.ts +5 -0
  643. package/types/time-line/timeline-item.d.cts +10 -0
  644. package/types/time-line/timeline-item.d.ts +10 -0
  645. package/types/time-line/timeline.d.cts +6 -0
  646. package/types/time-line/timeline.d.ts +6 -0
  647. package/types/tooltip/index.d.cts +23 -0
  648. package/types/tooltip/index.d.ts +23 -0
  649. package/types/tour/index.d.cts +22 -0
  650. package/types/tour/index.d.ts +22 -0
  651. package/types/transfer/index.d.cts +33 -0
  652. package/types/transfer/index.d.ts +33 -0
  653. package/types/tree/index.d.cts +51 -0
  654. package/types/tree/index.d.ts +51 -0
  655. package/types/tree/types.d.cts +27 -0
  656. package/types/tree/types.d.ts +27 -0
  657. package/types/tree/utils.d.cts +33 -0
  658. package/types/tree/utils.d.ts +33 -0
  659. package/types/tree-select/index.d.cts +60 -0
  660. package/types/tree-select/index.d.ts +60 -0
  661. package/types/typography/index.d.cts +40 -0
  662. package/types/typography/index.d.ts +40 -0
  663. package/types/upload/file-list.d.cts +19 -0
  664. package/types/upload/file-list.d.ts +19 -0
  665. package/types/upload/index.d.cts +90 -0
  666. package/types/upload/index.d.ts +90 -0
  667. package/types/upload/picture-sort.d.cts +2 -0
  668. package/types/upload/picture-sort.d.ts +2 -0
  669. package/types/upload/selector.d.cts +21 -0
  670. package/types/upload/selector.d.ts +21 -0
  671. package/types/utils/checked.d.cts +2 -0
  672. package/types/utils/checked.d.ts +2 -0
  673. package/types/utils/color.d.cts +1 -0
  674. package/types/utils/color.d.ts +1 -0
  675. package/types/utils/element.d.cts +2 -0
  676. package/types/utils/element.d.ts +2 -0
  677. package/types/utils/mouse.d.cts +1 -0
  678. package/types/utils/mouse.d.ts +1 -0
  679. package/types/utils/number.d.cts +6 -0
  680. package/types/utils/number.d.ts +6 -0
  681. package/types/utils/placement.d.cts +16 -0
  682. package/types/utils/placement.d.ts +16 -0
  683. package/types/utils/react-node.d.cts +5 -0
  684. package/types/utils/react-node.d.ts +5 -0
  685. package/types/utils/share.d.cts +12 -0
  686. package/types/utils/share.d.ts +12 -0
  687. package/types/utils/theme.d.cts +5 -0
  688. package/types/utils/theme.d.ts +5 -0
  689. package/types/utils/transition.d.cts +3 -0
  690. package/types/utils/transition.d.ts +3 -0
  691. package/types/utils/use-value.d.cts +2 -0
  692. package/types/utils/use-value.d.ts +2 -0
  693. package/types/virtual-list/index.d.cts +17 -0
  694. package/types/virtual-list/index.d.ts +17 -0
  695. package/types/virtual-list/range.d.cts +15 -0
  696. package/types/virtual-list/range.d.ts +15 -0
  697. package/types/watermark/index.d.cts +27 -0
  698. package/types/watermark/index.d.ts +27 -0
  699. package/dist/k-ui.css +0 -7
  700. package/dist/k-ui.js +0 -13
@@ -0,0 +1,275 @@
1
+ /*!
2
+ * react-kui v3.0.0
3
+ * Copyright 2017-present, kui-react.
4
+ * All rights reserved.
5
+ * Homepage: https://react.k-ui.cn
6
+ * Author: Qiu / https://chuchur.com
7
+ */
8
+
9
+ import zh_CN_default from "../locale/zh-CN.js";
10
+ import { ConfigContext } from "../config/config-context.js";
11
+ import { useConfigAppearance } from "../config/use-config-appearance.js";
12
+ import { ChevronUp, ChevronsLeft, ChevronsRight, Ellipsis } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
13
+ import Icon from "../icon/index.js";
14
+ import input_number_default from "../input-number/index.js";
15
+ import select_default from "../select/select.js";
16
+ import clsx from "clsx";
17
+ import { useContext, useState } from "react";
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ //#region components/page/index.tsx
20
+ var Page = ({ simple = false, disabled = false, showSizer = false, showTotal = true, showElevator = false, theme: themeProp, shape: shapeProp, sizeData = [
21
+ 10,
22
+ 15,
23
+ 20,
24
+ 30,
25
+ 40
26
+ ], size: sizeProp, total = 0, pageSize: pageSizeProp = 10, page: pageProp = 1, onChange, className = "", ...rest }) => {
27
+ const inheritedAppearance = useConfigAppearance();
28
+ const theme = themeProp ?? inheritedAppearance.theme ?? "fill";
29
+ const shape = shapeProp ?? inheritedAppearance.shape ?? "round";
30
+ const size = sizeProp ?? inheritedAppearance.size;
31
+ const locale = useContext(ConfigContext)?.locale || zh_CN_default;
32
+ const normalizePageSize = (value) => Number.isFinite(value) && value > 0 ? value : 10;
33
+ const calcPageCount = (tot, ps) => Math.max(1, Math.ceil((Number.isFinite(tot) && tot > 0 ? tot : 0) / normalizePageSize(ps)));
34
+ const normalizePage = (value_0, count) => Math.min(count, Math.max(1, Number.isFinite(value_0) ? Math.floor(value_0) : 1));
35
+ const initialPageSize = normalizePageSize(pageSizeProp);
36
+ const initialPageCount = calcPageCount(total, initialPageSize);
37
+ const [currentPage, setCurrentPage] = useState(normalizePage(pageProp, initialPageCount));
38
+ const [currentPageSize, setCurrentPageSize] = useState(initialPageSize);
39
+ const [pageCount, setPageCount] = useState(initialPageCount);
40
+ const syncKey = `${total}:${pageProp}:${pageSizeProp}`;
41
+ const [previousSyncKey, setPreviousSyncKey] = useState(syncKey);
42
+ if (previousSyncKey !== syncKey) {
43
+ const nextPageSize = normalizePageSize(pageSizeProp);
44
+ const newCount = calcPageCount(total, nextPageSize);
45
+ setPreviousSyncKey(syncKey);
46
+ setCurrentPageSize(nextPageSize);
47
+ setPageCount(newCount);
48
+ setCurrentPage(normalizePage(pageProp, newCount));
49
+ }
50
+ const [prevHover, setPrevHover] = useState(false);
51
+ const [nextHover, setNextHover] = useState(false);
52
+ const toPage = (p) => {
53
+ if (disabled) return;
54
+ const nextP = normalizePage(p, pageCount);
55
+ if (nextP === currentPage) return;
56
+ setCurrentPage(nextP);
57
+ onChange?.(nextP, currentPageSize);
58
+ };
59
+ const prePage = () => {
60
+ if (!disabled && currentPage > 1) toPage(currentPage - 1);
61
+ };
62
+ const goNextPage = () => {
63
+ if (!disabled && currentPage < pageCount) toPage(currentPage + 1);
64
+ };
65
+ const changeSize = (value_1) => {
66
+ const newPageSize = normalizePageSize(Number(value_1));
67
+ setCurrentPageSize(newPageSize);
68
+ const newCount_0 = calcPageCount(total, newPageSize);
69
+ setPageCount(newCount_0);
70
+ const nextPage = currentPage > newCount_0 ? newCount_0 : currentPage;
71
+ setCurrentPage(nextPage);
72
+ onChange?.(nextPage, newPageSize);
73
+ };
74
+ const activateByKeyboard = (event, action) => {
75
+ if (event.key !== "Enter" && event.key !== " ") return;
76
+ event.preventDefault();
77
+ action();
78
+ };
79
+ const renderPageItems = () => {
80
+ const groupCount = 7;
81
+ const page = currentPage;
82
+ const pCount = pageCount;
83
+ let showPrevMore = false;
84
+ let showNextMore = false;
85
+ if (pCount > groupCount) {
86
+ if (page > 4) showPrevMore = true;
87
+ if (page < pCount - 3) showNextMore = true;
88
+ }
89
+ const array = [];
90
+ if (showPrevMore && !showNextMore) {
91
+ const startPage = pCount - 5;
92
+ for (let i = startPage; i < pCount; i++) array.push(i);
93
+ } else if (!showPrevMore && showNextMore) for (let i_0 = 2; i_0 < groupCount; i_0++) array.push(i_0);
94
+ else if (showPrevMore && showNextMore) {
95
+ const offset = Math.floor(groupCount / 2) - 1;
96
+ for (let i_1 = page - offset; i_1 <= page + offset; i_1++) array.push(i_1);
97
+ } else for (let i_2 = 2; i_2 < pCount; i_2++) array.push(i_2);
98
+ const items = array.map((p_0) => /* @__PURE__ */ jsx("li", {
99
+ className: clsx("k-pager-item", { "k-pager-item-active": page === p_0 }),
100
+ role: "button",
101
+ tabIndex: disabled ? -1 : 0,
102
+ "aria-current": page === p_0 ? "page" : void 0,
103
+ "aria-label": `Page ${p_0}`,
104
+ onClick: () => toPage(p_0),
105
+ onKeyDown: (event_0) => activateByKeyboard(event_0, () => toPage(p_0)),
106
+ children: /* @__PURE__ */ jsx("span", { children: p_0 })
107
+ }, p_0));
108
+ if (showPrevMore) items.unshift(/* @__PURE__ */ jsx("li", {
109
+ className: "k-pager-item k-pager-more",
110
+ role: "button",
111
+ tabIndex: disabled ? -1 : 0,
112
+ "aria-label": "Previous 5 pages",
113
+ onMouseEnter: () => setPrevHover(true),
114
+ onMouseLeave: () => setPrevHover(false),
115
+ onClick: () => toPage(currentPage - 5),
116
+ onKeyDown: (event_1) => activateByKeyboard(event_1, () => toPage(currentPage - 5)),
117
+ children: /* @__PURE__ */ jsx(Icon, { type: prevHover ? ChevronsLeft : Ellipsis })
118
+ }, "prev-more"));
119
+ if (showNextMore) items.push(/* @__PURE__ */ jsx("li", {
120
+ className: "k-pager-item k-pager-more",
121
+ role: "button",
122
+ tabIndex: disabled ? -1 : 0,
123
+ "aria-label": "Next 5 pages",
124
+ onMouseEnter: () => setNextHover(true),
125
+ onMouseLeave: () => setNextHover(false),
126
+ onClick: () => toPage(currentPage + 5),
127
+ onKeyDown: (event_2) => activateByKeyboard(event_2, () => toPage(currentPage + 5)),
128
+ children: /* @__PURE__ */ jsx(Icon, { type: nextHover ? ChevronsRight : Ellipsis })
129
+ }, "next-more"));
130
+ return items;
131
+ };
132
+ const classes = clsx("k-page", {
133
+ "k-page-sm": size === "small",
134
+ "k-page-lg": size === "large",
135
+ "k-page-fill": theme === "fill",
136
+ "k-page-outline": theme === "outline",
137
+ "k-page-disabled": disabled,
138
+ "k-page-simple": simple,
139
+ [`k-page-${shape}`]: shape
140
+ }, className);
141
+ const sizeOptions = sizeData.map((s) => ({
142
+ value: s,
143
+ label: `${s}${locale?.k?.page?.pageSize || " / page"}`
144
+ }));
145
+ return /* @__PURE__ */ jsxs("nav", {
146
+ className: classes,
147
+ "aria-label": "Pagination",
148
+ ...rest,
149
+ children: [
150
+ showTotal && !simple ? /* @__PURE__ */ jsx("div", {
151
+ className: "k-page-number",
152
+ children: /* @__PURE__ */ jsxs("span", { children: [
153
+ locale?.k?.page?.total,
154
+ " ",
155
+ total,
156
+ " ",
157
+ locale?.k?.page?.items
158
+ ] })
159
+ }) : null,
160
+ /* @__PURE__ */ jsxs("ul", {
161
+ className: "k-pager",
162
+ children: [
163
+ /* @__PURE__ */ jsx("li", {
164
+ className: clsx("k-pager-item k-pager-prev", { "k-pager-item-disabled": currentPage === 1 }),
165
+ role: "button",
166
+ tabIndex: disabled || currentPage === 1 ? -1 : 0,
167
+ "aria-disabled": disabled || currentPage === 1,
168
+ "aria-label": "Previous page",
169
+ onClick: prePage,
170
+ onKeyDown: (event_3) => activateByKeyboard(event_3, prePage),
171
+ children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
172
+ }),
173
+ !simple && pageCount > 0 && /* @__PURE__ */ jsx("li", {
174
+ className: clsx("k-pager-item", { "k-pager-item-active": currentPage === 1 }),
175
+ role: "button",
176
+ tabIndex: disabled ? -1 : 0,
177
+ "aria-current": currentPage === 1 ? "page" : void 0,
178
+ "aria-label": "Page 1",
179
+ onClick: () => toPage(1),
180
+ onKeyDown: (event_4) => activateByKeyboard(event_4, () => toPage(1)),
181
+ children: /* @__PURE__ */ jsx("span", { children: "1" })
182
+ }),
183
+ !simple && renderPageItems(),
184
+ !simple && pageCount > 1 && /* @__PURE__ */ jsx("li", {
185
+ className: clsx("k-pager-item", { "k-pager-item-active": currentPage === pageCount }),
186
+ role: "button",
187
+ tabIndex: disabled ? -1 : 0,
188
+ "aria-current": currentPage === pageCount ? "page" : void 0,
189
+ "aria-label": `Page ${pageCount}`,
190
+ onClick: () => toPage(pageCount),
191
+ onKeyDown: (event_5) => activateByKeyboard(event_5, () => toPage(pageCount)),
192
+ children: /* @__PURE__ */ jsx("span", { children: pageCount })
193
+ }),
194
+ simple && /* @__PURE__ */ jsxs("li", {
195
+ className: "k-page-simple-number",
196
+ "aria-current": "page",
197
+ children: [
198
+ showElevator ? /* @__PURE__ */ jsx("span", {
199
+ className: "k-page-simple-input",
200
+ children: /* @__PURE__ */ jsx(input_number_default, {
201
+ value: currentPage,
202
+ min: 1,
203
+ max: pageCount,
204
+ controls: false,
205
+ disabled,
206
+ size,
207
+ theme,
208
+ onChange: (nextPage_0) => {
209
+ if (nextPage_0 !== void 0) toPage(nextPage_0);
210
+ }
211
+ })
212
+ }) : /* @__PURE__ */ jsx("span", { children: currentPage }),
213
+ /* @__PURE__ */ jsx("span", {
214
+ "aria-hidden": "true",
215
+ children: "/"
216
+ }),
217
+ /* @__PURE__ */ jsx("span", { children: pageCount })
218
+ ]
219
+ }),
220
+ /* @__PURE__ */ jsx("li", {
221
+ className: clsx("k-pager-item k-pager-next", { "k-pager-item-disabled": currentPage === pageCount }),
222
+ role: "button",
223
+ tabIndex: disabled || currentPage === pageCount ? -1 : 0,
224
+ "aria-disabled": disabled || currentPage === pageCount,
225
+ "aria-label": "Next page",
226
+ onClick: goNextPage,
227
+ onKeyDown: (event_6) => activateByKeyboard(event_6, goNextPage),
228
+ children: /* @__PURE__ */ jsx(Icon, { type: ChevronUp })
229
+ })
230
+ ]
231
+ }),
232
+ !simple && showSizer && /* @__PURE__ */ jsxs("div", {
233
+ className: "k-page-sizer",
234
+ children: [/* @__PURE__ */ jsx(select_default, {
235
+ value: currentPageSize,
236
+ size,
237
+ clearable: false,
238
+ theme,
239
+ disabled,
240
+ onChange: (value_2) => {
241
+ if (typeof value_2 === "string" || typeof value_2 === "number") changeSize(value_2);
242
+ },
243
+ options: sizeOptions
244
+ }), /* @__PURE__ */ jsx("span", {
245
+ className: "k-page-sizer-measure",
246
+ "aria-hidden": "true",
247
+ children: sizeOptions.map((option, index) => /* @__PURE__ */ jsx("span", { children: option.label }, index))
248
+ })]
249
+ }),
250
+ !simple && showElevator && /* @__PURE__ */ jsxs("div", {
251
+ className: "k-page-options",
252
+ children: [
253
+ /* @__PURE__ */ jsx("span", { children: locale?.k?.page?.goto }),
254
+ /* @__PURE__ */ jsx(input_number_default, {
255
+ className: "k-page-options-elevator",
256
+ size,
257
+ theme,
258
+ disabled,
259
+ onChange: (p_1) => {
260
+ if (p_1 === void 0) return;
261
+ const nextP_0 = Math.min(Math.max(p_1, 1), pageCount);
262
+ if (nextP_0 !== currentPage) {
263
+ setCurrentPage(nextP_0);
264
+ onChange?.(nextP_0, currentPageSize);
265
+ }
266
+ }
267
+ }),
268
+ /* @__PURE__ */ jsx("span", { children: locale?.k?.page?.page })
269
+ ]
270
+ })
271
+ ]
272
+ });
273
+ };
274
+ //#endregion
275
+ export { Page as default };
@@ -0,0 +1,134 @@
1
+ /*!
2
+ * react-kui v3.0.0
3
+ * Copyright 2017-present, kui-react.
4
+ * All rights reserved.
5
+ * Homepage: https://react.k-ui.cn
6
+ * Author: Qiu / https://chuchur.com
7
+ */
8
+
9
+ import { c } from "react/compiler-runtime";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ //#region components/page-header/index.tsx
12
+ function PageHeader(t0) {
13
+ const $ = c(34);
14
+ let actions;
15
+ let back;
16
+ let breadcrumb;
17
+ let children;
18
+ let className;
19
+ let description;
20
+ let rest;
21
+ let title;
22
+ if ($[0] !== t0) {
23
+ ({title, description, breadcrumb, back, actions, children, className, ...rest} = t0);
24
+ $[0] = t0;
25
+ $[1] = actions;
26
+ $[2] = back;
27
+ $[3] = breadcrumb;
28
+ $[4] = children;
29
+ $[5] = className;
30
+ $[6] = description;
31
+ $[7] = rest;
32
+ $[8] = title;
33
+ } else {
34
+ actions = $[1];
35
+ back = $[2];
36
+ breadcrumb = $[3];
37
+ children = $[4];
38
+ className = $[5];
39
+ description = $[6];
40
+ rest = $[7];
41
+ title = $[8];
42
+ }
43
+ const hasTitle = title !== null && title !== void 0 && title !== false;
44
+ const hasDescription = description !== null && description !== void 0 && description !== false;
45
+ const hasBreadcrumb = breadcrumb !== null && breadcrumb !== void 0 && breadcrumb !== false;
46
+ const hasBack = back !== null && back !== void 0 && back !== false;
47
+ const hasContent = children !== null && children !== void 0 && children !== false;
48
+ const hasActions = actions !== null && actions !== void 0 && actions !== false;
49
+ const t1 = className ? `k-page-header ${className}` : "k-page-header";
50
+ let t2;
51
+ if ($[9] !== breadcrumb || $[10] !== hasBreadcrumb) {
52
+ t2 = hasBreadcrumb ? /* @__PURE__ */ jsx("div", {
53
+ className: "k-page-header-breadcrumb",
54
+ children: breadcrumb
55
+ }) : null;
56
+ $[9] = breadcrumb;
57
+ $[10] = hasBreadcrumb;
58
+ $[11] = t2;
59
+ } else t2 = $[11];
60
+ let t3;
61
+ if ($[12] !== back || $[13] !== description || $[14] !== hasBack || $[15] !== hasDescription || $[16] !== hasTitle || $[17] !== title) {
62
+ t3 = hasBack || hasTitle || hasDescription ? /* @__PURE__ */ jsxs("div", {
63
+ className: "k-page-header-heading",
64
+ children: [back, hasTitle || hasDescription ? /* @__PURE__ */ jsxs("div", {
65
+ className: "k-page-header-copy",
66
+ children: [hasTitle ? /* @__PURE__ */ jsx("div", {
67
+ className: "k-page-header-title",
68
+ children: title
69
+ }) : null, hasDescription ? /* @__PURE__ */ jsx("div", {
70
+ className: "k-page-header-description",
71
+ children: description
72
+ }) : null]
73
+ }) : null]
74
+ }) : null;
75
+ $[12] = back;
76
+ $[13] = description;
77
+ $[14] = hasBack;
78
+ $[15] = hasDescription;
79
+ $[16] = hasTitle;
80
+ $[17] = title;
81
+ $[18] = t3;
82
+ } else t3 = $[18];
83
+ let t4;
84
+ if ($[19] !== children || $[20] !== hasContent) {
85
+ t4 = hasContent ? /* @__PURE__ */ jsx("div", {
86
+ className: "k-page-header-content",
87
+ children
88
+ }) : null;
89
+ $[19] = children;
90
+ $[20] = hasContent;
91
+ $[21] = t4;
92
+ } else t4 = $[21];
93
+ let t5;
94
+ if ($[22] !== t2 || $[23] !== t3 || $[24] !== t4) {
95
+ t5 = /* @__PURE__ */ jsxs("div", {
96
+ className: "k-page-header-main",
97
+ children: [
98
+ t2,
99
+ t3,
100
+ t4
101
+ ]
102
+ });
103
+ $[22] = t2;
104
+ $[23] = t3;
105
+ $[24] = t4;
106
+ $[25] = t5;
107
+ } else t5 = $[25];
108
+ let t6;
109
+ if ($[26] !== actions || $[27] !== hasActions) {
110
+ t6 = hasActions ? /* @__PURE__ */ jsx("div", {
111
+ className: "k-page-header-actions",
112
+ children: actions
113
+ }) : null;
114
+ $[26] = actions;
115
+ $[27] = hasActions;
116
+ $[28] = t6;
117
+ } else t6 = $[28];
118
+ let t7;
119
+ if ($[29] !== rest || $[30] !== t1 || $[31] !== t5 || $[32] !== t6) {
120
+ t7 = /* @__PURE__ */ jsxs("header", {
121
+ ...rest,
122
+ className: t1,
123
+ children: [t5, t6]
124
+ });
125
+ $[29] = rest;
126
+ $[30] = t1;
127
+ $[31] = t5;
128
+ $[32] = t6;
129
+ $[33] = t7;
130
+ } else t7 = $[33];
131
+ return t7;
132
+ }
133
+ //#endregion
134
+ export { PageHeader as default };
@@ -0,0 +1,275 @@
1
+ /*!
2
+ * react-kui v3.0.0
3
+ * Copyright 2017-present, kui-react.
4
+ * All rights reserved.
5
+ * Homepage: https://react.k-ui.cn
6
+ * Author: Qiu / https://chuchur.com
7
+ */
8
+
9
+ import zh_CN_default from "../locale/zh-CN.js";
10
+ import { ConfigContext } from "../config/config-context.js";
11
+ import { CircleQuestionMark } from "../node_modules/.pnpm/kui-icons@5.0.0/node_modules/kui-icons/dist/kui-icons.esm.js";
12
+ import Icon from "../icon/index.js";
13
+ import { getChildren, setRef } from "../utils/react-node.js";
14
+ import Button from "../button/button.js";
15
+ import Teleport from "../base/teleport.js";
16
+ import { Transition } from "../base/transition.js";
17
+ import { setPlacement } from "../utils/placement.js";
18
+ import { c } from "react/compiler-runtime";
19
+ import clsx from "clsx";
20
+ import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
21
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
22
+ //#region components/popconfirm/index.tsx
23
+ /** 与 kui-vue 一致:`PopconfirmPanel` 是 `panelOnly` 模式的 `Popconfirm` */
24
+ function PopconfirmPanel(props) {
25
+ const $ = c(2);
26
+ let t0;
27
+ if ($[0] !== props) {
28
+ t0 = /* @__PURE__ */ jsx(Popconfirm, {
29
+ ...props,
30
+ panelOnly: true
31
+ });
32
+ $[0] = props;
33
+ $[1] = t0;
34
+ } else t0 = $[1];
35
+ return t0;
36
+ }
37
+ var Popconfirm = ({ dark = false, open, defaultOpen = false, show, title, width, okText, cancelText, placement = "top", panelOnly = false, onCancel, onOk, onOpenChange, onShowChange, children }) => {
38
+ const locale = useContext(ConfigContext)?.locale || zh_CN_default;
39
+ const externalOpen = open ?? show;
40
+ const initialOpen = externalOpen ?? defaultOpen;
41
+ const [visible, setVisible] = useState(initialOpen);
42
+ const [rendered, setRendered] = useState(initialOpen);
43
+ const [previousOpen, setPreviousOpen] = useState(externalOpen);
44
+ if (previousOpen !== externalOpen) {
45
+ setPreviousOpen(externalOpen);
46
+ if (externalOpen !== void 0) {
47
+ setVisible(externalOpen);
48
+ if (externalOpen) setRendered(true);
49
+ }
50
+ }
51
+ const [left, setLeft] = useState(0);
52
+ const [top, setTop] = useState(0);
53
+ const [currentPlacement, setCurrentPlacement] = useState(placement);
54
+ const [transOrigin, setTransOrigin] = useState("bottom");
55
+ const refPopper = useRef(null);
56
+ const refSelection = useRef(null);
57
+ const placementRef = useRef(placement);
58
+ const transOriginRef = useRef("bottom");
59
+ const topRef = useRef(0);
60
+ const leftRef = useRef(0);
61
+ const hideTimer = useRef(null);
62
+ const showTimer = useRef(null);
63
+ const updatePosition = useCallback(() => {
64
+ if (!refSelection.current || !refPopper.current) return;
65
+ placementRef.current = placement;
66
+ setPlacement({
67
+ refSelection,
68
+ refPopper,
69
+ currentPlacement: placementRef,
70
+ transOrigin: transOriginRef,
71
+ top: topRef,
72
+ left: leftRef
73
+ });
74
+ setCurrentPlacement(placementRef.current);
75
+ setTransOrigin(transOriginRef.current);
76
+ setTop(topRef.current);
77
+ setLeft(leftRef.current);
78
+ }, [placement]);
79
+ useEffect(() => {
80
+ if (panelOnly || !visible) return;
81
+ updatePosition();
82
+ }, [
83
+ panelOnly,
84
+ title,
85
+ updatePosition,
86
+ visible
87
+ ]);
88
+ const updateShow = useCallback((value) => {
89
+ if (externalOpen === void 0) setVisible(value);
90
+ onOpenChange?.(value);
91
+ onShowChange?.(value);
92
+ }, [
93
+ externalOpen,
94
+ onOpenChange,
95
+ onShowChange
96
+ ]);
97
+ const outsideClick = useCallback((e) => {
98
+ const ctx = refSelection.current;
99
+ if (refPopper.current && !refPopper.current.contains(e.target) && ctx && !ctx.contains(e.target)) updateShow(false);
100
+ }, [updateShow]);
101
+ useEffect(() => {
102
+ if (panelOnly) return;
103
+ window.addEventListener("resize", updatePosition);
104
+ return () => {
105
+ window.removeEventListener("resize", updatePosition);
106
+ };
107
+ }, [panelOnly, updatePosition]);
108
+ useEffect(() => {
109
+ if (!visible) return;
110
+ document.addEventListener("click", outsideClick);
111
+ return () => document.removeEventListener("click", outsideClick);
112
+ }, [outsideClick, visible]);
113
+ const showPopconfirm = () => {
114
+ if (showTimer.current) clearTimeout(showTimer.current);
115
+ if (!rendered) {
116
+ setRendered(true);
117
+ setTimeout(() => {
118
+ updateShow(true);
119
+ setTimeout(updatePosition, 0);
120
+ }, 0);
121
+ } else {
122
+ updateShow(true);
123
+ setTimeout(updatePosition, 0);
124
+ }
125
+ };
126
+ const ok = () => {
127
+ updateShow(false);
128
+ onOk?.();
129
+ };
130
+ const cancel = () => {
131
+ updateShow(false);
132
+ onCancel?.();
133
+ };
134
+ const childList = getChildren(children);
135
+ const firstChild = childList.length === 1 ? childList[0] : null;
136
+ const setSelectionRef = (node) => {
137
+ refSelection.current = node;
138
+ };
139
+ let triggerNode;
140
+ if (firstChild && React.isValidElement(firstChild)) {
141
+ const childProps = firstChild.props;
142
+ triggerNode = React.cloneElement(firstChild, {
143
+ ref: (node_0) => {
144
+ setRef(childProps.ref, node_0);
145
+ setSelectionRef(node_0);
146
+ },
147
+ onClick: (event) => {
148
+ childProps.onClick?.(event);
149
+ showPopconfirm();
150
+ }
151
+ });
152
+ } else triggerNode = /* @__PURE__ */ jsx("span", {
153
+ ref: setSelectionRef,
154
+ onClick: showPopconfirm,
155
+ children
156
+ });
157
+ const preCls = "popconfirm";
158
+ const overlayNode = rendered ? /* @__PURE__ */ jsx(Transition, {
159
+ show: visible,
160
+ name: `k-${preCls}`,
161
+ nodeRef: refPopper,
162
+ appear: true,
163
+ children: /* @__PURE__ */ jsx("div", {
164
+ ref: refPopper,
165
+ "k-placement": currentPlacement,
166
+ className: clsx(`k-${preCls}`, `k-${preCls}-has-arrow`, { [`k-${preCls}-dark`]: dark }),
167
+ style: {
168
+ left: `${left}px`,
169
+ top: `${top}px`,
170
+ transformOrigin: transOrigin,
171
+ width: width ? typeof width === "number" ? `${width}px` : width : void 0
172
+ },
173
+ onMouseEnter: () => {
174
+ if (hideTimer.current) clearTimeout(hideTimer.current);
175
+ updateShow(true);
176
+ },
177
+ onMouseLeave: () => {
178
+ showTimer.current = setTimeout(() => {
179
+ updateShow(false);
180
+ }, 300);
181
+ },
182
+ children: /* @__PURE__ */ jsxs("div", {
183
+ className: `k-${preCls}-content`,
184
+ children: [
185
+ /* @__PURE__ */ jsxs("div", {
186
+ className: `k-${preCls}-body`,
187
+ children: [/* @__PURE__ */ jsx(Icon, { type: CircleQuestionMark }), /* @__PURE__ */ jsx("div", {
188
+ className: `k-${preCls}-title`,
189
+ children: title
190
+ })]
191
+ }),
192
+ /* @__PURE__ */ jsxs("div", {
193
+ className: `k-${preCls}-footer`,
194
+ children: [/* @__PURE__ */ jsx(Button, {
195
+ size: "small",
196
+ onClick: cancel,
197
+ children: cancelText || locale?.k?.common?.cancel
198
+ }), /* @__PURE__ */ jsx(Button, {
199
+ size: "small",
200
+ type: "primary",
201
+ onClick: ok,
202
+ children: okText || locale?.k?.common?.ok
203
+ })]
204
+ }),
205
+ /* @__PURE__ */ jsx("div", {
206
+ className: `k-${preCls}-arrow`,
207
+ children: /* @__PURE__ */ jsxs("svg", {
208
+ style: { fill: "currentcolor" },
209
+ viewBox: "0 0 24 8",
210
+ children: [/* @__PURE__ */ jsx("path", {
211
+ d: "M24,0.97087 L24,1.97087 C20,1.97087 18.5,2.97087 16.5,4.97087 C14.5,6.97087 14,7.97087 12,7.97087 C10,7.97087 9.5,6.97087 7.5,4.97087 C5.5,2.97087 4,1.97087 0,1.97087 L0,0.97087 L24,0.97087 Z",
212
+ id: "ot"
213
+ }), /* @__PURE__ */ jsx("path", {
214
+ d: "M24,0 L24,1 C20.032328,1 18.1576594,1.985435 16.1576594,3.985435 C14.1576594,5.985435 13.3847825,7 12,7 C10.6152175,7 9.81306952,5.985435 7.81306952,3.985435 C5.81306952,1.985435 4.0114261,1 0,1 L0,0 L24,0 Z",
215
+ id: "in",
216
+ stroke: "currentcolor"
217
+ })]
218
+ })
219
+ })
220
+ ]
221
+ })
222
+ })
223
+ }) : null;
224
+ if (panelOnly) return /* @__PURE__ */ jsx("div", {
225
+ "k-placement": placement,
226
+ className: clsx(`k-${preCls}`, `k-${preCls}-has-arrow`, `k-${preCls}-panel`, { [`k-${preCls}-dark`]: dark }),
227
+ style: { width: width ? typeof width === "number" ? `${width}px` : width : void 0 },
228
+ children: /* @__PURE__ */ jsxs("div", {
229
+ className: `k-${preCls}-content`,
230
+ children: [
231
+ /* @__PURE__ */ jsxs("div", {
232
+ className: `k-${preCls}-body`,
233
+ children: [/* @__PURE__ */ jsx(Icon, { type: CircleQuestionMark }), /* @__PURE__ */ jsx("div", {
234
+ className: `k-${preCls}-title`,
235
+ children: title
236
+ })]
237
+ }),
238
+ /* @__PURE__ */ jsxs("div", {
239
+ className: `k-${preCls}-footer`,
240
+ children: [/* @__PURE__ */ jsx(Button, {
241
+ size: "small",
242
+ onClick: cancel,
243
+ children: cancelText || locale?.k?.common?.cancel
244
+ }), /* @__PURE__ */ jsx(Button, {
245
+ size: "small",
246
+ type: "primary",
247
+ onClick: ok,
248
+ children: okText || locale?.k?.common?.ok
249
+ })]
250
+ }),
251
+ /* @__PURE__ */ jsx("div", {
252
+ className: `k-${preCls}-arrow`,
253
+ children: /* @__PURE__ */ jsxs("svg", {
254
+ style: { fill: "currentcolor" },
255
+ viewBox: "0 0 24 8",
256
+ children: [/* @__PURE__ */ jsx("path", {
257
+ id: "ot",
258
+ d: "m24,0.97087l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
259
+ }), /* @__PURE__ */ jsx("path", {
260
+ id: "in",
261
+ stroke: "currentcolor",
262
+ d: "m24,0l0,1c-4,0 -5.5,1 -7.5,3c-2,2 -2.5,3 -4.5,3c-2,0 -2.5,-1 -4.5,-3c-2,-2 -3.5,-3 -7.5,-3l0,-1l24,0z"
263
+ })]
264
+ })
265
+ })
266
+ ]
267
+ })
268
+ });
269
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [triggerNode, /* @__PURE__ */ jsx(Teleport, {
270
+ to: "body",
271
+ children: overlayNode
272
+ })] });
273
+ };
274
+ //#endregion
275
+ export { PopconfirmPanel, Popconfirm as default };