@kupola/kupola 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/INTEGRATION.md +440 -0
  3. package/PROJECT_SUMMARY.md +312 -0
  4. package/README.md +286 -0
  5. package/SKILL.md +572 -0
  6. package/css/accessibility.css +119 -0
  7. package/css/animations.css +224 -0
  8. package/css/brand-themes.css +300 -0
  9. package/css/colors_and_type.css +441 -0
  10. package/css/components-ext.css +4165 -0
  11. package/css/components.css +1483 -0
  12. package/css/kupola.css +12 -0
  13. package/css/responsive.css +697 -0
  14. package/css/scaffold.css +145 -0
  15. package/css/states.css +316 -0
  16. package/css/theme-dark.css +296 -0
  17. package/css/theme-light.css +296 -0
  18. package/css/utilities.css +171 -0
  19. package/dist/css/kupola.css +12 -0
  20. package/dist/icons/icons/activity.svg +3 -0
  21. package/dist/icons/icons/alert-circle.svg +1 -0
  22. package/dist/icons/icons/alert-triangle.svg +1 -0
  23. package/dist/icons/icons/alert.d27e24.svg +1 -0
  24. package/dist/icons/icons/alert.svg +1 -0
  25. package/dist/icons/icons/apple.svg +1 -0
  26. package/dist/icons/icons/arrow-down.svg +1 -0
  27. package/dist/icons/icons/arrow-expand.svg +1 -0
  28. package/dist/icons/icons/arrow-left.svg +1 -0
  29. package/dist/icons/icons/arrow-minimize.svg +1 -0
  30. package/dist/icons/icons/arrow-right-to-line.svg +1 -0
  31. package/dist/icons/icons/arrow-right.svg +1 -0
  32. package/dist/icons/icons/arrow-up-right.svg +1 -0
  33. package/dist/icons/icons/arrow-up.0c0c0d.svg +1 -0
  34. package/dist/icons/icons/arrow-up.svg +1 -0
  35. package/dist/icons/icons/at.svg +1 -0
  36. package/dist/icons/icons/atom.0c0c0d.svg +1 -0
  37. package/dist/icons/icons/atom.svg +1 -0
  38. package/dist/icons/icons/bar-chart-2.svg +1 -0
  39. package/dist/icons/icons/bar.svg +1 -0
  40. package/dist/icons/icons/bell.svg +1 -0
  41. package/dist/icons/icons/box.svg +1 -0
  42. package/dist/icons/icons/bug.svg +1 -0
  43. package/dist/icons/icons/button.svg +1 -0
  44. package/dist/icons/icons/calendar.svg +1 -0
  45. package/dist/icons/icons/check-circle.33c192.svg +1 -0
  46. package/dist/icons/icons/check-circle.svg +1 -0
  47. package/dist/icons/icons/check-square.svg +4 -0
  48. package/dist/icons/icons/check.d1d3db.svg +1 -0
  49. package/dist/icons/icons/check.svg +1 -0
  50. package/dist/icons/icons/chevron-down.svg +1 -0
  51. package/dist/icons/icons/chevron-left.svg +1 -0
  52. package/dist/icons/icons/chevron-right.svg +1 -0
  53. package/dist/icons/icons/chevron-up.svg +1 -0
  54. package/dist/icons/icons/circle.svg +1 -0
  55. package/dist/icons/icons/clock.svg +1 -0
  56. package/dist/icons/icons/cmd.svg +1 -0
  57. package/dist/icons/icons/code.svg +1 -0
  58. package/dist/icons/icons/columns.svg +1 -0
  59. package/dist/icons/icons/copy.svg +1 -0
  60. package/dist/icons/icons/cpu.svg +1 -0
  61. package/dist/icons/icons/dashboard.0c0c0d.svg +1 -0
  62. package/dist/icons/icons/dashboard.svg +1 -0
  63. package/dist/icons/icons/dollar.svg +1 -0
  64. package/dist/icons/icons/download.svg +1 -0
  65. package/dist/icons/icons/edit.svg +1 -0
  66. package/dist/icons/icons/extensions.svg +1 -0
  67. package/dist/icons/icons/external.svg +1 -0
  68. package/dist/icons/icons/eye.svg +1 -0
  69. package/dist/icons/icons/file-text.svg +1 -0
  70. package/dist/icons/icons/file.svg +1 -0
  71. package/dist/icons/icons/files.svg +1 -0
  72. package/dist/icons/icons/filter.svg +1 -0
  73. package/dist/icons/icons/folder-open.svg +4 -0
  74. package/dist/icons/icons/folder.svg +1 -0
  75. package/dist/icons/icons/gear.svg +1 -0
  76. package/dist/icons/icons/git.svg +1 -0
  77. package/dist/icons/icons/github.svg +1 -0
  78. package/dist/icons/icons/globe.svg +1 -0
  79. package/dist/icons/icons/grid-2x2.svg +1 -0
  80. package/dist/icons/icons/hash.svg +1 -0
  81. package/dist/icons/icons/heart.svg +1 -0
  82. package/dist/icons/icons/help-circle.svg +5 -0
  83. package/dist/icons/icons/help.svg +1 -0
  84. package/dist/icons/icons/home.svg +1 -0
  85. package/dist/icons/icons/icons.svg +153 -0
  86. package/dist/icons/icons/image.svg +1 -0
  87. package/dist/icons/icons/info-circle.svg +1 -0
  88. package/dist/icons/icons/info-square.svg +1 -0
  89. package/dist/icons/icons/info.387bff.svg +1 -0
  90. package/dist/icons/icons/info.svg +1 -0
  91. package/dist/icons/icons/input.svg +1 -0
  92. package/dist/icons/icons/key.svg +1 -0
  93. package/dist/icons/icons/layers.svg +1 -0
  94. package/dist/icons/icons/layout-grid.svg +6 -0
  95. package/dist/icons/icons/layout.svg +1 -0
  96. package/dist/icons/icons/link.svg +1 -0
  97. package/dist/icons/icons/list.svg +1 -0
  98. package/dist/icons/icons/lock.svg +1 -0
  99. package/dist/icons/icons/log-out.svg +1 -0
  100. package/dist/icons/icons/logo.svg +1 -0
  101. package/dist/icons/icons/mail.svg +1 -0
  102. package/dist/icons/icons/menu.svg +1 -0
  103. package/dist/icons/icons/message-circle.svg +1 -0
  104. package/dist/icons/icons/message-plus.svg +1 -0
  105. package/dist/icons/icons/message-square.svg +1 -0
  106. package/dist/icons/icons/mic.svg +1 -0
  107. package/dist/icons/icons/minus.svg +1 -0
  108. package/dist/icons/icons/moon.svg +1 -0
  109. package/dist/icons/icons/more-h.svg +1 -0
  110. package/dist/icons/icons/mouse.svg +1 -0
  111. package/dist/icons/icons/palette.svg +1 -0
  112. package/dist/icons/icons/panel-bottom.svg +1 -0
  113. package/dist/icons/icons/pause.svg +1 -0
  114. package/dist/icons/icons/play.svg +1 -0
  115. package/dist/icons/icons/plug.svg +1 -0
  116. package/dist/icons/icons/plus.0c0c0d.svg +1 -0
  117. package/dist/icons/icons/plus.svg +1 -0
  118. package/dist/icons/icons/refresh.svg +1 -0
  119. package/dist/icons/icons/ruler.svg +1 -0
  120. package/dist/icons/icons/scroll-text.svg +1 -0
  121. package/dist/icons/icons/search-menu.svg +1 -0
  122. package/dist/icons/icons/search.svg +1 -0
  123. package/dist/icons/icons/send.0c0c0d.svg +1 -0
  124. package/dist/icons/icons/send.svg +1 -0
  125. package/dist/icons/icons/settings.0c0c0d.svg +1 -0
  126. package/dist/icons/icons/settings.svg +1 -0
  127. package/dist/icons/icons/shield.svg +1 -0
  128. package/dist/icons/icons/sidebar-left.svg +1 -0
  129. package/dist/icons/icons/sidebar-right.svg +1 -0
  130. package/dist/icons/icons/sliders.svg +1 -0
  131. package/dist/icons/icons/sparkles.32f08c.svg +1 -0
  132. package/dist/icons/icons/sparkles.svg +1 -0
  133. package/dist/icons/icons/square.svg +1 -0
  134. package/dist/icons/icons/star.svg +1 -0
  135. package/dist/icons/icons/sun.svg +1 -0
  136. package/dist/icons/icons/table.svg +1 -0
  137. package/dist/icons/icons/terminal.svg +1 -0
  138. package/dist/icons/icons/trash.svg +1 -0
  139. package/dist/icons/icons/trending-down.svg +1 -0
  140. package/dist/icons/icons/trending-up.svg +1 -0
  141. package/dist/icons/icons/type.svg +1 -0
  142. package/dist/icons/icons/upload.svg +1 -0
  143. package/dist/icons/icons/user-circle.svg +1 -0
  144. package/dist/icons/icons/user-plus.svg +6 -0
  145. package/dist/icons/icons/user.svg +1 -0
  146. package/dist/icons/icons/users.svg +1 -0
  147. package/dist/icons/icons/warning.svg +1 -0
  148. package/dist/icons/icons/wrench.svg +1 -0
  149. package/dist/icons/icons/x-circle.svg +1 -0
  150. package/dist/icons/icons/x.svg +1 -0
  151. package/dist/icons/icons/zap.0c0c0d.svg +1 -0
  152. package/dist/icons/icons/zap.svg +1 -0
  153. package/dist/kupola.cjs.js +258 -0
  154. package/dist/kupola.cjs.js.map +1 -0
  155. package/dist/kupola.esm.js +7640 -0
  156. package/dist/kupola.esm.js.map +1 -0
  157. package/dist/kupola.umd.js +258 -0
  158. package/dist/kupola.umd.js.map +1 -0
  159. package/dist/types/kupola.d.ts +1359 -0
  160. package/dist/utils/utils/Kupola.cs +77 -0
  161. package/dist/utils/utils/Kupola.java +104 -0
  162. package/dist/utils/utils/kupola.go +120 -0
  163. package/dist/utils/utils/kupola.js +63 -0
  164. package/dist/utils/utils/kupola.py +1392 -0
  165. package/dist/utils/utils/kupola.rb +69 -0
  166. package/icons/activity.svg +3 -0
  167. package/icons/alert-circle.svg +1 -0
  168. package/icons/alert-triangle.svg +1 -0
  169. package/icons/alert.d27e24.svg +1 -0
  170. package/icons/alert.svg +1 -0
  171. package/icons/apple.svg +1 -0
  172. package/icons/arrow-down.svg +1 -0
  173. package/icons/arrow-expand.svg +1 -0
  174. package/icons/arrow-left.svg +1 -0
  175. package/icons/arrow-minimize.svg +1 -0
  176. package/icons/arrow-right-to-line.svg +1 -0
  177. package/icons/arrow-right.svg +1 -0
  178. package/icons/arrow-up-right.svg +1 -0
  179. package/icons/arrow-up.0c0c0d.svg +1 -0
  180. package/icons/arrow-up.svg +1 -0
  181. package/icons/at.svg +1 -0
  182. package/icons/atom.0c0c0d.svg +1 -0
  183. package/icons/atom.svg +1 -0
  184. package/icons/bar-chart-2.svg +1 -0
  185. package/icons/bar.svg +1 -0
  186. package/icons/bell.svg +1 -0
  187. package/icons/box.svg +1 -0
  188. package/icons/bug.svg +1 -0
  189. package/icons/button.svg +1 -0
  190. package/icons/calendar.svg +1 -0
  191. package/icons/check-circle.33c192.svg +1 -0
  192. package/icons/check-circle.svg +1 -0
  193. package/icons/check-square.svg +4 -0
  194. package/icons/check.d1d3db.svg +1 -0
  195. package/icons/check.svg +1 -0
  196. package/icons/chevron-down.svg +1 -0
  197. package/icons/chevron-left.svg +1 -0
  198. package/icons/chevron-right.svg +1 -0
  199. package/icons/chevron-up.svg +1 -0
  200. package/icons/circle.svg +1 -0
  201. package/icons/clock.svg +1 -0
  202. package/icons/cmd.svg +1 -0
  203. package/icons/code.svg +1 -0
  204. package/icons/columns.svg +1 -0
  205. package/icons/copy.svg +1 -0
  206. package/icons/cpu.svg +1 -0
  207. package/icons/dashboard.0c0c0d.svg +1 -0
  208. package/icons/dashboard.svg +1 -0
  209. package/icons/dollar.svg +1 -0
  210. package/icons/download.svg +1 -0
  211. package/icons/edit.svg +1 -0
  212. package/icons/extensions.svg +1 -0
  213. package/icons/external.svg +1 -0
  214. package/icons/eye.svg +1 -0
  215. package/icons/file-text.svg +1 -0
  216. package/icons/file.svg +1 -0
  217. package/icons/files.svg +1 -0
  218. package/icons/filter.svg +1 -0
  219. package/icons/folder-open.svg +4 -0
  220. package/icons/folder.svg +1 -0
  221. package/icons/gear.svg +1 -0
  222. package/icons/git.svg +1 -0
  223. package/icons/github.svg +1 -0
  224. package/icons/globe.svg +1 -0
  225. package/icons/grid-2x2.svg +1 -0
  226. package/icons/hash.svg +1 -0
  227. package/icons/heart.svg +1 -0
  228. package/icons/help-circle.svg +5 -0
  229. package/icons/help.svg +1 -0
  230. package/icons/home.svg +1 -0
  231. package/icons/icons.svg +153 -0
  232. package/icons/image.svg +1 -0
  233. package/icons/info-circle.svg +1 -0
  234. package/icons/info-square.svg +1 -0
  235. package/icons/info.387bff.svg +1 -0
  236. package/icons/info.svg +1 -0
  237. package/icons/input.svg +1 -0
  238. package/icons/key.svg +1 -0
  239. package/icons/layers.svg +1 -0
  240. package/icons/layout-grid.svg +6 -0
  241. package/icons/layout.svg +1 -0
  242. package/icons/link.svg +1 -0
  243. package/icons/list.svg +1 -0
  244. package/icons/lock.svg +1 -0
  245. package/icons/log-out.svg +1 -0
  246. package/icons/logo.svg +1 -0
  247. package/icons/mail.svg +1 -0
  248. package/icons/menu.svg +1 -0
  249. package/icons/message-circle.svg +1 -0
  250. package/icons/message-plus.svg +1 -0
  251. package/icons/message-square.svg +1 -0
  252. package/icons/mic.svg +1 -0
  253. package/icons/minus.svg +1 -0
  254. package/icons/moon.svg +1 -0
  255. package/icons/more-h.svg +1 -0
  256. package/icons/mouse.svg +1 -0
  257. package/icons/palette.svg +1 -0
  258. package/icons/panel-bottom.svg +1 -0
  259. package/icons/pause.svg +1 -0
  260. package/icons/play.svg +1 -0
  261. package/icons/plug.svg +1 -0
  262. package/icons/plus.0c0c0d.svg +1 -0
  263. package/icons/plus.svg +1 -0
  264. package/icons/refresh.svg +1 -0
  265. package/icons/ruler.svg +1 -0
  266. package/icons/scroll-text.svg +1 -0
  267. package/icons/search-menu.svg +1 -0
  268. package/icons/search.svg +1 -0
  269. package/icons/send.0c0c0d.svg +1 -0
  270. package/icons/send.svg +1 -0
  271. package/icons/settings.0c0c0d.svg +1 -0
  272. package/icons/settings.svg +1 -0
  273. package/icons/shield.svg +1 -0
  274. package/icons/sidebar-left.svg +1 -0
  275. package/icons/sidebar-right.svg +1 -0
  276. package/icons/sliders.svg +1 -0
  277. package/icons/sparkles.32f08c.svg +1 -0
  278. package/icons/sparkles.svg +1 -0
  279. package/icons/square.svg +1 -0
  280. package/icons/star.svg +1 -0
  281. package/icons/sun.svg +1 -0
  282. package/icons/table.svg +1 -0
  283. package/icons/terminal.svg +1 -0
  284. package/icons/trash.svg +1 -0
  285. package/icons/trending-down.svg +1 -0
  286. package/icons/trending-up.svg +1 -0
  287. package/icons/type.svg +1 -0
  288. package/icons/upload.svg +1 -0
  289. package/icons/user-circle.svg +1 -0
  290. package/icons/user-plus.svg +6 -0
  291. package/icons/user.svg +1 -0
  292. package/icons/users.svg +1 -0
  293. package/icons/warning.svg +1 -0
  294. package/icons/wrench.svg +1 -0
  295. package/icons/x-circle.svg +1 -0
  296. package/icons/x.svg +1 -0
  297. package/icons/zap.0c0c0d.svg +1 -0
  298. package/icons/zap.svg +1 -0
  299. package/js/calendar.js +184 -0
  300. package/js/carousel.js +173 -0
  301. package/js/collapse.js +127 -0
  302. package/js/color-picker.js +144 -0
  303. package/js/component.js +276 -0
  304. package/js/composition-api.js +458 -0
  305. package/js/countdown.js +144 -0
  306. package/js/data-bind.js +1286 -0
  307. package/js/datepicker.js +270 -0
  308. package/js/dialog.js +131 -0
  309. package/js/drawer.js +118 -0
  310. package/js/dropdown.js +122 -0
  311. package/js/dynamic-tags.js +156 -0
  312. package/js/error-handler.js +181 -0
  313. package/js/fileupload.js +392 -0
  314. package/js/form.js +291 -0
  315. package/js/global-events.js +203 -0
  316. package/js/heatmap.js +405 -0
  317. package/js/http.js +419 -0
  318. package/js/i18n.js +228 -0
  319. package/js/icons.js +165 -0
  320. package/js/image-preview.js +218 -0
  321. package/js/initializer.js +162 -0
  322. package/js/kupola-core.js +66 -0
  323. package/js/kupola-devtools.js +598 -0
  324. package/js/kupola-lifecycle.js +510 -0
  325. package/js/message.js +60 -0
  326. package/js/modal.js +191 -0
  327. package/js/notification.js +73 -0
  328. package/js/numberinput.js +146 -0
  329. package/js/performance.js +250 -0
  330. package/js/registry.js +205 -0
  331. package/js/router.js +396 -0
  332. package/js/security.js +189 -0
  333. package/js/select.js +143 -0
  334. package/js/slide-captcha.js +504 -0
  335. package/js/slider.js +94 -0
  336. package/js/statcard.js +219 -0
  337. package/js/tag.js +83 -0
  338. package/js/test-utils.js +251 -0
  339. package/js/theme.js +363 -0
  340. package/js/timepicker.js +238 -0
  341. package/js/tooltip.js +122 -0
  342. package/js/utils.js +1458 -0
  343. package/js/validation.js +553 -0
  344. package/js/virtual-list.js +593 -0
  345. package/package.json +105 -0
  346. package/templates/base.html +30 -0
  347. package/templates/base_dashboard.html +99 -0
  348. package/types/kupola.d.ts +1359 -0
  349. package/utils/Kupola.cs +77 -0
  350. package/utils/Kupola.java +104 -0
  351. package/utils/kupola.go +120 -0
  352. package/utils/kupola.js +63 -0
  353. package/utils/kupola.py +1392 -0
  354. package/utils/kupola.rb +69 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,130 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.2.0] - 2026-07-09
9
+
10
+ ### Added
11
+
12
+ - **Architecture**: Added `package.json` exports field for ES Module support
13
+ - **Architecture**: Added `vite.config.js` for modern Vite/Rolldown build support
14
+ - **Architecture**: Added `.eslintrc.cjs` with comprehensive linting rules
15
+ - **Architecture**: Added `.prettierrc` for consistent code formatting
16
+ - **Architecture**: Added `jest.config.cjs` and test setup for unit testing
17
+ - **Architecture**: Added comprehensive test scripts (`test`, `test:watch`, `test:coverage`)
18
+ - **Architecture**: Added lint scripts (`lint`, `lint:fix`) and format script
19
+ - **Security**: Added XSS protection utility (`escapeHtml`, `sanitize`)
20
+ - **Security**: Added CSRF protection mechanism
21
+ - **Error Handling**: Added unified error boundary and global error handler
22
+ - **Performance**: Added performance monitoring utility (`KupolaPerformance`)
23
+ - **Components**: Converted 7 functional components to class-based (Dropdown, Select, ColorPicker, Datepicker, Timepicker, Tooltip, SlideCaptcha)
24
+ - **HTTP**: Added `cancelAllRequests()` method for batch request cancellation
25
+ - **HTTP**: Fixed `cancelRequest()` to support all HTTP methods
26
+
27
+ ### Changed
28
+
29
+ - **package.json**: Added `type: module` for ES Module compatibility
30
+ - **package.json**: Updated build scripts to support both Rollup and Vite
31
+ - **package.json**: Added dev dependencies (vite, eslint, prettier, jest)
32
+ - **KupolaHttp**: Fixed `response.ok` check for proper error handling
33
+ - **KupolaComponent**: Fixed `setState/setProps` to await lifecycle updates
34
+ - **KupolaLifecycle**: Fixed `onError` property/method name conflict
35
+ - **Data Bind**: Unified `createReactive()` and `wrapReactive()` implementations
36
+ - **Composition API**: Fixed computed() circular reference issue
37
+ - **Dialog**: Fixed incomplete event listener cleanup
38
+
39
+ ### Fixed
40
+
41
+ - **Memory Leaks**: Fixed global event listeners in all components using GlobalEventManager
42
+ - **Memory Leaks**: Fixed Modal, ImagePreview, Heatmap, Datepicker listener cleanup
43
+ - **Memory Leaks**: Fixed SlideCaptcha touch/mouse event cleanup
44
+ - **Performance**: Fixed wrapReactive() duplicate Proxy creation using WeakMap cache
45
+ - **Initialization**: Added `__kupolaInitialized` flags to prevent duplicate initialization
46
+
47
+ ## [1.1.1] - 2026-07-07
48
+
49
+ ### Added
50
+
51
+ - **Components**: Added Statistic Card (`ds-statcard`) with number animation, trend indicators, and progress bar
52
+ - **Components**: Added Image (`ds-image`) with placeholder, fallback, and error states
53
+ - **Components**: Added Image List (`ds-image-list`) with grid layout and selection
54
+ - **Components**: Added Image Preview (`ds-image-preview`) with full-screen viewer
55
+ - **Components**: Added Tag (`ds-tag`) with closable functionality
56
+ - **File Upload**: Added file size limit (`data-max-size`), multi-file limit (`data-max-count`), error handling, image preview, and upload progress
57
+ - **Form Validation**: Enhanced validation to support DatePicker, Dropdown, and FileUpload components; added success state icons; added duplicate submission prevention
58
+ - **Heatmap**: Fixed color display issue with green gradient; added horizontal scroll layout; fixed mock data generation
59
+
60
+ ### Changed
61
+
62
+ - **Heatmap**: Changed from vertical to horizontal column layout for better visual alignment
63
+ - **Virtual List**: Fixed mouse wheel scrolling support for both vertical and horizontal modes
64
+ - **File Upload**: Enhanced disabled state with distinct visual styling
65
+ - **Components CSS**: Renamed `components-new.css` to `components-ext.css`
66
+
67
+ ### Fixed
68
+
69
+ - **File Upload**: Fixed duplicate file selector popup caused by event bubbling
70
+ - **Heatmap**: Fixed "0 contributions" display by including all dates in mock data
71
+ - **Sidebar**: Fixed missing icons for Data and Data Viz navigation items
72
+ - **Heatmap**: Fixed color visibility in dark theme with improved green gradient colors
73
+
74
+ ## [1.1.0] - 2026-07-07
75
+
76
+ ### Added
77
+
78
+ - **Components**: Added 26+ new components including Heatmap, Virtual List, Slide Captcha, Countdown, Carousel, Drawer, Color Picker, Image Preview, Notification, Message, Collapse, Dynamic Tags, Timepicker, Number Input, Progress Circle, Slider, Checkbox, Radio, Switch, Badge, Timeline, Divider, Empty, Spin, etc.
79
+ - **Heatmap Color Customization**: Added `data-color` attribute support for custom heatmap colors
80
+ - **Brand Picker Auto-create**: Added automatic brand picker popup creation in theme.js, eliminating duplicate inline code
81
+ - **Form Validation**: Added comprehensive form validation system with multiple rules (required, email, phone, url, min, max, pattern)
82
+ - **Tooltip System**: Added custom tooltip system with `data-title` attribute and mouse-follow positioning
83
+ - **Data Binding**: Added two-way data binding system with event bus
84
+
85
+ ### Changed
86
+
87
+ - **Default Brand Color**: Changed default brand color from 翠绿 (#32F08C) to 曾青 (#535164)
88
+ - **Brand Color API**: Renamed `setBrandColor()` to `setBrand()` for consistency
89
+ - **Heatmap**: Fixed date range mismatch issue, updated mock data generation logic
90
+ - **Dashboard Layout**: Fixed header display issues, improved scroll container handling
91
+ - **Input Components**: Removed inner input borders for Date Picker, Time Picker, and Number Input
92
+
93
+ ### Fixed
94
+
95
+ - **Event Listener Duplication**: Added execution flags (`window.__nimbus*Initialized`) to prevent duplicate event binding in theme.js, validation.js, and tooltip.js
96
+ - **Form Validation**: Fixed `.ds-dropdown` class name error in getValue(), changed to `.ds-select`
97
+ - **Heatmap Colors**: Fixed cell color display issue by adding `!important` to CSS styles
98
+ - **Brand Picker**: Fixed popup not showing on page load by checking `document.readyState`
99
+ - **Accessibility**: Improved icon visibility in both dark and light themes using CSS filter
100
+ - **Tooltip Positioning**: Fixed tooltip being blocked by mouse cursor, positioned at bottom-right
101
+
102
+ ## [1.0.0] - 2026-07-03
103
+
104
+ ### Added
105
+
106
+ - **Components**: Added 14 components (buttons, cards, forms, tables, dialogs, pagination, stat cards, nav lists, file trees, alerts, tags, tabs, modals, avatars)
107
+ - **Themes**: Added dark and light themes with CSS variables
108
+ - **Brand Colors**: Added 11 brand colors (翠绿, 雄黄, 姜黄, 蓝绿, 孔雀蓝, 玫瑰紫, 柿红, 紫云, 山茶红, 曾青, 柔蓝)
109
+ - **Dashboard**: Added complete dashboard layout framework
110
+ - **Templates**: Added Flask base templates (base.html, base_dashboard.html)
111
+ - **Python Utilities**: Added nimbus.py with component generation functions
112
+ - **SVG Sprite**: Added icons.svg sprite file for optimized icon loading
113
+ - **Documentation**: Added comprehensive README with usage examples
114
+
115
+ ### Changed
116
+
117
+ - **Icons**: Updated icon colors to match Nimbus design system
118
+ - **CSS**: Refactored CSS into modular files (nimbus.css, brand-themes.css, states.css, utilities.css)
119
+
120
+ ### Removed
121
+
122
+ - N/A
123
+
124
+ ## [0.1.0] - 2026-06-01
125
+
126
+ ### Added
127
+
128
+ - Initial project setup
129
+ - Core CSS variables (colors_and_type.css)
130
+ - Basic components (buttons, cards, forms)
package/INTEGRATION.md ADDED
@@ -0,0 +1,440 @@
1
+ # Nimbus Design System - Integration Guide
2
+
3
+ ## Table of Contents
4
+
5
+ 1. [Flask Integration](#flask-integration)
6
+ 2. [Django Integration](#django-integration)
7
+ 3. [Static Site Integration](#static-site-integration)
8
+ 4. [Python Helper Functions](#python-helper-functions)
9
+ 5. [Production Deployment](#production-deployment)
10
+
11
+ ---
12
+
13
+ ## Flask Integration
14
+
15
+ ### Step 1: Copy Files
16
+
17
+ Copy the `nimbus` directory to your Flask project's `static` folder:
18
+
19
+ ```
20
+ your-flask-app/
21
+ ├── static/
22
+ │ └── nimbus/
23
+ │ ├── css/
24
+ │ ├── js/
25
+ │ ├── icons/
26
+ │ └── utils/
27
+ ├── templates/
28
+ └── app.py
29
+ ```
30
+
31
+ ### Step 2: Create Base Template
32
+
33
+ Create `templates/base.html`:
34
+
35
+ ```html
36
+ <!DOCTYPE html>
37
+ <html lang="zh-CN">
38
+ <head>
39
+ <meta charset="UTF-8">
40
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
41
+ <title>{% block title %}Nimbus{% endblock %}</title>
42
+
43
+ <!-- Nimbus CSS -->
44
+ <link rel="stylesheet" href="{{ url_for('static', filename='nimbus/css/nimbus.min.css') }}">
45
+ </head>
46
+ <body data-theme="dark">
47
+ {% block content %}{% endblock %}
48
+
49
+ <!-- Nimbus JS -->
50
+ <script src="{{ url_for('static', filename='nimbus/js/nimbus.min.js') }}"></script>
51
+ <script>
52
+ initTheme();
53
+ initTooltip();
54
+ initDatepickers();
55
+ initFileUploads();
56
+ initValidation();
57
+ </script>
58
+ {% block scripts %}{% endblock %}
59
+ </body>
60
+ </html>
61
+ ```
62
+
63
+ ### Step 3: Use Components in Templates
64
+
65
+ Create `templates/index.html`:
66
+
67
+ ```html
68
+ {% extends 'base.html' %}
69
+
70
+ {% block title %}Dashboard{% endblock %}
71
+
72
+ {% block content %}
73
+ <div class="ds-page-header">
74
+ <div class="ds-page-header__left">
75
+ <h1 class="ds-page-header__title">Welcome</h1>
76
+ <p class="ds-page-header__subtitle">This is your dashboard</p>
77
+ </div>
78
+ <div class="ds-page-header__right">
79
+ <button class="ds-btn ds-btn--brand">Get Started</button>
80
+ </div>
81
+ </div>
82
+
83
+ <div class="ds-card">
84
+ <div class="ds-card__body">
85
+ <form class="ds-form" style="display: flex; flex-direction: column; gap: 16px; width: 300px;">
86
+ <input type="text" class="ds-input" data-validate="required,email" placeholder="Email">
87
+ <input type="password" class="ds-input" data-validate="required,min:6" placeholder="Password">
88
+ <button type="submit" class="ds-btn ds-btn--brand">Login</button>
89
+ </form>
90
+ </div>
91
+ </div>
92
+ {% endblock %}
93
+ ```
94
+
95
+ ### Step 4: Use Python Helper Functions
96
+
97
+ Import the helper functions in your Flask app:
98
+
99
+ ```python
100
+ from utils.nimbus import *
101
+
102
+ @app.route('/')
103
+ def index():
104
+ return render_template('index.html',
105
+ btn=btn,
106
+ card=card,
107
+ input_field=input_field)
108
+ ```
109
+
110
+ In your template:
111
+
112
+ ```html
113
+ {{ btn('Primary Button', variant='primary') }}
114
+ {{ card(title='Card Title', body='Card content') }}
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Django Integration
120
+
121
+ ### Step 1: Copy Files
122
+
123
+ Copy the `nimbus` directory to your Django project's `static` folder:
124
+
125
+ ```
126
+ your-django-app/
127
+ ├── your_app/
128
+ │ ├── static/
129
+ │ │ └── nimbus/
130
+ │ │ ├── css/
131
+ │ │ ├── js/
132
+ │ │ ├── icons/
133
+ │ │ └── utils/
134
+ │ └── templates/
135
+ └── settings.py
136
+ ```
137
+
138
+ ### Step 2: Configure Static Files
139
+
140
+ In `settings.py`:
141
+
142
+ ```python
143
+ STATIC_URL = '/static/'
144
+ STATICFILES_DIRS = [
145
+ os.path.join(BASE_DIR, 'your_app/static'),
146
+ ]
147
+ ```
148
+
149
+ ### Step 3: Create Base Template
150
+
151
+ Create `templates/base.html`:
152
+
153
+ ```html
154
+ <!DOCTYPE html>
155
+ <html lang="zh-CN">
156
+ <head>
157
+ <meta charset="UTF-8">
158
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
159
+ <title>{% block title %}Nimbus{% endblock %}</title>
160
+
161
+ <!-- Nimbus CSS -->
162
+ <link rel="stylesheet" href="{% static 'nimbus/css/nimbus.min.css' %}">
163
+ </head>
164
+ <body data-theme="dark">
165
+ {% block content %}{% endblock %}
166
+
167
+ <!-- Nimbus JS -->
168
+ <script src="{% static 'nimbus/js/nimbus.min.js' %}"></script>
169
+ <script>
170
+ initTheme();
171
+ initTooltip();
172
+ initDatepickers();
173
+ initFileUploads();
174
+ initValidation();
175
+ </script>
176
+ {% block scripts %}{% endblock %}
177
+ </body>
178
+ </html>
179
+ ```
180
+
181
+ ### Step 4: Use Components in Templates
182
+
183
+ Create `templates/index.html`:
184
+
185
+ ```html
186
+ {% extends 'base.html' %}
187
+
188
+ {% block title %}Dashboard{% endblock %}
189
+
190
+ {% block content %}
191
+ <div class="ds-page-header">
192
+ <div class="ds-page-header__left">
193
+ <h1 class="ds-page-header__title">Welcome</h1>
194
+ <p class="ds-page-header__subtitle">This is your dashboard</p>
195
+ </div>
196
+ </div>
197
+ {% endblock %}
198
+ ```
199
+
200
+ ### Step 5: Use Python Helper Functions
201
+
202
+ Create a custom template tag in `your_app/templatetags/nimbus_tags.py`:
203
+
204
+ ```python
205
+ from django import template
206
+ from your_app.static.nimbus.utils.nimbus import *
207
+
208
+ register = template.Library()
209
+
210
+ @register.simple_tag
211
+ def ds_btn(text, variant='brand'):
212
+ return btn(text, variant)
213
+
214
+ @register.simple_tag
215
+ def ds_card(title, body):
216
+ return card(title, body)
217
+
218
+ @register.simple_tag
219
+ def ds_input(placeholder, validate=''):
220
+ return input_field(placeholder, validate)
221
+ ```
222
+
223
+ In your template:
224
+
225
+ ```html
226
+ {% load nimbus_tags %}
227
+
228
+ {% ds_btn 'Primary Button' 'primary' %}
229
+ {% ds_card 'Card Title' 'Card content' %}
230
+ {% ds_input 'Email' 'required,email' %}
231
+ ```
232
+
233
+ ---
234
+
235
+ ## Static Site Integration
236
+
237
+ ### Step 1: Copy Files
238
+
239
+ Copy the `nimbus` directory to your static site:
240
+
241
+ ```
242
+ your-static-site/
243
+ ├── nimbus/
244
+ │ ├── css/
245
+ │ ├── js/
246
+ │ └── icons/
247
+ └── index.html
248
+ ```
249
+
250
+ ### Step 2: Create HTML Page
251
+
252
+ Create `index.html`:
253
+
254
+ ```html
255
+ <!DOCTYPE html>
256
+ <html lang="zh-CN">
257
+ <head>
258
+ <meta charset="UTF-8">
259
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
260
+ <title>Nimbus Dashboard</title>
261
+
262
+ <!-- Nimbus CSS -->
263
+ <link rel="stylesheet" href="nimbus/css/nimbus.min.css">
264
+ </head>
265
+ <body data-theme="dark">
266
+ <div class="ds-page-header">
267
+ <div class="ds-page-header__left">
268
+ <h1 class="ds-page-header__title">Welcome</h1>
269
+ </div>
270
+ </div>
271
+
272
+ <!-- Nimbus JS -->
273
+ <script src="nimbus/js/nimbus.min.js"></script>
274
+ <script>
275
+ initTheme();
276
+ initTooltip();
277
+ initDatepickers();
278
+ initFileUploads();
279
+ initValidation();
280
+ </script>
281
+ </body>
282
+ </html>
283
+ ```
284
+
285
+ ---
286
+
287
+ ## Python Helper Functions
288
+
289
+ ### Available Functions
290
+
291
+ The `nimbus.py` file provides helper functions for generating component HTML:
292
+
293
+ | Function | Description |
294
+ |----------|-------------|
295
+ | `btn(text, variant='brand', size='md', icon='')` | Button component |
296
+ | `card(title, body, footer='')` | Card component |
297
+ | `input_field(placeholder, validate='')` | Input component |
298
+ | `textarea(placeholder)` | Textarea component |
299
+ | `select(options, selected='')` | Select component |
300
+ | `checkbox(label, checked=False)` | Checkbox component |
301
+ | `radio(name, label, checked=False)` | Radio component |
302
+ | `switch(checked=False)` | Switch component |
303
+ | `badge(text, variant='default')` | Badge component |
304
+ | `alert(text, variant='info')` | Alert component |
305
+ | `tabs(tabs)` | Tabs component |
306
+ | `progress_bar(percent, indeterminate=False)` | Progress bar |
307
+ | `progress_circle(value, label='')` | Progress circle |
308
+ | `slider(label, value=50)` | Slider component |
309
+ | `datepicker(placeholder='Select date')` | Datepicker component |
310
+ | `fileupload(accept='')` | File upload component |
311
+ | `timeline(items)` | Timeline component |
312
+ | `avatar(image='', initials='')` | Avatar component |
313
+ | `breadcrumb(items)` | Breadcrumb component |
314
+
315
+ ### Usage Example
316
+
317
+ ```python
318
+ from utils.nimbus import *
319
+
320
+ # Generate HTML
321
+ html = btn('Submit', variant='primary') + \
322
+ card('User Profile', 'User information')
323
+
324
+ # In Flask template
325
+ return render_template('page.html', html=html)
326
+ ```
327
+
328
+ ---
329
+
330
+ ## Production Deployment
331
+
332
+ ### Step 1: Build Files
333
+
334
+ Run the build script to generate compressed files:
335
+
336
+ ```bash
337
+ cd nimbus
338
+ npm run build
339
+ ```
340
+
341
+ ### Step 2: Use Compressed Files
342
+
343
+ In production, use the minified files from the `dist/` directory:
344
+
345
+ ```html
346
+ <!-- CSS -->
347
+ <link rel="stylesheet" href="nimbus/dist/css/nimbus.min.css">
348
+
349
+ <!-- JS -->
350
+ <script src="nimbus/dist/js/nimbus.min.js"></script>
351
+ ```
352
+
353
+ ### Step 3: CDN Deployment (Optional)
354
+
355
+ Upload the `dist/` directory to a CDN and reference it:
356
+
357
+ ```html
358
+ <link rel="stylesheet" href="https://cdn.example.com/nimbus/css/nimbus.min.css">
359
+ <script src="https://cdn.example.com/nimbus/js/nimbus.min.js"></script>
360
+ ```
361
+
362
+ ### Step 4: Browser Caching
363
+
364
+ Set appropriate caching headers for static assets:
365
+
366
+ - CSS/JS files: `Cache-Control: public, max-age=31536000`
367
+ - Icon files: `Cache-Control: public, max-age=31536000`
368
+
369
+ ---
370
+
371
+ ## Dashboard Integration
372
+
373
+ ### Basic Dashboard Layout
374
+
375
+ ```html
376
+ <div class="ds-dashboard">
377
+ <header class="ds-dashboard__header">
378
+ <!-- Header content -->
379
+ </header>
380
+ <div class="ds-dashboard__body">
381
+ <aside class="ds-dashboard__sidebar">
382
+ <!-- Sidebar content -->
383
+ </aside>
384
+ <main class="ds-dashboard__content">
385
+ <!-- Main content -->
386
+ </main>
387
+ </div>
388
+ <footer class="ds-dashboard__footer">
389
+ <!-- Footer content -->
390
+ </footer>
391
+ </div>
392
+ ```
393
+
394
+ ### Complete Dashboard Example
395
+
396
+ See `nimbus/dashboard/dashboard.html` for a complete example.
397
+
398
+ ---
399
+
400
+ ## Tips
401
+
402
+ 1. **Theme Switching**: Use `setTheme('light')` or `setTheme('dark')` to switch themes
403
+ 2. **Brand Color**: Use `setBrand('zengqing')` to switch brand colors (default: 曾青 #535164)
404
+ 3. **Validation**: Add `data-validate` attributes to form fields
405
+ 4. **Tooltip**: Add `data-title` attributes to elements for tooltips
406
+ 5. **Responsive**: The design system automatically adapts to different screen sizes
407
+
408
+ ---
409
+
410
+ ## Troubleshooting
411
+
412
+ ### Icons Not Displaying
413
+
414
+ Ensure the icons path is correct. The icons should be in `nimbus/icons/` directory.
415
+
416
+ ### Theme Not Applying
417
+
418
+ Make sure the `data-theme` attribute is set on the `<body>` element.
419
+
420
+ ### JavaScript Not Working
421
+
422
+ Check that all JS files are loaded in the correct order:
423
+
424
+ 1. `icons.js`
425
+ 2. `theme.js`
426
+ 3. `tooltip.js`
427
+ 4. `datepicker.js`
428
+ 5. `fileupload.js`
429
+ 6. `validation.js`
430
+ 7. `data-bind.js`
431
+
432
+ ### CSS Not Loading
433
+
434
+ Verify the CSS path is correct and the file exists.
435
+
436
+ ---
437
+
438
+ ## Support
439
+
440
+ For issues or feature requests, please refer to the project documentation or create an issue.