sheer-ui 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/package.json +369 -0
- package/src/lib/VENDORED.md +109 -0
- package/src/lib/assets/ui.css +733 -0
- package/src/lib/blocks/Appearance.svelte +104 -0
- package/src/lib/blocks/BoundaryFailed.svelte +33 -0
- package/src/lib/blocks/ErrorPage.svelte +65 -0
- package/src/lib/blocks/Footer.svelte +71 -0
- package/src/lib/blocks/Header.svelte +67 -0
- package/src/lib/blocks/Heading.svelte +86 -0
- package/src/lib/blocks/MobileNav.svelte +169 -0
- package/src/lib/blocks/PhoneInput.svelte +68 -0
- package/src/lib/blocks/Section.svelte +34 -0
- package/src/lib/blocks/alert-modal/AlertModal.svelte +83 -0
- package/src/lib/blocks/alert-modal/alert-modal.svelte.ts +81 -0
- package/src/lib/blocks/alert-modal/index.ts +2 -0
- package/src/lib/blocks/calendar.svelte +155 -0
- package/src/lib/blocks/copy-button/copy-button.svelte +43 -0
- package/src/lib/blocks/copy-button/copy.svelte.ts +52 -0
- package/src/lib/blocks/copy-button/index.ts +2 -0
- package/src/lib/blocks/date-picker/date-picker-with-presets.svelte +109 -0
- package/src/lib/blocks/date-picker/date-picker.svelte +91 -0
- package/src/lib/blocks/date-picker/index.ts +13 -0
- package/src/lib/blocks/date-picker/range-date-picker.svelte +128 -0
- package/src/lib/blocks/index.ts +12 -0
- package/src/lib/blocks/mockups/Browser.svelte +22 -0
- package/src/lib/blocks/mockups/Phone.svelte +44 -0
- package/src/lib/blocks/mockups/index.ts +2 -0
- package/src/lib/blocks/tab-nav/index.ts +1 -0
- package/src/lib/blocks/tab-nav/tab-nav.svelte +46 -0
- package/src/lib/blocks/time-picker/index.ts +16 -0
- package/src/lib/blocks/time-picker/time-input.svelte +118 -0
- package/src/lib/blocks/time-picker/time-picker.svelte +93 -0
- package/src/lib/blocks/time-picker/time-range-input.svelte +34 -0
- package/src/lib/blocks/time-picker/time-range-picker.svelte +180 -0
- package/src/lib/blocks/time-picker/time-slots.ts +61 -0
- package/src/lib/blocks/user-avatar/UserAvatar.svelte +36 -0
- package/src/lib/blocks/user-avatar/index.ts +1 -0
- package/src/lib/blocks/verification-code-field/VerificationCodeField.svelte +57 -0
- package/src/lib/blocks/verification-code-field/index.ts +1 -0
- package/src/lib/components/accordion/accordion.svelte.ts +43 -0
- package/src/lib/components/accordion/components/accordion-content.svelte +17 -0
- package/src/lib/components/accordion/components/accordion-item.svelte +58 -0
- package/src/lib/components/accordion/components/accordion-trigger.svelte +38 -0
- package/src/lib/components/accordion/components/accordion.svelte +24 -0
- package/src/lib/components/accordion/index.ts +11 -0
- package/src/lib/components/accordion/types.ts +19 -0
- package/src/lib/components/alert/alert-action.svelte +11 -0
- package/src/lib/components/alert/alert-description.svelte +18 -0
- package/src/lib/components/alert/alert-title.svelte +18 -0
- package/src/lib/components/alert/alert.svelte +37 -0
- package/src/lib/components/alert/index.ts +17 -0
- package/src/lib/components/avatar/avatar.svelte.ts +154 -0
- package/src/lib/components/avatar/components/avatar-fallback.svelte +38 -0
- package/src/lib/components/avatar/components/avatar-image.svelte +47 -0
- package/src/lib/components/avatar/components/avatar.svelte +57 -0
- package/src/lib/components/avatar/index.ts +9 -0
- package/src/lib/components/avatar/types.ts +46 -0
- package/src/lib/components/badge/badge.svelte +49 -0
- package/src/lib/components/badge/index.ts +1 -0
- package/src/lib/components/breadcrumb/breadcrumb-ellipsis.svelte +23 -0
- package/src/lib/components/breadcrumb/breadcrumb-item.svelte +11 -0
- package/src/lib/components/breadcrumb/breadcrumb-link.svelte +32 -0
- package/src/lib/components/breadcrumb/breadcrumb-list.svelte +15 -0
- package/src/lib/components/breadcrumb/breadcrumb-page.svelte +18 -0
- package/src/lib/components/breadcrumb/breadcrumb-separator.svelte +22 -0
- package/src/lib/components/breadcrumb/breadcrumb.svelte +10 -0
- package/src/lib/components/breadcrumb/index.ts +25 -0
- package/src/lib/components/button/button.svelte +55 -0
- package/src/lib/components/button/index.ts +12 -0
- package/src/lib/components/button/variants.ts +51 -0
- package/src/lib/components/calendar/calendar.svelte.ts +1081 -0
- package/src/lib/components/calendar/components/calendar-cell.svelte +34 -0
- package/src/lib/components/calendar/components/calendar-day.svelte +36 -0
- package/src/lib/components/calendar/components/calendar-grid-body.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-grid-head.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-grid-row.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-grid.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-head-cell.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-header.svelte +29 -0
- package/src/lib/components/calendar/components/calendar-heading.svelte +33 -0
- package/src/lib/components/calendar/components/calendar-month-select.svelte +50 -0
- package/src/lib/components/calendar/components/calendar-next-button.svelte +37 -0
- package/src/lib/components/calendar/components/calendar-prev-button.svelte +37 -0
- package/src/lib/components/calendar/components/calendar-year-select.svelte +50 -0
- package/src/lib/components/calendar/components/calendar.svelte +123 -0
- package/src/lib/components/calendar/exports.ts +31 -0
- package/src/lib/components/calendar/index.ts +2 -0
- package/src/lib/components/calendar/types.ts +417 -0
- package/src/lib/components/card/card-action.svelte +15 -0
- package/src/lib/components/card/card-content.svelte +11 -0
- package/src/lib/components/card/card-description.svelte +11 -0
- package/src/lib/components/card/card-footer.svelte +11 -0
- package/src/lib/components/card/card-header.svelte +18 -0
- package/src/lib/components/card/card-title.svelte +11 -0
- package/src/lib/components/card/card.svelte +15 -0
- package/src/lib/components/card/index.ts +25 -0
- package/src/lib/components/carousel/carousel-arrow.svelte +42 -0
- package/src/lib/components/carousel/carousel-content.svelte +25 -0
- package/src/lib/components/carousel/carousel-dots.svelte +21 -0
- package/src/lib/components/carousel/carousel-item.svelte +21 -0
- package/src/lib/components/carousel/carousel-next.svelte +9 -0
- package/src/lib/components/carousel/carousel-previous.svelte +9 -0
- package/src/lib/components/carousel/carousel.svelte +245 -0
- package/src/lib/components/carousel/carouselState.svelte.ts +30 -0
- package/src/lib/components/carousel/index.ts +24 -0
- package/src/lib/components/chart/chart-container.svelte +52 -0
- package/src/lib/components/chart/chart-style.svelte +29 -0
- package/src/lib/components/chart/chart-tooltip.svelte +163 -0
- package/src/lib/components/chart/chart-utils.ts +50 -0
- package/src/lib/components/chart/index.ts +6 -0
- package/src/lib/components/checkbox/checkbox.svelte.ts +199 -0
- package/src/lib/components/checkbox/components/checkbox-group-label.svelte +29 -0
- package/src/lib/components/checkbox/components/checkbox-group.svelte +48 -0
- package/src/lib/components/checkbox/components/checkbox.svelte +85 -0
- package/src/lib/components/checkbox/index.ts +9 -0
- package/src/lib/components/checkbox/types.ts +131 -0
- package/src/lib/components/checkbox-native/checkbox.svelte +96 -0
- package/src/lib/components/checkbox-native/index.ts +8 -0
- package/src/lib/components/collapsible/components/collapsible-content.svelte +16 -0
- package/src/lib/components/collapsible/components/collapsible-trigger.svelte +14 -0
- package/src/lib/components/collapsible/components/collapsible.svelte +68 -0
- package/src/lib/components/collapsible/index.ts +9 -0
- package/src/lib/components/collapsible/types.ts +25 -0
- package/src/lib/components/combobox/components/combobox-arrow.svelte +8 -0
- package/src/lib/components/combobox/components/combobox-input.svelte +46 -0
- package/src/lib/components/combobox/components/combobox-trigger.svelte +44 -0
- package/src/lib/components/combobox/components/combobox.svelte +83 -0
- package/src/lib/components/combobox/index.ts +30 -0
- package/src/lib/components/combobox/select/components/select-content-static.svelte +56 -0
- package/src/lib/components/combobox/select/components/select-content.svelte +95 -0
- package/src/lib/components/combobox/select/components/select-group-heading.svelte +51 -0
- package/src/lib/components/combobox/select/components/select-group.svelte +51 -0
- package/src/lib/components/combobox/select/components/select-hidden-input.svelte +16 -0
- package/src/lib/components/combobox/select/components/select-item.svelte +86 -0
- package/src/lib/components/combobox/select/components/select-scroll-down-button.svelte +41 -0
- package/src/lib/components/combobox/select/components/select-scroll-up-button.svelte +34 -0
- package/src/lib/components/combobox/select/components/select-trigger.svelte +32 -0
- package/src/lib/components/combobox/select/components/select-value.svelte +40 -0
- package/src/lib/components/combobox/select/components/select-viewport.svelte +29 -0
- package/src/lib/components/combobox/select/components/select.svelte +92 -0
- package/src/lib/components/combobox/select/select.svelte.ts +1596 -0
- package/src/lib/components/combobox/select/types.ts +291 -0
- package/src/lib/components/combobox/types.ts +77 -0
- package/src/lib/components/command/command-dialog.svelte +42 -0
- package/src/lib/components/command/command.svelte.ts +1506 -0
- package/src/lib/components/command/components/_command-label.svelte +31 -0
- package/src/lib/components/command/components/command-empty.svelte +34 -0
- package/src/lib/components/command/components/command-group-heading.svelte +29 -0
- package/src/lib/components/command/components/command-group-items.svelte +31 -0
- package/src/lib/components/command/components/command-group.svelte +76 -0
- package/src/lib/components/command/components/command-input.svelte +55 -0
- package/src/lib/components/command/components/command-item.svelte +61 -0
- package/src/lib/components/command/components/command-link-item.svelte +61 -0
- package/src/lib/components/command/components/command-list.svelte +41 -0
- package/src/lib/components/command/components/command-loading.svelte +30 -0
- package/src/lib/components/command/components/command-separator.svelte +34 -0
- package/src/lib/components/command/components/command-viewport.svelte +29 -0
- package/src/lib/components/command/components/command.svelte +143 -0
- package/src/lib/components/command/compute-command-score.ts +207 -0
- package/src/lib/components/command/index.ts +29 -0
- package/src/lib/components/command/types.ts +222 -0
- package/src/lib/components/command/utils.ts +30 -0
- package/src/lib/components/context-menu/components/context-menu-content-static.svelte +22 -0
- package/src/lib/components/context-menu/components/context-menu-content.svelte +22 -0
- package/src/lib/components/context-menu/components/context-menu-trigger.svelte +46 -0
- package/src/lib/components/context-menu/components/context-menu.svelte +8 -0
- package/src/lib/components/context-menu/index.ts +39 -0
- package/src/lib/components/context-menu/types.ts +56 -0
- package/src/lib/components/data-table/column-helpers.ts +97 -0
- package/src/lib/components/data-table/data-table-checkbox.svelte +25 -0
- package/src/lib/components/data-table/data-table-sort-button.svelte +16 -0
- package/src/lib/components/data-table/flex-render.svelte +42 -0
- package/src/lib/components/data-table/index.ts +29 -0
- package/src/lib/components/data-table/render-helpers.ts +105 -0
- package/src/lib/components/data-table/table-cell.svelte +9 -0
- package/src/lib/components/data-table/table-column-header.svelte +51 -0
- package/src/lib/components/data-table/table-faceted-filter.svelte +109 -0
- package/src/lib/components/data-table/table-pagination.svelte +54 -0
- package/src/lib/components/data-table/table-priority-cell.svelte +22 -0
- package/src/lib/components/data-table/table-row-actions.svelte +29 -0
- package/src/lib/components/data-table/table-status-cell.svelte +34 -0
- package/src/lib/components/data-table/table-title-cell.svelte +24 -0
- package/src/lib/components/data-table/table-toolbar.svelte +55 -0
- package/src/lib/components/data-table/table-view-options.svelte +25 -0
- package/src/lib/components/date-field/components/date-field-hidden-input.svelte +9 -0
- package/src/lib/components/date-field/components/date-field-input.svelte +33 -0
- package/src/lib/components/date-field/components/date-field-label.svelte +29 -0
- package/src/lib/components/date-field/components/date-field-segment.svelte +29 -0
- package/src/lib/components/date-field/components/date-field.svelte +106 -0
- package/src/lib/components/date-field/date-field.svelte.ts +1474 -0
- package/src/lib/components/date-field/index.ts +11 -0
- package/src/lib/components/date-field/types.ts +165 -0
- package/src/lib/components/date-range-field/components/date-range-field-input.svelte +36 -0
- package/src/lib/components/date-range-field/components/date-range-field-label.svelte +29 -0
- package/src/lib/components/date-range-field/components/date-range-field.svelte +106 -0
- package/src/lib/components/date-range-field/date-range-field.svelte.ts +212 -0
- package/src/lib/components/date-range-field/index.ts +11 -0
- package/src/lib/components/date-range-field/types.ts +171 -0
- package/src/lib/components/dialog/components/dialog-close.svelte +31 -0
- package/src/lib/components/dialog/components/dialog-content-headless.svelte +104 -0
- package/src/lib/components/dialog/components/dialog-content.svelte +69 -0
- package/src/lib/components/dialog/components/dialog-description.svelte +29 -0
- package/src/lib/components/dialog/components/dialog-overlay.svelte +31 -0
- package/src/lib/components/dialog/components/dialog-title.svelte +30 -0
- package/src/lib/components/dialog/components/dialog-trigger.svelte +30 -0
- package/src/lib/components/dialog/components/dialog.svelte +21 -0
- package/src/lib/components/dialog/components/modal-surface.svelte +131 -0
- package/src/lib/components/dialog/dialog.svelte.ts +371 -0
- package/src/lib/components/dialog/index.ts +19 -0
- package/src/lib/components/dialog/types.ts +105 -0
- package/src/lib/components/drawer/drawer-close.svelte +7 -0
- package/src/lib/components/drawer/drawer-content.svelte +91 -0
- package/src/lib/components/drawer/drawer-description.svelte +8 -0
- package/src/lib/components/drawer/drawer-footer.svelte +11 -0
- package/src/lib/components/drawer/drawer-header.svelte +11 -0
- package/src/lib/components/drawer/drawer-nested.svelte +44 -0
- package/src/lib/components/drawer/drawer-overlay.svelte +60 -0
- package/src/lib/components/drawer/drawer-portal.svelte +10 -0
- package/src/lib/components/drawer/drawer-title.svelte +8 -0
- package/src/lib/components/drawer/drawer-trigger.svelte +7 -0
- package/src/lib/components/drawer/drawer.svelte +290 -0
- package/src/lib/components/drawer/index.ts +37 -0
- package/src/lib/components/dropdown-menu/components/dropdown-menu-content-static.svelte +22 -0
- package/src/lib/components/dropdown-menu/components/dropdown-menu-content.svelte +22 -0
- package/src/lib/components/dropdown-menu/index.ts +39 -0
- package/src/lib/components/dropdown-menu/types.ts +41 -0
- package/src/lib/components/empty/empty-content.svelte +15 -0
- package/src/lib/components/empty/empty-description.svelte +15 -0
- package/src/lib/components/empty/empty-header.svelte +15 -0
- package/src/lib/components/empty/empty-media.svelte +21 -0
- package/src/lib/components/empty/empty-title.svelte +11 -0
- package/src/lib/components/empty/empty.svelte +18 -0
- package/src/lib/components/empty/index.ts +22 -0
- package/src/lib/components/empty/variants.ts +16 -0
- package/src/lib/components/field/field-content.svelte +14 -0
- package/src/lib/components/field/field-description.svelte +19 -0
- package/src/lib/components/field/field-error.svelte +47 -0
- package/src/lib/components/field/field-group.svelte +17 -0
- package/src/lib/components/field/field-label.svelte +18 -0
- package/src/lib/components/field/field-legend.svelte +23 -0
- package/src/lib/components/field/field-separator.svelte +32 -0
- package/src/lib/components/field/field-set.svelte +14 -0
- package/src/lib/components/field/field-title.svelte +14 -0
- package/src/lib/components/field/field.svelte +36 -0
- package/src/lib/components/field/index.ts +32 -0
- package/src/lib/components/field/variants.ts +19 -0
- package/src/lib/components/input/file-input.svelte +26 -0
- package/src/lib/components/input/index.ts +12 -0
- package/src/lib/components/input/input.svelte +24 -0
- package/src/lib/components/input/variants.ts +28 -0
- package/src/lib/components/item/index.ts +34 -0
- package/src/lib/components/item/item-actions.svelte +11 -0
- package/src/lib/components/item/item-content.svelte +15 -0
- package/src/lib/components/item/item-description.svelte +18 -0
- package/src/lib/components/item/item-footer.svelte +11 -0
- package/src/lib/components/item/item-group.svelte +16 -0
- package/src/lib/components/item/item-header.svelte +11 -0
- package/src/lib/components/item/item-media.svelte +37 -0
- package/src/lib/components/item/item-separator.svelte +9 -0
- package/src/lib/components/item/item-title.svelte +15 -0
- package/src/lib/components/item/item.svelte +61 -0
- package/src/lib/components/kbd/index.ts +10 -0
- package/src/lib/components/kbd/kbd-group.svelte +11 -0
- package/src/lib/components/kbd/kbd.svelte +18 -0
- package/src/lib/components/label/exports.ts +2 -0
- package/src/lib/components/label/index.ts +2 -0
- package/src/lib/components/label/label.svelte +39 -0
- package/src/lib/components/label/label.svelte.ts +39 -0
- package/src/lib/components/label/types.ts +7 -0
- package/src/lib/components/link-preview/components/link-preview-content.svelte +60 -0
- package/src/lib/components/link-preview/components/link-preview-trigger.svelte +29 -0
- package/src/lib/components/link-preview/components/link-preview.svelte +34 -0
- package/src/lib/components/link-preview/exports.ts +11 -0
- package/src/lib/components/link-preview/index.ts +2 -0
- package/src/lib/components/link-preview/link-preview.svelte.ts +270 -0
- package/src/lib/components/link-preview/types.ts +102 -0
- package/src/lib/components/menu/components/menu-arrow.svelte +14 -0
- package/src/lib/components/menu/components/menu-checkbox-group.svelte +42 -0
- package/src/lib/components/menu/components/menu-checkbox-item.svelte +85 -0
- package/src/lib/components/menu/components/menu-content.svelte +98 -0
- package/src/lib/components/menu/components/menu-group-heading.svelte +47 -0
- package/src/lib/components/menu/components/menu-group.svelte +36 -0
- package/src/lib/components/menu/components/menu-item.svelte +58 -0
- package/src/lib/components/menu/components/menu-radio-group.svelte +44 -0
- package/src/lib/components/menu/components/menu-radio-item.svelte +65 -0
- package/src/lib/components/menu/components/menu-separator.svelte +38 -0
- package/src/lib/components/menu/components/menu-sub-content-static.svelte +8 -0
- package/src/lib/components/menu/components/menu-sub-content.svelte +133 -0
- package/src/lib/components/menu/components/menu-sub-trigger.svelte +60 -0
- package/src/lib/components/menu/components/menu-sub.svelte +23 -0
- package/src/lib/components/menu/components/menu-trigger.svelte +50 -0
- package/src/lib/components/menu/components/menu.svelte +58 -0
- package/src/lib/components/menu/exports.ts +38 -0
- package/src/lib/components/menu/menu.svelte.ts +1599 -0
- package/src/lib/components/menu/types.ts +285 -0
- package/src/lib/components/menu/utils.ts +68 -0
- package/src/lib/components/menubar/components/menubar-content-static.svelte +50 -0
- package/src/lib/components/menubar/components/menubar-content.svelte +54 -0
- package/src/lib/components/menubar/components/menubar-menu.svelte +34 -0
- package/src/lib/components/menubar/components/menubar-trigger.svelte +50 -0
- package/src/lib/components/menubar/components/menubar.svelte +57 -0
- package/src/lib/components/menubar/exports.ts +44 -0
- package/src/lib/components/menubar/index.ts +2 -0
- package/src/lib/components/menubar/menubar.svelte.ts +394 -0
- package/src/lib/components/menubar/types.ts +97 -0
- package/src/lib/components/meter/components/meter.svelte +41 -0
- package/src/lib/components/meter/exports.ts +2 -0
- package/src/lib/components/meter/index.ts +2 -0
- package/src/lib/components/meter/meter.svelte.ts +47 -0
- package/src/lib/components/meter/types.ts +28 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-content-impl.svelte +85 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-content.svelte +58 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-indicator-impl.svelte +29 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-indicator.svelte +56 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-item.svelte +56 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-link.svelte +64 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-list.svelte +59 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-sub.svelte +46 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-trigger.svelte +80 -0
- package/src/lib/components/navigation-menu/components/navigation-menu-viewport.svelte +63 -0
- package/src/lib/components/navigation-menu/components/navigation-menu.svelte +80 -0
- package/src/lib/components/navigation-menu/index.ts +28 -0
- package/src/lib/components/navigation-menu/navigation-menu.svelte.ts +1092 -0
- package/src/lib/components/navigation-menu/types.ts +189 -0
- package/src/lib/components/pagination/components/pagination-next-button.svelte +60 -0
- package/src/lib/components/pagination/components/pagination-page.svelte +65 -0
- package/src/lib/components/pagination/components/pagination-prev-button.svelte +60 -0
- package/src/lib/components/pagination/components/pagination.svelte +65 -0
- package/src/lib/components/pagination/index.ts +11 -0
- package/src/lib/components/pagination/pagination.svelte.ts +275 -0
- package/src/lib/components/pagination/types.ts +100 -0
- package/src/lib/components/pin-input/components/pin-input-cell.svelte +49 -0
- package/src/lib/components/pin-input/components/pin-input.svelte +76 -0
- package/src/lib/components/pin-input/exports.ts +4 -0
- package/src/lib/components/pin-input/index.ts +2 -0
- package/src/lib/components/pin-input/pin-input.svelte.ts +541 -0
- package/src/lib/components/pin-input/types.ts +118 -0
- package/src/lib/components/pin-input/usePasswordManager.svelte.ts +122 -0
- package/src/lib/components/popover/components/popover-close.svelte +38 -0
- package/src/lib/components/popover/components/popover-content.svelte +70 -0
- package/src/lib/components/popover/components/popover-header.svelte +11 -0
- package/src/lib/components/popover/components/popover-title.svelte +11 -0
- package/src/lib/components/popover/components/popover-trigger.svelte +44 -0
- package/src/lib/components/popover/components/popover.svelte +26 -0
- package/src/lib/components/popover/exports.ts +13 -0
- package/src/lib/components/popover/index.ts +2 -0
- package/src/lib/components/popover/popover.svelte.ts +392 -0
- package/src/lib/components/popover/types.ts +92 -0
- package/src/lib/components/progress/components/progress.svelte +56 -0
- package/src/lib/components/progress/exports.ts +3 -0
- package/src/lib/components/progress/index.ts +2 -0
- package/src/lib/components/progress/progress.svelte.ts +58 -0
- package/src/lib/components/progress/types.ts +28 -0
- package/src/lib/components/radio-group/context.ts +13 -0
- package/src/lib/components/radio-group/index.ts +10 -0
- package/src/lib/components/radio-group/radio-group-item.svelte +67 -0
- package/src/lib/components/radio-group/radio-group.svelte +87 -0
- package/src/lib/components/range-calendar/components/range-calendar-cell.svelte +31 -0
- package/src/lib/components/range-calendar/components/range-calendar-day.svelte +33 -0
- package/src/lib/components/range-calendar/components/range-calendar.svelte +120 -0
- package/src/lib/components/range-calendar/exports.ts +31 -0
- package/src/lib/components/range-calendar/index.ts +2 -0
- package/src/lib/components/range-calendar/range-calendar.svelte.ts +739 -0
- package/src/lib/components/range-calendar/types.ts +258 -0
- package/src/lib/components/resizable/index.ts +15 -0
- package/src/lib/components/resizable/resizable-handle.svelte +30 -0
- package/src/lib/components/resizable/resizable-pane-group.svelte +19 -0
- package/src/lib/components/scroll-area/components/scroll-area-corner-impl.svelte +34 -0
- package/src/lib/components/scroll-area/components/scroll-area-corner.svelte +18 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-auto.svelte +15 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-hover.svelte +22 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-scroll.svelte +16 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-shared.svelte +19 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-visible.svelte +16 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-x.svelte +23 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar-y.svelte +24 -0
- package/src/lib/components/scroll-area/components/scroll-area-scrollbar.svelte +56 -0
- package/src/lib/components/scroll-area/components/scroll-area-thumb-impl.svelte +49 -0
- package/src/lib/components/scroll-area/components/scroll-area-thumb.svelte +21 -0
- package/src/lib/components/scroll-area/components/scroll-area-viewport.svelte +39 -0
- package/src/lib/components/scroll-area/components/scroll-area.svelte +82 -0
- package/src/lib/components/scroll-area/exports.ts +13 -0
- package/src/lib/components/scroll-area/index.ts +2 -0
- package/src/lib/components/scroll-area/scroll-area.svelte.ts +946 -0
- package/src/lib/components/scroll-area/types.ts +67 -0
- package/src/lib/components/select/index.ts +5 -0
- package/src/lib/components/select/select-opt-group.svelte +10 -0
- package/src/lib/components/select/select-option.svelte +15 -0
- package/src/lib/components/select/select.svelte +281 -0
- package/src/lib/components/separator/components/separator.svelte +49 -0
- package/src/lib/components/separator/index.ts +3 -0
- package/src/lib/components/separator/separator.svelte.ts +43 -0
- package/src/lib/components/separator/types.ts +22 -0
- package/src/lib/components/sheet/components/sheet-close.svelte +8 -0
- package/src/lib/components/sheet/components/sheet-content.svelte +108 -0
- package/src/lib/components/sheet/components/sheet-description.svelte +9 -0
- package/src/lib/components/sheet/components/sheet-footer.svelte +11 -0
- package/src/lib/components/sheet/components/sheet-header.svelte +11 -0
- package/src/lib/components/sheet/components/sheet-overlay.svelte +13 -0
- package/src/lib/components/sheet/components/sheet-title.svelte +9 -0
- package/src/lib/components/sheet/components/sheet-trigger.svelte +8 -0
- package/src/lib/components/sheet/index.ts +47 -0
- package/src/lib/components/sheet/variants.ts +20 -0
- package/src/lib/components/sidebar/constants.ts +6 -0
- package/src/lib/components/sidebar/context.svelte.ts +54 -0
- package/src/lib/components/sidebar/index.ts +77 -0
- package/src/lib/components/sidebar/sidebar-content.svelte +16 -0
- package/src/lib/components/sidebar/sidebar-desktop-surface.svelte +60 -0
- package/src/lib/components/sidebar/sidebar-footer.svelte +11 -0
- package/src/lib/components/sidebar/sidebar-group-action.svelte +34 -0
- package/src/lib/components/sidebar/sidebar-group-content.svelte +16 -0
- package/src/lib/components/sidebar/sidebar-group-label.svelte +34 -0
- package/src/lib/components/sidebar/sidebar-group.svelte +16 -0
- package/src/lib/components/sidebar/sidebar-header.svelte +11 -0
- package/src/lib/components/sidebar/sidebar-input.svelte +14 -0
- package/src/lib/components/sidebar/sidebar-inset.svelte +18 -0
- package/src/lib/components/sidebar/sidebar-menu-action.svelte +38 -0
- package/src/lib/components/sidebar/sidebar-menu-badge.svelte +19 -0
- package/src/lib/components/sidebar/sidebar-menu-button.svelte +99 -0
- package/src/lib/components/sidebar/sidebar-menu-item.svelte +21 -0
- package/src/lib/components/sidebar/sidebar-menu-skeleton.svelte +34 -0
- package/src/lib/components/sidebar/sidebar-menu-sub-button.svelte +40 -0
- package/src/lib/components/sidebar/sidebar-menu-sub-item.svelte +16 -0
- package/src/lib/components/sidebar/sidebar-menu-sub.svelte +19 -0
- package/src/lib/components/sidebar/sidebar-menu.svelte +21 -0
- package/src/lib/components/sidebar/sidebar-mobile-surface.svelte +48 -0
- package/src/lib/components/sidebar/sidebar-provider.svelte +60 -0
- package/src/lib/components/sidebar/sidebar-rail.svelte +36 -0
- package/src/lib/components/sidebar/sidebar-separator.svelte +9 -0
- package/src/lib/components/sidebar/sidebar-trigger.svelte +35 -0
- package/src/lib/components/sidebar/sidebar.svelte +30 -0
- package/src/lib/components/sidebar/types.ts +14 -0
- package/src/lib/components/skeleton/index.ts +7 -0
- package/src/lib/components/skeleton/skeleton.svelte +9 -0
- package/src/lib/components/slider/components/slider-range.svelte +37 -0
- package/src/lib/components/slider/components/slider-thumb-label.svelte +42 -0
- package/src/lib/components/slider/components/slider-thumb.svelte +46 -0
- package/src/lib/components/slider/components/slider-tick-label.svelte +42 -0
- package/src/lib/components/slider/components/slider-tick.svelte +28 -0
- package/src/lib/components/slider/components/slider.svelte +136 -0
- package/src/lib/components/slider/helpers.ts +249 -0
- package/src/lib/components/slider/index.ts +15 -0
- package/src/lib/components/slider/slider.svelte.ts +979 -0
- package/src/lib/components/slider/types.ts +294 -0
- package/src/lib/components/sonner/Toast.svelte +558 -0
- package/src/lib/components/sonner/Toaster.svelte +603 -0
- package/src/lib/components/sonner/index.ts +15 -0
- package/src/lib/components/sonner/toast-state.svelte.ts +217 -0
- package/src/lib/components/sonner/types.ts +384 -0
- package/src/lib/components/switch/index.ts +8 -0
- package/src/lib/components/switch/switch.svelte +78 -0
- package/src/lib/components/table/index.ts +28 -0
- package/src/lib/components/table/table-body.svelte +15 -0
- package/src/lib/components/table/table-caption.svelte +10 -0
- package/src/lib/components/table/table-cell.svelte +14 -0
- package/src/lib/components/table/table-footer.svelte +19 -0
- package/src/lib/components/table/table-head.svelte +17 -0
- package/src/lib/components/table/table-header.svelte +15 -0
- package/src/lib/components/table/table-row.svelte +14 -0
- package/src/lib/components/table/table.svelte +12 -0
- package/src/lib/components/tabs/components/tabs-content.svelte +30 -0
- package/src/lib/components/tabs/components/tabs-list.svelte +38 -0
- package/src/lib/components/tabs/components/tabs-trigger.svelte +51 -0
- package/src/lib/components/tabs/components/tabs.svelte +52 -0
- package/src/lib/components/tabs/index.ts +11 -0
- package/src/lib/components/tabs/tabs.svelte.ts +253 -0
- package/src/lib/components/tabs/types.ts +86 -0
- package/src/lib/components/textarea/index.ts +7 -0
- package/src/lib/components/textarea/textarea.svelte +23 -0
- package/src/lib/components/theme-toggle/index.ts +5 -0
- package/src/lib/components/theme-toggle/theme-toggle.svelte +49 -0
- package/src/lib/components/theme-toggle/theme.svelte.ts +81 -0
- package/src/lib/components/time-field/components/time-field-hidden-input.svelte +9 -0
- package/src/lib/components/time-field/components/time-field-input.svelte +33 -0
- package/src/lib/components/time-field/components/time-field-label.svelte +29 -0
- package/src/lib/components/time-field/components/time-field-segment.svelte +29 -0
- package/src/lib/components/time-field/components/time-field.svelte +99 -0
- package/src/lib/components/time-field/index.ts +11 -0
- package/src/lib/components/time-field/time-field.svelte.ts +1198 -0
- package/src/lib/components/time-field/types.ts +174 -0
- package/src/lib/components/time-range-field/components/time-range-field-input.svelte +36 -0
- package/src/lib/components/time-range-field/components/time-range-field-label.svelte +29 -0
- package/src/lib/components/time-range-field/components/time-range-field.svelte +104 -0
- package/src/lib/components/time-range-field/index.ts +11 -0
- package/src/lib/components/time-range-field/time-range-field.svelte.ts +235 -0
- package/src/lib/components/time-range-field/types.ts +181 -0
- package/src/lib/components/toggle/components/toggle.svelte +55 -0
- package/src/lib/components/toggle/index.ts +3 -0
- package/src/lib/components/toggle/toggle.svelte.ts +57 -0
- package/src/lib/components/toggle/types.ts +33 -0
- package/src/lib/components/toggle/variants.ts +25 -0
- package/src/lib/components/toggle-group/components/toggle-group-item.svelte +67 -0
- package/src/lib/components/toggle-group/components/toggle-group.svelte +109 -0
- package/src/lib/components/toggle-group/index.ts +7 -0
- package/src/lib/components/toggle-group/toggle-group.svelte.ts +235 -0
- package/src/lib/components/toggle-group/types.ts +89 -0
- package/src/lib/components/toolbar/components/toolbar-button.svelte +46 -0
- package/src/lib/components/toolbar/components/toolbar-group-item.svelte +56 -0
- package/src/lib/components/toolbar/components/toolbar-group.svelte +69 -0
- package/src/lib/components/toolbar/components/toolbar-link.svelte +39 -0
- package/src/lib/components/toolbar/components/toolbar.svelte +39 -0
- package/src/lib/components/toolbar/index.ts +13 -0
- package/src/lib/components/toolbar/toolbar.svelte.ts +373 -0
- package/src/lib/components/toolbar/types.ts +60 -0
- package/src/lib/components/tooltip/components/tooltip-content.svelte +81 -0
- package/src/lib/components/tooltip/components/tooltip-provider.svelte +26 -0
- package/src/lib/components/tooltip/components/tooltip-trigger.svelte +48 -0
- package/src/lib/components/tooltip/components/tooltip.svelte +55 -0
- package/src/lib/components/tooltip/index.ts +17 -0
- package/src/lib/components/tooltip/tooltip.svelte.ts +796 -0
- package/src/lib/components/tooltip/types.ts +175 -0
- package/src/lib/components/tooltip/utils.ts +1 -0
- package/src/lib/icons/google-icon.svelte +10 -0
- package/src/lib/icons/google-workspace.svelte +18 -0
- package/src/lib/icons/icon.d.ts +19 -0
- package/src/lib/icons/instagram.svelte +9 -0
- package/src/lib/icons/instantly.svelte +10 -0
- package/src/lib/icons/linkedin.svelte +9 -0
- package/src/lib/icons/mailshake.svelte +10 -0
- package/src/lib/icons/microsoft-365.svelte +7 -0
- package/src/lib/icons/passcode.svelte +12 -0
- package/src/lib/icons/replyio.svelte +10 -0
- package/src/lib/icons/smartlead.svelte +19 -0
- package/src/lib/icons/smtp.svelte +10 -0
- package/src/lib/icons/x-logo.svelte +9 -0
- package/src/lib/internal/animations-settled.svelte.ts +119 -0
- package/src/lib/internal/arrays.ts +253 -0
- package/src/lib/internal/attribute-types.ts +53 -0
- package/src/lib/internal/attrs.ts +64 -0
- package/src/lib/internal/body-scroll-lock.svelte.ts +330 -0
- package/src/lib/internal/create-id.ts +12 -0
- package/src/lib/internal/date-time/announcer.ts +74 -0
- package/src/lib/internal/date-time/calendar-helpers.svelte.ts +399 -0
- package/src/lib/internal/date-time/field/helpers.ts +431 -0
- package/src/lib/internal/date-time/field/parts.ts +15 -0
- package/src/lib/internal/date-time/field/range-field.svelte.ts +45 -0
- package/src/lib/internal/date-time/field/segments.ts +89 -0
- package/src/lib/internal/date-time/field/time-helpers.ts +311 -0
- package/src/lib/internal/date-time/formatter.ts +86 -0
- package/src/lib/internal/date-time/placeholders.ts +131 -0
- package/src/lib/internal/date-time/types.ts +121 -0
- package/src/lib/internal/date-time/utils.ts +243 -0
- package/src/lib/internal/dismissible-layer/index.ts +3 -0
- package/src/lib/internal/dismissible-layer/scheduler.ts +48 -0
- package/src/lib/internal/dismissible-layer/types.ts +57 -0
- package/src/lib/internal/dismissible-layer/use-dismissable-layer.svelte.ts +291 -0
- package/src/lib/internal/escape-layer/index.ts +3 -0
- package/src/lib/internal/escape-layer/types.ts +34 -0
- package/src/lib/internal/escape-layer/use-escape-layer.svelte.ts +91 -0
- package/src/lib/internal/floating-layer/components/floating-layer-arrow.svelte +35 -0
- package/src/lib/internal/floating-layer/components/floating-layer-content-static.svelte +19 -0
- package/src/lib/internal/floating-layer/components/floating-layer-content.svelte +52 -0
- package/src/lib/internal/floating-layer/components/floating-layer.svelte +12 -0
- package/src/lib/internal/floating-layer/components/index.ts +6 -0
- package/src/lib/internal/floating-layer/index.ts +2 -0
- package/src/lib/internal/floating-layer/types.ts +126 -0
- package/src/lib/internal/floating-layer/use-floating-layer.svelte.ts +471 -0
- package/src/lib/internal/focus-scope/focus-scope.svelte.ts +310 -0
- package/src/lib/internal/focus-scope/index.ts +4 -0
- package/src/lib/internal/focus-scope/types.ts +45 -0
- package/src/lib/internal/focus.ts +14 -0
- package/src/lib/internal/global-singleton.ts +10 -0
- package/src/lib/internal/group-value.svelte.ts +36 -0
- package/src/lib/internal/hover-intent-geometry.ts +96 -0
- package/src/lib/internal/index.ts +44 -0
- package/src/lib/internal/kbd.ts +60 -0
- package/src/lib/internal/layer-stack.ts +37 -0
- package/src/lib/internal/math.ts +11 -0
- package/src/lib/internal/merge-props.ts +7 -0
- package/src/lib/internal/native-dialog-controller.svelte.ts +102 -0
- package/src/lib/internal/native-popover.svelte.ts +173 -0
- package/src/lib/internal/open-cell.svelte.ts +41 -0
- package/src/lib/internal/paneforge/index.ts +5 -0
- package/src/lib/internal/paneforge/internal/constants.ts +2 -0
- package/src/lib/internal/paneforge/internal/helpers.ts +354 -0
- package/src/lib/internal/paneforge/internal/types.ts +33 -0
- package/src/lib/internal/paneforge/internal/utils/adjust-layout.ts +122 -0
- package/src/lib/internal/paneforge/internal/utils/aria.ts +36 -0
- package/src/lib/internal/paneforge/internal/utils/compare.ts +15 -0
- package/src/lib/internal/paneforge/internal/utils/is.ts +13 -0
- package/src/lib/internal/paneforge/internal/utils/resize.ts +31 -0
- package/src/lib/internal/paneforge/internal/utils/storage.ts +116 -0
- package/src/lib/internal/paneforge/internal/utils/style.ts +104 -0
- package/src/lib/internal/paneforge/pane-group.svelte +48 -0
- package/src/lib/internal/paneforge/pane-resizer.svelte +40 -0
- package/src/lib/internal/paneforge/pane.svelte +60 -0
- package/src/lib/internal/paneforge/paneforge.svelte.ts +821 -0
- package/src/lib/internal/paneforge/types.ts +179 -0
- package/src/lib/internal/popper-layer/index.ts +2 -0
- package/src/lib/internal/popper-layer/popper-content.svelte +19 -0
- package/src/lib/internal/popper-layer/popper-layer-inner.svelte +122 -0
- package/src/lib/internal/popper-layer/popper-layer.svelte +71 -0
- package/src/lib/internal/popper-layer/types.ts +65 -0
- package/src/lib/internal/portal/index.ts +2 -0
- package/src/lib/internal/portal/portal.svelte +61 -0
- package/src/lib/internal/prop-resolvers.ts +14 -0
- package/src/lib/internal/roving-focus-group.ts +147 -0
- package/src/lib/internal/roving-focus-item.svelte.ts +51 -0
- package/src/lib/internal/safe-polygon.svelte.ts +239 -0
- package/src/lib/internal/shared-state.svelte.ts +39 -0
- package/src/lib/internal/state-machine.ts +32 -0
- package/src/lib/internal/svelte-resize-observer.svelte.ts +37 -0
- package/src/lib/internal/tabbable.ts +398 -0
- package/src/lib/internal/table/core.ts +53 -0
- package/src/lib/internal/table/filter-fns.ts +10 -0
- package/src/lib/internal/table/index.ts +2 -0
- package/src/lib/internal/table/sorting-fns.ts +84 -0
- package/src/lib/internal/table/table.svelte.ts +330 -0
- package/src/lib/internal/table/types.ts +33 -0
- package/src/lib/internal/timeout-fn.svelte.ts +36 -0
- package/src/lib/internal/tools/box.svelte.ts +153 -0
- package/src/lib/internal/tools/index.ts +22 -0
- package/src/lib/internal/tools/types.ts +44 -0
- package/src/lib/internal/tools/utils/attach-ref.ts +74 -0
- package/src/lib/internal/tools/utils/compose-handlers.ts +36 -0
- package/src/lib/internal/tools/utils/dom-context.svelte.ts +63 -0
- package/src/lib/internal/tools/utils/dom.ts +62 -0
- package/src/lib/internal/tools/utils/events.ts +1 -0
- package/src/lib/internal/tools/utils/index.ts +5 -0
- package/src/lib/internal/tools/utils/strings.ts +28 -0
- package/src/lib/internal/typeahead.svelte.ts +48 -0
- package/src/lib/internal/types.ts +119 -0
- package/src/lib/internal/utils.ts +10 -0
- package/src/lib/internal/vaul/browser.ts +8 -0
- package/src/lib/internal/vaul/constants.ts +19 -0
- package/src/lib/internal/vaul/helpers.ts +39 -0
- package/src/lib/internal/vaul/types.ts +142 -0
- package/src/lib/internal/vaul/use-drawer-content.svelte.ts +219 -0
- package/src/lib/internal/vaul/use-drawer-root.svelte.ts +682 -0
- package/src/lib/internal/vaul/use-position-fixed.svelte.ts +142 -0
- package/src/lib/internal/vaul/use-prevent-scroll.svelte.ts +267 -0
- package/src/lib/internal/vaul/use-snap-points.svelte.ts +246 -0
- package/src/lib/time.ts +73 -0
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import type { DateValue } from '@internationalized/date';
|
|
2
|
+
import type { OnChangeFn, WithChild, Without } from '../../internal/types.js';
|
|
3
|
+
import type {
|
|
4
|
+
BitsPrimitiveButtonAttributes,
|
|
5
|
+
BitsPrimitiveDivAttributes,
|
|
6
|
+
BitsPrimitiveHeaderAttributes,
|
|
7
|
+
BitsPrimitiveSelectAttributes,
|
|
8
|
+
BitsPrimitiveTableAttributes,
|
|
9
|
+
BitsPrimitiveTbodyAttributes,
|
|
10
|
+
BitsPrimitiveTdAttributes,
|
|
11
|
+
BitsPrimitiveThAttributes,
|
|
12
|
+
BitsPrimitiveTheadAttributes,
|
|
13
|
+
BitsPrimitiveTrAttributes,
|
|
14
|
+
} from '../../internal/attribute-types.js';
|
|
15
|
+
import type { DateMatcher, Month, WeekStartsOn } from '../../internal/date-time/types.js';
|
|
16
|
+
|
|
17
|
+
export type CalendarRootSnippetProps = {
|
|
18
|
+
months: Month<DateValue>[];
|
|
19
|
+
weekdays: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type CalendarBaseRootPropsWithoutHTML = {
|
|
23
|
+
/**
|
|
24
|
+
* The placeholder date, used to control the view of the
|
|
25
|
+
* calendar when no value is present.
|
|
26
|
+
*
|
|
27
|
+
* @default the current date
|
|
28
|
+
*/
|
|
29
|
+
placeholder?: DateValue;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A callback function called when the placeholder value
|
|
33
|
+
* changes.
|
|
34
|
+
*/
|
|
35
|
+
onPlaceholderChange?: OnChangeFn<DateValue>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Whether or not users can deselect a date once selected
|
|
39
|
+
* without selecting another date.
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
preventDeselect?: boolean;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The minimum date that can be selected in the calendar.
|
|
47
|
+
*/
|
|
48
|
+
minValue?: DateValue;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The maximum date that can be selected in the calendar.
|
|
52
|
+
*/
|
|
53
|
+
maxValue?: DateValue;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Whether or not the calendar is disabled.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Applicable only when `numberOfMonths` is greater than 1.
|
|
64
|
+
*
|
|
65
|
+
* Controls whether to use paged navigation for the next and previous buttons in the
|
|
66
|
+
* date picker. With paged navigation set to `true`, clicking the next/prev buttons
|
|
67
|
+
* changes all months in view. When set to `false`, it shifts the view by a single month.
|
|
68
|
+
*
|
|
69
|
+
* For example, with `pagedNavigation` set to `true` and 2 months displayed (January and
|
|
70
|
+
* February), clicking the next button changes the view to March and April. If `pagedNavigation`
|
|
71
|
+
* is `false`, the view shifts to February and March.
|
|
72
|
+
*
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
pagedNavigation?: boolean;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The day of the week to start the calendar on, which must
|
|
79
|
+
* be a number between 0 and 6, where 0 is Sunday and 6 is
|
|
80
|
+
* Saturday.
|
|
81
|
+
*
|
|
82
|
+
* @default 0 (Sunday)
|
|
83
|
+
*/
|
|
84
|
+
weekStartsOn?: WeekStartsOn;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* How the string representation of the weekdays provided via the `weekdays` state store
|
|
88
|
+
* should be formatted.
|
|
89
|
+
*
|
|
90
|
+
* ```md
|
|
91
|
+
* - "long": "Sunday", "Monday", "Tuesday", etc.
|
|
92
|
+
* - "short": "Sun", "Mon", "Tue", etc.
|
|
93
|
+
* - "narrow": "S", "M", "T", etc.
|
|
94
|
+
*```
|
|
95
|
+
*
|
|
96
|
+
* @default "narrow"
|
|
97
|
+
*
|
|
98
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#weekday
|
|
99
|
+
*/
|
|
100
|
+
weekdayFormat?: Intl.DateTimeFormatOptions['weekday'];
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* A function that receives a date and returns `true` or `false` to indicate whether
|
|
104
|
+
* the date is disabled.
|
|
105
|
+
*
|
|
106
|
+
* @remarks
|
|
107
|
+
* Disabled dates cannot be focused or selected. Additionally, they are tagged
|
|
108
|
+
* with a data attribute to enable custom styling.
|
|
109
|
+
*
|
|
110
|
+
* `[data-disabled]` - applied to disabled dates
|
|
111
|
+
*
|
|
112
|
+
*/
|
|
113
|
+
isDateDisabled?: DateMatcher;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Dates matching the provided matchers are marked as "unavailable." Unlike disabled dates,
|
|
117
|
+
* users can still focus and select unavailable dates. However, selecting an unavailable date
|
|
118
|
+
* renders the date picker as invalid.
|
|
119
|
+
*
|
|
120
|
+
* For example, in a calendar for booking appointments, you might mark already booked dates as
|
|
121
|
+
* unavailable. These dates could become available again before the appointment date, allowing
|
|
122
|
+
* users to select them to learn more about the appointment.
|
|
123
|
+
*
|
|
124
|
+
* `[data-unavailable]` - applied to unavailable dates
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
isDateUnavailable?: DateMatcher;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Display 6 weeks per month, regardless the month's number of weeks.
|
|
131
|
+
* This is useful for displaying a consistent calendar, where the size
|
|
132
|
+
* of the calendar doesn't change month to month.
|
|
133
|
+
*
|
|
134
|
+
* To display 6 weeks per month, you will need to render out the previous
|
|
135
|
+
* and next month's dates in the calendar as well.
|
|
136
|
+
*
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
fixedWeeks?: boolean;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Determines the number of months to display on the calendar simultaneously.
|
|
143
|
+
* For navigation between months, refer to the `pagedNavigation` prop.
|
|
144
|
+
*
|
|
145
|
+
* @default 1
|
|
146
|
+
*/
|
|
147
|
+
numberOfMonths?: number;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* This label is exclusively used for accessibility, remaining hidden from the page.
|
|
151
|
+
* It's read by screen readers when the calendar is opened. The current month and year
|
|
152
|
+
* are automatically appended to the label, so you only need to provide the base label.
|
|
153
|
+
*
|
|
154
|
+
* For instance:
|
|
155
|
+
* - 'Date of birth' will be read as 'Date of birth, January 2021' if the current month is January 2021.
|
|
156
|
+
* - 'Appointment date' will be read as 'Appointment date, January 2021' if the current month is January 2021.
|
|
157
|
+
* - 'Booking date' will be read as 'Booking date, January 2021' if the current month is January 2021.
|
|
158
|
+
*/
|
|
159
|
+
calendarLabel?: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The default locale setting.
|
|
163
|
+
*
|
|
164
|
+
* @default 'en'
|
|
165
|
+
*/
|
|
166
|
+
locale?: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Whether the calendar is readonly. When true, the user will be able
|
|
170
|
+
* to focus and navigate the calendar, but will not be able to select
|
|
171
|
+
* dates. @see disabled for a similar prop that prevents focusing
|
|
172
|
+
* and selecting dates.
|
|
173
|
+
*
|
|
174
|
+
* @default false
|
|
175
|
+
*/
|
|
176
|
+
readonly?: boolean;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* If `true`, the calendar will focus the selected day, today, or the first day of the month
|
|
180
|
+
* in that order depending on what is visible when the calendar is mounted.
|
|
181
|
+
*/
|
|
182
|
+
initialFocus?: boolean;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Whether to disable the selection of days outside the current month. By default,
|
|
186
|
+
* days outside the current month are rendered to fill the calendar grid, but they
|
|
187
|
+
* are not selectable. Setting this prop to `true` will disable this behavior.
|
|
188
|
+
*
|
|
189
|
+
* @default false
|
|
190
|
+
*/
|
|
191
|
+
disableDaysOutsideMonth?: boolean;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The maximum number of days that can be selected in multiple mode.
|
|
195
|
+
* When set, users cannot select more dates than this number.
|
|
196
|
+
*
|
|
197
|
+
* @default undefined
|
|
198
|
+
*/
|
|
199
|
+
maxDays?: number;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The format of the month names in the calendar.
|
|
203
|
+
*
|
|
204
|
+
* @default "long"
|
|
205
|
+
*/
|
|
206
|
+
monthFormat?: Intl.DateTimeFormatOptions['month'] | ((month: number) => string);
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* The format of the year names in the calendar.
|
|
210
|
+
*
|
|
211
|
+
* @default "numeric"
|
|
212
|
+
*/
|
|
213
|
+
yearFormat?: Intl.DateTimeFormatOptions['year'] | ((year: number) => string);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
export type CalendarSingleRootPropsWithoutHTML = {
|
|
217
|
+
/**
|
|
218
|
+
* The type of calendar. If set to `'single'`, the calendar will
|
|
219
|
+
* only allow a single date to be selected. If set to `'multiple'`,
|
|
220
|
+
* the calendar will allow multiple dates to be selected.
|
|
221
|
+
*/
|
|
222
|
+
type: 'single';
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The value of the selected date in the calendar.
|
|
226
|
+
*/
|
|
227
|
+
value?: DateValue;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* A callback function called when the value changes.
|
|
231
|
+
*/
|
|
232
|
+
onValueChange?: OnChangeFn<DateValue | undefined>;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export type CalendarMultipleRootPropsWithoutHTML = {
|
|
236
|
+
/**
|
|
237
|
+
* The type of calendar. If set to `'single'`, the calendar will
|
|
238
|
+
* only allow a single date to be selected. If set to `'multiple'`,
|
|
239
|
+
* the calendar will allow multiple dates to be selected.
|
|
240
|
+
*/
|
|
241
|
+
type: 'multiple';
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* The value of the selected dates in the calendar.
|
|
245
|
+
*/
|
|
246
|
+
value?: DateValue[];
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* A callback function called when the value changes.
|
|
250
|
+
*/
|
|
251
|
+
onValueChange?: OnChangeFn<DateValue[]>;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export type _CalendarSingleRootPropsWithoutHTML = CalendarBaseRootPropsWithoutHTML & CalendarSingleRootPropsWithoutHTML;
|
|
255
|
+
|
|
256
|
+
export type CalendarSingleRootProps = _CalendarSingleRootPropsWithoutHTML &
|
|
257
|
+
Without<BitsPrimitiveDivAttributes, _CalendarSingleRootPropsWithoutHTML>;
|
|
258
|
+
|
|
259
|
+
export type _CalendarMultipleRootPropsWithoutHTML = CalendarBaseRootPropsWithoutHTML & CalendarMultipleRootPropsWithoutHTML;
|
|
260
|
+
|
|
261
|
+
export type CalendarMultipleRootProps = _CalendarMultipleRootPropsWithoutHTML &
|
|
262
|
+
Without<BitsPrimitiveDivAttributes, _CalendarMultipleRootPropsWithoutHTML>;
|
|
263
|
+
|
|
264
|
+
export type CalendarRootPropsWithoutHTML = CalendarBaseRootPropsWithoutHTML &
|
|
265
|
+
(
|
|
266
|
+
| WithChild<CalendarSingleRootPropsWithoutHTML, CalendarRootSnippetProps>
|
|
267
|
+
| WithChild<CalendarMultipleRootPropsWithoutHTML, CalendarRootSnippetProps>
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
export type CalendarRootProps = CalendarRootPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, CalendarRootPropsWithoutHTML>;
|
|
271
|
+
|
|
272
|
+
export type CalendarCellSnippetProps = {
|
|
273
|
+
disabled: boolean;
|
|
274
|
+
unavailable: boolean;
|
|
275
|
+
selected: boolean;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export type CalendarCellPropsWithoutHTML = WithChild<
|
|
279
|
+
{
|
|
280
|
+
/**
|
|
281
|
+
* The date value of the cell.
|
|
282
|
+
*
|
|
283
|
+
* @required
|
|
284
|
+
*/
|
|
285
|
+
date: DateValue;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* The month DateValue that this cell is being rendered in.
|
|
289
|
+
*/
|
|
290
|
+
month: DateValue;
|
|
291
|
+
},
|
|
292
|
+
CalendarCellSnippetProps
|
|
293
|
+
>;
|
|
294
|
+
|
|
295
|
+
export type CalendarCellProps = CalendarCellPropsWithoutHTML & Without<BitsPrimitiveTdAttributes, CalendarCellPropsWithoutHTML>;
|
|
296
|
+
|
|
297
|
+
export type CalendarGridPropsWithoutHTML = WithChild;
|
|
298
|
+
|
|
299
|
+
export type CalendarGridProps = CalendarGridPropsWithoutHTML & Without<BitsPrimitiveTableAttributes, CalendarGridPropsWithoutHTML>;
|
|
300
|
+
|
|
301
|
+
export type CalendarGridBodyPropsWithoutHTML = WithChild;
|
|
302
|
+
|
|
303
|
+
export type CalendarGridBodyProps = CalendarGridBodyPropsWithoutHTML &
|
|
304
|
+
Without<BitsPrimitiveTbodyAttributes, CalendarGridBodyPropsWithoutHTML>;
|
|
305
|
+
|
|
306
|
+
export type CalendarGridHeadPropsWithoutHTML = WithChild;
|
|
307
|
+
|
|
308
|
+
export type CalendarGridHeadProps = CalendarGridHeadPropsWithoutHTML &
|
|
309
|
+
Without<BitsPrimitiveTheadAttributes, CalendarGridHeadPropsWithoutHTML>;
|
|
310
|
+
|
|
311
|
+
export type CalendarHeadCellPropsWithoutHTML = WithChild;
|
|
312
|
+
|
|
313
|
+
export type CalendarHeadCellProps = CalendarHeadCellPropsWithoutHTML & Without<BitsPrimitiveThAttributes, CalendarHeadCellPropsWithoutHTML>;
|
|
314
|
+
|
|
315
|
+
export type CalendarGridRowPropsWithoutHTML = WithChild;
|
|
316
|
+
|
|
317
|
+
export type CalendarGridRowProps = CalendarGridRowPropsWithoutHTML & Without<BitsPrimitiveTrAttributes, CalendarGridRowPropsWithoutHTML>;
|
|
318
|
+
|
|
319
|
+
export type CalendarHeaderPropsWithoutHTML = WithChild;
|
|
320
|
+
|
|
321
|
+
export type CalendarHeaderProps = CalendarHeaderPropsWithoutHTML & Without<BitsPrimitiveHeaderAttributes, CalendarHeaderPropsWithoutHTML>;
|
|
322
|
+
|
|
323
|
+
export type CalendarHeadingSnippetProps = {
|
|
324
|
+
headingValue: string;
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export type CalendarHeadingPropsWithoutHTML = WithChild<{}, CalendarHeadingSnippetProps>;
|
|
328
|
+
|
|
329
|
+
export type CalendarDaySnippetProps = {
|
|
330
|
+
disabled: boolean;
|
|
331
|
+
unavailable: boolean;
|
|
332
|
+
selected: boolean;
|
|
333
|
+
day: string;
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export type CalendarDayPropsWithoutHTML = WithChild<{}, CalendarDaySnippetProps>;
|
|
337
|
+
|
|
338
|
+
export type CalendarDayProps = CalendarDayPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, CalendarDayPropsWithoutHTML>;
|
|
339
|
+
|
|
340
|
+
export type CalendarHeadingProps = CalendarHeadingPropsWithoutHTML & Without<BitsPrimitiveDivAttributes, CalendarHeadingPropsWithoutHTML>;
|
|
341
|
+
|
|
342
|
+
export type CalendarNextButtonPropsWithoutHTML = WithChild;
|
|
343
|
+
|
|
344
|
+
export type CalendarNextButtonProps = CalendarNextButtonPropsWithoutHTML &
|
|
345
|
+
Without<BitsPrimitiveButtonAttributes, CalendarNextButtonPropsWithoutHTML>;
|
|
346
|
+
|
|
347
|
+
export type CalendarPrevButtonPropsWithoutHTML = WithChild;
|
|
348
|
+
|
|
349
|
+
export type CalendarPrevButtonProps = CalendarPrevButtonPropsWithoutHTML &
|
|
350
|
+
Without<BitsPrimitiveButtonAttributes, CalendarPrevButtonPropsWithoutHTML>;
|
|
351
|
+
|
|
352
|
+
export type CalendarMonthSelectSnippetProps = {
|
|
353
|
+
monthItems: Array<{ value: number; label: string }>;
|
|
354
|
+
selectedMonthItem: { value: number; label: string };
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export type CalendarMonthSelectPropsWithoutHTML = WithChild<
|
|
358
|
+
{
|
|
359
|
+
/**
|
|
360
|
+
* An array of month numbers (1-12) to display in the select.
|
|
361
|
+
* This allows for flexible month selection, such as showing only
|
|
362
|
+
* specific months or seasons.
|
|
363
|
+
*
|
|
364
|
+
* @default [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] (all months)
|
|
365
|
+
*/
|
|
366
|
+
months?: number[];
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* How the month names should be formatted in the select options.
|
|
370
|
+
*
|
|
371
|
+
* - "long": "January", "February", etc.
|
|
372
|
+
* - "short": "Jan", "Feb", etc.
|
|
373
|
+
* - "narrow": "J", "F", etc.
|
|
374
|
+
* - "numeric": "1", "2", etc.
|
|
375
|
+
* - "2-digit": "01", "02", etc.
|
|
376
|
+
*
|
|
377
|
+
* @default "long"
|
|
378
|
+
*/
|
|
379
|
+
monthFormat?: Intl.DateTimeFormatOptions['month'] | ((month: number) => string);
|
|
380
|
+
},
|
|
381
|
+
CalendarMonthSelectSnippetProps
|
|
382
|
+
>;
|
|
383
|
+
|
|
384
|
+
export type CalendarMonthSelectProps = CalendarMonthSelectPropsWithoutHTML &
|
|
385
|
+
Without<BitsPrimitiveSelectAttributes, CalendarMonthSelectPropsWithoutHTML>;
|
|
386
|
+
|
|
387
|
+
export type CalendarYearSelectSnippetProps = {
|
|
388
|
+
yearItems: Array<{ value: number; label: string }>;
|
|
389
|
+
selectedYearItem: { value: number; label: string };
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
export type CalendarYearSelectPropsWithoutHTML = WithChild<
|
|
393
|
+
{
|
|
394
|
+
/**
|
|
395
|
+
* An array of years to display in the select.
|
|
396
|
+
* This allows for complete control over which years appear,
|
|
397
|
+
* such as showing only years with data or excluding certain periods.
|
|
398
|
+
*
|
|
399
|
+
* @default Array from currentYear - 100 to currentYear
|
|
400
|
+
*/
|
|
401
|
+
years?: number[];
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* How the year should be formatted in the select options.
|
|
405
|
+
*
|
|
406
|
+
* - "numeric": "2024", "2023", etc.
|
|
407
|
+
* - "2-digit": "24", "23", etc.
|
|
408
|
+
*
|
|
409
|
+
* @default "numeric"
|
|
410
|
+
*/
|
|
411
|
+
yearFormat?: Intl.DateTimeFormatOptions['year'] | ((year: number) => string);
|
|
412
|
+
},
|
|
413
|
+
CalendarYearSelectSnippetProps
|
|
414
|
+
>;
|
|
415
|
+
|
|
416
|
+
export type CalendarYearSelectProps = CalendarYearSelectPropsWithoutHTML &
|
|
417
|
+
Without<BitsPrimitiveSelectAttributes, CalendarYearSelectPropsWithoutHTML>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
bind:this={ref}
|
|
11
|
+
data-slot="card-action"
|
|
12
|
+
class={join('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
|
|
13
|
+
{...restProps}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { join } from 'overrule';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div bind:this={ref} data-slot="card-content" class={join('px-6', className)} {...restProps}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { join } from 'overrule';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLParagraphElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<p bind:this={ref} data-slot="card-description" class={join('text-muted-foreground text-sm', className)} {...restProps}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</p>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div bind:this={ref} data-slot="card-footer" class={join('flex items-center px-6 [.border-t]:pt-6', className)} {...restProps}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
bind:this={ref}
|
|
11
|
+
data-slot="card-header"
|
|
12
|
+
class={join(
|
|
13
|
+
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...restProps}>
|
|
17
|
+
{@render children?.()}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { join } from 'overrule';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div bind:this={ref} data-slot="card-title" class={join('leading-none font-semibold', className)} {...restProps}>
|
|
10
|
+
{@render children?.()}
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { join } from 'overrule';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<div
|
|
10
|
+
bind:this={ref}
|
|
11
|
+
data-slot="card"
|
|
12
|
+
class={join('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}
|
|
13
|
+
{...restProps}>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Root from './card.svelte';
|
|
2
|
+
import Action from './card-action.svelte';
|
|
3
|
+
import Content from './card-content.svelte';
|
|
4
|
+
import Description from './card-description.svelte';
|
|
5
|
+
import Footer from './card-footer.svelte';
|
|
6
|
+
import Header from './card-header.svelte';
|
|
7
|
+
import Title from './card-title.svelte';
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
Root,
|
|
11
|
+
Content,
|
|
12
|
+
Description,
|
|
13
|
+
Footer,
|
|
14
|
+
Header,
|
|
15
|
+
Title,
|
|
16
|
+
Action,
|
|
17
|
+
//
|
|
18
|
+
Root as Card,
|
|
19
|
+
Content as CardContent,
|
|
20
|
+
Description as CardDescription,
|
|
21
|
+
Footer as CardFooter,
|
|
22
|
+
Header as CardHeader,
|
|
23
|
+
Title as CardTitle,
|
|
24
|
+
Action as CardAction,
|
|
25
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import ArrowLeftIcon from '@lucide/svelte/icons/arrow-left';
|
|
4
|
+
import ArrowRightIcon from '@lucide/svelte/icons/arrow-right';
|
|
5
|
+
import type { WithoutChildren } from '../../internal/index.js';
|
|
6
|
+
import { getCarouselContext } from './carouselState.svelte';
|
|
7
|
+
import { Button, type Props } from '../button';
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
direction,
|
|
11
|
+
ref = $bindable(null),
|
|
12
|
+
class: className,
|
|
13
|
+
variant = 'outline',
|
|
14
|
+
size = 'icon',
|
|
15
|
+
...restProps
|
|
16
|
+
}: WithoutChildren<Props> & { direction: 'next' | 'previous' } = $props();
|
|
17
|
+
|
|
18
|
+
const ctx = getCarouselContext();
|
|
19
|
+
|
|
20
|
+
const isNext = $derived(direction === 'next');
|
|
21
|
+
const Icon = $derived(isNext ? ArrowRightIcon : ArrowLeftIcon);
|
|
22
|
+
const canScroll = $derived(isNext ? ctx.canScrollNext : ctx.canScrollPrev);
|
|
23
|
+
// Full literal class strings per (direction, orientation) so Tailwind's scanner sees them intact.
|
|
24
|
+
const horizontal = $derived(isNext ? '-inset-e-12 top-1/2 -translate-y-1/2' : '-inset-s-12 top-1/2 -translate-y-1/2');
|
|
25
|
+
const vertical = $derived(
|
|
26
|
+
isNext ? 'inset-s-1/2 -bottom-12 -translate-x-1/2 rotate-90' : 'inset-s-1/2 -top-12 -translate-x-1/2 rotate-90',
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Button
|
|
31
|
+
data-slot={isNext ? 'carousel-next' : 'carousel-previous'}
|
|
32
|
+
{variant}
|
|
33
|
+
{size}
|
|
34
|
+
disabled={!canScroll}
|
|
35
|
+
aria-disabled={!canScroll}
|
|
36
|
+
class={join('absolute size-8! rounded-full!', ctx.orientation === 'horizontal' ? horizontal : vertical, className)}
|
|
37
|
+
onclick={isNext ? ctx.scrollNext : ctx.scrollPrev}
|
|
38
|
+
{...restProps}
|
|
39
|
+
bind:ref>
|
|
40
|
+
<Icon class="size-4" />
|
|
41
|
+
<span class="sr-only">{isNext ? 'Next' : 'Previous'} slide</span>
|
|
42
|
+
</Button>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
import { getCarouselWiring } from './carouselState.svelte';
|
|
6
|
+
|
|
7
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
8
|
+
|
|
9
|
+
const ctx = getCarouselWiring();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
bind:this={ref}
|
|
14
|
+
data-slot="carousel-content"
|
|
15
|
+
data-orientation={ctx.orientation}
|
|
16
|
+
class={join(
|
|
17
|
+
// [overflow-anchor:none]: scroll anchoring fights the loop mode's `order` rotation
|
|
18
|
+
'flex snap-mandatory scrollbar-hidden [overflow-anchor:none]',
|
|
19
|
+
ctx.orientation === 'horizontal' ? 'snap-x gap-4 overflow-x-auto overscroll-x-contain' : 'snap-y flex-col gap-4 overflow-y-auto overscroll-y-contain',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{@attach ctx.scroller}
|
|
23
|
+
{...restProps}>
|
|
24
|
+
{@render children?.()}
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
import { getCarouselContext } from './carouselState.svelte';
|
|
6
|
+
|
|
7
|
+
let { ref = $bindable(null), class: className, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
8
|
+
|
|
9
|
+
const ctx = getCarouselContext();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div bind:this={ref} data-slot="carousel-dots" class={join('flex justify-center gap-2', className)} {...restProps}>
|
|
13
|
+
{#each ctx.scrollSnaps as _, i (i)}
|
|
14
|
+
<button
|
|
15
|
+
type="button"
|
|
16
|
+
aria-label={`Go to slide ${i + 1}`}
|
|
17
|
+
aria-current={i === ctx.selectedIndex ? 'true' : undefined}
|
|
18
|
+
class="bg-muted-foreground/30 aria-[current]:bg-primary size-2 rounded-full transition-colors"
|
|
19
|
+
onclick={() => ctx.scrollTo(i)}></button>
|
|
20
|
+
{/each}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { join } from 'overrule';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { WithElementRef } from '../../internal/utils.js';
|
|
5
|
+
import { getCarouselWiring } from './carouselState.svelte';
|
|
6
|
+
|
|
7
|
+
let { ref = $bindable(null), class: className, children, ...restProps }: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
8
|
+
|
|
9
|
+
const ctx = getCarouselWiring();
|
|
10
|
+
const snapAlign = $derived(ctx.align === 'center' ? 'snap-center' : ctx.align === 'end' ? 'snap-end' : 'snap-start');
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="carousel-item"
|
|
16
|
+
role="group"
|
|
17
|
+
aria-roledescription="slide"
|
|
18
|
+
class={join('min-w-0 shrink-0 grow-0 basis-full', snapAlign, className)}
|
|
19
|
+
{...restProps}>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithoutChildren } from '../../internal/index.js';
|
|
3
|
+
import type { Props } from '../button';
|
|
4
|
+
import CarouselArrow from './carousel-arrow.svelte';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), ...restProps }: WithoutChildren<Props> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<CarouselArrow direction="next" bind:ref {...restProps} />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { WithoutChildren } from '../../internal/index.js';
|
|
3
|
+
import type { Props } from '../button';
|
|
4
|
+
import CarouselArrow from './carousel-arrow.svelte';
|
|
5
|
+
|
|
6
|
+
let { ref = $bindable(null), ...restProps }: WithoutChildren<Props> = $props();
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<CarouselArrow direction="previous" bind:ref {...restProps} />
|