snice 3.1.0 → 3.3.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/README.md +90 -41
- package/dist/components/accordion/snice-accordion-item.d.ts +2 -2
- package/dist/components/accordion/snice-accordion-item.js +9 -9
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.d.ts +2 -2
- package/dist/components/accordion/snice-accordion.js +9 -9
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/actions/snice-actions.d.ts +28 -0
- package/dist/components/actions/snice-actions.js +220 -0
- package/dist/components/actions/snice-actions.js.map +1 -0
- package/dist/components/actions/snice-actions.types.d.ts +27 -0
- package/dist/components/alert/snice-alert.d.ts +2 -2
- package/dist/components/alert/snice-alert.js +9 -9
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/audio-recorder/snice-audio-recorder.d.ts +58 -0
- package/dist/components/audio-recorder/snice-audio-recorder.js +413 -0
- package/dist/components/audio-recorder/snice-audio-recorder.js.map +1 -0
- package/dist/components/audio-recorder/snice-audio-recorder.types.d.ts +28 -0
- package/dist/components/avatar/snice-avatar.d.ts +2 -2
- package/dist/components/avatar/snice-avatar.js +9 -9
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.d.ts +2 -2
- package/dist/components/badge/snice-badge.js +10 -10
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/banner/snice-banner.d.ts +22 -0
- package/dist/components/banner/snice-banner.js +180 -0
- package/dist/components/banner/snice-banner.js.map +1 -0
- package/dist/components/banner/snice-banner.types.d.ts +14 -0
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +2 -2
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +9 -9
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/button/snice-button.d.ts +2 -2
- package/dist/components/button/snice-button.js +9 -9
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +46 -0
- package/dist/components/calendar/snice-calendar.js +294 -0
- package/dist/components/calendar/snice-calendar.js.map +1 -0
- package/dist/components/calendar/snice-calendar.types.d.ts +34 -0
- package/dist/components/camera/snice-camera.d.ts +39 -0
- package/dist/components/camera/snice-camera.js +286 -0
- package/dist/components/camera/snice-camera.js.map +1 -0
- package/dist/components/camera/snice-camera.types.d.ts +28 -0
- package/dist/components/card/snice-card.d.ts +2 -2
- package/dist/components/card/snice-card.js +9 -9
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/carousel/snice-carousel.d.ts +32 -0
- package/dist/components/carousel/snice-carousel.js +279 -0
- package/dist/components/carousel/snice-carousel.js.map +1 -0
- package/dist/components/carousel/snice-carousel.types.d.ts +22 -0
- package/dist/components/chart/snice-chart.d.ts +73 -0
- package/dist/components/chart/snice-chart.js +940 -0
- package/dist/components/chart/snice-chart.js.map +1 -0
- package/dist/components/chart/snice-chart.types.d.ts +71 -0
- package/dist/components/chat/snice-chat.d.ts +98 -0
- package/dist/components/chat/snice-chat.js +589 -0
- package/dist/components/chat/snice-chat.js.map +1 -0
- package/dist/components/chat/snice-chat.types.d.ts +141 -0
- package/dist/components/checkbox/snice-checkbox.d.ts +2 -2
- package/dist/components/checkbox/snice-checkbox.js +9 -9
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.d.ts +2 -2
- package/dist/components/chip/snice-chip.js +9 -9
- package/dist/components/chip/snice-chip.js.map +1 -1
- package/dist/components/code-block/snice-code-block.d.ts +15 -0
- package/dist/components/code-block/snice-code-block.js +141 -0
- package/dist/components/code-block/snice-code-block.js.map +1 -0
- package/dist/components/code-block/snice-code-block.types.d.ts +15 -0
- package/dist/components/color-display/snice-color-display.d.ts +14 -0
- package/dist/components/color-display/snice-color-display.js +151 -0
- package/dist/components/color-display/snice-color-display.js.map +1 -0
- package/dist/components/color-display/snice-color-display.types.d.ts +10 -0
- package/dist/components/color-picker/snice-color-picker.d.ts +50 -0
- package/dist/components/color-picker/snice-color-picker.js +489 -0
- package/dist/components/color-picker/snice-color-picker.js.map +1 -0
- package/dist/components/color-picker/snice-color-picker.types.d.ts +19 -0
- package/dist/components/command-palette/snice-command-palette.d.ts +47 -0
- package/dist/components/command-palette/snice-command-palette.js +428 -0
- package/dist/components/command-palette/snice-command-palette.js.map +1 -0
- package/dist/components/command-palette/snice-command-palette.types.d.ts +49 -0
- package/dist/components/date-picker/snice-date-picker.d.ts +2 -2
- package/dist/components/date-picker/snice-date-picker.js +10 -10
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.d.ts +2 -2
- package/dist/components/divider/snice-divider.js +9 -9
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/doc/snice-doc.d.ts +93 -0
- package/dist/components/doc/snice-doc.js +626 -0
- package/dist/components/doc/snice-doc.js.map +1 -0
- package/dist/components/doc/snice-doc.types.d.ts +118 -0
- package/dist/components/draw/snice-draw.d.ts +71 -0
- package/dist/components/draw/snice-draw.js +709 -0
- package/dist/components/draw/snice-draw.js.map +1 -0
- package/dist/components/draw/snice-draw.types.d.ts +41 -0
- package/dist/components/drawer/snice-drawer.d.ts +2 -2
- package/dist/components/drawer/snice-drawer.js +9 -9
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/empty-state/snice-empty-state.d.ts +13 -0
- package/dist/components/empty-state/snice-empty-state.js +121 -0
- package/dist/components/empty-state/snice-empty-state.js.map +1 -0
- package/dist/components/empty-state/snice-empty-state.types.d.ts +9 -0
- package/dist/components/file-upload/snice-file-upload.d.ts +44 -0
- package/dist/components/file-upload/snice-file-upload.js +387 -0
- package/dist/components/file-upload/snice-file-upload.js.map +1 -0
- package/dist/components/file-upload/snice-file-upload.types.d.ts +22 -0
- package/dist/components/gantt/snice-gantt.d.ts +29 -0
- package/dist/components/gantt/snice-gantt.js +268 -0
- package/dist/components/gantt/snice-gantt.js.map +1 -0
- package/dist/components/gantt/snice-gantt.types.d.ts +23 -0
- package/dist/components/image/snice-image.d.ts +22 -0
- package/dist/components/image/snice-image.js +201 -0
- package/dist/components/image/snice-image.js.map +1 -0
- package/dist/components/image/snice-image.types.d.ts +17 -0
- package/dist/components/input/snice-input.d.ts +2 -2
- package/dist/components/input/snice-input.js +9 -9
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/kanban/snice-kanban.d.ts +31 -0
- package/dist/components/kanban/snice-kanban.js +243 -0
- package/dist/components/kanban/snice-kanban.js.map +1 -0
- package/dist/components/kanban/snice-kanban.types.d.ts +29 -0
- package/dist/components/kpi/snice-kpi.d.ts +16 -0
- package/dist/components/kpi/snice-kpi.js +162 -0
- package/dist/components/kpi/snice-kpi.js.map +1 -0
- package/dist/components/kpi/snice-kpi.types.d.ts +12 -0
- package/dist/components/layout/snice-layout-blog.d.ts +2 -2
- package/dist/components/layout/snice-layout-blog.js +9 -9
- package/dist/components/layout/snice-layout-blog.js.map +1 -1
- package/dist/components/layout/snice-layout-card.d.ts +2 -2
- package/dist/components/layout/snice-layout-card.js +9 -9
- package/dist/components/layout/snice-layout-card.js.map +1 -1
- package/dist/components/layout/snice-layout-centered.d.ts +2 -2
- package/dist/components/layout/snice-layout-centered.js +9 -9
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-dashboard.d.ts +2 -2
- package/dist/components/layout/snice-layout-dashboard.js +9 -9
- package/dist/components/layout/snice-layout-dashboard.js.map +1 -1
- package/dist/components/layout/snice-layout-fullscreen.d.ts +2 -2
- package/dist/components/layout/snice-layout-fullscreen.js +9 -9
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-landing.d.ts +2 -2
- package/dist/components/layout/snice-layout-landing.js +9 -9
- package/dist/components/layout/snice-layout-landing.js.map +1 -1
- package/dist/components/layout/snice-layout-minimal.d.ts +2 -2
- package/dist/components/layout/snice-layout-minimal.js +9 -9
- package/dist/components/layout/snice-layout-minimal.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.d.ts +2 -2
- package/dist/components/layout/snice-layout-sidebar.js +9 -9
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout-split.d.ts +2 -2
- package/dist/components/layout/snice-layout-split.js +9 -9
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/layout/snice-layout.d.ts +2 -2
- package/dist/components/layout/snice-layout.js +9 -9
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/link/snice-link.d.ts +13 -0
- package/dist/components/link/snice-link.js +137 -0
- package/dist/components/link/snice-link.js.map +1 -0
- package/dist/components/link/snice-link.types.d.ts +11 -0
- package/dist/components/list/snice-list-item.d.ts +6 -0
- package/dist/components/list/snice-list-item.js +68 -0
- package/dist/components/list/snice-list-item.js.map +1 -0
- package/dist/components/list/snice-list.d.ts +23 -0
- package/dist/components/list/snice-list.js +270 -0
- package/dist/components/list/snice-list.js.map +1 -0
- package/dist/components/list/snice-list.types.d.ts +28 -0
- package/dist/components/location/snice-location.d.ts +35 -0
- package/dist/components/location/snice-location.js +238 -0
- package/dist/components/location/snice-location.js.map +1 -0
- package/dist/components/location/snice-location.types.d.ts +35 -0
- package/dist/components/login/snice-login.d.ts +2 -2
- package/dist/components/login/snice-login.js +9 -9
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/menu/snice-menu-divider.d.ts +4 -0
- package/dist/components/menu/snice-menu-divider.js +53 -0
- package/dist/components/menu/snice-menu-divider.js.map +1 -0
- package/dist/components/menu/snice-menu-item.d.ts +10 -0
- package/dist/components/menu/snice-menu-item.js +99 -0
- package/dist/components/menu/snice-menu-item.js.map +1 -0
- package/dist/components/menu/snice-menu-item.types.d.ts +9 -0
- package/dist/components/menu/snice-menu.d.ts +27 -0
- package/dist/components/menu/snice-menu.js +199 -0
- package/dist/components/menu/snice-menu.js.map +1 -0
- package/dist/components/menu/snice-menu.types.d.ts +18 -0
- package/dist/components/modal/snice-modal.d.ts +2 -2
- package/dist/components/modal/snice-modal.js +9 -9
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/nav/snice-nav.js +1 -1
- package/dist/components/nav/snice-nav.js.map +1 -1
- package/dist/components/pagination/snice-pagination.d.ts +2 -2
- package/dist/components/pagination/snice-pagination.js +8 -8
- package/dist/components/pagination/snice-pagination.js.map +1 -1
- package/dist/components/progress/snice-progress.d.ts +2 -2
- package/dist/components/progress/snice-progress.js +9 -9
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/qr-code/qrcode.d.ts +28 -0
- package/dist/components/qr-code/qrcode.js +906 -0
- package/dist/components/qr-code/qrcode.js.map +1 -0
- package/dist/components/qr-code/snice-qr-code.d.ts +35 -0
- package/dist/components/qr-code/snice-qr-code.js +256 -0
- package/dist/components/qr-code/snice-qr-code.js.map +1 -0
- package/dist/components/qr-code/snice-qr-code.types.d.ts +33 -0
- package/dist/components/radio/snice-radio.d.ts +2 -2
- package/dist/components/radio/snice-radio.js +9 -9
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-option.d.ts +2 -2
- package/dist/components/select/snice-option.js +8 -8
- package/dist/components/select/snice-option.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +2 -2
- package/dist/components/select/snice-select.js +9 -9
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.d.ts +2 -2
- package/dist/components/skeleton/snice-skeleton.js +9 -9
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +53 -0
- package/dist/components/slider/snice-slider.js +479 -0
- package/dist/components/slider/snice-slider.js.map +1 -0
- package/dist/components/slider/snice-slider.types.d.ts +26 -0
- package/dist/components/snice-cell-C0slgOpe.js +4 -0
- package/dist/components/snice-cell-C0slgOpe.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.d.ts +21 -0
- package/dist/components/sparkline/snice-sparkline.js +228 -0
- package/dist/components/sparkline/snice-sparkline.js.map +1 -0
- package/dist/components/sparkline/snice-sparkline.types.d.ts +16 -0
- package/dist/components/spinner/snice-spinner.d.ts +10 -0
- package/dist/components/spinner/snice-spinner.js +109 -0
- package/dist/components/spinner/snice-spinner.js.map +1 -0
- package/dist/components/spinner/snice-spinner.types.d.ts +8 -0
- package/dist/components/split-pane/snice-split-pane.d.ts +32 -0
- package/dist/components/split-pane/snice-split-pane.js +191 -0
- package/dist/components/split-pane/snice-split-pane.js.map +1 -0
- package/dist/components/split-pane/snice-split-pane.types.d.ts +19 -0
- package/dist/components/stat/snice-stat.d.ts +14 -0
- package/dist/components/stat/snice-stat.js +140 -0
- package/dist/components/stat/snice-stat.js.map +1 -0
- package/dist/components/stat/snice-stat.types.d.ts +12 -0
- package/dist/components/stepper/snice-stepper-panel.d.ts +8 -0
- package/dist/components/stepper/snice-stepper-panel.js +70 -0
- package/dist/components/stepper/snice-stepper-panel.js.map +1 -0
- package/dist/components/stepper/snice-stepper-panel.types.d.ts +4 -0
- package/dist/components/stepper/snice-stepper.d.ts +15 -0
- package/dist/components/stepper/snice-stepper.js +163 -0
- package/dist/components/stepper/snice-stepper.js.map +1 -0
- package/dist/components/stepper/snice-stepper.types.d.ts +13 -0
- package/dist/components/switch/snice-switch.d.ts +2 -2
- package/dist/components/switch/snice-switch.js +9 -9
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.d.ts +2 -2
- package/dist/components/table/snice-cell-actions.js +9 -9
- package/dist/components/table/snice-cell-actions.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.d.ts +2 -2
- package/dist/components/table/snice-cell-boolean.js +9 -9
- package/dist/components/table/snice-cell-boolean.js.map +1 -1
- package/dist/components/table/snice-cell-color.d.ts +2 -2
- package/dist/components/table/snice-cell-color.js +9 -9
- package/dist/components/table/snice-cell-color.js.map +1 -1
- package/dist/components/table/snice-cell-currency.d.ts +2 -2
- package/dist/components/table/snice-cell-currency.js +9 -9
- package/dist/components/table/snice-cell-currency.js.map +1 -1
- package/dist/components/table/snice-cell-date.d.ts +2 -2
- package/dist/components/table/snice-cell-date.js +9 -9
- package/dist/components/table/snice-cell-date.js.map +1 -1
- package/dist/components/table/snice-cell-duration.d.ts +2 -2
- package/dist/components/table/snice-cell-duration.js +9 -9
- package/dist/components/table/snice-cell-duration.js.map +1 -1
- package/dist/components/table/snice-cell-email.d.ts +2 -2
- package/dist/components/table/snice-cell-email.js +9 -9
- package/dist/components/table/snice-cell-email.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.d.ts +2 -2
- package/dist/components/table/snice-cell-filesize.js +9 -9
- package/dist/components/table/snice-cell-filesize.js.map +1 -1
- package/dist/components/table/snice-cell-image.d.ts +2 -2
- package/dist/components/table/snice-cell-image.js +9 -9
- package/dist/components/table/snice-cell-image.js.map +1 -1
- package/dist/components/table/snice-cell-json.d.ts +2 -2
- package/dist/components/table/snice-cell-json.js +9 -9
- package/dist/components/table/snice-cell-json.js.map +1 -1
- package/dist/components/table/snice-cell-link.d.ts +2 -2
- package/dist/components/table/snice-cell-link.js +9 -9
- package/dist/components/table/snice-cell-link.js.map +1 -1
- package/dist/components/table/snice-cell-location.d.ts +2 -2
- package/dist/components/table/snice-cell-location.js +9 -9
- package/dist/components/table/snice-cell-location.js.map +1 -1
- package/dist/components/table/snice-cell-number.d.ts +2 -2
- package/dist/components/table/snice-cell-number.js +9 -9
- package/dist/components/table/snice-cell-number.js.map +1 -1
- package/dist/components/table/snice-cell-percentage.d.ts +2 -2
- package/dist/components/table/snice-cell-percentage.js +9 -9
- package/dist/components/table/snice-cell-percentage.js.map +1 -1
- package/dist/components/table/snice-cell-phone.d.ts +2 -2
- package/dist/components/table/snice-cell-phone.js +9 -9
- package/dist/components/table/snice-cell-phone.js.map +1 -1
- package/dist/components/table/snice-cell-progress.d.ts +2 -2
- package/dist/components/table/snice-cell-progress.js +9 -9
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.d.ts +2 -2
- package/dist/components/table/snice-cell-rating.js +9 -9
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.d.ts +2 -2
- package/dist/components/table/snice-cell-sparkline.js +9 -9
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.d.ts +2 -2
- package/dist/components/table/snice-cell-status.js +9 -9
- package/dist/components/table/snice-cell-status.js.map +1 -1
- package/dist/components/table/snice-cell-tag.d.ts +2 -2
- package/dist/components/table/snice-cell-tag.js +9 -9
- package/dist/components/table/snice-cell-tag.js.map +1 -1
- package/dist/components/table/snice-cell-text.d.ts +2 -2
- package/dist/components/table/snice-cell-text.js +9 -9
- package/dist/components/table/snice-cell-text.js.map +1 -1
- package/dist/components/table/snice-cell.d.ts +2 -2
- package/dist/components/table/snice-cell.js +9 -9
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-column.d.ts +1 -1
- package/dist/components/table/snice-column.js +4 -4
- package/dist/components/table/snice-column.js.map +1 -1
- package/dist/components/table/snice-header.d.ts +2 -2
- package/dist/components/table/snice-header.js +9 -9
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-progress.d.ts +2 -2
- package/dist/components/table/snice-progress.js +8 -8
- package/dist/components/table/snice-progress.js.map +1 -1
- package/dist/components/table/snice-rating.d.ts +2 -2
- package/dist/components/table/snice-rating.js +8 -8
- package/dist/components/table/snice-rating.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +2 -2
- package/dist/components/table/snice-row.js +10 -10
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +2 -3
- package/dist/components/table/snice-table.js +9 -14
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/tabs/snice-tab-panel.d.ts +2 -2
- package/dist/components/tabs/snice-tab-panel.js +9 -9
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.d.ts +2 -2
- package/dist/components/tabs/snice-tab.js +9 -9
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.d.ts +2 -2
- package/dist/components/tabs/snice-tabs.js +9 -9
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- package/dist/components/terminal/snice-terminal.types.d.ts +133 -0
- package/dist/components/textarea/snice-textarea.d.ts +52 -0
- package/dist/components/textarea/snice-textarea.js +407 -0
- package/dist/components/textarea/snice-textarea.js.map +1 -0
- package/dist/components/textarea/snice-textarea.types.d.ts +30 -0
- package/dist/components/timeline/snice-timeline.d.ts +11 -0
- package/dist/components/timeline/snice-timeline.js +112 -0
- package/dist/components/timeline/snice-timeline.js.map +1 -0
- package/dist/components/timeline/snice-timeline.types.d.ts +16 -0
- package/dist/components/toast/snice-toast-container.d.ts +2 -2
- package/dist/components/toast/snice-toast-container.js +8 -8
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/components/toast/snice-toast.d.ts +2 -2
- package/dist/components/toast/snice-toast.js +8 -8
- package/dist/components/toast/snice-toast.js.map +1 -1
- package/dist/components/tooltip/snice-tooltip.d.ts +2 -2
- package/dist/components/tooltip/snice-tooltip.js +10 -10
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/components/tree/snice-tree-item.d.ts +35 -0
- package/dist/components/tree/snice-tree-item.js +301 -0
- package/dist/components/tree/snice-tree-item.js.map +1 -0
- package/dist/components/tree/snice-tree-item.types.d.ts +30 -0
- package/dist/components/tree/snice-tree.d.ts +45 -0
- package/dist/components/tree/snice-tree.js +390 -0
- package/dist/components/tree/snice-tree.js.map +1 -0
- package/dist/components/tree/snice-tree.types.d.ts +65 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.d.ts +31 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js +160 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.js.map +1 -0
- package/dist/components/virtual-scroller/snice-virtual-scroller.types.d.ts +19 -0
- package/dist/index.cjs +125 -158
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +125 -158
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +125 -158
- package/dist/index.iife.js.map +1 -1
- package/dist/parts.d.ts +13 -16
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/template.d.ts +0 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/README.md +10 -1
- package/docs/ai/components/actions.md +81 -0
- package/docs/ai/components/audio-recorder.md +97 -0
- package/docs/ai/components/banner.md +84 -0
- package/docs/ai/components/calendar.md +95 -0
- package/docs/ai/components/camera.md +130 -0
- package/docs/ai/components/carousel.md +49 -0
- package/docs/ai/components/chart.md +160 -0
- package/docs/ai/components/chat.md +189 -0
- package/docs/ai/components/code-block.md +32 -0
- package/docs/ai/components/color-display.md +48 -0
- package/docs/ai/components/color-picker.md +75 -0
- package/docs/ai/components/command-palette.md +117 -0
- package/docs/ai/components/doc.md +154 -0
- package/docs/ai/components/draw.md +140 -0
- package/docs/ai/components/empty-state.md +72 -0
- package/docs/ai/components/file-upload.md +93 -0
- package/docs/ai/components/gantt.md +95 -0
- package/docs/ai/components/image.md +60 -0
- package/docs/ai/components/kanban.md +102 -0
- package/docs/ai/components/kpi.md +158 -0
- package/docs/ai/components/layout.md +261 -0
- package/docs/ai/components/link.md +77 -0
- package/docs/ai/components/list.md +50 -0
- package/docs/ai/components/location.md +75 -0
- package/docs/ai/components/menu.md +114 -0
- package/docs/ai/components/popover.md +70 -0
- package/docs/ai/components/qr-code.md +106 -0
- package/docs/ai/components/slider.md +87 -0
- package/docs/ai/components/sparkline.md +168 -0
- package/docs/ai/components/spinner.md +47 -0
- package/docs/ai/components/split-pane.md +71 -0
- package/docs/ai/components/stat.md +29 -0
- package/docs/ai/components/stepper.md +216 -0
- package/docs/ai/components/textarea.md +87 -0
- package/docs/ai/components/timeline.md +77 -0
- package/docs/ai/components/tree.md +191 -0
- package/docs/ai/components/virtual-scroller.md +71 -0
- package/docs/components/actions.md +317 -0
- package/docs/components/alert.md +540 -0
- package/docs/components/audio-recorder.md +152 -0
- package/docs/components/badge.md +593 -0
- package/docs/components/banner.md +106 -0
- package/docs/components/breadcrumbs.md +568 -0
- package/docs/components/button.md +648 -0
- package/docs/components/calendar.md +397 -0
- package/docs/components/camera.md +383 -0
- package/docs/components/card.md +778 -0
- package/docs/components/carousel.md +63 -0
- package/docs/components/chart.md +526 -0
- package/docs/components/chat.md +482 -0
- package/docs/components/checkbox.md +714 -0
- package/docs/components/chip.md +670 -0
- package/docs/components/code-block.md +49 -0
- package/docs/components/color-display.md +96 -0
- package/docs/components/color-picker.md +81 -0
- package/docs/components/command-palette.md +159 -0
- package/docs/components/doc.md +357 -0
- package/docs/components/draw.md +307 -0
- package/docs/components/empty-state.md +79 -0
- package/docs/components/file-upload.md +263 -0
- package/docs/components/gantt.md +347 -0
- package/docs/components/image.md +110 -0
- package/docs/components/kanban.md +410 -0
- package/docs/components/kpi.md +251 -0
- package/docs/components/link.md +229 -0
- package/docs/components/list.md +65 -0
- package/docs/components/location.md +369 -0
- package/docs/components/menu.md +633 -0
- package/docs/components/popover.md +333 -0
- package/docs/components/qr-code.md +464 -0
- package/docs/components/slider.md +297 -0
- package/docs/components/sparkline.md +293 -0
- package/docs/components/spinner.md +63 -0
- package/docs/components/split-pane.md +315 -0
- package/docs/components/stat.md +45 -0
- package/docs/components/stepper.md +410 -0
- package/docs/components/textarea.md +235 -0
- package/docs/components/timeline.md +192 -0
- package/docs/components/tree.md +536 -0
- package/docs/components/virtual-scroller.md +298 -0
- package/package.json +2 -1
- package/dist/components/snice-cell-BLFVdxPp.js +0 -4
- package/dist/components/snice-cell-BLFVdxPp.js.map +0 -1
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
# Badge Component
|
|
2
|
+
|
|
3
|
+
The badge component displays notification indicators, status markers, and counts. It can be positioned on other elements or used inline, with support for custom colors, sizes, and animations.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Basic Usage](#basic-usage)
|
|
7
|
+
- [Properties](#properties)
|
|
8
|
+
- [Methods](#methods)
|
|
9
|
+
- [Examples](#examples)
|
|
10
|
+
|
|
11
|
+
## Basic Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!-- Simple text badge -->
|
|
15
|
+
<snice-badge content="New"></snice-badge>
|
|
16
|
+
|
|
17
|
+
<!-- Count badge -->
|
|
18
|
+
<snice-badge count="5"></snice-badge>
|
|
19
|
+
|
|
20
|
+
<!-- Dot indicator -->
|
|
21
|
+
<snice-badge dot></snice-badge>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import 'snice/components/badge/snice-badge';
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Properties
|
|
29
|
+
|
|
30
|
+
| Property | Type | Default | Description |
|
|
31
|
+
|----------|------|---------|-------------|
|
|
32
|
+
| `content` | `string` | `''` | Text content to display |
|
|
33
|
+
| `count` | `number` | `0` | Numeric count to display |
|
|
34
|
+
| `max` | `number` | `99` | Maximum count before showing "99+" |
|
|
35
|
+
| `dot` | `boolean` | `false` | Show as a dot indicator |
|
|
36
|
+
| `variant` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'error' \| 'info'` | `'default'` | Color variant |
|
|
37
|
+
| `position` | `'top-right' \| 'top-left' \| 'bottom-right' \| 'bottom-left'` | `'top-right'` | Position when overlaying an element |
|
|
38
|
+
| `inline` | `boolean` | `false` | Display inline with text |
|
|
39
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Badge size |
|
|
40
|
+
| `pulse` | `boolean` | `false` | Enable pulse animation |
|
|
41
|
+
| `offset` | `number` | `0` | Offset in pixels from default position |
|
|
42
|
+
|
|
43
|
+
## Methods
|
|
44
|
+
|
|
45
|
+
#### `setBadgeContent(content: string): void`
|
|
46
|
+
Set the badge to display text content.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
badge.setBadgeContent('New');
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### `setBadgeCount(count: number): void`
|
|
53
|
+
Set the badge to display a numeric count.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
badge.setBadgeCount(5);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### `showDot(): void`
|
|
60
|
+
Change the badge to dot mode.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
badge.showDot();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### `hide(): void`
|
|
67
|
+
Hide the badge by clearing all content.
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
badge.hide();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Examples
|
|
74
|
+
|
|
75
|
+
### Basic Badges
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<!-- Text content -->
|
|
79
|
+
<snice-badge content="New"></snice-badge>
|
|
80
|
+
<snice-badge content="Pro"></snice-badge>
|
|
81
|
+
<snice-badge content="Beta"></snice-badge>
|
|
82
|
+
|
|
83
|
+
<!-- Numeric count -->
|
|
84
|
+
<snice-badge count="5"></snice-badge>
|
|
85
|
+
<snice-badge count="23"></snice-badge>
|
|
86
|
+
<snice-badge count="150" max="99"></snice-badge>
|
|
87
|
+
|
|
88
|
+
<!-- Dot indicator -->
|
|
89
|
+
<snice-badge dot></snice-badge>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Color Variants
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<snice-badge content="Default" variant="default"></snice-badge>
|
|
96
|
+
<snice-badge content="Primary" variant="primary"></snice-badge>
|
|
97
|
+
<snice-badge content="Success" variant="success"></snice-badge>
|
|
98
|
+
<snice-badge content="Warning" variant="warning"></snice-badge>
|
|
99
|
+
<snice-badge content="Error" variant="error"></snice-badge>
|
|
100
|
+
<snice-badge content="Info" variant="info"></snice-badge>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Badge on Elements
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<style>
|
|
107
|
+
.badge-container {
|
|
108
|
+
position: relative;
|
|
109
|
+
display: inline-block;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
112
|
+
|
|
113
|
+
<!-- On button -->
|
|
114
|
+
<div class="badge-container">
|
|
115
|
+
<button>Messages</button>
|
|
116
|
+
<snice-badge count="3" variant="error"></snice-badge>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<!-- On icon -->
|
|
120
|
+
<div class="badge-container">
|
|
121
|
+
<svg width="24" height="24" viewBox="0 0 24 24">
|
|
122
|
+
<path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z"/>
|
|
123
|
+
</svg>
|
|
124
|
+
<snice-badge count="12" variant="primary"></snice-badge>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- On avatar -->
|
|
128
|
+
<div class="badge-container">
|
|
129
|
+
<img src="avatar.jpg" alt="User" style="width: 48px; height: 48px; border-radius: 50%;">
|
|
130
|
+
<snice-badge dot pulse variant="success"></snice-badge>
|
|
131
|
+
</div>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Different Positions
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<style>
|
|
138
|
+
.position-demo {
|
|
139
|
+
position: relative;
|
|
140
|
+
display: inline-block;
|
|
141
|
+
margin: 2rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.demo-box {
|
|
145
|
+
width: 60px;
|
|
146
|
+
height: 60px;
|
|
147
|
+
background: #e5e7eb;
|
|
148
|
+
border-radius: 8px;
|
|
149
|
+
}
|
|
150
|
+
</style>
|
|
151
|
+
|
|
152
|
+
<!-- Top right (default) -->
|
|
153
|
+
<div class="position-demo">
|
|
154
|
+
<div class="demo-box"></div>
|
|
155
|
+
<snice-badge count="5" position="top-right"></snice-badge>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<!-- Top left -->
|
|
159
|
+
<div class="position-demo">
|
|
160
|
+
<div class="demo-box"></div>
|
|
161
|
+
<snice-badge count="5" position="top-left"></snice-badge>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- Bottom right -->
|
|
165
|
+
<div class="position-demo">
|
|
166
|
+
<div class="demo-box"></div>
|
|
167
|
+
<snice-badge count="5" position="bottom-right"></snice-badge>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
170
|
+
<!-- Bottom left -->
|
|
171
|
+
<div class="position-demo">
|
|
172
|
+
<div class="demo-box"></div>
|
|
173
|
+
<snice-badge count="5" position="bottom-left"></snice-badge>
|
|
174
|
+
</div>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Inline Badges
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<p>
|
|
181
|
+
Status: <snice-badge inline content="Active" variant="success"></snice-badge>
|
|
182
|
+
</p>
|
|
183
|
+
|
|
184
|
+
<p>
|
|
185
|
+
Plan: <snice-badge inline content="Pro" variant="primary"></snice-badge>
|
|
186
|
+
</p>
|
|
187
|
+
|
|
188
|
+
<h3>
|
|
189
|
+
Documentation
|
|
190
|
+
<snice-badge inline content="Beta" variant="warning" size="small"></snice-badge>
|
|
191
|
+
</h3>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Different Sizes
|
|
195
|
+
|
|
196
|
+
```html
|
|
197
|
+
<!-- Small -->
|
|
198
|
+
<snice-badge content="Small" size="small"></snice-badge>
|
|
199
|
+
<snice-badge count="5" size="small" variant="error"></snice-badge>
|
|
200
|
+
<snice-badge dot size="small" variant="primary"></snice-badge>
|
|
201
|
+
|
|
202
|
+
<!-- Medium (default) -->
|
|
203
|
+
<snice-badge content="Medium" size="medium"></snice-badge>
|
|
204
|
+
<snice-badge count="15" size="medium" variant="warning"></snice-badge>
|
|
205
|
+
<snice-badge dot size="medium" variant="success"></snice-badge>
|
|
206
|
+
|
|
207
|
+
<!-- Large -->
|
|
208
|
+
<snice-badge content="Large" size="large"></snice-badge>
|
|
209
|
+
<snice-badge count="99+" size="large" variant="info"></snice-badge>
|
|
210
|
+
<snice-badge dot size="large" variant="error" pulse></snice-badge>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Pulse Animation
|
|
214
|
+
|
|
215
|
+
```html
|
|
216
|
+
<!-- Pulse with dot -->
|
|
217
|
+
<snice-badge dot pulse variant="success"></snice-badge>
|
|
218
|
+
<snice-badge dot pulse variant="error"></snice-badge>
|
|
219
|
+
<snice-badge dot pulse variant="warning"></snice-badge>
|
|
220
|
+
|
|
221
|
+
<!-- Pulse with count -->
|
|
222
|
+
<snice-badge count="3" pulse variant="primary"></snice-badge>
|
|
223
|
+
|
|
224
|
+
<!-- Pulse with content -->
|
|
225
|
+
<snice-badge content="Live" pulse variant="error"></snice-badge>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Notification Counter
|
|
229
|
+
|
|
230
|
+
```html
|
|
231
|
+
<style>
|
|
232
|
+
.nav-item {
|
|
233
|
+
position: relative;
|
|
234
|
+
display: inline-block;
|
|
235
|
+
margin: 0 1rem;
|
|
236
|
+
padding: 0.5rem 1rem;
|
|
237
|
+
background: #f3f4f6;
|
|
238
|
+
border-radius: 0.375rem;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
}
|
|
241
|
+
</style>
|
|
242
|
+
|
|
243
|
+
<nav>
|
|
244
|
+
<div class="nav-item">
|
|
245
|
+
Home
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<div class="nav-item">
|
|
249
|
+
Messages
|
|
250
|
+
<snice-badge count="5" variant="primary"></snice-badge>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<div class="nav-item">
|
|
254
|
+
Notifications
|
|
255
|
+
<snice-badge count="12" variant="error"></snice-badge>
|
|
256
|
+
</div>
|
|
257
|
+
|
|
258
|
+
<div class="nav-item">
|
|
259
|
+
Updates
|
|
260
|
+
<snice-badge dot pulse variant="info"></snice-badge>
|
|
261
|
+
</div>
|
|
262
|
+
</nav>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Dynamic Badge Updates
|
|
266
|
+
|
|
267
|
+
```html
|
|
268
|
+
<div class="badge-container">
|
|
269
|
+
<button id="cart-button">
|
|
270
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
271
|
+
<path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/>
|
|
272
|
+
</svg>
|
|
273
|
+
Cart
|
|
274
|
+
</button>
|
|
275
|
+
<snice-badge id="cart-badge" count="0"></snice-badge>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<button onclick="addToCart()">Add Item</button>
|
|
279
|
+
<button onclick="clearCart()">Clear Cart</button>
|
|
280
|
+
|
|
281
|
+
<script type="module">
|
|
282
|
+
import type { SniceBadgeElement } from 'snice/components/badge/snice-badge.types';
|
|
283
|
+
|
|
284
|
+
let cartCount = 0;
|
|
285
|
+
const badge = document.getElementById('cart-badge') as SniceBadgeElement;
|
|
286
|
+
|
|
287
|
+
window.addToCart = () => {
|
|
288
|
+
cartCount++;
|
|
289
|
+
badge.setBadgeCount(cartCount);
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
window.clearCart = () => {
|
|
293
|
+
cartCount = 0;
|
|
294
|
+
badge.hide();
|
|
295
|
+
};
|
|
296
|
+
</script>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Status Indicators
|
|
300
|
+
|
|
301
|
+
```html
|
|
302
|
+
<style>
|
|
303
|
+
.user-list {
|
|
304
|
+
display: flex;
|
|
305
|
+
flex-direction: column;
|
|
306
|
+
gap: 1rem;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.user-item {
|
|
310
|
+
position: relative;
|
|
311
|
+
display: inline-flex;
|
|
312
|
+
align-items: center;
|
|
313
|
+
gap: 1rem;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.user-avatar {
|
|
317
|
+
position: relative;
|
|
318
|
+
width: 48px;
|
|
319
|
+
height: 48px;
|
|
320
|
+
border-radius: 50%;
|
|
321
|
+
background: #e5e7eb;
|
|
322
|
+
display: flex;
|
|
323
|
+
align-items: center;
|
|
324
|
+
justify-content: center;
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
}
|
|
327
|
+
</style>
|
|
328
|
+
|
|
329
|
+
<div class="user-list">
|
|
330
|
+
<div class="user-item">
|
|
331
|
+
<div class="user-avatar">
|
|
332
|
+
JD
|
|
333
|
+
<snice-badge dot variant="success" position="bottom-right"></snice-badge>
|
|
334
|
+
</div>
|
|
335
|
+
<span>John Doe (Online)</span>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
338
|
+
<div class="user-item">
|
|
339
|
+
<div class="user-avatar">
|
|
340
|
+
JS
|
|
341
|
+
<snice-badge dot variant="warning" position="bottom-right"></snice-badge>
|
|
342
|
+
</div>
|
|
343
|
+
<span>Jane Smith (Away)</span>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<div class="user-item">
|
|
347
|
+
<div class="user-avatar">
|
|
348
|
+
AB
|
|
349
|
+
<snice-badge dot variant="error" position="bottom-right"></snice-badge>
|
|
350
|
+
</div>
|
|
351
|
+
<span>Alice Brown (Busy)</span>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<div class="user-item">
|
|
355
|
+
<div class="user-avatar">
|
|
356
|
+
CD
|
|
357
|
+
</div>
|
|
358
|
+
<span>Charlie Davis (Offline)</span>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Max Count Handling
|
|
364
|
+
|
|
365
|
+
```html
|
|
366
|
+
<div class="badge-container">
|
|
367
|
+
<button>Messages</button>
|
|
368
|
+
<snice-badge id="msg-badge" count="0" max="99" variant="error"></snice-badge>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
<div style="margin-top: 1rem;">
|
|
372
|
+
<button onclick="setCount(5)">5 messages</button>
|
|
373
|
+
<button onclick="setCount(50)">50 messages</button>
|
|
374
|
+
<button onclick="setCount(100)">100 messages</button>
|
|
375
|
+
<button onclick="setCount(500)">500 messages</button>
|
|
376
|
+
</div>
|
|
377
|
+
|
|
378
|
+
<script type="module">
|
|
379
|
+
import type { SniceBadgeElement } from 'snice/components/badge/snice-badge.types';
|
|
380
|
+
|
|
381
|
+
const badge = document.getElementById('msg-badge') as SniceBadgeElement;
|
|
382
|
+
|
|
383
|
+
window.setCount = (count) => {
|
|
384
|
+
badge.setBadgeCount(count);
|
|
385
|
+
};
|
|
386
|
+
</script>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Badge with Custom Offset
|
|
390
|
+
|
|
391
|
+
```html
|
|
392
|
+
<style>
|
|
393
|
+
.icon-container {
|
|
394
|
+
position: relative;
|
|
395
|
+
display: inline-block;
|
|
396
|
+
margin: 2rem;
|
|
397
|
+
}
|
|
398
|
+
</style>
|
|
399
|
+
|
|
400
|
+
<!-- Default offset -->
|
|
401
|
+
<div class="icon-container">
|
|
402
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
403
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
|
|
404
|
+
</svg>
|
|
405
|
+
<snice-badge count="5" variant="error"></snice-badge>
|
|
406
|
+
</div>
|
|
407
|
+
|
|
408
|
+
<!-- With offset -->
|
|
409
|
+
<div class="icon-container">
|
|
410
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
411
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
|
|
412
|
+
</svg>
|
|
413
|
+
<snice-badge count="5" variant="error" offset="5"></snice-badge>
|
|
414
|
+
</div>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Feature Badges
|
|
418
|
+
|
|
419
|
+
```html
|
|
420
|
+
<style>
|
|
421
|
+
.feature-card {
|
|
422
|
+
padding: 1.5rem;
|
|
423
|
+
border: 1px solid #e5e7eb;
|
|
424
|
+
border-radius: 0.5rem;
|
|
425
|
+
max-width: 20rem;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.feature-title {
|
|
429
|
+
display: flex;
|
|
430
|
+
align-items: center;
|
|
431
|
+
gap: 0.5rem;
|
|
432
|
+
margin-bottom: 0.5rem;
|
|
433
|
+
}
|
|
434
|
+
</style>
|
|
435
|
+
|
|
436
|
+
<div class="feature-card">
|
|
437
|
+
<h3 class="feature-title">
|
|
438
|
+
Advanced Analytics
|
|
439
|
+
<snice-badge inline content="New" variant="primary" size="small"></snice-badge>
|
|
440
|
+
</h3>
|
|
441
|
+
<p>Get detailed insights into your data with our new analytics dashboard.</p>
|
|
442
|
+
</div>
|
|
443
|
+
|
|
444
|
+
<div class="feature-card">
|
|
445
|
+
<h3 class="feature-title">
|
|
446
|
+
API Access
|
|
447
|
+
<snice-badge inline content="Pro" variant="warning" size="small"></snice-badge>
|
|
448
|
+
</h3>
|
|
449
|
+
<p>Integrate with your applications using our REST API.</p>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<div class="feature-card">
|
|
453
|
+
<h3 class="feature-title">
|
|
454
|
+
Custom Domains
|
|
455
|
+
<snice-badge inline content="Beta" variant="info" size="small"></snice-badge>
|
|
456
|
+
</h3>
|
|
457
|
+
<p>Use your own domain name for your hosted content.</p>
|
|
458
|
+
</div>
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### Unread Messages Indicator
|
|
462
|
+
|
|
463
|
+
```html
|
|
464
|
+
<style>
|
|
465
|
+
.message-thread {
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: center;
|
|
468
|
+
gap: 1rem;
|
|
469
|
+
padding: 1rem;
|
|
470
|
+
border-bottom: 1px solid #e5e7eb;
|
|
471
|
+
cursor: pointer;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.message-thread:hover {
|
|
475
|
+
background: #f9fafb;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.thread-avatar {
|
|
479
|
+
position: relative;
|
|
480
|
+
width: 40px;
|
|
481
|
+
height: 40px;
|
|
482
|
+
border-radius: 50%;
|
|
483
|
+
background: #3b82f6;
|
|
484
|
+
color: white;
|
|
485
|
+
display: flex;
|
|
486
|
+
align-items: center;
|
|
487
|
+
justify-content: center;
|
|
488
|
+
font-weight: 600;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.thread-content {
|
|
492
|
+
flex: 1;
|
|
493
|
+
}
|
|
494
|
+
</style>
|
|
495
|
+
|
|
496
|
+
<div class="message-thread">
|
|
497
|
+
<div class="thread-avatar">
|
|
498
|
+
A
|
|
499
|
+
<snice-badge count="3" variant="error" size="small"></snice-badge>
|
|
500
|
+
</div>
|
|
501
|
+
<div class="thread-content">
|
|
502
|
+
<strong>Alice</strong>
|
|
503
|
+
<p style="margin: 0; color: #6b7280;">Hey, are you available for a call?</p>
|
|
504
|
+
</div>
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<div class="message-thread">
|
|
508
|
+
<div class="thread-avatar">
|
|
509
|
+
B
|
|
510
|
+
<snice-badge count="1" variant="error" size="small"></snice-badge>
|
|
511
|
+
</div>
|
|
512
|
+
<div class="thread-content">
|
|
513
|
+
<strong>Bob</strong>
|
|
514
|
+
<p style="margin: 0; color: #6b7280;">I've sent you the files.</p>
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
|
|
518
|
+
<div class="message-thread">
|
|
519
|
+
<div class="thread-avatar">C</div>
|
|
520
|
+
<div class="thread-content">
|
|
521
|
+
<strong>Charlie</strong>
|
|
522
|
+
<p style="margin: 0; color: #9ca3af;">Thanks for your help!</p>
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
## Accessibility
|
|
528
|
+
|
|
529
|
+
- **ARIA role**: Badge has `role="status"` for screen reader announcements
|
|
530
|
+
- **ARIA label**: Descriptive labels for badge content
|
|
531
|
+
- **Color contrast**: All variants meet WCAG AA standards
|
|
532
|
+
- **Screen reader friendly**: Content is properly announced
|
|
533
|
+
|
|
534
|
+
## Browser Support
|
|
535
|
+
|
|
536
|
+
- Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
537
|
+
- Requires Custom Elements v1 and Shadow DOM support
|
|
538
|
+
|
|
539
|
+
## Best Practices
|
|
540
|
+
|
|
541
|
+
1. **Use appropriate variants**: Choose colors that match the badge meaning
|
|
542
|
+
2. **Keep content short**: 1-3 characters work best for badges
|
|
543
|
+
3. **Set reasonable max values**: Default max of 99 works well for most cases
|
|
544
|
+
4. **Use dot for simple indicators**: When exact count isn't needed
|
|
545
|
+
5. **Position appropriately**: Ensure badges don't obscure important content
|
|
546
|
+
6. **Avoid overuse**: Too many badges can reduce their effectiveness
|
|
547
|
+
7. **Make badges clickable if needed**: Wrap in button or link when actionable
|
|
548
|
+
8. **Test with long counts**: Ensure layout handles 99+ properly
|
|
549
|
+
9. **Use pulse sparingly**: Reserve for important notifications
|
|
550
|
+
10. **Consider accessibility**: Ensure badge content is announced to screen readers
|
|
551
|
+
|
|
552
|
+
## Common Patterns
|
|
553
|
+
|
|
554
|
+
### Notification Badge
|
|
555
|
+
```html
|
|
556
|
+
<div class="badge-container">
|
|
557
|
+
<button>Notifications</button>
|
|
558
|
+
<snice-badge count="5" variant="error"></snice-badge>
|
|
559
|
+
</div>
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
### Status Indicator
|
|
563
|
+
```html
|
|
564
|
+
<div class="badge-container">
|
|
565
|
+
<img src="avatar.jpg" alt="User">
|
|
566
|
+
<snice-badge dot variant="success"></snice-badge>
|
|
567
|
+
</div>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
### Feature Label
|
|
571
|
+
```html
|
|
572
|
+
<h3>
|
|
573
|
+
Premium Feature
|
|
574
|
+
<snice-badge inline content="Pro" variant="warning" size="small"></snice-badge>
|
|
575
|
+
</h3>
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
### Count with Max
|
|
579
|
+
```html
|
|
580
|
+
<snice-badge count="150" max="99"></snice-badge>
|
|
581
|
+
<!-- Displays as "99+" -->
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
## Variant Colors
|
|
585
|
+
|
|
586
|
+
| Variant | Color Scheme | Use Case |
|
|
587
|
+
|---------|-------------|----------|
|
|
588
|
+
| `default` | Gray | Neutral information |
|
|
589
|
+
| `primary` | Blue | Primary actions, branding |
|
|
590
|
+
| `success` | Green | Positive status, confirmations |
|
|
591
|
+
| `warning` | Orange | Warnings, important notices |
|
|
592
|
+
| `error` | Red | Errors, urgent notifications |
|
|
593
|
+
| `info` | Light blue | Informational content |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Banner Component
|
|
2
|
+
|
|
3
|
+
The `<snice-banner>` component displays fixed-position notification banners at the top or bottom of the viewport.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-banner
|
|
9
|
+
variant="info"
|
|
10
|
+
message="This is an informational message"
|
|
11
|
+
open
|
|
12
|
+
></snice-banner>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Type | Default | Description |
|
|
18
|
+
|----------|------|---------|-------------|
|
|
19
|
+
| `variant` | `'info' \| 'success' \| 'warning' \| 'error'` | `'info'` | Visual variant |
|
|
20
|
+
| `position` | `'top' \| 'bottom'` | `'top'` | Position on screen |
|
|
21
|
+
| `message` | `string` | `''` | Banner message |
|
|
22
|
+
| `dismissible` | `boolean` | `true` | Show close button |
|
|
23
|
+
| `icon` | `string` | `''` | Custom icon (default icons per variant) |
|
|
24
|
+
| `actionText` | `string` | `''` | Action button text |
|
|
25
|
+
| `open` | `boolean` | `false` | Banner visibility |
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
### `show(): void`
|
|
30
|
+
Show the banner.
|
|
31
|
+
|
|
32
|
+
### `hide(): void`
|
|
33
|
+
Hide the banner.
|
|
34
|
+
|
|
35
|
+
### `toggle(): void`
|
|
36
|
+
Toggle banner visibility.
|
|
37
|
+
|
|
38
|
+
## Events
|
|
39
|
+
|
|
40
|
+
### `@snice/banner-open`
|
|
41
|
+
Fired when banner opens.
|
|
42
|
+
|
|
43
|
+
### `@snice/banner-close`
|
|
44
|
+
Fired when banner closes.
|
|
45
|
+
|
|
46
|
+
### `@snice/banner-action`
|
|
47
|
+
Fired when action button is clicked.
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### Variants
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<snice-banner variant="info" message="Info message" open></snice-banner>
|
|
55
|
+
<snice-banner variant="success" message="Success!" open></snice-banner>
|
|
56
|
+
<snice-banner variant="warning" message="Warning" open></snice-banner>
|
|
57
|
+
<snice-banner variant="error" message="Error occurred" open></snice-banner>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### With Action Button
|
|
61
|
+
|
|
62
|
+
```html
|
|
63
|
+
<snice-banner
|
|
64
|
+
message="A new version is available"
|
|
65
|
+
action-text="Update Now"
|
|
66
|
+
open
|
|
67
|
+
></snice-banner>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
document.querySelector('snice-banner').addEventListener('@snice/banner-action', () => {
|
|
71
|
+
console.log('Update clicked');
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Bottom Position
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<snice-banner
|
|
80
|
+
position="bottom"
|
|
81
|
+
message="Cookie notice"
|
|
82
|
+
action-text="Accept"
|
|
83
|
+
open
|
|
84
|
+
></snice-banner>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Not Dismissible
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<snice-banner
|
|
91
|
+
message="Maintenance mode active"
|
|
92
|
+
dismissible="false"
|
|
93
|
+
variant="warning"
|
|
94
|
+
open
|
|
95
|
+
></snice-banner>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Programmatic Control
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<snice-banner id="myBanner" message="Hello"></snice-banner>
|
|
102
|
+
|
|
103
|
+
<button onclick="myBanner.show()">Show</button>
|
|
104
|
+
<button onclick="myBanner.hide()">Hide</button>
|
|
105
|
+
<button onclick="myBanner.toggle()">Toggle</button>
|
|
106
|
+
```
|