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,546 @@
|
|
|
1
|
+
# Tabs Components
|
|
2
|
+
|
|
3
|
+
The tabs components provide a flexible tabbed interface for organizing content into separate panels. The system consists of three components working together: `<snice-tabs>` (container), `<snice-tab>` (tab buttons), and `<snice-tab-panel>` (content panels).
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Basic Usage](#basic-usage)
|
|
7
|
+
- [Components](#components)
|
|
8
|
+
- [snice-tabs](#snice-tabs)
|
|
9
|
+
- [snice-tab](#snice-tab)
|
|
10
|
+
- [snice-tab-panel](#snice-tab-panel)
|
|
11
|
+
- [Properties](#properties)
|
|
12
|
+
- [Methods](#methods)
|
|
13
|
+
- [Events](#events)
|
|
14
|
+
- [Variants](#variants)
|
|
15
|
+
- [Examples](#examples)
|
|
16
|
+
|
|
17
|
+
## Basic Usage
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<snice-tabs>
|
|
21
|
+
<snice-tab slot="nav">Tab 1</snice-tab>
|
|
22
|
+
<snice-tab slot="nav">Tab 2</snice-tab>
|
|
23
|
+
<snice-tab slot="nav">Tab 3</snice-tab>
|
|
24
|
+
|
|
25
|
+
<snice-tab-panel>Content for tab 1</snice-tab-panel>
|
|
26
|
+
<snice-tab-panel>Content for tab 2</snice-tab-panel>
|
|
27
|
+
<snice-tab-panel>Content for tab 3</snice-tab-panel>
|
|
28
|
+
</snice-tabs>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import 'snice/components/tabs/snice-tabs';
|
|
33
|
+
import 'snice/components/tabs/snice-tab';
|
|
34
|
+
import 'snice/components/tabs/snice-tab-panel';
|
|
35
|
+
|
|
36
|
+
const tabs = document.querySelector('snice-tabs');
|
|
37
|
+
tabs.addEventListener('@snice/tab-change', (e) => {
|
|
38
|
+
console.log('Tab changed to:', e.detail.index);
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Components
|
|
43
|
+
|
|
44
|
+
### snice-tabs
|
|
45
|
+
|
|
46
|
+
The main container component that manages tab navigation and panel visibility.
|
|
47
|
+
|
|
48
|
+
#### Properties
|
|
49
|
+
|
|
50
|
+
| Property | Type | Default | Description |
|
|
51
|
+
|----------|------|---------|-------------|
|
|
52
|
+
| `selected` | `number` | `0` | Index of the currently selected tab |
|
|
53
|
+
| `placement` | `'top' \| 'bottom' \| 'start' \| 'end'` | `'top'` | Position of the tab navigation |
|
|
54
|
+
| `noScrollControls` | `boolean` | `false` | Hide the scroll buttons for overflowing tabs |
|
|
55
|
+
| `transition` | `string` | `'none'` | Transition effect when switching panels |
|
|
56
|
+
|
|
57
|
+
#### Methods
|
|
58
|
+
|
|
59
|
+
##### `selectTab(index: number): void`
|
|
60
|
+
Select a tab by its index.
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
tabs.selectTab(2);
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
##### `show(index: number): void`
|
|
67
|
+
Alias for `selectTab()`. Shows the tab at the specified index.
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
tabs.show(1);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
##### `getTab(index: number): SniceTabElement | undefined`
|
|
74
|
+
Get a tab element by its index.
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const tab = tabs.getTab(0);
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
##### `getPanel(index: number): SniceTabPanelElement | undefined`
|
|
81
|
+
Get a panel element by its index.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
const panel = tabs.getPanel(0);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Events
|
|
88
|
+
|
|
89
|
+
##### `@snice/tab-change`
|
|
90
|
+
Fired when the active tab changes.
|
|
91
|
+
|
|
92
|
+
**Event Detail:**
|
|
93
|
+
```typescript
|
|
94
|
+
{
|
|
95
|
+
index: number; // New tab index
|
|
96
|
+
oldIndex: number; // Previous tab index
|
|
97
|
+
tab: SniceTabElement; // Reference to the selected tab element
|
|
98
|
+
panel: SniceTabPanelElement; // Reference to the selected panel element
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Usage:**
|
|
103
|
+
```typescript
|
|
104
|
+
tabs.addEventListener('@snice/tab-change', (e) => {
|
|
105
|
+
const { index, oldIndex, tab, panel } = e.detail;
|
|
106
|
+
console.log(`Changed from tab ${oldIndex} to ${index}`);
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### snice-tab
|
|
111
|
+
|
|
112
|
+
Individual tab button component. Must be placed inside `<snice-tabs>` with `slot="nav"`.
|
|
113
|
+
|
|
114
|
+
#### Properties
|
|
115
|
+
|
|
116
|
+
| Property | Type | Default | Description |
|
|
117
|
+
|----------|------|---------|-------------|
|
|
118
|
+
| `disabled` | `boolean` | `false` | Whether the tab is disabled |
|
|
119
|
+
| `closable` | `boolean` | `false` | Whether to show a close button |
|
|
120
|
+
|
|
121
|
+
#### Methods
|
|
122
|
+
|
|
123
|
+
##### `focus(): void`
|
|
124
|
+
Give focus to the tab.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
tab.focus();
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
##### `blur(): void`
|
|
131
|
+
Remove focus from the tab.
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
tab.blur();
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Events
|
|
138
|
+
|
|
139
|
+
##### `@snice/tab-select`
|
|
140
|
+
Fired when the tab is clicked (bubbles to parent tabs container).
|
|
141
|
+
|
|
142
|
+
**Event Detail:**
|
|
143
|
+
```typescript
|
|
144
|
+
{
|
|
145
|
+
tab: SniceTabElement; // Reference to the clicked tab
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
##### `@snice/close`
|
|
150
|
+
Fired when the close button is clicked (only if `closable` is true).
|
|
151
|
+
|
|
152
|
+
**Event Detail:**
|
|
153
|
+
```typescript
|
|
154
|
+
{
|
|
155
|
+
tab: SniceTabElement; // Reference to the tab being closed
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### snice-tab-panel
|
|
160
|
+
|
|
161
|
+
Content panel component. Must be placed inside `<snice-tabs>` in the default slot.
|
|
162
|
+
|
|
163
|
+
#### Properties
|
|
164
|
+
|
|
165
|
+
| Property | Type | Default | Description |
|
|
166
|
+
|----------|------|---------|-------------|
|
|
167
|
+
| `name` | `string` | `''` | Optional identifier for the panel |
|
|
168
|
+
| `transitionIn` | `string` | `''` | Transition effect when showing |
|
|
169
|
+
| `transitionOut` | `string` | `''` | Transition effect when hiding |
|
|
170
|
+
| `transitioning` | `'in' \| 'out' \| ''` | `''` | Current transition state |
|
|
171
|
+
| `transitionDuration` | `number` | `300` | Duration of transition in milliseconds |
|
|
172
|
+
|
|
173
|
+
## Variants
|
|
174
|
+
|
|
175
|
+
### Tab Placement
|
|
176
|
+
|
|
177
|
+
Control where the tab navigation appears relative to the content.
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<!-- Top (default) -->
|
|
181
|
+
<snice-tabs placement="top">
|
|
182
|
+
<!-- ... -->
|
|
183
|
+
</snice-tabs>
|
|
184
|
+
|
|
185
|
+
<!-- Bottom -->
|
|
186
|
+
<snice-tabs placement="bottom">
|
|
187
|
+
<!-- ... -->
|
|
188
|
+
</snice-tabs>
|
|
189
|
+
|
|
190
|
+
<!-- Start (left in LTR) -->
|
|
191
|
+
<snice-tabs placement="start">
|
|
192
|
+
<!-- ... -->
|
|
193
|
+
</snice-tabs>
|
|
194
|
+
|
|
195
|
+
<!-- End (right in LTR) -->
|
|
196
|
+
<snice-tabs placement="end">
|
|
197
|
+
<!-- ... -->
|
|
198
|
+
</snice-tabs>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Closable Tabs
|
|
202
|
+
|
|
203
|
+
```html
|
|
204
|
+
<snice-tabs>
|
|
205
|
+
<snice-tab slot="nav" closable>Closable Tab</snice-tab>
|
|
206
|
+
<snice-tab slot="nav">Regular Tab</snice-tab>
|
|
207
|
+
|
|
208
|
+
<snice-tab-panel>Content 1</snice-tab-panel>
|
|
209
|
+
<snice-tab-panel>Content 2</snice-tab-panel>
|
|
210
|
+
</snice-tabs>
|
|
211
|
+
|
|
212
|
+
<script type="module">
|
|
213
|
+
import 'snice/components/tabs/snice-tabs';
|
|
214
|
+
import 'snice/components/tabs/snice-tab';
|
|
215
|
+
import 'snice/components/tabs/snice-tab-panel';
|
|
216
|
+
|
|
217
|
+
const tabs = document.querySelectorAll('snice-tab');
|
|
218
|
+
tabs.forEach(tab => {
|
|
219
|
+
tab.addEventListener('@snice/close', (e) => {
|
|
220
|
+
console.log('Tab closed:', e.detail.tab);
|
|
221
|
+
// Handle tab removal
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
</script>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Disabled Tabs
|
|
228
|
+
|
|
229
|
+
```html
|
|
230
|
+
<snice-tabs>
|
|
231
|
+
<snice-tab slot="nav">Active Tab</snice-tab>
|
|
232
|
+
<snice-tab slot="nav" disabled>Disabled Tab</snice-tab>
|
|
233
|
+
<snice-tab slot="nav">Active Tab</snice-tab>
|
|
234
|
+
|
|
235
|
+
<snice-tab-panel>Content 1</snice-tab-panel>
|
|
236
|
+
<snice-tab-panel>Content 2</snice-tab-panel>
|
|
237
|
+
<snice-tab-panel>Content 3</snice-tab-panel>
|
|
238
|
+
</snice-tabs>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Without Scroll Controls
|
|
242
|
+
|
|
243
|
+
```html
|
|
244
|
+
<snice-tabs no-scroll-controls>
|
|
245
|
+
<snice-tab slot="nav">Tab 1</snice-tab>
|
|
246
|
+
<snice-tab slot="nav">Tab 2</snice-tab>
|
|
247
|
+
<snice-tab slot="nav">Tab 3</snice-tab>
|
|
248
|
+
|
|
249
|
+
<snice-tab-panel>Content 1</snice-tab-panel>
|
|
250
|
+
<snice-tab-panel>Content 2</snice-tab-panel>
|
|
251
|
+
<snice-tab-panel>Content 3</snice-tab-panel>
|
|
252
|
+
</snice-tabs>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Examples
|
|
256
|
+
|
|
257
|
+
### Basic Tabs
|
|
258
|
+
|
|
259
|
+
```html
|
|
260
|
+
<snice-tabs>
|
|
261
|
+
<snice-tab slot="nav">Home</snice-tab>
|
|
262
|
+
<snice-tab slot="nav">Profile</snice-tab>
|
|
263
|
+
<snice-tab slot="nav">Settings</snice-tab>
|
|
264
|
+
|
|
265
|
+
<snice-tab-panel>
|
|
266
|
+
<h2>Home</h2>
|
|
267
|
+
<p>Welcome to the home page!</p>
|
|
268
|
+
</snice-tab-panel>
|
|
269
|
+
|
|
270
|
+
<snice-tab-panel>
|
|
271
|
+
<h2>Profile</h2>
|
|
272
|
+
<p>Your profile information...</p>
|
|
273
|
+
</snice-tab-panel>
|
|
274
|
+
|
|
275
|
+
<snice-tab-panel>
|
|
276
|
+
<h2>Settings</h2>
|
|
277
|
+
<p>Application settings...</p>
|
|
278
|
+
</snice-tab-panel>
|
|
279
|
+
</snice-tabs>
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Programmatic Tab Control
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
import type { SniceTabsElement } from 'snice/components/tabs/snice-tabs.types';
|
|
286
|
+
|
|
287
|
+
const tabs = document.querySelector<SniceTabsElement>('snice-tabs');
|
|
288
|
+
|
|
289
|
+
// Navigate to specific tab
|
|
290
|
+
tabs.selectTab(2);
|
|
291
|
+
|
|
292
|
+
// Or use show()
|
|
293
|
+
tabs.show(1);
|
|
294
|
+
|
|
295
|
+
// Get references
|
|
296
|
+
const tab = tabs.getTab(0);
|
|
297
|
+
const panel = tabs.getPanel(0);
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### With Event Handling
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
const tabs = document.querySelector('snice-tabs');
|
|
304
|
+
|
|
305
|
+
tabs.addEventListener('@snice/tab-change', (e) => {
|
|
306
|
+
const { index, oldIndex, tab, panel } = e.detail;
|
|
307
|
+
|
|
308
|
+
// Load content dynamically
|
|
309
|
+
if (!panel.hasAttribute('data-loaded')) {
|
|
310
|
+
loadPanelContent(index, panel);
|
|
311
|
+
panel.setAttribute('data-loaded', 'true');
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
async function loadPanelContent(index: number, panel: HTMLElement) {
|
|
316
|
+
const response = await fetch(`/api/tab-content/${index}`);
|
|
317
|
+
const content = await response.text();
|
|
318
|
+
panel.innerHTML = content;
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Dynamic Tabs
|
|
323
|
+
|
|
324
|
+
```html
|
|
325
|
+
<snice-tabs id="dynamicTabs"></snice-tabs>
|
|
326
|
+
|
|
327
|
+
<button id="addTab">Add Tab</button>
|
|
328
|
+
|
|
329
|
+
<script type="module">
|
|
330
|
+
import 'snice/components/tabs/snice-tabs';
|
|
331
|
+
import 'snice/components/tabs/snice-tab';
|
|
332
|
+
import 'snice/components/tabs/snice-tab-panel';
|
|
333
|
+
|
|
334
|
+
const tabs = document.querySelector('#dynamicTabs');
|
|
335
|
+
let tabCount = 0;
|
|
336
|
+
|
|
337
|
+
function addTab() {
|
|
338
|
+
tabCount++;
|
|
339
|
+
|
|
340
|
+
const tab = document.createElement('snice-tab');
|
|
341
|
+
tab.setAttribute('slot', 'nav');
|
|
342
|
+
tab.setAttribute('closable', 'true');
|
|
343
|
+
tab.textContent = `Tab ${tabCount}`;
|
|
344
|
+
|
|
345
|
+
const panel = document.createElement('snice-tab-panel');
|
|
346
|
+
panel.textContent = `Content for tab ${tabCount}`;
|
|
347
|
+
|
|
348
|
+
tabs.appendChild(tab);
|
|
349
|
+
tabs.appendChild(panel);
|
|
350
|
+
|
|
351
|
+
// Handle close
|
|
352
|
+
tab.addEventListener('@snice/close', () => {
|
|
353
|
+
const index = Array.from(tabs.querySelectorAll('snice-tab')).indexOf(tab);
|
|
354
|
+
const panelToRemove = tabs.querySelectorAll('snice-tab-panel')[index];
|
|
355
|
+
|
|
356
|
+
tab.remove();
|
|
357
|
+
panelToRemove.remove();
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// Select the new tab
|
|
361
|
+
const newIndex = tabs.querySelectorAll('snice-tab').length - 1;
|
|
362
|
+
tabs.selectTab(newIndex);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
document.querySelector('#addTab').addEventListener('click', addTab);
|
|
366
|
+
|
|
367
|
+
// Add initial tab
|
|
368
|
+
addTab();
|
|
369
|
+
</script>
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### With Transitions
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<snice-tabs transition="fade">
|
|
376
|
+
<snice-tab slot="nav">Tab 1</snice-tab>
|
|
377
|
+
<snice-tab slot="nav">Tab 2</snice-tab>
|
|
378
|
+
<snice-tab slot="nav">Tab 3</snice-tab>
|
|
379
|
+
|
|
380
|
+
<snice-tab-panel>
|
|
381
|
+
<h2>Panel 1</h2>
|
|
382
|
+
<p>Content with fade transition</p>
|
|
383
|
+
</snice-tab-panel>
|
|
384
|
+
|
|
385
|
+
<snice-tab-panel>
|
|
386
|
+
<h2>Panel 2</h2>
|
|
387
|
+
<p>Content with fade transition</p>
|
|
388
|
+
</snice-tab-panel>
|
|
389
|
+
|
|
390
|
+
<snice-tab-panel>
|
|
391
|
+
<h2>Panel 3</h2>
|
|
392
|
+
<p>Content with fade transition</p>
|
|
393
|
+
</snice-tab-panel>
|
|
394
|
+
</snice-tabs>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Vertical Tabs
|
|
398
|
+
|
|
399
|
+
```html
|
|
400
|
+
<snice-tabs placement="start">
|
|
401
|
+
<snice-tab slot="nav">Dashboard</snice-tab>
|
|
402
|
+
<snice-tab slot="nav">Analytics</snice-tab>
|
|
403
|
+
<snice-tab slot="nav">Reports</snice-tab>
|
|
404
|
+
<snice-tab slot="nav">Settings</snice-tab>
|
|
405
|
+
|
|
406
|
+
<snice-tab-panel>
|
|
407
|
+
<h2>Dashboard</h2>
|
|
408
|
+
<p>Dashboard content...</p>
|
|
409
|
+
</snice-tab-panel>
|
|
410
|
+
|
|
411
|
+
<snice-tab-panel>
|
|
412
|
+
<h2>Analytics</h2>
|
|
413
|
+
<p>Analytics content...</p>
|
|
414
|
+
</snice-tab-panel>
|
|
415
|
+
|
|
416
|
+
<snice-tab-panel>
|
|
417
|
+
<h2>Reports</h2>
|
|
418
|
+
<p>Reports content...</p>
|
|
419
|
+
</snice-tab-panel>
|
|
420
|
+
|
|
421
|
+
<snice-tab-panel>
|
|
422
|
+
<h2>Settings</h2>
|
|
423
|
+
<p>Settings content...</p>
|
|
424
|
+
</snice-tab-panel>
|
|
425
|
+
</snice-tabs>
|
|
426
|
+
|
|
427
|
+
<style>
|
|
428
|
+
snice-tabs[placement="start"],
|
|
429
|
+
snice-tabs[placement="end"] {
|
|
430
|
+
height: 400px;
|
|
431
|
+
}
|
|
432
|
+
</style>
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Complete Example with All Features
|
|
436
|
+
|
|
437
|
+
```html
|
|
438
|
+
<!DOCTYPE html>
|
|
439
|
+
<html>
|
|
440
|
+
<head>
|
|
441
|
+
<style>
|
|
442
|
+
.tab-demo {
|
|
443
|
+
max-width: 800px;
|
|
444
|
+
margin: 2rem auto;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.panel-content {
|
|
448
|
+
padding: 1rem;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.panel-content h2 {
|
|
452
|
+
margin-top: 0;
|
|
453
|
+
}
|
|
454
|
+
</style>
|
|
455
|
+
|
|
456
|
+
<script type="module">
|
|
457
|
+
import 'snice/components/tabs/snice-tabs';
|
|
458
|
+
import 'snice/components/tabs/snice-tab';
|
|
459
|
+
import 'snice/components/tabs/snice-tab-panel';
|
|
460
|
+
|
|
461
|
+
const tabs = document.querySelector('snice-tabs');
|
|
462
|
+
|
|
463
|
+
// Handle tab changes
|
|
464
|
+
tabs.addEventListener('@snice/tab-change', (e) => {
|
|
465
|
+
console.log('Active tab:', e.detail.index);
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// Handle tab close
|
|
469
|
+
document.querySelectorAll('snice-tab[closable]').forEach(tab => {
|
|
470
|
+
tab.addEventListener('@snice/close', (e) => {
|
|
471
|
+
if (confirm('Close this tab?')) {
|
|
472
|
+
const index = Array.from(tabs.querySelectorAll('snice-tab')).indexOf(e.detail.tab);
|
|
473
|
+
const panel = tabs.querySelectorAll('snice-tab-panel')[index];
|
|
474
|
+
|
|
475
|
+
e.detail.tab.remove();
|
|
476
|
+
panel.remove();
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
</script>
|
|
481
|
+
</head>
|
|
482
|
+
<body>
|
|
483
|
+
<div class="tab-demo">
|
|
484
|
+
<snice-tabs selected="0" transition="fade">
|
|
485
|
+
<snice-tab slot="nav">Overview</snice-tab>
|
|
486
|
+
<snice-tab slot="nav">Details</snice-tab>
|
|
487
|
+
<snice-tab slot="nav" closable>Extra</snice-tab>
|
|
488
|
+
<snice-tab slot="nav" disabled>Disabled</snice-tab>
|
|
489
|
+
|
|
490
|
+
<snice-tab-panel>
|
|
491
|
+
<div class="panel-content">
|
|
492
|
+
<h2>Overview</h2>
|
|
493
|
+
<p>This is the overview tab with general information.</p>
|
|
494
|
+
</div>
|
|
495
|
+
</snice-tab-panel>
|
|
496
|
+
|
|
497
|
+
<snice-tab-panel>
|
|
498
|
+
<div class="panel-content">
|
|
499
|
+
<h2>Details</h2>
|
|
500
|
+
<p>Detailed information goes here.</p>
|
|
501
|
+
</div>
|
|
502
|
+
</snice-tab-panel>
|
|
503
|
+
|
|
504
|
+
<snice-tab-panel>
|
|
505
|
+
<div class="panel-content">
|
|
506
|
+
<h2>Extra Content</h2>
|
|
507
|
+
<p>This tab can be closed.</p>
|
|
508
|
+
</div>
|
|
509
|
+
</snice-tab-panel>
|
|
510
|
+
|
|
511
|
+
<snice-tab-panel>
|
|
512
|
+
<div class="panel-content">
|
|
513
|
+
<h2>Disabled</h2>
|
|
514
|
+
<p>This content is not accessible.</p>
|
|
515
|
+
</div>
|
|
516
|
+
</snice-tab-panel>
|
|
517
|
+
</snice-tabs>
|
|
518
|
+
</div>
|
|
519
|
+
</body>
|
|
520
|
+
</html>
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
## Accessibility
|
|
524
|
+
|
|
525
|
+
The tabs components include proper ARIA attributes and keyboard support:
|
|
526
|
+
|
|
527
|
+
- `role="tablist"` on the navigation container
|
|
528
|
+
- `role="tab"` on each tab element
|
|
529
|
+
- `aria-selected` reflects the current tab state
|
|
530
|
+
- `aria-hidden` on panels to hide inactive content from screen readers
|
|
531
|
+
- `tabindex` management for keyboard navigation
|
|
532
|
+
- Focus management for keyboard users
|
|
533
|
+
- `aria-label` on scroll buttons
|
|
534
|
+
|
|
535
|
+
### Keyboard Support
|
|
536
|
+
|
|
537
|
+
- **Tab**: Move focus into/out of the tab list
|
|
538
|
+
- **Arrow Keys**: Navigate between tabs
|
|
539
|
+
- **Home**: Focus first tab
|
|
540
|
+
- **End**: Focus last tab
|
|
541
|
+
- **Space/Enter**: Activate focused tab
|
|
542
|
+
|
|
543
|
+
## Browser Support
|
|
544
|
+
|
|
545
|
+
- Modern browsers (Chrome, Firefox, Safari, Edge)
|
|
546
|
+
- Requires Custom Elements v1 and Shadow DOM support
|