@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,7 @@
|
|
|
1
|
+
export { default as Divider } from './dropdown-divider.svelte';
|
|
2
|
+
export { default as Header } from './dropdown-header.svelte';
|
|
3
|
+
export { default as ItemText } from './dropdown-item-text.svelte';
|
|
4
|
+
export { default as Item } from './dropdown-item.svelte';
|
|
5
|
+
export { default as Menu } from './dropdown-menu.svelte';
|
|
6
|
+
export { default as Toggle } from './dropdown-toggle.svelte';
|
|
7
|
+
export { default as Root } from './dropdown.svelte';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Divider
|
|
4
|
+
A horizontal divider for separating dropdown items.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Divider />
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
- `class` (string): Optional. Additional CSS classes to apply to the divider.
|
|
13
|
+
- `elementRef` (HTMLElement): Optional. Reference to the divider DOM element.
|
|
14
|
+
- `listItemProps` (object): Optional. Additional properties to apply to the `<li>` element that wraps the divider.
|
|
15
|
+
-->
|
|
16
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
17
|
+
let { class: classValues, elementRef = $bindable(null), listItemProps, ...restOfProps } = $props();
|
|
18
|
+
let classes = $derived(uniqueClsx('dropdown-divider', classValues));
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<li {...listItemProps}>
|
|
22
|
+
<hr bind:this={elementRef} class={classes} {...restOfProps} />
|
|
23
|
+
</li>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Divider
|
|
4
|
+
* A horizontal divider for separating dropdown items.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Divider />
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Props
|
|
12
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the divider.
|
|
13
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the divider DOM element.
|
|
14
|
+
* - `listItemProps` (object): Optional. Additional properties to apply to the `<li>` element that wraps the divider.
|
|
15
|
+
*/
|
|
16
|
+
declare const DropdownDivider: import("svelte").Component<Dropdown.DividerProps, {}, "elementRef">;
|
|
17
|
+
type DropdownDivider = ReturnType<typeof DropdownDivider>;
|
|
18
|
+
export default DropdownDivider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Header
|
|
4
|
+
A header for grouping dropdown items.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Header>Group Title</Dropdown.Header>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
- `class` (string): Optional. Additional CSS classes to apply to the header.
|
|
13
|
+
- `elementRef` (HTMLElement): Optional. Reference to the header DOM element.
|
|
14
|
+
- `level` (number): Optional. Heading level for the header (default is 6).
|
|
15
|
+
- `listItemProps` (object): Optional. Additional properties to apply to the `<li>` element that wraps the header.
|
|
16
|
+
-->
|
|
17
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
18
|
+
let { children, class: classValues, elementRef = $bindable(null), level = 6, listItemProps, ...restOfProps } = $props();
|
|
19
|
+
let elementType = $derived(`h${level}`);
|
|
20
|
+
let classes = $derived(uniqueClsx('dropdown-header', classValues));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<li {...listItemProps}>
|
|
24
|
+
<svelte:element this={elementType} bind:this={elementRef} class={classes} {...restOfProps}>
|
|
25
|
+
{@render children?.()}
|
|
26
|
+
</svelte:element>
|
|
27
|
+
</li>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Header
|
|
4
|
+
* A header for grouping dropdown items.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Header>Group Title</Dropdown.Header>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Props
|
|
12
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the header.
|
|
13
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the header DOM element.
|
|
14
|
+
* - `level` (number): Optional. Heading level for the header (default is 6).
|
|
15
|
+
* - `listItemProps` (object): Optional. Additional properties to apply to the `<li>` element that wraps the header.
|
|
16
|
+
*/
|
|
17
|
+
declare const DropdownHeader: import("svelte").Component<Dropdown.HeaderProps, {}, "elementRef">;
|
|
18
|
+
type DropdownHeader = ReturnType<typeof DropdownHeader>;
|
|
19
|
+
export default DropdownHeader;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Text
|
|
4
|
+
Text content within a dropdown menu.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Text>Some text here</Dropdown.Text>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
- `class` (string): Optional. Additional CSS classes to apply to the text.
|
|
13
|
+
- `elementRef` (HTMLElement): Optional. Reference to the text DOM element.
|
|
14
|
+
- `listItemProps` (object): Optional. Additional properties for the list item element.
|
|
15
|
+
-->
|
|
16
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
17
|
+
let { children, class: classValues, elementRef = $bindable(null), listItemProps, ...restOfProps } = $props();
|
|
18
|
+
// Compute text classes
|
|
19
|
+
let classes = $derived(uniqueClsx('dropdown-item-text', classValues));
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<li {...listItemProps}>
|
|
23
|
+
<span bind:this={elementRef} class={classes} {...restOfProps}>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</span>
|
|
26
|
+
</li>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Text
|
|
4
|
+
* Text content within a dropdown menu.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Text>Some text here</Dropdown.Text>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Props
|
|
12
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the text.
|
|
13
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the text DOM element.
|
|
14
|
+
* - `listItemProps` (object): Optional. Additional properties for the list item element.
|
|
15
|
+
*/
|
|
16
|
+
declare const DropdownItemText: import("svelte").Component<Dropdown.ItemTextProps, {}, "elementRef">;
|
|
17
|
+
type DropdownItemText = ReturnType<typeof DropdownItemText>;
|
|
18
|
+
export default DropdownItemText;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Item
|
|
4
|
+
A clickable item within a dropdown menu.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
9
|
+
<Dropdown.Item>Another action</Dropdown.Item>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
- `class` (string): Optional. Additional CSS classes to apply to the item.
|
|
14
|
+
- `elementRef` (HTMLElement): Optional. Reference to the item DOM element.
|
|
15
|
+
- `href` (string): Optional. URL for the item if it's a link, default is '#'.
|
|
16
|
+
- `id` (string): Optional. Unique identifier for the item, default is `dropdown-item-{uid}`.
|
|
17
|
+
- `isActive` (boolean): Optional. Makes the item appear active, default is false.
|
|
18
|
+
- `isDisabled` (boolean): Optional. Disables the item, default is false.
|
|
19
|
+
- `listItemProps` (object): Optional. Additional properties for the list item element.
|
|
20
|
+
- `onclick` (EventListener): Optional. Click event handler for the item.
|
|
21
|
+
-->
|
|
22
|
+
<script lang="ts">/* eslint-disable @typescript-eslint/no-explicit-any -- restOfProps spread targets a union element type that is not spreadable without as any */
|
|
23
|
+
import { uniqueClsx } from '../common/css.js';
|
|
24
|
+
import { noop } from '../common/noop.js';
|
|
25
|
+
import { DropdownItemState, initDropdownItemState } from './dropdown.svelte.js';
|
|
26
|
+
// Generate a unique ID for the dropdown item
|
|
27
|
+
const uid = $props.id();
|
|
28
|
+
let { children, class: classValues, elementRef = $bindable(null), href, id = `dropdown-item-${uid}`, isActive = false, isDisabled = false, listItemProps, onclick = noop, onfocus = noop, onkeydown = noop, ...restOfProps } = $props();
|
|
29
|
+
const itemState = initDropdownItemState({
|
|
30
|
+
get id() {
|
|
31
|
+
return id;
|
|
32
|
+
},
|
|
33
|
+
get elementRef() {
|
|
34
|
+
return elementRef;
|
|
35
|
+
},
|
|
36
|
+
get isActive() {
|
|
37
|
+
return isActive;
|
|
38
|
+
},
|
|
39
|
+
get isDisabled() {
|
|
40
|
+
return isDisabled;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
let isAnchor = $derived(Boolean(href));
|
|
44
|
+
let elementType = $derived(isAnchor ? 'a' : 'button');
|
|
45
|
+
let classes = $derived(uniqueClsx('dropdown-item', {
|
|
46
|
+
active: isActive,
|
|
47
|
+
disabled: isDisabled
|
|
48
|
+
}, classValues));
|
|
49
|
+
const handleClick = (event) => {
|
|
50
|
+
if (href && href === '#!') {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
itemState.onclick(event);
|
|
54
|
+
onclick(event);
|
|
55
|
+
};
|
|
56
|
+
const handleKeydown = (event) => {
|
|
57
|
+
itemState.onkeydown(event);
|
|
58
|
+
onkeydown(event);
|
|
59
|
+
};
|
|
60
|
+
const handleFocus = (event) => {
|
|
61
|
+
itemState.onfocus(event);
|
|
62
|
+
onfocus(event);
|
|
63
|
+
};
|
|
64
|
+
// Note: itemState reads elementRef, isActive, and isDisabled reactively via the
|
|
65
|
+
// getter-based props object passed to initDropdownItemState above — no manual
|
|
66
|
+
// mirroring needed.
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<li {...listItemProps}>
|
|
70
|
+
<svelte:element
|
|
71
|
+
this={elementType}
|
|
72
|
+
aria-disabled={isDisabled ? true : undefined}
|
|
73
|
+
bind:this={elementRef}
|
|
74
|
+
class={classes}
|
|
75
|
+
{href}
|
|
76
|
+
{id}
|
|
77
|
+
onclick={handleClick}
|
|
78
|
+
onfocus={handleFocus}
|
|
79
|
+
onkeydown={handleKeydown}
|
|
80
|
+
role="menuitem"
|
|
81
|
+
tabindex={isDisabled ? -1 : undefined}
|
|
82
|
+
type={isAnchor ? undefined : 'button'}
|
|
83
|
+
{...restOfProps as any}>
|
|
84
|
+
{@render children?.()}
|
|
85
|
+
</svelte:element>
|
|
86
|
+
</li>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Item
|
|
4
|
+
* A clickable item within a dropdown menu.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
9
|
+
* <Dropdown.Item>Another action</Dropdown.Item>
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* ### Props
|
|
13
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the item.
|
|
14
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the item DOM element.
|
|
15
|
+
* - `href` (string): Optional. URL for the item if it's a link, default is '#'.
|
|
16
|
+
* - `id` (string): Optional. Unique identifier for the item, default is `dropdown-item-{uid}`.
|
|
17
|
+
* - `isActive` (boolean): Optional. Makes the item appear active, default is false.
|
|
18
|
+
* - `isDisabled` (boolean): Optional. Disables the item, default is false.
|
|
19
|
+
* - `listItemProps` (object): Optional. Additional properties for the list item element.
|
|
20
|
+
* - `onclick` (EventListener): Optional. Click event handler for the item.
|
|
21
|
+
*/
|
|
22
|
+
declare const DropdownItem: import("svelte").Component<Dropdown.ItemProps, {}, "elementRef">;
|
|
23
|
+
type DropdownItem = ReturnType<typeof DropdownItem>;
|
|
24
|
+
export default DropdownItem;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Menu
|
|
4
|
+
The container for dropdown items.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Menu>
|
|
9
|
+
<Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
10
|
+
<Dropdown.Item href="#!">Another action</Dropdown.Item>
|
|
11
|
+
<Dropdown.Divider/>
|
|
12
|
+
<Dropdown.Item href="#!">Something else here</Dropdown.Item>
|
|
13
|
+
</Dropdown.Menu>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Props
|
|
17
|
+
- `class` (string): Optional. Additional CSS classes to apply to the dropdown menu.
|
|
18
|
+
- `container` (string | HTMLElement | false): Optional. Specifies the container where the dropdown menu should be appended. Default is `false`.
|
|
19
|
+
- `elementRef` (HTMLElement): Optional. Reference to the dropdown menu DOM element.
|
|
20
|
+
- `id` (string): Optional. Unique identifier for the dropdown menu, default is `dropdown-menu-{uid}`.
|
|
21
|
+
- `isDark` (boolean): Optional. Makes the dropdown menu dark-themed, default is false.
|
|
22
|
+
- `isEnd` (boolean): Optional. Aligns the dropdown menu to the end of its parent, default is false.
|
|
23
|
+
- `offset` (number[]): Optional. Offset for the dropdown menu position, default is `[0, 2]`.
|
|
24
|
+
-->
|
|
25
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
26
|
+
import { Portal } from '../index.js';
|
|
27
|
+
import { onMount } from 'svelte';
|
|
28
|
+
import { DropdownMenuState, initDropdownMenuState } from './dropdown.svelte.js';
|
|
29
|
+
// Generate a unique ID for the dropdown menu
|
|
30
|
+
const uid = $props.id();
|
|
31
|
+
let { children, class: classValues, container = false, elementRef = $bindable(null), id = `dropdown-menu-${uid}`, isDark = false, isEnd = false, offset = [0, 2], ...restOfProps } = $props();
|
|
32
|
+
let containerElement = $derived(container === false ? 'body' : container);
|
|
33
|
+
const menuState = initDropdownMenuState({
|
|
34
|
+
get elementRef() {
|
|
35
|
+
return elementRef;
|
|
36
|
+
},
|
|
37
|
+
get id() {
|
|
38
|
+
return id;
|
|
39
|
+
},
|
|
40
|
+
get isEnd() {
|
|
41
|
+
return isEnd;
|
|
42
|
+
},
|
|
43
|
+
get offset() {
|
|
44
|
+
return offset;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
// Compute menu classes
|
|
48
|
+
let classes = $derived(uniqueClsx('dropdown-menu', {
|
|
49
|
+
'dropdown-menu-dark': isDark,
|
|
50
|
+
'dropdown-menu-end': isEnd,
|
|
51
|
+
show: menuState.isShown
|
|
52
|
+
}, classValues));
|
|
53
|
+
onMount(() => {
|
|
54
|
+
return () => {
|
|
55
|
+
menuState.dispose();
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
// Forward prop changes to the matching menuState setters so their side effects
|
|
59
|
+
// run on every transition. The setters are idempotent.
|
|
60
|
+
$effect(() => {
|
|
61
|
+
menuState.elementRef = elementRef;
|
|
62
|
+
});
|
|
63
|
+
$effect(() => {
|
|
64
|
+
menuState.isEnd = isEnd;
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<svelte:body onclick={menuState.bodyOnclick} />
|
|
69
|
+
|
|
70
|
+
<Portal target={containerElement} disabled={container === false}>
|
|
71
|
+
<ul
|
|
72
|
+
aria-labelledby={menuState.ariaLabelledBy}
|
|
73
|
+
bind:this={elementRef}
|
|
74
|
+
class={classes}
|
|
75
|
+
data-bs-popper={menuState.isShown && menuState.root.isNavItem ? 'static' : undefined}
|
|
76
|
+
data-popper-placement={menuState.popperPlacement}
|
|
77
|
+
{id}
|
|
78
|
+
role={menuState.root.hasItems ? 'menu' : undefined}
|
|
79
|
+
{...restOfProps}>
|
|
80
|
+
{@render children?.()}
|
|
81
|
+
</ul>
|
|
82
|
+
</Portal>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Menu
|
|
4
|
+
* The container for dropdown items.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Menu>
|
|
9
|
+
* <Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
10
|
+
* <Dropdown.Item href="#!">Another action</Dropdown.Item>
|
|
11
|
+
* <Dropdown.Divider/>
|
|
12
|
+
* <Dropdown.Item href="#!">Something else here</Dropdown.Item>
|
|
13
|
+
* </Dropdown.Menu>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* ### Props
|
|
17
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the dropdown menu.
|
|
18
|
+
* - `container` (string | HTMLElement | false): Optional. Specifies the container where the dropdown menu should be appended. Default is `false`.
|
|
19
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the dropdown menu DOM element.
|
|
20
|
+
* - `id` (string): Optional. Unique identifier for the dropdown menu, default is `dropdown-menu-{uid}`.
|
|
21
|
+
* - `isDark` (boolean): Optional. Makes the dropdown menu dark-themed, default is false.
|
|
22
|
+
* - `isEnd` (boolean): Optional. Aligns the dropdown menu to the end of its parent, default is false.
|
|
23
|
+
* - `offset` (number[]): Optional. Offset for the dropdown menu position, default is `[0, 2]`.
|
|
24
|
+
*/
|
|
25
|
+
declare const DropdownMenu: import("svelte").Component<Dropdown.MenuProps, {}, "elementRef">;
|
|
26
|
+
type DropdownMenu = ReturnType<typeof DropdownMenu>;
|
|
27
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown.Toggle
|
|
4
|
+
The button that triggers the dropdown menu.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Toggle colorVariant="success">Dropdown Button</Dropdown.Toggle>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
- `class` (string): Optional. Additional CSS classes to apply to the toggle button.
|
|
13
|
+
- `colorVariant` (string): Optional. Button color variant, default is 'primary'.
|
|
14
|
+
- `disabled` (boolean): Optional. Disables the button if true, default is false.
|
|
15
|
+
- `elementRef` (HTMLElement): Optional. Reference to the button DOM element.
|
|
16
|
+
- `href` (string): Optional. If provided, the button will render as an anchor tag.
|
|
17
|
+
- `id` (string): Optional. Unique identifier for the button, default is `dropdown-toggle-{uid}`.
|
|
18
|
+
- `isSplit` (boolean): Optional. Displays the button as a split button, default is false.
|
|
19
|
+
- `size` (string): Optional. Button size: 'sm' or 'lg'.
|
|
20
|
+
- `type` (string): Optional. Button type, default is 'button'.
|
|
21
|
+
-->
|
|
22
|
+
<script lang="ts">/* eslint-disable @typescript-eslint/no-explicit-any -- restOfProps spread targets a union element type that is not spreadable without as any */
|
|
23
|
+
import { Button } from '../Button/index.js';
|
|
24
|
+
import { uniqueClsx } from '../common/css.js';
|
|
25
|
+
import { noop } from '../common/noop.js';
|
|
26
|
+
import { DropdownToggleState, initDropdownToggleState } from './dropdown.svelte.js';
|
|
27
|
+
// Generate a unique ID for the dropdown toggle
|
|
28
|
+
const uid = $props.id();
|
|
29
|
+
let { children, class: classValues, colorVariant, disabled = false, elementRef = $bindable(null), href, id = `dropdown-toggle-${uid}`, isSplit = false, onclick = noop, onkeydown = noop, size, type, ...restOfProps } = $props();
|
|
30
|
+
const toggleState = initDropdownToggleState({
|
|
31
|
+
get id() {
|
|
32
|
+
return id;
|
|
33
|
+
},
|
|
34
|
+
get isSplit() {
|
|
35
|
+
return isSplit;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
let classes = $derived(uniqueClsx('dropdown-toggle', { 'dropdown-toggle-split': isSplit }, classValues));
|
|
39
|
+
const handleClick = (event) => {
|
|
40
|
+
toggleState.onclick(event);
|
|
41
|
+
onclick(event);
|
|
42
|
+
};
|
|
43
|
+
const handleKeydown = (event) => {
|
|
44
|
+
toggleState.onkeydown(event);
|
|
45
|
+
onkeydown(event);
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<Button
|
|
50
|
+
aria-expanded={toggleState.isShown}
|
|
51
|
+
bind:elementRef
|
|
52
|
+
class={classes}
|
|
53
|
+
{colorVariant}
|
|
54
|
+
{disabled}
|
|
55
|
+
{href}
|
|
56
|
+
{id}
|
|
57
|
+
onclick={handleClick}
|
|
58
|
+
onkeydown={handleKeydown}
|
|
59
|
+
{size}
|
|
60
|
+
{type}
|
|
61
|
+
{...restOfProps as any}>
|
|
62
|
+
{#if isSplit}
|
|
63
|
+
<span class="visually-hidden">Toggle Dropdown</span>
|
|
64
|
+
{:else}
|
|
65
|
+
{@render children?.()}
|
|
66
|
+
{/if}
|
|
67
|
+
</Button>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown.Toggle
|
|
4
|
+
* The button that triggers the dropdown menu.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Toggle colorVariant="success">Dropdown Button</Dropdown.Toggle>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Props
|
|
12
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the toggle button.
|
|
13
|
+
* - `colorVariant` (string): Optional. Button color variant, default is 'primary'.
|
|
14
|
+
* - `disabled` (boolean): Optional. Disables the button if true, default is false.
|
|
15
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the button DOM element.
|
|
16
|
+
* - `href` (string): Optional. If provided, the button will render as an anchor tag.
|
|
17
|
+
* - `id` (string): Optional. Unique identifier for the button, default is `dropdown-toggle-{uid}`.
|
|
18
|
+
* - `isSplit` (boolean): Optional. Displays the button as a split button, default is false.
|
|
19
|
+
* - `size` (string): Optional. Button size: 'sm' or 'lg'.
|
|
20
|
+
* - `type` (string): Optional. Button type, default is 'button'.
|
|
21
|
+
*/
|
|
22
|
+
declare const DropdownToggle: import("svelte").Component<Dropdown.ToggleProps, {}, "elementRef">;
|
|
23
|
+
type DropdownToggle = ReturnType<typeof DropdownToggle>;
|
|
24
|
+
export default DropdownToggle;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
## Dropdown
|
|
4
|
+
Bootstrap's dropdown component provides a togglable overlay of links and actions.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```svelte
|
|
8
|
+
<Dropdown.Root>
|
|
9
|
+
<Dropdown.Toggle>Dropdown Button</Dropdown.Toggle>
|
|
10
|
+
<Dropdown.Menu>
|
|
11
|
+
<Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
12
|
+
<Dropdown.Item href="#!">Another action</Dropdown.Item>
|
|
13
|
+
<Dropdown.Divider/>
|
|
14
|
+
<Dropdown.Item href="#!">Something else here</Dropdown.Item>
|
|
15
|
+
</Dropdown.Menu>
|
|
16
|
+
</Dropdown.Root>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
- `autoClose` (boolean | 'inside' | 'outside'): Optional. Controls auto-closing behavior, default is true.
|
|
21
|
+
- `class` (string): Optional. Additional CSS classes to apply to the dropdown.
|
|
22
|
+
- `direction` (string): Optional. Direction of the dropdown menu: 'dropdown' (default), 'dropup', 'dropend', 'dropstart'.
|
|
23
|
+
- `display` (string): Optional. Display mode of the dropdown: 'dynamic' (default), 'static'.
|
|
24
|
+
- `elementRef` (HTMLElement): Optional. Reference to the dropdown DOM element.
|
|
25
|
+
- `id` (string): Optional. Unique identifier for the dropdown, default is `dropdown-{uid}`.
|
|
26
|
+
- `isButtonGroup` (boolean): Optional. If true, the dropdown is styled as part of a button group.
|
|
27
|
+
- `onHide` (function): Optional. Callback when the dropdown is about to be hidden.
|
|
28
|
+
- `onHidden` (function): Optional. Callback when the dropdown has been hidden.
|
|
29
|
+
- `onShow` (function): Optional. Callback when the dropdown is about to be shown.
|
|
30
|
+
- `onShown` (function): Optional. Callback when the dropdown has been shown.
|
|
31
|
+
-->
|
|
32
|
+
<script lang="ts">import { uniqueClsx } from '../common/css.js';
|
|
33
|
+
import { noop } from '../common/noop.js';
|
|
34
|
+
import { DropdownRootState, initDropdownRootState } from './dropdown.svelte.js';
|
|
35
|
+
// Generate a unique ID for the dropdown element, in case one is not provided
|
|
36
|
+
const uid = $props.id();
|
|
37
|
+
let { autoClose = true, children, class: classValues, direction = 'dropdown', display = 'dynamic', elementRef = $bindable(null), id = `dropdown-${uid}`, isButtonGroup = false, onHide = noop, onHidden = noop, onShow = noop, onShown = noop, ...restOfProps } = $props();
|
|
38
|
+
const rootState = initDropdownRootState({
|
|
39
|
+
get autoClose() {
|
|
40
|
+
return autoClose;
|
|
41
|
+
},
|
|
42
|
+
get direction() {
|
|
43
|
+
return direction;
|
|
44
|
+
},
|
|
45
|
+
get display() {
|
|
46
|
+
return display;
|
|
47
|
+
},
|
|
48
|
+
get elementRef() {
|
|
49
|
+
return elementRef;
|
|
50
|
+
},
|
|
51
|
+
get id() {
|
|
52
|
+
return id;
|
|
53
|
+
},
|
|
54
|
+
get isButtonGroup() {
|
|
55
|
+
return isButtonGroup;
|
|
56
|
+
},
|
|
57
|
+
get onHide() {
|
|
58
|
+
return onHide;
|
|
59
|
+
},
|
|
60
|
+
get onHidden() {
|
|
61
|
+
return onHidden;
|
|
62
|
+
},
|
|
63
|
+
get onShow() {
|
|
64
|
+
return onShow;
|
|
65
|
+
},
|
|
66
|
+
get onShown() {
|
|
67
|
+
return onShown;
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
let elementType = $derived(rootState.isNavItem ? 'li' : 'div');
|
|
71
|
+
let classes = $derived(uniqueClsx({
|
|
72
|
+
'nav-item': rootState.isNavItem,
|
|
73
|
+
'btn-group': rootState.isButtonGroup,
|
|
74
|
+
dropdown: ['dropdown', 'dropdown-end'].includes(rootState.direction),
|
|
75
|
+
'dropdown-center': rootState.direction === 'dropdown-center',
|
|
76
|
+
'dropdown-end': rootState.direction === 'dropdown-end',
|
|
77
|
+
dropup: ['dropup', 'dropup-end'].includes(rootState.direction),
|
|
78
|
+
'dropup-center': rootState.direction === 'dropup-center',
|
|
79
|
+
'dropup-end': rootState.direction === 'dropup-end',
|
|
80
|
+
dropend: rootState.direction === 'dropend',
|
|
81
|
+
dropstart: rootState.direction === 'dropstart'
|
|
82
|
+
}, classValues));
|
|
83
|
+
// Forward prop changes to the matching rootState setters so their side effects
|
|
84
|
+
// (e.g. elementRef setter detecting nav-item parent) run on every transition.
|
|
85
|
+
// The setters internally compare against their captured state, so calling them
|
|
86
|
+
// on each prop change is safe and idempotent.
|
|
87
|
+
$effect(() => {
|
|
88
|
+
rootState.autoClose = autoClose;
|
|
89
|
+
});
|
|
90
|
+
$effect(() => {
|
|
91
|
+
rootState.elementRef = elementRef;
|
|
92
|
+
});
|
|
93
|
+
$effect(() => {
|
|
94
|
+
rootState.direction = direction;
|
|
95
|
+
});
|
|
96
|
+
$effect(() => {
|
|
97
|
+
rootState.isButtonGroup = isButtonGroup;
|
|
98
|
+
});
|
|
99
|
+
$effect(() => {
|
|
100
|
+
rootState.display = display;
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<svelte:element this={elementType} bind:this={elementRef} class={classes} {id} {...restOfProps}>
|
|
105
|
+
{@render children?.()}
|
|
106
|
+
</svelte:element>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Dropdown } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* ## Dropdown
|
|
4
|
+
* Bootstrap's dropdown component provides a togglable overlay of links and actions.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```svelte
|
|
8
|
+
* <Dropdown.Root>
|
|
9
|
+
* <Dropdown.Toggle>Dropdown Button</Dropdown.Toggle>
|
|
10
|
+
* <Dropdown.Menu>
|
|
11
|
+
* <Dropdown.Item href="#!">Action</Dropdown.Item>
|
|
12
|
+
* <Dropdown.Item href="#!">Another action</Dropdown.Item>
|
|
13
|
+
* <Dropdown.Divider/>
|
|
14
|
+
* <Dropdown.Item href="#!">Something else here</Dropdown.Item>
|
|
15
|
+
* </Dropdown.Menu>
|
|
16
|
+
* </Dropdown.Root>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ### Props
|
|
20
|
+
* - `autoClose` (boolean | 'inside' | 'outside'): Optional. Controls auto-closing behavior, default is true.
|
|
21
|
+
* - `class` (string): Optional. Additional CSS classes to apply to the dropdown.
|
|
22
|
+
* - `direction` (string): Optional. Direction of the dropdown menu: 'dropdown' (default), 'dropup', 'dropend', 'dropstart'.
|
|
23
|
+
* - `display` (string): Optional. Display mode of the dropdown: 'dynamic' (default), 'static'.
|
|
24
|
+
* - `elementRef` (HTMLElement): Optional. Reference to the dropdown DOM element.
|
|
25
|
+
* - `id` (string): Optional. Unique identifier for the dropdown, default is `dropdown-{uid}`.
|
|
26
|
+
* - `isButtonGroup` (boolean): Optional. If true, the dropdown is styled as part of a button group.
|
|
27
|
+
* - `onHide` (function): Optional. Callback when the dropdown is about to be hidden.
|
|
28
|
+
* - `onHidden` (function): Optional. Callback when the dropdown has been hidden.
|
|
29
|
+
* - `onShow` (function): Optional. Callback when the dropdown is about to be shown.
|
|
30
|
+
* - `onShown` (function): Optional. Callback when the dropdown has been shown.
|
|
31
|
+
*/
|
|
32
|
+
declare const Dropdown: import("svelte").Component<Dropdown.RootProps, {}, "elementRef">;
|
|
33
|
+
type Dropdown = ReturnType<typeof Dropdown>;
|
|
34
|
+
export default Dropdown;
|