@winkintel/bootstrap-svelte 0.0.1
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/LICENSE.md +202 -0
- package/README.md +221 -0
- package/dist/Accordion/accordion-body.svelte +8 -0
- package/dist/Accordion/accordion-body.svelte.d.ts +4 -0
- package/dist/Accordion/accordion-button.svelte +25 -0
- package/dist/Accordion/accordion-button.svelte.d.ts +4 -0
- package/dist/Accordion/accordion-collapse.svelte +18 -0
- package/dist/Accordion/accordion-collapse.svelte.d.ts +4 -0
- package/dist/Accordion/accordion-header.svelte +8 -0
- package/dist/Accordion/accordion-header.svelte.d.ts +4 -0
- package/dist/Accordion/accordion-item.svelte +33 -0
- package/dist/Accordion/accordion-item.svelte.d.ts +4 -0
- package/dist/Accordion/accordion.svelte +65 -0
- package/dist/Accordion/accordion.svelte.d.ts +51 -0
- package/dist/Accordion/accordion.svelte.js +139 -0
- package/dist/Accordion/composition.d.ts +7 -0
- package/dist/Accordion/composition.js +6 -0
- package/dist/Accordion/index.d.ts +1 -0
- package/dist/Accordion/index.js +1 -0
- package/dist/Accordion/types.d.ts +15 -0
- package/dist/Accordion/types.js +1 -0
- package/dist/Alert/alert.svelte +73 -0
- package/dist/Alert/alert.svelte.d.ts +46 -0
- package/dist/Alert/index.d.ts +2 -0
- package/dist/Alert/index.js +2 -0
- package/dist/Alert/types.d.ts +11 -0
- package/dist/Alert/types.js +1 -0
- package/dist/Badge/badge.svelte +42 -0
- package/dist/Badge/badge.svelte.d.ts +36 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +2 -0
- package/dist/Badge/types.d.ts +28 -0
- package/dist/Badge/types.js +24 -0
- package/dist/Breadcrumb/breadcrumb-item.svelte +66 -0
- package/dist/Breadcrumb/breadcrumb-item.svelte.d.ts +30 -0
- package/dist/Breadcrumb/breadcrumb.svelte +57 -0
- package/dist/Breadcrumb/breadcrumb.svelte.d.ts +34 -0
- package/dist/Breadcrumb/breadcrumb.svelte.js +41 -0
- package/dist/Breadcrumb/composition.d.ts +3 -0
- package/dist/Breadcrumb/composition.js +2 -0
- package/dist/Breadcrumb/index.d.ts +1 -0
- package/dist/Breadcrumb/index.js +1 -0
- package/dist/Breadcrumb/types.d.ts +9 -0
- package/dist/Breadcrumb/types.js +1 -0
- package/dist/BreakpointListener/breakpoint-listener.svelte +54 -0
- package/dist/BreakpointListener/breakpoint-listener.svelte.d.ts +4 -0
- package/dist/BreakpointListener/index.d.ts +2 -0
- package/dist/BreakpointListener/index.js +2 -0
- package/dist/BreakpointListener/types.d.ts +30 -0
- package/dist/BreakpointListener/types.js +20 -0
- package/dist/Button/button.svelte +87 -0
- package/dist/Button/button.svelte.d.ts +59 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +2 -0
- package/dist/Button/types.d.ts +26 -0
- package/dist/Button/types.js +1 -0
- package/dist/ButtonGroup/button-check.svelte +70 -0
- package/dist/ButtonGroup/button-check.svelte.d.ts +35 -0
- package/dist/ButtonGroup/button-group.svelte +51 -0
- package/dist/ButtonGroup/button-group.svelte.d.ts +43 -0
- package/dist/ButtonGroup/button-toolbar.svelte +36 -0
- package/dist/ButtonGroup/button-toolbar.svelte.d.ts +28 -0
- package/dist/ButtonGroup/index.d.ts +4 -0
- package/dist/ButtonGroup/index.js +4 -0
- package/dist/ButtonGroup/types.d.ts +21 -0
- package/dist/ButtonGroup/types.js +1 -0
- package/dist/Card/card-body.svelte +10 -0
- package/dist/Card/card-body.svelte.d.ts +3 -0
- package/dist/Card/card-footer.svelte +10 -0
- package/dist/Card/card-footer.svelte.d.ts +3 -0
- package/dist/Card/card-group.svelte +10 -0
- package/dist/Card/card-group.svelte.d.ts +3 -0
- package/dist/Card/card-header.svelte +10 -0
- package/dist/Card/card-header.svelte.d.ts +3 -0
- package/dist/Card/card-img-overlay.svelte +10 -0
- package/dist/Card/card-img-overlay.svelte.d.ts +3 -0
- package/dist/Card/card-img.svelte +12 -0
- package/dist/Card/card-img.svelte.d.ts +4 -0
- package/dist/Card/card-link.svelte +10 -0
- package/dist/Card/card-link.svelte.d.ts +4 -0
- package/dist/Card/card-subtitle.svelte +11 -0
- package/dist/Card/card-subtitle.svelte.d.ts +4 -0
- package/dist/Card/card-text.svelte +10 -0
- package/dist/Card/card-text.svelte.d.ts +3 -0
- package/dist/Card/card-title.svelte +11 -0
- package/dist/Card/card-title.svelte.d.ts +4 -0
- package/dist/Card/card.svelte +45 -0
- package/dist/Card/card.svelte.d.ts +38 -0
- package/dist/Card/composition.d.ts +12 -0
- package/dist/Card/composition.js +11 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Card/index.js +1 -0
- package/dist/Card/types.d.ts +22 -0
- package/dist/Card/types.js +1 -0
- package/dist/Carousel/carousel-caption.svelte +30 -0
- package/dist/Carousel/carousel-caption.svelte.d.ts +22 -0
- package/dist/Carousel/carousel-control-next.svelte +35 -0
- package/dist/Carousel/carousel-control-next.svelte.d.ts +21 -0
- package/dist/Carousel/carousel-control-prev.svelte +35 -0
- package/dist/Carousel/carousel-control-prev.svelte.d.ts +21 -0
- package/dist/Carousel/carousel-indicator-button.svelte +41 -0
- package/dist/Carousel/carousel-indicator-button.svelte.d.ts +21 -0
- package/dist/Carousel/carousel-indicators.svelte +33 -0
- package/dist/Carousel/carousel-indicators.svelte.d.ts +25 -0
- package/dist/Carousel/carousel-inner.svelte +30 -0
- package/dist/Carousel/carousel-inner.svelte.d.ts +22 -0
- package/dist/Carousel/carousel-item.svelte +138 -0
- package/dist/Carousel/carousel-item.svelte.d.ts +28 -0
- package/dist/Carousel/carousel.svelte +140 -0
- package/dist/Carousel/carousel.svelte.d.ts +46 -0
- package/dist/Carousel/carousel.svelte.js +551 -0
- package/dist/Carousel/composition.d.ts +9 -0
- package/dist/Carousel/composition.js +8 -0
- package/dist/Carousel/index.d.ts +1 -0
- package/dist/Carousel/index.js +1 -0
- package/dist/Carousel/types.d.ts +74 -0
- package/dist/Carousel/types.js +1 -0
- package/dist/CloseButton/close-button.svelte +32 -0
- package/dist/CloseButton/close-button.svelte.d.ts +29 -0
- package/dist/CloseButton/index.d.ts +2 -0
- package/dist/CloseButton/index.js +2 -0
- package/dist/CloseButton/types.d.ts +6 -0
- package/dist/CloseButton/types.js +1 -0
- package/dist/Col/col.svelte +133 -0
- package/dist/Col/col.svelte.d.ts +60 -0
- package/dist/Col/index.d.ts +2 -0
- package/dist/Col/index.js +2 -0
- package/dist/Col/types.d.ts +30 -0
- package/dist/Col/types.js +1 -0
- package/dist/Collapse/collapse-aria-attachment.svelte.d.ts +3 -0
- package/dist/Collapse/collapse-aria-attachment.svelte.js +32 -0
- package/dist/Collapse/collapse.svelte +63 -0
- package/dist/Collapse/collapse.svelte.d.ts +45 -0
- package/dist/Collapse/index.d.ts +3 -0
- package/dist/Collapse/index.js +3 -0
- package/dist/Collapse/transition.d.ts +5 -0
- package/dist/Collapse/transition.js +75 -0
- package/dist/Collapse/types.d.ts +18 -0
- package/dist/Collapse/types.js +1 -0
- package/dist/Container/container.svelte +46 -0
- package/dist/Container/container.svelte.d.ts +36 -0
- package/dist/Container/index.d.ts +2 -0
- package/dist/Container/index.js +2 -0
- package/dist/Container/types.d.ts +8 -0
- package/dist/Container/types.js +1 -0
- package/dist/Dropdown/composition.d.ts +8 -0
- package/dist/Dropdown/composition.js +7 -0
- package/dist/Dropdown/dropdown-divider.svelte +23 -0
- package/dist/Dropdown/dropdown-divider.svelte.d.ts +18 -0
- package/dist/Dropdown/dropdown-header.svelte +27 -0
- package/dist/Dropdown/dropdown-header.svelte.d.ts +19 -0
- package/dist/Dropdown/dropdown-item-text.svelte +26 -0
- package/dist/Dropdown/dropdown-item-text.svelte.d.ts +18 -0
- package/dist/Dropdown/dropdown-item.svelte +86 -0
- package/dist/Dropdown/dropdown-item.svelte.d.ts +24 -0
- package/dist/Dropdown/dropdown-menu.svelte +82 -0
- package/dist/Dropdown/dropdown-menu.svelte.d.ts +27 -0
- package/dist/Dropdown/dropdown-toggle.svelte +67 -0
- package/dist/Dropdown/dropdown-toggle.svelte.d.ts +24 -0
- package/dist/Dropdown/dropdown.svelte +106 -0
- package/dist/Dropdown/dropdown.svelte.d.ts +34 -0
- package/dist/Dropdown/dropdown.svelte.js +435 -0
- package/dist/Dropdown/index.d.ts +1 -0
- package/dist/Dropdown/index.js +1 -0
- package/dist/Dropdown/types.d.ts +47 -0
- package/dist/Dropdown/types.js +1 -0
- package/dist/Form/composition.d.ts +34 -0
- package/dist/Form/composition.js +33 -0
- package/dist/Form/form-check-input.svelte +92 -0
- package/dist/Form/form-check-input.svelte.d.ts +48 -0
- package/dist/Form/form-check-label.svelte +26 -0
- package/dist/Form/form-check-label.svelte.d.ts +21 -0
- package/dist/Form/form-check.svelte +55 -0
- package/dist/Form/form-check.svelte.d.ts +50 -0
- package/dist/Form/form-color-input.svelte +54 -0
- package/dist/Form/form-color-input.svelte.d.ts +30 -0
- package/dist/Form/form-date-input.svelte +64 -0
- package/dist/Form/form-date-input.svelte.d.ts +46 -0
- package/dist/Form/form-datetime-local-input.svelte +60 -0
- package/dist/Form/form-datetime-local-input.svelte.d.ts +45 -0
- package/dist/Form/form-email-input.svelte +64 -0
- package/dist/Form/form-email-input.svelte.d.ts +46 -0
- package/dist/Form/form-feedback.svelte +36 -0
- package/dist/Form/form-feedback.svelte.d.ts +26 -0
- package/dist/Form/form-file-input.svelte +43 -0
- package/dist/Form/form-file-input.svelte.d.ts +30 -0
- package/dist/Form/form-floating.svelte +44 -0
- package/dist/Form/form-floating.svelte.d.ts +38 -0
- package/dist/Form/form-helper-text.svelte +35 -0
- package/dist/Form/form-helper-text.svelte.d.ts +29 -0
- package/dist/Form/form-hidden-input.svelte +18 -0
- package/dist/Form/form-hidden-input.svelte.d.ts +16 -0
- package/dist/Form/form-image-input.svelte +30 -0
- package/dist/Form/form-image-input.svelte.d.ts +26 -0
- package/dist/Form/form-input-group-text.svelte +47 -0
- package/dist/Form/form-input-group-text.svelte.d.ts +42 -0
- package/dist/Form/form-input-group.svelte +52 -0
- package/dist/Form/form-input-group.svelte.d.ts +43 -0
- package/dist/Form/form-input-label.svelte +33 -0
- package/dist/Form/form-input-label.svelte.d.ts +28 -0
- package/dist/Form/form-month-input.svelte +63 -0
- package/dist/Form/form-month-input.svelte.d.ts +48 -0
- package/dist/Form/form-number-input.svelte +62 -0
- package/dist/Form/form-number-input.svelte.d.ts +47 -0
- package/dist/Form/form-password-input.svelte +60 -0
- package/dist/Form/form-password-input.svelte.d.ts +41 -0
- package/dist/Form/form-radio-input.svelte +47 -0
- package/dist/Form/form-radio-input.svelte.d.ts +41 -0
- package/dist/Form/form-radio-label.svelte +41 -0
- package/dist/Form/form-radio-label.svelte.d.ts +35 -0
- package/dist/Form/form-range-input.svelte +43 -0
- package/dist/Form/form-range-input.svelte.d.ts +39 -0
- package/dist/Form/form-search-input.svelte +63 -0
- package/dist/Form/form-search-input.svelte.d.ts +45 -0
- package/dist/Form/form-select.svelte +85 -0
- package/dist/Form/form-select.svelte.d.ts +59 -0
- package/dist/Form/form-switch-input.svelte +54 -0
- package/dist/Form/form-switch-input.svelte.d.ts +41 -0
- package/dist/Form/form-switch-label.svelte +25 -0
- package/dist/Form/form-switch-label.svelte.d.ts +19 -0
- package/dist/Form/form-telephone-input.svelte +129 -0
- package/dist/Form/form-telephone-input.svelte.d.ts +55 -0
- package/dist/Form/form-text-area.svelte +57 -0
- package/dist/Form/form-text-area.svelte.d.ts +38 -0
- package/dist/Form/form-text-input.svelte +55 -0
- package/dist/Form/form-text-input.svelte.d.ts +37 -0
- package/dist/Form/form-time-input.svelte +62 -0
- package/dist/Form/form-time-input.svelte.d.ts +47 -0
- package/dist/Form/form-url-input.svelte +60 -0
- package/dist/Form/form-url-input.svelte.d.ts +45 -0
- package/dist/Form/form-week-Input.svelte +62 -0
- package/dist/Form/form-week-Input.svelte.d.ts +47 -0
- package/dist/Form/form.svelte +37 -0
- package/dist/Form/form.svelte.d.ts +23 -0
- package/dist/Form/index.d.ts +1 -0
- package/dist/Form/index.js +1 -0
- package/dist/Form/types.d.ts +168 -0
- package/dist/Form/types.js +1 -0
- package/dist/ListGroup/composition.d.ts +4 -0
- package/dist/ListGroup/composition.js +3 -0
- package/dist/ListGroup/index.d.ts +1 -0
- package/dist/ListGroup/index.js +1 -0
- package/dist/ListGroup/list-group-item-action.svelte +50 -0
- package/dist/ListGroup/list-group-item-action.svelte.d.ts +23 -0
- package/dist/ListGroup/list-group-item.svelte +58 -0
- package/dist/ListGroup/list-group-item.svelte.d.ts +51 -0
- package/dist/ListGroup/list-group.svelte +83 -0
- package/dist/ListGroup/list-group.svelte.d.ts +68 -0
- package/dist/ListGroup/types.d.ts +20 -0
- package/dist/ListGroup/types.js +1 -0
- package/dist/Modal/composition.d.ts +8 -0
- package/dist/Modal/composition.js +7 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Modal/index.js +1 -0
- package/dist/Modal/modal-body.svelte +27 -0
- package/dist/Modal/modal-body.svelte.d.ts +19 -0
- package/dist/Modal/modal-content.svelte +35 -0
- package/dist/Modal/modal-content.svelte.d.ts +27 -0
- package/dist/Modal/modal-dialog.svelte +65 -0
- package/dist/Modal/modal-dialog.svelte.d.ts +52 -0
- package/dist/Modal/modal-footer.svelte +28 -0
- package/dist/Modal/modal-footer.svelte.d.ts +20 -0
- package/dist/Modal/modal-header.svelte +50 -0
- package/dist/Modal/modal-header.svelte.d.ts +29 -0
- package/dist/Modal/modal-title.svelte +45 -0
- package/dist/Modal/modal-title.svelte.d.ts +26 -0
- package/dist/Modal/modal.svelte +233 -0
- package/dist/Modal/modal.svelte.d.ts +52 -0
- package/dist/Modal/modal.svelte.js +86 -0
- package/dist/Modal/types.d.ts +31 -0
- package/dist/Modal/types.js +1 -0
- package/dist/Nav/composition.d.ts +4 -0
- package/dist/Nav/composition.js +3 -0
- package/dist/Nav/index.d.ts +1 -0
- package/dist/Nav/index.js +1 -0
- package/dist/Nav/nav-item.svelte +25 -0
- package/dist/Nav/nav-item.svelte.d.ts +18 -0
- package/dist/Nav/nav-link.svelte +77 -0
- package/dist/Nav/nav-link.svelte.d.ts +22 -0
- package/dist/Nav/nav.svelte +93 -0
- package/dist/Nav/nav.svelte.d.ts +56 -0
- package/dist/Nav/types.d.ts +26 -0
- package/dist/Nav/types.js +1 -0
- package/dist/Navbar/composition.d.ts +8 -0
- package/dist/Navbar/composition.js +7 -0
- package/dist/Navbar/index.d.ts +1 -0
- package/dist/Navbar/index.js +1 -0
- package/dist/Navbar/navbar-brand.svelte +55 -0
- package/dist/Navbar/navbar-brand.svelte.d.ts +48 -0
- package/dist/Navbar/navbar-collapse.svelte +76 -0
- package/dist/Navbar/navbar-collapse.svelte.d.ts +55 -0
- package/dist/Navbar/navbar-nav.svelte +66 -0
- package/dist/Navbar/navbar-nav.svelte.d.ts +53 -0
- package/dist/Navbar/navbar-text.svelte +36 -0
- package/dist/Navbar/navbar-text.svelte.d.ts +28 -0
- package/dist/Navbar/navbar-toggler-icon.svelte +34 -0
- package/dist/Navbar/navbar-toggler-icon.svelte.d.ts +28 -0
- package/dist/Navbar/navbar-toggler.svelte +75 -0
- package/dist/Navbar/navbar-toggler.svelte.d.ts +48 -0
- package/dist/Navbar/navbar.svelte +116 -0
- package/dist/Navbar/navbar.svelte.d.ts +88 -0
- package/dist/Navbar/types.d.ts +23 -0
- package/dist/Navbar/types.js +1 -0
- package/dist/Offcanvas/composition.d.ts +5 -0
- package/dist/Offcanvas/composition.js +4 -0
- package/dist/Offcanvas/index.d.ts +1 -0
- package/dist/Offcanvas/index.js +1 -0
- package/dist/Offcanvas/offcanvas-body.svelte +25 -0
- package/dist/Offcanvas/offcanvas-body.svelte.d.ts +19 -0
- package/dist/Offcanvas/offcanvas-header.svelte +39 -0
- package/dist/Offcanvas/offcanvas-header.svelte.d.ts +20 -0
- package/dist/Offcanvas/offcanvas-title.svelte +31 -0
- package/dist/Offcanvas/offcanvas-title.svelte.d.ts +25 -0
- package/dist/Offcanvas/offcanvas.svelte +220 -0
- package/dist/Offcanvas/offcanvas.svelte.d.ts +61 -0
- package/dist/Offcanvas/types.d.ts +25 -0
- package/dist/Offcanvas/types.js +1 -0
- package/dist/Pagination/composition.d.ts +4 -0
- package/dist/Pagination/composition.js +3 -0
- package/dist/Pagination/index.d.ts +1 -0
- package/dist/Pagination/index.js +1 -0
- package/dist/Pagination/pagination-item.svelte +81 -0
- package/dist/Pagination/pagination-item.svelte.d.ts +35 -0
- package/dist/Pagination/pagination-link.svelte +45 -0
- package/dist/Pagination/pagination-link.svelte.d.ts +25 -0
- package/dist/Pagination/pagination.svelte +60 -0
- package/dist/Pagination/pagination.svelte.d.ts +37 -0
- package/dist/Pagination/pagination.svelte.js +117 -0
- package/dist/Pagination/types.d.ts +19 -0
- package/dist/Pagination/types.js +1 -0
- package/dist/Placeholder/composition.d.ts +3 -0
- package/dist/Placeholder/composition.js +2 -0
- package/dist/Placeholder/index.d.ts +1 -0
- package/dist/Placeholder/index.js +1 -0
- package/dist/Placeholder/placeholder-item.svelte +53 -0
- package/dist/Placeholder/placeholder-item.svelte.d.ts +48 -0
- package/dist/Placeholder/placeholder.svelte +37 -0
- package/dist/Placeholder/placeholder.svelte.d.ts +32 -0
- package/dist/Placeholder/types.d.ts +12 -0
- package/dist/Placeholder/types.js +1 -0
- package/dist/Popover/composition.d.ts +4 -0
- package/dist/Popover/composition.js +3 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/Popover/index.js +1 -0
- package/dist/Popover/popover-body.svelte +10 -0
- package/dist/Popover/popover-body.svelte.d.ts +3 -0
- package/dist/Popover/popover-header.svelte +11 -0
- package/dist/Popover/popover-header.svelte.d.ts +4 -0
- package/dist/Popover/popover.svelte +74 -0
- package/dist/Popover/popover.svelte.d.ts +53 -0
- package/dist/Popover/types.d.ts +20 -0
- package/dist/Popover/types.js +1 -0
- package/dist/Portal/index.d.ts +2 -0
- package/dist/Portal/index.js +2 -0
- package/dist/Portal/portal-host.svelte +5 -0
- package/dist/Portal/portal-host.svelte.d.ts +7 -0
- package/dist/Portal/portal.svelte +69 -0
- package/dist/Portal/portal.svelte.d.ts +32 -0
- package/dist/Portal/types.d.ts +6 -0
- package/dist/Portal/types.js +1 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +3 -0
- package/dist/Progress/progress-bar.svelte +101 -0
- package/dist/Progress/progress-bar.svelte.d.ts +39 -0
- package/dist/Progress/progress-stacked.svelte +34 -0
- package/dist/Progress/progress-stacked.svelte.d.ts +24 -0
- package/dist/Progress/progress.svelte.d.ts +31 -0
- package/dist/Progress/progress.svelte.js +52 -0
- package/dist/Progress/types.d.ts +40 -0
- package/dist/Progress/types.js +1 -0
- package/dist/Row/index.d.ts +2 -0
- package/dist/Row/index.js +2 -0
- package/dist/Row/row.svelte +75 -0
- package/dist/Row/row.svelte.d.ts +46 -0
- package/dist/Row/types.d.ts +12 -0
- package/dist/Row/types.js +1 -0
- package/dist/Scrollspy/index.d.ts +2 -0
- package/dist/Scrollspy/index.js +2 -0
- package/dist/Scrollspy/scrollspy-attachment.svelte.d.ts +10 -0
- package/dist/Scrollspy/scrollspy-attachment.svelte.js +122 -0
- package/dist/Scrollspy/types.d.ts +9 -0
- package/dist/Scrollspy/types.js +1 -0
- package/dist/Spinner/index.d.ts +2 -0
- package/dist/Spinner/index.js +2 -0
- package/dist/Spinner/spinner.svelte +77 -0
- package/dist/Spinner/spinner.svelte.d.ts +70 -0
- package/dist/Spinner/types.d.ts +9 -0
- package/dist/Spinner/types.js +1 -0
- package/dist/Tab/composition.d.ts +5 -0
- package/dist/Tab/composition.js +4 -0
- package/dist/Tab/index.d.ts +1 -0
- package/dist/Tab/index.js +1 -0
- package/dist/Tab/tab-content.svelte +29 -0
- package/dist/Tab/tab-content.svelte.d.ts +23 -0
- package/dist/Tab/tab-nav-link.svelte +69 -0
- package/dist/Tab/tab-nav-link.svelte.d.ts +22 -0
- package/dist/Tab/tab-pane.svelte +72 -0
- package/dist/Tab/tab-pane.svelte.d.ts +26 -0
- package/dist/Tab/tab.svelte +63 -0
- package/dist/Tab/tab.svelte.d.ts +50 -0
- package/dist/Tab/types.d.ts +18 -0
- package/dist/Tab/types.js +1 -0
- package/dist/Table/composition.d.ts +9 -0
- package/dist/Table/composition.js +8 -0
- package/dist/Table/index.d.ts +1 -0
- package/dist/Table/index.js +1 -0
- package/dist/Table/table-body.svelte +30 -0
- package/dist/Table/table-body.svelte.d.ts +23 -0
- package/dist/Table/table-caption.svelte +20 -0
- package/dist/Table/table-caption.svelte.d.ts +15 -0
- package/dist/Table/table-data.svelte +30 -0
- package/dist/Table/table-data.svelte.d.ts +19 -0
- package/dist/Table/table-foot.svelte +31 -0
- package/dist/Table/table-foot.svelte.d.ts +24 -0
- package/dist/Table/table-head.svelte +31 -0
- package/dist/Table/table-head.svelte.d.ts +24 -0
- package/dist/Table/table-header.svelte +38 -0
- package/dist/Table/table-header.svelte.d.ts +17 -0
- package/dist/Table/table-row.svelte +34 -0
- package/dist/Table/table-row.svelte.d.ts +23 -0
- package/dist/Table/table.svelte +154 -0
- package/dist/Table/table.svelte.d.ts +98 -0
- package/dist/Table/table.svelte.js +92 -0
- package/dist/Table/types.d.ts +43 -0
- package/dist/Table/types.js +1 -0
- package/dist/Toast/composition.d.ts +5 -0
- package/dist/Toast/composition.js +4 -0
- package/dist/Toast/index.d.ts +1 -0
- package/dist/Toast/index.js +1 -0
- package/dist/Toast/toast-body.svelte +26 -0
- package/dist/Toast/toast-body.svelte.d.ts +18 -0
- package/dist/Toast/toast-container.svelte +44 -0
- package/dist/Toast/toast-container.svelte.d.ts +36 -0
- package/dist/Toast/toast-header.svelte +56 -0
- package/dist/Toast/toast-header.svelte.d.ts +36 -0
- package/dist/Toast/toast.svelte +112 -0
- package/dist/Toast/toast.svelte.d.ts +54 -0
- package/dist/Toast/toast.svelte.js +83 -0
- package/dist/Toast/types.d.ts +53 -0
- package/dist/Toast/types.js +19 -0
- package/dist/Tooltip/composition.d.ts +3 -0
- package/dist/Tooltip/composition.js +2 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/Tooltip/index.js +1 -0
- package/dist/Tooltip/tooltip-inner.svelte +10 -0
- package/dist/Tooltip/tooltip-inner.svelte.d.ts +4 -0
- package/dist/Tooltip/tooltip.svelte +213 -0
- package/dist/Tooltip/tooltip.svelte.d.ts +54 -0
- package/dist/Tooltip/types.d.ts +43 -0
- package/dist/Tooltip/types.js +1 -0
- package/dist/common/context.d.ts +47 -0
- package/dist/common/context.js +70 -0
- package/dist/common/css.d.ts +71 -0
- package/dist/common/css.js +133 -0
- package/dist/common/dom.d.ts +51 -0
- package/dist/common/dom.js +98 -0
- package/dist/common/index.d.ts +6 -0
- package/dist/common/index.js +5 -0
- package/dist/common/nav-tab.svelte.d.ts +88 -0
- package/dist/common/nav-tab.svelte.js +188 -0
- package/dist/common/navbar-offcanvas.svelte.d.ts +101 -0
- package/dist/common/navbar-offcanvas.svelte.js +228 -0
- package/dist/common/noop.d.ts +4 -0
- package/dist/common/noop.js +4 -0
- package/dist/common/scrollbar.d.ts +20 -0
- package/dist/common/scrollbar.js +53 -0
- package/dist/common/types.d.ts +143 -0
- package/dist/common/types.js +40 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +33 -0
- package/package.json +105 -0
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
import { Context } from '../common/index.js';
|
|
2
|
+
import { tick } from 'svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Manages the state for the Carousel root component.
|
|
5
|
+
* Handles the tracking of active slide, autoplay behavior, and transition control.
|
|
6
|
+
*/
|
|
7
|
+
export class CarouselRootState {
|
|
8
|
+
props;
|
|
9
|
+
// Public static constants...
|
|
10
|
+
static ANIMATION_DEFAULT = 'none';
|
|
11
|
+
static INTERNAL_DEFAULT = 5000;
|
|
12
|
+
static PAUSE_DEFAULT = 'hover';
|
|
13
|
+
static RIDE_DEFAULT = false;
|
|
14
|
+
static TRANSITION_DURATION_DEFAULT = 600;
|
|
15
|
+
// Private state properties...
|
|
16
|
+
#activeItemIndex = $state(0); // Zero-based index for active item
|
|
17
|
+
#animation = $state(CarouselRootState.ANIMATION_DEFAULT);
|
|
18
|
+
#hasUserInteraction = $state(false); // Used to delay autoplay until user interacts when ride=true
|
|
19
|
+
#indicators = [];
|
|
20
|
+
#interval = $state(0);
|
|
21
|
+
#timeoutId = $state(null);
|
|
22
|
+
#isAnimating = $state(false);
|
|
23
|
+
#isHovered = $state(false);
|
|
24
|
+
#isPaused = $state(true);
|
|
25
|
+
#isPointerDown = $state(false);
|
|
26
|
+
#items = [];
|
|
27
|
+
#nextActiveItemIndex = $state(-1); // Tracks the index of the slide that will become active (-1 when no transition is pending)
|
|
28
|
+
#pauseInteraction = $state(CarouselRootState.PAUSE_DEFAULT);
|
|
29
|
+
#pointerStartX = $state(0);
|
|
30
|
+
#ride = $state(false);
|
|
31
|
+
#transitionDuration = $state(CarouselRootState.TRANSITION_DURATION_DEFAULT);
|
|
32
|
+
#visibilityListener = null;
|
|
33
|
+
// Public readonly properties...
|
|
34
|
+
isSlideAnimation = $derived.by(() => this.animation === 'slide');
|
|
35
|
+
isFadeAnimation = $derived.by(() => this.animation === 'fade');
|
|
36
|
+
isCrossfadeAnimation = $derived.by(() => this.animation === 'crossfade');
|
|
37
|
+
isNoneAnimation = $derived.by(() => this.animation === 'none');
|
|
38
|
+
constructor(props) {
|
|
39
|
+
this.props = props;
|
|
40
|
+
this.#animation = this.props.animation || CarouselRootState.ANIMATION_DEFAULT;
|
|
41
|
+
this.#interval = this.props.interval || CarouselRootState.INTERNAL_DEFAULT;
|
|
42
|
+
this.#pauseInteraction = this.props.pause !== undefined ? this.props.pause : CarouselRootState.PAUSE_DEFAULT;
|
|
43
|
+
this.#ride = this.props.ride || CarouselRootState.RIDE_DEFAULT;
|
|
44
|
+
this.#transitionDuration = this.props.transitionDuration || CarouselRootState.TRANSITION_DURATION_DEFAULT;
|
|
45
|
+
this.registerItem = this.registerItem.bind(this);
|
|
46
|
+
this.isItemActive = this.isItemActive.bind(this);
|
|
47
|
+
this.next = this.next.bind(this);
|
|
48
|
+
this.prev = this.prev.bind(this);
|
|
49
|
+
this.pause = this.pause.bind(this);
|
|
50
|
+
this.cycle = this.cycle.bind(this);
|
|
51
|
+
this.to = this.to.bind(this);
|
|
52
|
+
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
53
|
+
this.handleMouseLeave = this.handleMouseLeave.bind(this);
|
|
54
|
+
this.handlePointerDown = this.handlePointerDown.bind(this);
|
|
55
|
+
this.handlePointerMove = this.handlePointerMove.bind(this);
|
|
56
|
+
this.handlePointerUp = this.handlePointerUp.bind(this);
|
|
57
|
+
// Setup Page Visibility API listener
|
|
58
|
+
if (typeof document !== 'undefined' && 'hidden' in document) {
|
|
59
|
+
this.#visibilityListener = () => {
|
|
60
|
+
if (document.hidden) {
|
|
61
|
+
this.pause();
|
|
62
|
+
}
|
|
63
|
+
else if (this.shouldCycle() && !this.#isHovered) {
|
|
64
|
+
this.cycle();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
document.addEventListener('visibilitychange', this.#visibilityListener);
|
|
68
|
+
}
|
|
69
|
+
// Start autoplay immediately if ride='carousel', otherwise wait for user interaction
|
|
70
|
+
if (this.#ride === 'carousel' && !this.#timeoutId) {
|
|
71
|
+
this.cycle();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Determines the appropriate interval duration, prioritizing the active item's specific interval
|
|
75
|
+
getCurrentItemInterval() {
|
|
76
|
+
if (this.#items.length === 0) {
|
|
77
|
+
return this.#interval;
|
|
78
|
+
}
|
|
79
|
+
const activeItem = this.#items[this.#activeItemIndex];
|
|
80
|
+
if (activeItem && activeItem.interval) {
|
|
81
|
+
return activeItem.interval;
|
|
82
|
+
}
|
|
83
|
+
return this.#interval;
|
|
84
|
+
}
|
|
85
|
+
// Determines if the carousel should auto-cycle based on configuration and user interaction state
|
|
86
|
+
shouldCycle() {
|
|
87
|
+
return this.#ride === 'carousel' || (this.#ride === true && this.#hasUserInteraction);
|
|
88
|
+
}
|
|
89
|
+
get animation() {
|
|
90
|
+
return this.#animation;
|
|
91
|
+
}
|
|
92
|
+
set animation(animation) {
|
|
93
|
+
this.#animation = animation;
|
|
94
|
+
}
|
|
95
|
+
get pauseInteraction() {
|
|
96
|
+
return this.#pauseInteraction;
|
|
97
|
+
}
|
|
98
|
+
set pauseInteraction(value) {
|
|
99
|
+
this.#pauseInteraction = value;
|
|
100
|
+
}
|
|
101
|
+
get interval() {
|
|
102
|
+
return this.#interval;
|
|
103
|
+
}
|
|
104
|
+
set interval(interval) {
|
|
105
|
+
this.#interval = interval;
|
|
106
|
+
if (this.shouldCycle()) {
|
|
107
|
+
this.cycle();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
get ride() {
|
|
111
|
+
return this.#ride;
|
|
112
|
+
}
|
|
113
|
+
set ride(ride) {
|
|
114
|
+
this.#ride = ride;
|
|
115
|
+
if (this.shouldCycle()) {
|
|
116
|
+
this.cycle();
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
this.pause();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
get transitionDuration() {
|
|
123
|
+
return this.#transitionDuration;
|
|
124
|
+
}
|
|
125
|
+
set transitionDuration(duration) {
|
|
126
|
+
this.#transitionDuration = duration;
|
|
127
|
+
}
|
|
128
|
+
get isAnimating() {
|
|
129
|
+
return this.#isAnimating;
|
|
130
|
+
}
|
|
131
|
+
registerItem(item) {
|
|
132
|
+
this.#items.push(item);
|
|
133
|
+
// Activate the first item by default if none is active
|
|
134
|
+
if (item.props.isActive && !this.#isAnimating) {
|
|
135
|
+
this.#activeItemIndex = item.index;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
registerIndicator(indicator) {
|
|
139
|
+
this.#indicators.push(indicator);
|
|
140
|
+
}
|
|
141
|
+
isItemActive(index) {
|
|
142
|
+
return this.#activeItemIndex === index;
|
|
143
|
+
}
|
|
144
|
+
getActiveIndex() {
|
|
145
|
+
return this.#activeItemIndex;
|
|
146
|
+
}
|
|
147
|
+
isNextItemActive(index) {
|
|
148
|
+
return this.#nextActiveItemIndex === index;
|
|
149
|
+
}
|
|
150
|
+
getNextActiveIndex() {
|
|
151
|
+
return this.#nextActiveItemIndex;
|
|
152
|
+
}
|
|
153
|
+
getItemCount() {
|
|
154
|
+
return this.#items.length;
|
|
155
|
+
}
|
|
156
|
+
getIndicatorCount() {
|
|
157
|
+
return this.#indicators.length;
|
|
158
|
+
}
|
|
159
|
+
next() {
|
|
160
|
+
if (this.#isAnimating) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const nextIndex = (this.#activeItemIndex + 1) % this.#items.length;
|
|
164
|
+
this.to(nextIndex, 'next');
|
|
165
|
+
// Mark that user interaction has occurred
|
|
166
|
+
this.#hasUserInteraction = true;
|
|
167
|
+
// Start cycling if ride is true and this is first interaction
|
|
168
|
+
if (this.#ride === true && !this.#timeoutId) {
|
|
169
|
+
this.cycle();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
prev() {
|
|
173
|
+
if (this.#isAnimating) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const prevIndex = (this.#activeItemIndex - 1 + this.#items.length) % this.#items.length;
|
|
177
|
+
this.to(prevIndex, 'prev');
|
|
178
|
+
// Mark that user interaction has occurred
|
|
179
|
+
this.#hasUserInteraction = true;
|
|
180
|
+
// Start cycling if ride is true and this is first interaction
|
|
181
|
+
if (this.#ride === true && !this.#timeoutId) {
|
|
182
|
+
this.cycle();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Navigates to the slide at the specified index with the given transition direction.
|
|
187
|
+
* Handles animation states and timing for different animation types.
|
|
188
|
+
*/
|
|
189
|
+
to(index, transitionDirection) {
|
|
190
|
+
if (index === this.#activeItemIndex || this.#isAnimating) {
|
|
191
|
+
console.warn(`[Carousel] Already on item ${this.#activeItemIndex}, ignoring to(${index})`);
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (this.#animation !== 'slide' && this.#animation !== 'fade' && this.#animation !== 'crossfade' && this.#animation !== 'none') {
|
|
195
|
+
console.warn(`[Carousel] Unsupported animation type: ${this.#animation}`);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const isNext = transitionDirection === 'next';
|
|
199
|
+
const isPrev = transitionDirection === 'prev';
|
|
200
|
+
const toItem = this.#items[index];
|
|
201
|
+
const fromItem = this.#items[this.#activeItemIndex];
|
|
202
|
+
if (toItem === fromItem) {
|
|
203
|
+
console.warn(`[Carousel] Attempting to transition to the same item ${index}, ignoring.`);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (!toItem) {
|
|
207
|
+
console.warn(`[Carousel] Item ${index} does not exist, ignoring transition.`);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (!fromItem) {
|
|
211
|
+
console.warn(`[Carousel] Active item ${this.#activeItemIndex} does not exist, ignoring transition.`);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
this.#isAnimating = true;
|
|
215
|
+
this.#nextActiveItemIndex = index;
|
|
216
|
+
// For slide and crossfade animations, we set directional classes and clean up after transition
|
|
217
|
+
if (this.#animation === 'slide' || this.#animation === 'crossfade') {
|
|
218
|
+
if (isNext) {
|
|
219
|
+
fromItem.direction = 'start';
|
|
220
|
+
toItem.direction = 'start';
|
|
221
|
+
toItem.order = 'next';
|
|
222
|
+
}
|
|
223
|
+
if (isPrev) {
|
|
224
|
+
fromItem.direction = 'end';
|
|
225
|
+
toItem.direction = 'end';
|
|
226
|
+
toItem.order = 'prev';
|
|
227
|
+
}
|
|
228
|
+
setTimeout(() => {
|
|
229
|
+
fromItem.order = undefined;
|
|
230
|
+
fromItem.direction = undefined;
|
|
231
|
+
toItem.order = undefined;
|
|
232
|
+
toItem.direction = undefined;
|
|
233
|
+
this.#activeItemIndex = index;
|
|
234
|
+
this.#nextActiveItemIndex = -1;
|
|
235
|
+
this.#isAnimating = false;
|
|
236
|
+
// Restart cycle with new slide's interval if cycling
|
|
237
|
+
if (this.shouldCycle() && !this.#isPaused) {
|
|
238
|
+
this.cycle();
|
|
239
|
+
}
|
|
240
|
+
}, this.#transitionDuration);
|
|
241
|
+
}
|
|
242
|
+
// For fade animation, we immediately change the active index but clean up classes after transition
|
|
243
|
+
if (this.#animation === 'fade') {
|
|
244
|
+
if (isNext) {
|
|
245
|
+
toItem.order = 'next';
|
|
246
|
+
}
|
|
247
|
+
if (isPrev) {
|
|
248
|
+
toItem.order = 'prev';
|
|
249
|
+
}
|
|
250
|
+
setTimeout(() => {
|
|
251
|
+
toItem.order = undefined;
|
|
252
|
+
this.#isAnimating = false;
|
|
253
|
+
}, this.#transitionDuration / 2);
|
|
254
|
+
this.#activeItemIndex = index;
|
|
255
|
+
this.#nextActiveItemIndex = -1;
|
|
256
|
+
// Restart cycle with new slide's interval if cycling
|
|
257
|
+
if (this.shouldCycle() && !this.#isPaused) {
|
|
258
|
+
this.cycle();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// For no animation, we simply update the active index on the next tick
|
|
262
|
+
if (this.#animation === 'none') {
|
|
263
|
+
tick().then(() => {
|
|
264
|
+
this.#activeItemIndex = index;
|
|
265
|
+
this.#nextActiveItemIndex = -1;
|
|
266
|
+
this.#isAnimating = false;
|
|
267
|
+
// Restart cycle with new slide's interval if cycling
|
|
268
|
+
if (this.shouldCycle() && !this.#isPaused) {
|
|
269
|
+
this.cycle();
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Starts or restarts the autoplay cycle with the appropriate interval.
|
|
276
|
+
* Uses the active slide's specific interval if available.
|
|
277
|
+
*/
|
|
278
|
+
cycle() {
|
|
279
|
+
if (typeof window === 'undefined') {
|
|
280
|
+
console.warn('[Carousel] Cycle called in non-browser environment, ignoring.');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
// Don't start cycling if we're hovered and pause='hover'
|
|
284
|
+
if (this.#pauseInteraction === 'hover' && this.#isHovered) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
// Don't start cycling if the document is hidden
|
|
288
|
+
if (typeof document !== 'undefined' && 'hidden' in document && document.hidden) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
// Clear any existing timeout
|
|
292
|
+
this.pause();
|
|
293
|
+
this.#isPaused = false;
|
|
294
|
+
// Use the current active slide's interval or the default
|
|
295
|
+
const currentInterval = this.getCurrentItemInterval();
|
|
296
|
+
// Schedule the next slide using setTimeout
|
|
297
|
+
this.#timeoutId = window.setTimeout(() => {
|
|
298
|
+
if (!this.#isPaused && !this.#isAnimating) {
|
|
299
|
+
this.next();
|
|
300
|
+
}
|
|
301
|
+
else if (!this.#isPaused) {
|
|
302
|
+
// If we're animating, try again after a short delay
|
|
303
|
+
this.cycle();
|
|
304
|
+
}
|
|
305
|
+
}, currentInterval);
|
|
306
|
+
}
|
|
307
|
+
pause() {
|
|
308
|
+
if (typeof window === 'undefined') {
|
|
309
|
+
console.warn('[Carousel] Pause called in non-browser environment, ignoring.');
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
if (this.#timeoutId) {
|
|
313
|
+
window.clearTimeout(this.#timeoutId);
|
|
314
|
+
this.#timeoutId = null;
|
|
315
|
+
}
|
|
316
|
+
this.#isPaused = true;
|
|
317
|
+
}
|
|
318
|
+
handleMouseEnter() {
|
|
319
|
+
this.#isHovered = true;
|
|
320
|
+
if (this.#pauseInteraction === 'hover' && this.shouldCycle()) {
|
|
321
|
+
this.pause();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
handleMouseLeave() {
|
|
325
|
+
this.#isHovered = false;
|
|
326
|
+
if (this.shouldCycle() && this.#pauseInteraction === 'hover') {
|
|
327
|
+
this.cycle();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
handlePointerDown(pointerEvent) {
|
|
331
|
+
// Only track primary touch pointer
|
|
332
|
+
if (pointerEvent.pointerType === 'touch' && pointerEvent.isPrimary) {
|
|
333
|
+
this.#isPointerDown = true;
|
|
334
|
+
this.#pointerStartX = pointerEvent.clientX;
|
|
335
|
+
// Pause autoplay during touch interaction
|
|
336
|
+
if (this.shouldCycle()) {
|
|
337
|
+
this.pause();
|
|
338
|
+
}
|
|
339
|
+
// Mark that user interaction has occurred
|
|
340
|
+
this.#hasUserInteraction = true;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
handlePointerMove(pointerEvent) {
|
|
344
|
+
// Skip if not tracking a touch
|
|
345
|
+
if (!this.#isPointerDown || pointerEvent.pointerType !== 'touch' || !pointerEvent.isPrimary) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
// No need to do anything here, just track in pointerup
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Handles touch swipe gestures for mobile carousel navigation.
|
|
352
|
+
* Determines swipe direction based on horizontal movement distance.
|
|
353
|
+
*/
|
|
354
|
+
handlePointerUp(pointerEvent) {
|
|
355
|
+
if (!this.#isPointerDown || pointerEvent.pointerType !== 'touch' || !pointerEvent.isPrimary) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const deltaX = pointerEvent.clientX - this.#pointerStartX;
|
|
359
|
+
// Consider it a swipe if movement exceeds threshold (50px)
|
|
360
|
+
if (Math.abs(deltaX) > 50) {
|
|
361
|
+
if (deltaX > 0) {
|
|
362
|
+
this.prev(); // Swipe right means go to previous
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
this.next(); // Swipe left means go to next
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
this.#isPointerDown = false;
|
|
369
|
+
// Resume cycling after touch with a delay to prevent immediate transition
|
|
370
|
+
if (this.shouldCycle()) {
|
|
371
|
+
setTimeout(() => {
|
|
372
|
+
this.cycle();
|
|
373
|
+
}, 1000);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
dispose() {
|
|
377
|
+
if (this.#timeoutId) {
|
|
378
|
+
window.clearTimeout(this.#timeoutId);
|
|
379
|
+
this.#timeoutId = null;
|
|
380
|
+
}
|
|
381
|
+
// Remove visibility change listener
|
|
382
|
+
if (typeof document !== 'undefined' && this.#visibilityListener) {
|
|
383
|
+
document.removeEventListener('visibilitychange', this.#visibilityListener);
|
|
384
|
+
this.#visibilityListener = null;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Manages the state for an individual Carousel item.
|
|
390
|
+
* Tracks active state and provides methods to handle transitions.
|
|
391
|
+
*/
|
|
392
|
+
export class CarouselItemState {
|
|
393
|
+
props;
|
|
394
|
+
root;
|
|
395
|
+
#order = $state(undefined);
|
|
396
|
+
#direction = $state(undefined);
|
|
397
|
+
index;
|
|
398
|
+
interval;
|
|
399
|
+
isActive = $derived.by(() => this.root.isItemActive(this.index));
|
|
400
|
+
isNext = $derived(this.#order === 'next');
|
|
401
|
+
isPrev = $derived(this.#order === 'prev');
|
|
402
|
+
// Used to determine whether this item should be in the DOM (active or transitioning)
|
|
403
|
+
isActiveOrWillBeActive = $derived.by(() => this.isActive || this.isNext || this.isPrev);
|
|
404
|
+
isEnd = $derived(this.#direction === 'end');
|
|
405
|
+
isStart = $derived(this.#direction === 'start');
|
|
406
|
+
isSlideAnimation = $derived.by(() => this.root.animation === 'slide');
|
|
407
|
+
isFadeAnimation = $derived.by(() => this.root.animation === 'fade');
|
|
408
|
+
isCrossfadeAnimation = $derived.by(() => this.root.animation === 'crossfade');
|
|
409
|
+
isNoneAnimation = $derived.by(() => this.root.animation === 'none');
|
|
410
|
+
// These derived values determine which animation classes/behavior to apply
|
|
411
|
+
doSlideItem = $derived.by(() => this.isSlideAnimation && this.isActiveOrWillBeActive);
|
|
412
|
+
doFadeItem = $derived.by(() => this.isFadeAnimation && this.isActiveOrWillBeActive);
|
|
413
|
+
doCrossfadeItem = $derived.by(() => this.isCrossfadeAnimation && this.isActiveOrWillBeActive);
|
|
414
|
+
doShowImmediatelyItem = $derived.by(() => this.isNoneAnimation && this.isActiveOrWillBeActive);
|
|
415
|
+
constructor(props, root) {
|
|
416
|
+
this.props = props;
|
|
417
|
+
this.root = root;
|
|
418
|
+
this.index = this.root.getItemCount();
|
|
419
|
+
this.interval = this.props.interval || 5000;
|
|
420
|
+
}
|
|
421
|
+
get order() {
|
|
422
|
+
return this.#order;
|
|
423
|
+
}
|
|
424
|
+
set order(order) {
|
|
425
|
+
this.#order = order;
|
|
426
|
+
}
|
|
427
|
+
get direction() {
|
|
428
|
+
return this.#direction;
|
|
429
|
+
}
|
|
430
|
+
set direction(direction) {
|
|
431
|
+
this.#direction = direction;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Manages the state for Carousel controls.
|
|
436
|
+
* Handles previous actions and target identification.
|
|
437
|
+
*/
|
|
438
|
+
export class CarouselControlPrevState {
|
|
439
|
+
props;
|
|
440
|
+
root;
|
|
441
|
+
constructor(props, root) {
|
|
442
|
+
this.props = props;
|
|
443
|
+
this.root = root;
|
|
444
|
+
this.onclick = this.onclick.bind(this);
|
|
445
|
+
}
|
|
446
|
+
onclick(event) {
|
|
447
|
+
event.preventDefault();
|
|
448
|
+
this.root.prev();
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Manages the state for Carousel controls.
|
|
453
|
+
* Handles next actions and target identification.
|
|
454
|
+
*/
|
|
455
|
+
export class CarouselControlNextState {
|
|
456
|
+
props;
|
|
457
|
+
root;
|
|
458
|
+
constructor(props, root) {
|
|
459
|
+
this.props = props;
|
|
460
|
+
this.root = root;
|
|
461
|
+
this.onclick = this.onclick.bind(this);
|
|
462
|
+
}
|
|
463
|
+
onclick(event) {
|
|
464
|
+
event.preventDefault();
|
|
465
|
+
this.root.next();
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Manages the state for Carousel indicator buttons.
|
|
470
|
+
* Tracks active state and provides methods to handle clicks.
|
|
471
|
+
*/
|
|
472
|
+
export class CarouselIndicatorButtonState {
|
|
473
|
+
props;
|
|
474
|
+
root;
|
|
475
|
+
isActive = $derived.by(() => this.root.isItemActive(this.index) && !this.root.isAnimating);
|
|
476
|
+
isNextActive = $derived.by(() => this.root.isNextItemActive(this.index));
|
|
477
|
+
index;
|
|
478
|
+
constructor(props, root) {
|
|
479
|
+
this.props = props;
|
|
480
|
+
this.root = root;
|
|
481
|
+
this.index = this.root.getIndicatorCount();
|
|
482
|
+
this.onclick = this.onclick.bind(this);
|
|
483
|
+
}
|
|
484
|
+
onclick(event) {
|
|
485
|
+
event.preventDefault();
|
|
486
|
+
const order = this.index > this.root.getActiveIndex() ? 'next' : 'prev';
|
|
487
|
+
this.root.to(this.index, order);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const CarouselRootContext = new Context('carousel-root');
|
|
491
|
+
/**
|
|
492
|
+
* Creates and initializes the Carousel root state.
|
|
493
|
+
* This function is used to set up the context for the Carousel component.
|
|
494
|
+
* @param props - The props for the Carousel root component.
|
|
495
|
+
* @returns The created CarouselRootState instance.
|
|
496
|
+
*/
|
|
497
|
+
export function initCarouselRootState(props) {
|
|
498
|
+
const rootState = new CarouselRootState(props);
|
|
499
|
+
return CarouselRootContext.set(rootState);
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Creates and initializes the Carousel item state.
|
|
503
|
+
* This function is used to set up the state for a Carousel item.
|
|
504
|
+
* @param props - The props for the Carousel item.
|
|
505
|
+
* @param index - The index of the item in the carousel.
|
|
506
|
+
* @returns The created CarouselItemState instance.
|
|
507
|
+
*/
|
|
508
|
+
export function initCarouselItemState(props) {
|
|
509
|
+
if (!CarouselRootContext.exists()) {
|
|
510
|
+
throw new Error('Carousel.Item requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Item.');
|
|
511
|
+
}
|
|
512
|
+
const rootState = CarouselRootContext.get();
|
|
513
|
+
const itemState = new CarouselItemState(props, rootState);
|
|
514
|
+
rootState.registerItem(itemState);
|
|
515
|
+
return itemState;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Creates and initializes the Carousel control state.
|
|
519
|
+
* This function is used to set up the state for a Carousel control button.
|
|
520
|
+
* @param props - The props for the Carousel control.
|
|
521
|
+
* @returns The created CarouselControlState instance.
|
|
522
|
+
*/
|
|
523
|
+
export function initCarouselControlPrevState(props) {
|
|
524
|
+
if (!CarouselRootContext.exists()) {
|
|
525
|
+
throw new Error('Carousel.Control requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Control.');
|
|
526
|
+
}
|
|
527
|
+
const rootState = CarouselRootContext.get();
|
|
528
|
+
return new CarouselControlPrevState(props, rootState);
|
|
529
|
+
}
|
|
530
|
+
export function initCarouselControlNextState(props) {
|
|
531
|
+
if (!CarouselRootContext.exists()) {
|
|
532
|
+
throw new Error('Carousel.Control requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.Control.');
|
|
533
|
+
}
|
|
534
|
+
const rootState = CarouselRootContext.get();
|
|
535
|
+
return new CarouselControlNextState(props, rootState);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Creates and initializes the Carousel indicator button state.
|
|
539
|
+
* This function is used to set up the state for a Carousel indicator button.
|
|
540
|
+
* @param props - The props for the Carousel indicator button.
|
|
541
|
+
* @returns The created CarouselIndicatorButtonState instance.
|
|
542
|
+
*/
|
|
543
|
+
export function initCarouselIndicatorButtonState(props) {
|
|
544
|
+
if (!CarouselRootContext.exists()) {
|
|
545
|
+
throw new Error('Carousel.IndicatorButton requires Carousel.Root context. Please ensure Carousel.Root is initialized before Carousel.IndicatorButton.');
|
|
546
|
+
}
|
|
547
|
+
const rootState = CarouselRootContext.get();
|
|
548
|
+
const indicatorState = new CarouselIndicatorButtonState(props, rootState);
|
|
549
|
+
rootState.registerIndicator(indicatorState);
|
|
550
|
+
return indicatorState;
|
|
551
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Caption } from './carousel-caption.svelte';
|
|
2
|
+
export { default as ControlNext } from './carousel-control-next.svelte';
|
|
3
|
+
export { default as ControlPrev } from './carousel-control-prev.svelte';
|
|
4
|
+
export { default as IndicatorButton } from './carousel-indicator-button.svelte';
|
|
5
|
+
export { default as Indicators } from './carousel-indicators.svelte';
|
|
6
|
+
export { default as Inner } from './carousel-inner.svelte';
|
|
7
|
+
export { default as Item } from './carousel-item.svelte';
|
|
8
|
+
export { default as Root } from './carousel.svelte';
|
|
9
|
+
export type { CarouselCaptionProps as CaptionProps, CarouselControlProps as ControlProps, CarouselIndicatorButtonProps as IndicatorButtonProps, CarouselIndicatorsProps as IndicatorsProps, CarouselInnerProps as InnerProps, CarouselItemProps as ItemProps, CarouselRootProps as RootProps } from './types.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Caption } from './carousel-caption.svelte';
|
|
2
|
+
export { default as ControlNext } from './carousel-control-next.svelte';
|
|
3
|
+
export { default as ControlPrev } from './carousel-control-prev.svelte';
|
|
4
|
+
export { default as IndicatorButton } from './carousel-indicator-button.svelte';
|
|
5
|
+
export { default as Indicators } from './carousel-indicators.svelte';
|
|
6
|
+
export { default as Inner } from './carousel-inner.svelte';
|
|
7
|
+
export { default as Item } from './carousel-item.svelte';
|
|
8
|
+
export { default as Root } from './carousel.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Carousel from './composition.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Carousel from './composition.js';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { ButtonElement, DivElement } from '../common/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Controls the transition effect between carousel items
|
|
4
|
+
* - 'none': No animation (immediate change)
|
|
5
|
+
* - 'slide': Standard horizontal sliding transition
|
|
6
|
+
* - 'fade': Opacity transition without horizontal movement
|
|
7
|
+
* - 'crossfade': Cross-dissolve between slides
|
|
8
|
+
*/
|
|
9
|
+
export type CarouselAnimation = 'none' | 'slide' | 'fade' | 'crossfade';
|
|
10
|
+
/**
|
|
11
|
+
* Denotes the relative position of a carousel item during transitions
|
|
12
|
+
*/
|
|
13
|
+
export type CarouselItemOrder = 'next' | 'prev';
|
|
14
|
+
/**
|
|
15
|
+
* Specifies the direction of movement for carousel transitions
|
|
16
|
+
* - 'start': Move toward the start (right-to-left in LTR, left-to-right in RTL)
|
|
17
|
+
* - 'end': Move toward the end (left-to-right in LTR, right-to-left in RTL)
|
|
18
|
+
*/
|
|
19
|
+
export type CarouselItemDirection = 'start' | 'end';
|
|
20
|
+
/**
|
|
21
|
+
* Controls auto-cycling behavior
|
|
22
|
+
* - true: Enable auto-cycling with default settings
|
|
23
|
+
* - false: Disable auto-cycling
|
|
24
|
+
* - 'carousel': Enable auto-cycling with Bootstrap's standard behavior
|
|
25
|
+
*/
|
|
26
|
+
export type CarouselRide = boolean | 'carousel';
|
|
27
|
+
/**
|
|
28
|
+
* Determines what pauses the carousel's cycling
|
|
29
|
+
* - 'hover': Pause when mouse hovers over carousel
|
|
30
|
+
* - false: Don't pause on hover
|
|
31
|
+
*/
|
|
32
|
+
export type CarouselPause = 'hover' | false;
|
|
33
|
+
/**
|
|
34
|
+
* Root carousel container properties
|
|
35
|
+
* Controls overall carousel behavior including animation type and timing
|
|
36
|
+
*/
|
|
37
|
+
export type CarouselRootProps = DivElement & {
|
|
38
|
+
animation?: CarouselAnimation;
|
|
39
|
+
interval?: number;
|
|
40
|
+
pause?: CarouselPause;
|
|
41
|
+
ride?: CarouselRide;
|
|
42
|
+
transitionDuration?: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Container for carousel items that manages the sliding surface
|
|
46
|
+
*/
|
|
47
|
+
export type CarouselInnerProps = DivElement;
|
|
48
|
+
/**
|
|
49
|
+
* Individual carousel slide properties
|
|
50
|
+
*/
|
|
51
|
+
export type CarouselItemProps = DivElement & {
|
|
52
|
+
isActive?: boolean;
|
|
53
|
+
interval?: number;
|
|
54
|
+
onSlide?: EventListener;
|
|
55
|
+
onSlid?: EventListener;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Container for optional caption text within carousel items
|
|
59
|
+
*/
|
|
60
|
+
export type CarouselCaptionProps = DivElement;
|
|
61
|
+
/**
|
|
62
|
+
* Container for the indicator dots/buttons showing current position
|
|
63
|
+
*/
|
|
64
|
+
export type CarouselIndicatorsProps = DivElement;
|
|
65
|
+
/**
|
|
66
|
+
* Individual indicator button properties
|
|
67
|
+
*/
|
|
68
|
+
export type CarouselIndicatorButtonProps = ButtonElement & {
|
|
69
|
+
ariaLabel?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Properties for previous/next navigation controls
|
|
73
|
+
*/
|
|
74
|
+
export type CarouselControlProps = ButtonElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## CloseButton
|
|
4
|
+
A button component that provides a standardized close button functionality.
|
|
5
|
+
Typically used in alerts, modals, and other dismissible components.
|
|
6
|
+
|
|
7
|
+
@example
|
|
8
|
+
```svelte
|
|
9
|
+
<CloseButton />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
#### Basic close button
|
|
13
|
+
```svelte
|
|
14
|
+
<CloseButton />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### Disabled state
|
|
18
|
+
```svelte
|
|
19
|
+
<CloseButton disabled={true} />
|
|
20
|
+
```
|
|
21
|
+
### Props
|
|
22
|
+
- `ariaLabel` (string): Optional. Customizes the aria-label attribute for accessibility (defaults to "Close")
|
|
23
|
+
- `class` (string): Optional. Additional CSS classes to apply to the close button
|
|
24
|
+
- `disabled` (boolean): Optional. Disables the close button when set to true
|
|
25
|
+
- `elementRef` (HTMLElement): Optional. Reference to the button DOM element
|
|
26
|
+
-->
|
|
27
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
28
|
+
let { ariaLabel = 'Close', class: classValues, disabled = false, elementRef = $bindable(null), ...restOfProps } = $props();
|
|
29
|
+
let classes = $derived(uniqueClsx('btn-close', classValues));
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<button aria-label={ariaLabel} bind:this={elementRef} class={classes} {disabled} type="button" {...restOfProps}></button>
|