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
|
@@ -32,7 +32,7 @@ declare abstract class SliderBaseRootState {
|
|
|
32
32
|
getPositionFromValue: (thumbValue: number) => number;
|
|
33
33
|
readonly props: {
|
|
34
34
|
readonly id: string;
|
|
35
|
-
readonly "data-orientation":
|
|
35
|
+
readonly "data-orientation": Orientation;
|
|
36
36
|
readonly "data-disabled": "" | undefined;
|
|
37
37
|
readonly style: {
|
|
38
38
|
readonly touchAction: "pan-x" | "pan-y" | undefined;
|
|
@@ -66,16 +66,16 @@ declare class SliderSingleRootState extends SliderBaseRootState {
|
|
|
66
66
|
readonly "aria-valuemax": number;
|
|
67
67
|
readonly "aria-valuenow": number;
|
|
68
68
|
readonly "aria-disabled": "true" | "false";
|
|
69
|
-
readonly "aria-orientation":
|
|
69
|
+
readonly "aria-orientation": Orientation;
|
|
70
70
|
readonly "data-value": number;
|
|
71
|
-
readonly "data-orientation":
|
|
71
|
+
readonly "data-orientation": Orientation;
|
|
72
72
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
73
73
|
}[];
|
|
74
74
|
readonly thumbsRenderArr: number[];
|
|
75
75
|
readonly ticksPropsArr: {
|
|
76
76
|
readonly [sliderAttrs.tick]: "";
|
|
77
77
|
readonly "data-disabled": "" | undefined;
|
|
78
|
-
readonly "data-orientation":
|
|
78
|
+
readonly "data-orientation": Orientation;
|
|
79
79
|
readonly "data-bounded": "" | undefined;
|
|
80
80
|
readonly "data-value": number;
|
|
81
81
|
readonly "data-selected": "" | undefined;
|
|
@@ -139,16 +139,16 @@ declare class SliderMultiRootState extends SliderBaseRootState {
|
|
|
139
139
|
readonly "aria-valuemax": number;
|
|
140
140
|
readonly "aria-valuenow": number | undefined;
|
|
141
141
|
readonly "aria-disabled": "true" | "false";
|
|
142
|
-
readonly "aria-orientation":
|
|
142
|
+
readonly "aria-orientation": Orientation;
|
|
143
143
|
readonly "data-value": number | undefined;
|
|
144
|
-
readonly "data-orientation":
|
|
144
|
+
readonly "data-orientation": Orientation;
|
|
145
145
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
146
146
|
}[];
|
|
147
147
|
readonly thumbsRenderArr: number[];
|
|
148
148
|
readonly ticksPropsArr: {
|
|
149
149
|
readonly [sliderAttrs.tick]: "";
|
|
150
150
|
readonly "data-disabled": "" | undefined;
|
|
151
|
-
readonly "data-orientation":
|
|
151
|
+
readonly "data-orientation": Orientation;
|
|
152
152
|
readonly "data-bounded": "" | undefined;
|
|
153
153
|
readonly "data-value": number;
|
|
154
154
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
@@ -1021,7 +1021,7 @@ export declare class SliderRangeState {
|
|
|
1021
1021
|
};
|
|
1022
1022
|
readonly props: {
|
|
1023
1023
|
readonly id: string;
|
|
1024
|
-
readonly "data-orientation":
|
|
1024
|
+
readonly "data-orientation": Orientation;
|
|
1025
1025
|
readonly "data-disabled": "" | undefined;
|
|
1026
1026
|
readonly style: {
|
|
1027
1027
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
@@ -1876,9 +1876,9 @@ export declare class SliderThumbState {
|
|
|
1876
1876
|
readonly "aria-valuemax": number;
|
|
1877
1877
|
readonly "aria-valuenow": number;
|
|
1878
1878
|
readonly "aria-disabled": "true" | "false";
|
|
1879
|
-
readonly "aria-orientation":
|
|
1879
|
+
readonly "aria-orientation": Orientation;
|
|
1880
1880
|
readonly "data-value": number;
|
|
1881
|
-
readonly "data-orientation":
|
|
1881
|
+
readonly "data-orientation": Orientation;
|
|
1882
1882
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1883
1883
|
} | {
|
|
1884
1884
|
readonly id: string;
|
|
@@ -1891,9 +1891,9 @@ export declare class SliderThumbState {
|
|
|
1891
1891
|
readonly "aria-valuemax": number;
|
|
1892
1892
|
readonly "aria-valuenow": number | undefined;
|
|
1893
1893
|
readonly "aria-disabled": "true" | "false";
|
|
1894
|
-
readonly "aria-orientation":
|
|
1894
|
+
readonly "aria-orientation": Orientation;
|
|
1895
1895
|
readonly "data-value": number | undefined;
|
|
1896
|
-
readonly "data-orientation":
|
|
1896
|
+
readonly "data-orientation": Orientation;
|
|
1897
1897
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1898
1898
|
};
|
|
1899
1899
|
}
|
|
@@ -1910,7 +1910,7 @@ export declare class SliderTickState {
|
|
|
1910
1910
|
readonly props: {
|
|
1911
1911
|
readonly id: string;
|
|
1912
1912
|
readonly "data-disabled": "" | undefined;
|
|
1913
|
-
readonly "data-orientation":
|
|
1913
|
+
readonly "data-orientation": Orientation;
|
|
1914
1914
|
readonly "data-bounded": "" | undefined;
|
|
1915
1915
|
readonly "data-value": number;
|
|
1916
1916
|
readonly "data-selected": "" | undefined;
|
|
@@ -1918,7 +1918,7 @@ export declare class SliderTickState {
|
|
|
1918
1918
|
} | {
|
|
1919
1919
|
readonly id: string;
|
|
1920
1920
|
readonly "data-disabled": "" | undefined;
|
|
1921
|
-
readonly "data-orientation":
|
|
1921
|
+
readonly "data-orientation": Orientation;
|
|
1922
1922
|
readonly "data-bounded": "" | undefined;
|
|
1923
1923
|
readonly "data-value": number;
|
|
1924
1924
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
@@ -1937,7 +1937,7 @@ export declare class SliderTickLabelState {
|
|
|
1937
1937
|
constructor(opts: SliderTickLabelStateOpts, root: SliderRoot);
|
|
1938
1938
|
readonly props: {
|
|
1939
1939
|
readonly id: string;
|
|
1940
|
-
readonly "data-orientation":
|
|
1940
|
+
readonly "data-orientation": Orientation;
|
|
1941
1941
|
readonly "data-disabled": "" | undefined;
|
|
1942
1942
|
readonly "data-bounded": "" | undefined;
|
|
1943
1943
|
readonly "data-value": number;
|
|
@@ -1959,7 +1959,7 @@ export declare class SliderThumbLabelState {
|
|
|
1959
1959
|
constructor(opts: SliderThumbLabelStateOpts, root: SliderRoot);
|
|
1960
1960
|
readonly props: {
|
|
1961
1961
|
readonly id: string;
|
|
1962
|
-
readonly "data-orientation":
|
|
1962
|
+
readonly "data-orientation": Orientation;
|
|
1963
1963
|
readonly "data-disabled": "" | undefined;
|
|
1964
1964
|
readonly "data-value": number;
|
|
1965
1965
|
readonly "data-active": "" | undefined;
|
|
@@ -7,7 +7,7 @@ import { executeCallbacks, onMountEffect, attachRef, DOMContext, } from "svelte-
|
|
|
7
7
|
import { on } from "svelte/events";
|
|
8
8
|
import { Context, watch } from "runed";
|
|
9
9
|
import { getRangeStyles, getThumbStyles, getTickStyles, normalizeSteps, snapValueToCustomSteps, getAdjacentStepValue, getTickLabelStyles, getThumbLabelStyles, } from "./helpers.js";
|
|
10
|
-
import { createBitsAttrs,
|
|
10
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef } from "../../internal/attrs.js";
|
|
11
11
|
import { kbd } from "../../internal/kbd.js";
|
|
12
12
|
import { isElementOrSVGElement } from "../../internal/is.js";
|
|
13
13
|
import { isValidIndex } from "../../internal/arrays.js";
|
|
@@ -90,8 +90,8 @@ class SliderBaseRootState {
|
|
|
90
90
|
};
|
|
91
91
|
props = $derived.by(() => ({
|
|
92
92
|
id: this.opts.id.current,
|
|
93
|
-
"data-orientation":
|
|
94
|
-
"data-disabled":
|
|
93
|
+
"data-orientation": this.opts.orientation.current,
|
|
94
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
95
95
|
style: {
|
|
96
96
|
touchAction: this.#touchAction,
|
|
97
97
|
},
|
|
@@ -223,10 +223,10 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
223
223
|
"aria-valuemin": this.opts.min.current,
|
|
224
224
|
"aria-valuemax": this.opts.max.current,
|
|
225
225
|
"aria-valuenow": thumbValue,
|
|
226
|
-
"aria-disabled":
|
|
227
|
-
"aria-orientation":
|
|
226
|
+
"aria-disabled": boolToStr(this.opts.disabled.current),
|
|
227
|
+
"aria-orientation": this.opts.orientation.current,
|
|
228
228
|
"data-value": thumbValue,
|
|
229
|
-
"data-orientation":
|
|
229
|
+
"data-orientation": this.opts.orientation.current,
|
|
230
230
|
style,
|
|
231
231
|
[sliderAttrs.thumb]: "",
|
|
232
232
|
};
|
|
@@ -247,8 +247,8 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
247
247
|
const style = getTickStyles(this.direction, tickPosition, offsetPercentage);
|
|
248
248
|
const bounded = tickValue <= currValue;
|
|
249
249
|
return {
|
|
250
|
-
"data-disabled":
|
|
251
|
-
"data-orientation":
|
|
250
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
251
|
+
"data-orientation": this.opts.orientation.current,
|
|
252
252
|
"data-bounded": bounded ? "" : undefined,
|
|
253
253
|
"data-value": tickValue,
|
|
254
254
|
"data-selected": this.isTickValueSelected(tickValue) ? "" : undefined,
|
|
@@ -485,10 +485,10 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
485
485
|
"aria-valuemin": this.opts.min.current,
|
|
486
486
|
"aria-valuemax": this.opts.max.current,
|
|
487
487
|
"aria-valuenow": thumbValue,
|
|
488
|
-
"aria-disabled":
|
|
489
|
-
"aria-orientation":
|
|
488
|
+
"aria-disabled": boolToStr(this.opts.disabled.current),
|
|
489
|
+
"aria-orientation": this.opts.orientation.current,
|
|
490
490
|
"data-value": thumbValue,
|
|
491
|
-
"data-orientation":
|
|
491
|
+
"data-orientation": this.opts.orientation.current,
|
|
492
492
|
style,
|
|
493
493
|
[sliderAttrs.thumb]: "",
|
|
494
494
|
};
|
|
@@ -511,8 +511,8 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
511
511
|
? tickValue <= currValue[0]
|
|
512
512
|
: currValue[0] <= tickValue && tickValue <= currValue[currValue.length - 1];
|
|
513
513
|
return {
|
|
514
|
-
"data-disabled":
|
|
515
|
-
"data-orientation":
|
|
514
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
515
|
+
"data-orientation": this.opts.orientation.current,
|
|
516
516
|
"data-bounded": bounded ? "" : undefined,
|
|
517
517
|
"data-value": tickValue,
|
|
518
518
|
style,
|
|
@@ -605,8 +605,8 @@ export class SliderRangeState {
|
|
|
605
605
|
});
|
|
606
606
|
props = $derived.by(() => ({
|
|
607
607
|
id: this.opts.id.current,
|
|
608
|
-
"data-orientation":
|
|
609
|
-
"data-disabled":
|
|
608
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
609
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
610
610
|
style: this.rangeStyles,
|
|
611
611
|
[sliderAttrs.range]: "",
|
|
612
612
|
...this.attachment,
|
|
@@ -721,7 +721,7 @@ export class SliderThumbState {
|
|
|
721
721
|
id: this.opts.id.current,
|
|
722
722
|
onkeydown: this.onkeydown,
|
|
723
723
|
"data-active": this.root.isThumbActive(this.opts.index.current) ? "" : undefined,
|
|
724
|
-
"data-disabled":
|
|
724
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current || this.root.opts.disabled.current),
|
|
725
725
|
tabindex: this.opts.disabled.current || this.root.opts.disabled.current ? -1 : 0,
|
|
726
726
|
...this.attachment,
|
|
727
727
|
}));
|
|
@@ -765,8 +765,8 @@ export class SliderTickLabelState {
|
|
|
765
765
|
const style = getTickLabelStyles(this.root.direction, tickPosition, labelPosition);
|
|
766
766
|
return {
|
|
767
767
|
id: this.opts.id.current,
|
|
768
|
-
"data-orientation":
|
|
769
|
-
"data-disabled":
|
|
768
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
769
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
770
770
|
"data-bounded": tickProps["data-bounded"],
|
|
771
771
|
"data-value": tickValue,
|
|
772
772
|
"data-selected": this.root.isTickValueSelected(tickValue) ? "" : undefined,
|
|
@@ -797,8 +797,8 @@ export class SliderThumbLabelState {
|
|
|
797
797
|
const style = getThumbLabelStyles(this.root.direction, thumbPosition, labelPosition);
|
|
798
798
|
return {
|
|
799
799
|
id: this.opts.id.current,
|
|
800
|
-
"data-orientation":
|
|
801
|
-
"data-disabled":
|
|
800
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
801
|
+
"data-disabled": boolToEmptyStrOrUndef(this.root.opts.disabled.current),
|
|
802
802
|
"data-value": thumbValue,
|
|
803
803
|
"data-active": this.root.isThumbActive(this.opts.index.current) ? "" : undefined,
|
|
804
804
|
"data-position": labelPosition,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { SwitchThumbProps } from "../types.js";
|
|
4
4
|
import { SwitchThumbState } from "../switch.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: SwitchThumbProps = $props();
|
|
16
16
|
|
|
17
17
|
const thumbState = SwitchThumbState.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 { SwitchRootProps } from "../types.js";
|
|
4
4
|
import { SwitchRootState } from "../switch.svelte.js";
|
|
5
5
|
import SwitchInput from "./switch-input.svelte";
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
}: SwitchRootProps = $props();
|
|
25
25
|
|
|
26
26
|
const rootState = SwitchRootState.create({
|
|
27
|
-
checked:
|
|
27
|
+
checked: boxWith(
|
|
28
28
|
() => checked,
|
|
29
29
|
(v) => {
|
|
30
30
|
checked = v;
|
|
31
31
|
onCheckedChange?.(v);
|
|
32
32
|
}
|
|
33
33
|
),
|
|
34
|
-
disabled:
|
|
35
|
-
required:
|
|
36
|
-
value:
|
|
37
|
-
name:
|
|
38
|
-
id:
|
|
39
|
-
ref:
|
|
34
|
+
disabled: boxWith(() => disabled ?? false),
|
|
35
|
+
required: boxWith(() => required),
|
|
36
|
+
value: boxWith(() => value),
|
|
37
|
+
name: boxWith(() => name),
|
|
38
|
+
id: boxWith(() => id),
|
|
39
|
+
ref: boxWith(
|
|
40
40
|
() => ref,
|
|
41
41
|
(v) => (ref = v)
|
|
42
42
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SwitchRootProps } from "../types.js";
|
|
2
|
-
declare const Switch: import("svelte").Component<SwitchRootProps, {}, "
|
|
2
|
+
declare const Switch: import("svelte").Component<SwitchRootProps, {}, "ref" | "checked">;
|
|
3
3
|
type Switch = ReturnType<typeof Switch>;
|
|
4
4
|
export default Switch;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
|
-
import { getAriaChecked,
|
|
3
|
+
import { getAriaChecked, boolToStr, getDataChecked, boolToTrueOrUndef, createBitsAttrs, boolToEmptyStrOrUndef, } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
5
|
const switchAttrs = createBitsAttrs({
|
|
6
6
|
component: "switch",
|
|
@@ -34,9 +34,9 @@ export class SwitchRootState {
|
|
|
34
34
|
this.#toggle();
|
|
35
35
|
}
|
|
36
36
|
sharedProps = $derived.by(() => ({
|
|
37
|
-
"data-disabled":
|
|
37
|
+
"data-disabled": boolToEmptyStrOrUndef(this.opts.disabled.current),
|
|
38
38
|
"data-state": getDataChecked(this.opts.checked.current),
|
|
39
|
-
"data-required":
|
|
39
|
+
"data-required": boolToEmptyStrOrUndef(this.opts.required.current),
|
|
40
40
|
}));
|
|
41
41
|
snippetProps = $derived.by(() => ({
|
|
42
42
|
checked: this.opts.checked.current,
|
|
@@ -45,9 +45,9 @@ export class SwitchRootState {
|
|
|
45
45
|
...this.sharedProps,
|
|
46
46
|
id: this.opts.id.current,
|
|
47
47
|
role: "switch",
|
|
48
|
-
disabled:
|
|
48
|
+
disabled: boolToTrueOrUndef(this.opts.disabled.current),
|
|
49
49
|
"aria-checked": getAriaChecked(this.opts.checked.current, false),
|
|
50
|
-
"aria-required":
|
|
50
|
+
"aria-required": boolToStr(this.opts.required.current),
|
|
51
51
|
[switchAttrs.root]: "",
|
|
52
52
|
//
|
|
53
53
|
onclick: this.onclick,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { TabsContentProps } from "../types.js";
|
|
4
4
|
import { TabsContentState } from "../tabs.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
}: TabsContentProps = $props();
|
|
17
17
|
|
|
18
18
|
const contentState = TabsContentState.create({
|
|
19
|
-
value:
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
19
|
+
value: boxWith(() => value),
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import type { TabsListProps } from "../types.js";
|
|
4
4
|
import { TabsListState } from "../tabs.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: TabsListProps = $props();
|
|
16
16
|
|
|
17
17
|
const listState = TabsListState.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 { TabsTriggerProps } from "../types.js";
|
|
4
4
|
import { TabsTriggerState } from "../tabs.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
}: TabsTriggerProps = $props();
|
|
19
19
|
|
|
20
20
|
const triggerState = TabsTriggerState.create({
|
|
21
|
-
id:
|
|
22
|
-
disabled:
|
|
23
|
-
value:
|
|
24
|
-
ref:
|
|
21
|
+
id: boxWith(() => id),
|
|
22
|
+
disabled: boxWith(() => disabled ?? false),
|
|
23
|
+
value: boxWith(() => value),
|
|
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 { TabsRootProps } from "../types.js";
|
|
4
4
|
import { TabsRootState } from "../tabs.svelte.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
}: TabsRootProps = $props();
|
|
23
23
|
|
|
24
24
|
const rootState = TabsRootState.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
|
-
orientation:
|
|
34
|
-
loop:
|
|
35
|
-
activationMode:
|
|
36
|
-
disabled:
|
|
37
|
-
ref:
|
|
33
|
+
orientation: boxWith(() => orientation),
|
|
34
|
+
loop: boxWith(() => loop),
|
|
35
|
+
activationMode: boxWith(() => activationMode),
|
|
36
|
+
disabled: boxWith(() => disabled),
|
|
37
|
+
ref: boxWith(
|
|
38
38
|
() => ref,
|
|
39
39
|
(v) => (ref = v)
|
|
40
40
|
),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TabsRootProps } from "../types.js";
|
|
2
|
-
declare const Tabs: import("svelte").Component<TabsRootProps, {}, "
|
|
2
|
+
declare const Tabs: import("svelte").Component<TabsRootProps, {}, "ref" | "value">;
|
|
3
3
|
type Tabs = ReturnType<typeof Tabs>;
|
|
4
4
|
export default Tabs;
|
|
@@ -27,7 +27,7 @@ export declare class TabsRootState {
|
|
|
27
27
|
setValue(v: string): void;
|
|
28
28
|
readonly props: {
|
|
29
29
|
readonly id: string;
|
|
30
|
-
readonly "data-orientation":
|
|
30
|
+
readonly "data-orientation": Orientation;
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
interface TabsListStateOpts extends WithRefOpts {
|
|
@@ -42,8 +42,8 @@ export declare class TabsListState {
|
|
|
42
42
|
readonly props: {
|
|
43
43
|
readonly id: string;
|
|
44
44
|
readonly role: "tablist";
|
|
45
|
-
readonly "aria-orientation":
|
|
46
|
-
readonly "data-orientation":
|
|
45
|
+
readonly "aria-orientation": Orientation;
|
|
46
|
+
readonly "data-orientation": Orientation;
|
|
47
47
|
readonly "data-disabled": "" | undefined;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
@@ -67,7 +67,7 @@ export declare class TabsTriggerState {
|
|
|
67
67
|
readonly role: "tab";
|
|
68
68
|
readonly "data-state": "active" | "inactive";
|
|
69
69
|
readonly "data-value": string;
|
|
70
|
-
readonly "data-orientation":
|
|
70
|
+
readonly "data-orientation": Orientation;
|
|
71
71
|
readonly "data-disabled": "" | undefined;
|
|
72
72
|
readonly "aria-selected": "true" | "false";
|
|
73
73
|
readonly "aria-controls": string | undefined;
|
|
@@ -97,7 +97,7 @@ export declare class TabsContentState {
|
|
|
97
97
|
readonly "data-value": string;
|
|
98
98
|
readonly "data-state": "active" | "inactive";
|
|
99
99
|
readonly "aria-labelledby": string | undefined;
|
|
100
|
-
readonly "data-orientation":
|
|
100
|
+
readonly "data-orientation": Orientation;
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteMap } from "svelte/reactivity";
|
|
2
2
|
import { attachRef } from "svelte-toolbelt";
|
|
3
3
|
import { Context, watch } from "runed";
|
|
4
|
-
import { createBitsAttrs,
|
|
4
|
+
import { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, boolToTrueOrUndef, } from "../../internal/attrs.js";
|
|
5
5
|
import { kbd } from "../../internal/kbd.js";
|
|
6
6
|
import { RovingFocusGroup } from "../../internal/roving-focus-group.js";
|
|
7
7
|
const tabsAttrs = createBitsAttrs({
|
|
@@ -52,7 +52,7 @@ export class TabsRootState {
|
|
|
52
52
|
}
|
|
53
53
|
props = $derived.by(() => ({
|
|
54
54
|
id: this.opts.id.current,
|
|
55
|
-
"data-orientation":
|
|
55
|
+
"data-orientation": this.opts.orientation.current,
|
|
56
56
|
[tabsAttrs.root]: "",
|
|
57
57
|
...this.attachment,
|
|
58
58
|
}));
|
|
@@ -73,10 +73,10 @@ export class TabsListState {
|
|
|
73
73
|
props = $derived.by(() => ({
|
|
74
74
|
id: this.opts.id.current,
|
|
75
75
|
role: "tablist",
|
|
76
|
-
"aria-orientation":
|
|
77
|
-
"data-orientation":
|
|
76
|
+
"aria-orientation": this.root.opts.orientation.current,
|
|
77
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
78
78
|
[tabsAttrs.list]: "",
|
|
79
|
-
"data-disabled":
|
|
79
|
+
"data-disabled": boolToEmptyStrOrUndef(this.#isDisabled),
|
|
80
80
|
...this.attachment,
|
|
81
81
|
}));
|
|
82
82
|
}
|
|
@@ -141,12 +141,12 @@ export class TabsTriggerState {
|
|
|
141
141
|
role: "tab",
|
|
142
142
|
"data-state": getTabDataState(this.#isActive),
|
|
143
143
|
"data-value": this.opts.value.current,
|
|
144
|
-
"data-orientation":
|
|
145
|
-
"data-disabled":
|
|
146
|
-
"aria-selected":
|
|
144
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
145
|
+
"data-disabled": boolToEmptyStrOrUndef(this.#isDisabled),
|
|
146
|
+
"aria-selected": boolToStr(this.#isActive),
|
|
147
147
|
"aria-controls": this.#ariaControls,
|
|
148
148
|
[tabsAttrs.trigger]: "",
|
|
149
|
-
disabled:
|
|
149
|
+
disabled: boolToTrueOrUndef(this.#isDisabled),
|
|
150
150
|
tabindex: this.#tabIndex,
|
|
151
151
|
//
|
|
152
152
|
onclick: this.onclick,
|
|
@@ -175,12 +175,12 @@ export class TabsContentState {
|
|
|
175
175
|
props = $derived.by(() => ({
|
|
176
176
|
id: this.opts.id.current,
|
|
177
177
|
role: "tabpanel",
|
|
178
|
-
hidden:
|
|
178
|
+
hidden: boolToTrueOrUndef(!this.#isActive),
|
|
179
179
|
tabindex: 0,
|
|
180
180
|
"data-value": this.opts.value.current,
|
|
181
181
|
"data-state": getTabDataState(this.#isActive),
|
|
182
182
|
"aria-labelledby": this.#ariaLabelledBy,
|
|
183
|
-
"data-orientation":
|
|
183
|
+
"data-orientation": this.root.opts.orientation.current,
|
|
184
184
|
[tabsAttrs.content]: "",
|
|
185
185
|
...this.attachment,
|
|
186
186
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { TimeFieldInputState } from "../time-field.svelte.js";
|
|
4
4
|
import type { TimeFieldInputProps } from "../types.js";
|
|
5
5
|
import DateFieldHiddenInput from "./time-field-hidden-input.svelte";
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
}: TimeFieldInputProps = $props();
|
|
18
18
|
|
|
19
19
|
const inputState = TimeFieldInputState.create({
|
|
20
|
-
id:
|
|
21
|
-
ref:
|
|
20
|
+
id: boxWith(() => id),
|
|
21
|
+
ref: boxWith(
|
|
22
22
|
() => ref,
|
|
23
23
|
(v) => (ref = v)
|
|
24
24
|
),
|
|
25
|
-
name:
|
|
25
|
+
name: boxWith(() => name),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const mergedProps = $derived(mergeProps(restProps, inputState.props));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { boxWith, mergeProps } from "svelte-toolbelt";
|
|
3
3
|
import { TimeFieldLabelState } from "../time-field.svelte.js";
|
|
4
4
|
import type { TimeFieldLabelProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}: TimeFieldLabelProps = $props();
|
|
16
16
|
|
|
17
17
|
const labelState = TimeFieldLabelState.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 { DateFieldSegmentState } from "../time-field.svelte.js";
|
|
4
4
|
import type { TimeFieldSegmentProps } from "../types.js";
|
|
5
5
|
import { createId } from "../../../internal/create-id.js";
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
}: TimeFieldSegmentProps = $props();
|
|
17
17
|
|
|
18
18
|
const segmentState = DateFieldSegmentState.create(part, {
|
|
19
|
-
id:
|
|
20
|
-
ref:
|
|
19
|
+
id: boxWith(() => id),
|
|
20
|
+
ref: boxWith(
|
|
21
21
|
() => ref,
|
|
22
22
|
(v) => (ref = v)
|
|
23
23
|
),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script lang="ts" generics="T extends TimeValue = Time">
|
|
8
8
|
import { watch } from "runed";
|
|
9
|
-
import {
|
|
9
|
+
import { boxWith } from "svelte-toolbelt";
|
|
10
10
|
import { TimeFieldRootState } from "../time-field.svelte.js";
|
|
11
11
|
import type { TimeFieldRootProps } from "../types.js";
|
|
12
12
|
import { noop } from "../../../internal/noop.js";
|
|
@@ -61,34 +61,34 @@
|
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
TimeFieldRootState.create({
|
|
64
|
-
value:
|
|
64
|
+
value: boxWith(
|
|
65
65
|
() => value,
|
|
66
66
|
(v) => {
|
|
67
67
|
value = v;
|
|
68
68
|
onValueChange(v);
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
placeholder:
|
|
71
|
+
placeholder: boxWith(
|
|
72
72
|
() => placeholder as TimeValue,
|
|
73
73
|
(v) => {
|
|
74
74
|
placeholder = v;
|
|
75
75
|
onPlaceholderChange(v);
|
|
76
76
|
}
|
|
77
77
|
),
|
|
78
|
-
disabled:
|
|
79
|
-
granularity:
|
|
80
|
-
hideTimeZone:
|
|
81
|
-
hourCycle:
|
|
78
|
+
disabled: boxWith(() => disabled),
|
|
79
|
+
granularity: boxWith(() => granularity),
|
|
80
|
+
hideTimeZone: boxWith(() => hideTimeZone),
|
|
81
|
+
hourCycle: boxWith(() => hourCycle),
|
|
82
82
|
locale: resolveLocaleProp(() => locale),
|
|
83
|
-
maxValue:
|
|
84
|
-
minValue:
|
|
85
|
-
validate:
|
|
86
|
-
readonly:
|
|
87
|
-
readonlySegments:
|
|
88
|
-
required:
|
|
89
|
-
onInvalid:
|
|
90
|
-
errorMessageId:
|
|
91
|
-
isInvalidProp:
|
|
83
|
+
maxValue: boxWith(() => maxValue),
|
|
84
|
+
minValue: boxWith(() => minValue),
|
|
85
|
+
validate: boxWith(() => validate),
|
|
86
|
+
readonly: boxWith(() => readonly),
|
|
87
|
+
readonlySegments: boxWith(() => readonlySegments),
|
|
88
|
+
required: boxWith(() => required),
|
|
89
|
+
onInvalid: boxWith(() => onInvalid),
|
|
90
|
+
errorMessageId: boxWith(() => errorMessageId),
|
|
91
|
+
isInvalidProp: boxWith(() => undefined),
|
|
92
92
|
});
|
|
93
93
|
</script>
|
|
94
94
|
|