bits-ui 2.7.0 → 2.8.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/README.md +4 -4
- package/dist/bits/accordion/accordion.svelte.d.ts +66 -58
- package/dist/bits/accordion/accordion.svelte.js +56 -51
- package/dist/bits/accordion/components/accordion-content.svelte +4 -4
- package/dist/bits/accordion/components/accordion-header.svelte +2 -2
- package/dist/bits/accordion/components/accordion-item.svelte +2 -2
- package/dist/bits/accordion/components/accordion-trigger.svelte +2 -2
- package/dist/bits/accordion/components/accordion.svelte +2 -2
- package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +2 -2
- package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +2 -2
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +9 -12
- package/dist/bits/alert-dialog/components/alert-dialog.svelte +9 -3
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.d.ts +10 -16
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.js +4 -11
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +2 -2
- package/dist/bits/avatar/avatar.svelte.d.ts +25 -33
- package/dist/bits/avatar/avatar.svelte.js +20 -21
- package/dist/bits/avatar/components/avatar-fallback.svelte +2 -2
- package/dist/bits/avatar/components/avatar-image.svelte +2 -2
- package/dist/bits/avatar/components/avatar.svelte +2 -2
- package/dist/bits/calendar/calendar.svelte.d.ts +117 -106
- package/dist/bits/calendar/calendar.svelte.js +51 -52
- package/dist/bits/calendar/components/calendar-cell.svelte +2 -2
- package/dist/bits/calendar/components/calendar-day.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-body.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-head.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid-row.svelte +2 -2
- package/dist/bits/calendar/components/calendar-grid.svelte +2 -2
- package/dist/bits/calendar/components/calendar-head-cell.svelte +2 -2
- package/dist/bits/calendar/components/calendar-header.svelte +2 -2
- package/dist/bits/calendar/components/calendar-heading.svelte +5 -5
- package/dist/bits/calendar/components/calendar-month-select.svelte +2 -2
- package/dist/bits/calendar/components/calendar-next-button.svelte +5 -3
- package/dist/bits/calendar/components/calendar-prev-button.svelte +5 -3
- package/dist/bits/calendar/components/calendar-year-select.svelte +2 -2
- package/dist/bits/calendar/components/calendar.svelte +2 -2
- package/dist/bits/checkbox/checkbox.svelte.d.ts +37 -34
- package/dist/bits/checkbox/checkbox.svelte.js +19 -22
- package/dist/bits/checkbox/components/checkbox-group-label.svelte +2 -2
- package/dist/bits/checkbox/components/checkbox-group.svelte +2 -2
- package/dist/bits/checkbox/components/checkbox-input.svelte +2 -2
- package/dist/bits/checkbox/components/checkbox.svelte +2 -2
- package/dist/bits/collapsible/collapsible.svelte.d.ts +30 -27
- package/dist/bits/collapsible/collapsible.svelte.js +23 -15
- package/dist/bits/collapsible/components/collapsible-content.svelte +5 -5
- package/dist/bits/collapsible/components/collapsible-content.svelte.d.ts +1 -4
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +2 -2
- package/dist/bits/collapsible/components/collapsible.svelte +4 -2
- package/dist/bits/collapsible/types.d.ts +4 -0
- package/dist/bits/combobox/components/combobox-input.svelte +2 -2
- package/dist/bits/combobox/components/combobox-trigger.svelte +2 -2
- package/dist/bits/combobox/components/combobox.svelte +4 -2
- package/dist/bits/command/command.svelte.d.ts +103 -92
- package/dist/bits/command/command.svelte.js +55 -57
- package/dist/bits/command/components/_command-label.svelte +2 -2
- package/dist/bits/command/components/command-empty.svelte +2 -2
- package/dist/bits/command/components/command-group-heading.svelte +2 -2
- package/dist/bits/command/components/command-group-items.svelte +2 -2
- package/dist/bits/command/components/command-group.svelte +2 -2
- package/dist/bits/command/components/command-input.svelte +2 -2
- package/dist/bits/command/components/command-item.svelte +2 -2
- package/dist/bits/command/components/command-link-item.svelte +2 -2
- package/dist/bits/command/components/command-list.svelte +2 -2
- package/dist/bits/command/components/command-loading.svelte +2 -2
- package/dist/bits/command/components/command-separator.svelte +2 -2
- package/dist/bits/command/components/command-viewport.svelte +2 -2
- package/dist/bits/command/components/command.svelte +2 -2
- package/dist/bits/context-menu/components/context-menu-content-static.svelte +3 -3
- package/dist/bits/context-menu/components/context-menu-content.svelte +4 -4
- package/dist/bits/context-menu/components/context-menu-trigger.svelte +2 -2
- package/dist/bits/context-menu/components/context-menu.svelte +16 -11
- package/dist/bits/date-field/components/date-field-hidden-input.svelte +2 -2
- package/dist/bits/date-field/components/date-field-input.svelte +2 -2
- package/dist/bits/date-field/components/date-field-label.svelte +2 -2
- package/dist/bits/date-field/components/date-field-segment.svelte +2 -2
- package/dist/bits/date-field/components/date-field.svelte +2 -2
- package/dist/bits/date-field/date-field.svelte.d.ts +85 -74
- package/dist/bits/date-field/date-field.svelte.js +55 -53
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +2 -2
- package/dist/bits/date-picker/components/date-picker.svelte +8 -6
- package/dist/bits/date-picker/date-picker.svelte.d.ts +10 -10
- package/dist/bits/date-picker/date-picker.svelte.js +6 -5
- package/dist/bits/date-picker/types.d.ts +4 -0
- package/dist/bits/date-range-field/components/date-range-field-input.svelte +2 -2
- package/dist/bits/date-range-field/components/date-range-field-label.svelte +2 -2
- package/dist/bits/date-range-field/components/date-range-field.svelte +2 -2
- package/dist/bits/date-range-field/date-range-field.svelte.d.ts +32 -29
- package/dist/bits/date-range-field/date-range-field.svelte.js +33 -32
- package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +2 -2
- package/dist/bits/date-range-picker/components/date-range-picker.svelte +8 -6
- package/dist/bits/date-range-picker/date-range-picker.svelte.d.ts +10 -10
- package/dist/bits/date-range-picker/date-range-picker.svelte.js +6 -5
- package/dist/bits/date-range-picker/types.d.ts +4 -0
- package/dist/bits/dialog/components/dialog-close.svelte +2 -2
- package/dist/bits/dialog/components/dialog-content.svelte +8 -10
- package/dist/bits/dialog/components/dialog-description.svelte +2 -2
- package/dist/bits/dialog/components/dialog-overlay.svelte +3 -6
- package/dist/bits/dialog/components/dialog-title.svelte +2 -2
- package/dist/bits/dialog/components/dialog-trigger.svelte +2 -2
- package/dist/bits/dialog/components/dialog.svelte +9 -3
- package/dist/bits/dialog/dialog.svelte.d.ts +75 -65
- package/dist/bits/dialog/dialog.svelte.js +47 -38
- package/dist/bits/dialog/types.d.ts +4 -0
- package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +3 -3
- package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +6 -5
- package/dist/bits/label/components/label.svelte +2 -2
- package/dist/bits/label/label.svelte.d.ts +8 -7
- package/dist/bits/label/label.svelte.js +4 -4
- package/dist/bits/link-preview/components/link-preview-content-static.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview-content.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview-trigger.svelte +2 -2
- package/dist/bits/link-preview/components/link-preview.svelte +4 -2
- package/dist/bits/link-preview/link-preview.svelte.d.ts +28 -25
- package/dist/bits/link-preview/link-preview.svelte.js +24 -16
- package/dist/bits/link-preview/types.d.ts +4 -0
- package/dist/bits/menu/components/menu-arrow.svelte +2 -2
- package/dist/bits/menu/components/menu-checkbox-group.svelte +2 -2
- package/dist/bits/menu/components/menu-checkbox-item.svelte +2 -2
- package/dist/bits/menu/components/menu-content-static.svelte +3 -3
- package/dist/bits/menu/components/menu-content.svelte +3 -3
- package/dist/bits/menu/components/menu-group-heading.svelte +2 -2
- package/dist/bits/menu/components/menu-group.svelte +2 -2
- package/dist/bits/menu/components/menu-item.svelte +2 -2
- package/dist/bits/menu/components/menu-radio-group.svelte +2 -2
- package/dist/bits/menu/components/menu-radio-item.svelte +2 -2
- package/dist/bits/menu/components/menu-separator.svelte +2 -2
- package/dist/bits/menu/components/menu-sub-content-static.svelte +3 -3
- package/dist/bits/menu/components/menu-sub-content.svelte +3 -3
- package/dist/bits/menu/components/menu-sub-trigger.svelte +2 -2
- package/dist/bits/menu/components/menu-sub.svelte +9 -3
- package/dist/bits/menu/components/menu-trigger.svelte +2 -2
- package/dist/bits/menu/components/menu.svelte +16 -11
- package/dist/bits/menu/menu.svelte.d.ts +136 -119
- package/dist/bits/menu/menu.svelte.js +105 -105
- package/dist/bits/menu/types.d.ts +8 -0
- package/dist/bits/menubar/components/menubar-content-static.svelte +2 -2
- package/dist/bits/menubar/components/menubar-content.svelte +2 -2
- package/dist/bits/menubar/components/menubar-menu.svelte +2 -2
- package/dist/bits/menubar/components/menubar-trigger.svelte +4 -4
- package/dist/bits/menubar/components/menubar.svelte +2 -2
- package/dist/bits/menubar/menubar.svelte.d.ts +37 -36
- package/dist/bits/menubar/menubar.svelte.js +21 -24
- package/dist/bits/meter/components/meter.svelte +2 -2
- package/dist/bits/meter/meter.svelte.d.ts +10 -9
- package/dist/bits/meter/meter.svelte.js +4 -4
- package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +4 -3
- package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -3
- package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu.svelte +2 -2
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +116 -109
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +78 -81
- package/dist/bits/pagination/components/pagination-next-button.svelte +2 -2
- package/dist/bits/pagination/components/pagination-page.svelte +2 -2
- package/dist/bits/pagination/components/pagination-prev-button.svelte +2 -2
- package/dist/bits/pagination/components/pagination.svelte +2 -2
- package/dist/bits/pagination/pagination.svelte.d.ts +34 -32
- package/dist/bits/pagination/pagination.svelte.js +15 -15
- package/dist/bits/pin-input/components/pin-input-cell.svelte +2 -2
- package/dist/bits/pin-input/components/pin-input.svelte +2 -2
- package/dist/bits/pin-input/pin-input.svelte.d.ts +22 -21
- package/dist/bits/pin-input/pin-input.svelte.js +9 -9
- package/dist/bits/popover/components/popover-close.svelte +2 -2
- package/dist/bits/popover/components/popover-content-static.svelte +3 -3
- package/dist/bits/popover/components/popover-content.svelte +3 -3
- package/dist/bits/popover/components/popover-trigger.svelte +2 -2
- package/dist/bits/popover/components/popover.svelte +9 -3
- package/dist/bits/popover/popover.svelte.d.ts +36 -31
- package/dist/bits/popover/popover.svelte.js +26 -21
- package/dist/bits/popover/types.d.ts +4 -0
- package/dist/bits/progress/components/progress.svelte +2 -2
- package/dist/bits/progress/progress.svelte.d.ts +10 -9
- package/dist/bits/progress/progress.svelte.js +4 -4
- package/dist/bits/radio-group/components/radio-group-input.svelte +2 -2
- package/dist/bits/radio-group/components/radio-group-item.svelte +2 -2
- package/dist/bits/radio-group/components/radio-group.svelte +2 -2
- package/dist/bits/radio-group/radio-group.svelte.d.ts +21 -19
- package/dist/bits/radio-group/radio-group.svelte.js +15 -15
- package/dist/bits/range-calendar/components/range-calendar-cell.svelte +2 -2
- package/dist/bits/range-calendar/components/range-calendar-day.svelte +2 -2
- package/dist/bits/range-calendar/components/range-calendar.svelte +2 -2
- package/dist/bits/range-calendar/range-calendar.svelte.d.ts +21 -20
- package/dist/bits/range-calendar/range-calendar.svelte.js +12 -12
- package/dist/bits/rating-group/components/rating-group-input.svelte +2 -2
- package/dist/bits/rating-group/components/rating-group-item.svelte +2 -2
- package/dist/bits/rating-group/components/rating-group.svelte +2 -2
- package/dist/bits/rating-group/rating-group.svelte.d.ts +19 -18
- package/dist/bits/rating-group/rating-group.svelte.js +16 -17
- package/dist/bits/scroll-area/components/scroll-area-corner-impl.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-auto.svelte +3 -3
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-hover.svelte +6 -6
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-scroll.svelte +3 -3
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-shared.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-visible.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-x.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-y.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-thumb-impl.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area-thumb.svelte +2 -5
- package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +2 -2
- package/dist/bits/scroll-area/components/scroll-area.svelte +2 -2
- package/dist/bits/scroll-area/scroll-area.svelte.d.ts +98 -78
- package/dist/bits/scroll-area/scroll-area.svelte.js +78 -74
- package/dist/bits/select/components/select-content-static.svelte +3 -3
- package/dist/bits/select/components/select-content.svelte +3 -3
- package/dist/bits/select/components/select-group-heading.svelte +2 -2
- package/dist/bits/select/components/select-group.svelte +2 -2
- package/dist/bits/select/components/select-hidden-input.svelte +2 -2
- package/dist/bits/select/components/select-item.svelte +2 -2
- package/dist/bits/select/components/select-scroll-down-button.svelte +2 -2
- package/dist/bits/select/components/select-scroll-up-button.svelte +2 -2
- package/dist/bits/select/components/select-trigger.svelte +2 -2
- package/dist/bits/select/components/select-viewport.svelte +2 -2
- package/dist/bits/select/components/select.svelte +4 -2
- package/dist/bits/select/select.svelte.d.ts +127 -113
- package/dist/bits/select/select.svelte.js +72 -62
- package/dist/bits/select/types.d.ts +4 -0
- package/dist/bits/separator/components/separator.svelte +2 -2
- package/dist/bits/separator/separator.svelte.d.ts +9 -8
- package/dist/bits/separator/separator.svelte.js +4 -4
- package/dist/bits/slider/components/slider-range.svelte +2 -2
- package/dist/bits/slider/components/slider-thumb-label.svelte +2 -2
- package/dist/bits/slider/components/slider-thumb.svelte +2 -2
- package/dist/bits/slider/components/slider-tick-label.svelte +2 -2
- package/dist/bits/slider/components/slider-tick.svelte +2 -2
- package/dist/bits/slider/components/slider.svelte +2 -2
- package/dist/bits/slider/slider.svelte.d.ts +82 -73
- package/dist/bits/slider/slider.svelte.js +30 -28
- package/dist/bits/switch/components/switch-input.svelte +2 -2
- package/dist/bits/switch/components/switch-thumb.svelte +2 -2
- package/dist/bits/switch/components/switch.svelte +2 -2
- package/dist/bits/switch/switch.svelte.d.ts +19 -17
- package/dist/bits/switch/switch.svelte.js +13 -13
- package/dist/bits/tabs/components/tabs-content.svelte +2 -2
- package/dist/bits/tabs/components/tabs-list.svelte +2 -2
- package/dist/bits/tabs/components/tabs-trigger.svelte +2 -2
- package/dist/bits/tabs/components/tabs.svelte +2 -2
- package/dist/bits/tabs/tabs.svelte.d.ts +33 -29
- package/dist/bits/tabs/tabs.svelte.js +19 -19
- package/dist/bits/time-field/components/time-field-hidden-input.svelte +2 -2
- package/dist/bits/time-field/components/time-field-input.svelte +2 -2
- package/dist/bits/time-field/components/time-field-label.svelte +2 -2
- package/dist/bits/time-field/components/time-field-segment.svelte +2 -2
- package/dist/bits/time-field/components/time-field.svelte +2 -2
- package/dist/bits/time-field/time-field.svelte.d.ts +72 -66
- package/dist/bits/time-field/time-field.svelte.js +37 -42
- package/dist/bits/time-range-field/components/time-range-field-input.svelte +2 -2
- package/dist/bits/time-range-field/components/time-range-field-label.svelte +2 -2
- package/dist/bits/time-range-field/components/time-range-field.svelte +2 -2
- package/dist/bits/time-range-field/time-range-field.svelte.d.ts +35 -31
- package/dist/bits/time-range-field/time-range-field.svelte.js +34 -32
- package/dist/bits/toggle/components/toggle.svelte +2 -2
- package/dist/bits/toggle/toggle.svelte.d.ts +11 -10
- package/dist/bits/toggle/toggle.svelte.js +4 -4
- package/dist/bits/toggle-group/components/toggle-group-item.svelte +2 -2
- package/dist/bits/toggle-group/components/toggle-group.svelte +2 -2
- package/dist/bits/toggle-group/toggle-group.svelte.d.ts +48 -43
- package/dist/bits/toggle-group/toggle-group.svelte.js +24 -25
- package/dist/bits/toolbar/components/toolbar-button.svelte +2 -2
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +2 -2
- package/dist/bits/toolbar/components/toolbar-group.svelte +2 -2
- package/dist/bits/toolbar/components/toolbar-link.svelte +2 -2
- package/dist/bits/toolbar/components/toolbar.svelte +2 -2
- package/dist/bits/toolbar/toolbar.svelte.d.ts +59 -51
- package/dist/bits/toolbar/toolbar.svelte.js +32 -30
- package/dist/bits/tooltip/components/tooltip-content-static.svelte +3 -3
- package/dist/bits/tooltip/components/tooltip-content.svelte +3 -3
- package/dist/bits/tooltip/components/tooltip-provider.svelte +2 -2
- package/dist/bits/tooltip/components/tooltip-trigger.svelte +2 -2
- package/dist/bits/tooltip/components/tooltip.svelte +4 -2
- package/dist/bits/tooltip/tooltip.svelte.d.ts +33 -29
- package/dist/bits/tooltip/tooltip.svelte.js +33 -28
- package/dist/bits/tooltip/types.d.ts +4 -0
- package/dist/bits/utilities/config/bits-config.d.ts +1 -1
- package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +2 -2
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +6 -7
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +3 -3
- package/dist/bits/utilities/escape-layer/escape-layer.svelte +2 -2
- package/dist/bits/utilities/escape-layer/use-escape-layer.svelte.d.ts +6 -7
- package/dist/bits/utilities/escape-layer/use-escape-layer.svelte.js +3 -3
- package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +2 -2
- package/dist/bits/utilities/floating-layer/components/floating-layer-arrow.svelte +2 -2
- package/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte +2 -2
- package/dist/bits/utilities/floating-layer/components/floating-layer.svelte +2 -2
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +25 -23
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +25 -25
- package/dist/bits/utilities/focus-scope/focus-scope-manager.d.ts +12 -0
- package/dist/bits/utilities/focus-scope/focus-scope-manager.js +40 -0
- package/dist/bits/utilities/focus-scope/focus-scope.svelte +6 -8
- package/dist/bits/utilities/focus-scope/focus-scope.svelte.d.ts +1 -0
- package/dist/bits/utilities/focus-scope/focus-scope.svelte.js +204 -0
- package/dist/bits/utilities/focus-scope/types.d.ts +2 -6
- package/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte +1 -1
- package/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte.d.ts +1 -1
- package/dist/bits/utilities/popper-layer/popper-layer-inner.svelte +3 -3
- package/dist/bits/utilities/popper-layer/popper-layer-inner.svelte.d.ts +1 -1
- package/dist/bits/utilities/popper-layer/popper-layer.svelte +3 -3
- package/dist/bits/utilities/presence-layer/presence-layer.svelte +8 -8
- package/dist/bits/utilities/presence-layer/presence.svelte.d.ts +42 -0
- package/dist/bits/utilities/presence-layer/presence.svelte.js +116 -0
- package/dist/bits/utilities/presence-layer/types.d.ts +3 -5
- package/dist/bits/utilities/scroll-lock/scroll-lock.svelte +2 -2
- package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +2 -2
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.d.ts +7 -7
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js +3 -3
- package/dist/internal/animations-complete.d.ts +12 -0
- package/dist/internal/animations-complete.js +55 -0
- package/dist/internal/arrays.js +20 -36
- package/dist/internal/attrs.d.ts +9 -2
- package/dist/internal/attrs.js +21 -11
- package/dist/internal/body-scroll-lock.svelte.d.ts +10 -0
- package/dist/internal/body-scroll-lock.svelte.js +106 -0
- package/dist/internal/data-typeahead.svelte.d.ts +15 -0
- package/dist/internal/data-typeahead.svelte.js +33 -0
- package/dist/internal/date-time/calendar-helpers.svelte.d.ts +1 -1
- package/dist/internal/dom-typeahead.svelte.d.ts +14 -0
- package/dist/internal/dom-typeahead.svelte.js +44 -0
- package/dist/internal/dom.d.ts +0 -2
- package/dist/internal/dom.js +0 -15
- package/dist/internal/focus.js +1 -1
- package/dist/internal/{use-grace-area.svelte.d.ts → grace-area.svelte.d.ts} +5 -4
- package/dist/internal/{use-grace-area.svelte.js → grace-area.svelte.js} +60 -56
- package/dist/internal/open-change-complete.d.ts +13 -0
- package/dist/internal/open-change-complete.js +24 -0
- package/dist/internal/{use-roving-focus.svelte.d.ts → roving-focus-group.d.ts} +9 -8
- package/dist/internal/{use-roving-focus.svelte.js → roving-focus-group.js} +30 -34
- package/dist/internal/shared-state.svelte.d.ts +6 -0
- package/dist/internal/shared-state.svelte.js +31 -0
- package/dist/internal/should-enable-focus-trap.d.ts +5 -0
- package/dist/internal/should-enable-focus-trap.js +5 -0
- package/dist/internal/state-machine.d.ts +16 -0
- package/dist/internal/state-machine.js +18 -0
- package/dist/internal/svelte-resize-observer.svelte.d.ts +6 -0
- package/dist/internal/svelte-resize-observer.svelte.js +25 -0
- package/dist/internal/tabbable.d.ts +0 -1
- package/dist/internal/tabbable.js +0 -11
- package/dist/internal/timeout-fn.d.ts +16 -0
- package/dist/internal/timeout-fn.js +38 -0
- package/dist/internal/types.d.ts +2 -2
- package/package.json +2 -2
- package/dist/bits/utilities/focus-scope/focus-scope-stack.svelte.d.ts +0 -14
- package/dist/bits/utilities/focus-scope/focus-scope-stack.svelte.js +0 -50
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.d.ts +0 -49
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.js +0 -218
- package/dist/bits/utilities/presence-layer/use-presence.svelte.d.ts +0 -4
- package/dist/bits/utilities/presence-layer/use-presence.svelte.js +0 -97
- package/dist/internal/box.svelte.d.ts +0 -21
- package/dist/internal/box.svelte.js +0 -26
- package/dist/internal/create-event-hook.svelte.d.ts +0 -18
- package/dist/internal/create-event-hook.svelte.js +0 -29
- package/dist/internal/create-shared-hook.svelte.d.ts +0 -2
- package/dist/internal/create-shared-hook.svelte.js +0 -27
- package/dist/internal/should-trap-focus.d.ts +0 -6
- package/dist/internal/should-trap-focus.js +0 -6
- package/dist/internal/sleep.d.ts +0 -1
- package/dist/internal/sleep.js +0 -3
- package/dist/internal/use-after-animations.svelte.d.ts +0 -5
- package/dist/internal/use-after-animations.svelte.js +0 -27
- package/dist/internal/use-body-scroll-lock.svelte.d.ts +0 -6
- package/dist/internal/use-body-scroll-lock.svelte.js +0 -106
- package/dist/internal/use-data-typeahead.svelte.d.ts +0 -15
- package/dist/internal/use-data-typeahead.svelte.js +0 -34
- package/dist/internal/use-dom-typeahead.svelte.d.ts +0 -13
- package/dist/internal/use-dom-typeahead.svelte.js +0 -32
- package/dist/internal/use-form-control.svelte.d.ts +0 -4
- package/dist/internal/use-form-control.svelte.js +0 -16
- package/dist/internal/use-resize-observer.svelte.d.ts +0 -2
- package/dist/internal/use-resize-observer.svelte.js +0 -17
- package/dist/internal/use-state-machine.svelte.d.ts +0 -24
- package/dist/internal/use-state-machine.svelte.js +0 -28
- package/dist/internal/use-timeout-fn.svelte.d.ts +0 -25
- package/dist/internal/use-timeout-fn.svelte.js +0 -39
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { BitsFocusEvent, BitsKeyboardEvent, BitsMouseEvent,
|
|
1
|
+
import { type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
2
|
+
import type { BitsFocusEvent, BitsKeyboardEvent, BitsMouseEvent, WithRefOpts } from "../../internal/types.js";
|
|
3
3
|
import type { Orientation } from "../../shared/index.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { RovingFocusGroup } from "../../internal/roving-focus-group.js";
|
|
5
|
+
interface RadioGroupRootStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
required: boolean;
|
|
8
8
|
loop: boolean;
|
|
9
9
|
orientation: Orientation;
|
|
10
10
|
name: string | undefined;
|
|
11
11
|
readonly: boolean;
|
|
12
|
-
}
|
|
12
|
+
}>, WritableBoxedValues<{
|
|
13
13
|
value: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
}> {
|
|
15
|
+
}
|
|
16
|
+
export declare class RadioGroupRootState {
|
|
17
|
+
static create(opts: RadioGroupRootStateOpts): RadioGroupRootState;
|
|
18
|
+
readonly opts: RadioGroupRootStateOpts;
|
|
17
19
|
readonly hasValue: boolean;
|
|
18
|
-
rovingFocusGroup:
|
|
19
|
-
constructor(opts:
|
|
20
|
+
readonly rovingFocusGroup: RovingFocusGroup;
|
|
21
|
+
constructor(opts: RadioGroupRootStateOpts);
|
|
20
22
|
isChecked(value: string): boolean;
|
|
21
23
|
setValue(value: string): void;
|
|
22
24
|
readonly props: {
|
|
@@ -30,16 +32,18 @@ declare class RadioGroupRootState {
|
|
|
30
32
|
readonly "data-orientation": Orientation;
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
|
|
35
|
+
interface RadioGroupItemStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
34
36
|
disabled: boolean;
|
|
35
37
|
value: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
+
}> {
|
|
39
|
+
}
|
|
40
|
+
export declare class RadioGroupItemState {
|
|
38
41
|
#private;
|
|
39
|
-
|
|
42
|
+
static create(opts: RadioGroupItemStateOpts): RadioGroupItemState;
|
|
43
|
+
readonly opts: RadioGroupItemStateOpts;
|
|
40
44
|
readonly root: RadioGroupRootState;
|
|
41
45
|
readonly checked: boolean;
|
|
42
|
-
constructor(opts:
|
|
46
|
+
constructor(opts: RadioGroupItemStateOpts, root: RadioGroupRootState);
|
|
43
47
|
onclick(_: BitsMouseEvent): void;
|
|
44
48
|
onfocus(_: BitsFocusEvent): void;
|
|
45
49
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
@@ -63,7 +67,8 @@ declare class RadioGroupItemState {
|
|
|
63
67
|
readonly onclick: (_: BitsMouseEvent) => void;
|
|
64
68
|
};
|
|
65
69
|
}
|
|
66
|
-
declare class RadioGroupInputState {
|
|
70
|
+
export declare class RadioGroupInputState {
|
|
71
|
+
static create(): RadioGroupInputState;
|
|
67
72
|
readonly root: RadioGroupRootState;
|
|
68
73
|
readonly shouldRender: boolean;
|
|
69
74
|
readonly props: {
|
|
@@ -74,7 +79,4 @@ declare class RadioGroupInputState {
|
|
|
74
79
|
};
|
|
75
80
|
constructor(root: RadioGroupRootState);
|
|
76
81
|
}
|
|
77
|
-
export declare function useRadioGroupRoot(props: RadioGroupRootStateProps): RadioGroupRootState;
|
|
78
|
-
export declare function useRadioGroupItem(props: RadioGroupItemStateProps): RadioGroupItemState;
|
|
79
|
-
export declare function useRadioGroupInput(): RadioGroupInputState;
|
|
80
82
|
export {};
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { createBitsAttrs, getAriaChecked, getAriaRequired, getDataDisabled, getDataReadonly, getAriaDisabled, } from "../../internal/attrs.js";
|
|
4
|
-
import { useRovingFocus, } from "../../internal/use-roving-focus.svelte.js";
|
|
5
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
|
+
import { RovingFocusGroup } from "../../internal/roving-focus-group.js";
|
|
6
6
|
const radioGroupAttrs = createBitsAttrs({
|
|
7
7
|
component: "radio-group",
|
|
8
8
|
parts: ["root", "item"],
|
|
9
9
|
});
|
|
10
|
-
|
|
10
|
+
const RadioGroupRootContext = new Context("RadioGroup.Root");
|
|
11
|
+
export class RadioGroupRootState {
|
|
12
|
+
static create(opts) {
|
|
13
|
+
return RadioGroupRootContext.set(new RadioGroupRootState(opts));
|
|
14
|
+
}
|
|
11
15
|
opts;
|
|
12
16
|
hasValue = $derived.by(() => this.opts.value.current !== "");
|
|
13
17
|
rovingFocusGroup;
|
|
14
18
|
constructor(opts) {
|
|
15
19
|
this.opts = opts;
|
|
16
|
-
this.rovingFocusGroup =
|
|
20
|
+
this.rovingFocusGroup = new RovingFocusGroup({
|
|
17
21
|
rootNode: this.opts.ref,
|
|
18
22
|
candidateAttr: radioGroupAttrs.item,
|
|
19
23
|
loop: this.opts.loop,
|
|
@@ -39,7 +43,10 @@ class RadioGroupRootState {
|
|
|
39
43
|
...attachRef(this.opts.ref),
|
|
40
44
|
}));
|
|
41
45
|
}
|
|
42
|
-
class RadioGroupItemState {
|
|
46
|
+
export class RadioGroupItemState {
|
|
47
|
+
static create(opts) {
|
|
48
|
+
return new RadioGroupItemState(opts, RadioGroupRootContext.get());
|
|
49
|
+
}
|
|
43
50
|
opts;
|
|
44
51
|
root;
|
|
45
52
|
checked = $derived.by(() => this.root.opts.value.current === this.opts.value.current);
|
|
@@ -113,7 +120,10 @@ class RadioGroupItemState {
|
|
|
113
120
|
...attachRef(this.opts.ref),
|
|
114
121
|
}));
|
|
115
122
|
}
|
|
116
|
-
class RadioGroupInputState {
|
|
123
|
+
export class RadioGroupInputState {
|
|
124
|
+
static create() {
|
|
125
|
+
return new RadioGroupInputState(RadioGroupRootContext.get());
|
|
126
|
+
}
|
|
117
127
|
root;
|
|
118
128
|
shouldRender = $derived.by(() => this.root.opts.name.current !== undefined);
|
|
119
129
|
props = $derived.by(() => ({
|
|
@@ -126,13 +136,3 @@ class RadioGroupInputState {
|
|
|
126
136
|
this.root = root;
|
|
127
137
|
}
|
|
128
138
|
}
|
|
129
|
-
const RadioGroupRootContext = new Context("RadioGroup.Root");
|
|
130
|
-
export function useRadioGroupRoot(props) {
|
|
131
|
-
return RadioGroupRootContext.set(new RadioGroupRootState(props));
|
|
132
|
-
}
|
|
133
|
-
export function useRadioGroupItem(props) {
|
|
134
|
-
return new RadioGroupItemState(props, RadioGroupRootContext.get());
|
|
135
|
-
}
|
|
136
|
-
export function useRadioGroupInput() {
|
|
137
|
-
return new RadioGroupInputState(RadioGroupRootContext.get());
|
|
138
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RangeCalendarCellProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RangeCalendarCellState } from "../range-calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
...restProps
|
|
17
17
|
}: RangeCalendarCellProps = $props();
|
|
18
18
|
|
|
19
|
-
const cellState =
|
|
19
|
+
const cellState = RangeCalendarCellState.create({
|
|
20
20
|
id: box.with(() => id),
|
|
21
21
|
ref: box.with(
|
|
22
22
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RangeCalendarDayProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RangeCalendarDayState } from "../range-calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: RangeCalendarDayProps = $props();
|
|
16
16
|
|
|
17
|
-
const dayState =
|
|
17
|
+
const dayState = RangeCalendarDayState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
4
4
|
import { type DateValue } from "@internationalized/date";
|
|
5
5
|
import type { RangeCalendarRootProps } from "../types.js";
|
|
6
|
-
import {
|
|
6
|
+
import { RangeCalendarRootState } from "../range-calendar.svelte.js";
|
|
7
7
|
import { noop } from "../../../internal/noop.js";
|
|
8
8
|
import { createId } from "../../../internal/create-id.js";
|
|
9
9
|
import { getDefaultDate } from "../../../internal/date-time/utils.js";
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
-
const rootState =
|
|
85
|
+
const rootState = RangeCalendarRootState.create({
|
|
86
86
|
id: box.with(() => id),
|
|
87
87
|
ref: box.with(
|
|
88
88
|
() => ref,
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { type DateValue } from "@internationalized/date";
|
|
2
|
-
import { DOMContext } from "svelte-toolbelt";
|
|
2
|
+
import { DOMContext, type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
3
3
|
import type { DateRange, Month } from "../../shared/index.js";
|
|
4
|
-
import type {
|
|
5
|
-
import type { BitsFocusEvent, BitsKeyboardEvent, BitsMouseEvent, WithRefProps } from "../../internal/types.js";
|
|
4
|
+
import type { BitsFocusEvent, BitsKeyboardEvent, BitsMouseEvent, WithRefOpts } from "../../internal/types.js";
|
|
6
5
|
import { type Announcer } from "../../internal/date-time/announcer.js";
|
|
7
6
|
import { type Formatter } from "../../internal/date-time/formatter.js";
|
|
8
7
|
import { calendarAttrs } from "../../internal/date-time/calendar-helpers.svelte.js";
|
|
9
8
|
import type { WeekStartsOn } from "../../shared/date/types.js";
|
|
10
|
-
|
|
9
|
+
interface RangeCalendarRootStateOpts extends WithRefOpts, WritableBoxedValues<{
|
|
11
10
|
value: DateRange;
|
|
12
11
|
placeholder: DateValue;
|
|
13
12
|
startValue: DateValue | undefined;
|
|
14
13
|
endValue: DateValue | undefined;
|
|
15
|
-
}
|
|
14
|
+
}>, ReadableBoxedValues<{
|
|
16
15
|
preventDeselect: boolean;
|
|
17
16
|
minValue: DateValue | undefined;
|
|
18
17
|
maxValue: DateValue | undefined;
|
|
@@ -38,12 +37,13 @@ type RangeCalendarRootStateProps = WithRefProps<WritableBoxedValues<{
|
|
|
38
37
|
onRangeSelect?: () => void;
|
|
39
38
|
monthFormat: Intl.DateTimeFormatOptions["month"] | ((month: number) => string);
|
|
40
39
|
yearFormat: Intl.DateTimeFormatOptions["year"] | ((year: number) => string);
|
|
41
|
-
}>
|
|
40
|
+
}> {
|
|
42
41
|
defaultPlaceholder: DateValue;
|
|
43
|
-
}
|
|
42
|
+
}
|
|
44
43
|
export declare class RangeCalendarRootState {
|
|
45
44
|
#private;
|
|
46
|
-
|
|
45
|
+
static create(opts: RangeCalendarRootStateOpts): RangeCalendarRootState | import("../calendar/calendar.svelte.js").CalendarRootState;
|
|
46
|
+
readonly opts: RangeCalendarRootStateOpts;
|
|
47
47
|
readonly visibleMonths: DateValue[];
|
|
48
48
|
months: Month<DateValue>[];
|
|
49
49
|
announcer: Announcer;
|
|
@@ -73,7 +73,7 @@ export declare class RangeCalendarRootState {
|
|
|
73
73
|
} | null;
|
|
74
74
|
readonly initialPlaceholderYear: number;
|
|
75
75
|
readonly defaultYears: number[];
|
|
76
|
-
constructor(opts:
|
|
76
|
+
constructor(opts: RangeCalendarRootStateOpts);
|
|
77
77
|
setMonths: (months: Month<DateValue>[]) => void;
|
|
78
78
|
isOutsideVisibleMonths(date: DateValue): boolean;
|
|
79
79
|
isDateDisabled(date: DateValue): boolean;
|
|
@@ -111,12 +111,14 @@ export declare class RangeCalendarRootState {
|
|
|
111
111
|
readonly "data-readonly": "" | undefined;
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
interface RangeCalendarCellStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
115
115
|
date: DateValue;
|
|
116
116
|
month: DateValue;
|
|
117
|
-
}
|
|
117
|
+
}> {
|
|
118
|
+
}
|
|
118
119
|
export declare class RangeCalendarCellState {
|
|
119
|
-
|
|
120
|
+
static create(opts: RangeCalendarCellStateOpts): RangeCalendarCellState;
|
|
121
|
+
readonly opts: RangeCalendarCellStateOpts;
|
|
120
122
|
readonly root: RangeCalendarRootState;
|
|
121
123
|
readonly cellDate: Date;
|
|
122
124
|
readonly isDisabled: boolean;
|
|
@@ -134,7 +136,7 @@ export declare class RangeCalendarCellState {
|
|
|
134
136
|
readonly isSelectionEnd: boolean;
|
|
135
137
|
readonly isHighlighted: boolean;
|
|
136
138
|
readonly labelText: string;
|
|
137
|
-
constructor(opts:
|
|
139
|
+
constructor(opts: RangeCalendarCellStateOpts, root: RangeCalendarRootState);
|
|
138
140
|
readonly snippetProps: {
|
|
139
141
|
disabled: boolean;
|
|
140
142
|
unavailable: boolean;
|
|
@@ -180,12 +182,14 @@ export declare class RangeCalendarCellState {
|
|
|
180
182
|
readonly "aria-disabled": "true" | "false";
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
interface RangeCalendarDayStateOpts extends WithRefOpts {
|
|
186
|
+
}
|
|
187
|
+
export declare class RangeCalendarDayState {
|
|
185
188
|
#private;
|
|
186
|
-
|
|
189
|
+
static create(opts: RangeCalendarDayStateOpts): RangeCalendarDayState;
|
|
190
|
+
readonly opts: RangeCalendarDayStateOpts;
|
|
187
191
|
readonly cell: RangeCalendarCellState;
|
|
188
|
-
constructor(opts:
|
|
192
|
+
constructor(opts: RangeCalendarDayStateOpts, cell: RangeCalendarCellState);
|
|
189
193
|
onclick(e: BitsMouseEvent): void;
|
|
190
194
|
onmouseenter(_: BitsMouseEvent): void;
|
|
191
195
|
onfocusin(_: BitsFocusEvent): void;
|
|
@@ -222,7 +226,4 @@ declare class RangeCalendarDayState {
|
|
|
222
226
|
readonly "aria-disabled": "true" | "false";
|
|
223
227
|
};
|
|
224
228
|
}
|
|
225
|
-
export declare function useRangeCalendarRoot(props: RangeCalendarRootStateProps): RangeCalendarRootState | import("../calendar/calendar.svelte.js").CalendarRootState;
|
|
226
|
-
export declare function useRangeCalendarCell(props: RangeCalendarCellStateProps): RangeCalendarCellState;
|
|
227
|
-
export declare function useRangeCalendarDay(props: RangeCalendarDayStateProps): RangeCalendarDayState;
|
|
228
229
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getLocalTimeZone, isSameDay, isSameMonth, isToday, } from "@internationalized/date";
|
|
2
|
-
import { attachRef, DOMContext } from "svelte-toolbelt";
|
|
2
|
+
import { attachRef, DOMContext, } from "svelte-toolbelt";
|
|
3
3
|
import { Context, watch } from "runed";
|
|
4
4
|
import { CalendarRootContext } from "../calendar/calendar.svelte.js";
|
|
5
5
|
import { useId } from "../../internal/use-id.js";
|
|
@@ -9,7 +9,11 @@ import { createFormatter } from "../../internal/date-time/formatter.js";
|
|
|
9
9
|
import { calendarAttrs, createMonths, getCalendarElementProps, getCalendarHeadingValue, getDefaultYears, getIsNextButtonDisabled, getIsPrevButtonDisabled, getWeekdays, handleCalendarKeydown, handleCalendarNextPage, handleCalendarPrevPage, shiftCalendarFocus, useEnsureNonDisabledPlaceholder, useMonthViewOptionsSync, useMonthViewPlaceholderSync, } from "../../internal/date-time/calendar-helpers.svelte.js";
|
|
10
10
|
import { areAllDaysBetweenValid, getDateValueType, isAfter, isBefore, isBetweenInclusive, toDate, } from "../../internal/date-time/utils.js";
|
|
11
11
|
import { onMount, untrack } from "svelte";
|
|
12
|
+
const RangeCalendarCellContext = new Context("RangeCalendar.Cell");
|
|
12
13
|
export class RangeCalendarRootState {
|
|
14
|
+
static create(opts) {
|
|
15
|
+
return CalendarRootContext.set(new RangeCalendarRootState(opts));
|
|
16
|
+
}
|
|
13
17
|
opts;
|
|
14
18
|
visibleMonths = $derived.by(() => this.months.map((month) => month.value));
|
|
15
19
|
months = $state([]);
|
|
@@ -526,6 +530,9 @@ export class RangeCalendarRootState {
|
|
|
526
530
|
}
|
|
527
531
|
}
|
|
528
532
|
export class RangeCalendarCellState {
|
|
533
|
+
static create(opts) {
|
|
534
|
+
return RangeCalendarCellContext.set(new RangeCalendarCellState(opts, CalendarRootContext.get()));
|
|
535
|
+
}
|
|
529
536
|
opts;
|
|
530
537
|
root;
|
|
531
538
|
cellDate = $derived.by(() => toDate(this.opts.date.current));
|
|
@@ -599,7 +606,10 @@ export class RangeCalendarCellState {
|
|
|
599
606
|
...attachRef(this.opts.ref),
|
|
600
607
|
}));
|
|
601
608
|
}
|
|
602
|
-
class RangeCalendarDayState {
|
|
609
|
+
export class RangeCalendarDayState {
|
|
610
|
+
static create(opts) {
|
|
611
|
+
return new RangeCalendarDayState(opts, RangeCalendarCellContext.get());
|
|
612
|
+
}
|
|
603
613
|
opts;
|
|
604
614
|
cell;
|
|
605
615
|
constructor(opts, cell) {
|
|
@@ -653,13 +663,3 @@ class RangeCalendarDayState {
|
|
|
653
663
|
...attachRef(this.opts.ref),
|
|
654
664
|
}));
|
|
655
665
|
}
|
|
656
|
-
const RangeCalendarCellContext = new Context("RangeCalendar.Cell");
|
|
657
|
-
export function useRangeCalendarRoot(props) {
|
|
658
|
-
return CalendarRootContext.set(new RangeCalendarRootState(props));
|
|
659
|
-
}
|
|
660
|
-
export function useRangeCalendarCell(props) {
|
|
661
|
-
return RangeCalendarCellContext.set(new RangeCalendarCellState(props, CalendarRootContext.get()));
|
|
662
|
-
}
|
|
663
|
-
export function useRangeCalendarDay(props) {
|
|
664
|
-
return new RangeCalendarDayState(props, RangeCalendarCellContext.get());
|
|
665
|
-
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { RatingGroupHiddenInputState } from "../rating-group.svelte.js";
|
|
3
3
|
import HiddenInput from "../../utilities/hidden-input.svelte";
|
|
4
4
|
|
|
5
|
-
const inputState =
|
|
5
|
+
const inputState = RatingGroupHiddenInputState.create();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if inputState.shouldRender}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RatingGroupItemProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RatingGroupItemState } from "../rating-group.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
...restProps
|
|
17
17
|
}: RatingGroupItemProps = $props();
|
|
18
18
|
|
|
19
|
-
const itemState =
|
|
19
|
+
const itemState = RatingGroupItemState.create({
|
|
20
20
|
disabled: box.with(() => Boolean(disabled)),
|
|
21
21
|
index: box.with(() => index),
|
|
22
22
|
id: box.with(() => id),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RatingGroupRootProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { RatingGroupRootState } from "../rating-group.svelte.js";
|
|
5
5
|
import RatingGroupInput from "./rating-group-input.svelte";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
7
7
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
return (value: number, max: number) => `${value} out of ${max}`;
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
const rootState =
|
|
41
|
+
const rootState = RatingGroupRootState.create({
|
|
42
42
|
orientation: box.with(() => orientation),
|
|
43
43
|
disabled: box.with(() => disabled),
|
|
44
44
|
name: box.with(() => name),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { DOMContext } from "svelte-toolbelt";
|
|
2
|
-
import type {
|
|
3
|
-
import type { BitsKeyboardEvent, BitsMouseEvent, BitsPointerEvent, WithRefProps } from "../../internal/types.js";
|
|
1
|
+
import { DOMContext, type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
2
|
+
import type { BitsKeyboardEvent, BitsMouseEvent, BitsPointerEvent, WithRefOpts } from "../../internal/types.js";
|
|
4
3
|
import type { RatingGroupAriaValuetext, RatingGroupItemState as RatingGroupItemStateType } from "./types.js";
|
|
5
4
|
import type { Orientation } from "../../shared/index.js";
|
|
6
|
-
|
|
5
|
+
interface RatingGroupRootStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
7
6
|
disabled: boolean;
|
|
8
7
|
required: boolean;
|
|
9
8
|
orientation: Orientation;
|
|
@@ -14,12 +13,14 @@ type RatingGroupRootStateProps = WithRefProps<ReadableBoxedValues<{
|
|
|
14
13
|
readonly: boolean;
|
|
15
14
|
hoverPreview: boolean;
|
|
16
15
|
ariaValuetext: NonNullable<RatingGroupAriaValuetext>;
|
|
17
|
-
}
|
|
16
|
+
}>, WritableBoxedValues<{
|
|
18
17
|
value: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
18
|
+
}> {
|
|
19
|
+
}
|
|
20
|
+
export declare class RatingGroupRootState {
|
|
21
21
|
#private;
|
|
22
|
-
|
|
22
|
+
static create(opts: RatingGroupRootStateOpts): RatingGroupRootState;
|
|
23
|
+
readonly opts: RatingGroupRootStateOpts;
|
|
23
24
|
domContext: DOMContext;
|
|
24
25
|
readonly hasValue: boolean;
|
|
25
26
|
readonly valueToUse: number;
|
|
@@ -29,7 +30,7 @@ declare class RatingGroupRootState {
|
|
|
29
30
|
index: number;
|
|
30
31
|
state: RatingGroupItemStateType;
|
|
31
32
|
}[];
|
|
32
|
-
constructor(opts:
|
|
33
|
+
constructor(opts: RatingGroupRootStateOpts);
|
|
33
34
|
isActive(itemIndex: number): boolean;
|
|
34
35
|
isPartial(itemIndex: number): boolean;
|
|
35
36
|
setHoverValue(value: number | null): void;
|
|
@@ -69,15 +70,17 @@ declare class RatingGroupRootState {
|
|
|
69
70
|
readonly onpointerleave: () => void;
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
+
interface RatingGroupItemStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
73
74
|
disabled: boolean;
|
|
74
75
|
index: number;
|
|
75
|
-
}
|
|
76
|
-
|
|
76
|
+
}> {
|
|
77
|
+
}
|
|
78
|
+
export declare class RatingGroupItemState {
|
|
77
79
|
#private;
|
|
78
|
-
|
|
80
|
+
static create(opts: RatingGroupItemStateOpts): RatingGroupItemState;
|
|
81
|
+
readonly opts: RatingGroupItemStateOpts;
|
|
79
82
|
readonly root: RatingGroupRootState;
|
|
80
|
-
constructor(opts:
|
|
83
|
+
constructor(opts: RatingGroupItemStateOpts, root: RatingGroupRootState);
|
|
81
84
|
onclick(e: BitsMouseEvent): void;
|
|
82
85
|
onpointermove(e: BitsPointerEvent): void;
|
|
83
86
|
readonly snippetProps: {
|
|
@@ -95,7 +98,8 @@ declare class RatingGroupItemState {
|
|
|
95
98
|
readonly onpointermove: (e: BitsPointerEvent) => void;
|
|
96
99
|
};
|
|
97
100
|
}
|
|
98
|
-
declare class RatingGroupHiddenInputState {
|
|
101
|
+
export declare class RatingGroupHiddenInputState {
|
|
102
|
+
static create(): RatingGroupHiddenInputState;
|
|
99
103
|
readonly root: RatingGroupRootState;
|
|
100
104
|
readonly shouldRender: boolean;
|
|
101
105
|
readonly props: {
|
|
@@ -106,7 +110,4 @@ declare class RatingGroupHiddenInputState {
|
|
|
106
110
|
};
|
|
107
111
|
constructor(root: RatingGroupRootState);
|
|
108
112
|
}
|
|
109
|
-
export declare function useRatingGroupRoot(props: RatingGroupRootStateProps): RatingGroupRootState;
|
|
110
|
-
export declare function useRatingGroupItem(props: RatingGroupItemStateProps): RatingGroupItemState;
|
|
111
|
-
export declare function useRatingGroupHiddenInput(): RatingGroupHiddenInputState;
|
|
112
113
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { attachRef, DOMContext } from "svelte-toolbelt";
|
|
1
|
+
import { attachRef, DOMContext, } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
3
|
import { createBitsAttrs, getAriaRequired, getDataDisabled } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
@@ -6,7 +6,11 @@ const ratingGroupAttrs = createBitsAttrs({
|
|
|
6
6
|
component: "rating-group",
|
|
7
7
|
parts: ["root", "item"],
|
|
8
8
|
});
|
|
9
|
-
|
|
9
|
+
const RatingGroupRootContext = new Context("RatingGroup.Root");
|
|
10
|
+
export class RatingGroupRootState {
|
|
11
|
+
static create(opts) {
|
|
12
|
+
return RatingGroupRootContext.set(new RatingGroupRootState(opts));
|
|
13
|
+
}
|
|
10
14
|
opts;
|
|
11
15
|
#hoverValue = $state(null);
|
|
12
16
|
#keySequence = $state("");
|
|
@@ -27,14 +31,13 @@ class RatingGroupRootState {
|
|
|
27
31
|
: this.opts.ariaValuetext.current;
|
|
28
32
|
});
|
|
29
33
|
items = $derived.by(() => {
|
|
30
|
-
const { max, allowHalf } = this.opts;
|
|
31
34
|
const value = this.valueToUse;
|
|
32
|
-
return Array.from({ length: max.current }, (_, i) => {
|
|
35
|
+
return Array.from({ length: this.opts.max.current }, (_, i) => {
|
|
33
36
|
const itemValue = i + 1;
|
|
34
37
|
const halfValue = itemValue - 0.5;
|
|
35
38
|
const state = value >= itemValue
|
|
36
39
|
? "active"
|
|
37
|
-
: allowHalf.current && value >= halfValue
|
|
40
|
+
: this.opts.allowHalf.current && value >= halfValue
|
|
38
41
|
? "partial"
|
|
39
42
|
: "inactive";
|
|
40
43
|
return { index: i, state };
|
|
@@ -217,7 +220,10 @@ class RatingGroupRootState {
|
|
|
217
220
|
};
|
|
218
221
|
});
|
|
219
222
|
}
|
|
220
|
-
class RatingGroupItemState {
|
|
223
|
+
export class RatingGroupItemState {
|
|
224
|
+
static create(opts) {
|
|
225
|
+
return new RatingGroupItemState(opts, RatingGroupRootContext.get());
|
|
226
|
+
}
|
|
221
227
|
opts;
|
|
222
228
|
root;
|
|
223
229
|
#isDisabled = $derived.by(() => this.opts.disabled.current || this.root.opts.disabled.current);
|
|
@@ -292,7 +298,10 @@ class RatingGroupItemState {
|
|
|
292
298
|
...attachRef(this.opts.ref),
|
|
293
299
|
}));
|
|
294
300
|
}
|
|
295
|
-
class RatingGroupHiddenInputState {
|
|
301
|
+
export class RatingGroupHiddenInputState {
|
|
302
|
+
static create() {
|
|
303
|
+
return new RatingGroupHiddenInputState(RatingGroupRootContext.get());
|
|
304
|
+
}
|
|
296
305
|
root;
|
|
297
306
|
shouldRender = $derived.by(() => this.root.opts.name.current !== undefined);
|
|
298
307
|
props = $derived.by(() => ({
|
|
@@ -305,13 +314,3 @@ class RatingGroupHiddenInputState {
|
|
|
305
314
|
this.root = root;
|
|
306
315
|
}
|
|
307
316
|
}
|
|
308
|
-
const RatingGroupRootContext = new Context("RatingGroup.Root");
|
|
309
|
-
export function useRatingGroupRoot(props) {
|
|
310
|
-
return RatingGroupRootContext.set(new RatingGroupRootState(props));
|
|
311
|
-
}
|
|
312
|
-
export function useRatingGroupItem(props) {
|
|
313
|
-
return new RatingGroupItemState(props, RatingGroupRootContext.get());
|
|
314
|
-
}
|
|
315
|
-
export function useRatingGroupHiddenInput() {
|
|
316
|
-
return new RatingGroupHiddenInputState(RatingGroupRootContext.get());
|
|
317
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ScrollAreaCornerProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ScrollAreaCornerImplState } from "../scroll-area.svelte.js";
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
id: string;
|
|
14
14
|
} = $props();
|
|
15
15
|
|
|
16
|
-
const cornerState =
|
|
16
|
+
const cornerState = ScrollAreaCornerImplState.create({
|
|
17
17
|
id: box.with(() => id),
|
|
18
18
|
ref: box.with(
|
|
19
19
|
() => ref,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { ScrollAreaScrollbarAutoState } from "../scroll-area.svelte.js";
|
|
4
4
|
import type { _ScrollbarStubProps } from "../types.js";
|
|
5
5
|
import ScrollAreaScrollbarVisible from "./scroll-area-scrollbar-visible.svelte";
|
|
6
6
|
import PresenceLayer from "../../utilities/presence-layer/presence-layer.svelte";
|
|
7
7
|
|
|
8
8
|
let { forceMount = false, ...restProps }: _ScrollbarStubProps = $props();
|
|
9
9
|
|
|
10
|
-
const scrollbarAutoState =
|
|
10
|
+
const scrollbarAutoState = ScrollAreaScrollbarAutoState.create();
|
|
11
11
|
const mergedProps = $derived(mergeProps(restProps, scrollbarAutoState.props));
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<PresenceLayer
|
|
15
|
-
|
|
15
|
+
open={forceMount || scrollbarAutoState.isVisible}
|
|
16
16
|
ref={scrollbarAutoState.scrollbar.opts.ref}
|
|
17
17
|
>
|
|
18
18
|
{#snippet presence()}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
ScrollAreaScrollbarAutoState,
|
|
5
|
+
ScrollAreaScrollbarHoverState,
|
|
6
6
|
} from "../scroll-area.svelte.js";
|
|
7
7
|
import type { _ScrollbarStubProps } from "../types.js";
|
|
8
8
|
import ScrollAreaScrollbarVisible from "./scroll-area-scrollbar-visible.svelte";
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
|
|
11
11
|
let { forceMount = false, ...restProps }: _ScrollbarStubProps = $props();
|
|
12
12
|
|
|
13
|
-
const scrollbarHoverState =
|
|
14
|
-
const scrollbarAutoState =
|
|
13
|
+
const scrollbarHoverState = ScrollAreaScrollbarHoverState.create();
|
|
14
|
+
const scrollbarAutoState = ScrollAreaScrollbarAutoState.create();
|
|
15
15
|
const mergedProps = $derived(
|
|
16
16
|
mergeProps(restProps, scrollbarHoverState.props, scrollbarAutoState.props, {
|
|
17
17
|
"data-state": scrollbarHoverState.isVisible ? "visible" : "hidden",
|
|
18
18
|
})
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const open = $derived(
|
|
22
22
|
forceMount || (scrollbarHoverState.isVisible && scrollbarAutoState.isVisible)
|
|
23
23
|
);
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<PresenceLayer {
|
|
26
|
+
<PresenceLayer {open} ref={scrollbarAutoState.scrollbar.opts.ref}>
|
|
27
27
|
{#snippet presence()}
|
|
28
28
|
<ScrollAreaScrollbarVisible {...mergedProps} />
|
|
29
29
|
{/snippet}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { ScrollAreaScrollbarScrollState } from "../scroll-area.svelte.js";
|
|
4
4
|
import type { _ScrollbarStubProps } from "../types.js";
|
|
5
5
|
import ScrollAreaScrollbarVisible from "./scroll-area-scrollbar-visible.svelte";
|
|
6
6
|
import PresenceLayer from "../../utilities/presence-layer/presence-layer.svelte";
|
|
7
7
|
|
|
8
8
|
let { forceMount = false, ...restProps }: _ScrollbarStubProps = $props();
|
|
9
9
|
|
|
10
|
-
const scrollbarScrollState =
|
|
10
|
+
const scrollbarScrollState = ScrollAreaScrollbarScrollState.create();
|
|
11
11
|
|
|
12
12
|
const mergedProps = $derived(mergeProps(restProps, scrollbarScrollState.props));
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<PresenceLayer
|
|
16
16
|
{...mergedProps}
|
|
17
|
-
|
|
17
|
+
open={forceMount || !scrollbarScrollState.isHidden}
|
|
18
18
|
ref={scrollbarScrollState.scrollbar.opts.ref}
|
|
19
19
|
>
|
|
20
20
|
{#snippet presence()}
|