snice 3.2.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/dist/components/accordion/snice-accordion-item.d.ts +2 -2
- package/dist/components/accordion/snice-accordion-item.js +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +9 -9
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/banner/snice-banner.d.ts +2 -2
- package/dist/components/banner/snice-banner.js +8 -8
- package/dist/components/banner/snice-banner.js.map +1 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.d.ts +2 -2
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +2 -2
- package/dist/components/color-display/snice-color-display.js +9 -9
- package/dist/components/color-display/snice-color-display.js.map +1 -1
- package/dist/components/color-picker/snice-color-picker.d.ts +2 -2
- package/dist/components/color-picker/snice-color-picker.js +8 -8
- package/dist/components/color-picker/snice-color-picker.js.map +1 -1
- 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 +9 -9
- 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 +8 -8
- 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 +8 -8
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/empty-state/snice-empty-state.d.ts +2 -2
- package/dist/components/empty-state/snice-empty-state.js +8 -8
- package/dist/components/empty-state/snice-empty-state.js.map +1 -1
- package/dist/components/file-upload/snice-file-upload.d.ts +2 -3
- package/dist/components/file-upload/snice-file-upload.js +8 -15
- package/dist/components/file-upload/snice-file-upload.js.map +1 -1
- 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 +2 -2
- package/dist/components/image/snice-image.js +9 -9
- package/dist/components/image/snice-image.js.map +1 -1
- package/dist/components/input/snice-input.d.ts +2 -2
- package/dist/components/input/snice-input.js +8 -8
- 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 +2 -2
- package/dist/components/kpi/snice-kpi.js +10 -10
- package/dist/components/kpi/snice-kpi.js.map +1 -1
- package/dist/components/layout/snice-layout-blog.d.ts +2 -2
- package/dist/components/layout/snice-layout-blog.js +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- package/dist/components/layout/snice-layout.js.map +1 -1
- package/dist/components/link/snice-link.d.ts +2 -2
- package/dist/components/link/snice-link.js +9 -9
- package/dist/components/link/snice-link.js.map +1 -1
- 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 +8 -8
- 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 +8 -8
- package/dist/components/modal/snice-modal.js.map +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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/slider/snice-slider.d.ts +2 -2
- package/dist/components/slider/snice-slider.js +8 -8
- package/dist/components/slider/snice-slider.js.map +1 -1
- package/dist/components/sparkline/snice-sparkline.d.ts +2 -2
- package/dist/components/sparkline/snice-sparkline.js +9 -9
- package/dist/components/sparkline/snice-sparkline.js.map +1 -1
- package/dist/components/spinner/snice-spinner.d.ts +2 -2
- package/dist/components/spinner/snice-spinner.js +9 -9
- package/dist/components/spinner/snice-spinner.js.map +1 -1
- 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 +2 -2
- package/dist/components/stepper/snice-stepper-panel.js +9 -9
- package/dist/components/stepper/snice-stepper-panel.js.map +1 -1
- package/dist/components/stepper/snice-stepper.d.ts +2 -2
- package/dist/components/stepper/snice-stepper.js +9 -9
- package/dist/components/stepper/snice-stepper.js.map +1 -1
- package/dist/components/switch/snice-switch.d.ts +2 -2
- package/dist/components/switch/snice-switch.js +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +8 -13
- 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 +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +2 -2
- package/dist/components/textarea/snice-textarea.js +8 -8
- package/dist/components/textarea/snice-textarea.js.map +1 -1
- package/dist/components/timeline/snice-timeline.d.ts +1 -1
- package/dist/components/timeline/snice-timeline.js +5 -5
- package/dist/components/timeline/snice-timeline.js.map +1 -1
- 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 +8 -8
- 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 +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/components/actions.md +81 -0
- package/docs/ai/components/audio-recorder.md +97 -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/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/gantt.md +95 -0
- package/docs/ai/components/kanban.md +102 -0
- package/docs/ai/components/layout.md +261 -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/split-pane.md +71 -0
- package/docs/ai/components/stat.md +29 -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/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/command-palette.md +159 -0
- package/docs/components/doc.md +357 -0
- package/docs/components/draw.md +307 -0
- package/docs/components/gantt.md +347 -0
- package/docs/components/kanban.md +410 -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/split-pane.md +315 -0
- package/docs/components/stat.md +45 -0
- package/docs/components/tree.md +536 -0
- package/docs/components/virtual-scroller.md +298 -0
- package/package.json +1 -1
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
# Chip Component
|
|
2
|
+
|
|
3
|
+
The chip component provides compact elements for tags, filters, selections, or categorizations. It supports icons, avatars, removable states, and multiple visual variants.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Basic Usage](#basic-usage)
|
|
7
|
+
- [Properties](#properties)
|
|
8
|
+
- [Events](#events)
|
|
9
|
+
- [Examples](#examples)
|
|
10
|
+
|
|
11
|
+
## Basic Usage
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<snice-chip label="Tag"></snice-chip>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import 'snice/components/chip/snice-chip';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Type | Default | Description |
|
|
24
|
+
|----------|------|---------|-------------|
|
|
25
|
+
| `label` | `string` | `''` | Text label for the chip |
|
|
26
|
+
| `variant` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'error' \| 'info'` | `'default'` | Color variant |
|
|
27
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Chip size |
|
|
28
|
+
| `removable` | `boolean` | `false` | Show remove button |
|
|
29
|
+
| `selected` | `boolean` | `false` | Show selected state |
|
|
30
|
+
| `disabled` | `boolean` | `false` | Disable the chip |
|
|
31
|
+
| `icon` | `string` | `''` | Icon text/emoji to display |
|
|
32
|
+
| `avatar` | `string` | `''` | Avatar image URL |
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
|
|
36
|
+
#### `click`
|
|
37
|
+
Fired when the chip is clicked (not the remove button).
|
|
38
|
+
|
|
39
|
+
**Usage:**
|
|
40
|
+
```typescript
|
|
41
|
+
chip.addEventListener('click', () => {
|
|
42
|
+
console.log('Chip clicked');
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `remove`
|
|
47
|
+
Fired when the remove button is clicked.
|
|
48
|
+
|
|
49
|
+
**Usage:**
|
|
50
|
+
```typescript
|
|
51
|
+
chip.addEventListener('remove', () => {
|
|
52
|
+
chip.remove(); // Remove from DOM
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Examples
|
|
57
|
+
|
|
58
|
+
### Basic Chips
|
|
59
|
+
|
|
60
|
+
```html
|
|
61
|
+
<snice-chip label="Default"></snice-chip>
|
|
62
|
+
<snice-chip label="Technology"></snice-chip>
|
|
63
|
+
<snice-chip label="Design"></snice-chip>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Color Variants
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<snice-chip label="Default" variant="default"></snice-chip>
|
|
70
|
+
<snice-chip label="Primary" variant="primary"></snice-chip>
|
|
71
|
+
<snice-chip label="Success" variant="success"></snice-chip>
|
|
72
|
+
<snice-chip label="Warning" variant="warning"></snice-chip>
|
|
73
|
+
<snice-chip label="Error" variant="error"></snice-chip>
|
|
74
|
+
<snice-chip label="Info" variant="info"></snice-chip>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Chip Sizes
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<snice-chip label="Small" size="small"></snice-chip>
|
|
81
|
+
<snice-chip label="Medium" size="medium"></snice-chip>
|
|
82
|
+
<snice-chip label="Large" size="large"></snice-chip>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Removable Chips
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<snice-chip label="Remove me" removable></snice-chip>
|
|
89
|
+
|
|
90
|
+
<snice-chip
|
|
91
|
+
id="removable-chip"
|
|
92
|
+
label="Click X to remove"
|
|
93
|
+
removable
|
|
94
|
+
variant="primary">
|
|
95
|
+
</snice-chip>
|
|
96
|
+
|
|
97
|
+
<script type="module">
|
|
98
|
+
const chip = document.getElementById('removable-chip');
|
|
99
|
+
chip.addEventListener('remove', () => {
|
|
100
|
+
chip.remove();
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Chips with Icons
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<snice-chip label="Favorite" icon="★" variant="warning"></snice-chip>
|
|
109
|
+
<snice-chip label="Home" icon="🏠" variant="primary"></snice-chip>
|
|
110
|
+
<snice-chip label="Settings" icon="⚙️" variant="default"></snice-chip>
|
|
111
|
+
<snice-chip label="Email" icon="📧" variant="info"></snice-chip>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Chips with Avatars
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<snice-chip
|
|
118
|
+
label="John Doe"
|
|
119
|
+
avatar="https://via.placeholder.com/32"
|
|
120
|
+
removable>
|
|
121
|
+
</snice-chip>
|
|
122
|
+
|
|
123
|
+
<snice-chip
|
|
124
|
+
label="Jane Smith"
|
|
125
|
+
avatar="https://via.placeholder.com/32/FF6B6B"
|
|
126
|
+
removable>
|
|
127
|
+
</snice-chip>
|
|
128
|
+
|
|
129
|
+
<snice-chip
|
|
130
|
+
label="Alice Brown"
|
|
131
|
+
avatar="https://via.placeholder.com/32/4ECDC4"
|
|
132
|
+
removable>
|
|
133
|
+
</snice-chip>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Selected State
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<snice-chip label="Option 1" selected></snice-chip>
|
|
140
|
+
<snice-chip label="Option 2"></snice-chip>
|
|
141
|
+
<snice-chip label="Option 3"></snice-chip>
|
|
142
|
+
|
|
143
|
+
<script type="module">
|
|
144
|
+
const chips = document.querySelectorAll('snice-chip');
|
|
145
|
+
chips.forEach(chip => {
|
|
146
|
+
chip.addEventListener('click', () => {
|
|
147
|
+
chips.forEach(c => c.selected = false);
|
|
148
|
+
chip.selected = true;
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
</script>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Disabled Chips
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<snice-chip label="Disabled" disabled></snice-chip>
|
|
158
|
+
<snice-chip label="Disabled Removable" removable disabled></snice-chip>
|
|
159
|
+
<snice-chip label="Disabled Selected" selected disabled></snice-chip>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Tag List
|
|
163
|
+
|
|
164
|
+
```html
|
|
165
|
+
<style>
|
|
166
|
+
.tag-container {
|
|
167
|
+
display: flex;
|
|
168
|
+
flex-wrap: wrap;
|
|
169
|
+
gap: 0.5rem;
|
|
170
|
+
}
|
|
171
|
+
</style>
|
|
172
|
+
|
|
173
|
+
<div class="tag-container">
|
|
174
|
+
<snice-chip label="JavaScript" variant="warning" removable></snice-chip>
|
|
175
|
+
<snice-chip label="TypeScript" variant="primary" removable></snice-chip>
|
|
176
|
+
<snice-chip label="React" variant="info" removable></snice-chip>
|
|
177
|
+
<snice-chip label="Vue" variant="success" removable></snice-chip>
|
|
178
|
+
<snice-chip label="Angular" variant="error" removable></snice-chip>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<script type="module">
|
|
182
|
+
const chips = document.querySelectorAll('.tag-container snice-chip');
|
|
183
|
+
chips.forEach(chip => {
|
|
184
|
+
chip.addEventListener('remove', () => {
|
|
185
|
+
chip.remove();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
</script>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Filter Chips
|
|
192
|
+
|
|
193
|
+
```html
|
|
194
|
+
<style>
|
|
195
|
+
.filter-section {
|
|
196
|
+
margin-bottom: 1.5rem;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.filter-title {
|
|
200
|
+
font-weight: 600;
|
|
201
|
+
margin-bottom: 0.75rem;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.filter-chips {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-wrap: wrap;
|
|
207
|
+
gap: 0.5rem;
|
|
208
|
+
}
|
|
209
|
+
</style>
|
|
210
|
+
|
|
211
|
+
<div class="filter-section">
|
|
212
|
+
<div class="filter-title">Category</div>
|
|
213
|
+
<div class="filter-chips">
|
|
214
|
+
<snice-chip id="cat-electronics" label="Electronics"></snice-chip>
|
|
215
|
+
<snice-chip id="cat-clothing" label="Clothing"></snice-chip>
|
|
216
|
+
<snice-chip id="cat-books" label="Books"></snice-chip>
|
|
217
|
+
<snice-chip id="cat-home" label="Home & Garden"></snice-chip>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="filter-section">
|
|
222
|
+
<div class="filter-title">Price</div>
|
|
223
|
+
<div class="filter-chips">
|
|
224
|
+
<snice-chip id="price-1" label="Under $25"></snice-chip>
|
|
225
|
+
<snice-chip id="price-2" label="$25-$50"></snice-chip>
|
|
226
|
+
<snice-chip id="price-3" label="$50-$100"></snice-chip>
|
|
227
|
+
<snice-chip id="price-4" label="Over $100"></snice-chip>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<script type="module">
|
|
232
|
+
import type { SniceChipElement } from 'snice/components/chip/snice-chip.types';
|
|
233
|
+
|
|
234
|
+
const filterChips = document.querySelectorAll('.filter-chips snice-chip') as NodeListOf<SniceChipElement>;
|
|
235
|
+
|
|
236
|
+
filterChips.forEach(chip => {
|
|
237
|
+
chip.addEventListener('click', () => {
|
|
238
|
+
chip.selected = !chip.selected;
|
|
239
|
+
console.log('Filters:', Array.from(filterChips)
|
|
240
|
+
.filter(c => c.selected)
|
|
241
|
+
.map(c => c.label));
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
</script>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Contact Chips
|
|
248
|
+
|
|
249
|
+
```html
|
|
250
|
+
<style>
|
|
251
|
+
.contacts {
|
|
252
|
+
display: flex;
|
|
253
|
+
flex-wrap: wrap;
|
|
254
|
+
gap: 0.5rem;
|
|
255
|
+
max-width: 600px;
|
|
256
|
+
}
|
|
257
|
+
</style>
|
|
258
|
+
|
|
259
|
+
<div>
|
|
260
|
+
<h4>To:</h4>
|
|
261
|
+
<div class="contacts" id="recipients"></div>
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
<script type="module">
|
|
265
|
+
import 'snice/components/chip/snice-chip';
|
|
266
|
+
|
|
267
|
+
const contacts = [
|
|
268
|
+
{ name: 'John Doe', email: 'john@example.com', avatar: 'https://via.placeholder.com/32' },
|
|
269
|
+
{ name: 'Jane Smith', email: 'jane@example.com', avatar: 'https://via.placeholder.com/32/FF6B6B' },
|
|
270
|
+
{ name: 'Bob Johnson', email: 'bob@example.com', avatar: 'https://via.placeholder.com/32/4ECDC4' }
|
|
271
|
+
];
|
|
272
|
+
|
|
273
|
+
const container = document.getElementById('recipients');
|
|
274
|
+
|
|
275
|
+
contacts.forEach(contact => {
|
|
276
|
+
const chip = document.createElement('snice-chip');
|
|
277
|
+
chip.label = contact.name;
|
|
278
|
+
chip.avatar = contact.avatar;
|
|
279
|
+
chip.removable = true;
|
|
280
|
+
|
|
281
|
+
chip.addEventListener('remove', () => {
|
|
282
|
+
chip.remove();
|
|
283
|
+
console.log('Removed:', contact.name);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
container.appendChild(chip);
|
|
287
|
+
});
|
|
288
|
+
</script>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Status Chips
|
|
292
|
+
|
|
293
|
+
```html
|
|
294
|
+
<style>
|
|
295
|
+
.status-list {
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
gap: 1rem;
|
|
299
|
+
max-width: 400px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.status-item {
|
|
303
|
+
display: flex;
|
|
304
|
+
justify-content: space-between;
|
|
305
|
+
align-items: center;
|
|
306
|
+
padding: 1rem;
|
|
307
|
+
border: 1px solid #e5e7eb;
|
|
308
|
+
border-radius: 0.5rem;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.status-info h4 {
|
|
312
|
+
margin: 0 0 0.25rem;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.status-info p {
|
|
316
|
+
margin: 0;
|
|
317
|
+
color: #6b7280;
|
|
318
|
+
font-size: 0.875rem;
|
|
319
|
+
}
|
|
320
|
+
</style>
|
|
321
|
+
|
|
322
|
+
<div class="status-list">
|
|
323
|
+
<div class="status-item">
|
|
324
|
+
<div class="status-info">
|
|
325
|
+
<h4>Order #1234</h4>
|
|
326
|
+
<p>Placed 2 hours ago</p>
|
|
327
|
+
</div>
|
|
328
|
+
<snice-chip label="Processing" variant="warning" size="small"></snice-chip>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
<div class="status-item">
|
|
332
|
+
<div class="status-info">
|
|
333
|
+
<h4>Order #1235</h4>
|
|
334
|
+
<p>Placed yesterday</p>
|
|
335
|
+
</div>
|
|
336
|
+
<snice-chip label="Shipped" variant="info" size="small"></snice-chip>
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
<div class="status-item">
|
|
340
|
+
<div class="status-info">
|
|
341
|
+
<h4>Order #1236</h4>
|
|
342
|
+
<p>Placed 3 days ago</p>
|
|
343
|
+
</div>
|
|
344
|
+
<snice-chip label="Delivered" variant="success" size="small"></snice-chip>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<div class="status-item">
|
|
348
|
+
<div class="status-info">
|
|
349
|
+
<h4>Order #1237</h4>
|
|
350
|
+
<p>Placed last week</p>
|
|
351
|
+
</div>
|
|
352
|
+
<snice-chip label="Cancelled" variant="error" size="small"></snice-chip>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Skill Tags
|
|
358
|
+
|
|
359
|
+
```html
|
|
360
|
+
<style>
|
|
361
|
+
.profile-section {
|
|
362
|
+
max-width: 600px;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.skills {
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-wrap: wrap;
|
|
368
|
+
gap: 0.5rem;
|
|
369
|
+
margin-top: 0.75rem;
|
|
370
|
+
}
|
|
371
|
+
</style>
|
|
372
|
+
|
|
373
|
+
<div class="profile-section">
|
|
374
|
+
<h3>Skills</h3>
|
|
375
|
+
<div class="skills" id="skill-list"></div>
|
|
376
|
+
<button id="add-skill" style="margin-top: 1rem;">Add Skill</button>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<script type="module">
|
|
380
|
+
import 'snice/components/chip/snice-chip';
|
|
381
|
+
|
|
382
|
+
const skillsList = document.getElementById('skill-list');
|
|
383
|
+
const addButton = document.getElementById('add-skill');
|
|
384
|
+
|
|
385
|
+
const availableSkills = ['JavaScript', 'Python', 'Java', 'C++', 'React', 'Vue', 'Node.js', 'Docker'];
|
|
386
|
+
let currentSkills = ['JavaScript', 'React', 'Node.js'];
|
|
387
|
+
|
|
388
|
+
function renderSkills() {
|
|
389
|
+
skillsList.innerHTML = '';
|
|
390
|
+
currentSkills.forEach(skill => {
|
|
391
|
+
const chip = document.createElement('snice-chip');
|
|
392
|
+
chip.label = skill;
|
|
393
|
+
chip.variant = 'primary';
|
|
394
|
+
chip.removable = true;
|
|
395
|
+
|
|
396
|
+
chip.addEventListener('remove', () => {
|
|
397
|
+
currentSkills = currentSkills.filter(s => s !== skill);
|
|
398
|
+
renderSkills();
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
skillsList.appendChild(chip);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
addButton.addEventListener('click', () => {
|
|
406
|
+
const skill = prompt('Enter skill name:');
|
|
407
|
+
if (skill && !currentSkills.includes(skill)) {
|
|
408
|
+
currentSkills.push(skill);
|
|
409
|
+
renderSkills();
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
renderSkills();
|
|
414
|
+
</script>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Interactive Selection
|
|
418
|
+
|
|
419
|
+
```html
|
|
420
|
+
<style>
|
|
421
|
+
.selection-group {
|
|
422
|
+
margin-bottom: 2rem;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.selection-group h4 {
|
|
426
|
+
margin-bottom: 0.75rem;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.chip-group {
|
|
430
|
+
display: flex;
|
|
431
|
+
flex-wrap: wrap;
|
|
432
|
+
gap: 0.5rem;
|
|
433
|
+
}
|
|
434
|
+
</style>
|
|
435
|
+
|
|
436
|
+
<div class="selection-group">
|
|
437
|
+
<h4>Select your preferred language:</h4>
|
|
438
|
+
<div class="chip-group" id="language-group">
|
|
439
|
+
<snice-chip label="English"></snice-chip>
|
|
440
|
+
<snice-chip label="Spanish"></snice-chip>
|
|
441
|
+
<snice-chip label="French"></snice-chip>
|
|
442
|
+
<snice-chip label="German"></snice-chip>
|
|
443
|
+
<snice-chip label="Chinese"></snice-chip>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div class="selection-group">
|
|
448
|
+
<h4>Select topics of interest (multiple):</h4>
|
|
449
|
+
<div class="chip-group" id="topics-group">
|
|
450
|
+
<snice-chip label="Technology"></snice-chip>
|
|
451
|
+
<snice-chip label="Science"></snice-chip>
|
|
452
|
+
<snice-chip label="Arts"></snice-chip>
|
|
453
|
+
<snice-chip label="Sports"></snice-chip>
|
|
454
|
+
<snice-chip label="Music"></snice-chip>
|
|
455
|
+
<snice-chip label="Travel"></snice-chip>
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
|
|
459
|
+
<script type="module">
|
|
460
|
+
import type { SniceChipElement } from 'snice/components/chip/snice-chip.types';
|
|
461
|
+
|
|
462
|
+
// Single selection for language
|
|
463
|
+
const languageChips = document.querySelectorAll('#language-group snice-chip') as NodeListOf<SniceChipElement>;
|
|
464
|
+
languageChips.forEach(chip => {
|
|
465
|
+
chip.addEventListener('click', () => {
|
|
466
|
+
languageChips.forEach(c => c.selected = false);
|
|
467
|
+
chip.selected = true;
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
// Multiple selection for topics
|
|
472
|
+
const topicChips = document.querySelectorAll('#topics-group snice-chip') as NodeListOf<SniceChipElement>;
|
|
473
|
+
topicChips.forEach(chip => {
|
|
474
|
+
chip.addEventListener('click', () => {
|
|
475
|
+
chip.selected = !chip.selected;
|
|
476
|
+
});
|
|
477
|
+
});
|
|
478
|
+
</script>
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Search Result Tags
|
|
482
|
+
|
|
483
|
+
```html
|
|
484
|
+
<style>
|
|
485
|
+
.search-results {
|
|
486
|
+
display: flex;
|
|
487
|
+
flex-direction: column;
|
|
488
|
+
gap: 1rem;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.result-item {
|
|
492
|
+
padding: 1rem;
|
|
493
|
+
border: 1px solid #e5e7eb;
|
|
494
|
+
border-radius: 0.5rem;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.result-title {
|
|
498
|
+
margin: 0 0 0.5rem;
|
|
499
|
+
font-size: 1.125rem;
|
|
500
|
+
font-weight: 600;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.result-tags {
|
|
504
|
+
display: flex;
|
|
505
|
+
flex-wrap: wrap;
|
|
506
|
+
gap: 0.25rem;
|
|
507
|
+
margin-top: 0.5rem;
|
|
508
|
+
}
|
|
509
|
+
</style>
|
|
510
|
+
|
|
511
|
+
<div class="search-results">
|
|
512
|
+
<div class="result-item">
|
|
513
|
+
<h3 class="result-title">Getting Started with Web Components</h3>
|
|
514
|
+
<p>Learn how to build reusable components...</p>
|
|
515
|
+
<div class="result-tags">
|
|
516
|
+
<snice-chip label="Tutorial" variant="primary" size="small"></snice-chip>
|
|
517
|
+
<snice-chip label="JavaScript" variant="info" size="small"></snice-chip>
|
|
518
|
+
<snice-chip label="Web Components" variant="success" size="small"></snice-chip>
|
|
519
|
+
</div>
|
|
520
|
+
</div>
|
|
521
|
+
|
|
522
|
+
<div class="result-item">
|
|
523
|
+
<h3 class="result-title">Advanced TypeScript Patterns</h3>
|
|
524
|
+
<p>Explore advanced type system features...</p>
|
|
525
|
+
<div class="result-tags">
|
|
526
|
+
<snice-chip label="Advanced" variant="warning" size="small"></snice-chip>
|
|
527
|
+
<snice-chip label="TypeScript" variant="primary" size="small"></snice-chip>
|
|
528
|
+
<snice-chip label="Patterns" variant="default" size="small"></snice-chip>
|
|
529
|
+
</div>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
### Active Filters Display
|
|
535
|
+
|
|
536
|
+
```html
|
|
537
|
+
<style>
|
|
538
|
+
.active-filters {
|
|
539
|
+
padding: 1rem;
|
|
540
|
+
background: #f9fafb;
|
|
541
|
+
border-radius: 0.5rem;
|
|
542
|
+
margin-bottom: 1rem;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.filters-header {
|
|
546
|
+
display: flex;
|
|
547
|
+
justify-content: space-between;
|
|
548
|
+
align-items: center;
|
|
549
|
+
margin-bottom: 0.75rem;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.filters-header h4 {
|
|
553
|
+
margin: 0;
|
|
554
|
+
font-size: 0.875rem;
|
|
555
|
+
font-weight: 600;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
.clear-all {
|
|
559
|
+
font-size: 0.875rem;
|
|
560
|
+
color: #3b82f6;
|
|
561
|
+
text-decoration: underline;
|
|
562
|
+
cursor: pointer;
|
|
563
|
+
border: none;
|
|
564
|
+
background: none;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.filter-chips {
|
|
568
|
+
display: flex;
|
|
569
|
+
flex-wrap: wrap;
|
|
570
|
+
gap: 0.5rem;
|
|
571
|
+
}
|
|
572
|
+
</style>
|
|
573
|
+
|
|
574
|
+
<div class="active-filters">
|
|
575
|
+
<div class="filters-header">
|
|
576
|
+
<h4>Active Filters (3)</h4>
|
|
577
|
+
<button class="clear-all" id="clear-filters">Clear all</button>
|
|
578
|
+
</div>
|
|
579
|
+
<div class="filter-chips" id="active-filters">
|
|
580
|
+
<snice-chip label="Category: Electronics" variant="primary" removable size="small"></snice-chip>
|
|
581
|
+
<snice-chip label="Price: $25-$50" variant="info" removable size="small"></snice-chip>
|
|
582
|
+
<snice-chip label="Brand: Sony" variant="success" removable size="small"></snice-chip>
|
|
583
|
+
</div>
|
|
584
|
+
</div>
|
|
585
|
+
|
|
586
|
+
<script type="module">
|
|
587
|
+
const container = document.getElementById('active-filters');
|
|
588
|
+
const clearButton = document.getElementById('clear-filters');
|
|
589
|
+
|
|
590
|
+
// Handle remove events
|
|
591
|
+
container.addEventListener('remove', (e) => {
|
|
592
|
+
e.target.remove();
|
|
593
|
+
updateFilterCount();
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
// Clear all filters
|
|
597
|
+
clearButton.addEventListener('click', () => {
|
|
598
|
+
container.innerHTML = '';
|
|
599
|
+
updateFilterCount();
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
function updateFilterCount() {
|
|
603
|
+
const count = container.querySelectorAll('snice-chip').length;
|
|
604
|
+
document.querySelector('.filters-header h4').textContent = `Active Filters (${count})`;
|
|
605
|
+
}
|
|
606
|
+
</script>
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## Accessibility
|
|
610
|
+
|
|
611
|
+
- **Keyboard support**: Focusable and activatable with Enter/Space
|
|
612
|
+
- **ARIA attributes**: `role`, `aria-selected`, `aria-disabled`
|
|
613
|
+
- **Screen reader friendly**: Remove button has `aria-label`
|
|
614
|
+
- **Focus indicators**: Clear focus states for keyboard navigation
|
|
615
|
+
|
|
616
|
+
## Browser Support
|
|
617
|
+
|
|
618
|
+
- Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
619
|
+
- Requires Custom Elements v1 and Shadow DOM support
|
|
620
|
+
|
|
621
|
+
## Best Practices
|
|
622
|
+
|
|
623
|
+
1. **Keep labels short**: Chips work best with concise text
|
|
624
|
+
2. **Use appropriate variants**: Match colors to semantic meaning
|
|
625
|
+
3. **Make removable when needed**: Allow users to dismiss chips
|
|
626
|
+
4. **Group related chips**: Use containers to organize chip sets
|
|
627
|
+
5. **Limit chip count**: Too many chips can overwhelm users
|
|
628
|
+
6. **Use icons/avatars wisely**: Visual elements should add meaning
|
|
629
|
+
7. **Handle removal gracefully**: Animate or fade out when removing
|
|
630
|
+
8. **Test keyboard navigation**: Ensure chips work without a mouse
|
|
631
|
+
9. **Consider mobile**: Ensure chips are tappable on touch devices
|
|
632
|
+
10. **Provide feedback**: Show selected/active states clearly
|
|
633
|
+
|
|
634
|
+
## Common Patterns
|
|
635
|
+
|
|
636
|
+
### Tag/Label
|
|
637
|
+
```html
|
|
638
|
+
<snice-chip label="JavaScript" variant="primary"></snice-chip>
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
### Removable Tag
|
|
642
|
+
```html
|
|
643
|
+
<snice-chip label="Remove me" removable></snice-chip>
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Filter Selection
|
|
647
|
+
```html
|
|
648
|
+
<snice-chip label="Filter" selected></snice-chip>
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
### User/Contact
|
|
652
|
+
```html
|
|
653
|
+
<snice-chip label="John Doe" avatar="/avatar.jpg" removable></snice-chip>
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
### Status Indicator
|
|
657
|
+
```html
|
|
658
|
+
<snice-chip label="Active" variant="success" size="small"></snice-chip>
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
## Variant Colors
|
|
662
|
+
|
|
663
|
+
| Variant | Color Scheme | Use Case |
|
|
664
|
+
|---------|-------------|----------|
|
|
665
|
+
| `default` | Gray | Neutral tags, labels |
|
|
666
|
+
| `primary` | Blue | Primary categories, selections |
|
|
667
|
+
| `success` | Green | Positive status, confirmed items |
|
|
668
|
+
| `warning` | Orange | Important tags, warnings |
|
|
669
|
+
| `error` | Red | Error states, critical items |
|
|
670
|
+
| `info` | Light blue | Informational tags |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Code Block Component
|
|
2
|
+
|
|
3
|
+
Display code with syntax highlighting, line numbers, and copy functionality.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<snice-code-block id="code" language="javascript"></snice-code-block>
|
|
9
|
+
<script>
|
|
10
|
+
document.getElementById('code').code = `
|
|
11
|
+
function hello() {
|
|
12
|
+
console.log("Hello World");
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
</script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Properties
|
|
19
|
+
|
|
20
|
+
| Property | Type | Default | Description |
|
|
21
|
+
|----------|------|---------|-------------|
|
|
22
|
+
| `code` | `string` | `''` | Code content |
|
|
23
|
+
| `language` | `CodeLanguage` | `'plaintext'` | Programming language |
|
|
24
|
+
| `showLineNumbers` | `boolean` | `false` | Show line numbers |
|
|
25
|
+
| `startLine` | `number` | `1` | Starting line number |
|
|
26
|
+
| `highlightLines` | `number[]` | `[]` | Lines to highlight |
|
|
27
|
+
| `copyable` | `boolean` | `true` | Show copy button |
|
|
28
|
+
| `filename` | `string` | `''` | File name to display |
|
|
29
|
+
|
|
30
|
+
## Methods
|
|
31
|
+
|
|
32
|
+
- `copy()` - Copy code to clipboard
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
|
|
36
|
+
- `@snice/code-copy` - Code copied (detail: { code, codeBlock })
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<!-- With line numbers -->
|
|
42
|
+
<snice-code-block show-line-numbers></snice-code-block>
|
|
43
|
+
|
|
44
|
+
<!-- With filename -->
|
|
45
|
+
<snice-code-block filename="index.js"></snice-code-block>
|
|
46
|
+
|
|
47
|
+
<!-- Highlight lines -->
|
|
48
|
+
<snice-code-block highlight-lines="[2,3,4]"></snice-code-block>
|
|
49
|
+
```
|