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,648 @@
|
|
|
1
|
+
# Button Component
|
|
2
|
+
|
|
3
|
+
The button component provides an interactive element for user actions. It supports multiple variants, sizes, states (loading, disabled), styles (outline, pill, circle), icons, and can function as both a button and link.
|
|
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
|
+
<snice-button>Click me</snice-button>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import 'snice/components/button/snice-button';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Properties
|
|
22
|
+
|
|
23
|
+
| Property | Type | Default | Description |
|
|
24
|
+
|----------|------|---------|-------------|
|
|
25
|
+
| `variant` | `'default' \| 'primary' \| 'success' \| 'warning' \| 'danger' \| 'text'` | `'default'` | Visual style variant |
|
|
26
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Button size |
|
|
27
|
+
| `disabled` | `boolean` | `false` | Disable the button |
|
|
28
|
+
| `loading` | `boolean` | `false` | Show loading spinner |
|
|
29
|
+
| `outline` | `boolean` | `false` | Use outline style |
|
|
30
|
+
| `pill` | `boolean` | `false` | Use pill (fully rounded) shape |
|
|
31
|
+
| `circle` | `boolean` | `false` | Use circle shape (icon only) |
|
|
32
|
+
| `href` | `string` | `''` | URL to navigate to (renders as link) |
|
|
33
|
+
| `target` | `string` | `''` | Link target attribute |
|
|
34
|
+
| `download` | `string` | `''` | Download attribute for file downloads |
|
|
35
|
+
| `icon` | `string` | `''` | Icon image URL |
|
|
36
|
+
| `iconPlacement` | `'start' \| 'end'` | `'start'` | Icon position relative to label |
|
|
37
|
+
|
|
38
|
+
## Methods
|
|
39
|
+
|
|
40
|
+
#### `focus(options?: FocusOptions): void`
|
|
41
|
+
Focus the button programmatically.
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
button.focus();
|
|
45
|
+
button.focus({ preventScroll: true });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### `blur(): void`
|
|
49
|
+
Remove focus from the button.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
button.blur();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### `click(): void`
|
|
56
|
+
Programmatically click the button.
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
button.click();
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
### Basic Buttons
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<!-- Default button -->
|
|
68
|
+
<snice-button>Default</snice-button>
|
|
69
|
+
|
|
70
|
+
<!-- Primary button -->
|
|
71
|
+
<snice-button variant="primary">Primary</snice-button>
|
|
72
|
+
|
|
73
|
+
<!-- Success button -->
|
|
74
|
+
<snice-button variant="success">Success</snice-button>
|
|
75
|
+
|
|
76
|
+
<!-- Warning button -->
|
|
77
|
+
<snice-button variant="warning">Warning</snice-button>
|
|
78
|
+
|
|
79
|
+
<!-- Danger button -->
|
|
80
|
+
<snice-button variant="danger">Danger</snice-button>
|
|
81
|
+
|
|
82
|
+
<!-- Text button -->
|
|
83
|
+
<snice-button variant="text">Text Only</snice-button>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Button Sizes
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<snice-button size="small">Small</snice-button>
|
|
90
|
+
<snice-button size="medium">Medium</snice-button>
|
|
91
|
+
<snice-button size="large">Large</snice-button>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Outline Buttons
|
|
95
|
+
|
|
96
|
+
```html
|
|
97
|
+
<snice-button outline>Default Outline</snice-button>
|
|
98
|
+
<snice-button variant="primary" outline>Primary Outline</snice-button>
|
|
99
|
+
<snice-button variant="success" outline>Success Outline</snice-button>
|
|
100
|
+
<snice-button variant="warning" outline>Warning Outline</snice-button>
|
|
101
|
+
<snice-button variant="danger" outline>Danger Outline</snice-button>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Pill Buttons
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<snice-button pill>Default Pill</snice-button>
|
|
108
|
+
<snice-button variant="primary" pill>Primary Pill</snice-button>
|
|
109
|
+
<snice-button variant="success" pill>Success Pill</snice-button>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Circle Buttons
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<snice-button circle icon="/icons/plus.svg"></snice-button>
|
|
116
|
+
<snice-button variant="primary" circle icon="/icons/edit.svg"></snice-button>
|
|
117
|
+
<snice-button variant="danger" circle icon="/icons/delete.svg"></snice-button>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Button States
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<!-- Disabled -->
|
|
124
|
+
<snice-button disabled>Disabled</snice-button>
|
|
125
|
+
<snice-button variant="primary" disabled>Primary Disabled</snice-button>
|
|
126
|
+
|
|
127
|
+
<!-- Loading -->
|
|
128
|
+
<snice-button loading>Loading...</snice-button>
|
|
129
|
+
<snice-button variant="primary" loading>Saving...</snice-button>
|
|
130
|
+
|
|
131
|
+
<!-- Disabled and loading cannot be clicked -->
|
|
132
|
+
<snice-button disabled loading>Processing...</snice-button>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Buttons with Icons
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<!-- Icon at start (default) -->
|
|
139
|
+
<snice-button icon="/icons/arrow-right.svg">Next</snice-button>
|
|
140
|
+
|
|
141
|
+
<!-- Icon at end -->
|
|
142
|
+
<snice-button icon="/icons/external-link.svg" icon-placement="end">
|
|
143
|
+
Open Link
|
|
144
|
+
</snice-button>
|
|
145
|
+
|
|
146
|
+
<!-- Icon only -->
|
|
147
|
+
<snice-button circle icon="/icons/settings.svg"></snice-button>
|
|
148
|
+
|
|
149
|
+
<!-- With variants -->
|
|
150
|
+
<snice-button variant="primary" icon="/icons/save.svg">
|
|
151
|
+
Save
|
|
152
|
+
</snice-button>
|
|
153
|
+
|
|
154
|
+
<snice-button variant="danger" icon="/icons/trash.svg" outline>
|
|
155
|
+
Delete
|
|
156
|
+
</snice-button>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Link Buttons
|
|
160
|
+
|
|
161
|
+
```html
|
|
162
|
+
<!-- Basic link -->
|
|
163
|
+
<snice-button href="/page">Go to Page</snice-button>
|
|
164
|
+
|
|
165
|
+
<!-- External link -->
|
|
166
|
+
<snice-button href="https://example.com" target="_blank">
|
|
167
|
+
Visit Site
|
|
168
|
+
</snice-button>
|
|
169
|
+
|
|
170
|
+
<!-- Download link -->
|
|
171
|
+
<snice-button href="/files/document.pdf" download="document.pdf">
|
|
172
|
+
Download PDF
|
|
173
|
+
</snice-button>
|
|
174
|
+
|
|
175
|
+
<!-- Link with icon -->
|
|
176
|
+
<snice-button
|
|
177
|
+
href="/docs"
|
|
178
|
+
icon="/icons/book.svg"
|
|
179
|
+
variant="primary">
|
|
180
|
+
View Docs
|
|
181
|
+
</snice-button>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Button Groups
|
|
185
|
+
|
|
186
|
+
```html
|
|
187
|
+
<style>
|
|
188
|
+
.button-group {
|
|
189
|
+
display: inline-flex;
|
|
190
|
+
gap: 0.5rem;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.button-group--attached {
|
|
194
|
+
display: inline-flex;
|
|
195
|
+
gap: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.button-group--attached snice-button:not(:first-child):not(:last-child) {
|
|
199
|
+
border-radius: 0;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.button-group--attached snice-button:first-child {
|
|
203
|
+
border-top-right-radius: 0;
|
|
204
|
+
border-bottom-right-radius: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.button-group--attached snice-button:last-child {
|
|
208
|
+
border-top-left-radius: 0;
|
|
209
|
+
border-bottom-left-radius: 0;
|
|
210
|
+
}
|
|
211
|
+
</style>
|
|
212
|
+
|
|
213
|
+
<!-- Spaced group -->
|
|
214
|
+
<div class="button-group">
|
|
215
|
+
<snice-button>Cancel</snice-button>
|
|
216
|
+
<snice-button variant="primary">Save</snice-button>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<!-- Attached group -->
|
|
220
|
+
<div class="button-group--attached">
|
|
221
|
+
<snice-button outline>Left</snice-button>
|
|
222
|
+
<snice-button outline>Center</snice-button>
|
|
223
|
+
<snice-button outline>Right</snice-button>
|
|
224
|
+
</div>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Form Buttons
|
|
228
|
+
|
|
229
|
+
```html
|
|
230
|
+
<form id="user-form">
|
|
231
|
+
<label>
|
|
232
|
+
Name:
|
|
233
|
+
<input type="text" name="name" required>
|
|
234
|
+
</label>
|
|
235
|
+
|
|
236
|
+
<label>
|
|
237
|
+
Email:
|
|
238
|
+
<input type="email" name="email" required>
|
|
239
|
+
</label>
|
|
240
|
+
|
|
241
|
+
<div class="button-group">
|
|
242
|
+
<snice-button type="reset">Reset</snice-button>
|
|
243
|
+
<snice-button variant="primary" type="submit">Submit</snice-button>
|
|
244
|
+
</div>
|
|
245
|
+
</form>
|
|
246
|
+
|
|
247
|
+
<script type="module">
|
|
248
|
+
import 'snice/components/button/snice-button';
|
|
249
|
+
|
|
250
|
+
const form = document.getElementById('user-form');
|
|
251
|
+
const submitButton = form.querySelector('snice-button[type="submit"]');
|
|
252
|
+
|
|
253
|
+
form.addEventListener('submit', async (e) => {
|
|
254
|
+
e.preventDefault();
|
|
255
|
+
|
|
256
|
+
// Show loading state
|
|
257
|
+
submitButton.loading = true;
|
|
258
|
+
submitButton.textContent = 'Submitting...';
|
|
259
|
+
|
|
260
|
+
try {
|
|
261
|
+
const formData = new FormData(form);
|
|
262
|
+
const response = await fetch('/api/users', {
|
|
263
|
+
method: 'POST',
|
|
264
|
+
body: formData
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
if (!response.ok) throw new Error('Submission failed');
|
|
268
|
+
|
|
269
|
+
alert('Form submitted successfully!');
|
|
270
|
+
} catch (error) {
|
|
271
|
+
alert('Error: ' + error.message);
|
|
272
|
+
} finally {
|
|
273
|
+
// Reset loading state
|
|
274
|
+
submitButton.loading = false;
|
|
275
|
+
submitButton.textContent = 'Submit';
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
</script>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Async Action Handling
|
|
282
|
+
|
|
283
|
+
```html
|
|
284
|
+
<snice-button
|
|
285
|
+
id="save-btn"
|
|
286
|
+
variant="primary"
|
|
287
|
+
icon="/icons/save.svg">
|
|
288
|
+
Save Changes
|
|
289
|
+
</snice-button>
|
|
290
|
+
|
|
291
|
+
<script type="module">
|
|
292
|
+
import type { SniceButtonElement } from 'snice/components/button/snice-button.types';
|
|
293
|
+
|
|
294
|
+
const button = document.getElementById('save-btn') as SniceButtonElement;
|
|
295
|
+
|
|
296
|
+
button.addEventListener('click', async () => {
|
|
297
|
+
// Show loading state
|
|
298
|
+
button.loading = true;
|
|
299
|
+
const originalText = button.textContent;
|
|
300
|
+
button.textContent = 'Saving...';
|
|
301
|
+
|
|
302
|
+
try {
|
|
303
|
+
// Simulate API call
|
|
304
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
305
|
+
|
|
306
|
+
// Success feedback
|
|
307
|
+
button.variant = 'success';
|
|
308
|
+
button.textContent = 'Saved!';
|
|
309
|
+
|
|
310
|
+
setTimeout(() => {
|
|
311
|
+
button.variant = 'primary';
|
|
312
|
+
button.textContent = originalText;
|
|
313
|
+
button.loading = false;
|
|
314
|
+
}, 1500);
|
|
315
|
+
|
|
316
|
+
} catch (error) {
|
|
317
|
+
// Error feedback
|
|
318
|
+
button.variant = 'danger';
|
|
319
|
+
button.textContent = 'Save Failed';
|
|
320
|
+
button.loading = false;
|
|
321
|
+
|
|
322
|
+
setTimeout(() => {
|
|
323
|
+
button.variant = 'primary';
|
|
324
|
+
button.textContent = originalText;
|
|
325
|
+
}, 2000);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
</script>
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Confirmation Dialog
|
|
332
|
+
|
|
333
|
+
```html
|
|
334
|
+
<snice-button
|
|
335
|
+
id="delete-btn"
|
|
336
|
+
variant="danger"
|
|
337
|
+
outline
|
|
338
|
+
icon="/icons/trash.svg">
|
|
339
|
+
Delete Account
|
|
340
|
+
</snice-button>
|
|
341
|
+
|
|
342
|
+
<script type="module">
|
|
343
|
+
import type { SniceButtonElement } from 'snice/components/button/snice-button.types';
|
|
344
|
+
|
|
345
|
+
const button = document.getElementById('delete-btn') as SniceButtonElement;
|
|
346
|
+
|
|
347
|
+
button.addEventListener('click', async () => {
|
|
348
|
+
const confirmed = confirm('Are you sure you want to delete your account? This action cannot be undone.');
|
|
349
|
+
|
|
350
|
+
if (!confirmed) return;
|
|
351
|
+
|
|
352
|
+
button.loading = true;
|
|
353
|
+
button.disabled = true;
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
await fetch('/api/account', { method: 'DELETE' });
|
|
357
|
+
alert('Account deleted successfully');
|
|
358
|
+
window.location.href = '/goodbye';
|
|
359
|
+
} catch (error) {
|
|
360
|
+
alert('Failed to delete account');
|
|
361
|
+
button.loading = false;
|
|
362
|
+
button.disabled = false;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
</script>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Icon Buttons with Tooltips
|
|
369
|
+
|
|
370
|
+
```html
|
|
371
|
+
<style>
|
|
372
|
+
.icon-button-group {
|
|
373
|
+
display: inline-flex;
|
|
374
|
+
gap: 0.5rem;
|
|
375
|
+
}
|
|
376
|
+
</style>
|
|
377
|
+
|
|
378
|
+
<div class="icon-button-group">
|
|
379
|
+
<snice-button
|
|
380
|
+
circle
|
|
381
|
+
icon="/icons/bold.svg"
|
|
382
|
+
variant="default"
|
|
383
|
+
outline
|
|
384
|
+
title="Bold">
|
|
385
|
+
</snice-button>
|
|
386
|
+
|
|
387
|
+
<snice-button
|
|
388
|
+
circle
|
|
389
|
+
icon="/icons/italic.svg"
|
|
390
|
+
variant="default"
|
|
391
|
+
outline
|
|
392
|
+
title="Italic">
|
|
393
|
+
</snice-button>
|
|
394
|
+
|
|
395
|
+
<snice-button
|
|
396
|
+
circle
|
|
397
|
+
icon="/icons/underline.svg"
|
|
398
|
+
variant="default"
|
|
399
|
+
outline
|
|
400
|
+
title="Underline">
|
|
401
|
+
</snice-button>
|
|
402
|
+
</div>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### Call-to-Action Buttons
|
|
406
|
+
|
|
407
|
+
```html
|
|
408
|
+
<style>
|
|
409
|
+
.cta-section {
|
|
410
|
+
text-align: center;
|
|
411
|
+
padding: 3rem;
|
|
412
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
413
|
+
color: white;
|
|
414
|
+
border-radius: 0.5rem;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.cta-buttons {
|
|
418
|
+
display: flex;
|
|
419
|
+
gap: 1rem;
|
|
420
|
+
justify-content: center;
|
|
421
|
+
margin-top: 2rem;
|
|
422
|
+
}
|
|
423
|
+
</style>
|
|
424
|
+
|
|
425
|
+
<div class="cta-section">
|
|
426
|
+
<h2>Ready to get started?</h2>
|
|
427
|
+
<p>Join thousands of users already using our platform.</p>
|
|
428
|
+
|
|
429
|
+
<div class="cta-buttons">
|
|
430
|
+
<snice-button size="large" variant="default">
|
|
431
|
+
Learn More
|
|
432
|
+
</snice-button>
|
|
433
|
+
<snice-button size="large" variant="primary">
|
|
434
|
+
Get Started Free
|
|
435
|
+
</snice-button>
|
|
436
|
+
</div>
|
|
437
|
+
</div>
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### Toolbar Buttons
|
|
441
|
+
|
|
442
|
+
```html
|
|
443
|
+
<style>
|
|
444
|
+
.toolbar {
|
|
445
|
+
display: flex;
|
|
446
|
+
gap: 0.25rem;
|
|
447
|
+
padding: 0.5rem;
|
|
448
|
+
background: #f3f4f6;
|
|
449
|
+
border-radius: 0.375rem;
|
|
450
|
+
width: fit-content;
|
|
451
|
+
}
|
|
452
|
+
</style>
|
|
453
|
+
|
|
454
|
+
<div class="toolbar">
|
|
455
|
+
<snice-button circle icon="/icons/undo.svg" size="small" outline title="Undo"></snice-button>
|
|
456
|
+
<snice-button circle icon="/icons/redo.svg" size="small" outline title="Redo"></snice-button>
|
|
457
|
+
<div style="width: 1px; background: #d1d5db; margin: 0 0.25rem;"></div>
|
|
458
|
+
<snice-button circle icon="/icons/copy.svg" size="small" outline title="Copy"></snice-button>
|
|
459
|
+
<snice-button circle icon="/icons/paste.svg" size="small" outline title="Paste"></snice-button>
|
|
460
|
+
<snice-button circle icon="/icons/cut.svg" size="small" outline title="Cut"></snice-button>
|
|
461
|
+
<div style="width: 1px; background: #d1d5db; margin: 0 0.25rem;"></div>
|
|
462
|
+
<snice-button circle icon="/icons/align-left.svg" size="small" outline title="Align Left"></snice-button>
|
|
463
|
+
<snice-button circle icon="/icons/align-center.svg" size="small" outline title="Align Center"></snice-button>
|
|
464
|
+
<snice-button circle icon="/icons/align-right.svg" size="small" outline title="Align Right"></snice-button>
|
|
465
|
+
</div>
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### Social Login Buttons
|
|
469
|
+
|
|
470
|
+
```html
|
|
471
|
+
<style>
|
|
472
|
+
.social-buttons {
|
|
473
|
+
display: flex;
|
|
474
|
+
flex-direction: column;
|
|
475
|
+
gap: 0.75rem;
|
|
476
|
+
max-width: 20rem;
|
|
477
|
+
}
|
|
478
|
+
</style>
|
|
479
|
+
|
|
480
|
+
<div class="social-buttons">
|
|
481
|
+
<snice-button
|
|
482
|
+
variant="default"
|
|
483
|
+
icon="/icons/google.svg"
|
|
484
|
+
style="width: 100%;">
|
|
485
|
+
Continue with Google
|
|
486
|
+
</snice-button>
|
|
487
|
+
|
|
488
|
+
<snice-button
|
|
489
|
+
variant="default"
|
|
490
|
+
icon="/icons/github.svg"
|
|
491
|
+
style="width: 100%;">
|
|
492
|
+
Continue with GitHub
|
|
493
|
+
</snice-button>
|
|
494
|
+
|
|
495
|
+
<snice-button
|
|
496
|
+
variant="default"
|
|
497
|
+
icon="/icons/twitter.svg"
|
|
498
|
+
style="width: 100%;">
|
|
499
|
+
Continue with Twitter
|
|
500
|
+
</snice-button>
|
|
501
|
+
</div>
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### Pagination Buttons
|
|
505
|
+
|
|
506
|
+
```html
|
|
507
|
+
<style>
|
|
508
|
+
.pagination {
|
|
509
|
+
display: flex;
|
|
510
|
+
gap: 0.25rem;
|
|
511
|
+
align-items: center;
|
|
512
|
+
}
|
|
513
|
+
</style>
|
|
514
|
+
|
|
515
|
+
<div class="pagination">
|
|
516
|
+
<snice-button icon="/icons/chevron-left.svg" outline disabled>Previous</snice-button>
|
|
517
|
+
|
|
518
|
+
<snice-button outline>1</snice-button>
|
|
519
|
+
<snice-button variant="primary">2</snice-button>
|
|
520
|
+
<snice-button outline>3</snice-button>
|
|
521
|
+
<snice-button outline>4</snice-button>
|
|
522
|
+
<snice-button outline>5</snice-button>
|
|
523
|
+
|
|
524
|
+
<snice-button icon="/icons/chevron-right.svg" icon-placement="end" outline>Next</snice-button>
|
|
525
|
+
</div>
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Upload Button
|
|
529
|
+
|
|
530
|
+
```html
|
|
531
|
+
<input type="file" id="file-input" style="display: none;" accept="image/*">
|
|
532
|
+
|
|
533
|
+
<snice-button
|
|
534
|
+
id="upload-btn"
|
|
535
|
+
variant="primary"
|
|
536
|
+
icon="/icons/upload.svg">
|
|
537
|
+
Upload Image
|
|
538
|
+
</snice-button>
|
|
539
|
+
|
|
540
|
+
<script type="module">
|
|
541
|
+
import type { SniceButtonElement } from 'snice/components/button/snice-button.types';
|
|
542
|
+
|
|
543
|
+
const button = document.getElementById('upload-btn') as SniceButtonElement;
|
|
544
|
+
const input = document.getElementById('file-input');
|
|
545
|
+
|
|
546
|
+
button.addEventListener('click', () => {
|
|
547
|
+
input.click();
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
input.addEventListener('change', async (e) => {
|
|
551
|
+
const file = e.target.files[0];
|
|
552
|
+
if (!file) return;
|
|
553
|
+
|
|
554
|
+
button.loading = true;
|
|
555
|
+
button.textContent = 'Uploading...';
|
|
556
|
+
|
|
557
|
+
try {
|
|
558
|
+
const formData = new FormData();
|
|
559
|
+
formData.append('file', file);
|
|
560
|
+
|
|
561
|
+
const response = await fetch('/api/upload', {
|
|
562
|
+
method: 'POST',
|
|
563
|
+
body: formData
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
if (!response.ok) throw new Error('Upload failed');
|
|
567
|
+
|
|
568
|
+
button.variant = 'success';
|
|
569
|
+
button.textContent = 'Uploaded!';
|
|
570
|
+
|
|
571
|
+
setTimeout(() => {
|
|
572
|
+
button.variant = 'primary';
|
|
573
|
+
button.textContent = 'Upload Image';
|
|
574
|
+
button.loading = false;
|
|
575
|
+
}, 2000);
|
|
576
|
+
|
|
577
|
+
} catch (error) {
|
|
578
|
+
alert('Upload failed: ' + error.message);
|
|
579
|
+
button.textContent = 'Upload Image';
|
|
580
|
+
button.loading = false;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
</script>
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
## Accessibility
|
|
587
|
+
|
|
588
|
+
- **Keyboard support**: Fully keyboard accessible with Enter and Space
|
|
589
|
+
- **Focus indicators**: Clear focus states for keyboard navigation
|
|
590
|
+
- **ARIA attributes**: Proper roles and states for screen readers
|
|
591
|
+
- **Disabled state**: Properly disabled buttons cannot be focused or activated
|
|
592
|
+
- **Link semantics**: When using href, renders as accessible link
|
|
593
|
+
|
|
594
|
+
## Browser Support
|
|
595
|
+
|
|
596
|
+
- Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
597
|
+
- Requires Custom Elements v1 and Shadow DOM support
|
|
598
|
+
|
|
599
|
+
## Best Practices
|
|
600
|
+
|
|
601
|
+
1. **Use appropriate variants**: Choose colors that match the action's importance
|
|
602
|
+
2. **Provide clear labels**: Button text should describe the action
|
|
603
|
+
3. **Show loading states**: Indicate async operations with loading prop
|
|
604
|
+
4. **Disable during actions**: Prevent double-clicks during processing
|
|
605
|
+
5. **Use icons wisely**: Icons should enhance, not replace text (except circle buttons)
|
|
606
|
+
6. **Group related buttons**: Use button groups for related actions
|
|
607
|
+
7. **Make primary actions prominent**: Use primary variant for main actions
|
|
608
|
+
8. **Avoid too many buttons**: Limit choices to prevent decision fatigue
|
|
609
|
+
9. **Test keyboard navigation**: Ensure all buttons work without a mouse
|
|
610
|
+
10. **Provide feedback**: Show success/error states after actions
|
|
611
|
+
|
|
612
|
+
## Common Patterns
|
|
613
|
+
|
|
614
|
+
### Primary Action
|
|
615
|
+
```html
|
|
616
|
+
<snice-button variant="primary">Save Changes</snice-button>
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
### Secondary Action
|
|
620
|
+
```html
|
|
621
|
+
<snice-button variant="default">Cancel</snice-button>
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
### Destructive Action
|
|
625
|
+
```html
|
|
626
|
+
<snice-button variant="danger" outline>Delete</snice-button>
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
### Icon-Only Action
|
|
630
|
+
```html
|
|
631
|
+
<snice-button circle icon="/icons/edit.svg"></snice-button>
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
### Form Submit
|
|
635
|
+
```html
|
|
636
|
+
<snice-button variant="primary" type="submit">Submit</snice-button>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
## Variant Colors
|
|
640
|
+
|
|
641
|
+
| Variant | Color Scheme | Use Case |
|
|
642
|
+
|---------|-------------|----------|
|
|
643
|
+
| `default` | Gray | Secondary actions, cancel |
|
|
644
|
+
| `primary` | Blue | Primary actions, submit |
|
|
645
|
+
| `success` | Green | Confirmations, positive actions |
|
|
646
|
+
| `warning` | Orange | Caution actions, important notices |
|
|
647
|
+
| `danger` | Red | Destructive actions, delete |
|
|
648
|
+
| `text` | Transparent | Tertiary actions, links |
|