@kupola/kupola 1.9.16 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (585) hide show
  1. package/README.md +247 -401
  2. package/README.zh-CN.md +333 -0
  3. package/dist/kupola-core-alert.cjs.js +9 -0
  4. package/dist/kupola-core-alert.esm.js +9 -0
  5. package/dist/kupola-core-avatar.cjs.js +1 -0
  6. package/dist/kupola-core-avatar.esm.js +1 -0
  7. package/dist/kupola-core-badge.cjs.js +3 -0
  8. package/dist/kupola-core-badge.esm.js +3 -0
  9. package/dist/kupola-core-breadcrumb.cjs.js +1 -0
  10. package/dist/kupola-core-breadcrumb.esm.js +1 -0
  11. package/dist/kupola-core-calendar.cjs.js +1 -0
  12. package/dist/kupola-core-calendar.esm.js +1 -0
  13. package/dist/kupola-core-carousel.cjs.js +12 -0
  14. package/dist/kupola-core-carousel.esm.js +12 -0
  15. package/dist/kupola-core-checkbox.cjs.js +7 -0
  16. package/dist/kupola-core-checkbox.esm.js +7 -0
  17. package/dist/kupola-core-collapse.cjs.js +11 -0
  18. package/dist/kupola-core-collapse.esm.js +11 -0
  19. package/dist/kupola-core-colorpicker.cjs.js +14 -0
  20. package/dist/kupola-core-colorpicker.esm.js +14 -0
  21. package/dist/kupola-core-countdown.cjs.js +23 -0
  22. package/dist/kupola-core-countdown.esm.js +23 -0
  23. package/dist/kupola-core-datepicker.cjs.js +28 -0
  24. package/dist/kupola-core-datepicker.esm.js +28 -0
  25. package/dist/kupola-core-dialog.cjs.js +13 -0
  26. package/dist/kupola-core-dialog.esm.js +13 -0
  27. package/dist/kupola-core-directives.cjs.js +1 -0
  28. package/dist/kupola-core-directives.esm.js +1 -0
  29. package/dist/kupola-core-divider.cjs.js +1 -0
  30. package/dist/kupola-core-divider.esm.js +1 -0
  31. package/dist/kupola-core-drawer.cjs.js +15 -0
  32. package/dist/kupola-core-drawer.esm.js +15 -0
  33. package/dist/kupola-core-dropdown.cjs.js +11 -0
  34. package/dist/kupola-core-dropdown.esm.js +11 -0
  35. package/dist/kupola-core-dynamictags.cjs.js +8 -0
  36. package/dist/kupola-core-dynamictags.esm.js +8 -0
  37. package/dist/kupola-core-empty.cjs.js +7 -0
  38. package/dist/kupola-core-empty.esm.js +7 -0
  39. package/dist/kupola-core-fileupload.cjs.js +15 -0
  40. package/dist/kupola-core-fileupload.esm.js +15 -0
  41. package/dist/kupola-core-form.cjs.js +1 -0
  42. package/dist/kupola-core-form.esm.js +1 -0
  43. package/dist/kupola-core-heatmap.cjs.js +1 -0
  44. package/dist/kupola-core-heatmap.esm.js +1 -0
  45. package/dist/kupola-core-icons.cjs.js +1 -0
  46. package/dist/kupola-core-icons.esm.js +1 -0
  47. package/dist/kupola-core-imagepreview.cjs.js +20 -0
  48. package/dist/kupola-core-imagepreview.esm.js +20 -0
  49. package/dist/kupola-core-input.cjs.js +5 -0
  50. package/dist/kupola-core-input.esm.js +5 -0
  51. package/dist/kupola-core-kbd.cjs.js +1 -0
  52. package/dist/kupola-core-kbd.esm.js +1 -0
  53. package/dist/kupola-core-menu.cjs.js +1 -0
  54. package/dist/kupola-core-menu.esm.js +1 -0
  55. package/dist/kupola-core-message.cjs.js +1 -0
  56. package/dist/kupola-core-message.esm.js +1 -0
  57. package/dist/kupola-core-modal.cjs.js +15 -0
  58. package/dist/kupola-core-modal.esm.js +15 -0
  59. package/dist/kupola-core-notification.cjs.js +1 -0
  60. package/dist/kupola-core-notification.esm.js +1 -0
  61. package/dist/kupola-core-numberinput.cjs.js +7 -0
  62. package/dist/kupola-core-numberinput.esm.js +7 -0
  63. package/dist/kupola-core-pagination.cjs.js +12 -0
  64. package/dist/kupola-core-pagination.esm.js +12 -0
  65. package/dist/kupola-core-progress.cjs.js +5 -0
  66. package/dist/kupola-core-progress.esm.js +5 -0
  67. package/dist/kupola-core-radio.cjs.js +1 -0
  68. package/dist/kupola-core-radio.esm.js +1 -0
  69. package/dist/kupola-core-select.cjs.js +15 -0
  70. package/dist/kupola-core-select.esm.js +15 -0
  71. package/dist/kupola-core-server.cjs.js +1 -0
  72. package/dist/kupola-core-server.esm.js +1 -0
  73. package/dist/kupola-core-skeleton.cjs.js +1 -0
  74. package/dist/kupola-core-skeleton.esm.js +1 -0
  75. package/dist/kupola-core-slider.cjs.js +15 -0
  76. package/dist/kupola-core-slider.esm.js +15 -0
  77. package/dist/kupola-core-spin.cjs.js +6 -0
  78. package/dist/kupola-core-spin.esm.js +6 -0
  79. package/dist/kupola-core-statcard.cjs.js +18 -0
  80. package/dist/kupola-core-statcard.esm.js +18 -0
  81. package/dist/kupola-core-switch.cjs.js +6 -0
  82. package/dist/kupola-core-switch.esm.js +6 -0
  83. package/dist/kupola-core-table.cjs.js +1 -0
  84. package/dist/kupola-core-table.esm.js +1 -0
  85. package/dist/kupola-core-tabs.cjs.js +6 -0
  86. package/dist/kupola-core-tabs.esm.js +6 -0
  87. package/dist/kupola-core-tag.cjs.js +6 -0
  88. package/dist/kupola-core-tag.esm.js +6 -0
  89. package/dist/kupola-core-textarea.cjs.js +3 -0
  90. package/dist/kupola-core-textarea.esm.js +3 -0
  91. package/dist/kupola-core-timeline.cjs.js +1 -0
  92. package/dist/kupola-core-timeline.esm.js +1 -0
  93. package/dist/kupola-core-timepicker.cjs.js +22 -0
  94. package/dist/kupola-core-timepicker.esm.js +22 -0
  95. package/dist/kupola-core-tooltip.cjs.js +1 -0
  96. package/dist/kupola-core-tooltip.esm.js +1 -0
  97. package/dist/kupola-core-tree.cjs.js +1 -0
  98. package/dist/kupola-core-tree.esm.js +1 -0
  99. package/dist/kupola-core-validation.cjs.js +1 -0
  100. package/dist/kupola-core-validation.esm.js +1 -0
  101. package/dist/kupola-core-virtuallist.cjs.js +7 -0
  102. package/dist/kupola-core-virtuallist.esm.js +7 -0
  103. package/dist/kupola-core.cjs.js +1 -0
  104. package/dist/kupola-core.esm.js +1 -0
  105. package/package.json +203 -75
  106. package/packages/core/__tests__/component.test.js +269 -0
  107. package/packages/core/__tests__/components/alert.test.js +136 -0
  108. package/packages/core/__tests__/components/avatar.test.js +132 -0
  109. package/packages/core/__tests__/components/badge.test.js +187 -0
  110. package/packages/core/__tests__/components/breadcrumb.test.js +120 -0
  111. package/packages/core/__tests__/components/calendar.test.js +293 -0
  112. package/packages/core/__tests__/components/carousel.test.js +220 -0
  113. package/packages/core/__tests__/components/checkbox.test.js +139 -0
  114. package/packages/core/__tests__/components/collapse.test.js +220 -0
  115. package/packages/core/__tests__/components/colorpicker.test.js +173 -0
  116. package/packages/core/__tests__/components/countdown.test.js +156 -0
  117. package/packages/core/__tests__/components/datepicker.test.js +344 -0
  118. package/packages/core/__tests__/components/dialog.test.js +188 -0
  119. package/packages/core/__tests__/components/divider.test.js +84 -0
  120. package/packages/core/__tests__/components/drawer.test.js +230 -0
  121. package/packages/core/__tests__/components/dropdown.test.js +324 -0
  122. package/packages/core/__tests__/components/dynamictags.test.js +239 -0
  123. package/packages/core/__tests__/components/empty.test.js +107 -0
  124. package/packages/core/__tests__/components/fileupload.test.js +151 -0
  125. package/packages/core/__tests__/components/form.test.js +258 -0
  126. package/packages/core/__tests__/components/heatmap.test.js +161 -0
  127. package/packages/core/__tests__/components/icons.test.js +166 -0
  128. package/packages/core/__tests__/components/imagepreview.test.js +166 -0
  129. package/packages/core/__tests__/components/input.test.js +165 -0
  130. package/packages/core/__tests__/components/kbd.test.js +74 -0
  131. package/packages/core/__tests__/components/menu.test.js +131 -0
  132. package/packages/core/__tests__/components/message.test.js +136 -0
  133. package/packages/core/__tests__/components/modal.test.js +291 -0
  134. package/packages/core/__tests__/components/notification.test.js +164 -0
  135. package/packages/core/__tests__/components/numberinput.test.js +153 -0
  136. package/packages/core/__tests__/components/pagination.test.js +229 -0
  137. package/packages/core/__tests__/components/progress.test.js +156 -0
  138. package/packages/core/__tests__/components/radio.test.js +167 -0
  139. package/packages/core/__tests__/components/select.test.js +352 -0
  140. package/packages/core/__tests__/components/skeleton.test.js +126 -0
  141. package/packages/core/__tests__/components/slider.test.js +177 -0
  142. package/packages/core/__tests__/components/spin.test.js +95 -0
  143. package/packages/core/__tests__/components/statcard.test.js +167 -0
  144. package/packages/core/__tests__/components/switch.test.js +145 -0
  145. package/packages/core/__tests__/components/table.test.js +611 -0
  146. package/packages/core/__tests__/components/tabs.test.js +185 -0
  147. package/packages/core/__tests__/components/tag.test.js +130 -0
  148. package/packages/core/__tests__/components/textarea.test.js +137 -0
  149. package/packages/core/__tests__/components/timeline.test.js +126 -0
  150. package/packages/core/__tests__/components/timepicker.test.js +184 -0
  151. package/packages/core/__tests__/components/tooltip.test.js +237 -0
  152. package/packages/core/__tests__/components/tree.test.js +238 -0
  153. package/packages/core/__tests__/components/validation.test.js +256 -0
  154. package/packages/core/__tests__/components/virtuallist.test.js +141 -0
  155. package/packages/core/__tests__/core.test.js +357 -0
  156. package/packages/core/__tests__/directives.test.js +467 -0
  157. package/packages/core/__tests__/server.test.js +290 -0
  158. package/packages/core/__tests__/template.test.js +301 -0
  159. package/packages/core/package.json +234 -0
  160. package/packages/core/src/batch.js +66 -0
  161. package/packages/core/src/component.js +154 -0
  162. package/packages/core/src/components/alert.js +92 -0
  163. package/packages/core/src/components/avatar.js +87 -0
  164. package/packages/core/src/components/badge.js +106 -0
  165. package/packages/core/src/components/breadcrumb.js +83 -0
  166. package/packages/core/src/components/calendar.js +442 -0
  167. package/packages/core/src/components/carousel.js +173 -0
  168. package/packages/core/src/components/checkbox.js +101 -0
  169. package/packages/core/src/components/collapse.js +148 -0
  170. package/packages/core/src/components/colorpicker.js +147 -0
  171. package/packages/core/src/components/countdown.js +142 -0
  172. package/packages/core/src/components/datepicker.js +378 -0
  173. package/packages/core/src/components/dialog.js +142 -0
  174. package/packages/core/src/components/divider.js +63 -0
  175. package/packages/core/src/components/drawer.js +125 -0
  176. package/packages/core/src/components/dropdown.js +191 -0
  177. package/packages/core/src/components/dynamictags.js +173 -0
  178. package/packages/core/src/components/empty.js +71 -0
  179. package/packages/core/src/components/fileupload.js +203 -0
  180. package/packages/core/src/components/form.js +257 -0
  181. package/packages/core/src/components/heatmap.js +324 -0
  182. package/{js → packages/core/src/components}/icons.js +40 -53
  183. package/packages/core/src/components/imagepreview.js +146 -0
  184. package/packages/core/src/components/input.js +117 -0
  185. package/packages/core/src/components/kbd.js +53 -0
  186. package/packages/core/src/components/menu.js +105 -0
  187. package/packages/core/src/components/message.js +115 -0
  188. package/packages/core/src/components/modal.js +120 -0
  189. package/packages/core/src/components/notification.js +150 -0
  190. package/packages/core/src/components/numberinput.js +141 -0
  191. package/packages/core/src/components/pagination.js +186 -0
  192. package/packages/core/src/components/progress.js +107 -0
  193. package/packages/core/src/components/radio.js +128 -0
  194. package/packages/core/src/components/select.js +340 -0
  195. package/packages/core/src/components/skeleton.js +77 -0
  196. package/packages/core/src/components/slider.js +134 -0
  197. package/packages/core/src/components/spin.js +58 -0
  198. package/packages/core/src/components/statcard.js +100 -0
  199. package/packages/core/src/components/switch.js +105 -0
  200. package/packages/core/src/components/table.js +916 -0
  201. package/packages/core/src/components/tabs.js +139 -0
  202. package/packages/core/src/components/tag.js +89 -0
  203. package/packages/core/src/components/textarea.js +115 -0
  204. package/packages/core/src/components/timeline.js +91 -0
  205. package/packages/core/src/components/timepicker.js +212 -0
  206. package/packages/core/src/components/tooltip.js +184 -0
  207. package/packages/core/src/components/tree.js +156 -0
  208. package/packages/core/src/components/types.d.ts +917 -0
  209. package/packages/core/src/components/validation.js +329 -0
  210. package/packages/core/src/components/virtuallist.js +157 -0
  211. package/packages/core/src/computed.js +118 -0
  212. package/packages/core/src/directives.js +413 -0
  213. package/packages/core/src/effect.js +98 -0
  214. package/packages/core/src/index.js +39 -0
  215. package/packages/core/src/render.js +431 -0
  216. package/packages/core/src/scheduler.js +51 -0
  217. package/packages/core/src/server.js +446 -0
  218. package/packages/core/src/signal.js +157 -0
  219. package/packages/core/src/template.js +51 -0
  220. package/adapters/axios.d.ts +0 -34
  221. package/adapters/axios.js +0 -122
  222. package/adapters/navios-http.d.ts +0 -110
  223. package/adapters/navios-http.js +0 -151
  224. package/css/accessibility.css +0 -119
  225. package/css/animations.css +0 -224
  226. package/css/brand-themes.css +0 -300
  227. package/css/colors-and-type.css +0 -408
  228. package/css/components-ext.css +0 -4401
  229. package/css/components.css +0 -1576
  230. package/css/dashboard.css +0 -425
  231. package/css/kupola.css +0 -13
  232. package/css/responsive.css +0 -697
  233. package/css/scaffold.css +0 -155
  234. package/css/states.css +0 -316
  235. package/css/table.css +0 -75
  236. package/css/theme.css +0 -568
  237. package/css/utilities.css +0 -334
  238. package/dist/core-Cs-VWZ5H.cjs +0 -1
  239. package/dist/core-DBjFFC_n.js +0 -4959
  240. package/dist/core.cjs.js +0 -1
  241. package/dist/core.esm.js +0 -106
  242. package/dist/css/accessibility.css +0 -119
  243. package/dist/css/animations.css +0 -224
  244. package/dist/css/brand-themes.css +0 -300
  245. package/dist/css/colors-and-type.css +0 -408
  246. package/dist/css/components-ext.css +0 -4401
  247. package/dist/css/components.css +0 -1576
  248. package/dist/css/dashboard.css +0 -368
  249. package/dist/css/kupola.css +0 -14
  250. package/dist/css/responsive.css +0 -697
  251. package/dist/css/scaffold.css +0 -155
  252. package/dist/css/states.css +0 -316
  253. package/dist/css/table.css +0 -75
  254. package/dist/css/theme-dark.css +0 -341
  255. package/dist/css/theme-light.css +0 -298
  256. package/dist/css/utilities.css +0 -334
  257. package/dist/icons/icons/activity.svg +0 -3
  258. package/dist/icons/icons/alert-circle.svg +0 -1
  259. package/dist/icons/icons/alert-triangle.svg +0 -1
  260. package/dist/icons/icons/alert.d27e24.svg +0 -1
  261. package/dist/icons/icons/alert.svg +0 -1
  262. package/dist/icons/icons/apple.svg +0 -1
  263. package/dist/icons/icons/arrow-down.svg +0 -1
  264. package/dist/icons/icons/arrow-expand.svg +0 -1
  265. package/dist/icons/icons/arrow-left.svg +0 -1
  266. package/dist/icons/icons/arrow-minimize.svg +0 -1
  267. package/dist/icons/icons/arrow-right-to-line.svg +0 -1
  268. package/dist/icons/icons/arrow-right.svg +0 -1
  269. package/dist/icons/icons/arrow-up-right.svg +0 -1
  270. package/dist/icons/icons/arrow-up.0c0c0d.svg +0 -1
  271. package/dist/icons/icons/arrow-up.svg +0 -1
  272. package/dist/icons/icons/at.svg +0 -1
  273. package/dist/icons/icons/atom.0c0c0d.svg +0 -1
  274. package/dist/icons/icons/atom.svg +0 -1
  275. package/dist/icons/icons/bar-chart-2.svg +0 -1
  276. package/dist/icons/icons/bar.svg +0 -1
  277. package/dist/icons/icons/bell.svg +0 -1
  278. package/dist/icons/icons/box.svg +0 -1
  279. package/dist/icons/icons/bug.svg +0 -1
  280. package/dist/icons/icons/button.svg +0 -1
  281. package/dist/icons/icons/calendar.svg +0 -1
  282. package/dist/icons/icons/check-circle.33c192.svg +0 -1
  283. package/dist/icons/icons/check-circle.svg +0 -1
  284. package/dist/icons/icons/check-square.svg +0 -4
  285. package/dist/icons/icons/check.d1d3db.svg +0 -1
  286. package/dist/icons/icons/check.svg +0 -1
  287. package/dist/icons/icons/chevron-down.svg +0 -1
  288. package/dist/icons/icons/chevron-left.svg +0 -1
  289. package/dist/icons/icons/chevron-right.svg +0 -1
  290. package/dist/icons/icons/chevron-up.svg +0 -1
  291. package/dist/icons/icons/circle.svg +0 -1
  292. package/dist/icons/icons/clock.svg +0 -1
  293. package/dist/icons/icons/cmd.svg +0 -1
  294. package/dist/icons/icons/code.svg +0 -1
  295. package/dist/icons/icons/columns.svg +0 -1
  296. package/dist/icons/icons/copy.svg +0 -1
  297. package/dist/icons/icons/cpu.svg +0 -1
  298. package/dist/icons/icons/dashboard.0c0c0d.svg +0 -1
  299. package/dist/icons/icons/dashboard.svg +0 -1
  300. package/dist/icons/icons/dollar.svg +0 -1
  301. package/dist/icons/icons/download.svg +0 -1
  302. package/dist/icons/icons/edit.svg +0 -1
  303. package/dist/icons/icons/extensions.svg +0 -1
  304. package/dist/icons/icons/external.svg +0 -1
  305. package/dist/icons/icons/eye.svg +0 -1
  306. package/dist/icons/icons/file-text.svg +0 -1
  307. package/dist/icons/icons/file.svg +0 -1
  308. package/dist/icons/icons/files.svg +0 -1
  309. package/dist/icons/icons/filter.svg +0 -1
  310. package/dist/icons/icons/folder-open.svg +0 -4
  311. package/dist/icons/icons/folder.svg +0 -1
  312. package/dist/icons/icons/gear.svg +0 -1
  313. package/dist/icons/icons/git.svg +0 -1
  314. package/dist/icons/icons/github.svg +0 -1
  315. package/dist/icons/icons/globe.svg +0 -1
  316. package/dist/icons/icons/grid-2x2.svg +0 -1
  317. package/dist/icons/icons/hash.svg +0 -1
  318. package/dist/icons/icons/heart.svg +0 -1
  319. package/dist/icons/icons/help-circle.svg +0 -5
  320. package/dist/icons/icons/help.svg +0 -1
  321. package/dist/icons/icons/home.svg +0 -1
  322. package/dist/icons/icons/icons.svg +0 -153
  323. package/dist/icons/icons/image.svg +0 -1
  324. package/dist/icons/icons/info-circle.svg +0 -1
  325. package/dist/icons/icons/info-square.svg +0 -1
  326. package/dist/icons/icons/info.387bff.svg +0 -1
  327. package/dist/icons/icons/info.svg +0 -1
  328. package/dist/icons/icons/input.svg +0 -1
  329. package/dist/icons/icons/key.svg +0 -1
  330. package/dist/icons/icons/layers.svg +0 -1
  331. package/dist/icons/icons/layout-grid.svg +0 -6
  332. package/dist/icons/icons/layout.svg +0 -1
  333. package/dist/icons/icons/link.svg +0 -1
  334. package/dist/icons/icons/list.svg +0 -1
  335. package/dist/icons/icons/lock.svg +0 -1
  336. package/dist/icons/icons/log-out.svg +0 -1
  337. package/dist/icons/icons/logo.svg +0 -1
  338. package/dist/icons/icons/mail.svg +0 -1
  339. package/dist/icons/icons/menu.svg +0 -1
  340. package/dist/icons/icons/message-circle.svg +0 -1
  341. package/dist/icons/icons/message-plus.svg +0 -1
  342. package/dist/icons/icons/message-square.svg +0 -1
  343. package/dist/icons/icons/mic.svg +0 -1
  344. package/dist/icons/icons/minus.svg +0 -1
  345. package/dist/icons/icons/moon.svg +0 -1
  346. package/dist/icons/icons/more-h.svg +0 -1
  347. package/dist/icons/icons/mouse.svg +0 -1
  348. package/dist/icons/icons/palette.svg +0 -1
  349. package/dist/icons/icons/panel-bottom.svg +0 -1
  350. package/dist/icons/icons/pause.svg +0 -1
  351. package/dist/icons/icons/play.svg +0 -1
  352. package/dist/icons/icons/plug.svg +0 -1
  353. package/dist/icons/icons/plus.0c0c0d.svg +0 -1
  354. package/dist/icons/icons/plus.svg +0 -1
  355. package/dist/icons/icons/refresh.svg +0 -1
  356. package/dist/icons/icons/ruler.svg +0 -1
  357. package/dist/icons/icons/scroll-text.svg +0 -1
  358. package/dist/icons/icons/search-menu.svg +0 -1
  359. package/dist/icons/icons/search.svg +0 -1
  360. package/dist/icons/icons/send.0c0c0d.svg +0 -1
  361. package/dist/icons/icons/send.svg +0 -1
  362. package/dist/icons/icons/settings.0c0c0d.svg +0 -1
  363. package/dist/icons/icons/settings.svg +0 -1
  364. package/dist/icons/icons/shield.svg +0 -1
  365. package/dist/icons/icons/sidebar-left.svg +0 -1
  366. package/dist/icons/icons/sidebar-right.svg +0 -1
  367. package/dist/icons/icons/sliders.svg +0 -1
  368. package/dist/icons/icons/sparkles.32f08c.svg +0 -1
  369. package/dist/icons/icons/sparkles.svg +0 -1
  370. package/dist/icons/icons/square.svg +0 -1
  371. package/dist/icons/icons/star.svg +0 -1
  372. package/dist/icons/icons/sun.svg +0 -1
  373. package/dist/icons/icons/table.svg +0 -1
  374. package/dist/icons/icons/terminal.svg +0 -1
  375. package/dist/icons/icons/trash.svg +0 -1
  376. package/dist/icons/icons/trending-down.svg +0 -1
  377. package/dist/icons/icons/trending-up.svg +0 -1
  378. package/dist/icons/icons/type.svg +0 -1
  379. package/dist/icons/icons/upload.svg +0 -1
  380. package/dist/icons/icons/user-circle.svg +0 -1
  381. package/dist/icons/icons/user-plus.svg +0 -6
  382. package/dist/icons/icons/user.svg +0 -1
  383. package/dist/icons/icons/users.svg +0 -1
  384. package/dist/icons/icons/warning.svg +0 -1
  385. package/dist/icons/icons/wrench.svg +0 -1
  386. package/dist/icons/icons/x-circle.svg +0 -1
  387. package/dist/icons/icons/x.svg +0 -1
  388. package/dist/icons/icons/zap.0c0c0d.svg +0 -1
  389. package/dist/icons/icons/zap.svg +0 -1
  390. package/dist/kupola.cjs.js +0 -1
  391. package/dist/kupola.css +0 -9601
  392. package/dist/kupola.esm.js +0 -9965
  393. package/dist/kupola.min.css +0 -1
  394. package/dist/plugins/vite-plugin-kupola.js +0 -142
  395. package/dist/plugins/webpack-plugin-kupola.js +0 -69
  396. package/dist/react-theme.js +0 -111
  397. package/dist/theme-preload.js +0 -75
  398. package/dist/theme-standalone.js +0 -161
  399. package/dist/types/kupola.d.ts +0 -1608
  400. package/dist/vue-theme.js +0 -78
  401. package/icons/activity.svg +0 -3
  402. package/icons/alert-circle.svg +0 -1
  403. package/icons/alert-triangle.svg +0 -1
  404. package/icons/alert.d27e24.svg +0 -1
  405. package/icons/alert.svg +0 -1
  406. package/icons/apple.svg +0 -1
  407. package/icons/arrow-down.svg +0 -1
  408. package/icons/arrow-expand.svg +0 -1
  409. package/icons/arrow-left.svg +0 -1
  410. package/icons/arrow-minimize.svg +0 -1
  411. package/icons/arrow-right-to-line.svg +0 -1
  412. package/icons/arrow-right.svg +0 -1
  413. package/icons/arrow-up-right.svg +0 -1
  414. package/icons/arrow-up.0c0c0d.svg +0 -1
  415. package/icons/arrow-up.svg +0 -1
  416. package/icons/at.svg +0 -1
  417. package/icons/atom.0c0c0d.svg +0 -1
  418. package/icons/atom.svg +0 -1
  419. package/icons/bar-chart-2.svg +0 -1
  420. package/icons/bar.svg +0 -1
  421. package/icons/bell.svg +0 -1
  422. package/icons/box.svg +0 -1
  423. package/icons/bug.svg +0 -1
  424. package/icons/button.svg +0 -1
  425. package/icons/calendar.svg +0 -1
  426. package/icons/check-circle.33c192.svg +0 -1
  427. package/icons/check-circle.svg +0 -1
  428. package/icons/check-square.svg +0 -4
  429. package/icons/check.d1d3db.svg +0 -1
  430. package/icons/check.svg +0 -1
  431. package/icons/chevron-down.svg +0 -1
  432. package/icons/chevron-left.svg +0 -1
  433. package/icons/chevron-right.svg +0 -1
  434. package/icons/chevron-up.svg +0 -1
  435. package/icons/circle.svg +0 -1
  436. package/icons/clock.svg +0 -1
  437. package/icons/cmd.svg +0 -1
  438. package/icons/code.svg +0 -1
  439. package/icons/columns.svg +0 -1
  440. package/icons/copy.svg +0 -1
  441. package/icons/cpu.svg +0 -1
  442. package/icons/dashboard.0c0c0d.svg +0 -1
  443. package/icons/dashboard.svg +0 -1
  444. package/icons/dollar.svg +0 -1
  445. package/icons/download.svg +0 -1
  446. package/icons/edit.svg +0 -1
  447. package/icons/extensions.svg +0 -1
  448. package/icons/external.svg +0 -1
  449. package/icons/eye.svg +0 -1
  450. package/icons/file-text.svg +0 -1
  451. package/icons/file.svg +0 -1
  452. package/icons/files.svg +0 -1
  453. package/icons/filter.svg +0 -1
  454. package/icons/folder-open.svg +0 -4
  455. package/icons/folder.svg +0 -1
  456. package/icons/gear.svg +0 -1
  457. package/icons/git.svg +0 -1
  458. package/icons/github.svg +0 -1
  459. package/icons/globe.svg +0 -1
  460. package/icons/grid-2x2.svg +0 -1
  461. package/icons/hash.svg +0 -1
  462. package/icons/heart.svg +0 -1
  463. package/icons/help-circle.svg +0 -5
  464. package/icons/help.svg +0 -1
  465. package/icons/home.svg +0 -1
  466. package/icons/icons.svg +0 -153
  467. package/icons/image.svg +0 -1
  468. package/icons/info-circle.svg +0 -1
  469. package/icons/info-square.svg +0 -1
  470. package/icons/info.387bff.svg +0 -1
  471. package/icons/info.svg +0 -1
  472. package/icons/input.svg +0 -1
  473. package/icons/key.svg +0 -1
  474. package/icons/layers.svg +0 -1
  475. package/icons/layout-grid.svg +0 -6
  476. package/icons/layout.svg +0 -1
  477. package/icons/link.svg +0 -1
  478. package/icons/list.svg +0 -1
  479. package/icons/lock.svg +0 -1
  480. package/icons/log-out.svg +0 -1
  481. package/icons/logo.svg +0 -1
  482. package/icons/mail.svg +0 -1
  483. package/icons/menu.svg +0 -1
  484. package/icons/message-circle.svg +0 -1
  485. package/icons/message-plus.svg +0 -1
  486. package/icons/message-square.svg +0 -1
  487. package/icons/mic.svg +0 -1
  488. package/icons/minus.svg +0 -1
  489. package/icons/moon.svg +0 -1
  490. package/icons/more-h.svg +0 -1
  491. package/icons/mouse.svg +0 -1
  492. package/icons/palette.svg +0 -1
  493. package/icons/panel-bottom.svg +0 -1
  494. package/icons/pause.svg +0 -1
  495. package/icons/play.svg +0 -1
  496. package/icons/plug.svg +0 -1
  497. package/icons/plus.0c0c0d.svg +0 -1
  498. package/icons/plus.svg +0 -1
  499. package/icons/refresh.svg +0 -1
  500. package/icons/ruler.svg +0 -1
  501. package/icons/scroll-text.svg +0 -1
  502. package/icons/search-menu.svg +0 -1
  503. package/icons/search.svg +0 -1
  504. package/icons/send.0c0c0d.svg +0 -1
  505. package/icons/send.svg +0 -1
  506. package/icons/settings.0c0c0d.svg +0 -1
  507. package/icons/settings.svg +0 -1
  508. package/icons/shield.svg +0 -1
  509. package/icons/sidebar-left.svg +0 -1
  510. package/icons/sidebar-right.svg +0 -1
  511. package/icons/sliders.svg +0 -1
  512. package/icons/sparkles.32f08c.svg +0 -1
  513. package/icons/sparkles.svg +0 -1
  514. package/icons/square.svg +0 -1
  515. package/icons/star.svg +0 -1
  516. package/icons/sun.svg +0 -1
  517. package/icons/table.svg +0 -1
  518. package/icons/terminal.svg +0 -1
  519. package/icons/trash.svg +0 -1
  520. package/icons/trending-down.svg +0 -1
  521. package/icons/trending-up.svg +0 -1
  522. package/icons/type.svg +0 -1
  523. package/icons/upload.svg +0 -1
  524. package/icons/user-circle.svg +0 -1
  525. package/icons/user-plus.svg +0 -6
  526. package/icons/user.svg +0 -1
  527. package/icons/users.svg +0 -1
  528. package/icons/warning.svg +0 -1
  529. package/icons/wrench.svg +0 -1
  530. package/icons/x-circle.svg +0 -1
  531. package/icons/x.svg +0 -1
  532. package/icons/zap.0c0c0d.svg +0 -1
  533. package/icons/zap.svg +0 -1
  534. package/js/calendar.js +0 -486
  535. package/js/carousel.js +0 -300
  536. package/js/collapse.js +0 -234
  537. package/js/color-picker.js +0 -441
  538. package/js/component.js +0 -251
  539. package/js/countdown.js +0 -138
  540. package/js/data-bind.js +0 -1363
  541. package/js/datepicker.js +0 -716
  542. package/js/depends.js +0 -732
  543. package/js/dialog.js +0 -129
  544. package/js/drawer.js +0 -274
  545. package/js/dropdown.js +0 -509
  546. package/js/dynamic-tags.js +0 -265
  547. package/js/fileupload.js +0 -391
  548. package/js/form.js +0 -323
  549. package/js/global-events.js +0 -283
  550. package/js/heatmap.js +0 -399
  551. package/js/i18n.js +0 -226
  552. package/js/image-preview.js +0 -356
  553. package/js/initializer.js +0 -201
  554. package/js/kupola-config.js +0 -212
  555. package/js/kupola-core.js +0 -161
  556. package/js/kupola-lifecycle.js +0 -504
  557. package/js/message.js +0 -78
  558. package/js/modal.js +0 -348
  559. package/js/notification.js +0 -81
  560. package/js/numberinput.js +0 -140
  561. package/js/pagination.js +0 -258
  562. package/js/react-theme.js +0 -111
  563. package/js/registry.js +0 -218
  564. package/js/security.js +0 -113
  565. package/js/select.js +0 -701
  566. package/js/slide-captcha.js +0 -500
  567. package/js/slider.js +0 -504
  568. package/js/statcard.js +0 -213
  569. package/js/table.js +0 -1188
  570. package/js/tag.js +0 -330
  571. package/js/theme-preload.js +0 -75
  572. package/js/theme-standalone.js +0 -161
  573. package/js/theme.js +0 -372
  574. package/js/timepicker.js +0 -494
  575. package/js/tooltip.js +0 -353
  576. package/js/utils.js +0 -304
  577. package/js/validation.js +0 -567
  578. package/js/virtual-list.js +0 -572
  579. package/js/vue-theme.js +0 -78
  580. package/js/web-components.js +0 -279
  581. package/plugins/vite-plugin-kupola.js +0 -142
  582. package/plugins/webpack-plugin-kupola.js +0 -69
  583. package/scripts/build-css.cjs +0 -115
  584. package/scripts/build-svg-sprite.cjs +0 -107
  585. package/types/kupola.d.ts +0 -1608
package/README.md CHANGED
@@ -1,487 +1,333 @@
1
- # Kupola
2
-
3
- > A lightweight, dependency-free declarative UI component system for server-side rendered web applications.
4
- >
5
- > 零外部框架依赖的声明式 UI 组件系统,适用于任何服务端渲染 Web 应用。
6
-
7
- [![License](https://img.shields.io/github/license/kupola-cn/kupola)](https://github.com/kupola-cn/kupola/blob/main/LICENSE)
8
- [![npm](https://img.shields.io/npm/v/@kupola/kupola)](https://www.npmjs.com/package/@kupola/kupola)
9
- [![bundle size (gzip)](https://img.shields.io/badge/gzip-75%20KB-blue)](https://bundlephobia.com/package/@kupola/kupola)
10
- [![GitHub stars](https://img.shields.io/github/stars/kupola-cn/kupola)](https://github.com/kupola-cn/kupola/stargazers)
11
-
12
- **HTMX** (data fetching) + **Alpine.js** (declarative interaction) + **Bootstrap** (component richness) — in one zero-dependency package.
13
-
14
- ---
15
-
16
- ## 🌐 Languages / 语言
17
-
18
- - [English](#english)
19
- - [中文](#中文)
20
-
21
- ---
22
-
23
- ## 📦 构建工具插件
24
-
25
- ### Vite 插件
26
-
27
- ```js
28
- // vite.config.js
29
- import { kupola } from '@kupola/kupola/vite';
30
-
31
- export default {
32
- plugins: [kupola()]
33
- };
34
- ```
35
-
36
- **配置选项:**
37
-
38
- | 选项 | 类型 | 默认值 | 说明 |
39
- |------|------|--------|------|
40
- | `autoCSS` | boolean | `true` | 自动注入 Kupola CSS |
41
- | `autoImport` | boolean | `true` | 自动导入 `useDeps`/`useQuery` |
42
- | `devTools` | boolean | `true` | 开发模式下启用调试工具 |
43
- | `cssPath` | string | `null` | 自定义 CSS 路径 |
44
- | `themePreload` | boolean | `false` | 自动注入主题预加载脚本 |
1
+ [中文文档](./README.zh-CN.md)
45
2
 
46
- ### Webpack 插件
3
+ ![npm](https://img.shields.io/npm/v/@kupola/kupola)
4
+ ![bundlephobia](https://img.shields.io/bundlephobia/minzip/@kupola/kupola)
5
+ ![Build Status](https://img.shields.io/github/actions/workflow/status/kupola-cn/kupola/ci.yml)
6
+ ![License](https://img.shields.io/github/license/kupola-cn/kupola)
47
7
 
48
- ```js
49
- // webpack.config.js
50
- const KupolaWebpackPlugin = require('@kupola/kupola/webpack');
51
-
52
- module.exports = {
53
- plugins: [new KupolaWebpackPlugin()]
54
- };
55
- ```
56
-
57
- **配置选项:**
58
-
59
- | 选项 | 类型 | 默认值 | 说明 |
60
- |------|------|--------|------|
61
- | `autoCSS` | boolean | `true` | 自动注入 Kupola CSS |
62
- | `themePreload` | boolean | `false` | 自动注入主题预加载脚本 |
63
- | `cssPath` | string | `null` | 自定义 CSS 路径 |
64
-
65
- ### themePreload 配置说明
66
-
67
- **默认值:`false`**(v1.9.13 变更)
68
-
69
- `themePreload` 用于在 CSS 加载前设置主题属性,防止主题切换时的闪屏问题。请根据你的使用方式决定是否开启:
70
-
71
- | 使用方式 | themePreload | 说明 |
72
- |---------|-------------|------|
73
- | **ESM + initTheme()** | `false`(默认) | JS 模块加载时自动初始化,无需预加载 |
74
- | **UMD / 纯 CSS** | `true` | 需要在 CSS 加载前设置主题,防止闪屏 |
75
-
76
- **开启示例:**
77
-
78
- ```js
79
- // Vite
80
- kupola({ themePreload: true })
8
+ # Kupola
81
9
 
82
- // Webpack
83
- new KupolaWebpackPlugin({ themePreload: true })
84
- ```
10
+ **A zero-framework-dependency declarative UI engine + component library for any server-rendered web application.**
85
11
 
86
12
  ---
87
13
 
88
- ## 📖 Documentation
14
+ ## Features
89
15
 
90
- - [**用户文档**](https://kupola-cn.github.io/kupola/docs/index.html) 安装、组件速查、核心 API、主题、后端集成
91
- - [**架构文档**](https://kupola-cn.github.io/kupola/docs/architecture.html)内部引擎、模块依赖、构建管线、贡献指南
16
+ - ⚛️ **Signal-based Reactivity**: Fine-grained tracking via `signal` / `computed` / `effect` with automatic batched updates
17
+ - 📝 **Template Literals**: `html` tagged template + `render` for instant DOM binding no compilation step
18
+ - 🖥️ **SSR Ready**: `renderToString` + `hydrate` for pristine hydration with zero client-side flicker
19
+ - 🧩 **48+ Components, Tree-shakeable**: Modal, Table, Dropdown, Form… each component is independently bundled
20
+ - 🪶 **Ultra-lightweight**: Core engine < 5KB gzip, zero third-party dependencies
92
21
 
93
22
  ---
94
23
 
95
- <a id="english"></a>
96
- ## 📦 Build Tool Plugins
97
-
98
- ### Vite Plugin
99
-
100
- ```js
101
- // vite.config.js
102
- import { kupola } from '@kupola/kupola/vite';
103
-
104
- export default {
105
- plugins: [kupola()]
106
- };
107
- ```
108
-
109
- **Options:**
110
-
111
- | Option | Type | Default | Description |
112
- |--------|------|--------|-------------|
113
- | `autoCSS` | boolean | `true` | Auto inject Kupola CSS |
114
- | `autoImport` | boolean | `true` | Auto import `useDeps`/`useQuery` |
115
- | `devTools` | boolean | `true` | Enable dev tools in dev mode |
116
- | `cssPath` | string | `null` | Custom CSS path |
117
- | `themePreload` | boolean | `false` | Auto inject theme preload script |
118
-
119
- ### Webpack Plugin
120
-
121
- ```js
122
- // webpack.config.js
123
- const KupolaWebpackPlugin = require('@kupola/kupola/webpack');
24
+ ## Quick Start
124
25
 
125
- module.exports = {
126
- plugins: [new KupolaWebpackPlugin()]
127
- };
26
+ ```html
27
+ <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola-core.umd.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola-core-directives.umd.js"></script>
29
+ <div k-data="{ count: 0 }">
30
+ <button k-on:click="count++">Clicked {{ count }} times</button>
31
+ </div>
32
+ <script>
33
+ Kupola.walk(document.body);
34
+ </script>
128
35
  ```
129
36
 
130
- **Options:**
131
-
132
- | Option | Type | Default | Description |
133
- |--------|------|--------|-------------|
134
- | `autoCSS` | boolean | `true` | Auto inject Kupola CSS |
135
- | `themePreload` | boolean | `false` | Auto inject theme preload script |
136
- | `cssPath` | string | `null` | Custom CSS path |
37
+ Or use the programmatic API:
137
38
 
138
- ### themePreload Configuration
139
-
140
- **Default: `false`** (Changed in v1.9.13)
141
-
142
- `themePreload` sets theme attributes before CSS loads to prevent flash of unstyled content during theme switching. Enable it based on your usage pattern:
143
-
144
- | Usage Pattern | themePreload | Reason |
145
- |--------------|-------------|--------|
146
- | **ESM + initTheme()** | `false` (default) | JS module initializes automatically on load |
147
- | **UMD / CSS-only** | `true` | Needs theme set before CSS loads to prevent flash |
148
-
149
- **Example with themePreload enabled:**
150
-
151
- ```js
152
- // Vite
153
- kupola({ themePreload: true })
154
-
155
- // Webpack
156
- new KupolaWebpackPlugin({ themePreload: true })
39
+ ```html
40
+ <div id="app"></div>
41
+ <script type="module">
42
+ import { signal, html, render } from 'https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola-core.esm.js';
43
+
44
+ const count = signal(0);
45
+ const view = () => html`<button @click=${() => count.value++}>Clicked ${count} times</button>`;
46
+ render(view(), document.getElementById('app'));
47
+ </script>
157
48
  ```
158
49
 
159
50
  ---
160
51
 
161
- ## ✨ Features
162
-
163
- - **50+ UI Components** — Buttons, inputs, cards, modals, datepickers, timepickers, heatmap, virtual list, stat cards, and more
164
- - **Declarative Data Dependencies** — `useDeps()` with auto-caching, retry, refresh, and transform
165
- - **HTTP Client Plugin System** — Plug in Axios, @navios/http, or any HTTP client; interceptors preserved
166
- - **Reactive Data Binding** — Two-way binding with `ref()` / `store()` (Proxy-based)
167
- - **Dual Themes** — Dark-first design with light theme support
168
- - **11 Brand Colors** — Switchable brand themes inspired by Chinese traditional colors
169
- - **Responsive** — PC, Pad, and Phone
170
- - **Accessible** — WCAG AA compliant
171
- - **Form Validation** — Built-in validation with custom rules
172
- - **Zero Dependencies** — Pure HTML/CSS/JavaScript, ~75 KB minified gzipped
173
- - **Backend Agnostic** — Works with Flask, Django, FastAPI, Gin, Spring Boot, ASP.NET, Express, Rails, Actix-web, and any backend that outputs HTML
174
- - **TypeScript Ready** — Full type definitions included
175
-
176
- ---
177
-
178
- ## 🚀 Quick Start
179
-
180
- ### Scaffold (recommended)
181
-
182
- Create a fully configured Kupola project in seconds:
52
+ ## Installation
183
53
 
184
54
  ```bash
185
- npx @kupola/create-kupola
55
+ npm install @kupola/kupola # Full package
56
+ # Or core engine only
57
+ npm install @kupola/kupola/core # signal + template + render + SSR
186
58
  ```
187
59
 
188
- Choose from **Static**, **Flask**, **FastAPI**, or **Gin** — with dark theme, brand colors, and example pages out of the box.
189
-
190
- ### npm
191
-
192
60
  ```bash
193
- npm install @kupola/kupola
194
- ```
195
-
196
- ```html
197
- <link rel="stylesheet" href="node_modules/@kupola/kupola/dist/css/kupola.css">
198
- <script src="node_modules/@kupola/kupola/dist/kupola.esm.js" type="module"></script>
199
- ```
200
-
201
- ### CDN
202
-
203
- ```html
204
- <!-- ESM (modern browsers) -->
205
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/css/kupola.css">
206
- <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola.esm.js" type="module"></script>
207
-
208
- <!-- UMD (legacy) -->
209
- <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola.umd.js"></script>
61
+ # CDN
62
+ https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola-core.esm.js
63
+ https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola-core.cjs.js
210
64
  ```
211
65
 
212
66
  ---
213
67
 
214
- ## 📦 Usage
215
-
216
- ### Components (HTML-only, no JS needed)
217
-
218
- ```html
219
- <button class="ds-btn ds-btn--brand">Primary</button>
220
- <button class="ds-btn ds-btn--outline">Outline</button>
221
-
222
- <div class="ds-card">
223
- <div class="ds-card__header">
224
- <h3 class="ds-card__title">Card Title</h3>
225
- </div>
226
- <div class="ds-card__body">Card content</div>
227
- </div>
228
- ```
229
-
230
- ### Data Binding
231
-
232
- ```html
233
- <input type="text" data-bind="user.name:value" placeholder="Name">
234
- <span data-bind="user.name:text"></span>
235
- ```
236
-
237
- ```js
238
- kupolaData.data.user = { name: 'John' };
239
- kupolaData.data.user.name = 'Jane'; // Auto-updates all bound elements
240
- ```
68
+ ## Import Components on Demand
241
69
 
242
- ### Declarative Data Dependencies
70
+ Each component is independently bundled — import only what you need:
243
71
 
244
- ```html
245
- <div data-deps="users:fetch:/api/users">
246
- <template data-each="users">
247
- <span data-bind="item.name:text"></span>
248
- </template>
249
- </div>
250
- ```
72
+ ```javascript
73
+ // Import Modal only
74
+ import { Modal } from '@kupola/kupola/components/modal';
251
75
 
252
- ```js
253
- import { useDeps } from 'kupola';
254
- useDeps({ users: { url: '/api/users', staleTime: 60000 } });
76
+ const modal = Modal({ title: 'Confirm', content: 'This action cannot be undone.' });
77
+ modal.open();
255
78
  ```
256
79
 
257
- ### HTTP Client Plugin (Axios Example)
258
-
259
- ```js
260
- import { configureHttpClient } from 'kupola';
261
- import { createAxiosAdapter } from 'kupola/adapters/axios';
262
- import axios from 'axios';
263
-
264
- const api = axios.create({ baseURL: '/api' });
265
- api.interceptors.request.use(config => {
266
- config.headers.Authorization = `Bearer ${getToken()}`;
267
- return config;
80
+ ```javascript
81
+ // Import Table only
82
+ import { Table } from '@kupola/kupola/components/table';
83
+
84
+ const table = Table({
85
+ columns: [
86
+ { key: 'name', label: 'Name', sortable: true },
87
+ { key: 'age', label: 'Age', sortable: true },
88
+ ],
89
+ data: [
90
+ { name: 'Alice', age: 28 },
91
+ { name: 'Bob', age: 34 },
92
+ ],
93
+ pageSize: 10,
268
94
  });
269
-
270
- // All useDeps() requests now go through Axios
271
- configureHttpClient(createAxiosAdapter(api));
95
+ document.body.appendChild(table.element);
272
96
  ```
273
97
 
274
- ### HTTP Client Plugin (@navios/http Example)
275
-
276
- ```js
277
- import { configureHttpClient } from 'kupola';
278
- import { createNaviosAdapter } from 'kupola/adapters/navios-http';
279
- import { create } from '@navios/http';
280
-
281
- const client = create({ baseURL: '/api' });
282
- client.interceptors.request.use(config => {
283
- config.headers['Authorization'] = `Bearer ${getToken()}`;
284
- return config;
285
- });
286
-
287
- configureHttpClient(createNaviosAdapter(client));
288
- ```
289
-
290
- ---
291
-
292
- ## 📖 Documentation
293
-
294
- - [Usage Guide](docs/usage-guide.md) — Getting started and API reference
295
- - [Integration Guide](INTEGRATION.md) — Framework integration examples
296
- - [Kupola vs Vue/React](docs/kupola-vs-vue-react.md) — Architecture comparison
297
- - [Contributing](CONTRIBUTING.md) — How to contribute
298
-
299
- ---
300
-
301
- ## 🛠️ Development
302
-
303
- ```bash
304
- npm install # Install dependencies
305
- npm run dev # Dev server (Vite, hot reload)
306
- npm run build # Production build
307
- npm run lint # Lint code
308
- npm run test # Run tests
309
- ```
310
-
311
- ---
312
-
313
- ## 🌐 Browser Support
314
-
315
- Chrome, Firefox, Safari, Edge (latest)
316
-
317
98
  ---
318
99
 
319
- <a id="中文"></a>
320
- ## ✨ 核心特性
321
-
322
- - **50+ UI 组件** — 按钮、输入框、卡片、模态框、日期选择器、时间选择器、热力图、虚拟列表、统计卡片等
323
- - **声明式数据依赖** — `useDeps()` 自动缓存、重试、刷新、数据转换
324
- - **HTTP 客户端插件** — 无缝集成 Axios、@navios/http 或任意 HTTP 客户端,保留拦截器
325
- - **响应式数据绑定** — 基于 Proxy 的双向绑定,`ref()` / `store()`
326
- - **双主题** — 暗色优先设计,支持亮色主题切换
327
- - **11 种品牌色** — 灵感源自中国传统色的可切换品牌主题
328
- - **响应式** — 适配 PC、平板、手机
329
- - **无障碍** — 符合 WCAG AA 标准
330
- - **表单验证** — 内置验证系统,支持自定义规则
331
- - **零依赖** — 纯 HTML/CSS/JavaScript,minified gzip 约 75 KB
332
- - **后端无关** — 支持 Flask、Django、FastAPI、Gin、Spring Boot、ASP.NET、Express、Rails、Actix-web 等任何输出 HTML 的后端
333
- - **TypeScript 支持** — 完整类型定义
100
+ ## Core Engine API
334
101
 
335
- ---
336
-
337
- ## 🚀 快速开始
338
-
339
- ### 脚手架(推荐)
340
-
341
- 一行命令创建配置好的 Kupola 项目:
342
-
343
- ```bash
344
- npx @kupola/create-kupola
345
- ```
346
-
347
- 支持 **Static**、**Flask**、**FastAPI**、**Gin** 四种后端模板,自带暗色主题、品牌色和示例页面。
348
-
349
- ### npm 安装
102
+ ```javascript
103
+ import { signal, computed, effect, batch, html, render } from '@kupola/kupola';
350
104
 
351
- ```bash
352
- npm install @kupola/kupola
353
- ```
105
+ // Signal — reactive state
106
+ const count = signal(0);
354
107
 
355
- ```html
356
- <link rel="stylesheet" href="node_modules/@kupola/kupola/dist/css/kupola.css">
357
- <script src="node_modules/@kupola/kupola/dist/kupola.esm.js" type="module"></script>
358
- ```
108
+ // Computed — derived value (auto-tracks dependencies)
109
+ const doubled = computed(() => count.value * 2);
359
110
 
360
- ### CDN 引入
111
+ // Effect — side effect (auto re-runs)
112
+ effect(() => console.log(`count = ${count.value}, doubled = ${doubled.value}`));
361
113
 
362
- ```html
363
- <!-- ESM(现代浏览器) -->
364
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/css/kupola.css">
365
- <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola.esm.js" type="module"></script>
114
+ // Batch — merge multiple updates into one flush
115
+ batch(() => {
116
+ count.value++;
117
+ count.value++;
118
+ });
366
119
 
367
- <!-- UMD(传统方式) -->
368
- <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola.umd.js"></script>
120
+ // Template + Render — declarative DOM
121
+ const view = () => html`
122
+ <div class="counter">
123
+ <p>Count: ${count}</p>
124
+ <button @click=${() => count.value++}>+1</button>
125
+ </div>
126
+ `;
127
+ render(view(), document.getElementById('app'));
369
128
  ```
370
129
 
371
130
  ---
372
131
 
373
- ## 📦 使用示例
132
+ ## Directive System (Declarative HTML)
374
133
 
375
- ### 组件(纯 HTML,无需 JS)
134
+ Add interactivity directly in HTML — no build tools required:
376
135
 
377
136
  ```html
378
- <button class="ds-btn ds-btn--brand">主要按钮</button>
379
- <button class="ds-btn ds-btn--outline">描边按钮</button>
380
-
381
- <div class="ds-card">
382
- <div class="ds-card__header">
383
- <h3 class="ds-card__title">卡片标题</h3>
384
- </div>
385
- <div class="ds-card__body">卡片内容</div>
137
+ <div k-data="{ name: '', items: [], show: true }">
138
+ <input k-model="name" placeholder="Enter search term">
139
+ <p k-show="name">Hello, {{ name }}!</p>
140
+ <ul>
141
+ <li k-for="item in items" k-text="item"></li>
142
+ </ul>
143
+ <button k-on:click="show = !show" k-bind:disabled="!name">
144
+ <span k-show="show">Hide</span>
145
+ <span k-show="!show">Show</span>
146
+ </button>
386
147
  </div>
148
+ <script>
149
+ import { walk } from '@kupola/kupola/directives';
150
+ walk(document.body);
151
+ </script>
387
152
  ```
388
153
 
389
- ### 数据绑定
154
+ **Directives Overview**:
390
155
 
391
- ```html
392
- <input type="text" data-bind="user.name:value" placeholder="姓名">
393
- <span data-bind="user.name:text"></span>
394
- ```
156
+ | Directive | Shorthand | Purpose |
157
+ |-----------|-----------|---------|
158
+ | `k-data` | — | Create a reactive scope |
159
+ | `k-show` | — | Conditional display (`display: none`) |
160
+ | `k-text` | — | Reactive textContent |
161
+ | `k-html` | — | Reactive innerHTML |
162
+ | `k-bind` | `:` | Dynamic attribute binding |
163
+ | `k-on` | `@` | Event listener |
164
+ | `k-model` | — | Two-way input binding |
165
+ | `k-for` | — | List rendering |
395
166
 
396
- ```js
397
- kupolaData.data.user = { name: '张三' };
398
- kupolaData.data.user.name = '李四'; // 所有绑定元素自动更新
399
- ```
167
+ ---
400
168
 
401
- ### 声明式数据依赖
169
+ ## SSR (Server-Side Rendering)
402
170
 
403
- ```html
404
- <div data-deps="users:fetch:/api/users">
405
- <template data-each="users">
406
- <span data-bind="item.name:text"></span>
407
- </template>
408
- </div>
409
- ```
171
+ ```javascript
172
+ import { signal, html } from '@kupola/kupola';
173
+ import { renderToString } from '@kupola/kupola/server';
410
174
 
411
- ```js
412
- import { useDeps } from 'kupola';
413
- useDeps({ users: { url: '/api/users', staleTime: 60000 } });
175
+ const title = signal('Hello Server');
176
+ const serverHtml = renderToString(html`<h1>${title}</h1>`);
177
+ // => '<h1>Hello Server<!----></h1>'
178
+ res.send(`<!DOCTYPE html><html><body>${serverHtml}</body></html>`);
414
179
  ```
415
180
 
416
- ### HTTP 客户端插件(Axios 示例)
181
+ Client-side hydration:
417
182
 
418
- ```js
419
- import { configureHttpClient } from 'kupola';
420
- import { createAxiosAdapter } from 'kupola/adapters/axios';
421
- import axios from 'axios';
422
-
423
- const api = axios.create({ baseURL: '/api' });
424
- api.interceptors.request.use(config => {
425
- config.headers.Authorization = `Bearer ${getToken()}`;
426
- return config;
427
- });
183
+ ```javascript
184
+ import { signal, html } from '@kupola/kupola';
185
+ import { hydrate } from '@kupola/kupola/server';
428
186
 
429
- // 之后所有 useDeps() 请求自动走 Axios + 拦截器
430
- configureHttpClient(createAxiosAdapter(api));
187
+ const title = signal('Hello Server');
188
+ hydrate(html`<h1>${title}</h1>`, document.body);
189
+ // DOM is not rebuilt — only reactive bindings are attached
431
190
  ```
432
191
 
433
192
  ---
434
193
 
435
- ## 📖 文档
436
-
437
- - [使用指南](docs/usage-guide.md) — 入门与 API 参考
438
- - [集成指南](INTEGRATION.md) — 后端框架集成示例
439
- - [Kupola 与 Vue/React 对比](docs/kupola-vs-vue-react.md) — 架构对比
440
- - [贡献指南](CONTRIBUTING.md) 如何参与贡献
194
+ ## Components
195
+
196
+ <details>
197
+ <summary><strong>Overlay & Navigation</strong> (6)</summary>
198
+
199
+ | Component | Import Path | Description |
200
+ |-----------|-------------|-------------|
201
+ | Modal | `@kupola/kupola/components/modal` | Modal dialog |
202
+ | Dropdown | `@kupola/kupola/components/dropdown` | Dropdown menu |
203
+ | Drawer | `@kupola/kupola/components/drawer` | Side drawer |
204
+ | Tabs | `@kupola/kupola/components/tabs` | Tab panel |
205
+ | Tooltip | `@kupola/kupola/components/tooltip` | Text tooltip |
206
+ | Menu | `@kupola/kupola/components/menu` | Navigation menu |
207
+
208
+ </details>
209
+
210
+ <details>
211
+ <summary><strong>Form</strong> (11)</summary>
212
+
213
+ | Component | Import Path | Description |
214
+ |-----------|-------------|-------------|
215
+ | Input | `@kupola/kupola/components/input` | Text input |
216
+ | Select | `@kupola/kupola/components/select` | Dropdown select |
217
+ | Checkbox | `@kupola/kupola/components/checkbox` | Checkbox |
218
+ | Radio | `@kupola/kupola/components/radio` | Radio button |
219
+ | Switch | `@kupola/kupola/components/switch` | Toggle switch |
220
+ | Slider | `@kupola/kupola/components/slider` | Range slider |
221
+ | NumberInput | `@kupola/kupola/components/numberinput` | Number input |
222
+ | Textarea | `@kupola/kupola/components/textarea` | Multi-line text |
223
+ | Datepicker | `@kupola/kupola/components/datepicker` | Date picker |
224
+ | Timepicker | `@kupola/kupola/components/timepicker` | Time picker |
225
+ | Form | `@kupola/kupola/components/form` | Form container + validation |
226
+
227
+ </details>
228
+
229
+ <details>
230
+ <summary><strong>Feedback</strong> (6)</summary>
231
+
232
+ | Component | Import Path | Description |
233
+ |-----------|-------------|-------------|
234
+ | Dialog | `@kupola/kupola/components/dialog` | Native confirm dialog |
235
+ | Notification | `@kupola/kupola/components/notification` | Notification toast |
236
+ | Message | `@kupola/kupola/components/message` | Lightweight global message |
237
+ | Alert | `@kupola/kupola/components/alert` | Alert banner |
238
+ | Spin | `@kupola/kupola/components/spin` | Loading spinner |
239
+ | Progress | `@kupola/kupola/components/progress` | Progress bar |
240
+
241
+ </details>
242
+
243
+ <details>
244
+ <summary><strong>Data Display</strong> (9)</summary>
245
+
246
+ | Component | Import Path | Description |
247
+ |-----------|-------------|-------------|
248
+ | Table | `@kupola/kupola/components/table` | Data table (sort/filter/paginate/select/edit) |
249
+ | Tree | `@kupola/kupola/components/tree` | Tree view |
250
+ | Calendar | `@kupola/kupola/components/calendar` | Calendar |
251
+ | Carousel | `@kupola/kupola/components/carousel` | Carousel / slider |
252
+ | Timeline | `@kupola/kupola/components/timeline` | Timeline |
253
+ | Collapse | `@kupola/kupola/components/collapse` | Collapse panel |
254
+ | Tag | `@kupola/kupola/components/tag` | Tag |
255
+ | Badge | `@kupola/kupola/components/badge` | Badge |
256
+ | Statcard | `@kupola/kupola/components/statcard` | Stat card |
257
+
258
+ </details>
259
+
260
+ <details>
261
+ <summary><strong>Interactive & Utility</strong> (16)</summary>
262
+
263
+ | Component | Import Path | Description |
264
+ |-----------|-------------|-------------|
265
+ | Pagination | `@kupola/kupola/components/pagination` | Pagination |
266
+ | Breadcrumb | `@kupola/kupola/components/breadcrumb` | Breadcrumb |
267
+ | FileUpload | `@kupola/kupola/components/fileupload` | File upload |
268
+ | DynamicTags | `@kupola/kupola/components/dynamictags` | Dynamic tags |
269
+ | ImagePreview | `@kupola/kupola/components/imagepreview` | Image preview |
270
+ | ColorPicker | `@kupola/kupola/components/colorpicker` | Color picker |
271
+ | VirtualList | `@kupola/kupola/components/virtuallist` | Virtual list |
272
+ | Heatmap | `@kupola/kupola/components/heatmap` | Heatmap |
273
+ | Countdown | `@kupola/kupola/components/countdown` | Countdown timer |
274
+ | Icons | `@kupola/kupola/components/icons` | SVG icon set |
275
+ | Validation | `@kupola/kupola/components/validation` | Validation engine |
276
+ | Avatar | `@kupola/kupola/components/avatar` | Avatar |
277
+ | Divider | `@kupola/kupola/components/divider` | Divider |
278
+ | Skeleton | `@kupola/kupola/components/skeleton` | Skeleton screen |
279
+ | Empty | `@kupola/kupola/components/empty` | Empty state |
280
+ | Kbd | `@kupola/kupola/components/kbd` | Keyboard key |
281
+
282
+ </details>
441
283
 
442
284
  ---
443
285
 
444
- ## 🛠️ 开发
286
+ ## TypeScript
445
287
 
446
- ```bash
447
- npm install # 安装依赖
448
- npm run dev # 开发服务器(Vite,热更新)
449
- npm run build # 生产构建
450
- npm run lint # 代码检查
451
- npm run test # 运行测试
288
+ Full type definitions included out of the box:
289
+
290
+ ```typescript
291
+ import type { Modal, ModalOptions } from '@kupola/kupola/components/modal';
292
+ import type { Table, TableOptions, TableColumn } from '@kupola/kupola/components/table';
293
+
294
+ const options: ModalOptions = {
295
+ title: 'Confirm',
296
+ content: 'Are you sure you want to delete?',
297
+ onConfirm: () => console.log('confirmed'),
298
+ };
452
299
  ```
453
300
 
454
301
  ---
455
302
 
456
- ## 🌐 浏览器支持
303
+ ## Browser Support
457
304
 
458
- Chrome、Firefox、Safari、Edge(最新版本)
305
+ - Chrome / Edge >= 88
306
+ - Firefox >= 78
307
+ - Safari >= 14
308
+ - IE is not supported
459
309
 
460
310
  ---
461
311
 
462
- ## 🤝 Contributing / 贡献
312
+ ## Documentation
463
313
 
464
- See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
314
+ - 📖 [Integration Guide](./INTEGRATION.md) CDN / SSR / Vite / Webpack / React / Vue
315
+ - 🤝 [Contributing Guide](./CONTRIBUTING.md) — Dev setup & code standards
316
+ - 📋 [Changelog](./CHANGELOG.md)
317
+ - 📄 [MIT License](./LICENSE)
465
318
 
466
319
  ---
467
320
 
468
- ## 🙏 Acknowledgments / 致谢
469
-
470
- Kupola is built with the help of these excellent open-source tools:
321
+ ## Ecosystem
471
322
 
472
- **Build & Dev Tooling:**
473
- - [Vite](https://vitejs.dev/) — Next generation frontend tooling
474
- - [Rollup](https://rollupjs.org/) ES module bundler
475
- - [ESLint](https://eslint.org/) JavaScript linter
476
- - [Prettier](https://prettier.io/) Code formatter
477
- - [Jest](https://jestjs.io/) — JavaScript testing framework
478
-
479
- **HTTP Client Adapters (optional, user-installed):**
480
- - [Axios](https://axios-http.com/) — Promise based HTTP client
481
- - [@navios/http](https://www.npmjs.com/package/@navios/http) — Lightweight fetch-based Axios replacement
323
+ | Project | Description |
324
+ |---------|-------------|
325
+ | `@kupola/kupola` | Core engine + 48 UI components |
326
+ | `create-kupola` | Project scaffolding CLI |
327
+ | `his-sys` | HIS medical system built on Kupola |
482
328
 
483
329
  ---
484
330
 
485
- ## 📄 License
486
-
487
- [MIT](LICENSE) © Kupola Team
331
+ <p align="center">
332
+ <strong>Kupola</strong> — Zero framework dependencies. Declarative UI. Import only what you need.
333
+ </p>