bits-ui 2.6.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +3 -3
- 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 +2 -2
- package/dist/bits/calendar/components/calendar-prev-button.svelte +2 -2
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +106 -96
- 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 -34
- package/dist/bits/menubar/menubar.svelte.js +21 -21
- 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 +2 -2
- 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 +2 -2
- 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 +4 -2
- package/dist/bits/radio-group/radio-group.svelte.d.ts +26 -19
- package/dist/bits/radio-group/radio-group.svelte.js +26 -19
- package/dist/bits/radio-group/types.d.ts +13 -6
- 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 +74 -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/use-focus-scope.svelte.d.ts +1 -1
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.js +1 -1
- 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 +1 -1
- 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/{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-trap-focus.js +1 -2
- 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 +1 -1
- 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/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,4 +1,4 @@
|
|
|
1
|
-
import { afterSleep, afterTick, srOnlyStyles, attachRef } from "svelte-toolbelt";
|
|
1
|
+
import { afterSleep, afterTick, srOnlyStyles, attachRef, } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { findNextSibling, findPreviousSibling } from "./utils.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
@@ -47,7 +47,10 @@ const defaultState = {
|
|
|
47
47
|
groups: new Set(),
|
|
48
48
|
},
|
|
49
49
|
};
|
|
50
|
-
class CommandRootState {
|
|
50
|
+
export class CommandRootState {
|
|
51
|
+
static create(opts) {
|
|
52
|
+
return CommandRootContext.set(new CommandRootState(opts));
|
|
53
|
+
}
|
|
51
54
|
opts;
|
|
52
55
|
#updateScheduled = false;
|
|
53
56
|
#isInitialMount = true;
|
|
@@ -928,14 +931,17 @@ class CommandRootState {
|
|
|
928
931
|
function itemIsDisabled(item) {
|
|
929
932
|
return item.getAttribute("aria-disabled") === "true";
|
|
930
933
|
}
|
|
931
|
-
class CommandEmptyState {
|
|
934
|
+
export class CommandEmptyState {
|
|
935
|
+
static create(opts) {
|
|
936
|
+
return new CommandEmptyState(opts, CommandRootContext.get());
|
|
937
|
+
}
|
|
932
938
|
opts;
|
|
933
939
|
root;
|
|
934
|
-
#isInitialRender = true;
|
|
935
940
|
shouldRender = $derived.by(() => {
|
|
936
941
|
return ((this.root._commandState.filtered.count === 0 && this.#isInitialRender === false) ||
|
|
937
942
|
this.opts.forceMount.current);
|
|
938
943
|
});
|
|
944
|
+
#isInitialRender = true;
|
|
939
945
|
constructor(opts, root) {
|
|
940
946
|
this.opts = opts;
|
|
941
947
|
this.root = root;
|
|
@@ -950,11 +956,12 @@ class CommandEmptyState {
|
|
|
950
956
|
...attachRef(this.opts.ref),
|
|
951
957
|
}));
|
|
952
958
|
}
|
|
953
|
-
class CommandGroupContainerState {
|
|
959
|
+
export class CommandGroupContainerState {
|
|
960
|
+
static create(opts) {
|
|
961
|
+
return CommandGroupContainerContext.set(new CommandGroupContainerState(opts, CommandRootContext.get()));
|
|
962
|
+
}
|
|
954
963
|
opts;
|
|
955
964
|
root;
|
|
956
|
-
headingNode = $state(null);
|
|
957
|
-
trueValue = $state("");
|
|
958
965
|
shouldRender = $derived.by(() => {
|
|
959
966
|
if (this.opts.forceMount.current)
|
|
960
967
|
return true;
|
|
@@ -964,6 +971,8 @@ class CommandGroupContainerState {
|
|
|
964
971
|
return true;
|
|
965
972
|
return this.root._commandState.filtered.groups.has(this.trueValue);
|
|
966
973
|
});
|
|
974
|
+
headingNode = $state(null);
|
|
975
|
+
trueValue = $state("");
|
|
967
976
|
constructor(opts, root) {
|
|
968
977
|
this.opts = opts;
|
|
969
978
|
this.root = root;
|
|
@@ -995,7 +1004,10 @@ class CommandGroupContainerState {
|
|
|
995
1004
|
...attachRef(this.opts.ref),
|
|
996
1005
|
}));
|
|
997
1006
|
}
|
|
998
|
-
class CommandGroupHeadingState {
|
|
1007
|
+
export class CommandGroupHeadingState {
|
|
1008
|
+
static create(opts) {
|
|
1009
|
+
return new CommandGroupHeadingState(opts, CommandGroupContainerContext.get());
|
|
1010
|
+
}
|
|
999
1011
|
opts;
|
|
1000
1012
|
group;
|
|
1001
1013
|
constructor(opts, group) {
|
|
@@ -1008,7 +1020,10 @@ class CommandGroupHeadingState {
|
|
|
1008
1020
|
...attachRef(this.opts.ref, (v) => (this.group.headingNode = v)),
|
|
1009
1021
|
}));
|
|
1010
1022
|
}
|
|
1011
|
-
class CommandGroupItemsState {
|
|
1023
|
+
export class CommandGroupItemsState {
|
|
1024
|
+
static create(opts) {
|
|
1025
|
+
return new CommandGroupItemsState(opts, CommandGroupContainerContext.get());
|
|
1026
|
+
}
|
|
1012
1027
|
opts;
|
|
1013
1028
|
group;
|
|
1014
1029
|
constructor(opts, group) {
|
|
@@ -1023,7 +1038,10 @@ class CommandGroupItemsState {
|
|
|
1023
1038
|
...attachRef(this.opts.ref),
|
|
1024
1039
|
}));
|
|
1025
1040
|
}
|
|
1026
|
-
class CommandInputState {
|
|
1041
|
+
export class CommandInputState {
|
|
1042
|
+
static create(opts) {
|
|
1043
|
+
return new CommandInputState(opts, CommandRootContext.get());
|
|
1044
|
+
}
|
|
1027
1045
|
opts;
|
|
1028
1046
|
root;
|
|
1029
1047
|
#selectedItemId = $derived.by(() => {
|
|
@@ -1063,14 +1081,17 @@ class CommandInputState {
|
|
|
1063
1081
|
...attachRef(this.opts.ref, (v) => (this.root.inputNode = v)),
|
|
1064
1082
|
}));
|
|
1065
1083
|
}
|
|
1066
|
-
class CommandItemState {
|
|
1084
|
+
export class CommandItemState {
|
|
1085
|
+
static create(opts) {
|
|
1086
|
+
const group = CommandGroupContainerContext.getOr(null);
|
|
1087
|
+
return new CommandItemState({ ...opts, group }, CommandRootContext.get());
|
|
1088
|
+
}
|
|
1067
1089
|
opts;
|
|
1068
1090
|
root;
|
|
1069
1091
|
#group = null;
|
|
1070
1092
|
#trueForceMount = $derived.by(() => {
|
|
1071
1093
|
return this.opts.forceMount.current || this.#group?.opts.forceMount.current === true;
|
|
1072
1094
|
});
|
|
1073
|
-
trueValue = $state("");
|
|
1074
1095
|
shouldRender = $derived.by(() => {
|
|
1075
1096
|
this.opts.ref.current;
|
|
1076
1097
|
if (this.#trueForceMount ||
|
|
@@ -1084,6 +1105,7 @@ class CommandItemState {
|
|
|
1084
1105
|
return currentScore > 0;
|
|
1085
1106
|
});
|
|
1086
1107
|
isSelected = $derived.by(() => this.root.opts.value.current === this.trueValue && this.trueValue !== "");
|
|
1108
|
+
trueValue = $state("");
|
|
1087
1109
|
constructor(opts, root) {
|
|
1088
1110
|
this.opts = opts;
|
|
1089
1111
|
this.root = root;
|
|
@@ -1145,7 +1167,10 @@ class CommandItemState {
|
|
|
1145
1167
|
...attachRef(this.opts.ref),
|
|
1146
1168
|
}));
|
|
1147
1169
|
}
|
|
1148
|
-
class CommandLoadingState {
|
|
1170
|
+
export class CommandLoadingState {
|
|
1171
|
+
static create(opts) {
|
|
1172
|
+
return new CommandLoadingState(opts);
|
|
1173
|
+
}
|
|
1149
1174
|
opts;
|
|
1150
1175
|
constructor(opts) {
|
|
1151
1176
|
this.opts = opts;
|
|
@@ -1161,7 +1186,10 @@ class CommandLoadingState {
|
|
|
1161
1186
|
...attachRef(this.opts.ref),
|
|
1162
1187
|
}));
|
|
1163
1188
|
}
|
|
1164
|
-
class CommandSeparatorState {
|
|
1189
|
+
export class CommandSeparatorState {
|
|
1190
|
+
static create(opts) {
|
|
1191
|
+
return new CommandSeparatorState(opts, CommandRootContext.get());
|
|
1192
|
+
}
|
|
1165
1193
|
opts;
|
|
1166
1194
|
root;
|
|
1167
1195
|
shouldRender = $derived.by(() => !this.root._commandState.search || this.opts.forceMount.current);
|
|
@@ -1177,7 +1205,10 @@ class CommandSeparatorState {
|
|
|
1177
1205
|
...attachRef(this.opts.ref),
|
|
1178
1206
|
}));
|
|
1179
1207
|
}
|
|
1180
|
-
class CommandListState {
|
|
1208
|
+
export class CommandListState {
|
|
1209
|
+
static create(opts) {
|
|
1210
|
+
return CommandListContext.set(new CommandListState(opts, CommandRootContext.get()));
|
|
1211
|
+
}
|
|
1181
1212
|
opts;
|
|
1182
1213
|
root;
|
|
1183
1214
|
constructor(opts, root) {
|
|
@@ -1192,7 +1223,10 @@ class CommandListState {
|
|
|
1192
1223
|
...attachRef(this.opts.ref),
|
|
1193
1224
|
}));
|
|
1194
1225
|
}
|
|
1195
|
-
class CommandLabelState {
|
|
1226
|
+
export class CommandLabelState {
|
|
1227
|
+
static create(opts) {
|
|
1228
|
+
return new CommandLabelState(opts, CommandRootContext.get());
|
|
1229
|
+
}
|
|
1196
1230
|
opts;
|
|
1197
1231
|
root;
|
|
1198
1232
|
constructor(opts, root) {
|
|
@@ -1207,15 +1241,16 @@ class CommandLabelState {
|
|
|
1207
1241
|
...attachRef(this.opts.ref, (v) => (this.root.labelNode = v)),
|
|
1208
1242
|
}));
|
|
1209
1243
|
}
|
|
1210
|
-
class CommandViewportState {
|
|
1244
|
+
export class CommandViewportState {
|
|
1245
|
+
static create(opts) {
|
|
1246
|
+
return new CommandViewportState(opts, CommandListContext.get());
|
|
1247
|
+
}
|
|
1211
1248
|
opts;
|
|
1212
1249
|
list;
|
|
1213
1250
|
constructor(opts, list) {
|
|
1214
1251
|
this.opts = opts;
|
|
1215
1252
|
this.list = list;
|
|
1216
|
-
|
|
1217
|
-
const node = this.opts.ref.current;
|
|
1218
|
-
const listNode = this.list.opts.ref.current;
|
|
1253
|
+
watch([() => this.opts.ref.current, () => this.list.opts.ref.current], ([node, listNode]) => {
|
|
1219
1254
|
if (node === null || listNode === null)
|
|
1220
1255
|
return;
|
|
1221
1256
|
let aF;
|
|
@@ -1238,40 +1273,3 @@ class CommandViewportState {
|
|
|
1238
1273
|
...attachRef(this.opts.ref, (v) => (this.list.root.viewportNode = v)),
|
|
1239
1274
|
}));
|
|
1240
1275
|
}
|
|
1241
|
-
export function useCommandRoot(props) {
|
|
1242
|
-
return CommandRootContext.set(new CommandRootState(props));
|
|
1243
|
-
}
|
|
1244
|
-
export function useCommandEmpty(props) {
|
|
1245
|
-
return new CommandEmptyState(props, CommandRootContext.get());
|
|
1246
|
-
}
|
|
1247
|
-
export function useCommandItem(props) {
|
|
1248
|
-
const group = CommandGroupContainerContext.getOr(null);
|
|
1249
|
-
return new CommandItemState({ ...props, group }, CommandRootContext.get());
|
|
1250
|
-
}
|
|
1251
|
-
export function useCommandGroupContainer(props) {
|
|
1252
|
-
return CommandGroupContainerContext.set(new CommandGroupContainerState(props, CommandRootContext.get()));
|
|
1253
|
-
}
|
|
1254
|
-
export function useCommandGroupHeading(props) {
|
|
1255
|
-
return new CommandGroupHeadingState(props, CommandGroupContainerContext.get());
|
|
1256
|
-
}
|
|
1257
|
-
export function useCommandGroupItems(props) {
|
|
1258
|
-
return new CommandGroupItemsState(props, CommandGroupContainerContext.get());
|
|
1259
|
-
}
|
|
1260
|
-
export function useCommandInput(props) {
|
|
1261
|
-
return new CommandInputState(props, CommandRootContext.get());
|
|
1262
|
-
}
|
|
1263
|
-
export function useCommandLoading(props) {
|
|
1264
|
-
return new CommandLoadingState(props);
|
|
1265
|
-
}
|
|
1266
|
-
export function useCommandSeparator(props) {
|
|
1267
|
-
return new CommandSeparatorState(props, CommandRootContext.get());
|
|
1268
|
-
}
|
|
1269
|
-
export function useCommandList(props) {
|
|
1270
|
-
return CommandListContext.set(new CommandListState(props, CommandRootContext.get()));
|
|
1271
|
-
}
|
|
1272
|
-
export function useCommandViewport(props) {
|
|
1273
|
-
return new CommandViewportState(props, CommandListContext.get());
|
|
1274
|
-
}
|
|
1275
|
-
export function useCommandLabel(props) {
|
|
1276
|
-
return new CommandLabelState(props, CommandRootContext.get());
|
|
1277
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { CommandLabelState } from "../command.svelte.js";
|
|
4
4
|
|
|
5
5
|
import type { WithChildren } from "../../../internal/types.js";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: WithChildren<WithElementRef<BitsPrimitiveLabelAttributes>> = $props();
|
|
17
17
|
|
|
18
|
-
const labelState =
|
|
18
|
+
const labelState = CommandLabelState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandEmptyProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandEmptyState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: CommandEmptyProps = $props();
|
|
17
17
|
|
|
18
|
-
const emptyState =
|
|
18
|
+
const emptyState = CommandEmptyState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { CommandGroupHeadingState } from "../command.svelte.js";
|
|
4
4
|
import type { CommandGroupHeadingProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CommandGroupHeadingProps = $props();
|
|
16
16
|
|
|
17
|
-
const headingState =
|
|
17
|
+
const headingState = CommandGroupHeadingState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandGroupItemsProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandGroupItemsState } from "../command.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
|
}: CommandGroupItemsProps = $props();
|
|
16
16
|
|
|
17
|
-
const groupItemsState =
|
|
17
|
+
const groupItemsState = CommandGroupItemsState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandGroupProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandGroupContainerState } from "../command.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
|
}: CommandGroupProps = $props();
|
|
18
18
|
|
|
19
|
-
const groupState =
|
|
19
|
+
const groupState = CommandGroupContainerState.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 { CommandInputProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandInputState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: CommandInputProps = $props();
|
|
17
17
|
|
|
18
|
-
const inputState =
|
|
18
|
+
const inputState = CommandInputState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandItemProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandItemState } from "../command.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
...restProps
|
|
21
21
|
}: CommandItemProps = $props();
|
|
22
22
|
|
|
23
|
-
const itemState =
|
|
23
|
+
const itemState = CommandItemState.create({
|
|
24
24
|
id: box.with(() => id),
|
|
25
25
|
ref: box.with(
|
|
26
26
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandLinkItemProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandItemState } from "../command.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
...restProps
|
|
21
21
|
}: CommandLinkItemProps = $props();
|
|
22
22
|
|
|
23
|
-
const itemState =
|
|
23
|
+
const itemState = CommandItemState.create({
|
|
24
24
|
id: box.with(() => id),
|
|
25
25
|
ref: box.with(
|
|
26
26
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandListProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandListState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: CommandListProps = $props();
|
|
17
17
|
|
|
18
|
-
const listState =
|
|
18
|
+
const listState = CommandListState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandLoadingProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandLoadingState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: CommandLoadingProps = $props();
|
|
17
17
|
|
|
18
|
-
const loadingState =
|
|
18
|
+
const loadingState = CommandLoadingState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CommandSeparatorProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CommandSeparatorState } from "../command.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: CommandSeparatorProps = $props();
|
|
17
17
|
|
|
18
|
-
const separatorState =
|
|
18
|
+
const separatorState = CommandSeparatorState.create({
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { CommandViewportState } from "../command.svelte.js";
|
|
4
4
|
import type { CommandViewportProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CommandViewportProps = $props();
|
|
16
16
|
|
|
17
|
-
const listViewportState =
|
|
17
|
+
const listViewportState = CommandViewportState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { CommandRootState } from "../command.svelte.js";
|
|
4
4
|
import type { CommandRootProps } from "../types.js";
|
|
5
5
|
import CommandLabel from "./_command-label.svelte";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
...restProps
|
|
29
29
|
}: CommandRootProps = $props();
|
|
30
30
|
|
|
31
|
-
const rootState =
|
|
31
|
+
const rootState = CommandRootState.create({
|
|
32
32
|
id: box.with(() => id),
|
|
33
33
|
ref: box.with(
|
|
34
34
|
() => ref,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ContextMenuContentStaticProps } from "../types.js";
|
|
4
|
-
import { CONTEXT_MENU_TRIGGER_ATTR,
|
|
4
|
+
import { CONTEXT_MENU_TRIGGER_ATTR, MenuContentState } from "../../menu/menu.svelte.js";
|
|
5
5
|
import { useId } from "../../../internal/use-id.js";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
7
|
import PopperLayer from "../../utilities/popper-layer/popper-layer.svelte";
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
...restProps
|
|
25
25
|
}: ContextMenuContentStaticProps = $props();
|
|
26
26
|
|
|
27
|
-
const contentState =
|
|
27
|
+
const contentState = MenuContentState.create({
|
|
28
28
|
id: box.with(() => id),
|
|
29
29
|
loop: box.with(() => loop),
|
|
30
30
|
ref: box.with(
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
side="right"
|
|
103
103
|
sideOffset={2}
|
|
104
104
|
align="start"
|
|
105
|
-
|
|
105
|
+
open={contentState.parentMenu.opts.open.current}
|
|
106
106
|
{preventScroll}
|
|
107
107
|
onInteractOutside={handleInteractOutside}
|
|
108
108
|
onEscapeKeydown={handleEscapeKeydown}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ContextMenuContentProps } from "../types.js";
|
|
4
|
-
import { CONTEXT_MENU_TRIGGER_ATTR,
|
|
4
|
+
import { CONTEXT_MENU_TRIGGER_ATTR, MenuContentState } from "../../menu/menu.svelte.js";
|
|
5
5
|
import { useId } from "../../../internal/use-id.js";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
7
|
import PopperLayer from "../../utilities/popper-layer/popper-layer.svelte";
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
...restProps
|
|
27
27
|
}: ContextMenuContentProps = $props();
|
|
28
28
|
|
|
29
|
-
const contentState =
|
|
29
|
+
const contentState = MenuContentState.create({
|
|
30
30
|
id: box.with(() => id),
|
|
31
31
|
loop: box.with(() => loop),
|
|
32
32
|
ref: box.with(
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
side="right"
|
|
105
105
|
sideOffset={2}
|
|
106
106
|
align="start"
|
|
107
|
-
|
|
107
|
+
open={contentState.parentMenu.opts.open.current}
|
|
108
108
|
{preventScroll}
|
|
109
109
|
onInteractOutside={handleInteractOutside}
|
|
110
110
|
onEscapeKeydown={handleEscapeKeydown}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ContextMenuTriggerProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ContextMenuTriggerState } from "../../menu/menu.svelte.js";
|
|
5
5
|
import { useId } from "../../../internal/use-id.js";
|
|
6
6
|
import { FloatingLayer } from "../../utilities/floating-layer/index.js";
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: ContextMenuTriggerProps = $props();
|
|
16
16
|
|
|
17
|
-
const triggerState =
|
|
17
|
+
const triggerState = ContextMenuTriggerState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
disabled: box.with(() => disabled),
|
|
20
20
|
ref: box.with(
|
|
@@ -3,16 +3,17 @@
|
|
|
3
3
|
import type { ContextMenuRootProps } from "../types.js";
|
|
4
4
|
import FloatingLayer from "../../utilities/floating-layer/components/floating-layer.svelte";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
6
|
-
import {
|
|
6
|
+
import { MenuMenuState, MenuRootState } from "../../menu/menu.svelte.js";
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
open = $bindable(false),
|
|
10
10
|
dir = "ltr",
|
|
11
11
|
onOpenChange = noop,
|
|
12
|
+
onOpenChangeComplete = noop,
|
|
12
13
|
children,
|
|
13
14
|
}: ContextMenuRootProps = $props();
|
|
14
15
|
|
|
15
|
-
const root =
|
|
16
|
+
const root = MenuRootState.create({
|
|
16
17
|
variant: box.with(() => "context-menu"),
|
|
17
18
|
dir: box.with(() => dir),
|
|
18
19
|
onClose: () => {
|
|
@@ -21,15 +22,19 @@
|
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
MenuMenuState.create(
|
|
26
|
+
{
|
|
27
|
+
open: box.with(
|
|
28
|
+
() => open,
|
|
29
|
+
(v) => {
|
|
30
|
+
open = v;
|
|
31
|
+
onOpenChange(v);
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
onOpenChangeComplete: box.with(() => onOpenChangeComplete),
|
|
35
|
+
},
|
|
36
|
+
root
|
|
37
|
+
);
|
|
33
38
|
</script>
|
|
34
39
|
|
|
35
40
|
<FloatingLayer>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { DateFieldHiddenInputState } from "../date-field.svelte.js";
|
|
3
3
|
import HiddenInput from "../../utilities/hidden-input.svelte";
|
|
4
4
|
|
|
5
|
-
const hiddenInputState =
|
|
5
|
+
const hiddenInputState = DateFieldHiddenInputState.create();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
{#if hiddenInputState.shouldRender}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { DateFieldInputState } from "../date-field.svelte.js";
|
|
4
4
|
import type { DateFieldInputProps } from "../types.js";
|
|
5
5
|
import DateFieldHiddenInput from "./date-field-hidden-input.svelte";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
...restProps
|
|
17
17
|
}: DateFieldInputProps = $props();
|
|
18
18
|
|
|
19
|
-
const inputState =
|
|
19
|
+
const inputState = DateFieldInputState.create({
|
|
20
20
|
id: box.with(() => id),
|
|
21
21
|
ref: box.with(
|
|
22
22
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { DateFieldLabelState } from "../date-field.svelte.js";
|
|
4
4
|
import type { DateFieldLabelProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: DateFieldLabelProps = $props();
|
|
16
16
|
|
|
17
|
-
const labelState =
|
|
17
|
+
const labelState = DateFieldLabelState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { DateFieldSegmentState } from "../date-field.svelte.js";
|
|
4
4
|
import type { DateFieldSegmentProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
...restProps
|
|
16
16
|
}: DateFieldSegmentProps = $props();
|
|
17
17
|
|
|
18
|
-
const segmentState =
|
|
18
|
+
const segmentState = DateFieldSegmentState.create(part, {
|
|
19
19
|
id: box.with(() => id),
|
|
20
20
|
ref: box.with(
|
|
21
21
|
() => ref,
|