@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.
- package/CHANGELOG.md +130 -0
- package/INTEGRATION.md +440 -0
- package/PROJECT_SUMMARY.md +312 -0
- package/README.md +286 -0
- package/SKILL.md +572 -0
- package/css/accessibility.css +119 -0
- package/css/animations.css +224 -0
- package/css/brand-themes.css +300 -0
- package/css/colors_and_type.css +441 -0
- package/css/components-ext.css +4165 -0
- package/css/components.css +1483 -0
- package/css/kupola.css +12 -0
- package/css/responsive.css +697 -0
- package/css/scaffold.css +145 -0
- package/css/states.css +316 -0
- package/css/theme-dark.css +296 -0
- package/css/theme-light.css +296 -0
- package/css/utilities.css +171 -0
- package/dist/css/kupola.css +12 -0
- package/dist/icons/icons/activity.svg +3 -0
- package/dist/icons/icons/alert-circle.svg +1 -0
- package/dist/icons/icons/alert-triangle.svg +1 -0
- package/dist/icons/icons/alert.d27e24.svg +1 -0
- package/dist/icons/icons/alert.svg +1 -0
- package/dist/icons/icons/apple.svg +1 -0
- package/dist/icons/icons/arrow-down.svg +1 -0
- package/dist/icons/icons/arrow-expand.svg +1 -0
- package/dist/icons/icons/arrow-left.svg +1 -0
- package/dist/icons/icons/arrow-minimize.svg +1 -0
- package/dist/icons/icons/arrow-right-to-line.svg +1 -0
- package/dist/icons/icons/arrow-right.svg +1 -0
- package/dist/icons/icons/arrow-up-right.svg +1 -0
- package/dist/icons/icons/arrow-up.0c0c0d.svg +1 -0
- package/dist/icons/icons/arrow-up.svg +1 -0
- package/dist/icons/icons/at.svg +1 -0
- package/dist/icons/icons/atom.0c0c0d.svg +1 -0
- package/dist/icons/icons/atom.svg +1 -0
- package/dist/icons/icons/bar-chart-2.svg +1 -0
- package/dist/icons/icons/bar.svg +1 -0
- package/dist/icons/icons/bell.svg +1 -0
- package/dist/icons/icons/box.svg +1 -0
- package/dist/icons/icons/bug.svg +1 -0
- package/dist/icons/icons/button.svg +1 -0
- package/dist/icons/icons/calendar.svg +1 -0
- package/dist/icons/icons/check-circle.33c192.svg +1 -0
- package/dist/icons/icons/check-circle.svg +1 -0
- package/dist/icons/icons/check-square.svg +4 -0
- package/dist/icons/icons/check.d1d3db.svg +1 -0
- package/dist/icons/icons/check.svg +1 -0
- package/dist/icons/icons/chevron-down.svg +1 -0
- package/dist/icons/icons/chevron-left.svg +1 -0
- package/dist/icons/icons/chevron-right.svg +1 -0
- package/dist/icons/icons/chevron-up.svg +1 -0
- package/dist/icons/icons/circle.svg +1 -0
- package/dist/icons/icons/clock.svg +1 -0
- package/dist/icons/icons/cmd.svg +1 -0
- package/dist/icons/icons/code.svg +1 -0
- package/dist/icons/icons/columns.svg +1 -0
- package/dist/icons/icons/copy.svg +1 -0
- package/dist/icons/icons/cpu.svg +1 -0
- package/dist/icons/icons/dashboard.0c0c0d.svg +1 -0
- package/dist/icons/icons/dashboard.svg +1 -0
- package/dist/icons/icons/dollar.svg +1 -0
- package/dist/icons/icons/download.svg +1 -0
- package/dist/icons/icons/edit.svg +1 -0
- package/dist/icons/icons/extensions.svg +1 -0
- package/dist/icons/icons/external.svg +1 -0
- package/dist/icons/icons/eye.svg +1 -0
- package/dist/icons/icons/file-text.svg +1 -0
- package/dist/icons/icons/file.svg +1 -0
- package/dist/icons/icons/files.svg +1 -0
- package/dist/icons/icons/filter.svg +1 -0
- package/dist/icons/icons/folder-open.svg +4 -0
- package/dist/icons/icons/folder.svg +1 -0
- package/dist/icons/icons/gear.svg +1 -0
- package/dist/icons/icons/git.svg +1 -0
- package/dist/icons/icons/github.svg +1 -0
- package/dist/icons/icons/globe.svg +1 -0
- package/dist/icons/icons/grid-2x2.svg +1 -0
- package/dist/icons/icons/hash.svg +1 -0
- package/dist/icons/icons/heart.svg +1 -0
- package/dist/icons/icons/help-circle.svg +5 -0
- package/dist/icons/icons/help.svg +1 -0
- package/dist/icons/icons/home.svg +1 -0
- package/dist/icons/icons/icons.svg +153 -0
- package/dist/icons/icons/image.svg +1 -0
- package/dist/icons/icons/info-circle.svg +1 -0
- package/dist/icons/icons/info-square.svg +1 -0
- package/dist/icons/icons/info.387bff.svg +1 -0
- package/dist/icons/icons/info.svg +1 -0
- package/dist/icons/icons/input.svg +1 -0
- package/dist/icons/icons/key.svg +1 -0
- package/dist/icons/icons/layers.svg +1 -0
- package/dist/icons/icons/layout-grid.svg +6 -0
- package/dist/icons/icons/layout.svg +1 -0
- package/dist/icons/icons/link.svg +1 -0
- package/dist/icons/icons/list.svg +1 -0
- package/dist/icons/icons/lock.svg +1 -0
- package/dist/icons/icons/log-out.svg +1 -0
- package/dist/icons/icons/logo.svg +1 -0
- package/dist/icons/icons/mail.svg +1 -0
- package/dist/icons/icons/menu.svg +1 -0
- package/dist/icons/icons/message-circle.svg +1 -0
- package/dist/icons/icons/message-plus.svg +1 -0
- package/dist/icons/icons/message-square.svg +1 -0
- package/dist/icons/icons/mic.svg +1 -0
- package/dist/icons/icons/minus.svg +1 -0
- package/dist/icons/icons/moon.svg +1 -0
- package/dist/icons/icons/more-h.svg +1 -0
- package/dist/icons/icons/mouse.svg +1 -0
- package/dist/icons/icons/palette.svg +1 -0
- package/dist/icons/icons/panel-bottom.svg +1 -0
- package/dist/icons/icons/pause.svg +1 -0
- package/dist/icons/icons/play.svg +1 -0
- package/dist/icons/icons/plug.svg +1 -0
- package/dist/icons/icons/plus.0c0c0d.svg +1 -0
- package/dist/icons/icons/plus.svg +1 -0
- package/dist/icons/icons/refresh.svg +1 -0
- package/dist/icons/icons/ruler.svg +1 -0
- package/dist/icons/icons/scroll-text.svg +1 -0
- package/dist/icons/icons/search-menu.svg +1 -0
- package/dist/icons/icons/search.svg +1 -0
- package/dist/icons/icons/send.0c0c0d.svg +1 -0
- package/dist/icons/icons/send.svg +1 -0
- package/dist/icons/icons/settings.0c0c0d.svg +1 -0
- package/dist/icons/icons/settings.svg +1 -0
- package/dist/icons/icons/shield.svg +1 -0
- package/dist/icons/icons/sidebar-left.svg +1 -0
- package/dist/icons/icons/sidebar-right.svg +1 -0
- package/dist/icons/icons/sliders.svg +1 -0
- package/dist/icons/icons/sparkles.32f08c.svg +1 -0
- package/dist/icons/icons/sparkles.svg +1 -0
- package/dist/icons/icons/square.svg +1 -0
- package/dist/icons/icons/star.svg +1 -0
- package/dist/icons/icons/sun.svg +1 -0
- package/dist/icons/icons/table.svg +1 -0
- package/dist/icons/icons/terminal.svg +1 -0
- package/dist/icons/icons/trash.svg +1 -0
- package/dist/icons/icons/trending-down.svg +1 -0
- package/dist/icons/icons/trending-up.svg +1 -0
- package/dist/icons/icons/type.svg +1 -0
- package/dist/icons/icons/upload.svg +1 -0
- package/dist/icons/icons/user-circle.svg +1 -0
- package/dist/icons/icons/user-plus.svg +6 -0
- package/dist/icons/icons/user.svg +1 -0
- package/dist/icons/icons/users.svg +1 -0
- package/dist/icons/icons/warning.svg +1 -0
- package/dist/icons/icons/wrench.svg +1 -0
- package/dist/icons/icons/x-circle.svg +1 -0
- package/dist/icons/icons/x.svg +1 -0
- package/dist/icons/icons/zap.0c0c0d.svg +1 -0
- package/dist/icons/icons/zap.svg +1 -0
- package/dist/kupola.cjs.js +258 -0
- package/dist/kupola.cjs.js.map +1 -0
- package/dist/kupola.esm.js +7640 -0
- package/dist/kupola.esm.js.map +1 -0
- package/dist/kupola.umd.js +258 -0
- package/dist/kupola.umd.js.map +1 -0
- package/dist/types/kupola.d.ts +1359 -0
- package/dist/utils/utils/Kupola.cs +77 -0
- package/dist/utils/utils/Kupola.java +104 -0
- package/dist/utils/utils/kupola.go +120 -0
- package/dist/utils/utils/kupola.js +63 -0
- package/dist/utils/utils/kupola.py +1392 -0
- package/dist/utils/utils/kupola.rb +69 -0
- package/icons/activity.svg +3 -0
- package/icons/alert-circle.svg +1 -0
- package/icons/alert-triangle.svg +1 -0
- package/icons/alert.d27e24.svg +1 -0
- package/icons/alert.svg +1 -0
- package/icons/apple.svg +1 -0
- package/icons/arrow-down.svg +1 -0
- package/icons/arrow-expand.svg +1 -0
- package/icons/arrow-left.svg +1 -0
- package/icons/arrow-minimize.svg +1 -0
- package/icons/arrow-right-to-line.svg +1 -0
- package/icons/arrow-right.svg +1 -0
- package/icons/arrow-up-right.svg +1 -0
- package/icons/arrow-up.0c0c0d.svg +1 -0
- package/icons/arrow-up.svg +1 -0
- package/icons/at.svg +1 -0
- package/icons/atom.0c0c0d.svg +1 -0
- package/icons/atom.svg +1 -0
- package/icons/bar-chart-2.svg +1 -0
- package/icons/bar.svg +1 -0
- package/icons/bell.svg +1 -0
- package/icons/box.svg +1 -0
- package/icons/bug.svg +1 -0
- package/icons/button.svg +1 -0
- package/icons/calendar.svg +1 -0
- package/icons/check-circle.33c192.svg +1 -0
- package/icons/check-circle.svg +1 -0
- package/icons/check-square.svg +4 -0
- package/icons/check.d1d3db.svg +1 -0
- package/icons/check.svg +1 -0
- package/icons/chevron-down.svg +1 -0
- package/icons/chevron-left.svg +1 -0
- package/icons/chevron-right.svg +1 -0
- package/icons/chevron-up.svg +1 -0
- package/icons/circle.svg +1 -0
- package/icons/clock.svg +1 -0
- package/icons/cmd.svg +1 -0
- package/icons/code.svg +1 -0
- package/icons/columns.svg +1 -0
- package/icons/copy.svg +1 -0
- package/icons/cpu.svg +1 -0
- package/icons/dashboard.0c0c0d.svg +1 -0
- package/icons/dashboard.svg +1 -0
- package/icons/dollar.svg +1 -0
- package/icons/download.svg +1 -0
- package/icons/edit.svg +1 -0
- package/icons/extensions.svg +1 -0
- package/icons/external.svg +1 -0
- package/icons/eye.svg +1 -0
- package/icons/file-text.svg +1 -0
- package/icons/file.svg +1 -0
- package/icons/files.svg +1 -0
- package/icons/filter.svg +1 -0
- package/icons/folder-open.svg +4 -0
- package/icons/folder.svg +1 -0
- package/icons/gear.svg +1 -0
- package/icons/git.svg +1 -0
- package/icons/github.svg +1 -0
- package/icons/globe.svg +1 -0
- package/icons/grid-2x2.svg +1 -0
- package/icons/hash.svg +1 -0
- package/icons/heart.svg +1 -0
- package/icons/help-circle.svg +5 -0
- package/icons/help.svg +1 -0
- package/icons/home.svg +1 -0
- package/icons/icons.svg +153 -0
- package/icons/image.svg +1 -0
- package/icons/info-circle.svg +1 -0
- package/icons/info-square.svg +1 -0
- package/icons/info.387bff.svg +1 -0
- package/icons/info.svg +1 -0
- package/icons/input.svg +1 -0
- package/icons/key.svg +1 -0
- package/icons/layers.svg +1 -0
- package/icons/layout-grid.svg +6 -0
- package/icons/layout.svg +1 -0
- package/icons/link.svg +1 -0
- package/icons/list.svg +1 -0
- package/icons/lock.svg +1 -0
- package/icons/log-out.svg +1 -0
- package/icons/logo.svg +1 -0
- package/icons/mail.svg +1 -0
- package/icons/menu.svg +1 -0
- package/icons/message-circle.svg +1 -0
- package/icons/message-plus.svg +1 -0
- package/icons/message-square.svg +1 -0
- package/icons/mic.svg +1 -0
- package/icons/minus.svg +1 -0
- package/icons/moon.svg +1 -0
- package/icons/more-h.svg +1 -0
- package/icons/mouse.svg +1 -0
- package/icons/palette.svg +1 -0
- package/icons/panel-bottom.svg +1 -0
- package/icons/pause.svg +1 -0
- package/icons/play.svg +1 -0
- package/icons/plug.svg +1 -0
- package/icons/plus.0c0c0d.svg +1 -0
- package/icons/plus.svg +1 -0
- package/icons/refresh.svg +1 -0
- package/icons/ruler.svg +1 -0
- package/icons/scroll-text.svg +1 -0
- package/icons/search-menu.svg +1 -0
- package/icons/search.svg +1 -0
- package/icons/send.0c0c0d.svg +1 -0
- package/icons/send.svg +1 -0
- package/icons/settings.0c0c0d.svg +1 -0
- package/icons/settings.svg +1 -0
- package/icons/shield.svg +1 -0
- package/icons/sidebar-left.svg +1 -0
- package/icons/sidebar-right.svg +1 -0
- package/icons/sliders.svg +1 -0
- package/icons/sparkles.32f08c.svg +1 -0
- package/icons/sparkles.svg +1 -0
- package/icons/square.svg +1 -0
- package/icons/star.svg +1 -0
- package/icons/sun.svg +1 -0
- package/icons/table.svg +1 -0
- package/icons/terminal.svg +1 -0
- package/icons/trash.svg +1 -0
- package/icons/trending-down.svg +1 -0
- package/icons/trending-up.svg +1 -0
- package/icons/type.svg +1 -0
- package/icons/upload.svg +1 -0
- package/icons/user-circle.svg +1 -0
- package/icons/user-plus.svg +6 -0
- package/icons/user.svg +1 -0
- package/icons/users.svg +1 -0
- package/icons/warning.svg +1 -0
- package/icons/wrench.svg +1 -0
- package/icons/x-circle.svg +1 -0
- package/icons/x.svg +1 -0
- package/icons/zap.0c0c0d.svg +1 -0
- package/icons/zap.svg +1 -0
- package/js/calendar.js +184 -0
- package/js/carousel.js +173 -0
- package/js/collapse.js +127 -0
- package/js/color-picker.js +144 -0
- package/js/component.js +276 -0
- package/js/composition-api.js +458 -0
- package/js/countdown.js +144 -0
- package/js/data-bind.js +1286 -0
- package/js/datepicker.js +270 -0
- package/js/dialog.js +131 -0
- package/js/drawer.js +118 -0
- package/js/dropdown.js +122 -0
- package/js/dynamic-tags.js +156 -0
- package/js/error-handler.js +181 -0
- package/js/fileupload.js +392 -0
- package/js/form.js +291 -0
- package/js/global-events.js +203 -0
- package/js/heatmap.js +405 -0
- package/js/http.js +419 -0
- package/js/i18n.js +228 -0
- package/js/icons.js +165 -0
- package/js/image-preview.js +218 -0
- package/js/initializer.js +162 -0
- package/js/kupola-core.js +66 -0
- package/js/kupola-devtools.js +598 -0
- package/js/kupola-lifecycle.js +510 -0
- package/js/message.js +60 -0
- package/js/modal.js +191 -0
- package/js/notification.js +73 -0
- package/js/numberinput.js +146 -0
- package/js/performance.js +250 -0
- package/js/registry.js +205 -0
- package/js/router.js +396 -0
- package/js/security.js +189 -0
- package/js/select.js +143 -0
- package/js/slide-captcha.js +504 -0
- package/js/slider.js +94 -0
- package/js/statcard.js +219 -0
- package/js/tag.js +83 -0
- package/js/test-utils.js +251 -0
- package/js/theme.js +363 -0
- package/js/timepicker.js +238 -0
- package/js/tooltip.js +122 -0
- package/js/utils.js +1458 -0
- package/js/validation.js +553 -0
- package/js/virtual-list.js +593 -0
- package/package.json +105 -0
- package/templates/base.html +30 -0
- package/templates/base_dashboard.html +99 -0
- package/types/kupola.d.ts +1359 -0
- package/utils/Kupola.cs +77 -0
- package/utils/Kupola.java +104 -0
- package/utils/kupola.go +120 -0
- package/utils/kupola.js +63 -0
- package/utils/kupola.py +1392 -0
- 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.
|