bits-ui 1.7.0 → 2.1.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 +56 -53
- package/dist/bits/accordion/accordion.svelte.js +78 -89
- package/dist/bits/accordion/components/accordion-content.svelte +5 -3
- package/dist/bits/accordion/components/accordion-header.svelte +4 -2
- package/dist/bits/accordion/components/accordion-item.svelte +6 -3
- package/dist/bits/accordion/components/accordion-trigger.svelte +4 -2
- package/dist/bits/accordion/components/accordion.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-action.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte +4 -2
- package/dist/bits/alert-dialog/components/alert-dialog-content.svelte +8 -3
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.js +2 -2
- package/dist/bits/aspect-ratio/components/aspect-ratio.svelte +4 -2
- package/dist/bits/avatar/avatar.svelte.js +4 -4
- package/dist/bits/avatar/components/avatar-fallback.svelte +4 -2
- package/dist/bits/avatar/components/avatar-image.svelte +4 -2
- package/dist/bits/avatar/components/avatar.svelte +4 -2
- package/dist/bits/button/components/button.svelte +1 -1
- package/dist/bits/calendar/calendar.svelte.d.ts +1 -9
- package/dist/bits/calendar/calendar.svelte.js +47 -38
- package/dist/bits/calendar/components/calendar-cell.svelte +4 -2
- package/dist/bits/calendar/components/calendar-day.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-body.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-head.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid-row.svelte +4 -2
- package/dist/bits/calendar/components/calendar-grid.svelte +4 -2
- package/dist/bits/calendar/components/calendar-head-cell.svelte +4 -2
- package/dist/bits/calendar/components/calendar-header.svelte +4 -2
- package/dist/bits/calendar/components/calendar-heading.svelte +4 -2
- package/dist/bits/calendar/components/calendar-next-button.svelte +4 -2
- package/dist/bits/calendar/components/calendar-prev-button.svelte +4 -2
- package/dist/bits/checkbox/checkbox.svelte.js +4 -14
- package/dist/bits/checkbox/components/checkbox-group-label.svelte +4 -2
- package/dist/bits/checkbox/components/checkbox-group.svelte +4 -2
- package/dist/bits/checkbox/components/checkbox.svelte +4 -2
- package/dist/bits/collapsible/collapsible.svelte.js +4 -10
- package/dist/bits/collapsible/components/collapsible-content.svelte +5 -3
- package/dist/bits/collapsible/components/collapsible-trigger.svelte +4 -2
- package/dist/bits/collapsible/components/collapsible.svelte +4 -2
- package/dist/bits/combobox/components/combobox-input.svelte +1 -1
- package/dist/bits/combobox/components/combobox.svelte +1 -1
- package/dist/bits/command/command.svelte.js +13 -45
- package/dist/bits/command/components/_command-label.svelte +6 -7
- package/dist/bits/command/components/_command-label.svelte.d.ts +1 -1
- package/dist/bits/command/components/command-empty.svelte +4 -2
- package/dist/bits/command/components/command-group-heading.svelte +4 -2
- package/dist/bits/command/components/command-group-items.svelte +4 -2
- package/dist/bits/command/components/command-group.svelte +4 -2
- package/dist/bits/command/components/command-input.svelte +4 -2
- package/dist/bits/command/components/command-item.svelte +4 -2
- package/dist/bits/command/components/command-link-item.svelte +4 -2
- package/dist/bits/command/components/command-list.svelte +4 -2
- package/dist/bits/command/components/command-loading.svelte +4 -2
- package/dist/bits/command/components/command-separator.svelte +4 -2
- package/dist/bits/command/components/command-viewport.svelte +4 -2
- package/dist/bits/command/components/command.svelte +4 -2
- package/dist/bits/context-menu/components/context-menu-content-static.svelte +2 -3
- package/dist/bits/context-menu/components/context-menu-content.svelte +2 -3
- package/dist/bits/context-menu/components/context-menu-trigger.svelte +1 -1
- package/dist/bits/date-field/components/date-field-input.svelte +4 -2
- package/dist/bits/date-field/components/date-field-label.svelte +4 -2
- package/dist/bits/date-field/components/date-field-segment.svelte +4 -2
- package/dist/bits/date-field/date-field.svelte.d.ts +4 -4
- package/dist/bits/date-field/date-field.svelte.js +15 -33
- package/dist/bits/date-picker/components/date-picker-calendar.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field-input.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field-label.svelte +4 -2
- package/dist/bits/date-range-field/components/date-range-field.svelte +4 -2
- package/dist/bits/date-range-field/date-range-field.svelte.js +3 -13
- package/dist/bits/date-range-picker/components/date-range-picker-calendar.svelte +4 -2
- package/dist/bits/dialog/components/dialog-close.svelte +4 -2
- package/dist/bits/dialog/components/dialog-content.svelte +8 -2
- package/dist/bits/dialog/components/dialog-description.svelte +4 -2
- package/dist/bits/dialog/components/dialog-overlay.svelte +8 -3
- package/dist/bits/dialog/components/dialog-title.svelte +4 -2
- package/dist/bits/dialog/components/dialog-trigger.svelte +4 -2
- package/dist/bits/dialog/dialog.svelte.d.ts +1 -1
- package/dist/bits/dialog/dialog.svelte.js +19 -47
- package/dist/bits/dropdown-menu/components/dropdown-menu-content-static.svelte +6 -5
- package/dist/bits/dropdown-menu/components/dropdown-menu-content.svelte +6 -5
- package/dist/bits/index.d.ts +2 -0
- package/dist/bits/index.js +2 -0
- package/dist/bits/label/components/label.svelte +4 -2
- package/dist/bits/label/label.svelte.js +2 -2
- package/dist/bits/link-preview/components/link-preview-content-static.svelte +6 -2
- package/dist/bits/link-preview/components/link-preview-content.svelte +6 -2
- package/dist/bits/link-preview/components/link-preview-trigger.svelte +5 -3
- package/dist/bits/link-preview/link-preview.svelte.js +3 -14
- package/dist/bits/menu/components/menu-checkbox-group.svelte +4 -2
- package/dist/bits/menu/components/menu-checkbox-item.svelte +6 -4
- package/dist/bits/menu/components/menu-content-static.svelte +6 -5
- package/dist/bits/menu/components/menu-content.svelte +6 -5
- package/dist/bits/menu/components/menu-group-heading.svelte +4 -2
- package/dist/bits/menu/components/menu-group.svelte +4 -2
- package/dist/bits/menu/components/menu-item.svelte +4 -2
- package/dist/bits/menu/components/menu-radio-group.svelte +4 -2
- package/dist/bits/menu/components/menu-radio-item.svelte +4 -2
- package/dist/bits/menu/components/menu-separator.svelte +4 -2
- package/dist/bits/menu/components/menu-sub-content-static.svelte +6 -5
- package/dist/bits/menu/components/menu-sub-content.svelte +6 -5
- package/dist/bits/menu/components/menu-sub-trigger.svelte +6 -3
- package/dist/bits/menu/components/menu-trigger.svelte +5 -3
- package/dist/bits/menu/menu.svelte.d.ts +7 -20
- package/dist/bits/menu/menu.svelte.js +26 -54
- package/dist/bits/menubar/components/menubar-content-static.svelte +4 -2
- package/dist/bits/menubar/components/menubar-content.svelte +4 -2
- package/dist/bits/menubar/components/menubar-menu.svelte +4 -2
- package/dist/bits/menubar/components/menubar-trigger.svelte +14 -6
- package/dist/bits/menubar/components/menubar.svelte +4 -2
- package/dist/bits/menubar/menubar.svelte.d.ts +24 -20
- package/dist/bits/menubar/menubar.svelte.js +40 -56
- package/dist/bits/meter/components/meter.svelte +4 -2
- package/dist/bits/meter/meter.svelte.js +2 -2
- package/dist/bits/navigation-menu/components/navigation-menu-content-impl.svelte +5 -2
- package/dist/bits/navigation-menu/components/navigation-menu-content.svelte +8 -3
- package/dist/bits/navigation-menu/components/navigation-menu-indicator-impl.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-indicator.svelte +6 -4
- package/dist/bits/navigation-menu/components/navigation-menu-item.svelte +8 -3
- package/dist/bits/navigation-menu/components/navigation-menu-link.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-list.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-sub.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-trigger.svelte +4 -2
- package/dist/bits/navigation-menu/components/navigation-menu-viewport.svelte +7 -3
- package/dist/bits/navigation-menu/components/navigation-menu.svelte +4 -2
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +29 -17
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +107 -74
- package/dist/bits/navigation-menu/types.d.ts +14 -7
- package/dist/bits/pagination/components/pagination-next-button.svelte +4 -2
- package/dist/bits/pagination/components/pagination-page.svelte +4 -2
- package/dist/bits/pagination/components/pagination-prev-button.svelte +4 -2
- package/dist/bits/pagination/components/pagination.svelte +4 -2
- package/dist/bits/pagination/pagination.svelte.js +4 -4
- package/dist/bits/pin-input/components/pin-input-cell.svelte +4 -2
- package/dist/bits/pin-input/components/pin-input.svelte +5 -3
- package/dist/bits/pin-input/pin-input.svelte.js +4 -10
- package/dist/bits/popover/components/popover-close.svelte +4 -2
- package/dist/bits/popover/components/popover-content-static.svelte +6 -2
- package/dist/bits/popover/components/popover-content.svelte +6 -2
- package/dist/bits/popover/components/popover-trigger.svelte +5 -3
- package/dist/bits/popover/popover.svelte.js +4 -18
- package/dist/bits/progress/components/progress.svelte +4 -2
- package/dist/bits/progress/progress.svelte.js +2 -2
- package/dist/bits/radio-group/components/radio-group-item.svelte +4 -2
- package/dist/bits/radio-group/components/radio-group.svelte +4 -2
- package/dist/bits/radio-group/radio-group.svelte.js +4 -7
- package/dist/bits/range-calendar/components/range-calendar-cell.svelte +4 -2
- package/dist/bits/range-calendar/components/range-calendar-day.svelte +4 -2
- package/dist/bits/range-calendar/components/range-calendar.svelte +4 -2
- package/dist/bits/range-calendar/range-calendar.svelte.js +4 -4
- package/dist/bits/scroll-area/components/scroll-area-corner.svelte +8 -2
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-auto.svelte +4 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-hover.svelte +1 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar-scroll.svelte +5 -1
- package/dist/bits/scroll-area/components/scroll-area-scrollbar.svelte +4 -2
- package/dist/bits/scroll-area/components/scroll-area-thumb.svelte +8 -3
- package/dist/bits/scroll-area/components/scroll-area-viewport.svelte +4 -2
- package/dist/bits/scroll-area/components/scroll-area.svelte +4 -2
- package/dist/bits/scroll-area/scroll-area.svelte.js +13 -47
- package/dist/bits/select/components/select-content-static.svelte +6 -2
- package/dist/bits/select/components/select-content.svelte +6 -2
- package/dist/bits/select/components/select-group-heading.svelte +3 -2
- package/dist/bits/select/components/select-group.svelte +4 -2
- package/dist/bits/select/components/select-item.svelte +4 -2
- package/dist/bits/select/components/select-scroll-down-button.svelte +4 -2
- package/dist/bits/select/components/select-scroll-up-button.svelte +4 -2
- package/dist/bits/select/components/select-trigger.svelte +5 -3
- package/dist/bits/select/components/select-viewport.svelte +4 -2
- package/dist/bits/select/components/select.svelte +1 -1
- package/dist/bits/select/select.svelte.d.ts +0 -18
- package/dist/bits/select/select.svelte.js +10 -43
- package/dist/bits/separator/components/separator.svelte +4 -2
- package/dist/bits/separator/separator.svelte.js +2 -2
- package/dist/bits/slider/components/slider-range.svelte +4 -2
- package/dist/bits/slider/components/slider-thumb-label.svelte +50 -0
- package/dist/bits/slider/components/slider-thumb-label.svelte.d.ts +4 -0
- package/dist/bits/slider/components/slider-thumb.svelte +4 -2
- package/dist/bits/slider/components/slider-tick-label.svelte +50 -0
- package/dist/bits/slider/components/slider-tick-label.svelte.d.ts +4 -0
- package/dist/bits/slider/components/slider-tick.svelte +4 -2
- package/dist/bits/slider/components/slider.svelte +26 -5
- package/dist/bits/slider/exports.d.ts +3 -1
- package/dist/bits/slider/exports.js +2 -0
- package/dist/bits/slider/helpers.d.ts +14 -0
- package/dist/bits/slider/helpers.js +122 -0
- package/dist/bits/slider/slider.svelte.d.ts +93 -6
- package/dist/bits/slider/slider.svelte.js +198 -101
- package/dist/bits/slider/types.d.ts +111 -11
- package/dist/bits/switch/components/switch-thumb.svelte +4 -2
- package/dist/bits/switch/components/switch.svelte +4 -2
- package/dist/bits/switch/switch.svelte.js +3 -3
- package/dist/bits/tabs/components/tabs-content.svelte +4 -2
- package/dist/bits/tabs/components/tabs-list.svelte +4 -2
- package/dist/bits/tabs/components/tabs-trigger.svelte +4 -2
- package/dist/bits/tabs/components/tabs.svelte +4 -2
- package/dist/bits/tabs/tabs.svelte.js +6 -6
- package/dist/bits/time-field/components/time-field-hidden-input.svelte +10 -0
- package/dist/bits/{date-field/components/date-field-error.svelte.d.ts → time-field/components/time-field-hidden-input.svelte.d.ts} +6 -14
- package/dist/bits/time-field/components/time-field-input.svelte +39 -0
- package/dist/bits/time-field/components/time-field-input.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field-label.svelte +34 -0
- package/dist/bits/time-field/components/time-field-label.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field-segment.svelte +37 -0
- package/dist/bits/time-field/components/time-field-segment.svelte.d.ts +4 -0
- package/dist/bits/time-field/components/time-field.svelte +94 -0
- package/dist/bits/time-field/components/time-field.svelte.d.ts +20 -0
- package/dist/bits/time-field/exports.d.ts +5 -0
- package/dist/bits/time-field/exports.js +4 -0
- package/dist/bits/time-field/index.d.ts +1 -0
- package/dist/bits/time-field/index.js +1 -0
- package/dist/bits/time-field/time-field.svelte.d.ts +415 -0
- package/dist/bits/time-field/time-field.svelte.js +971 -0
- package/dist/bits/time-field/types.d.ts +137 -0
- package/dist/bits/time-field/types.js +1 -0
- package/dist/bits/time-range-field/components/time-range-field-input.svelte +43 -0
- package/dist/bits/time-range-field/components/time-range-field-input.svelte.d.ts +4 -0
- package/dist/bits/time-range-field/components/time-range-field-label.svelte +34 -0
- package/dist/bits/time-range-field/components/time-range-field-label.svelte.d.ts +4 -0
- package/dist/bits/time-range-field/components/time-range-field.svelte +144 -0
- package/dist/bits/time-range-field/components/time-range-field.svelte.d.ts +20 -0
- package/dist/bits/time-range-field/exports.d.ts +5 -0
- package/dist/bits/time-range-field/exports.js +4 -0
- package/dist/bits/time-range-field/index.d.ts +1 -0
- package/dist/bits/time-range-field/index.js +1 -0
- package/dist/bits/time-range-field/time-range-field.svelte.d.ts +90 -0
- package/dist/bits/time-range-field/time-range-field.svelte.js +210 -0
- package/dist/bits/time-range-field/types.d.ts +150 -0
- package/dist/bits/time-range-field/types.js +1 -0
- package/dist/bits/toggle/components/toggle.svelte +4 -2
- package/dist/bits/toggle/toggle.svelte.js +2 -2
- package/dist/bits/toggle-group/components/toggle-group-item.svelte +4 -2
- package/dist/bits/toggle-group/components/toggle-group.svelte +4 -2
- package/dist/bits/toggle-group/toggle-group.svelte.js +4 -4
- package/dist/bits/toolbar/components/toolbar-button.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-group-item.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-group.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar-link.svelte +4 -2
- package/dist/bits/toolbar/components/toolbar.svelte +4 -2
- package/dist/bits/toolbar/toolbar.svelte.js +7 -7
- package/dist/bits/tooltip/components/tooltip-content-static.svelte +6 -2
- package/dist/bits/tooltip/components/tooltip-content.svelte +6 -2
- package/dist/bits/tooltip/components/tooltip-trigger.svelte +5 -3
- package/dist/bits/tooltip/tooltip.svelte.js +3 -14
- package/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte +2 -0
- package/dist/bits/utilities/dismissible-layer/types.d.ts +2 -0
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.d.ts +3 -3
- package/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js +16 -25
- package/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte +2 -1
- package/dist/bits/utilities/floating-layer/types.d.ts +1 -0
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.d.ts +3 -2
- package/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js +5 -26
- package/dist/bits/utilities/focus-scope/focus-scope.svelte +2 -0
- package/dist/bits/utilities/focus-scope/types.d.ts +2 -0
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.d.ts +2 -1
- package/dist/bits/utilities/focus-scope/use-focus-scope.svelte.js +2 -8
- package/dist/bits/utilities/popper-layer/popper-layer-inner.svelte +4 -0
- package/dist/bits/utilities/popper-layer/popper-layer.svelte +3 -1
- package/dist/bits/utilities/presence-layer/presence-layer.svelte +2 -2
- package/dist/bits/utilities/presence-layer/types.d.ts +2 -1
- package/dist/bits/utilities/presence-layer/use-presence.svelte.d.ts +1 -1
- package/dist/bits/utilities/presence-layer/use-presence.svelte.js +19 -36
- package/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte +2 -0
- package/dist/bits/utilities/text-selection-layer/types.d.ts +2 -0
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.d.ts +3 -1
- package/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js +2 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/create-id.d.ts +8 -0
- package/dist/internal/create-id.js +5 -0
- package/dist/internal/date-time/field/helpers.d.ts +1 -0
- package/dist/internal/date-time/field/helpers.js +8 -2
- package/dist/internal/date-time/field/parts.d.ts +3 -1
- package/dist/internal/date-time/field/parts.js +10 -2
- package/dist/internal/date-time/field/segments.d.ts +9 -0
- package/dist/internal/date-time/field/segments.js +65 -0
- package/dist/internal/date-time/field/time-helpers.d.ts +77 -0
- package/dist/internal/date-time/field/time-helpers.js +301 -0
- package/dist/internal/date-time/field/types.d.ts +2 -2
- package/dist/internal/date-time/formatter.d.ts +11 -1
- package/dist/internal/date-time/formatter.js +56 -0
- package/dist/internal/date-time/utils.d.ts +7 -2
- package/dist/internal/date-time/utils.js +15 -1
- package/dist/internal/dom-context.svelte.d.ts +9 -0
- package/dist/internal/dom-context.svelte.js +26 -0
- package/dist/internal/use-roving-focus.svelte.d.ts +3 -3
- package/dist/internal/use-roving-focus.svelte.js +10 -11
- package/dist/shared/date/types.d.ts +27 -4
- package/dist/shared/index.d.ts +9 -2
- package/dist/types.d.ts +2 -0
- package/package.json +18 -16
- package/dist/bits/date-field/components/date-field-error.svelte +0 -0
|
@@ -15,21 +15,22 @@ export type NavigationMenuRootPropsWithoutHTML = WithChild<{
|
|
|
15
15
|
*/
|
|
16
16
|
onValueChange?: OnChangeFn<string>;
|
|
17
17
|
/**
|
|
18
|
-
* The
|
|
18
|
+
* The amount of time in ms from when the mouse enters a trigger until the content opens.
|
|
19
19
|
*
|
|
20
|
-
* @
|
|
20
|
+
* @default 200
|
|
21
21
|
*/
|
|
22
22
|
delayDuration?: number;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* The amount of time in ms that a user has to enter another trigger without
|
|
25
|
+
* incurring a delay again.
|
|
25
26
|
*
|
|
26
|
-
* @
|
|
27
|
+
* @default 300
|
|
27
28
|
*/
|
|
28
29
|
skipDelayDuration?: number;
|
|
29
30
|
/**
|
|
30
31
|
* The reading direction of the content.
|
|
31
32
|
*
|
|
32
|
-
* @
|
|
33
|
+
* @default "ltr"
|
|
33
34
|
*/
|
|
34
35
|
dir?: Direction;
|
|
35
36
|
/**
|
|
@@ -68,6 +69,13 @@ export type NavigationMenuItemPropsWithoutHTML = WithChild<{
|
|
|
68
69
|
* The value of the menu item.
|
|
69
70
|
*/
|
|
70
71
|
value?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Whether to open the menu associated with the item when the item's trigger
|
|
74
|
+
* is hovered.
|
|
75
|
+
*
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
openOnHover?: boolean;
|
|
71
79
|
}>;
|
|
72
80
|
export type NavigationMenuItemProps = NavigationMenuItemPropsWithoutHTML & Without<BitsPrimitiveLiAttributes, NavigationMenuItemPropsWithoutHTML>;
|
|
73
81
|
export type NavigationMenuTriggerPropsWithoutHTML = WithChild<{
|
|
@@ -82,7 +90,6 @@ export type NavigationMenuContentPropsWithoutHTML = WithChild<{
|
|
|
82
90
|
/**
|
|
83
91
|
* Callback fired when an interaction occurs outside the content.
|
|
84
92
|
* Default behavior can be prevented with `event.preventDefault()`
|
|
85
|
-
*
|
|
86
93
|
*/
|
|
87
94
|
onInteractOutside?: (event: PointerEvent) => void;
|
|
88
95
|
/**
|
|
@@ -108,7 +115,7 @@ export type NavigationMenuContentPropsWithoutHTML = WithChild<{
|
|
|
108
115
|
* This is useful when wanting to use more custom transition and animation
|
|
109
116
|
* libraries.
|
|
110
117
|
*
|
|
111
|
-
* @
|
|
118
|
+
* @default false
|
|
112
119
|
*/
|
|
113
120
|
forceMount?: boolean;
|
|
114
121
|
}>;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PaginationNextButtonProps } from "../types.js";
|
|
4
4
|
import { usePaginationButton } from "../pagination.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
|
-
id =
|
|
10
|
+
id = createId(uid),
|
|
9
11
|
child,
|
|
10
12
|
children,
|
|
11
13
|
ref = $bindable(null),
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PaginationPageProps } from "../types.js";
|
|
4
4
|
import { usePaginationPage } from "../pagination.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
|
-
id =
|
|
10
|
+
id = createId(uid),
|
|
9
11
|
page,
|
|
10
12
|
child,
|
|
11
13
|
children,
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PaginationPrevButtonProps } from "../types.js";
|
|
4
4
|
import { usePaginationButton } from "../pagination.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
|
-
id =
|
|
10
|
+
id = createId(uid),
|
|
9
11
|
child,
|
|
10
12
|
children,
|
|
11
13
|
ref = $bindable(null),
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PaginationRootProps } from "../types.js";
|
|
4
4
|
import { usePaginationRoot } from "../pagination.svelte.js";
|
|
5
|
-
import { useId } from "../../../internal/use-id.js";
|
|
6
5
|
import { noop } from "../../../internal/noop.js";
|
|
6
|
+
import { createId } from "../../../internal/create-id.js";
|
|
7
|
+
|
|
8
|
+
const uid = $props.id();
|
|
7
9
|
|
|
8
10
|
let {
|
|
9
|
-
id =
|
|
11
|
+
id = createId(uid),
|
|
10
12
|
count,
|
|
11
13
|
perPage = 1,
|
|
12
14
|
page = $bindable(1),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
3
|
import { getDataOrientation } from "../../internal/attrs.js";
|
|
4
4
|
import { getElemDirection } from "../../internal/locale.js";
|
|
@@ -28,7 +28,6 @@ class PaginationRootState {
|
|
|
28
28
|
}));
|
|
29
29
|
constructor(opts) {
|
|
30
30
|
this.opts = opts;
|
|
31
|
-
useRefById(opts);
|
|
32
31
|
}
|
|
33
32
|
setPage(page) {
|
|
34
33
|
this.opts.page.current = page;
|
|
@@ -62,6 +61,7 @@ class PaginationRootState {
|
|
|
62
61
|
id: this.opts.id.current,
|
|
63
62
|
"data-orientation": getDataOrientation(this.opts.orientation.current),
|
|
64
63
|
[PAGINATION_ROOT_ATTR]: "",
|
|
64
|
+
...attachRef(this.opts.ref),
|
|
65
65
|
}));
|
|
66
66
|
}
|
|
67
67
|
class PaginationPageState {
|
|
@@ -71,7 +71,6 @@ class PaginationPageState {
|
|
|
71
71
|
constructor(opts, root) {
|
|
72
72
|
this.opts = opts;
|
|
73
73
|
this.root = root;
|
|
74
|
-
useRefById(opts);
|
|
75
74
|
this.onclick = this.onclick.bind(this);
|
|
76
75
|
this.onkeydown = this.onkeydown.bind(this);
|
|
77
76
|
}
|
|
@@ -100,6 +99,7 @@ class PaginationPageState {
|
|
|
100
99
|
//
|
|
101
100
|
onclick: this.onclick,
|
|
102
101
|
onkeydown: this.onkeydown,
|
|
102
|
+
...attachRef(this.opts.ref),
|
|
103
103
|
}));
|
|
104
104
|
}
|
|
105
105
|
class PaginationButtonState {
|
|
@@ -108,7 +108,6 @@ class PaginationButtonState {
|
|
|
108
108
|
constructor(opts, root) {
|
|
109
109
|
this.opts = opts;
|
|
110
110
|
this.root = root;
|
|
111
|
-
useRefById(opts);
|
|
112
111
|
this.onclick = this.onclick.bind(this);
|
|
113
112
|
this.onkeydown = this.onkeydown.bind(this);
|
|
114
113
|
}
|
|
@@ -148,6 +147,7 @@ class PaginationButtonState {
|
|
|
148
147
|
//
|
|
149
148
|
onclick: this.onclick,
|
|
150
149
|
onkeydown: this.onkeydown,
|
|
150
|
+
...attachRef(this.opts.ref),
|
|
151
151
|
}));
|
|
152
152
|
}
|
|
153
153
|
//
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PinInputCellProps } from "../types.js";
|
|
4
4
|
import { usePinInputCell } from "../pin-input.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
|
-
id =
|
|
10
|
+
id = createId(uid),
|
|
9
11
|
ref = $bindable(null),
|
|
10
12
|
cell,
|
|
11
13
|
child,
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PinInputRootProps } from "../types.js";
|
|
4
4
|
import { usePinInput } from "../pin-input.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
7
|
|
|
8
|
+
const uid = $props.id();
|
|
9
|
+
|
|
8
10
|
let {
|
|
9
|
-
id =
|
|
10
|
-
inputId =
|
|
11
|
+
id = createId(uid),
|
|
12
|
+
inputId = `${createId(uid)}-input`,
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
maxlength = 6,
|
|
13
15
|
textalign = "left",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Previous, watch } from "runed";
|
|
2
2
|
import { onMount } from "svelte";
|
|
3
|
-
import { box,
|
|
3
|
+
import { box, attachRef } from "svelte-toolbelt";
|
|
4
4
|
import { usePasswordManagerBadge } from "./usePasswordManager.svelte.js";
|
|
5
5
|
import { getDisabled } from "../../internal/attrs.js";
|
|
6
6
|
import { on } from "svelte/events";
|
|
@@ -60,11 +60,6 @@ class PinInputRootState {
|
|
|
60
60
|
isFocused: this.#isFocused,
|
|
61
61
|
pushPasswordManagerStrategy: this.opts.pushPasswordManagerStrategy,
|
|
62
62
|
});
|
|
63
|
-
useRefById(opts);
|
|
64
|
-
useRefById({
|
|
65
|
-
id: this.opts.inputId,
|
|
66
|
-
ref: this.#inputRef,
|
|
67
|
-
});
|
|
68
63
|
onMount(() => {
|
|
69
64
|
const input = this.#inputRef.current;
|
|
70
65
|
const container = this.opts.ref.current;
|
|
@@ -155,6 +150,7 @@ class PinInputRootState {
|
|
|
155
150
|
id: this.opts.id.current,
|
|
156
151
|
[ROOT_ATTR]: "",
|
|
157
152
|
style: this.#rootStyles,
|
|
153
|
+
...attachRef(this.opts.ref),
|
|
158
154
|
}));
|
|
159
155
|
inputWrapperProps = $derived.by(() => ({
|
|
160
156
|
style: {
|
|
@@ -365,6 +361,7 @@ class PinInputRootState {
|
|
|
365
361
|
onmouseleave: this.onmouseleave,
|
|
366
362
|
onfocus: this.onfocus,
|
|
367
363
|
onblur: this.onblur,
|
|
364
|
+
...attachRef(this.#inputRef),
|
|
368
365
|
}));
|
|
369
366
|
#cells = $derived.by(() => Array.from({ length: this.opts.maxLength.current }).map((_, idx) => {
|
|
370
367
|
const isActive = this.#isFocused.current &&
|
|
@@ -390,16 +387,13 @@ class PinInputCellState {
|
|
|
390
387
|
opts;
|
|
391
388
|
constructor(opts) {
|
|
392
389
|
this.opts = opts;
|
|
393
|
-
useRefById({
|
|
394
|
-
id: this.opts.id,
|
|
395
|
-
ref: this.opts.ref,
|
|
396
|
-
});
|
|
397
390
|
}
|
|
398
391
|
props = $derived.by(() => ({
|
|
399
392
|
id: this.opts.id.current,
|
|
400
393
|
[CELL_ATTR]: "",
|
|
401
394
|
"data-active": this.opts.cell.current.isActive ? "" : undefined,
|
|
402
395
|
"data-inactive": !this.opts.cell.current.isActive ? "" : undefined,
|
|
396
|
+
...attachRef(this.opts.ref),
|
|
403
397
|
}));
|
|
404
398
|
}
|
|
405
399
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PopoverCloseProps } from "../types.js";
|
|
4
4
|
import { usePopoverClose } from "../popover.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
child,
|
|
9
11
|
children,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
...restProps
|
|
13
15
|
}: PopoverCloseProps = $props();
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
import { usePopoverContent } from "../popover.svelte.js";
|
|
5
5
|
import PopperLayer from "../../utilities/popper-layer/popper-layer.svelte";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createId } from "../../../internal/create-id.js";
|
|
8
8
|
import { getFloatingContentCSSVars } from "../../../internal/floating-svelte/floating-utils.svelte.js";
|
|
9
9
|
import PopperLayerForceMount from "../../utilities/popper-layer/popper-layer-force-mount.svelte";
|
|
10
10
|
|
|
11
|
+
const uid = $props.id();
|
|
12
|
+
|
|
11
13
|
let {
|
|
12
14
|
child,
|
|
13
15
|
children,
|
|
14
16
|
ref = $bindable(null),
|
|
15
|
-
id =
|
|
17
|
+
id = createId(uid),
|
|
16
18
|
forceMount = false,
|
|
17
19
|
onCloseAutoFocus = noop,
|
|
18
20
|
onEscapeKeydown = noop,
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
<PopperLayerForceMount
|
|
41
43
|
{...mergedProps}
|
|
42
44
|
{...contentState.popperProps}
|
|
45
|
+
ref={contentState.opts.ref}
|
|
43
46
|
isStatic
|
|
44
47
|
enabled={contentState.root.opts.open.current}
|
|
45
48
|
{id}
|
|
@@ -65,6 +68,7 @@
|
|
|
65
68
|
<PopperLayer
|
|
66
69
|
{...mergedProps}
|
|
67
70
|
{...contentState.popperProps}
|
|
71
|
+
ref={contentState.opts.ref}
|
|
68
72
|
isStatic
|
|
69
73
|
present={contentState.root.opts.open.current}
|
|
70
74
|
{id}
|
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
import { usePopoverContent } from "../popover.svelte.js";
|
|
5
5
|
import PopperLayer from "../../utilities/popper-layer/popper-layer.svelte";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createId } from "../../../internal/create-id.js";
|
|
8
8
|
import { getFloatingContentCSSVars } from "../../../internal/floating-svelte/floating-utils.svelte.js";
|
|
9
9
|
import PopperLayerForceMount from "../../utilities/popper-layer/popper-layer-force-mount.svelte";
|
|
10
10
|
|
|
11
|
+
const uid = $props.id();
|
|
12
|
+
|
|
11
13
|
let {
|
|
12
14
|
child,
|
|
13
15
|
children,
|
|
14
16
|
ref = $bindable(null),
|
|
15
|
-
id =
|
|
17
|
+
id = createId(uid),
|
|
16
18
|
forceMount = false,
|
|
17
19
|
onCloseAutoFocus = noop,
|
|
18
20
|
onEscapeKeydown = noop,
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
<PopperLayerForceMount
|
|
41
43
|
{...mergedProps}
|
|
42
44
|
{...contentState.popperProps}
|
|
45
|
+
ref={contentState.opts.ref}
|
|
43
46
|
enabled={contentState.root.opts.open.current}
|
|
44
47
|
{id}
|
|
45
48
|
{trapFocus}
|
|
@@ -66,6 +69,7 @@
|
|
|
66
69
|
<PopperLayer
|
|
67
70
|
{...mergedProps}
|
|
68
71
|
{...contentState.popperProps}
|
|
72
|
+
ref={contentState.opts.ref}
|
|
69
73
|
present={contentState.root.opts.open.current}
|
|
70
74
|
{id}
|
|
71
75
|
{trapFocus}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { PopoverTriggerProps } from "../types.js";
|
|
4
4
|
import { usePopoverTrigger } from "../popover.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
6
|
import FloatingLayerAnchor from "../../utilities/floating-layer/components/floating-layer-anchor.svelte";
|
|
7
7
|
|
|
8
|
+
const uid = $props.id();
|
|
9
|
+
|
|
8
10
|
let {
|
|
9
11
|
children,
|
|
10
12
|
child,
|
|
11
|
-
id =
|
|
13
|
+
id = createId(uid),
|
|
12
14
|
ref = $bindable(null),
|
|
13
15
|
type = "button",
|
|
14
16
|
disabled = false,
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
const mergedProps = $derived(mergeProps(restProps, triggerState.props, { type }));
|
|
28
30
|
</script>
|
|
29
31
|
|
|
30
|
-
<FloatingLayerAnchor {id}>
|
|
32
|
+
<FloatingLayerAnchor {id} ref={triggerState.opts.ref}>
|
|
31
33
|
{#if child}
|
|
32
34
|
{@render child({ props: mergedProps })}
|
|
33
35
|
{:else}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
3
|
import { kbd } from "../../internal/kbd.js";
|
|
4
4
|
import { getAriaExpanded, getDataOpenClosed } from "../../internal/attrs.js";
|
|
@@ -25,12 +25,6 @@ class PopoverTriggerState {
|
|
|
25
25
|
constructor(opts, root) {
|
|
26
26
|
this.opts = opts;
|
|
27
27
|
this.root = root;
|
|
28
|
-
useRefById({
|
|
29
|
-
...opts,
|
|
30
|
-
onRefChange: (node) => {
|
|
31
|
-
this.root.triggerNode = node;
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
28
|
this.onclick = this.onclick.bind(this);
|
|
35
29
|
this.onkeydown = this.onkeydown.bind(this);
|
|
36
30
|
}
|
|
@@ -66,6 +60,7 @@ class PopoverTriggerState {
|
|
|
66
60
|
//
|
|
67
61
|
onkeydown: this.onkeydown,
|
|
68
62
|
onclick: this.onclick,
|
|
63
|
+
...attachRef(this.opts.ref, (v) => (this.root.triggerNode = v)),
|
|
69
64
|
}));
|
|
70
65
|
}
|
|
71
66
|
class PopoverContentState {
|
|
@@ -74,13 +69,6 @@ class PopoverContentState {
|
|
|
74
69
|
constructor(opts, root) {
|
|
75
70
|
this.opts = opts;
|
|
76
71
|
this.root = root;
|
|
77
|
-
useRefById({
|
|
78
|
-
...opts,
|
|
79
|
-
deps: () => this.root.opts.open.current,
|
|
80
|
-
onRefChange: (node) => {
|
|
81
|
-
this.root.contentNode = node;
|
|
82
|
-
},
|
|
83
|
-
});
|
|
84
72
|
}
|
|
85
73
|
onInteractOutside = (e) => {
|
|
86
74
|
this.opts.onInteractOutside.current(e);
|
|
@@ -115,6 +103,7 @@ class PopoverContentState {
|
|
|
115
103
|
style: {
|
|
116
104
|
pointerEvents: "auto",
|
|
117
105
|
},
|
|
106
|
+
...attachRef(this.opts.ref, (v) => (this.root.contentNode = v)),
|
|
118
107
|
}));
|
|
119
108
|
popperProps = {
|
|
120
109
|
onInteractOutside: this.onInteractOutside,
|
|
@@ -128,10 +117,6 @@ class PopoverCloseState {
|
|
|
128
117
|
constructor(opts, root) {
|
|
129
118
|
this.opts = opts;
|
|
130
119
|
this.root = root;
|
|
131
|
-
useRefById({
|
|
132
|
-
...opts,
|
|
133
|
-
deps: () => this.root.opts.open.current,
|
|
134
|
-
});
|
|
135
120
|
this.onclick = this.onclick.bind(this);
|
|
136
121
|
this.onkeydown = this.onkeydown.bind(this);
|
|
137
122
|
}
|
|
@@ -150,6 +135,7 @@ class PopoverCloseState {
|
|
|
150
135
|
onkeydown: this.onkeydown,
|
|
151
136
|
type: "button",
|
|
152
137
|
"data-popover-close": "",
|
|
138
|
+
...attachRef(this.opts.ref),
|
|
153
139
|
}));
|
|
154
140
|
}
|
|
155
141
|
//
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { ProgressRootProps } from "../types.js";
|
|
4
4
|
import { useProgressRootState } from "../progress.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
child,
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
value = 0,
|
|
11
13
|
max = 100,
|
|
12
14
|
min = 0,
|
|
13
|
-
id =
|
|
15
|
+
id = createId(uid),
|
|
14
16
|
ref = $bindable(null),
|
|
15
17
|
...restProps
|
|
16
18
|
}: ProgressRootProps = $props();
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
const ROOT_ATTR = "data-progress-root";
|
|
3
3
|
class ProgressRootState {
|
|
4
4
|
opts;
|
|
5
5
|
constructor(opts) {
|
|
6
6
|
this.opts = opts;
|
|
7
|
-
useRefById(opts);
|
|
8
7
|
}
|
|
9
8
|
props = $derived.by(() => ({
|
|
10
9
|
role: "progressbar",
|
|
@@ -18,6 +17,7 @@ class ProgressRootState {
|
|
|
18
17
|
"data-min": this.opts.min.current,
|
|
19
18
|
"data-indeterminate": this.opts.value.current === null ? "" : undefined,
|
|
20
19
|
[ROOT_ATTR]: "",
|
|
20
|
+
...attachRef(this.opts.ref),
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
23
|
function getProgressDataState(value, max) {
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RadioGroupItemProps } from "../types.js";
|
|
4
4
|
import { useRadioGroupItem } from "../radio-group.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
|
-
id =
|
|
10
|
+
id = createId(uid),
|
|
9
11
|
children,
|
|
10
12
|
child,
|
|
11
13
|
value,
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
import type { RadioGroupRootProps } from "../types.js";
|
|
4
4
|
import { useRadioGroupRoot } from "../radio-group.svelte.js";
|
|
5
5
|
import RadioGroupInput from "./radio-group-input.svelte";
|
|
6
|
-
import {
|
|
6
|
+
import { createId } from "../../../internal/create-id.js";
|
|
7
7
|
import { noop } from "../../../internal/noop.js";
|
|
8
8
|
|
|
9
|
+
const uid = $props.id();
|
|
10
|
+
|
|
9
11
|
let {
|
|
10
12
|
disabled = false,
|
|
11
13
|
children,
|
|
@@ -16,7 +18,7 @@
|
|
|
16
18
|
loop = true,
|
|
17
19
|
name = undefined,
|
|
18
20
|
required = false,
|
|
19
|
-
id =
|
|
21
|
+
id = createId(uid),
|
|
20
22
|
onValueChange = noop,
|
|
21
23
|
...restProps
|
|
22
24
|
}: RadioGroupRootProps = $props();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { getAriaChecked, getAriaRequired, getDataDisabled } from "../../internal/attrs.js";
|
|
4
4
|
import { useRovingFocus, } from "../../internal/use-roving-focus.svelte.js";
|
|
@@ -12,15 +12,11 @@ class RadioGroupRootState {
|
|
|
12
12
|
constructor(opts) {
|
|
13
13
|
this.opts = opts;
|
|
14
14
|
this.rovingFocusGroup = useRovingFocus({
|
|
15
|
-
|
|
15
|
+
rootNode: this.opts.ref,
|
|
16
16
|
candidateAttr: RADIO_GROUP_ITEM_ATTR,
|
|
17
17
|
loop: this.opts.loop,
|
|
18
18
|
orientation: this.opts.orientation,
|
|
19
19
|
});
|
|
20
|
-
useRefById({
|
|
21
|
-
id: this.opts.id,
|
|
22
|
-
ref: this.opts.ref,
|
|
23
|
-
});
|
|
24
20
|
}
|
|
25
21
|
isChecked(value) {
|
|
26
22
|
return this.opts.value.current === value;
|
|
@@ -35,6 +31,7 @@ class RadioGroupRootState {
|
|
|
35
31
|
"data-disabled": getDataDisabled(this.opts.disabled.current),
|
|
36
32
|
"data-orientation": this.opts.orientation.current,
|
|
37
33
|
[RADIO_GROUP_ROOT_ATTR]: "",
|
|
34
|
+
...attachRef(this.opts.ref),
|
|
38
35
|
}));
|
|
39
36
|
}
|
|
40
37
|
class RadioGroupItemState {
|
|
@@ -47,7 +44,6 @@ class RadioGroupItemState {
|
|
|
47
44
|
constructor(opts, root) {
|
|
48
45
|
this.opts = opts;
|
|
49
46
|
this.root = root;
|
|
50
|
-
useRefById(opts);
|
|
51
47
|
if (this.opts.value.current === this.root.opts.value.current) {
|
|
52
48
|
this.root.rovingFocusGroup.setCurrentTabStopId(this.opts.id.current);
|
|
53
49
|
this.#tabIndex = 0;
|
|
@@ -105,6 +101,7 @@ class RadioGroupItemState {
|
|
|
105
101
|
onkeydown: this.onkeydown,
|
|
106
102
|
onfocus: this.onfocus,
|
|
107
103
|
onclick: this.onclick,
|
|
104
|
+
...attachRef(this.opts.ref),
|
|
108
105
|
}));
|
|
109
106
|
}
|
|
110
107
|
//
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RangeCalendarCellProps } from "../types.js";
|
|
4
4
|
import { useRangeCalendarCell } from "../range-calendar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
date,
|
|
13
15
|
month,
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
import { box, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { RangeCalendarDayProps } from "../types.js";
|
|
4
4
|
import { useRangeCalendarDay } from "../range-calendar.svelte.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createId } from "../../../internal/create-id.js";
|
|
6
|
+
|
|
7
|
+
const uid = $props.id();
|
|
6
8
|
|
|
7
9
|
let {
|
|
8
10
|
children,
|
|
9
11
|
child,
|
|
10
|
-
id =
|
|
12
|
+
id = createId(uid),
|
|
11
13
|
ref = $bindable(null),
|
|
12
14
|
...restProps
|
|
13
15
|
}: RangeCalendarDayProps = $props();
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
import type { RangeCalendarRootProps } from "../types.js";
|
|
5
5
|
import { useRangeCalendarRoot } from "../range-calendar.svelte.js";
|
|
6
6
|
import { noop } from "../../../internal/noop.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createId } from "../../../internal/create-id.js";
|
|
8
8
|
import { getDefaultDate } from "../../../internal/date-time/utils.js";
|
|
9
9
|
import { watch } from "runed";
|
|
10
10
|
|
|
11
|
+
const uid = $props.id();
|
|
12
|
+
|
|
11
13
|
let {
|
|
12
14
|
children,
|
|
13
15
|
child,
|
|
14
|
-
id =
|
|
16
|
+
id = createId(uid),
|
|
15
17
|
ref = $bindable(null),
|
|
16
18
|
value = $bindable(),
|
|
17
19
|
onValueChange = noop,
|