bits-ui 2.10.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bits/accordion/accordion.svelte.d.ts +9 -7
- package/dist/bits/accordion/accordion.svelte.js +36 -13
- package/dist/bits/accordion/components/accordion-content.svelte +15 -7
- package/dist/bits/accordion/components/accordion-header.svelte +4 -4
- package/dist/bits/accordion/components/accordion-item.svelte +5 -5
- package/dist/bits/accordion/components/accordion-trigger.svelte +4 -4
- package/dist/bits/accordion/components/accordion.svelte +7 -7
- package/dist/bits/accordion/components/accordion.svelte.d.ts +1 -1
- package/dist/bits/accordion/types.d.ts +17 -8
- package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +3 -3
- package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -4
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +3 -3
- package/dist/bits/alert-dialog/components/alert-dialog.svelte +4 -4
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -4
- package/dist/bits/avatar/components/avatar-fallback.svelte +3 -3
- package/dist/bits/avatar/components/avatar-image.svelte +6 -6
- package/dist/bits/avatar/components/avatar.svelte +5 -5
- package/dist/bits/calendar/calendar.svelte.js +30 -30
- package/dist/bits/calendar/components/calendar-cell.svelte +5 -5
- package/dist/bits/calendar/components/calendar-day.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-body.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-head.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid-row.svelte +3 -3
- package/dist/bits/calendar/components/calendar-grid.svelte +3 -3
- package/dist/bits/calendar/components/calendar-head-cell.svelte +3 -3
- package/dist/bits/calendar/components/calendar-header.svelte +3 -3
- package/dist/bits/calendar/components/calendar-heading.svelte +3 -3
- package/dist/bits/calendar/components/calendar-month-select.svelte +6 -6
- package/dist/bits/calendar/components/calendar-next-button.svelte +3 -3
- package/dist/bits/calendar/components/calendar-prev-button.svelte +3 -3
- package/dist/bits/calendar/components/calendar-year-select.svelte +6 -6
- package/dist/bits/calendar/components/calendar.svelte +24 -24
- package/dist/bits/calendar/components/calendar.svelte.d.ts +1 -1
- package/dist/bits/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/bits/checkbox/checkbox.svelte.js +7 -7
- package/dist/bits/checkbox/components/checkbox-group-label.svelte +3 -3
- package/dist/bits/checkbox/components/checkbox-group.svelte +9 -9
- package/dist/bits/checkbox/components/checkbox-group.svelte.d.ts +1 -1
- package/dist/bits/checkbox/components/checkbox.svelte +11 -11
- package/dist/bits/checkbox/components/checkbox.svelte.d.ts +1 -1
- package/dist/bits/collapsible/collapsible.svelte.d.ts +2 -0
- package/dist/bits/collapsible/collapsible.svelte.js +31 -8
- package/dist/bits/collapsible/components/collapsible-content.svelte +15 -7
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -4
- package/dist/bits/collapsible/components/collapsible.svelte +6 -6
- package/dist/bits/collapsible/types.d.ts +12 -3
- package/dist/bits/combobox/components/combobox-input.svelte +4 -4
- package/dist/bits/combobox/components/combobox-trigger.svelte +3 -3
- package/dist/bits/combobox/components/combobox.svelte +12 -12
- package/dist/bits/command/command.svelte.js +6 -6
- package/dist/bits/command/components/_command-label.svelte +3 -3
- package/dist/bits/command/components/command-empty.svelte +4 -4
- package/dist/bits/command/components/command-group-heading.svelte +3 -3
- package/dist/bits/command/components/command-group-items.svelte +3 -3
- package/dist/bits/command/components/command-group.svelte +5 -5
- package/dist/bits/command/components/command-input.svelte +5 -5
- package/dist/bits/command/components/command-input.svelte.d.ts +1 -1
- package/dist/bits/command/components/command-item.svelte +8 -8
- package/dist/bits/command/components/command-link-item.svelte +8 -8
- package/dist/bits/command/components/command-list.svelte +4 -4
- package/dist/bits/command/components/command-loading.svelte +4 -4
- package/dist/bits/command/components/command-separator.svelte +4 -4
- package/dist/bits/command/components/command-viewport.svelte +3 -3
- package/dist/bits/command/components/command.svelte +12 -12
- package/dist/bits/command/components/command.svelte.d.ts +1 -1
- package/dist/bits/context-menu/components/context-menu-content-static.svelte +5 -5
- package/dist/bits/context-menu/components/context-menu-content.svelte +5 -5
- package/dist/bits/context-menu/components/context-menu-trigger.svelte +12 -5
- package/dist/bits/context-menu/components/context-menu.svelte +5 -5
- package/dist/bits/date-field/components/date-field-input.svelte +4 -4
- package/dist/bits/date-field/components/date-field-label.svelte +3 -3
- package/dist/bits/date-field/components/date-field-segment.svelte +3 -3
- package/dist/bits/date-field/components/date-field.svelte +16 -16
- package/dist/bits/date-field/date-field.svelte.js +17 -17
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +5 -5
- package/dist/bits/date-picker/components/date-picker.svelte +32 -32
- package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -4
- package/dist/bits/date-range-field/components/date-range-field-label.svelte +3 -3
- package/dist/bits/date-range-field/components/date-range-field.svelte +19 -19
- package/dist/bits/date-range-field/components/date-range-field.svelte.d.ts +1 -1
- package/dist/bits/date-range-field/date-range-field.svelte.js +9 -9
- package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +3 -3
- package/dist/bits/date-range-picker/components/date-range-picker.svelte +37 -37
- package/dist/bits/date-range-picker/components/date-range-picker.svelte.d.ts +1 -1
- package/dist/bits/dialog/components/dialog-close.svelte +5 -5
- package/dist/bits/dialog/components/dialog-content.svelte +3 -3
- package/dist/bits/dialog/components/dialog-description.svelte +3 -3
- package/dist/bits/dialog/components/dialog-overlay.svelte +3 -3
- package/dist/bits/dialog/components/dialog-title.svelte +4 -4
- package/dist/bits/dialog/components/dialog-trigger.svelte +4 -4
- package/dist/bits/dialog/components/dialog.svelte +4 -4
- package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
- package/dist/bits/dialog/dialog.svelte.js +4 -4
- package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +5 -5
- package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +5 -5
- package/dist/bits/label/components/label.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview-content-static.svelte +5 -5
- package/dist/bits/link-preview/components/link-preview-content.svelte +5 -5
- package/dist/bits/link-preview/components/link-preview-trigger.svelte +3 -3
- package/dist/bits/link-preview/components/link-preview.svelte +6 -6
- package/dist/bits/link-preview/link-preview.svelte.js +4 -4
- package/dist/bits/menu/components/menu-checkbox-group.svelte +5 -5
- package/dist/bits/menu/components/menu-checkbox-group.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-checkbox-item.svelte +9 -9
- package/dist/bits/menu/components/menu-checkbox-item.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-content-static.svelte +5 -5
- package/dist/bits/menu/components/menu-content.svelte +5 -5
- package/dist/bits/menu/components/menu-group-heading.svelte +3 -3
- package/dist/bits/menu/components/menu-group.svelte +3 -3
- package/dist/bits/menu/components/menu-item.svelte +6 -6
- package/dist/bits/menu/components/menu-radio-group.svelte +4 -4
- package/dist/bits/menu/components/menu-radio-group.svelte.d.ts +1 -1
- package/dist/bits/menu/components/menu-radio-item.svelte +7 -7
- package/dist/bits/menu/components/menu-separator.svelte +3 -3
- package/dist/bits/menu/components/menu-sub-content-static.svelte +5 -5
- package/dist/bits/menu/components/menu-sub-content.svelte +5 -5
- package/dist/bits/menu/components/menu-sub-trigger.svelte +5 -5
- package/dist/bits/menu/components/menu-sub.svelte +3 -3
- package/dist/bits/menu/components/menu-trigger.svelte +4 -4
- package/dist/bits/menu/components/menu.svelte +5 -5
- package/dist/bits/menu/menu.svelte.d.ts +1 -1
- package/dist/bits/menu/menu.svelte.js +24 -14
- package/dist/bits/menubar/components/menubar-content-static.svelte +8 -8
- package/dist/bits/menubar/components/menubar-content.svelte +8 -8
- package/dist/bits/menubar/components/menubar-menu.svelte +3 -3
- package/dist/bits/menubar/components/menubar-trigger.svelte +4 -4
- package/dist/bits/menubar/components/menubar.svelte +6 -6
- package/dist/bits/menubar/menubar.svelte.js +5 -5
- package/dist/bits/meter/components/meter.svelte +6 -6
- package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +5 -5
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte.d.ts +1 -1
- package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -4
- package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +3 -3
- package/dist/bits/navigation-menu/components/navigation-menu.svelte +8 -8
- package/dist/bits/navigation-menu/components/navigation-menu.svelte.d.ts +1 -1
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +6 -6
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +23 -23
- package/dist/bits/pagination/components/pagination-next-button.svelte +4 -4
- package/dist/bits/pagination/components/pagination-page.svelte +5 -5
- package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -4
- package/dist/bits/pagination/components/pagination.svelte +9 -9
- package/dist/bits/pagination/pagination.svelte.d.ts +1 -1
- package/dist/bits/pagination/pagination.svelte.js +2 -2
- package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -4
- package/dist/bits/pin-input/components/pin-input.svelte +14 -14
- package/dist/bits/pin-input/components/pin-input.svelte.d.ts +1 -1
- package/dist/bits/pin-input/pin-input.svelte.d.ts +2 -2
- package/dist/bits/pin-input/pin-input.svelte.js +5 -5
- package/dist/bits/popover/components/popover-close.svelte +3 -3
- package/dist/bits/popover/components/popover-content-static.svelte +6 -6
- package/dist/bits/popover/components/popover-content.svelte +6 -6
- package/dist/bits/popover/components/popover-trigger.svelte +4 -4
- package/dist/bits/popover/components/popover.svelte +3 -3
- package/dist/bits/popover/popover.svelte.js +4 -4
- package/dist/bits/progress/components/progress.svelte +6 -6
- package/dist/bits/radio-group/components/radio-group-item.svelte +5 -5
- package/dist/bits/radio-group/components/radio-group.svelte +10 -10
- package/dist/bits/radio-group/components/radio-group.svelte.d.ts +1 -1
- package/dist/bits/radio-group/radio-group.svelte.js +7 -7
- package/dist/bits/range-calendar/components/range-calendar-cell.svelte +5 -5
- package/dist/bits/range-calendar/components/range-calendar-day.svelte +3 -3
- package/dist/bits/range-calendar/components/range-calendar.svelte +26 -26
- package/dist/bits/range-calendar/components/range-calendar.svelte.d.ts +1 -1
- package/dist/bits/range-calendar/range-calendar.svelte.js +7 -7
- package/dist/bits/rating-group/components/rating-group-item.svelte +5 -5
- package/dist/bits/rating-group/components/rating-group.svelte +14 -14
- package/dist/bits/rating-group/components/rating-group.svelte.d.ts +1 -1
- package/dist/bits/rating-group/rating-group.svelte.js +4 -4
- package/dist/bits/scroll-area/components/scroll-area-corner-impl.svelte +3 -3
- 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 +4 -4
- package/dist/bits/scroll-area/components/scroll-area-thumb-impl.svelte +4 -4
- package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +3 -3
- package/dist/bits/scroll-area/components/scroll-area.svelte +6 -6
- package/dist/bits/scroll-area/scroll-area.svelte.d.ts +2 -2
- package/dist/bits/scroll-area/scroll-area.svelte.js +6 -7
- package/dist/bits/select/components/select-content-static.svelte +5 -5
- package/dist/bits/select/components/select-content.svelte +5 -5
- package/dist/bits/select/components/select-group-heading.svelte +3 -3
- package/dist/bits/select/components/select-group.svelte +3 -3
- package/dist/bits/select/components/select-hidden-input.svelte +2 -2
- package/dist/bits/select/components/select-item.svelte +8 -8
- package/dist/bits/select/components/select-scroll-down-button.svelte +4 -4
- package/dist/bits/select/components/select-scroll-up-button.svelte +4 -4
- package/dist/bits/select/components/select-trigger.svelte +3 -3
- package/dist/bits/select/components/select-viewport.svelte +3 -3
- package/dist/bits/select/components/select.svelte +12 -12
- package/dist/bits/select/select.svelte.js +12 -12
- package/dist/bits/separator/components/separator.svelte +5 -5
- package/dist/bits/separator/separator.svelte.d.ts +2 -2
- package/dist/bits/separator/separator.svelte.js +4 -4
- package/dist/bits/slider/components/slider-range.svelte +3 -3
- package/dist/bits/slider/components/slider-thumb-label.svelte +5 -5
- package/dist/bits/slider/components/slider-thumb.svelte +5 -5
- package/dist/bits/slider/components/slider-tick-label.svelte +5 -5
- package/dist/bits/slider/components/slider-tick.svelte +4 -4
- package/dist/bits/slider/components/slider.svelte +14 -14
- package/dist/bits/slider/components/slider.svelte.d.ts +1 -1
- package/dist/bits/slider/slider.svelte.d.ts +16 -16
- package/dist/bits/slider/slider.svelte.js +20 -20
- package/dist/bits/switch/components/switch-thumb.svelte +3 -3
- package/dist/bits/switch/components/switch.svelte +8 -8
- package/dist/bits/switch/components/switch.svelte.d.ts +1 -1
- package/dist/bits/switch/switch.svelte.js +5 -5
- package/dist/bits/tabs/components/tabs-content.svelte +4 -4
- package/dist/bits/tabs/components/tabs-list.svelte +3 -3
- package/dist/bits/tabs/components/tabs-trigger.svelte +5 -5
- package/dist/bits/tabs/components/tabs.svelte +8 -8
- package/dist/bits/tabs/components/tabs.svelte.d.ts +1 -1
- package/dist/bits/tabs/tabs.svelte.d.ts +5 -5
- package/dist/bits/tabs/tabs.svelte.js +11 -11
- package/dist/bits/time-field/components/time-field-input.svelte +4 -4
- package/dist/bits/time-field/components/time-field-label.svelte +3 -3
- package/dist/bits/time-field/components/time-field-segment.svelte +3 -3
- package/dist/bits/time-field/components/time-field.svelte +16 -16
- package/dist/bits/time-field/time-field.svelte.js +15 -15
- package/dist/bits/time-range-field/components/time-range-field-input.svelte +4 -4
- package/dist/bits/time-range-field/components/time-range-field-label.svelte +3 -3
- package/dist/bits/time-range-field/components/time-range-field.svelte +19 -19
- package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +1 -1
- package/dist/bits/time-range-field/time-range-field.svelte.js +7 -7
- package/dist/bits/toggle/components/toggle.svelte +5 -5
- package/dist/bits/toggle/toggle.svelte.d.ts +0 -1
- package/dist/bits/toggle/toggle.svelte.js +5 -10
- package/dist/bits/toggle-group/components/toggle-group-item.svelte +5 -5
- package/dist/bits/toggle-group/components/toggle-group.svelte +8 -8
- package/dist/bits/toggle-group/components/toggle-group.svelte.d.ts +1 -1
- package/dist/bits/toggle-group/toggle-group.svelte.d.ts +2 -2
- package/dist/bits/toggle-group/toggle-group.svelte.js +7 -7
- package/dist/bits/toolbar/components/toolbar-button.svelte +4 -4
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +5 -5
- package/dist/bits/toolbar/components/toolbar-group.svelte +5 -5
- package/dist/bits/toolbar/components/toolbar-group.svelte.d.ts +1 -1
- package/dist/bits/toolbar/components/toolbar-link.svelte +3 -3
- package/dist/bits/toolbar/components/toolbar.svelte +5 -5
- package/dist/bits/toolbar/toolbar.svelte.d.ts +4 -4
- package/dist/bits/toolbar/toolbar.svelte.js +11 -11
- package/dist/bits/tooltip/components/tooltip-content-static.svelte +5 -5
- package/dist/bits/tooltip/components/tooltip-content.svelte +7 -5
- package/dist/bits/tooltip/components/tooltip-provider.svelte +7 -7
- package/dist/bits/tooltip/components/tooltip-trigger.svelte +4 -4
- package/dist/bits/tooltip/components/tooltip.svelte +8 -8
- package/dist/bits/tooltip/tooltip.svelte.js +7 -7
- package/dist/bits/tooltip/types.d.ts +1 -1
- package/dist/bits/utilities/config/bits-config.js +2 -2
- package/dist/bits/utilities/config/components/bits-config.svelte +3 -3
- package/dist/bits/utilities/config/prop-resolvers.js +2 -2
- package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +7 -7
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +3 -2
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +8 -5
- package/dist/bits/utilities/escape-layer/escape-layer.svelte +4 -4
- package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +3 -3
- package/dist/bits/utilities/floating-layer/components/floating-layer-arrow.svelte +3 -3
- package/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte +20 -20
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -3
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +9 -9
- package/dist/bits/utilities/focus-scope/focus-scope-manager.js +2 -2
- package/dist/bits/utilities/focus-scope/focus-scope.svelte +5 -5
- package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
- package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +5 -5
- package/dist/internal/attrs.d.ts +4 -19
- package/dist/internal/attrs.js +11 -56
- package/dist/internal/body-scroll-lock.svelte.js +5 -5
- package/dist/internal/box-auto-reset.svelte.js +2 -2
- package/dist/internal/date-time/calendar-helpers.svelte.js +4 -4
- package/dist/internal/events.d.ts +0 -6
- package/dist/internal/events.js +0 -17
- package/dist/internal/floating-svelte/use-floating.svelte.js +2 -2
- package/dist/internal/state-machine.js +2 -2
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { MenubarContentStaticProps } from "../types.js";
|
|
4
4
|
import { MenubarContentState } from "../menubar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
}: MenubarContentStaticProps = $props();
|
|
21
21
|
|
|
22
22
|
const contentState = MenubarContentState.create({
|
|
23
|
-
id:
|
|
24
|
-
interactOutsideBehavior:
|
|
25
|
-
ref:
|
|
23
|
+
id: boxWith(() => id),
|
|
24
|
+
interactOutsideBehavior: boxWith(() => interactOutsideBehavior),
|
|
25
|
+
ref: boxWith(
|
|
26
26
|
() => ref,
|
|
27
27
|
(v) => (ref = v)
|
|
28
28
|
),
|
|
29
|
-
onInteractOutside:
|
|
30
|
-
onFocusOutside:
|
|
31
|
-
onCloseAutoFocus:
|
|
32
|
-
onOpenAutoFocus:
|
|
29
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
30
|
+
onFocusOutside: boxWith(() => onFocusOutside),
|
|
31
|
+
onCloseAutoFocus: boxWith(() => onCloseAutoFocus),
|
|
32
|
+
onOpenAutoFocus: boxWith(() => onOpenAutoFocus),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const mergedProps = $derived(mergeProps(restProps, contentState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { MenubarContentProps } from "../types.js";
|
|
4
4
|
import { MenubarContentState } from "../menubar.svelte.js";
|
|
5
5
|
import MenuContent from "../../menu/components/menu-content.svelte";
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
}: MenubarContentProps = $props();
|
|
21
21
|
|
|
22
22
|
const contentState = MenubarContentState.create({
|
|
23
|
-
id:
|
|
24
|
-
interactOutsideBehavior:
|
|
25
|
-
ref:
|
|
23
|
+
id: boxWith(() => id),
|
|
24
|
+
interactOutsideBehavior: boxWith(() => interactOutsideBehavior),
|
|
25
|
+
ref: boxWith(
|
|
26
26
|
() => ref,
|
|
27
27
|
(v) => (ref = v)
|
|
28
28
|
),
|
|
29
|
-
onInteractOutside:
|
|
30
|
-
onFocusOutside:
|
|
31
|
-
onCloseAutoFocus:
|
|
32
|
-
onOpenAutoFocus:
|
|
29
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
30
|
+
onFocusOutside: boxWith(() => onFocusOutside),
|
|
31
|
+
onCloseAutoFocus: boxWith(() => onCloseAutoFocus),
|
|
32
|
+
onOpenAutoFocus: boxWith(() => onOpenAutoFocus),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
const mergedProps = $derived(mergeProps(restProps, contentState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { MenubarMenuProps } from "../types.js";
|
|
4
4
|
import { MenubarMenuState } from "../menubar.svelte.js";
|
|
5
5
|
import Menu from "../../menu/components/menu.svelte";
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
let { value = createId(uid), onOpenChange = noop, ...restProps }: MenubarMenuProps = $props();
|
|
12
12
|
|
|
13
13
|
const menuState = MenubarMenuState.create({
|
|
14
|
-
value:
|
|
15
|
-
onOpenChange:
|
|
14
|
+
value: boxWith(() => value),
|
|
15
|
+
onOpenChange: boxWith(() => onOpenChange),
|
|
16
16
|
});
|
|
17
17
|
</script>
|
|
18
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { attachRef,
|
|
2
|
+
import { attachRef, boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { MenubarTriggerProps } from "../types.js";
|
|
4
4
|
import { MenubarTriggerState } from "../menubar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
}: MenubarTriggerProps = $props();
|
|
19
19
|
|
|
20
20
|
const triggerState = MenubarTriggerState.create({
|
|
21
|
-
id:
|
|
22
|
-
disabled:
|
|
23
|
-
ref:
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
disabled: boxWith(() => disabled ?? false),
|
|
23
|
+
ref: boxWith(
|
|
24
24
|
() => ref,
|
|
25
25
|
(v) => (ref = v)
|
|
26
26
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { MenubarRootProps } from "../types.js";
|
|
4
4
|
import { MenubarRootState } from "../menubar.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
}: MenubarRootProps = $props();
|
|
21
21
|
|
|
22
22
|
const rootState = MenubarRootState.create({
|
|
23
|
-
id:
|
|
24
|
-
value:
|
|
23
|
+
id: boxWith(() => id),
|
|
24
|
+
value: boxWith(
|
|
25
25
|
() => value,
|
|
26
26
|
(v) => {
|
|
27
27
|
value = v;
|
|
28
28
|
onValueChange?.(v);
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
dir:
|
|
32
|
-
loop:
|
|
33
|
-
ref:
|
|
31
|
+
dir: boxWith(() => dir),
|
|
32
|
+
loop: boxWith(() => loop),
|
|
33
|
+
ref: boxWith(
|
|
34
34
|
() => ref,
|
|
35
35
|
(v) => (ref = v)
|
|
36
36
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { afterTick,
|
|
1
|
+
import { afterTick, boxWith, attachRef, } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
|
-
import { createBitsAttrs,
|
|
3
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, getDataOpenClosed, } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
5
|
import { wrapArray } from "../../internal/arrays.js";
|
|
6
6
|
import { onMount } from "svelte";
|
|
@@ -29,7 +29,7 @@ export class MenubarRootState {
|
|
|
29
29
|
rootNode: this.opts.ref,
|
|
30
30
|
candidateAttr: menubarAttrs.trigger,
|
|
31
31
|
loop: this.opts.loop,
|
|
32
|
-
orientation:
|
|
32
|
+
orientation: boxWith(() => "horizontal"),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -194,11 +194,11 @@ export class MenubarTriggerState {
|
|
|
194
194
|
role: "menuitem",
|
|
195
195
|
id: this.opts.id.current,
|
|
196
196
|
"aria-haspopup": "menu",
|
|
197
|
-
"aria-expanded":
|
|
197
|
+
"aria-expanded": boolToStr(this.menu.open),
|
|
198
198
|
"aria-controls": this.menu.open ? this.menu.contentId : undefined,
|
|
199
199
|
"data-highlighted": this.isFocused ? "" : undefined,
|
|
200
200
|
"data-state": getDataOpenClosed(this.menu.open),
|
|
201
|
-
"data-disabled":
|
|
201
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
202
202
|
"data-menu-value": this.menu.opts.value.current,
|
|
203
203
|
disabled: this.opts.disabled.current ? true : undefined,
|
|
204
204
|
tabindex: this.#tabIndex,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { MeterRootProps } from "../types.js";
|
|
4
4
|
import { MeterRootState } from "../meter.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
}: MeterRootProps = $props();
|
|
19
19
|
|
|
20
20
|
const rootState = MeterRootState.create({
|
|
21
|
-
value:
|
|
22
|
-
max:
|
|
23
|
-
min:
|
|
24
|
-
id:
|
|
25
|
-
ref:
|
|
21
|
+
value: boxWith(() => value),
|
|
22
|
+
max: boxWith(() => max),
|
|
23
|
+
min: boxWith(() => min),
|
|
24
|
+
id: boxWith(() => id),
|
|
25
|
+
ref: boxWith(
|
|
26
26
|
() => ref,
|
|
27
27
|
(v) => (ref = v)
|
|
28
28
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { untrack, type Snippet } from "svelte";
|
|
4
4
|
import type { NavigationMenuContentProps } from "../types.js";
|
|
5
5
|
import {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
|
|
36
36
|
const contentImplState = NavigationMenuContentImplState.create(
|
|
37
37
|
{
|
|
38
|
-
id:
|
|
39
|
-
ref:
|
|
38
|
+
id: boxWith(() => id),
|
|
39
|
+
ref: boxWith(
|
|
40
40
|
() => ref,
|
|
41
41
|
(v) => {
|
|
42
42
|
ref = v;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { NavigationMenuContentState } from "../navigation-menu.svelte.js";
|
|
4
4
|
import NavigationMenuContentImpl from "./navigation-menu-content-impl.svelte";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
}: NavigationMenuContentProps = $props();
|
|
21
21
|
|
|
22
22
|
const contentState = NavigationMenuContentState.create({
|
|
23
|
-
id:
|
|
24
|
-
ref:
|
|
23
|
+
id: boxWith(() => id),
|
|
24
|
+
ref: boxWith(
|
|
25
25
|
() => ref,
|
|
26
26
|
(v) => (ref = v)
|
|
27
27
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuIndicatorProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuIndicatorImplState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: NavigationMenuIndicatorProps = $props();
|
|
16
16
|
|
|
17
17
|
const indicatorState = NavigationMenuIndicatorImplState.create({
|
|
18
|
-
id:
|
|
19
|
-
ref:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
ref: boxWith(
|
|
20
20
|
() => ref,
|
|
21
21
|
(v) => (ref = v)
|
|
22
22
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuIndicatorProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuIndicatorState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import NavigationMenuIndicatorImpl from "./navigation-menu-indicator-impl.svelte";
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
{#if indicatorState.context.indicatorTrackRef.current}
|
|
26
26
|
<Portal to={indicatorState.context.indicatorTrackRef.current}>
|
|
27
|
-
<PresenceLayer open={forceMount || indicatorState.isVisible} ref={
|
|
27
|
+
<PresenceLayer open={forceMount || indicatorState.isVisible} ref={boxWith(() => ref)}>
|
|
28
28
|
{#snippet presence()}
|
|
29
29
|
<NavigationMenuIndicatorImpl {...mergedProps} {children} {child} {id} bind:ref />
|
|
30
30
|
{/snippet}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuItemProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuItemState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
}: NavigationMenuItemProps = $props();
|
|
19
19
|
|
|
20
20
|
const itemState = NavigationMenuItemState.create({
|
|
21
|
-
id:
|
|
22
|
-
ref:
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
ref: boxWith(
|
|
23
23
|
() => ref,
|
|
24
24
|
(v) => (ref = v)
|
|
25
25
|
),
|
|
26
|
-
value:
|
|
27
|
-
openOnHover:
|
|
26
|
+
value: boxWith(() => value),
|
|
27
|
+
openOnHover: boxWith(() => openOnHover),
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
const mergedProps = $derived(mergeProps(restProps, itemState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuLinkProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuLinkState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
}: NavigationMenuLinkProps = $props();
|
|
20
20
|
|
|
21
21
|
const linkState = NavigationMenuLinkState.create({
|
|
22
|
-
id:
|
|
23
|
-
ref:
|
|
22
|
+
id: boxWith(() => id),
|
|
23
|
+
ref: boxWith(
|
|
24
24
|
() => ref,
|
|
25
25
|
(v) => (ref = v)
|
|
26
26
|
),
|
|
27
|
-
active:
|
|
28
|
-
onSelect:
|
|
27
|
+
active: boxWith(() => active),
|
|
28
|
+
onSelect: boxWith(() => onSelect),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
const mergedProps = $derived(mergeProps(restProps, linkState.props, { tabindex }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuListProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuListState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}: NavigationMenuListProps = $props();
|
|
17
17
|
|
|
18
18
|
const listState = NavigationMenuListState.create({
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuSubProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuSubState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
}: NavigationMenuSubProps = $props();
|
|
20
20
|
|
|
21
21
|
const rootState = NavigationMenuSubState.create({
|
|
22
|
-
id:
|
|
23
|
-
value:
|
|
22
|
+
id: boxWith(() => id),
|
|
23
|
+
value: boxWith(
|
|
24
24
|
() => value,
|
|
25
25
|
(v) => {
|
|
26
26
|
value = v;
|
|
27
27
|
onValueChange(v);
|
|
28
28
|
}
|
|
29
29
|
),
|
|
30
|
-
orientation:
|
|
31
|
-
ref:
|
|
30
|
+
orientation: boxWith(() => orientation),
|
|
31
|
+
ref: boxWith(
|
|
32
32
|
() => ref,
|
|
33
33
|
(v) => (ref = v)
|
|
34
34
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NavigationMenuSubProps } from "../types.js";
|
|
2
|
-
declare const NavigationMenuSub: import("svelte").Component<NavigationMenuSubProps, {}, "
|
|
2
|
+
declare const NavigationMenuSub: import("svelte").Component<NavigationMenuSubProps, {}, "ref" | "value">;
|
|
3
3
|
type NavigationMenuSub = ReturnType<typeof NavigationMenuSub>;
|
|
4
4
|
export default NavigationMenuSub;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuTriggerProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuTriggerState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
}: NavigationMenuTriggerProps = $props();
|
|
20
20
|
|
|
21
21
|
const triggerState = NavigationMenuTriggerState.create({
|
|
22
|
-
id:
|
|
23
|
-
disabled:
|
|
24
|
-
ref:
|
|
22
|
+
id: boxWith(() => id),
|
|
23
|
+
disabled: boxWith(() => disabled ?? false),
|
|
24
|
+
ref: boxWith(
|
|
25
25
|
() => ref,
|
|
26
26
|
(v) => (ref = v)
|
|
27
27
|
),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { NavigationMenuViewportState } from "../navigation-menu.svelte.js";
|
|
4
4
|
import { createId } from "../../../internal/create-id.js";
|
|
5
5
|
import PresenceLayer from "../../utilities/presence-layer/presence-layer.svelte";
|
|
6
|
-
import {
|
|
6
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
7
7
|
import { Mounted } from "../../utilities/index.js";
|
|
8
8
|
|
|
9
9
|
const uid = $props.id();
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
}: NavigationMenuViewportProps = $props();
|
|
19
19
|
|
|
20
20
|
const viewportState = NavigationMenuViewportState.create({
|
|
21
|
-
id:
|
|
22
|
-
ref:
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
ref: boxWith(
|
|
23
23
|
() => ref,
|
|
24
24
|
(v) => (ref = v)
|
|
25
25
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { NavigationMenuRootProps } from "../types.js";
|
|
4
4
|
import { NavigationMenuRootState } from "../navigation-menu.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
}: NavigationMenuRootProps = $props();
|
|
23
23
|
|
|
24
24
|
const rootState = NavigationMenuRootState.create({
|
|
25
|
-
id:
|
|
26
|
-
value:
|
|
25
|
+
id: boxWith(() => id),
|
|
26
|
+
value: boxWith(
|
|
27
27
|
() => value,
|
|
28
28
|
(v) => {
|
|
29
29
|
value = v;
|
|
30
30
|
onValueChange(v);
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
delayDuration:
|
|
34
|
-
skipDelayDuration:
|
|
35
|
-
dir:
|
|
36
|
-
orientation:
|
|
37
|
-
ref:
|
|
33
|
+
delayDuration: boxWith(() => delayDuration),
|
|
34
|
+
skipDelayDuration: boxWith(() => skipDelayDuration),
|
|
35
|
+
dir: boxWith(() => dir),
|
|
36
|
+
orientation: boxWith(() => orientation),
|
|
37
|
+
ref: boxWith(
|
|
38
38
|
() => ref,
|
|
39
39
|
(v) => (ref = v)
|
|
40
40
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NavigationMenuRootProps } from "../types.js";
|
|
2
|
-
declare const NavigationMenu: import("svelte").Component<NavigationMenuRootProps, {}, "
|
|
2
|
+
declare const NavigationMenu: import("svelte").Component<NavigationMenuRootProps, {}, "ref" | "value">;
|
|
3
3
|
type NavigationMenu = ReturnType<typeof NavigationMenu>;
|
|
4
4
|
export default NavigationMenu;
|
|
@@ -65,7 +65,7 @@ export declare class NavigationMenuRootState {
|
|
|
65
65
|
setValue: (newValue: string, itemState: NavigationMenuItemState | null) => void;
|
|
66
66
|
readonly props: {
|
|
67
67
|
readonly id: string;
|
|
68
|
-
readonly "data-orientation":
|
|
68
|
+
readonly "data-orientation": Orientation;
|
|
69
69
|
readonly dir: Direction;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
@@ -86,7 +86,7 @@ export declare class NavigationMenuSubState {
|
|
|
86
86
|
setValue: (newValue: string, itemState: NavigationMenuItemState | null) => void;
|
|
87
87
|
readonly props: {
|
|
88
88
|
readonly id: string;
|
|
89
|
-
readonly "data-orientation":
|
|
89
|
+
readonly "data-orientation": Orientation;
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
interface NavigationMenuListStateOpts extends WithRefProps {
|
|
@@ -109,7 +109,7 @@ export declare class NavigationMenuListState {
|
|
|
109
109
|
};
|
|
110
110
|
readonly props: {
|
|
111
111
|
readonly id: string;
|
|
112
|
-
readonly "data-orientation":
|
|
112
|
+
readonly "data-orientation": Orientation;
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
interface NavigationMenuItemStateOpts extends WithRefProps, ReadableBoxedValues<{
|
|
@@ -263,7 +263,7 @@ export declare class NavigationMenuIndicatorImplState {
|
|
|
263
263
|
readonly props: {
|
|
264
264
|
readonly id: string;
|
|
265
265
|
readonly "data-state": "hidden" | "visible";
|
|
266
|
-
readonly "data-orientation":
|
|
266
|
+
readonly "data-orientation": Orientation;
|
|
267
267
|
readonly style: {
|
|
268
268
|
readonly left: number;
|
|
269
269
|
readonly width: string;
|
|
@@ -325,7 +325,7 @@ export declare class NavigationMenuContentImplState {
|
|
|
325
325
|
readonly id: string;
|
|
326
326
|
readonly "aria-labelledby": string | undefined;
|
|
327
327
|
readonly "data-motion": MotionAttribute | undefined;
|
|
328
|
-
readonly "data-orientation":
|
|
328
|
+
readonly "data-orientation": Orientation;
|
|
329
329
|
readonly "data-state": "open" | "closed";
|
|
330
330
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
331
331
|
};
|
|
@@ -351,7 +351,7 @@ export declare class NavigationMenuViewportState {
|
|
|
351
351
|
readonly props: {
|
|
352
352
|
readonly id: string;
|
|
353
353
|
readonly "data-state": "open" | "closed";
|
|
354
|
-
readonly "data-orientation":
|
|
354
|
+
readonly "data-orientation": Orientation;
|
|
355
355
|
readonly style: {
|
|
356
356
|
readonly pointerEvents: "none" | undefined;
|
|
357
357
|
readonly "--bits-navigation-menu-viewport-width": string | undefined;
|