snice 2.5.4 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +537 -869
- package/bin/templates/base/src/components/counter-button.ts +13 -26
- package/bin/templates/base/src/controllers/counter-controller.ts +3 -3
- package/dist/components/accordion/snice-accordion-item.d.ts +4 -5
- package/dist/components/accordion/snice-accordion-item.js +37 -39
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.d.ts +5 -11
- package/dist/components/accordion/snice-accordion.js +51 -52
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/alert/snice-alert.d.ts +2 -6
- package/dist/components/alert/snice-alert.js +41 -56
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/avatar/snice-avatar.d.ts +2 -6
- package/dist/components/avatar/snice-avatar.js +64 -71
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.d.ts +2 -3
- package/dist/components/badge/snice-badge.js +22 -23
- 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 +5 -12
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +88 -89
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/button/snice-button.d.ts +3 -7
- package/dist/components/button/snice-button.js +37 -58
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/card/snice-card.d.ts +5 -8
- package/dist/components/card/snice-card.js +71 -56
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.d.ts +4 -13
- package/dist/components/checkbox/snice-checkbox.js +66 -137
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.d.ts +5 -11
- package/dist/components/chip/snice-chip.js +44 -47
- package/dist/components/chip/snice-chip.js.map +1 -1
- 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/date-picker/snice-date-picker.d.ts +11 -11
- package/dist/components/date-picker/snice-date-picker.js +134 -133
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.d.ts +2 -4
- package/dist/components/divider/snice-divider.js +14 -22
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/drawer/snice-drawer.d.ts +4 -4
- package/dist/components/drawer/snice-drawer.js +25 -19
- 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 +45 -0
- package/dist/components/file-upload/snice-file-upload.js +394 -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/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 +8 -6
- package/dist/components/input/snice-input.js +122 -105
- package/dist/components/input/snice-input.js.map +1 -1
- 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 +4 -4
- package/dist/components/layout/snice-layout-blog.js +21 -19
- 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 +16 -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 +14 -7
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-dashboard.d.ts +5 -5
- package/dist/components/layout/snice-layout-dashboard.js +38 -30
- 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 +17 -10
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-landing.d.ts +4 -4
- package/dist/components/layout/snice-layout-landing.js +21 -19
- 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 +17 -6
- package/dist/components/layout/snice-layout-minimal.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.d.ts +5 -4
- package/dist/components/layout/snice-layout-sidebar.js +42 -20
- 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 +14 -7
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/layout/snice-layout.d.ts +4 -4
- package/dist/components/layout/snice-layout.js +16 -10
- 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/login/snice-login.d.ts +6 -11
- package/dist/components/login/snice-login.js +97 -71
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/modal/snice-modal.d.ts +5 -9
- package/dist/components/modal/snice-modal.js +47 -78
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/nav/snice-nav.d.ts +13 -7
- package/dist/components/nav/snice-nav.js +191 -100
- package/dist/components/nav/snice-nav.js.map +1 -1
- package/dist/components/nav/snice-nav.types.d.ts +3 -3
- package/dist/components/pagination/snice-pagination.d.ts +6 -7
- package/dist/components/pagination/snice-pagination.js +94 -81
- package/dist/components/pagination/snice-pagination.js.map +1 -1
- package/dist/components/progress/snice-progress.d.ts +2 -7
- package/dist/components/progress/snice-progress.js +41 -98
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/radio/snice-radio.d.ts +4 -4
- package/dist/components/radio/snice-radio.js +52 -44
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-option.d.ts +2 -1
- package/dist/components/select/snice-option.js +12 -5
- package/dist/components/select/snice-option.js.map +1 -1
- package/dist/components/select/snice-select.d.ts +9 -21
- package/dist/components/select/snice-select.js +98 -170
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.d.ts +2 -6
- package/dist/components/skeleton/snice-skeleton.js +18 -49
- 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/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 +38 -26
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-actions.d.ts +24 -0
- package/dist/components/table/snice-cell-actions.js +149 -0
- package/dist/components/table/snice-cell-actions.js.map +1 -0
- package/dist/components/table/snice-cell-boolean.d.ts +2 -2
- package/dist/components/table/snice-cell-boolean.js +13 -7
- package/dist/components/table/snice-cell-boolean.js.map +1 -1
- package/dist/components/table/snice-cell-color.d.ts +18 -0
- package/dist/components/table/snice-cell-color.js +149 -0
- package/dist/components/table/snice-cell-color.js.map +1 -0
- package/dist/components/table/snice-cell-currency.d.ts +24 -0
- package/dist/components/table/snice-cell-currency.js +235 -0
- package/dist/components/table/snice-cell-currency.js.map +1 -0
- package/dist/components/table/snice-cell-date.d.ts +2 -2
- package/dist/components/table/snice-cell-date.js +14 -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 +12 -6
- package/dist/components/table/snice-cell-duration.js.map +1 -1
- package/dist/components/table/snice-cell-email.d.ts +15 -0
- package/dist/components/table/snice-cell-email.js +125 -0
- package/dist/components/table/snice-cell-email.js.map +1 -0
- package/dist/components/table/snice-cell-filesize.d.ts +2 -2
- package/dist/components/table/snice-cell-filesize.js +12 -6
- package/dist/components/table/snice-cell-filesize.js.map +1 -1
- package/dist/components/table/snice-cell-image.d.ts +20 -0
- package/dist/components/table/snice-cell-image.js +162 -0
- package/dist/components/table/snice-cell-image.js.map +1 -0
- package/dist/components/table/snice-cell-json.d.ts +20 -0
- package/dist/components/table/snice-cell-json.js +186 -0
- package/dist/components/table/snice-cell-json.js.map +1 -0
- package/dist/components/table/snice-cell-link.d.ts +17 -0
- package/dist/components/table/snice-cell-link.js +142 -0
- package/dist/components/table/snice-cell-link.js.map +1 -0
- package/dist/components/table/snice-cell-location.d.ts +19 -0
- package/dist/components/table/snice-cell-location.js +185 -0
- package/dist/components/table/snice-cell-location.js.map +1 -0
- package/dist/components/table/snice-cell-number.d.ts +2 -2
- package/dist/components/table/snice-cell-number.js +12 -6
- package/dist/components/table/snice-cell-number.js.map +1 -1
- package/dist/components/table/snice-cell-percentage.d.ts +22 -0
- package/dist/components/table/snice-cell-percentage.js +208 -0
- package/dist/components/table/snice-cell-percentage.js.map +1 -0
- package/dist/components/table/snice-cell-phone.d.ts +18 -0
- package/dist/components/table/snice-cell-phone.js +153 -0
- package/dist/components/table/snice-cell-phone.js.map +1 -0
- package/dist/components/table/snice-cell-progress.d.ts +2 -2
- package/dist/components/table/snice-cell-progress.js +12 -6
- 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 +12 -6
- 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 +13 -7
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-status.d.ts +17 -0
- package/dist/components/table/snice-cell-status.js +144 -0
- package/dist/components/table/snice-cell-status.js.map +1 -0
- package/dist/components/table/snice-cell-tag.d.ts +16 -0
- package/dist/components/table/snice-cell-tag.js +131 -0
- package/dist/components/table/snice-cell-tag.js.map +1 -0
- package/dist/components/table/snice-cell-text.d.ts +2 -2
- package/dist/components/table/snice-cell-text.js +14 -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 +12 -6
- 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 +6 -3
- package/dist/components/table/snice-column.js.map +1 -1
- package/dist/components/table/snice-header.d.ts +5 -5
- package/dist/components/table/snice-header.js +60 -50
- 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 +18 -11
- 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 +15 -8
- package/dist/components/table/snice-rating.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +17 -6
- package/dist/components/table/snice-row.js +95 -44
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +18 -10
- package/dist/components/table/snice-table.js +355 -173
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/table/snice-table.types.d.ts +101 -2
- package/dist/components/tabs/snice-tab-panel.d.ts +2 -2
- package/dist/components/tabs/snice-tab-panel.js +12 -6
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.d.ts +6 -5
- package/dist/components/tabs/snice-tab.js +36 -19
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.d.ts +5 -5
- package/dist/components/tabs/snice-tabs.js +38 -28
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- 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 +7 -7
- package/dist/components/toast/snice-toast-container.js +19 -12
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/components/toast/snice-toast.d.ts +3 -15
- package/dist/components/toast/snice-toast.js +49 -108
- 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 +15 -8
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/context.d.ts +44 -0
- package/dist/element-ready.d.ts +40 -0
- package/dist/{types/element.d.ts → element.d.ts} +2 -8
- package/dist/{types/events.d.ts → events.d.ts} +0 -4
- package/dist/index.cjs +2556 -605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.esm.js +2535 -604
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +2556 -605
- package/dist/index.iife.js.map +1 -1
- package/dist/method-decorators.d.ts +121 -0
- package/dist/on.d.ts +59 -0
- package/dist/parts.d.ts +156 -0
- package/dist/render-debug.d.ts +27 -0
- package/dist/render-tracker.d.ts +14 -0
- package/dist/render.d.ts +96 -0
- package/dist/symbols.cjs +163 -0
- package/dist/symbols.cjs.map +1 -1
- package/dist/{types/symbols.d.ts → symbols.d.ts} +22 -0
- package/dist/symbols.esm.js +27 -3
- package/dist/symbols.esm.js.map +1 -1
- package/dist/template.d.ts +99 -0
- package/dist/transitions.cjs +219 -0
- package/dist/transitions.esm.js +2 -2
- package/dist/types/context.d.ts +48 -0
- package/dist/types/element-options.d.ts +26 -0
- package/dist/types/index.d.ts +25 -9
- package/dist/types/nav-context.d.ts +19 -0
- package/dist/types/{types/on-options.d.ts → on-options.d.ts} +2 -0
- package/dist/types/{types/placard.d.ts → placard.d.ts} +0 -1
- package/docs/ai/README.md +26 -0
- package/docs/ai/api.md +175 -0
- package/docs/ai/architecture.md +160 -0
- package/docs/ai/components/accordion.md +174 -0
- package/docs/ai/components/alert.md +77 -0
- package/docs/ai/components/avatar.md +61 -0
- package/docs/ai/components/badge.md +69 -0
- package/docs/ai/components/banner.md +84 -0
- package/docs/ai/components/breadcrumbs.md +74 -0
- package/docs/ai/components/button.md +75 -0
- package/docs/ai/components/card.md +61 -0
- package/docs/ai/components/checkbox.md +74 -0
- package/docs/ai/components/chip.md +73 -0
- package/docs/ai/components/color-display.md +48 -0
- package/docs/ai/components/color-picker.md +75 -0
- package/docs/ai/components/date-picker.md +75 -0
- package/docs/ai/components/divider.md +66 -0
- package/docs/ai/components/drawer.md +80 -0
- package/docs/ai/components/empty-state.md +72 -0
- package/docs/ai/components/file-upload.md +93 -0
- package/docs/ai/components/image.md +60 -0
- package/docs/ai/components/input.md +111 -0
- package/docs/ai/components/kpi.md +158 -0
- package/docs/ai/components/link.md +77 -0
- package/docs/ai/components/login.md +109 -0
- package/docs/ai/components/modal.md +67 -0
- package/docs/ai/components/nav.md +76 -0
- package/docs/ai/components/pagination.md +55 -0
- package/docs/ai/components/progress.md +72 -0
- package/docs/ai/components/radio.md +79 -0
- package/docs/ai/components/select.md +92 -0
- package/docs/ai/components/skeleton.md +57 -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/stepper.md +216 -0
- package/docs/ai/components/switch.md +53 -0
- package/docs/ai/components/table.md +227 -0
- package/docs/ai/components/tabs.md +83 -0
- package/docs/ai/components/textarea.md +87 -0
- package/docs/ai/components/timeline.md +77 -0
- package/docs/ai/components/toast.md +140 -0
- package/docs/ai/components/tooltip.md +146 -0
- package/docs/ai/patterns.md +244 -0
- package/docs/components/accordion.md +558 -0
- package/docs/components/banner.md +106 -0
- package/docs/components/color-display.md +96 -0
- package/docs/components/color-picker.md +81 -0
- package/docs/components/drawer.md +602 -0
- package/docs/components/empty-state.md +79 -0
- package/docs/components/file-upload.md +263 -0
- package/docs/components/image.md +110 -0
- package/docs/components/kpi.md +251 -0
- package/docs/components/link.md +229 -0
- package/docs/components/modal.md +558 -0
- package/docs/components/nav.md +239 -0
- package/docs/components/pagination.md +289 -0
- package/docs/components/select.md +599 -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/stepper.md +410 -0
- package/docs/components/switch.md +354 -0
- package/docs/components/tabs.md +546 -0
- package/docs/components/textarea.md +235 -0
- package/docs/components/timeline.md +192 -0
- package/docs/components/toast.md +506 -0
- package/docs/components/tooltip.md +523 -0
- package/docs/controllers.md +744 -0
- package/docs/elements.md +855 -0
- package/docs/events.md +807 -0
- package/docs/migration-v2-to-v3.md +569 -0
- package/docs/observe.md +588 -0
- package/docs/placards.md +401 -0
- package/docs/request-response.md +852 -0
- package/docs/routing.md +1186 -0
- package/package.json +11 -11
- package/dist/components/snice-cell-C9N6yGxQ.js +0 -4
- package/dist/components/snice-cell-C9N6yGxQ.js.map +0 -1
- package/dist/types/types/index.d.ts +0 -23
- /package/dist/{types/controller.d.ts → controller.d.ts} +0 -0
- /package/dist/{types/global.d.ts → global.d.ts} +0 -0
- /package/dist/{types/observe.d.ts → observe.d.ts} +0 -0
- /package/dist/{types/request-response.d.ts → request-response.d.ts} +0 -0
- /package/dist/{types/router.d.ts → router.d.ts} +0 -0
- /package/dist/{types/testing.d.ts → testing.d.ts} +0 -0
- /package/dist/{types/transitions.d.ts → transitions.d.ts} +0 -0
- /package/dist/types/{types/adopted-options.d.ts → adopted-options.d.ts} +0 -0
- /package/dist/types/{types/app-context.d.ts → app-context.d.ts} +0 -0
- /package/dist/types/{types/dispatch-options.d.ts → dispatch-options.d.ts} +0 -0
- /package/dist/types/{types/guard.d.ts → guard.d.ts} +0 -0
- /package/dist/types/{types/i-controller.d.ts → i-controller.d.ts} +0 -0
- /package/dist/types/{types/moved-options.d.ts → moved-options.d.ts} +0 -0
- /package/dist/types/{types/observe-options.d.ts → observe-options.d.ts} +0 -0
- /package/dist/types/{types/page-options.d.ts → page-options.d.ts} +0 -0
- /package/dist/types/{types/part-options.d.ts → part-options.d.ts} +0 -0
- /package/dist/types/{types/property-converter.d.ts → property-converter.d.ts} +0 -0
- /package/dist/types/{types/property-options.d.ts → property-options.d.ts} +0 -0
- /package/dist/types/{types/query-options.d.ts → query-options.d.ts} +0 -0
- /package/dist/types/{types/request-options.d.ts → request-options.d.ts} +0 -0
- /package/dist/types/{types/respond-options.d.ts → respond-options.d.ts} +0 -0
- /package/dist/types/{types/route-params.d.ts → route-params.d.ts} +0 -0
- /package/dist/types/{types/router-instance.d.ts → router-instance.d.ts} +0 -0
- /package/dist/types/{types/router-options.d.ts → router-options.d.ts} +0 -0
- /package/dist/types/{types/simple-array.d.ts → simple-array.d.ts} +0 -0
- /package/dist/types/{types/snice-element.d.ts → snice-element.d.ts} +0 -0
- /package/dist/types/{types/snice-global.d.ts → snice-global.d.ts} +0 -0
- /package/dist/types/{types/transition.d.ts → transition.d.ts} +0 -0
- /package/dist/{types/utils.d.ts → utils.d.ts} +0 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
# Toast Components
|
|
2
|
+
|
|
3
|
+
The toast notification system provides temporary, non-blocking messages to users. It consists of two components and a static API for programmatic toast creation.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Components](#components)
|
|
7
|
+
- [Basic Usage](#basic-usage)
|
|
8
|
+
- [Static API](#static-api)
|
|
9
|
+
- [Properties](#properties)
|
|
10
|
+
- [Methods](#methods)
|
|
11
|
+
- [Examples](#examples)
|
|
12
|
+
|
|
13
|
+
## Components
|
|
14
|
+
|
|
15
|
+
### `<snice-toast>`
|
|
16
|
+
Individual toast notification element.
|
|
17
|
+
|
|
18
|
+
### `<snice-toast-container>`
|
|
19
|
+
Container that manages and positions multiple toast notifications.
|
|
20
|
+
|
|
21
|
+
## Basic Usage
|
|
22
|
+
|
|
23
|
+
### Using the Static API (Recommended)
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import Toast from 'snice/components/toast/snice-toast-container';
|
|
27
|
+
|
|
28
|
+
// Show different toast types
|
|
29
|
+
Toast.success('Operation completed successfully!');
|
|
30
|
+
Toast.error('An error occurred');
|
|
31
|
+
Toast.warning('Please review your input');
|
|
32
|
+
Toast.info('New update available');
|
|
33
|
+
|
|
34
|
+
// With options
|
|
35
|
+
Toast.show('Custom message', {
|
|
36
|
+
type: 'success',
|
|
37
|
+
duration: 5000,
|
|
38
|
+
position: 'top-right',
|
|
39
|
+
closable: true,
|
|
40
|
+
icon: true
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Using Container Element
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<snice-toast-container id="toaster" position="bottom-center"></snice-toast-container>
|
|
48
|
+
|
|
49
|
+
<script type="module">
|
|
50
|
+
import 'snice/components/toast/snice-toast-container';
|
|
51
|
+
|
|
52
|
+
const container = document.querySelector('#toaster');
|
|
53
|
+
|
|
54
|
+
// Show a toast
|
|
55
|
+
const id = container.show('Hello, world!', { type: 'success' });
|
|
56
|
+
|
|
57
|
+
// Hide specific toast
|
|
58
|
+
container.hide(id);
|
|
59
|
+
|
|
60
|
+
// Clear all toasts
|
|
61
|
+
container.clear();
|
|
62
|
+
</script>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Static API
|
|
66
|
+
|
|
67
|
+
### `Toast.show(message, options?): Promise<string>`
|
|
68
|
+
Show a toast with any type.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
const id = await Toast.show('Message', {
|
|
72
|
+
type: 'info',
|
|
73
|
+
duration: 4000,
|
|
74
|
+
position: 'bottom-center',
|
|
75
|
+
closable: true,
|
|
76
|
+
icon: true
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### `Toast.success(message, options?): Promise<string>`
|
|
81
|
+
Show a success toast (green).
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
await Toast.success('Profile updated successfully');
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `Toast.error(message, options?): Promise<string>`
|
|
88
|
+
Show an error toast (red).
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
await Toast.error('Failed to save changes');
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `Toast.warning(message, options?): Promise<string>`
|
|
95
|
+
Show a warning toast (orange).
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
await Toast.warning('Your session will expire soon');
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `Toast.info(message, options?): Promise<string>`
|
|
102
|
+
Show an info toast (blue).
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
await Toast.info('5 new messages');
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `Toast.hide(id: string): void`
|
|
109
|
+
Hide a specific toast by its ID.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
const id = await Toast.show('Saving...');
|
|
113
|
+
// Later...
|
|
114
|
+
Toast.hide(id);
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `Toast.clear(): void`
|
|
118
|
+
Clear all visible toasts.
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
Toast.clear();
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Properties
|
|
125
|
+
|
|
126
|
+
### Toast Container
|
|
127
|
+
|
|
128
|
+
| Property | Type | Default | Description |
|
|
129
|
+
|----------|------|---------|-------------|
|
|
130
|
+
| `position` | `ToastPosition` | `'bottom-center'` | Container position on screen |
|
|
131
|
+
|
|
132
|
+
**ToastPosition:**
|
|
133
|
+
- `'top-left'`
|
|
134
|
+
- `'top-center'`
|
|
135
|
+
- `'top-right'`
|
|
136
|
+
- `'bottom-left'`
|
|
137
|
+
- `'bottom-center'`
|
|
138
|
+
- `'bottom-right'`
|
|
139
|
+
|
|
140
|
+
### Individual Toast
|
|
141
|
+
|
|
142
|
+
| Property | Type | Default | Description |
|
|
143
|
+
|----------|------|---------|-------------|
|
|
144
|
+
| `type` | `ToastType` | `'info'` | Visual style of toast |
|
|
145
|
+
| `message` | `string` | `''` | Toast message text |
|
|
146
|
+
| `closable` | `boolean` | `true` | Show close button |
|
|
147
|
+
| `icon` | `boolean` | `true` | Show type icon |
|
|
148
|
+
|
|
149
|
+
**ToastType:**
|
|
150
|
+
- `'success'` - Green, checkmark icon
|
|
151
|
+
- `'error'` - Red, error icon
|
|
152
|
+
- `'warning'` - Orange, warning icon
|
|
153
|
+
- `'info'` - Blue, info icon
|
|
154
|
+
|
|
155
|
+
## Methods
|
|
156
|
+
|
|
157
|
+
### Container Methods
|
|
158
|
+
|
|
159
|
+
#### `show(message: string, options?: ToastOptions): string`
|
|
160
|
+
Show a new toast and return its ID.
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
const id = container.show('Success!', {
|
|
164
|
+
type: 'success',
|
|
165
|
+
duration: 3000,
|
|
166
|
+
closable: true,
|
|
167
|
+
icon: true,
|
|
168
|
+
id: 'custom-id' // Optional custom ID
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**ToastOptions:**
|
|
173
|
+
```typescript
|
|
174
|
+
interface ToastOptions {
|
|
175
|
+
type?: ToastType; // Default: 'info'
|
|
176
|
+
duration?: number; // ms, 0 for no auto-dismiss, default: 4000
|
|
177
|
+
position?: ToastPosition; // Only used with static API
|
|
178
|
+
closable?: boolean; // Default: true
|
|
179
|
+
icon?: boolean; // Default: true
|
|
180
|
+
id?: string; // Custom ID, auto-generated if not provided
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### `hide(id: string): void`
|
|
185
|
+
Hide a specific toast by ID.
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
container.hide('toast-1');
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
#### `clear(): void`
|
|
192
|
+
Remove all toasts from the container.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
container.clear();
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Toast Methods
|
|
199
|
+
|
|
200
|
+
#### `hide(): void`
|
|
201
|
+
Start the hide animation for this toast.
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
toast.hide();
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Examples
|
|
208
|
+
|
|
209
|
+
### Basic Notifications
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
import Toast from 'snice/components/toast/snice-toast-container';
|
|
213
|
+
|
|
214
|
+
// Success notification
|
|
215
|
+
document.querySelector('#saveBtn').addEventListener('click', async () => {
|
|
216
|
+
try {
|
|
217
|
+
await saveData();
|
|
218
|
+
Toast.success('Changes saved successfully');
|
|
219
|
+
} catch (error) {
|
|
220
|
+
Toast.error('Failed to save changes');
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// Info notification
|
|
225
|
+
Toast.info('Welcome back, John!');
|
|
226
|
+
|
|
227
|
+
// Warning notification
|
|
228
|
+
if (diskSpace < 10) {
|
|
229
|
+
Toast.warning('Low disk space');
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Custom Duration
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
// Short toast (2 seconds)
|
|
237
|
+
Toast.show('Quick message', { duration: 2000 });
|
|
238
|
+
|
|
239
|
+
// Long toast (10 seconds)
|
|
240
|
+
Toast.show('Important message', { duration: 10000 });
|
|
241
|
+
|
|
242
|
+
// Persistent toast (no auto-dismiss)
|
|
243
|
+
const id = Toast.show('Click X to close', { duration: 0 });
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Position Variants
|
|
247
|
+
|
|
248
|
+
```html
|
|
249
|
+
<button onclick="Toast.show('Top Left', { position: 'top-left' })">
|
|
250
|
+
Top Left
|
|
251
|
+
</button>
|
|
252
|
+
<button onclick="Toast.show('Top Center', { position: 'top-center' })">
|
|
253
|
+
Top Center
|
|
254
|
+
</button>
|
|
255
|
+
<button onclick="Toast.show('Top Right', { position: 'top-right' })">
|
|
256
|
+
Top Right
|
|
257
|
+
</button>
|
|
258
|
+
<button onclick="Toast.show('Bottom Left', { position: 'bottom-left' })">
|
|
259
|
+
Bottom Left
|
|
260
|
+
</button>
|
|
261
|
+
<button onclick="Toast.show('Bottom Center', { position: 'bottom-center' })">
|
|
262
|
+
Bottom Center
|
|
263
|
+
</button>
|
|
264
|
+
<button onclick="Toast.show('Bottom Right', { position: 'bottom-right' })">
|
|
265
|
+
Bottom Right
|
|
266
|
+
</button>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Manual Control
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
// Show loading toast
|
|
273
|
+
const loadingId = Toast.info('Loading data...', { duration: 0 });
|
|
274
|
+
|
|
275
|
+
// Fetch data
|
|
276
|
+
const data = await fetchData();
|
|
277
|
+
|
|
278
|
+
// Hide loading toast
|
|
279
|
+
Toast.hide(loadingId);
|
|
280
|
+
|
|
281
|
+
// Show success
|
|
282
|
+
Toast.success('Data loaded');
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Without Icon
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
Toast.show('Plain message', { icon: false });
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Non-Closable
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
Toast.show('Cannot be closed manually', {
|
|
295
|
+
closable: false,
|
|
296
|
+
duration: 3000 // Will auto-dismiss
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Multiple Containers
|
|
301
|
+
|
|
302
|
+
```html
|
|
303
|
+
<snice-toast-container id="alerts" position="top-right"></snice-toast-container>
|
|
304
|
+
<snice-toast-container id="messages" position="bottom-left"></snice-toast-container>
|
|
305
|
+
|
|
306
|
+
<script type="module">
|
|
307
|
+
import 'snice/components/toast/snice-toast-container';
|
|
308
|
+
|
|
309
|
+
const alerts = document.querySelector('#alerts');
|
|
310
|
+
const messages = document.querySelector('#messages');
|
|
311
|
+
|
|
312
|
+
alerts.show('System alert', { type: 'warning' });
|
|
313
|
+
messages.show('New message', { type: 'info' });
|
|
314
|
+
</script>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Form Validation
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
const form = document.querySelector('form');
|
|
321
|
+
|
|
322
|
+
form.addEventListener('submit', async (e) => {
|
|
323
|
+
e.preventDefault();
|
|
324
|
+
|
|
325
|
+
const formData = new FormData(form);
|
|
326
|
+
|
|
327
|
+
// Validate
|
|
328
|
+
if (!formData.get('email')) {
|
|
329
|
+
Toast.error('Email is required');
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (!formData.get('password')) {
|
|
334
|
+
Toast.error('Password is required');
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Show loading
|
|
339
|
+
const loadingId = Toast.info('Submitting...', { duration: 0 });
|
|
340
|
+
|
|
341
|
+
try {
|
|
342
|
+
await submitForm(formData);
|
|
343
|
+
Toast.hide(loadingId);
|
|
344
|
+
Toast.success('Form submitted successfully');
|
|
345
|
+
} catch (error) {
|
|
346
|
+
Toast.hide(loadingId);
|
|
347
|
+
Toast.error(error.message);
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### File Upload Progress
|
|
353
|
+
|
|
354
|
+
```typescript
|
|
355
|
+
async function uploadFile(file) {
|
|
356
|
+
const uploadId = Toast.info(`Uploading ${file.name}...`, { duration: 0 });
|
|
357
|
+
|
|
358
|
+
try {
|
|
359
|
+
await upload(file);
|
|
360
|
+
Toast.hide(uploadId);
|
|
361
|
+
Toast.success(`${file.name} uploaded`);
|
|
362
|
+
} catch (error) {
|
|
363
|
+
Toast.hide(uploadId);
|
|
364
|
+
Toast.error(`Failed to upload ${file.name}`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Batch Operations
|
|
370
|
+
|
|
371
|
+
```typescript
|
|
372
|
+
async function deleteMultiple(ids) {
|
|
373
|
+
Toast.info(`Deleting ${ids.length} items...`);
|
|
374
|
+
|
|
375
|
+
const results = await Promise.allSettled(
|
|
376
|
+
ids.map(id => deleteItem(id))
|
|
377
|
+
);
|
|
378
|
+
|
|
379
|
+
const succeeded = results.filter(r => r.status === 'fulfilled').length;
|
|
380
|
+
const failed = results.filter(r => r.status === 'rejected').length;
|
|
381
|
+
|
|
382
|
+
if (succeeded > 0) {
|
|
383
|
+
Toast.success(`Deleted ${succeeded} items`);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (failed > 0) {
|
|
387
|
+
Toast.error(`Failed to delete ${failed} items`);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Undo Action
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
let undoTimeout;
|
|
396
|
+
|
|
397
|
+
function deleteItem(id) {
|
|
398
|
+
const item = getItem(id);
|
|
399
|
+
item.deleted = true;
|
|
400
|
+
|
|
401
|
+
const toastId = Toast.warning('Item deleted', {
|
|
402
|
+
duration: 5000,
|
|
403
|
+
closable: false
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// Create undo button
|
|
407
|
+
setTimeout(() => {
|
|
408
|
+
Toast.hide(toastId);
|
|
409
|
+
Toast.show('Click to undo', {
|
|
410
|
+
duration: 5000,
|
|
411
|
+
type: 'info'
|
|
412
|
+
});
|
|
413
|
+
}, 100);
|
|
414
|
+
|
|
415
|
+
undoTimeout = setTimeout(() => {
|
|
416
|
+
permanentlyDelete(id);
|
|
417
|
+
}, 5000);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function undo() {
|
|
421
|
+
clearTimeout(undoTimeout);
|
|
422
|
+
item.deleted = false;
|
|
423
|
+
Toast.success('Deletion cancelled');
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Network Status
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
window.addEventListener('online', () => {
|
|
431
|
+
Toast.success('Back online');
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
window.addEventListener('offline', () => {
|
|
435
|
+
Toast.error('No internet connection', { duration: 0 });
|
|
436
|
+
});
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
## Accessibility
|
|
440
|
+
|
|
441
|
+
- **role="alert"**: Each toast has `role="alert"` to announce to screen readers
|
|
442
|
+
- **aria-live="polite"**: Non-intrusive announcements
|
|
443
|
+
- **Close button**: Keyboard accessible with aria-label
|
|
444
|
+
- **Focus management**: Close button receives focus when interacted with
|
|
445
|
+
|
|
446
|
+
## Behavior
|
|
447
|
+
|
|
448
|
+
### Auto-Dismiss
|
|
449
|
+
- Default duration: 4000ms (4 seconds)
|
|
450
|
+
- Set `duration: 0` to disable auto-dismiss
|
|
451
|
+
- Toast fades out with animation before removal
|
|
452
|
+
|
|
453
|
+
### Positioning
|
|
454
|
+
- **Top positions**: New toasts appear at top (newest first)
|
|
455
|
+
- **Bottom positions**: New toasts appear at bottom (newest last)
|
|
456
|
+
|
|
457
|
+
### Animation
|
|
458
|
+
- Slide in from top/bottom based on position
|
|
459
|
+
- Slide out when closing
|
|
460
|
+
- 300ms animation duration
|
|
461
|
+
|
|
462
|
+
### Global Container
|
|
463
|
+
- Static API automatically creates/reuses a global container
|
|
464
|
+
- First container element becomes the global container
|
|
465
|
+
- Position can be changed dynamically
|
|
466
|
+
|
|
467
|
+
## Browser Support
|
|
468
|
+
|
|
469
|
+
- Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
470
|
+
- Requires Custom Elements v1 and Shadow DOM support
|
|
471
|
+
|
|
472
|
+
## Best Practices
|
|
473
|
+
|
|
474
|
+
1. **Keep messages short**: Toasts should be scannable at a glance
|
|
475
|
+
2. **Use appropriate types**: Match the toast type to the message severity
|
|
476
|
+
3. **Set reasonable durations**: 2-5 seconds for normal messages
|
|
477
|
+
4. **Avoid too many toasts**: Clear old toasts before showing many new ones
|
|
478
|
+
5. **Don't rely solely on color**: Icons help distinguish toast types
|
|
479
|
+
6. **Provide actions when needed**: Use persistent toasts with manual dismiss for important actions
|
|
480
|
+
7. **Position consistently**: Choose one primary position for your app's toasts
|
|
481
|
+
|
|
482
|
+
## Common Patterns
|
|
483
|
+
|
|
484
|
+
### Success/Error Pattern
|
|
485
|
+
```typescript
|
|
486
|
+
try {
|
|
487
|
+
await action();
|
|
488
|
+
Toast.success('Success message');
|
|
489
|
+
} catch (error) {
|
|
490
|
+
Toast.error(error.message);
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### Loading Pattern
|
|
495
|
+
```typescript
|
|
496
|
+
const id = Toast.info('Loading...', { duration: 0 });
|
|
497
|
+
await operation();
|
|
498
|
+
Toast.hide(id);
|
|
499
|
+
Toast.success('Complete');
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Temporary Undo Pattern
|
|
503
|
+
```typescript
|
|
504
|
+
const id = Toast.warning('Item deleted. Click to undo', { duration: 5000 });
|
|
505
|
+
// Provide undo mechanism within 5 seconds
|
|
506
|
+
```
|