bits-ui 2.9.9 → 2.11.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/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 +4 -4
- 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 +14 -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.d.ts +1 -4
- package/dist/bits/select/select.svelte.js +17 -26
- 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.js +4 -3
- 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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- 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 +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { TooltipProviderProps } from "../types.js";
|
|
4
4
|
import { TooltipProviderState } from "../tooltip.svelte.js";
|
|
5
5
|
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
}: TooltipProviderProps = $props();
|
|
15
15
|
|
|
16
16
|
TooltipProviderState.create({
|
|
17
|
-
delayDuration:
|
|
18
|
-
disableCloseOnTriggerClick:
|
|
19
|
-
disableHoverableContent:
|
|
20
|
-
disabled:
|
|
21
|
-
ignoreNonKeyboardFocus:
|
|
22
|
-
skipDelayDuration:
|
|
17
|
+
delayDuration: boxWith(() => delayDuration),
|
|
18
|
+
disableCloseOnTriggerClick: boxWith(() => disableCloseOnTriggerClick),
|
|
19
|
+
disableHoverableContent: boxWith(() => disableHoverableContent),
|
|
20
|
+
disabled: boxWith(() => disabled),
|
|
21
|
+
ignoreNonKeyboardFocus: boxWith(() => ignoreNonKeyboardFocus),
|
|
22
|
+
skipDelayDuration: boxWith(() => skipDelayDuration),
|
|
23
23
|
});
|
|
24
24
|
</script>
|
|
25
25
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { TooltipTriggerProps } from "../types.js";
|
|
4
4
|
import { TooltipTriggerState } from "../tooltip.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
}: TooltipTriggerProps = $props();
|
|
19
19
|
|
|
20
20
|
const triggerState = TooltipTriggerState.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 } from "svelte-toolbelt";
|
|
3
3
|
import type { TooltipRootProps } from "../types.js";
|
|
4
4
|
import { TooltipRootState } from "../tooltip.svelte.js";
|
|
5
5
|
import FloatingLayer from "../../utilities/floating-layer/components/floating-layer.svelte";
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
}: TooltipRootProps = $props();
|
|
19
19
|
|
|
20
20
|
TooltipRootState.create({
|
|
21
|
-
open:
|
|
21
|
+
open: boxWith(
|
|
22
22
|
() => open,
|
|
23
23
|
(v) => {
|
|
24
24
|
open = v;
|
|
25
25
|
onOpenChange(v);
|
|
26
26
|
}
|
|
27
27
|
),
|
|
28
|
-
delayDuration:
|
|
29
|
-
disableCloseOnTriggerClick:
|
|
30
|
-
disableHoverableContent:
|
|
31
|
-
ignoreNonKeyboardFocus:
|
|
32
|
-
disabled:
|
|
33
|
-
onOpenChangeComplete:
|
|
28
|
+
delayDuration: boxWith(() => delayDuration),
|
|
29
|
+
disableCloseOnTriggerClick: boxWith(() => disableCloseOnTriggerClick),
|
|
30
|
+
disableHoverableContent: boxWith(() => disableHoverableContent),
|
|
31
|
+
ignoreNonKeyboardFocus: boxWith(() => ignoreNonKeyboardFocus),
|
|
32
|
+
disabled: boxWith(() => disabled),
|
|
33
|
+
onOpenChangeComplete: boxWith(() => onOpenChangeComplete),
|
|
34
34
|
});
|
|
35
35
|
</script>
|
|
36
36
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { onMountEffect, attachRef, DOMContext, simpleBox, boxWith, } from "svelte-toolbelt";
|
|
2
2
|
import { on } from "svelte/events";
|
|
3
3
|
import { Context, watch } from "runed";
|
|
4
4
|
import { isElement, isFocusVisible } from "../../internal/is.js";
|
|
5
|
-
import { createBitsAttrs,
|
|
5
|
+
import { createBitsAttrs, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
6
6
|
import { TimeoutFn } from "../../internal/timeout-fn.js";
|
|
7
7
|
import { GraceArea } from "../../internal/grace-area.svelte.js";
|
|
8
8
|
import { OpenChangeComplete } from "../../internal/open-change-complete.js";
|
|
@@ -18,7 +18,7 @@ export class TooltipProviderState {
|
|
|
18
18
|
}
|
|
19
19
|
opts;
|
|
20
20
|
isOpenDelayed = $state(true);
|
|
21
|
-
isPointerInTransit =
|
|
21
|
+
isPointerInTransit = simpleBox(false);
|
|
22
22
|
#timerFn;
|
|
23
23
|
#openTooltip = $state(null);
|
|
24
24
|
constructor(opts) {
|
|
@@ -89,7 +89,7 @@ export class TooltipRootState {
|
|
|
89
89
|
}, this.delayDuration ?? 0, { immediate: false });
|
|
90
90
|
new OpenChangeComplete({
|
|
91
91
|
open: this.opts.open,
|
|
92
|
-
ref:
|
|
92
|
+
ref: boxWith(() => this.contentNode),
|
|
93
93
|
onComplete: () => {
|
|
94
94
|
this.opts.onOpenChangeComplete.current(this.opts.open.current);
|
|
95
95
|
},
|
|
@@ -154,7 +154,7 @@ export class TooltipTriggerState {
|
|
|
154
154
|
opts;
|
|
155
155
|
root;
|
|
156
156
|
attachment;
|
|
157
|
-
#isPointerDown =
|
|
157
|
+
#isPointerDown = simpleBox(false);
|
|
158
158
|
#hasPointerMoveOpened = $state(false);
|
|
159
159
|
#isDisabled = $derived.by(() => this.opts.disabled.current || this.root.disabled);
|
|
160
160
|
domContext;
|
|
@@ -221,7 +221,7 @@ export class TooltipTriggerState {
|
|
|
221
221
|
? this.root.contentNode?.id
|
|
222
222
|
: undefined,
|
|
223
223
|
"data-state": this.root.stateAttr,
|
|
224
|
-
"data-disabled":
|
|
224
|
+
"data-disabled": boolToEmptyStrOrUndef(this.#isDisabled),
|
|
225
225
|
"data-delay-duration": `${this.root.delayDuration}`,
|
|
226
226
|
[tooltipAttrs.trigger]: "",
|
|
227
227
|
tabindex: this.#isDisabled ? undefined : 0,
|
|
@@ -298,7 +298,7 @@ export class TooltipContentState {
|
|
|
298
298
|
props = $derived.by(() => ({
|
|
299
299
|
id: this.opts.id.current,
|
|
300
300
|
"data-state": this.root.stateAttr,
|
|
301
|
-
"data-disabled":
|
|
301
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.disabled),
|
|
302
302
|
style: {
|
|
303
303
|
pointerEvents: "auto",
|
|
304
304
|
outline: "none",
|
|
@@ -94,7 +94,7 @@ export type TooltipRootPropsWithoutHTML = WithChildren<{
|
|
|
94
94
|
ignoreNonKeyboardFocus?: boolean;
|
|
95
95
|
}>;
|
|
96
96
|
export type TooltipRootProps = TooltipRootPropsWithoutHTML;
|
|
97
|
-
export type TooltipContentPropsWithoutHTML = WithChildNoChildrenSnippetProps<
|
|
97
|
+
export type TooltipContentPropsWithoutHTML = WithChildNoChildrenSnippetProps<Omit<FloatingLayerContentProps, "content" | "preventScroll"> & Omit<DismissibleLayerProps, "onInteractOutsideStart"> & EscapeLayerProps & {
|
|
98
98
|
/**
|
|
99
99
|
* When `true`, the tooltip will be forced to mount in the DOM.
|
|
100
100
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from "runed";
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
export const BitsConfigContext = new Context("BitsConfig");
|
|
4
4
|
/**
|
|
5
5
|
* Gets the current Bits UI configuration state from the context.
|
|
@@ -76,7 +76,7 @@ export class BitsConfigState {
|
|
|
76
76
|
*/
|
|
77
77
|
function createConfigResolver(parent, currentOpts) {
|
|
78
78
|
return (getter) => {
|
|
79
|
-
const configOption =
|
|
79
|
+
const configOption = boxWith(() => {
|
|
80
80
|
// try current opts first
|
|
81
81
|
const value = getter(currentOpts)?.current;
|
|
82
82
|
if (value !== undefined)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { BitsConfigProps } from "../types.js";
|
|
3
3
|
import { useBitsConfig } from "../bits-config.js";
|
|
4
|
-
import {
|
|
4
|
+
import { boxWith } from "svelte-toolbelt";
|
|
5
5
|
|
|
6
6
|
let { children, defaultPortalTo, defaultLocale }: BitsConfigProps = $props();
|
|
7
7
|
|
|
8
8
|
useBitsConfig({
|
|
9
|
-
defaultPortalTo:
|
|
10
|
-
defaultLocale:
|
|
9
|
+
defaultPortalTo: boxWith(() => defaultPortalTo),
|
|
10
|
+
defaultLocale: boxWith(() => defaultLocale),
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
13
13
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { boxWith } from "svelte-toolbelt";
|
|
2
2
|
import { getBitsConfig } from "./bits-config.js";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a generic prop resolver that follows a standard priority chain:
|
|
@@ -9,7 +9,7 @@ import { getBitsConfig } from "./bits-config.js";
|
|
|
9
9
|
function createPropResolver(configOption, fallback) {
|
|
10
10
|
return (getProp) => {
|
|
11
11
|
const config = getBitsConfig();
|
|
12
|
-
return
|
|
12
|
+
return boxWith(() => {
|
|
13
13
|
// 1. return the prop's value, if provided
|
|
14
14
|
const propValue = getProp();
|
|
15
15
|
if (propValue !== undefined)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { DismissibleLayerImplProps } from "./types.js";
|
|
4
4
|
import { DismissibleLayerState } from "./use-dismissable-layer.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
}: DismissibleLayerImplProps = $props();
|
|
17
17
|
|
|
18
18
|
const dismissibleLayerState = DismissibleLayerState.create({
|
|
19
|
-
id:
|
|
20
|
-
interactOutsideBehavior:
|
|
21
|
-
onInteractOutside:
|
|
22
|
-
enabled:
|
|
23
|
-
onFocusOutside:
|
|
24
|
-
isValidEvent:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
interactOutsideBehavior: boxWith(() => interactOutsideBehavior),
|
|
21
|
+
onInteractOutside: boxWith(() => onInteractOutside),
|
|
22
|
+
enabled: boxWith(() => enabled),
|
|
23
|
+
onFocusOutside: boxWith(() => onFocusOutside),
|
|
24
|
+
isValidEvent: boxWith(() => isValidEvent),
|
|
25
25
|
ref,
|
|
26
26
|
});
|
|
27
27
|
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterSleep, afterTick, executeCallbacks, onDestroyEffect, } from "svelte-toolbelt";
|
|
2
2
|
import { watch } from "runed";
|
|
3
3
|
import { on } from "svelte/events";
|
|
4
|
-
import {
|
|
4
|
+
import {} from "../../../internal/events.js";
|
|
5
5
|
import { debounce } from "../../../internal/debounce.js";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
7
|
import { getOwnerDocument, isOrContainsTarget } from "../../../internal/elements.js";
|
|
@@ -121,8 +121,9 @@ export class DismissibleLayerState {
|
|
|
121
121
|
}
|
|
122
122
|
if (e.pointerType === "touch") {
|
|
123
123
|
this.#unsubClickListener();
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
this.#unsubClickListener = on(this.#documentObj, "click", this.#handleDismiss, {
|
|
125
|
+
once: true,
|
|
126
|
+
});
|
|
126
127
|
}
|
|
127
128
|
else {
|
|
128
129
|
this.#interactOutsideProp.current(event);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { EscapeLayerImplProps } from "./types.js";
|
|
4
4
|
import { EscapeLayerState } from "./use-escape-layer.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}: EscapeLayerImplProps = $props();
|
|
14
14
|
|
|
15
15
|
EscapeLayerState.create({
|
|
16
|
-
escapeKeydownBehavior:
|
|
17
|
-
onEscapeKeydown:
|
|
18
|
-
enabled:
|
|
16
|
+
escapeKeydownBehavior: boxWith(() => escapeKeydownBehavior),
|
|
17
|
+
onEscapeKeydown: boxWith(() => onEscapeKeydown),
|
|
18
|
+
enabled: boxWith(() => enabled),
|
|
19
19
|
ref,
|
|
20
20
|
});
|
|
21
21
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import { FloatingAnchorState } from "../use-floating-layer.svelte.js";
|
|
4
4
|
import type { AnchorProps } from "./index.js";
|
|
5
5
|
import type { Measurable } from "../../../../internal/floating-svelte/types.js";
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
FloatingAnchorState.create(
|
|
10
10
|
{
|
|
11
|
-
id:
|
|
12
|
-
virtualEl:
|
|
11
|
+
id: boxWith(() => id),
|
|
12
|
+
virtualEl: boxWith(() => virtualEl as unknown as Measurable | null),
|
|
13
13
|
ref,
|
|
14
14
|
},
|
|
15
15
|
tooltip
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { FloatingArrowState } from "../use-floating-layer.svelte.js";
|
|
4
4
|
import { Arrow, type ArrowProps } from "../../arrow/index.js";
|
|
5
5
|
import { useId } from "../../../../internal/use-id.js";
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
let { id = useId(), ref = $bindable(null), ...restProps }: ArrowProps = $props();
|
|
8
8
|
|
|
9
9
|
const arrowState = FloatingArrowState.create({
|
|
10
|
-
id:
|
|
11
|
-
ref:
|
|
10
|
+
id: boxWith(() => id),
|
|
11
|
+
ref: boxWith(
|
|
12
12
|
() => ref,
|
|
13
13
|
(v) => (ref = v)
|
|
14
14
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { FloatingContentState } from "../use-floating-layer.svelte.js";
|
|
4
4
|
import type { ContentImplProps } from "./index.js";
|
|
5
5
|
import { useId } from "../../../../internal/use-id.js";
|
|
@@ -30,25 +30,25 @@
|
|
|
30
30
|
|
|
31
31
|
const contentState = FloatingContentState.create(
|
|
32
32
|
{
|
|
33
|
-
side:
|
|
34
|
-
sideOffset:
|
|
35
|
-
align:
|
|
36
|
-
alignOffset:
|
|
37
|
-
id:
|
|
38
|
-
arrowPadding:
|
|
39
|
-
avoidCollisions:
|
|
40
|
-
collisionBoundary:
|
|
41
|
-
collisionPadding:
|
|
42
|
-
hideWhenDetached:
|
|
43
|
-
onPlaced:
|
|
44
|
-
sticky:
|
|
45
|
-
updatePositionStrategy:
|
|
46
|
-
strategy:
|
|
47
|
-
dir:
|
|
48
|
-
style:
|
|
49
|
-
enabled:
|
|
50
|
-
wrapperId:
|
|
51
|
-
customAnchor:
|
|
33
|
+
side: boxWith(() => side),
|
|
34
|
+
sideOffset: boxWith(() => sideOffset),
|
|
35
|
+
align: boxWith(() => align),
|
|
36
|
+
alignOffset: boxWith(() => alignOffset),
|
|
37
|
+
id: boxWith(() => id),
|
|
38
|
+
arrowPadding: boxWith(() => arrowPadding),
|
|
39
|
+
avoidCollisions: boxWith(() => avoidCollisions),
|
|
40
|
+
collisionBoundary: boxWith(() => collisionBoundary),
|
|
41
|
+
collisionPadding: boxWith(() => collisionPadding),
|
|
42
|
+
hideWhenDetached: boxWith(() => hideWhenDetached),
|
|
43
|
+
onPlaced: boxWith(() => onPlaced),
|
|
44
|
+
sticky: boxWith(() => sticky),
|
|
45
|
+
updatePositionStrategy: boxWith(() => updatePositionStrategy),
|
|
46
|
+
strategy: boxWith(() => strategy),
|
|
47
|
+
dir: boxWith(() => dir),
|
|
48
|
+
style: boxWith(() => style),
|
|
49
|
+
enabled: boxWith(() => enabled),
|
|
50
|
+
wrapperId: boxWith(() => wrapperId),
|
|
51
|
+
customAnchor: boxWith(() => customAnchor),
|
|
52
52
|
},
|
|
53
53
|
tooltip
|
|
54
54
|
);
|
|
@@ -64,7 +64,7 @@ export declare class FloatingContentState {
|
|
|
64
64
|
middleware: Middleware[];
|
|
65
65
|
floating: UseFloatingReturn;
|
|
66
66
|
placedSide: "left" | "right" | "top" | "bottom";
|
|
67
|
-
placedAlign: "
|
|
67
|
+
placedAlign: "center" | "end" | "start";
|
|
68
68
|
arrowX: number;
|
|
69
69
|
arrowY: number;
|
|
70
70
|
cannotCenterArrow: boolean;
|
|
@@ -910,7 +910,7 @@ export declare class FloatingContentState {
|
|
|
910
910
|
};
|
|
911
911
|
props: {
|
|
912
912
|
readonly "data-side": "left" | "right" | "top" | "bottom";
|
|
913
|
-
readonly "data-align": "
|
|
913
|
+
readonly "data-align": "center" | "end" | "start";
|
|
914
914
|
readonly style: string;
|
|
915
915
|
};
|
|
916
916
|
arrowStyle: {
|
|
@@ -958,5 +958,5 @@ export declare class FloatingAnchorState {
|
|
|
958
958
|
constructor(opts: FloatingAnchorStateOpts, root: FloatingRootState);
|
|
959
959
|
}
|
|
960
960
|
export declare function getSideFromPlacement(placement: Placement): "left" | "right" | "top" | "bottom";
|
|
961
|
-
export declare function getAlignFromPlacement(placement: Placement): "
|
|
961
|
+
export declare function getAlignFromPlacement(placement: Placement): "center" | "end" | "start";
|
|
962
962
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { arrow, autoUpdate, flip, hide, limitShift, offset, shift, size, } from "@floating-ui/dom";
|
|
2
|
-
import { attachRef,
|
|
2
|
+
import { attachRef, cssToStyleObj, getWindow, styleToString, simpleBox, boxFrom, } from "svelte-toolbelt";
|
|
3
3
|
import { Context, ElementSize, watch } from "runed";
|
|
4
4
|
import { isNotNull } from "../../../internal/is.js";
|
|
5
5
|
import { useId } from "../../../internal/use-id.js";
|
|
@@ -21,9 +21,9 @@ export class FloatingRootState {
|
|
|
21
21
|
? FloatingTooltipRootContext.set(new FloatingRootState())
|
|
22
22
|
: FloatingRootContext.set(new FloatingRootState());
|
|
23
23
|
}
|
|
24
|
-
anchorNode =
|
|
25
|
-
customAnchorNode =
|
|
26
|
-
triggerNode =
|
|
24
|
+
anchorNode = simpleBox(null);
|
|
25
|
+
customAnchorNode = simpleBox(null);
|
|
26
|
+
triggerNode = simpleBox(null);
|
|
27
27
|
constructor() {
|
|
28
28
|
$effect(() => {
|
|
29
29
|
if (this.customAnchorNode.current) {
|
|
@@ -49,14 +49,14 @@ export class FloatingContentState {
|
|
|
49
49
|
opts;
|
|
50
50
|
root;
|
|
51
51
|
// nodes
|
|
52
|
-
contentRef =
|
|
53
|
-
wrapperRef =
|
|
54
|
-
arrowRef =
|
|
52
|
+
contentRef = simpleBox(null);
|
|
53
|
+
wrapperRef = simpleBox(null);
|
|
54
|
+
arrowRef = simpleBox(null);
|
|
55
55
|
contentAttachment = attachRef(this.contentRef);
|
|
56
56
|
wrapperAttachment = attachRef(this.wrapperRef);
|
|
57
57
|
arrowAttachment = attachRef(this.arrowRef);
|
|
58
58
|
// ids
|
|
59
|
-
arrowId =
|
|
59
|
+
arrowId = simpleBox(useId());
|
|
60
60
|
#transformedStyle = $derived.by(() => {
|
|
61
61
|
if (typeof this.opts.style === "string")
|
|
62
62
|
return cssToStyleObj(this.opts.style);
|
|
@@ -247,7 +247,7 @@ export class FloatingAnchorState {
|
|
|
247
247
|
this.opts = opts;
|
|
248
248
|
this.root = root;
|
|
249
249
|
if (opts.virtualEl && opts.virtualEl.current) {
|
|
250
|
-
root.triggerNode =
|
|
250
|
+
root.triggerNode = boxFrom(opts.virtualEl.current);
|
|
251
251
|
}
|
|
252
252
|
else {
|
|
253
253
|
root.triggerNode = opts.ref;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { simpleBox } from "svelte-toolbelt";
|
|
2
2
|
import { FocusScope } from "./focus-scope.svelte.js";
|
|
3
3
|
export class FocusScopeManager {
|
|
4
4
|
static instance;
|
|
5
|
-
#scopeStack =
|
|
5
|
+
#scopeStack = simpleBox([]);
|
|
6
6
|
#focusHistory = new WeakMap();
|
|
7
7
|
#preFocusHistory = new WeakMap();
|
|
8
8
|
static getInstance() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { FocusScopeImplProps } from "./types.js";
|
|
4
4
|
import { noop } from "../../../internal/noop.js";
|
|
5
5
|
import { FocusScope } from "./focus-scope.svelte.js";
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
}: FocusScopeImplProps = $props();
|
|
16
16
|
|
|
17
17
|
const focusScopeState = FocusScope.use({
|
|
18
|
-
enabled:
|
|
19
|
-
trap:
|
|
18
|
+
enabled: boxWith(() => enabled),
|
|
19
|
+
trap: boxWith(() => trapFocus),
|
|
20
20
|
loop: loop,
|
|
21
|
-
onCloseAutoFocus:
|
|
22
|
-
onOpenAutoFocus:
|
|
21
|
+
onCloseAutoFocus: boxWith(() => onCloseAutoFocus),
|
|
22
|
+
onOpenAutoFocus: boxWith(() => onOpenAutoFocus),
|
|
23
23
|
ref,
|
|
24
24
|
});
|
|
25
25
|
</script>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { PresenceLayerImplProps } from "./types.js";
|
|
4
4
|
import { Presence } from "./presence.svelte.js";
|
|
5
5
|
|
|
6
6
|
let { open, forceMount, presence, ref }: PresenceLayerImplProps = $props();
|
|
7
7
|
|
|
8
8
|
const presenceState = new Presence({
|
|
9
|
-
open:
|
|
9
|
+
open: boxWith(() => open),
|
|
10
10
|
ref,
|
|
11
11
|
});
|
|
12
12
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith } from "svelte-toolbelt";
|
|
3
3
|
import type { TextSelectionLayerImplProps } from "./types.js";
|
|
4
4
|
import { TextSelectionLayerState } from "./use-text-selection-layer.svelte.js";
|
|
5
5
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
}: TextSelectionLayerImplProps = $props();
|
|
16
16
|
|
|
17
17
|
TextSelectionLayerState.create({
|
|
18
|
-
id:
|
|
19
|
-
onPointerDown:
|
|
20
|
-
onPointerUp:
|
|
21
|
-
enabled:
|
|
18
|
+
id: boxWith(() => id),
|
|
19
|
+
onPointerDown: boxWith(() => onPointerDown),
|
|
20
|
+
onPointerUp: boxWith(() => onPointerUp),
|
|
21
|
+
enabled: boxWith(() => enabled && preventOverflowTextSelection),
|
|
22
22
|
ref,
|
|
23
23
|
});
|
|
24
24
|
</script>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Accordion, AlertDialog, AspectRatio, Avatar, BitsConfig, Button, Calendar, Checkbox, Collapsible, Combobox, Command, ContextMenu, DateField, DatePicker, DateRangeField, DateRangePicker, Dialog, DropdownMenu, Label, LinkPreview, Menubar, Meter, NavigationMenu, Pagination, PinInput, Popover, Progress, RadioGroup, RangeCalendar, RatingGroup
|
|
1
|
+
export { Accordion, AlertDialog, AspectRatio, Avatar, BitsConfig, Button, Calendar, Checkbox, Collapsible, Combobox, Command, ContextMenu, DateField, DatePicker, DateRangeField, DateRangePicker, Dialog, DropdownMenu, Label, LinkPreview, Menubar, Meter, NavigationMenu, Pagination, PinInput, Popover, Progress, RadioGroup, RangeCalendar, RatingGroup, ScrollArea, Select, Separator, Slider, Switch, Tabs, TimeField, TimeRangeField, Toggle, ToggleGroup, Toolbar, Tooltip, Portal, IsUsingKeyboard, computeCommandScore, getBitsConfig, } from "./bits/index.js";
|
|
2
2
|
export * from "./shared/index.js";
|
|
3
3
|
export type * from "./shared/index.js";
|
|
4
4
|
export * from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Accordion, AlertDialog, AspectRatio, Avatar, BitsConfig, Button, Calendar, Checkbox, Collapsible, Combobox, Command, ContextMenu, DateField, DatePicker, DateRangeField, DateRangePicker, Dialog, DropdownMenu, Label, LinkPreview, Menubar, Meter, NavigationMenu, Pagination, PinInput, Popover, Progress, RadioGroup, RangeCalendar, RatingGroup
|
|
1
|
+
export { Accordion, AlertDialog, AspectRatio, Avatar, BitsConfig, Button, Calendar, Checkbox, Collapsible, Combobox, Command, ContextMenu, DateField, DatePicker, DateRangeField, DateRangePicker, Dialog, DropdownMenu, Label, LinkPreview, Menubar, Meter, NavigationMenu, Pagination, PinInput, Popover, Progress, RadioGroup, RangeCalendar, RatingGroup, ScrollArea, Select, Separator, Slider, Switch, Tabs, TimeField, TimeRangeField, Toggle, ToggleGroup, Toolbar, Tooltip, Portal, IsUsingKeyboard, computeCommandScore, getBitsConfig, } from "./bits/index.js";
|
|
2
2
|
export * from "./shared/index.js";
|
|
3
3
|
export * from "./types.js";
|
package/dist/internal/attrs.d.ts
CHANGED
|
@@ -1,25 +1,10 @@
|
|
|
1
|
+
export declare function boolToStr(condition: boolean): "true" | "false";
|
|
2
|
+
export declare function boolToStrTrueOrUndef(condition: boolean): "true" | undefined;
|
|
3
|
+
export declare function boolToEmptyStrOrUndef(condition: boolean): "" | undefined;
|
|
4
|
+
export declare function boolToTrueOrUndef(condition: boolean): true | undefined;
|
|
1
5
|
export declare function getDataOpenClosed(condition: boolean): "open" | "closed";
|
|
2
6
|
export declare function getDataChecked(condition: boolean): "checked" | "unchecked";
|
|
3
|
-
export declare function getAriaDisabled(condition: boolean): "true" | "false";
|
|
4
|
-
export declare function getAriaReadonly(condition: boolean): "true" | "false";
|
|
5
|
-
export declare function getAriaExpanded(condition: boolean): "true" | "false";
|
|
6
|
-
export declare function getDataDisabled(condition: boolean): "" | undefined;
|
|
7
|
-
export declare function getAriaRequired(condition: boolean): "true" | "false";
|
|
8
|
-
export declare function getAriaSelected(condition: boolean): "true" | "false";
|
|
9
7
|
export declare function getAriaChecked(checked: boolean, indeterminate: boolean): "true" | "false" | "mixed";
|
|
10
|
-
export declare function getAriaOrientation(orientation: "horizontal" | "vertical"): "horizontal" | "vertical";
|
|
11
|
-
export declare function getAriaHidden(condition: boolean): "true" | undefined;
|
|
12
|
-
export declare function getAriaInvalid(condition: boolean): "true" | undefined;
|
|
13
|
-
export declare function getDataOrientation(orientation: "horizontal" | "vertical"): "horizontal" | "vertical";
|
|
14
|
-
export declare function getDataInvalid(condition: boolean): "" | undefined;
|
|
15
|
-
export declare function getDataRequired(condition: boolean): "" | undefined;
|
|
16
|
-
export declare function getDataReadonly(condition: boolean): "" | undefined;
|
|
17
|
-
export declare function getDataSelected(condition: boolean): "" | undefined;
|
|
18
|
-
export declare function getDataUnavailable(condition: boolean): "" | undefined;
|
|
19
|
-
export declare function getHidden(condition: boolean): true | undefined;
|
|
20
|
-
export declare function getDisabled(condition: boolean): true | undefined;
|
|
21
|
-
export declare function getAriaPressed(condition: boolean): "true" | "false";
|
|
22
|
-
export declare function getRequired(condition: boolean): true | undefined;
|
|
23
8
|
export type BitsAttrsConfig<T extends readonly string[]> = {
|
|
24
9
|
component: string;
|
|
25
10
|
parts: T;
|
package/dist/internal/attrs.js
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
export function
|
|
2
|
-
return condition ? "open" : "closed";
|
|
3
|
-
}
|
|
4
|
-
export function getDataChecked(condition) {
|
|
5
|
-
return condition ? "checked" : "unchecked";
|
|
6
|
-
}
|
|
7
|
-
export function getAriaDisabled(condition) {
|
|
1
|
+
export function boolToStr(condition) {
|
|
8
2
|
return condition ? "true" : "false";
|
|
9
3
|
}
|
|
10
|
-
export function
|
|
11
|
-
return condition ? "true" :
|
|
12
|
-
}
|
|
13
|
-
export function getAriaExpanded(condition) {
|
|
14
|
-
return condition ? "true" : "false";
|
|
4
|
+
export function boolToStrTrueOrUndef(condition) {
|
|
5
|
+
return condition ? "true" : undefined;
|
|
15
6
|
}
|
|
16
|
-
export function
|
|
7
|
+
export function boolToEmptyStrOrUndef(condition) {
|
|
17
8
|
return condition ? "" : undefined;
|
|
18
9
|
}
|
|
19
|
-
export function
|
|
20
|
-
return condition ?
|
|
10
|
+
export function boolToTrueOrUndef(condition) {
|
|
11
|
+
return condition ? true : undefined;
|
|
21
12
|
}
|
|
22
|
-
export function
|
|
23
|
-
return condition ? "
|
|
13
|
+
export function getDataOpenClosed(condition) {
|
|
14
|
+
return condition ? "open" : "closed";
|
|
15
|
+
}
|
|
16
|
+
export function getDataChecked(condition) {
|
|
17
|
+
return condition ? "checked" : "unchecked";
|
|
24
18
|
}
|
|
25
19
|
export function getAriaChecked(checked, indeterminate) {
|
|
26
20
|
if (indeterminate) {
|
|
@@ -28,45 +22,6 @@ export function getAriaChecked(checked, indeterminate) {
|
|
|
28
22
|
}
|
|
29
23
|
return checked ? "true" : "false";
|
|
30
24
|
}
|
|
31
|
-
export function getAriaOrientation(orientation) {
|
|
32
|
-
return orientation;
|
|
33
|
-
}
|
|
34
|
-
export function getAriaHidden(condition) {
|
|
35
|
-
return condition ? "true" : undefined;
|
|
36
|
-
}
|
|
37
|
-
export function getAriaInvalid(condition) {
|
|
38
|
-
return condition ? "true" : undefined;
|
|
39
|
-
}
|
|
40
|
-
export function getDataOrientation(orientation) {
|
|
41
|
-
return orientation;
|
|
42
|
-
}
|
|
43
|
-
export function getDataInvalid(condition) {
|
|
44
|
-
return condition ? "" : undefined;
|
|
45
|
-
}
|
|
46
|
-
export function getDataRequired(condition) {
|
|
47
|
-
return condition ? "" : undefined;
|
|
48
|
-
}
|
|
49
|
-
export function getDataReadonly(condition) {
|
|
50
|
-
return condition ? "" : undefined;
|
|
51
|
-
}
|
|
52
|
-
export function getDataSelected(condition) {
|
|
53
|
-
return condition ? "" : undefined;
|
|
54
|
-
}
|
|
55
|
-
export function getDataUnavailable(condition) {
|
|
56
|
-
return condition ? "" : undefined;
|
|
57
|
-
}
|
|
58
|
-
export function getHidden(condition) {
|
|
59
|
-
return condition ? true : undefined;
|
|
60
|
-
}
|
|
61
|
-
export function getDisabled(condition) {
|
|
62
|
-
return condition ? true : undefined;
|
|
63
|
-
}
|
|
64
|
-
export function getAriaPressed(condition) {
|
|
65
|
-
return condition ? "true" : "false";
|
|
66
|
-
}
|
|
67
|
-
export function getRequired(condition) {
|
|
68
|
-
return condition ? true : undefined;
|
|
69
|
-
}
|
|
70
25
|
export class BitsAttrs {
|
|
71
26
|
#variant;
|
|
72
27
|
#prefix;
|