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,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CalendarGridBodyProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarGridBodyState } from "../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
|
}: CalendarGridBodyProps = $props();
|
|
16
16
|
|
|
17
|
-
const gridBodyState =
|
|
17
|
+
const gridBodyState = CalendarGridBodyState.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 { CalendarGridHeadState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridHeadProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarGridHeadProps = $props();
|
|
16
16
|
|
|
17
|
-
const gridHeadState =
|
|
17
|
+
const gridHeadState = CalendarGridHeadState.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 { CalendarGridRowState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridRowProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarGridRowProps = $props();
|
|
16
16
|
|
|
17
|
-
const gridRowState =
|
|
17
|
+
const gridRowState = CalendarGridRowState.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 { CalendarGridState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarGridProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarGridProps = $props();
|
|
16
16
|
|
|
17
|
-
const gridState =
|
|
17
|
+
const gridState = CalendarGridState.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 { CalendarHeadCellState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeadCellProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarHeadCellProps = $props();
|
|
16
16
|
|
|
17
|
-
const headCellState =
|
|
17
|
+
const headCellState = CalendarHeadCellState.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 { CalendarHeaderState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarHeaderProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarHeaderProps = $props();
|
|
16
16
|
|
|
17
|
-
const headerState =
|
|
17
|
+
const headerState = CalendarHeaderState.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 { CalendarHeadingProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarHeadingState } from "../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
|
}: CalendarHeadingProps = $props();
|
|
16
16
|
|
|
17
|
-
const headingState =
|
|
17
|
+
const headingState = CalendarHeadingState.create({
|
|
18
18
|
id: box.with(() => id),
|
|
19
19
|
ref: box.with(
|
|
20
20
|
() => ref,
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
{#if child}
|
|
29
|
-
{@render child({ props: mergedProps, headingValue: headingState.headingValue })}
|
|
29
|
+
{@render child({ props: mergedProps, headingValue: headingState.root.headingValue })}
|
|
30
30
|
{:else}
|
|
31
31
|
<div {...mergedProps}>
|
|
32
32
|
{#if children}
|
|
33
|
-
{@render children?.({ headingValue: headingState.headingValue })}
|
|
33
|
+
{@render children?.({ headingValue: headingState.root.headingValue })}
|
|
34
34
|
{:else}
|
|
35
|
-
{headingState.headingValue}
|
|
35
|
+
{headingState.root.headingValue}
|
|
36
36
|
{/if}
|
|
37
37
|
</div>
|
|
38
38
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CalendarMonthSelectProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarMonthSelectState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
...restProps
|
|
19
19
|
}: CalendarMonthSelectProps = $props();
|
|
20
20
|
|
|
21
|
-
const monthSelectState =
|
|
21
|
+
const monthSelectState = CalendarMonthSelectState.create({
|
|
22
22
|
id: box.with(() => id),
|
|
23
23
|
ref: box.with(
|
|
24
24
|
() => ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
|
-
import {
|
|
3
|
+
import { CalendarNextButtonState } from "../calendar.svelte.js";
|
|
4
4
|
import type { CalendarNextButtonProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
...restProps
|
|
15
15
|
}: CalendarNextButtonProps = $props();
|
|
16
16
|
|
|
17
|
-
const nextButtonState =
|
|
17
|
+
const nextButtonState = CalendarNextButtonState.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 { CalendarPrevButtonProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarPrevButtonState } from "../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
|
}: CalendarPrevButtonProps = $props();
|
|
16
16
|
|
|
17
|
-
const prevButtonState =
|
|
17
|
+
const prevButtonState = CalendarPrevButtonState.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 { CalendarYearSelectProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CalendarYearSelectState } from "../calendar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
|
|
7
7
|
const uid = $props.id();
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
...restProps
|
|
19
19
|
}: CalendarYearSelectProps = $props();
|
|
20
20
|
|
|
21
|
-
const yearSelectState =
|
|
21
|
+
const yearSelectState = CalendarYearSelectState.create({
|
|
22
22
|
id: box.with(() => id),
|
|
23
23
|
ref: box.with(
|
|
24
24
|
() => ref,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { watch } from "runed";
|
|
3
3
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
4
4
|
import { type DateValue } from "@internationalized/date";
|
|
5
|
-
import {
|
|
5
|
+
import { CalendarRootState } from "../calendar.svelte.js";
|
|
6
6
|
import type { CalendarRootProps } from "../types.js";
|
|
7
7
|
import { useId } from "../../../internal/use-id.js";
|
|
8
8
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
77
|
|
|
78
|
-
const rootState =
|
|
78
|
+
const rootState = CalendarRootState.create({
|
|
79
79
|
id: box.with(() => id),
|
|
80
80
|
ref: box.with(
|
|
81
81
|
() => ref,
|
|
@@ -1,63 +1,70 @@
|
|
|
1
|
+
import { type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
1
2
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
2
3
|
import { Context } from "runed";
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
type CheckboxGroupStateProps = WithRefProps<ReadableBoxedValues<{
|
|
4
|
+
import type { BitsKeyboardEvent, BitsMouseEvent, OnChangeFn, WithRefOpts } from "../../internal/types.js";
|
|
5
|
+
interface CheckboxGroupStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
6
6
|
name: string | undefined;
|
|
7
7
|
disabled: boolean;
|
|
8
8
|
required: boolean;
|
|
9
9
|
onValueChange: OnChangeFn<string[]>;
|
|
10
|
-
}
|
|
10
|
+
}>, WritableBoxedValues<{
|
|
11
11
|
value: string[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
export declare const CheckboxGroupContext: Context<CheckboxGroupState>;
|
|
15
|
+
export declare class CheckboxGroupState {
|
|
16
|
+
static create(opts: CheckboxGroupStateOpts): CheckboxGroupState;
|
|
17
|
+
readonly opts: CheckboxGroupStateOpts;
|
|
15
18
|
labelId: string | undefined;
|
|
16
|
-
constructor(opts:
|
|
19
|
+
constructor(opts: CheckboxGroupStateOpts);
|
|
17
20
|
addValue(checkboxValue: string | undefined): void;
|
|
18
21
|
removeValue(checkboxValue: string | undefined): void;
|
|
19
|
-
props: {
|
|
22
|
+
readonly props: {
|
|
20
23
|
readonly id: string;
|
|
21
24
|
readonly role: "group";
|
|
22
25
|
readonly "aria-labelledby": string | undefined;
|
|
23
26
|
readonly "data-disabled": "" | undefined;
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
interface CheckboxGroupLabelStateOpts extends WithRefOpts {
|
|
30
|
+
}
|
|
31
|
+
export declare class CheckboxGroupLabelState {
|
|
32
|
+
static create(opts: CheckboxGroupLabelStateOpts): CheckboxGroupLabelState;
|
|
33
|
+
readonly opts: CheckboxGroupLabelStateOpts;
|
|
29
34
|
readonly group: CheckboxGroupState;
|
|
30
|
-
constructor(opts:
|
|
31
|
-
props: {
|
|
35
|
+
constructor(opts: CheckboxGroupLabelStateOpts, group: CheckboxGroupState);
|
|
36
|
+
readonly props: {
|
|
32
37
|
readonly id: string;
|
|
33
38
|
readonly "data-disabled": "" | undefined;
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
|
-
|
|
41
|
+
interface CheckboxRootStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
37
42
|
disabled: boolean;
|
|
38
43
|
required: boolean;
|
|
39
44
|
name: string | undefined;
|
|
40
45
|
value: string | undefined;
|
|
41
46
|
type: HTMLButtonAttributes["type"];
|
|
42
|
-
}
|
|
47
|
+
}>, WritableBoxedValues<{
|
|
43
48
|
checked: boolean;
|
|
44
49
|
indeterminate: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
50
|
+
}> {
|
|
51
|
+
}
|
|
52
|
+
export declare class CheckboxRootState {
|
|
47
53
|
#private;
|
|
48
|
-
|
|
54
|
+
static create(opts: CheckboxRootStateOpts, group?: CheckboxGroupState | null): CheckboxRootState;
|
|
55
|
+
readonly opts: CheckboxRootStateOpts;
|
|
49
56
|
readonly group: CheckboxGroupState | null;
|
|
50
|
-
trueName: string | undefined;
|
|
51
|
-
trueRequired: boolean;
|
|
52
|
-
trueDisabled: boolean;
|
|
53
|
-
constructor(opts:
|
|
57
|
+
readonly trueName: string | undefined;
|
|
58
|
+
readonly trueRequired: boolean;
|
|
59
|
+
readonly trueDisabled: boolean;
|
|
60
|
+
constructor(opts: CheckboxRootStateOpts, group: CheckboxGroupState | null);
|
|
54
61
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
55
62
|
onclick(_: BitsMouseEvent): void;
|
|
56
|
-
snippetProps: {
|
|
63
|
+
readonly snippetProps: {
|
|
57
64
|
checked: boolean;
|
|
58
65
|
indeterminate: boolean;
|
|
59
66
|
};
|
|
60
|
-
props: {
|
|
67
|
+
readonly props: {
|
|
61
68
|
readonly id: string;
|
|
62
69
|
readonly role: "checkbox";
|
|
63
70
|
readonly type: "button" | "reset" | "submit" | null | undefined;
|
|
@@ -70,12 +77,13 @@ declare class CheckboxRootState {
|
|
|
70
77
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
71
78
|
};
|
|
72
79
|
}
|
|
73
|
-
declare class CheckboxInputState {
|
|
80
|
+
export declare class CheckboxInputState {
|
|
81
|
+
static create(): CheckboxInputState;
|
|
74
82
|
readonly root: CheckboxRootState;
|
|
75
|
-
trueChecked: boolean;
|
|
76
|
-
shouldRender: boolean;
|
|
83
|
+
readonly trueChecked: boolean;
|
|
84
|
+
readonly shouldRender: boolean;
|
|
77
85
|
constructor(root: CheckboxRootState);
|
|
78
|
-
props: {
|
|
86
|
+
readonly props: {
|
|
79
87
|
readonly type: "checkbox";
|
|
80
88
|
readonly checked: boolean;
|
|
81
89
|
readonly disabled: boolean;
|
|
@@ -84,9 +92,4 @@ declare class CheckboxInputState {
|
|
|
84
92
|
readonly value: string | undefined;
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
|
-
export declare const CheckboxGroupContext: Context<CheckboxGroupState>;
|
|
88
|
-
export declare function useCheckboxGroup(props: CheckboxGroupStateProps): CheckboxGroupState;
|
|
89
|
-
export declare function useCheckboxRoot(props: CheckboxRootStateProps, group: CheckboxGroupState | null): CheckboxRootState;
|
|
90
|
-
export declare function useCheckboxGroupLabel(props: CheckboxGroupLabelStateProps): CheckboxGroupLabelState;
|
|
91
|
-
export declare function useCheckboxInput(): CheckboxInputState;
|
|
92
95
|
export {};
|
|
@@ -6,7 +6,11 @@ const checkboxAttrs = createBitsAttrs({
|
|
|
6
6
|
component: "checkbox",
|
|
7
7
|
parts: ["root", "group", "group-label", "input"],
|
|
8
8
|
});
|
|
9
|
-
|
|
9
|
+
export const CheckboxGroupContext = new Context("Checkbox.Group");
|
|
10
|
+
export class CheckboxGroupState {
|
|
11
|
+
static create(opts) {
|
|
12
|
+
return CheckboxGroupContext.set(new CheckboxGroupState(opts));
|
|
13
|
+
}
|
|
10
14
|
opts;
|
|
11
15
|
labelId = $state(undefined);
|
|
12
16
|
constructor(opts) {
|
|
@@ -40,7 +44,10 @@ class CheckboxGroupState {
|
|
|
40
44
|
...attachRef(this.opts.ref),
|
|
41
45
|
}));
|
|
42
46
|
}
|
|
43
|
-
class CheckboxGroupLabelState {
|
|
47
|
+
export class CheckboxGroupLabelState {
|
|
48
|
+
static create(opts) {
|
|
49
|
+
return new CheckboxGroupLabelState(opts, CheckboxGroupContext.get());
|
|
50
|
+
}
|
|
44
51
|
opts;
|
|
45
52
|
group;
|
|
46
53
|
constructor(opts, group) {
|
|
@@ -54,7 +61,11 @@ class CheckboxGroupLabelState {
|
|
|
54
61
|
...attachRef(this.opts.ref, (v) => (this.group.labelId = v?.id)),
|
|
55
62
|
}));
|
|
56
63
|
}
|
|
57
|
-
|
|
64
|
+
const CheckboxRootContext = new Context("Checkbox.Root");
|
|
65
|
+
export class CheckboxRootState {
|
|
66
|
+
static create(opts, group = null) {
|
|
67
|
+
return CheckboxRootContext.set(new CheckboxRootState(opts, group));
|
|
68
|
+
}
|
|
58
69
|
opts;
|
|
59
70
|
group;
|
|
60
71
|
trueName = $derived.by(() => {
|
|
@@ -77,7 +88,7 @@ class CheckboxRootState {
|
|
|
77
88
|
}
|
|
78
89
|
return this.opts.disabled.current;
|
|
79
90
|
});
|
|
80
|
-
constructor(opts, group
|
|
91
|
+
constructor(opts, group) {
|
|
81
92
|
this.opts = opts;
|
|
82
93
|
this.group = group;
|
|
83
94
|
this.onkeydown = this.onkeydown.bind(this);
|
|
@@ -142,10 +153,10 @@ class CheckboxRootState {
|
|
|
142
153
|
...attachRef(this.opts.ref),
|
|
143
154
|
}));
|
|
144
155
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
export class CheckboxInputState {
|
|
157
|
+
static create() {
|
|
158
|
+
return new CheckboxInputState(CheckboxRootContext.get());
|
|
159
|
+
}
|
|
149
160
|
root;
|
|
150
161
|
trueChecked = $derived.by(() => {
|
|
151
162
|
if (!this.root.group)
|
|
@@ -174,17 +185,3 @@ function getCheckboxDataState(checked, indeterminate) {
|
|
|
174
185
|
return "indeterminate";
|
|
175
186
|
return checked ? "checked" : "unchecked";
|
|
176
187
|
}
|
|
177
|
-
export const CheckboxGroupContext = new Context("Checkbox.Group");
|
|
178
|
-
const CheckboxRootContext = new Context("Checkbox.Root");
|
|
179
|
-
export function useCheckboxGroup(props) {
|
|
180
|
-
return CheckboxGroupContext.set(new CheckboxGroupState(props));
|
|
181
|
-
}
|
|
182
|
-
export function useCheckboxRoot(props, group) {
|
|
183
|
-
return CheckboxRootContext.set(new CheckboxRootState(props, group));
|
|
184
|
-
}
|
|
185
|
-
export function useCheckboxGroupLabel(props) {
|
|
186
|
-
return new CheckboxGroupLabelState(props, CheckboxGroupContext.get());
|
|
187
|
-
}
|
|
188
|
-
export function useCheckboxInput() {
|
|
189
|
-
return new CheckboxInputState(CheckboxRootContext.get());
|
|
190
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { CheckboxGroupLabelProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CheckboxGroupLabelState } from "../checkbox.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
|
}: CheckboxGroupLabelProps = $props();
|
|
16
16
|
|
|
17
|
-
const labelState =
|
|
17
|
+
const labelState = CheckboxGroupLabelState.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 { CheckboxGroupProps } from "../types.js";
|
|
4
|
-
import {
|
|
4
|
+
import { CheckboxGroupState } from "../checkbox.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
|
}: CheckboxGroupProps = $props();
|
|
22
22
|
|
|
23
|
-
const groupState =
|
|
23
|
+
const groupState = CheckboxGroupState.create({
|
|
24
24
|
id: box.with(() => id),
|
|
25
25
|
ref: box.with(
|
|
26
26
|
() => ref,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxInputState } from "../checkbox.svelte.js";
|
|
3
3
|
import HiddenInput from "../../utilities/hidden-input.svelte";
|
|
4
4
|
|
|
5
|
-
const inputState =
|
|
5
|
+
const inputState = CheckboxInputState.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 { CheckboxRootProps } from "../types.js";
|
|
4
|
-
import { CheckboxGroupContext,
|
|
4
|
+
import { CheckboxGroupContext, CheckboxRootState } from "../checkbox.svelte.js";
|
|
5
5
|
import CheckboxInput from "./checkbox-input.svelte";
|
|
6
6
|
import { createId } from "../../../internal/create-id.js";
|
|
7
7
|
import { watch } from "runed";
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
50
|
|
|
51
|
-
const rootState =
|
|
51
|
+
const rootState = CheckboxRootState.create(
|
|
52
52
|
{
|
|
53
53
|
checked: box.with(
|
|
54
54
|
() => checked,
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
type CollapsibleRootStateProps = WithRefProps & WritableBoxedValues<{
|
|
1
|
+
import { type ReadableBoxedValues, type WritableBoxedValues } from "svelte-toolbelt";
|
|
2
|
+
import type { BitsKeyboardEvent, BitsMouseEvent, OnChangeFn, WithRefOpts } from "../../internal/types.js";
|
|
3
|
+
interface CollapsibleRootStateOpts extends WithRefOpts, WritableBoxedValues<{
|
|
5
4
|
open: boolean;
|
|
6
|
-
}
|
|
5
|
+
}>, ReadableBoxedValues<{
|
|
7
6
|
disabled: boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
onOpenChangeComplete: OnChangeFn<boolean>;
|
|
8
|
+
}> {
|
|
9
|
+
}
|
|
10
|
+
export declare class CollapsibleRootState {
|
|
11
|
+
static create(opts: CollapsibleRootStateOpts): CollapsibleRootState;
|
|
12
|
+
readonly opts: CollapsibleRootStateOpts;
|
|
11
13
|
contentNode: HTMLElement | null;
|
|
12
|
-
constructor(opts:
|
|
14
|
+
constructor(opts: CollapsibleRootStateOpts);
|
|
13
15
|
toggleOpen(): void;
|
|
14
|
-
props: {
|
|
16
|
+
readonly props: {
|
|
15
17
|
readonly id: string;
|
|
16
18
|
readonly "data-state": "open" | "closed";
|
|
17
19
|
readonly "data-disabled": "" | undefined;
|
|
18
20
|
};
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
interface CollapsibleContentStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
21
23
|
forceMount: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
+
}> {
|
|
25
|
+
}
|
|
26
|
+
export declare class CollapsibleContentState {
|
|
24
27
|
#private;
|
|
25
|
-
|
|
28
|
+
static create(opts: CollapsibleContentStateOpts): CollapsibleContentState;
|
|
29
|
+
readonly opts: CollapsibleContentStateOpts;
|
|
26
30
|
readonly root: CollapsibleRootState;
|
|
27
|
-
present: boolean;
|
|
28
|
-
constructor(opts:
|
|
29
|
-
snippetProps: {
|
|
31
|
+
readonly present: boolean;
|
|
32
|
+
constructor(opts: CollapsibleContentStateOpts, root: CollapsibleRootState);
|
|
33
|
+
readonly snippetProps: {
|
|
30
34
|
open: boolean;
|
|
31
35
|
};
|
|
32
|
-
props: {
|
|
36
|
+
readonly props: {
|
|
33
37
|
readonly id: string;
|
|
34
38
|
readonly style: {
|
|
35
39
|
readonly "--bits-collapsible-content-height": string | undefined;
|
|
@@ -39,17 +43,19 @@ declare class CollapsibleContentState {
|
|
|
39
43
|
readonly "data-disabled": "" | undefined;
|
|
40
44
|
};
|
|
41
45
|
}
|
|
42
|
-
|
|
46
|
+
interface CollapsibleTriggerStateOpts extends WithRefOpts, ReadableBoxedValues<{
|
|
43
47
|
disabled: boolean | null | undefined;
|
|
44
|
-
}
|
|
45
|
-
|
|
48
|
+
}> {
|
|
49
|
+
}
|
|
50
|
+
export declare class CollapsibleTriggerState {
|
|
46
51
|
#private;
|
|
47
|
-
|
|
52
|
+
static create(opts: CollapsibleTriggerStateOpts): CollapsibleTriggerState;
|
|
53
|
+
readonly opts: CollapsibleTriggerStateOpts;
|
|
48
54
|
readonly root: CollapsibleRootState;
|
|
49
|
-
constructor(opts:
|
|
55
|
+
constructor(opts: CollapsibleTriggerStateOpts, root: CollapsibleRootState);
|
|
50
56
|
onclick(e: BitsMouseEvent): void;
|
|
51
57
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
52
|
-
props: {
|
|
58
|
+
readonly props: {
|
|
53
59
|
readonly id: string;
|
|
54
60
|
readonly type: "button";
|
|
55
61
|
readonly disabled: boolean;
|
|
@@ -61,7 +67,4 @@ declare class CollapsibleTriggerState {
|
|
|
61
67
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
62
68
|
};
|
|
63
69
|
}
|
|
64
|
-
export declare function useCollapsibleRoot(props: CollapsibleRootStateProps): CollapsibleRootState;
|
|
65
|
-
export declare function useCollapsibleTrigger(props: CollapsibleTriggerStateProps): CollapsibleTriggerState;
|
|
66
|
-
export declare function useCollapsibleContent(props: CollapsibleContentStateProps): CollapsibleContentState;
|
|
67
70
|
export {};
|