@kupola/kupola 1.9.16 → 2.0.0-beta.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 (594) hide show
  1. package/README.md +248 -400
  2. package/README.zh-CN.md +335 -0
  3. package/dist/css/components.css +239 -1542
  4. package/dist/css/index.css +13 -0
  5. package/dist/css/tokens.css +182 -0
  6. package/dist/kupola-core-alert.cjs.js +9 -0
  7. package/dist/kupola-core-alert.esm.js +9 -0
  8. package/dist/kupola-core-avatar.cjs.js +1 -0
  9. package/dist/kupola-core-avatar.esm.js +1 -0
  10. package/dist/kupola-core-badge.cjs.js +3 -0
  11. package/dist/kupola-core-badge.esm.js +3 -0
  12. package/dist/kupola-core-breadcrumb.cjs.js +1 -0
  13. package/dist/kupola-core-breadcrumb.esm.js +1 -0
  14. package/dist/kupola-core-calendar.cjs.js +1 -0
  15. package/dist/kupola-core-calendar.esm.js +1 -0
  16. package/dist/kupola-core-carousel.cjs.js +12 -0
  17. package/dist/kupola-core-carousel.esm.js +12 -0
  18. package/dist/kupola-core-checkbox.cjs.js +7 -0
  19. package/dist/kupola-core-checkbox.esm.js +7 -0
  20. package/dist/kupola-core-collapse.cjs.js +11 -0
  21. package/dist/kupola-core-collapse.esm.js +11 -0
  22. package/dist/kupola-core-colorpicker.cjs.js +14 -0
  23. package/dist/kupola-core-colorpicker.esm.js +14 -0
  24. package/dist/kupola-core-countdown.cjs.js +23 -0
  25. package/dist/kupola-core-countdown.esm.js +23 -0
  26. package/dist/kupola-core-datepicker.cjs.js +28 -0
  27. package/dist/kupola-core-datepicker.esm.js +28 -0
  28. package/dist/kupola-core-dialog.cjs.js +13 -0
  29. package/dist/kupola-core-dialog.esm.js +13 -0
  30. package/dist/kupola-core-directives.cjs.js +1 -0
  31. package/dist/kupola-core-directives.esm.js +1 -0
  32. package/dist/kupola-core-divider.cjs.js +1 -0
  33. package/dist/kupola-core-divider.esm.js +1 -0
  34. package/dist/kupola-core-drawer.cjs.js +15 -0
  35. package/dist/kupola-core-drawer.esm.js +15 -0
  36. package/dist/kupola-core-dropdown.cjs.js +11 -0
  37. package/dist/kupola-core-dropdown.esm.js +11 -0
  38. package/dist/kupola-core-dynamictags.cjs.js +8 -0
  39. package/dist/kupola-core-dynamictags.esm.js +8 -0
  40. package/dist/kupola-core-empty.cjs.js +7 -0
  41. package/dist/kupola-core-empty.esm.js +7 -0
  42. package/dist/kupola-core-fileupload.cjs.js +15 -0
  43. package/dist/kupola-core-fileupload.esm.js +15 -0
  44. package/dist/kupola-core-form.cjs.js +1 -0
  45. package/dist/kupola-core-form.esm.js +1 -0
  46. package/dist/kupola-core-heatmap.cjs.js +1 -0
  47. package/dist/kupola-core-heatmap.esm.js +1 -0
  48. package/dist/kupola-core-i18n.cjs.js +1 -0
  49. package/dist/kupola-core-i18n.esm.js +1 -0
  50. package/dist/kupola-core-icons.cjs.js +1 -0
  51. package/dist/kupola-core-icons.esm.js +1 -0
  52. package/dist/kupola-core-imagepreview.cjs.js +20 -0
  53. package/dist/kupola-core-imagepreview.esm.js +20 -0
  54. package/dist/kupola-core-input.cjs.js +5 -0
  55. package/dist/kupola-core-input.esm.js +5 -0
  56. package/dist/kupola-core-kbd.cjs.js +1 -0
  57. package/dist/kupola-core-kbd.esm.js +1 -0
  58. package/dist/kupola-core-menu.cjs.js +1 -0
  59. package/dist/kupola-core-menu.esm.js +1 -0
  60. package/dist/kupola-core-message.cjs.js +1 -0
  61. package/dist/kupola-core-message.esm.js +1 -0
  62. package/dist/kupola-core-modal.cjs.js +15 -0
  63. package/dist/kupola-core-modal.esm.js +15 -0
  64. package/dist/kupola-core-notification.cjs.js +1 -0
  65. package/dist/kupola-core-notification.esm.js +1 -0
  66. package/dist/kupola-core-numberinput.cjs.js +7 -0
  67. package/dist/kupola-core-numberinput.esm.js +7 -0
  68. package/dist/kupola-core-pagination.cjs.js +12 -0
  69. package/dist/kupola-core-pagination.esm.js +12 -0
  70. package/dist/kupola-core-progress.cjs.js +5 -0
  71. package/dist/kupola-core-progress.esm.js +5 -0
  72. package/dist/kupola-core-radio.cjs.js +1 -0
  73. package/dist/kupola-core-radio.esm.js +1 -0
  74. package/dist/kupola-core-select.cjs.js +15 -0
  75. package/dist/kupola-core-select.esm.js +15 -0
  76. package/dist/kupola-core-server.cjs.js +1 -0
  77. package/dist/kupola-core-server.esm.js +1 -0
  78. package/dist/kupola-core-skeleton.cjs.js +1 -0
  79. package/dist/kupola-core-skeleton.esm.js +1 -0
  80. package/dist/kupola-core-slider.cjs.js +15 -0
  81. package/dist/kupola-core-slider.esm.js +15 -0
  82. package/dist/kupola-core-spin.cjs.js +6 -0
  83. package/dist/kupola-core-spin.esm.js +6 -0
  84. package/dist/kupola-core-statcard.cjs.js +18 -0
  85. package/dist/kupola-core-statcard.esm.js +18 -0
  86. package/dist/kupola-core-switch.cjs.js +6 -0
  87. package/dist/kupola-core-switch.esm.js +6 -0
  88. package/dist/kupola-core-table.cjs.js +1 -0
  89. package/dist/kupola-core-table.esm.js +1 -0
  90. package/dist/kupola-core-tabs.cjs.js +6 -0
  91. package/dist/kupola-core-tabs.esm.js +6 -0
  92. package/dist/kupola-core-tag.cjs.js +6 -0
  93. package/dist/kupola-core-tag.esm.js +6 -0
  94. package/dist/kupola-core-textarea.cjs.js +3 -0
  95. package/dist/kupola-core-textarea.esm.js +3 -0
  96. package/dist/kupola-core-timeline.cjs.js +1 -0
  97. package/dist/kupola-core-timeline.esm.js +1 -0
  98. package/dist/kupola-core-timepicker.cjs.js +22 -0
  99. package/dist/kupola-core-timepicker.esm.js +22 -0
  100. package/dist/kupola-core-tooltip.cjs.js +1 -0
  101. package/dist/kupola-core-tooltip.esm.js +1 -0
  102. package/dist/kupola-core-tree.cjs.js +1 -0
  103. package/dist/kupola-core-tree.esm.js +1 -0
  104. package/dist/kupola-core-validation.cjs.js +1 -0
  105. package/dist/kupola-core-validation.esm.js +1 -0
  106. package/dist/kupola-core-virtuallist.cjs.js +7 -0
  107. package/dist/kupola-core-virtuallist.esm.js +7 -0
  108. package/dist/kupola-core.cjs.js +1 -0
  109. package/dist/kupola-core.esm.js +1 -0
  110. package/package.json +217 -76
  111. package/packages/core/__tests__/component.test.js +269 -0
  112. package/packages/core/__tests__/components/alert.test.js +136 -0
  113. package/packages/core/__tests__/components/avatar.test.js +132 -0
  114. package/packages/core/__tests__/components/badge.test.js +187 -0
  115. package/packages/core/__tests__/components/breadcrumb.test.js +120 -0
  116. package/packages/core/__tests__/components/calendar.test.js +293 -0
  117. package/packages/core/__tests__/components/carousel.test.js +220 -0
  118. package/packages/core/__tests__/components/checkbox.test.js +139 -0
  119. package/packages/core/__tests__/components/collapse.test.js +220 -0
  120. package/packages/core/__tests__/components/colorpicker.test.js +173 -0
  121. package/packages/core/__tests__/components/countdown.test.js +156 -0
  122. package/packages/core/__tests__/components/datepicker.test.js +344 -0
  123. package/packages/core/__tests__/components/dialog.test.js +188 -0
  124. package/packages/core/__tests__/components/divider.test.js +84 -0
  125. package/packages/core/__tests__/components/drawer.test.js +230 -0
  126. package/packages/core/__tests__/components/dropdown.test.js +324 -0
  127. package/packages/core/__tests__/components/dynamictags.test.js +239 -0
  128. package/packages/core/__tests__/components/empty.test.js +107 -0
  129. package/packages/core/__tests__/components/fileupload.test.js +151 -0
  130. package/packages/core/__tests__/components/form.test.js +258 -0
  131. package/packages/core/__tests__/components/heatmap.test.js +161 -0
  132. package/packages/core/__tests__/components/icons.test.js +166 -0
  133. package/packages/core/__tests__/components/imagepreview.test.js +166 -0
  134. package/packages/core/__tests__/components/input.test.js +165 -0
  135. package/packages/core/__tests__/components/kbd.test.js +74 -0
  136. package/packages/core/__tests__/components/menu.test.js +131 -0
  137. package/packages/core/__tests__/components/message.test.js +136 -0
  138. package/packages/core/__tests__/components/modal.test.js +291 -0
  139. package/packages/core/__tests__/components/notification.test.js +164 -0
  140. package/packages/core/__tests__/components/numberinput.test.js +153 -0
  141. package/packages/core/__tests__/components/pagination.test.js +229 -0
  142. package/packages/core/__tests__/components/progress.test.js +156 -0
  143. package/packages/core/__tests__/components/radio.test.js +167 -0
  144. package/packages/core/__tests__/components/select.test.js +352 -0
  145. package/packages/core/__tests__/components/skeleton.test.js +126 -0
  146. package/packages/core/__tests__/components/slider.test.js +177 -0
  147. package/packages/core/__tests__/components/spin.test.js +95 -0
  148. package/packages/core/__tests__/components/statcard.test.js +167 -0
  149. package/packages/core/__tests__/components/switch.test.js +145 -0
  150. package/packages/core/__tests__/components/table.test.js +611 -0
  151. package/packages/core/__tests__/components/tabs.test.js +185 -0
  152. package/packages/core/__tests__/components/tag.test.js +130 -0
  153. package/packages/core/__tests__/components/textarea.test.js +137 -0
  154. package/packages/core/__tests__/components/timeline.test.js +126 -0
  155. package/packages/core/__tests__/components/timepicker.test.js +184 -0
  156. package/packages/core/__tests__/components/tooltip.test.js +237 -0
  157. package/packages/core/__tests__/components/tree.test.js +238 -0
  158. package/packages/core/__tests__/components/validation.test.js +256 -0
  159. package/packages/core/__tests__/components/virtuallist.test.js +141 -0
  160. package/packages/core/__tests__/core.test.js +357 -0
  161. package/packages/core/__tests__/directives.test.js +467 -0
  162. package/packages/core/__tests__/server.test.js +290 -0
  163. package/packages/core/__tests__/template.test.js +301 -0
  164. package/packages/core/package.json +234 -0
  165. package/packages/core/src/batch.js +66 -0
  166. package/packages/core/src/component.js +154 -0
  167. package/packages/core/src/components/alert.js +92 -0
  168. package/packages/core/src/components/avatar.js +87 -0
  169. package/packages/core/src/components/badge.js +106 -0
  170. package/packages/core/src/components/breadcrumb.js +83 -0
  171. package/packages/core/src/components/calendar.js +442 -0
  172. package/packages/core/src/components/carousel.js +173 -0
  173. package/packages/core/src/components/checkbox.js +101 -0
  174. package/packages/core/src/components/collapse.js +148 -0
  175. package/packages/core/src/components/colorpicker.js +147 -0
  176. package/packages/core/src/components/countdown.js +142 -0
  177. package/packages/core/src/components/datepicker.js +378 -0
  178. package/packages/core/src/components/dialog.js +142 -0
  179. package/packages/core/src/components/divider.js +63 -0
  180. package/packages/core/src/components/drawer.js +125 -0
  181. package/packages/core/src/components/dropdown.js +191 -0
  182. package/packages/core/src/components/dynamictags.js +173 -0
  183. package/packages/core/src/components/empty.js +71 -0
  184. package/packages/core/src/components/fileupload.js +203 -0
  185. package/packages/core/src/components/form.js +257 -0
  186. package/packages/core/src/components/heatmap.js +324 -0
  187. package/{js → packages/core/src/components}/icons.js +42 -55
  188. package/packages/core/src/components/imagepreview.js +146 -0
  189. package/packages/core/src/components/input.js +117 -0
  190. package/packages/core/src/components/kbd.js +53 -0
  191. package/packages/core/src/components/menu.js +105 -0
  192. package/packages/core/src/components/message.js +115 -0
  193. package/packages/core/src/components/modal.js +123 -0
  194. package/packages/core/src/components/notification.js +150 -0
  195. package/packages/core/src/components/numberinput.js +141 -0
  196. package/packages/core/src/components/pagination.js +186 -0
  197. package/packages/core/src/components/progress.js +107 -0
  198. package/packages/core/src/components/radio.js +128 -0
  199. package/packages/core/src/components/select.js +340 -0
  200. package/packages/core/src/components/skeleton.js +77 -0
  201. package/packages/core/src/components/slider.js +134 -0
  202. package/packages/core/src/components/spin.js +58 -0
  203. package/packages/core/src/components/statcard.js +100 -0
  204. package/packages/core/src/components/switch.js +105 -0
  205. package/packages/core/src/components/table.js +916 -0
  206. package/packages/core/src/components/tabs.js +139 -0
  207. package/packages/core/src/components/tag.js +89 -0
  208. package/packages/core/src/components/textarea.js +115 -0
  209. package/packages/core/src/components/timeline.js +91 -0
  210. package/packages/core/src/components/timepicker.js +212 -0
  211. package/packages/core/src/components/tooltip.js +184 -0
  212. package/packages/core/src/components/tree.js +156 -0
  213. package/packages/core/src/components/types.d.ts +917 -0
  214. package/packages/core/src/components/validation.js +329 -0
  215. package/packages/core/src/components/virtuallist.js +157 -0
  216. package/packages/core/src/computed.js +118 -0
  217. package/packages/core/src/directives.js +413 -0
  218. package/packages/core/src/effect.js +98 -0
  219. package/packages/core/src/i18n.js +86 -0
  220. package/packages/core/src/index.js +42 -0
  221. package/packages/core/src/render.js +431 -0
  222. package/packages/core/src/scheduler.js +51 -0
  223. package/packages/core/src/server.js +446 -0
  224. package/packages/core/src/signal.js +157 -0
  225. package/packages/core/src/template.js +51 -0
  226. package/packages/css/components.css +273 -0
  227. package/packages/css/index.css +13 -0
  228. package/packages/css/tokens.css +182 -0
  229. package/version.json +1 -1
  230. package/adapters/axios.d.ts +0 -34
  231. package/adapters/axios.js +0 -122
  232. package/adapters/navios-http.d.ts +0 -110
  233. package/adapters/navios-http.js +0 -151
  234. package/css/accessibility.css +0 -119
  235. package/css/animations.css +0 -224
  236. package/css/brand-themes.css +0 -300
  237. package/css/colors-and-type.css +0 -408
  238. package/css/components-ext.css +0 -4401
  239. package/css/components.css +0 -1576
  240. package/css/dashboard.css +0 -425
  241. package/css/kupola.css +0 -13
  242. package/css/responsive.css +0 -697
  243. package/css/scaffold.css +0 -155
  244. package/css/states.css +0 -316
  245. package/css/table.css +0 -75
  246. package/css/theme.css +0 -568
  247. package/css/utilities.css +0 -334
  248. package/dist/core-Cs-VWZ5H.cjs +0 -1
  249. package/dist/core-DBjFFC_n.js +0 -4959
  250. package/dist/core.cjs.js +0 -1
  251. package/dist/core.esm.js +0 -106
  252. package/dist/css/accessibility.css +0 -119
  253. package/dist/css/animations.css +0 -224
  254. package/dist/css/brand-themes.css +0 -300
  255. package/dist/css/colors-and-type.css +0 -408
  256. package/dist/css/components-ext.css +0 -4401
  257. package/dist/css/dashboard.css +0 -368
  258. package/dist/css/kupola.css +0 -14
  259. package/dist/css/responsive.css +0 -697
  260. package/dist/css/scaffold.css +0 -155
  261. package/dist/css/states.css +0 -316
  262. package/dist/css/table.css +0 -75
  263. package/dist/css/theme-dark.css +0 -341
  264. package/dist/css/theme-light.css +0 -298
  265. package/dist/css/utilities.css +0 -334
  266. package/dist/icons/icons/activity.svg +0 -3
  267. package/dist/icons/icons/alert-circle.svg +0 -1
  268. package/dist/icons/icons/alert-triangle.svg +0 -1
  269. package/dist/icons/icons/alert.d27e24.svg +0 -1
  270. package/dist/icons/icons/alert.svg +0 -1
  271. package/dist/icons/icons/apple.svg +0 -1
  272. package/dist/icons/icons/arrow-down.svg +0 -1
  273. package/dist/icons/icons/arrow-expand.svg +0 -1
  274. package/dist/icons/icons/arrow-left.svg +0 -1
  275. package/dist/icons/icons/arrow-minimize.svg +0 -1
  276. package/dist/icons/icons/arrow-right-to-line.svg +0 -1
  277. package/dist/icons/icons/arrow-right.svg +0 -1
  278. package/dist/icons/icons/arrow-up-right.svg +0 -1
  279. package/dist/icons/icons/arrow-up.0c0c0d.svg +0 -1
  280. package/dist/icons/icons/arrow-up.svg +0 -1
  281. package/dist/icons/icons/at.svg +0 -1
  282. package/dist/icons/icons/atom.0c0c0d.svg +0 -1
  283. package/dist/icons/icons/atom.svg +0 -1
  284. package/dist/icons/icons/bar-chart-2.svg +0 -1
  285. package/dist/icons/icons/bar.svg +0 -1
  286. package/dist/icons/icons/bell.svg +0 -1
  287. package/dist/icons/icons/box.svg +0 -1
  288. package/dist/icons/icons/bug.svg +0 -1
  289. package/dist/icons/icons/button.svg +0 -1
  290. package/dist/icons/icons/calendar.svg +0 -1
  291. package/dist/icons/icons/check-circle.33c192.svg +0 -1
  292. package/dist/icons/icons/check-circle.svg +0 -1
  293. package/dist/icons/icons/check-square.svg +0 -4
  294. package/dist/icons/icons/check.d1d3db.svg +0 -1
  295. package/dist/icons/icons/check.svg +0 -1
  296. package/dist/icons/icons/chevron-down.svg +0 -1
  297. package/dist/icons/icons/chevron-left.svg +0 -1
  298. package/dist/icons/icons/chevron-right.svg +0 -1
  299. package/dist/icons/icons/chevron-up.svg +0 -1
  300. package/dist/icons/icons/circle.svg +0 -1
  301. package/dist/icons/icons/clock.svg +0 -1
  302. package/dist/icons/icons/cmd.svg +0 -1
  303. package/dist/icons/icons/code.svg +0 -1
  304. package/dist/icons/icons/columns.svg +0 -1
  305. package/dist/icons/icons/copy.svg +0 -1
  306. package/dist/icons/icons/cpu.svg +0 -1
  307. package/dist/icons/icons/dashboard.0c0c0d.svg +0 -1
  308. package/dist/icons/icons/dashboard.svg +0 -1
  309. package/dist/icons/icons/dollar.svg +0 -1
  310. package/dist/icons/icons/download.svg +0 -1
  311. package/dist/icons/icons/edit.svg +0 -1
  312. package/dist/icons/icons/extensions.svg +0 -1
  313. package/dist/icons/icons/external.svg +0 -1
  314. package/dist/icons/icons/eye.svg +0 -1
  315. package/dist/icons/icons/file-text.svg +0 -1
  316. package/dist/icons/icons/file.svg +0 -1
  317. package/dist/icons/icons/files.svg +0 -1
  318. package/dist/icons/icons/filter.svg +0 -1
  319. package/dist/icons/icons/folder-open.svg +0 -4
  320. package/dist/icons/icons/folder.svg +0 -1
  321. package/dist/icons/icons/gear.svg +0 -1
  322. package/dist/icons/icons/git.svg +0 -1
  323. package/dist/icons/icons/github.svg +0 -1
  324. package/dist/icons/icons/globe.svg +0 -1
  325. package/dist/icons/icons/grid-2x2.svg +0 -1
  326. package/dist/icons/icons/hash.svg +0 -1
  327. package/dist/icons/icons/heart.svg +0 -1
  328. package/dist/icons/icons/help-circle.svg +0 -5
  329. package/dist/icons/icons/help.svg +0 -1
  330. package/dist/icons/icons/home.svg +0 -1
  331. package/dist/icons/icons/icons.svg +0 -153
  332. package/dist/icons/icons/image.svg +0 -1
  333. package/dist/icons/icons/info-circle.svg +0 -1
  334. package/dist/icons/icons/info-square.svg +0 -1
  335. package/dist/icons/icons/info.387bff.svg +0 -1
  336. package/dist/icons/icons/info.svg +0 -1
  337. package/dist/icons/icons/input.svg +0 -1
  338. package/dist/icons/icons/key.svg +0 -1
  339. package/dist/icons/icons/layers.svg +0 -1
  340. package/dist/icons/icons/layout-grid.svg +0 -6
  341. package/dist/icons/icons/layout.svg +0 -1
  342. package/dist/icons/icons/link.svg +0 -1
  343. package/dist/icons/icons/list.svg +0 -1
  344. package/dist/icons/icons/lock.svg +0 -1
  345. package/dist/icons/icons/log-out.svg +0 -1
  346. package/dist/icons/icons/logo.svg +0 -1
  347. package/dist/icons/icons/mail.svg +0 -1
  348. package/dist/icons/icons/menu.svg +0 -1
  349. package/dist/icons/icons/message-circle.svg +0 -1
  350. package/dist/icons/icons/message-plus.svg +0 -1
  351. package/dist/icons/icons/message-square.svg +0 -1
  352. package/dist/icons/icons/mic.svg +0 -1
  353. package/dist/icons/icons/minus.svg +0 -1
  354. package/dist/icons/icons/moon.svg +0 -1
  355. package/dist/icons/icons/more-h.svg +0 -1
  356. package/dist/icons/icons/mouse.svg +0 -1
  357. package/dist/icons/icons/palette.svg +0 -1
  358. package/dist/icons/icons/panel-bottom.svg +0 -1
  359. package/dist/icons/icons/pause.svg +0 -1
  360. package/dist/icons/icons/play.svg +0 -1
  361. package/dist/icons/icons/plug.svg +0 -1
  362. package/dist/icons/icons/plus.0c0c0d.svg +0 -1
  363. package/dist/icons/icons/plus.svg +0 -1
  364. package/dist/icons/icons/refresh.svg +0 -1
  365. package/dist/icons/icons/ruler.svg +0 -1
  366. package/dist/icons/icons/scroll-text.svg +0 -1
  367. package/dist/icons/icons/search-menu.svg +0 -1
  368. package/dist/icons/icons/search.svg +0 -1
  369. package/dist/icons/icons/send.0c0c0d.svg +0 -1
  370. package/dist/icons/icons/send.svg +0 -1
  371. package/dist/icons/icons/settings.0c0c0d.svg +0 -1
  372. package/dist/icons/icons/settings.svg +0 -1
  373. package/dist/icons/icons/shield.svg +0 -1
  374. package/dist/icons/icons/sidebar-left.svg +0 -1
  375. package/dist/icons/icons/sidebar-right.svg +0 -1
  376. package/dist/icons/icons/sliders.svg +0 -1
  377. package/dist/icons/icons/sparkles.32f08c.svg +0 -1
  378. package/dist/icons/icons/sparkles.svg +0 -1
  379. package/dist/icons/icons/square.svg +0 -1
  380. package/dist/icons/icons/star.svg +0 -1
  381. package/dist/icons/icons/sun.svg +0 -1
  382. package/dist/icons/icons/table.svg +0 -1
  383. package/dist/icons/icons/terminal.svg +0 -1
  384. package/dist/icons/icons/trash.svg +0 -1
  385. package/dist/icons/icons/trending-down.svg +0 -1
  386. package/dist/icons/icons/trending-up.svg +0 -1
  387. package/dist/icons/icons/type.svg +0 -1
  388. package/dist/icons/icons/upload.svg +0 -1
  389. package/dist/icons/icons/user-circle.svg +0 -1
  390. package/dist/icons/icons/user-plus.svg +0 -6
  391. package/dist/icons/icons/user.svg +0 -1
  392. package/dist/icons/icons/users.svg +0 -1
  393. package/dist/icons/icons/warning.svg +0 -1
  394. package/dist/icons/icons/wrench.svg +0 -1
  395. package/dist/icons/icons/x-circle.svg +0 -1
  396. package/dist/icons/icons/x.svg +0 -1
  397. package/dist/icons/icons/zap.0c0c0d.svg +0 -1
  398. package/dist/icons/icons/zap.svg +0 -1
  399. package/dist/kupola.cjs.js +0 -1
  400. package/dist/kupola.css +0 -9601
  401. package/dist/kupola.esm.js +0 -9965
  402. package/dist/kupola.min.css +0 -1
  403. package/dist/plugins/vite-plugin-kupola.js +0 -142
  404. package/dist/plugins/webpack-plugin-kupola.js +0 -69
  405. package/dist/react-theme.js +0 -111
  406. package/dist/theme-preload.js +0 -75
  407. package/dist/theme-standalone.js +0 -161
  408. package/dist/types/kupola.d.ts +0 -1608
  409. package/dist/vue-theme.js +0 -78
  410. package/icons/activity.svg +0 -3
  411. package/icons/alert-circle.svg +0 -1
  412. package/icons/alert-triangle.svg +0 -1
  413. package/icons/alert.d27e24.svg +0 -1
  414. package/icons/alert.svg +0 -1
  415. package/icons/apple.svg +0 -1
  416. package/icons/arrow-down.svg +0 -1
  417. package/icons/arrow-expand.svg +0 -1
  418. package/icons/arrow-left.svg +0 -1
  419. package/icons/arrow-minimize.svg +0 -1
  420. package/icons/arrow-right-to-line.svg +0 -1
  421. package/icons/arrow-right.svg +0 -1
  422. package/icons/arrow-up-right.svg +0 -1
  423. package/icons/arrow-up.0c0c0d.svg +0 -1
  424. package/icons/arrow-up.svg +0 -1
  425. package/icons/at.svg +0 -1
  426. package/icons/atom.0c0c0d.svg +0 -1
  427. package/icons/atom.svg +0 -1
  428. package/icons/bar-chart-2.svg +0 -1
  429. package/icons/bar.svg +0 -1
  430. package/icons/bell.svg +0 -1
  431. package/icons/box.svg +0 -1
  432. package/icons/bug.svg +0 -1
  433. package/icons/button.svg +0 -1
  434. package/icons/calendar.svg +0 -1
  435. package/icons/check-circle.33c192.svg +0 -1
  436. package/icons/check-circle.svg +0 -1
  437. package/icons/check-square.svg +0 -4
  438. package/icons/check.d1d3db.svg +0 -1
  439. package/icons/check.svg +0 -1
  440. package/icons/chevron-down.svg +0 -1
  441. package/icons/chevron-left.svg +0 -1
  442. package/icons/chevron-right.svg +0 -1
  443. package/icons/chevron-up.svg +0 -1
  444. package/icons/circle.svg +0 -1
  445. package/icons/clock.svg +0 -1
  446. package/icons/cmd.svg +0 -1
  447. package/icons/code.svg +0 -1
  448. package/icons/columns.svg +0 -1
  449. package/icons/copy.svg +0 -1
  450. package/icons/cpu.svg +0 -1
  451. package/icons/dashboard.0c0c0d.svg +0 -1
  452. package/icons/dashboard.svg +0 -1
  453. package/icons/dollar.svg +0 -1
  454. package/icons/download.svg +0 -1
  455. package/icons/edit.svg +0 -1
  456. package/icons/extensions.svg +0 -1
  457. package/icons/external.svg +0 -1
  458. package/icons/eye.svg +0 -1
  459. package/icons/file-text.svg +0 -1
  460. package/icons/file.svg +0 -1
  461. package/icons/files.svg +0 -1
  462. package/icons/filter.svg +0 -1
  463. package/icons/folder-open.svg +0 -4
  464. package/icons/folder.svg +0 -1
  465. package/icons/gear.svg +0 -1
  466. package/icons/git.svg +0 -1
  467. package/icons/github.svg +0 -1
  468. package/icons/globe.svg +0 -1
  469. package/icons/grid-2x2.svg +0 -1
  470. package/icons/hash.svg +0 -1
  471. package/icons/heart.svg +0 -1
  472. package/icons/help-circle.svg +0 -5
  473. package/icons/help.svg +0 -1
  474. package/icons/home.svg +0 -1
  475. package/icons/icons.svg +0 -153
  476. package/icons/image.svg +0 -1
  477. package/icons/info-circle.svg +0 -1
  478. package/icons/info-square.svg +0 -1
  479. package/icons/info.387bff.svg +0 -1
  480. package/icons/info.svg +0 -1
  481. package/icons/input.svg +0 -1
  482. package/icons/key.svg +0 -1
  483. package/icons/layers.svg +0 -1
  484. package/icons/layout-grid.svg +0 -6
  485. package/icons/layout.svg +0 -1
  486. package/icons/link.svg +0 -1
  487. package/icons/list.svg +0 -1
  488. package/icons/lock.svg +0 -1
  489. package/icons/log-out.svg +0 -1
  490. package/icons/logo.svg +0 -1
  491. package/icons/mail.svg +0 -1
  492. package/icons/menu.svg +0 -1
  493. package/icons/message-circle.svg +0 -1
  494. package/icons/message-plus.svg +0 -1
  495. package/icons/message-square.svg +0 -1
  496. package/icons/mic.svg +0 -1
  497. package/icons/minus.svg +0 -1
  498. package/icons/moon.svg +0 -1
  499. package/icons/more-h.svg +0 -1
  500. package/icons/mouse.svg +0 -1
  501. package/icons/palette.svg +0 -1
  502. package/icons/panel-bottom.svg +0 -1
  503. package/icons/pause.svg +0 -1
  504. package/icons/play.svg +0 -1
  505. package/icons/plug.svg +0 -1
  506. package/icons/plus.0c0c0d.svg +0 -1
  507. package/icons/plus.svg +0 -1
  508. package/icons/refresh.svg +0 -1
  509. package/icons/ruler.svg +0 -1
  510. package/icons/scroll-text.svg +0 -1
  511. package/icons/search-menu.svg +0 -1
  512. package/icons/search.svg +0 -1
  513. package/icons/send.0c0c0d.svg +0 -1
  514. package/icons/send.svg +0 -1
  515. package/icons/settings.0c0c0d.svg +0 -1
  516. package/icons/settings.svg +0 -1
  517. package/icons/shield.svg +0 -1
  518. package/icons/sidebar-left.svg +0 -1
  519. package/icons/sidebar-right.svg +0 -1
  520. package/icons/sliders.svg +0 -1
  521. package/icons/sparkles.32f08c.svg +0 -1
  522. package/icons/sparkles.svg +0 -1
  523. package/icons/square.svg +0 -1
  524. package/icons/star.svg +0 -1
  525. package/icons/sun.svg +0 -1
  526. package/icons/table.svg +0 -1
  527. package/icons/terminal.svg +0 -1
  528. package/icons/trash.svg +0 -1
  529. package/icons/trending-down.svg +0 -1
  530. package/icons/trending-up.svg +0 -1
  531. package/icons/type.svg +0 -1
  532. package/icons/upload.svg +0 -1
  533. package/icons/user-circle.svg +0 -1
  534. package/icons/user-plus.svg +0 -6
  535. package/icons/user.svg +0 -1
  536. package/icons/users.svg +0 -1
  537. package/icons/warning.svg +0 -1
  538. package/icons/wrench.svg +0 -1
  539. package/icons/x-circle.svg +0 -1
  540. package/icons/x.svg +0 -1
  541. package/icons/zap.0c0c0d.svg +0 -1
  542. package/icons/zap.svg +0 -1
  543. package/js/calendar.js +0 -486
  544. package/js/carousel.js +0 -300
  545. package/js/collapse.js +0 -234
  546. package/js/color-picker.js +0 -441
  547. package/js/component.js +0 -251
  548. package/js/countdown.js +0 -138
  549. package/js/data-bind.js +0 -1363
  550. package/js/datepicker.js +0 -716
  551. package/js/depends.js +0 -732
  552. package/js/dialog.js +0 -129
  553. package/js/drawer.js +0 -274
  554. package/js/dropdown.js +0 -509
  555. package/js/dynamic-tags.js +0 -265
  556. package/js/fileupload.js +0 -391
  557. package/js/form.js +0 -323
  558. package/js/global-events.js +0 -283
  559. package/js/heatmap.js +0 -399
  560. package/js/i18n.js +0 -226
  561. package/js/image-preview.js +0 -356
  562. package/js/initializer.js +0 -201
  563. package/js/kupola-config.js +0 -212
  564. package/js/kupola-core.js +0 -161
  565. package/js/kupola-lifecycle.js +0 -504
  566. package/js/message.js +0 -78
  567. package/js/modal.js +0 -348
  568. package/js/notification.js +0 -81
  569. package/js/numberinput.js +0 -140
  570. package/js/pagination.js +0 -258
  571. package/js/react-theme.js +0 -111
  572. package/js/registry.js +0 -218
  573. package/js/security.js +0 -113
  574. package/js/select.js +0 -701
  575. package/js/slide-captcha.js +0 -500
  576. package/js/slider.js +0 -504
  577. package/js/statcard.js +0 -213
  578. package/js/table.js +0 -1188
  579. package/js/tag.js +0 -330
  580. package/js/theme-preload.js +0 -75
  581. package/js/theme-standalone.js +0 -161
  582. package/js/theme.js +0 -372
  583. package/js/timepicker.js +0 -494
  584. package/js/tooltip.js +0 -353
  585. package/js/utils.js +0 -304
  586. package/js/validation.js +0 -567
  587. package/js/virtual-list.js +0 -572
  588. package/js/vue-theme.js +0 -78
  589. package/js/web-components.js +0 -279
  590. package/plugins/vite-plugin-kupola.js +0 -142
  591. package/plugins/webpack-plugin-kupola.js +0 -69
  592. package/scripts/build-css.cjs +0 -115
  593. package/scripts/build-svg-sprite.cjs +0 -107
  594. package/types/kupola.d.ts +0 -1608
package/README.md CHANGED
@@ -1,487 +1,335 @@
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
- ---
52
+ ## Installation
177
53
 
178
- ## 🚀 Quick Start
179
-
180
- ### Scaffold (recommended)
181
-
182
- Create a fully configured Kupola project in seconds:
54
+ > **Current version**: `2.0.0-alpha.1` (pre-release). Use `@next` tag to install:
183
55
 
184
56
  ```bash
185
- npx @kupola/create-kupola
57
+ npm install @kupola/kupola@next # Full package
58
+ # Or core engine only
59
+ npm install @kupola/kupola/core@next # signal + template + render + SSR
186
60
  ```
187
61
 
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
62
  ```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>
63
+ # CDN
64
+ https://cdn.jsdelivr.net/npm/@kupola/kupola@next/dist/kupola-core.esm.js
65
+ https://cdn.jsdelivr.net/npm/@kupola/kupola@next/dist/kupola-core.cjs.js
210
66
  ```
211
67
 
212
68
  ---
213
69
 
214
- ## 📦 Usage
70
+ ## Import Components on Demand
215
71
 
216
- ### Components (HTML-only, no JS needed)
72
+ Each component is independently bundled — import only what you need:
217
73
 
218
- ```html
219
- <button class="ds-btn ds-btn--brand">Primary</button>
220
- <button class="ds-btn ds-btn--outline">Outline</button>
74
+ ```javascript
75
+ // Import Modal only
76
+ import { Modal } from '@kupola/kupola/components/modal';
221
77
 
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>
78
+ const modal = Modal({ title: 'Confirm', content: 'This action cannot be undone.' });
79
+ modal.open();
228
80
  ```
229
81
 
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
- ```
241
-
242
- ### Declarative Data Dependencies
243
-
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
- ```
251
-
252
- ```js
253
- import { useDeps } from 'kupola';
254
- useDeps({ users: { url: '/api/users', staleTime: 60000 } });
255
- ```
256
-
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;
82
+ ```javascript
83
+ // Import Table only
84
+ import { Table } from '@kupola/kupola/components/table';
85
+
86
+ const table = Table({
87
+ columns: [
88
+ { key: 'name', label: 'Name', sortable: true },
89
+ { key: 'age', label: 'Age', sortable: true },
90
+ ],
91
+ data: [
92
+ { name: 'Alice', age: 28 },
93
+ { name: 'Bob', age: 34 },
94
+ ],
95
+ pageSize: 10,
268
96
  });
269
-
270
- // All useDeps() requests now go through Axios
271
- configureHttpClient(createAxiosAdapter(api));
272
- ```
273
-
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));
97
+ document.body.appendChild(table.element);
288
98
  ```
289
99
 
290
100
  ---
291
101
 
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
- ```
102
+ ## Core Engine API
310
103
 
311
- ---
312
-
313
- ## 🌐 Browser Support
314
-
315
- Chrome, Firefox, Safari, Edge (latest)
316
-
317
- ---
318
-
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 支持** — 完整类型定义
334
-
335
- ---
104
+ ```javascript
105
+ import { signal, computed, effect, batch, html, render } from '@kupola/kupola';
336
106
 
337
- ## 🚀 快速开始
107
+ // Signal — reactive state
108
+ const count = signal(0);
338
109
 
339
- ### 脚手架(推荐)
110
+ // Computed — derived value (auto-tracks dependencies)
111
+ const doubled = computed(() => count.value * 2);
340
112
 
341
- 一行命令创建配置好的 Kupola 项目:
113
+ // Effect — side effect (auto re-runs)
114
+ effect(() => console.log(`count = ${count.value}, doubled = ${doubled.value}`));
342
115
 
343
- ```bash
344
- npx @kupola/create-kupola
345
- ```
346
-
347
- 支持 **Static**、**Flask**、**FastAPI**、**Gin** 四种后端模板,自带暗色主题、品牌色和示例页面。
348
-
349
- ### npm 安装
350
-
351
- ```bash
352
- npm install @kupola/kupola
353
- ```
354
-
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
- ```
359
-
360
- ### CDN 引入
361
-
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>
116
+ // Batch — merge multiple updates into one flush
117
+ batch(() => {
118
+ count.value++;
119
+ count.value++;
120
+ });
366
121
 
367
- <!-- UMD(传统方式) -->
368
- <script src="https://cdn.jsdelivr.net/npm/@kupola/kupola/dist/kupola.umd.js"></script>
122
+ // Template + Render — declarative DOM
123
+ const view = () => html`
124
+ <div class="counter">
125
+ <p>Count: ${count}</p>
126
+ <button @click=${() => count.value++}>+1</button>
127
+ </div>
128
+ `;
129
+ render(view(), document.getElementById('app'));
369
130
  ```
370
131
 
371
132
  ---
372
133
 
373
- ## 📦 使用示例
134
+ ## Directive System (Declarative HTML)
374
135
 
375
- ### 组件(纯 HTML,无需 JS)
136
+ Add interactivity directly in HTML — no build tools required:
376
137
 
377
138
  ```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>
139
+ <div k-data="{ name: '', items: [], show: true }">
140
+ <input k-model="name" placeholder="Enter search term">
141
+ <p k-show="name">Hello, {{ name }}!</p>
142
+ <ul>
143
+ <li k-for="item in items" k-text="item"></li>
144
+ </ul>
145
+ <button k-on:click="show = !show" k-bind:disabled="!name">
146
+ <span k-show="show">Hide</span>
147
+ <span k-show="!show">Show</span>
148
+ </button>
386
149
  </div>
150
+ <script>
151
+ import { walk } from '@kupola/kupola/directives';
152
+ walk(document.body);
153
+ </script>
387
154
  ```
388
155
 
389
- ### 数据绑定
156
+ **Directives Overview**:
390
157
 
391
- ```html
392
- <input type="text" data-bind="user.name:value" placeholder="姓名">
393
- <span data-bind="user.name:text"></span>
394
- ```
158
+ | Directive | Shorthand | Purpose |
159
+ |-----------|-----------|---------|
160
+ | `k-data` | — | Create a reactive scope |
161
+ | `k-show` | — | Conditional display (`display: none`) |
162
+ | `k-text` | — | Reactive textContent |
163
+ | `k-html` | — | Reactive innerHTML |
164
+ | `k-bind` | `:` | Dynamic attribute binding |
165
+ | `k-on` | `@` | Event listener |
166
+ | `k-model` | — | Two-way input binding |
167
+ | `k-for` | — | List rendering |
395
168
 
396
- ```js
397
- kupolaData.data.user = { name: '张三' };
398
- kupolaData.data.user.name = '李四'; // 所有绑定元素自动更新
399
- ```
169
+ ---
400
170
 
401
- ### 声明式数据依赖
171
+ ## SSR (Server-Side Rendering)
402
172
 
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
- ```
173
+ ```javascript
174
+ import { signal, html } from '@kupola/kupola';
175
+ import { renderToString } from '@kupola/kupola/server';
410
176
 
411
- ```js
412
- import { useDeps } from 'kupola';
413
- useDeps({ users: { url: '/api/users', staleTime: 60000 } });
177
+ const title = signal('Hello Server');
178
+ const serverHtml = renderToString(html`<h1>${title}</h1>`);
179
+ // => '<h1>Hello Server<!----></h1>'
180
+ res.send(`<!DOCTYPE html><html><body>${serverHtml}</body></html>`);
414
181
  ```
415
182
 
416
- ### HTTP 客户端插件(Axios 示例)
183
+ Client-side hydration:
417
184
 
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
- });
185
+ ```javascript
186
+ import { signal, html } from '@kupola/kupola';
187
+ import { hydrate } from '@kupola/kupola/server';
428
188
 
429
- // 之后所有 useDeps() 请求自动走 Axios + 拦截器
430
- configureHttpClient(createAxiosAdapter(api));
189
+ const title = signal('Hello Server');
190
+ hydrate(html`<h1>${title}</h1>`, document.body);
191
+ // DOM is not rebuilt — only reactive bindings are attached
431
192
  ```
432
193
 
433
194
  ---
434
195
 
435
- ## 📖 文档
436
-
437
- - [使用指南](docs/usage-guide.md) — 入门与 API 参考
438
- - [集成指南](INTEGRATION.md) — 后端框架集成示例
439
- - [Kupola 与 Vue/React 对比](docs/kupola-vs-vue-react.md) — 架构对比
440
- - [贡献指南](CONTRIBUTING.md) 如何参与贡献
196
+ ## Components
197
+
198
+ <details>
199
+ <summary><strong>Overlay & Navigation</strong> (6)</summary>
200
+
201
+ | Component | Import Path | Description |
202
+ |-----------|-------------|-------------|
203
+ | Modal | `@kupola/kupola/components/modal` | Modal dialog |
204
+ | Dropdown | `@kupola/kupola/components/dropdown` | Dropdown menu |
205
+ | Drawer | `@kupola/kupola/components/drawer` | Side drawer |
206
+ | Tabs | `@kupola/kupola/components/tabs` | Tab panel |
207
+ | Tooltip | `@kupola/kupola/components/tooltip` | Text tooltip |
208
+ | Menu | `@kupola/kupola/components/menu` | Navigation menu |
209
+
210
+ </details>
211
+
212
+ <details>
213
+ <summary><strong>Form</strong> (11)</summary>
214
+
215
+ | Component | Import Path | Description |
216
+ |-----------|-------------|-------------|
217
+ | Input | `@kupola/kupola/components/input` | Text input |
218
+ | Select | `@kupola/kupola/components/select` | Dropdown select |
219
+ | Checkbox | `@kupola/kupola/components/checkbox` | Checkbox |
220
+ | Radio | `@kupola/kupola/components/radio` | Radio button |
221
+ | Switch | `@kupola/kupola/components/switch` | Toggle switch |
222
+ | Slider | `@kupola/kupola/components/slider` | Range slider |
223
+ | NumberInput | `@kupola/kupola/components/numberinput` | Number input |
224
+ | Textarea | `@kupola/kupola/components/textarea` | Multi-line text |
225
+ | Datepicker | `@kupola/kupola/components/datepicker` | Date picker |
226
+ | Timepicker | `@kupola/kupola/components/timepicker` | Time picker |
227
+ | Form | `@kupola/kupola/components/form` | Form container + validation |
228
+
229
+ </details>
230
+
231
+ <details>
232
+ <summary><strong>Feedback</strong> (6)</summary>
233
+
234
+ | Component | Import Path | Description |
235
+ |-----------|-------------|-------------|
236
+ | Dialog | `@kupola/kupola/components/dialog` | Native confirm dialog |
237
+ | Notification | `@kupola/kupola/components/notification` | Notification toast |
238
+ | Message | `@kupola/kupola/components/message` | Lightweight global message |
239
+ | Alert | `@kupola/kupola/components/alert` | Alert banner |
240
+ | Spin | `@kupola/kupola/components/spin` | Loading spinner |
241
+ | Progress | `@kupola/kupola/components/progress` | Progress bar |
242
+
243
+ </details>
244
+
245
+ <details>
246
+ <summary><strong>Data Display</strong> (9)</summary>
247
+
248
+ | Component | Import Path | Description |
249
+ |-----------|-------------|-------------|
250
+ | Table | `@kupola/kupola/components/table` | Data table (sort/filter/paginate/select/edit) |
251
+ | Tree | `@kupola/kupola/components/tree` | Tree view |
252
+ | Calendar | `@kupola/kupola/components/calendar` | Calendar |
253
+ | Carousel | `@kupola/kupola/components/carousel` | Carousel / slider |
254
+ | Timeline | `@kupola/kupola/components/timeline` | Timeline |
255
+ | Collapse | `@kupola/kupola/components/collapse` | Collapse panel |
256
+ | Tag | `@kupola/kupola/components/tag` | Tag |
257
+ | Badge | `@kupola/kupola/components/badge` | Badge |
258
+ | Statcard | `@kupola/kupola/components/statcard` | Stat card |
259
+
260
+ </details>
261
+
262
+ <details>
263
+ <summary><strong>Interactive & Utility</strong> (16)</summary>
264
+
265
+ | Component | Import Path | Description |
266
+ |-----------|-------------|-------------|
267
+ | Pagination | `@kupola/kupola/components/pagination` | Pagination |
268
+ | Breadcrumb | `@kupola/kupola/components/breadcrumb` | Breadcrumb |
269
+ | FileUpload | `@kupola/kupola/components/fileupload` | File upload |
270
+ | DynamicTags | `@kupola/kupola/components/dynamictags` | Dynamic tags |
271
+ | ImagePreview | `@kupola/kupola/components/imagepreview` | Image preview |
272
+ | ColorPicker | `@kupola/kupola/components/colorpicker` | Color picker |
273
+ | VirtualList | `@kupola/kupola/components/virtuallist` | Virtual list |
274
+ | Heatmap | `@kupola/kupola/components/heatmap` | Heatmap |
275
+ | Countdown | `@kupola/kupola/components/countdown` | Countdown timer |
276
+ | Icons | `@kupola/kupola/components/icons` | SVG icon set |
277
+ | Validation | `@kupola/kupola/components/validation` | Validation engine |
278
+ | Avatar | `@kupola/kupola/components/avatar` | Avatar |
279
+ | Divider | `@kupola/kupola/components/divider` | Divider |
280
+ | Skeleton | `@kupola/kupola/components/skeleton` | Skeleton screen |
281
+ | Empty | `@kupola/kupola/components/empty` | Empty state |
282
+ | Kbd | `@kupola/kupola/components/kbd` | Keyboard key |
283
+
284
+ </details>
441
285
 
442
286
  ---
443
287
 
444
- ## 🛠️ 开发
288
+ ## TypeScript
445
289
 
446
- ```bash
447
- npm install # 安装依赖
448
- npm run dev # 开发服务器(Vite,热更新)
449
- npm run build # 生产构建
450
- npm run lint # 代码检查
451
- npm run test # 运行测试
290
+ Full type definitions included out of the box:
291
+
292
+ ```typescript
293
+ import type { Modal, ModalOptions } from '@kupola/kupola/components/modal';
294
+ import type { Table, TableOptions, TableColumn } from '@kupola/kupola/components/table';
295
+
296
+ const options: ModalOptions = {
297
+ title: 'Confirm',
298
+ content: 'Are you sure you want to delete?',
299
+ onConfirm: () => console.log('confirmed'),
300
+ };
452
301
  ```
453
302
 
454
303
  ---
455
304
 
456
- ## 🌐 浏览器支持
305
+ ## Browser Support
457
306
 
458
- Chrome、Firefox、Safari、Edge(最新版本)
307
+ - Chrome / Edge >= 88
308
+ - Firefox >= 78
309
+ - Safari >= 14
310
+ - IE is not supported
459
311
 
460
312
  ---
461
313
 
462
- ## 🤝 Contributing / 贡献
314
+ ## Documentation
463
315
 
464
- See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
316
+ - 📖 [Integration Guide](./INTEGRATION.md) CDN / SSR / Vite / Webpack / React / Vue
317
+ - 🤝 [Contributing Guide](./CONTRIBUTING.md) — Dev setup & code standards
318
+ - 📋 [Changelog](./CHANGELOG.md)
319
+ - 📄 [MIT License](./LICENSE)
465
320
 
466
321
  ---
467
322
 
468
- ## 🙏 Acknowledgments / 致谢
469
-
470
- Kupola is built with the help of these excellent open-source tools:
323
+ ## Ecosystem
471
324
 
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
325
+ | Project | Description |
326
+ |---------|-------------|
327
+ | `@kupola/kupola` | Core engine + 48 UI components |
328
+ | `create-kupola` | Project scaffolding CLI |
329
+ | `his-sys` | HIS medical system built on Kupola |
482
330
 
483
331
  ---
484
332
 
485
- ## 📄 License
486
-
487
- [MIT](LICENSE) © Kupola Team
333
+ <p align="center">
334
+ <strong>Kupola</strong> — Zero framework dependencies. Declarative UI. Import only what you need.
335
+ </p>