bits-ui 2.2.1 → 2.3.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 +0 -5
- package/dist/bits/accordion/accordion.svelte.js +11 -14
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.d.ts +0 -1
- package/dist/bits/aspect-ratio/aspect-ratio.svelte.js +6 -2
- package/dist/bits/avatar/avatar.svelte.d.ts +0 -3
- package/dist/bits/avatar/avatar.svelte.js +8 -6
- package/dist/bits/calendar/calendar.svelte.d.ts +2 -2
- package/dist/bits/calendar/calendar.svelte.js +4 -4
- package/dist/bits/checkbox/checkbox.svelte.d.ts +0 -3
- package/dist/bits/checkbox/checkbox.svelte.js +14 -14
- package/dist/bits/collapsible/collapsible.svelte.d.ts +0 -3
- package/dist/bits/collapsible/collapsible.svelte.js +8 -7
- package/dist/bits/command/command.svelte.d.ts +0 -12
- package/dist/bits/command/command.svelte.js +35 -31
- package/dist/bits/date-field/date-field.svelte.d.ts +2 -4
- package/dist/bits/date-field/date-field.svelte.js +8 -6
- package/dist/bits/date-picker/components/date-picker-trigger.svelte +2 -2
- package/dist/bits/date-range-field/date-range-field.svelte.d.ts +1 -3
- package/dist/bits/date-range-field/date-range-field.svelte.js +7 -5
- package/dist/bits/date-range-picker/components/date-range-picker-trigger.svelte +2 -2
- package/dist/bits/dialog/dialog.svelte.d.ts +2 -12
- package/dist/bits/dialog/dialog.svelte.js +16 -24
- package/dist/bits/index.d.ts +1 -0
- package/dist/bits/index.js +1 -0
- package/dist/bits/label/label.svelte.d.ts +0 -1
- package/dist/bits/label/label.svelte.js +6 -2
- package/dist/bits/link-preview/link-preview.svelte.d.ts +0 -2
- package/dist/bits/link-preview/link-preview.svelte.js +7 -5
- package/dist/bits/menu/components/menu-sub-content-static.svelte +1 -1
- package/dist/bits/menu/components/menu-sub-content.svelte +1 -1
- package/dist/bits/menu/menu.svelte.d.ts +2 -1
- package/dist/bits/menu/menu.svelte.js +39 -21
- package/dist/bits/menubar/menubar.svelte.d.ts +1 -7
- package/dist/bits/menubar/menubar.svelte.js +12 -14
- package/dist/bits/meter/meter.svelte.d.ts +0 -1
- package/dist/bits/meter/meter.svelte.js +6 -2
- package/dist/bits/navigation-menu/navigation-menu.svelte.d.ts +2 -11
- package/dist/bits/navigation-menu/navigation-menu.svelte.js +30 -25
- package/dist/bits/pagination/pagination.svelte.d.ts +0 -4
- package/dist/bits/pagination/pagination.svelte.js +9 -10
- package/dist/bits/pin-input/pin-input.svelte.d.ts +0 -2
- package/dist/bits/pin-input/pin-input.svelte.js +7 -5
- package/dist/bits/popover/popover.svelte.d.ts +0 -3
- package/dist/bits/popover/popover.svelte.js +9 -5
- package/dist/bits/progress/progress.svelte.d.ts +0 -1
- package/dist/bits/progress/progress.svelte.js +6 -2
- package/dist/bits/radio-group/radio-group.svelte.d.ts +7 -9
- package/dist/bits/radio-group/radio-group.svelte.js +9 -10
- package/dist/bits/range-calendar/range-calendar.svelte.d.ts +38 -38
- package/dist/bits/range-calendar/range-calendar.svelte.js +79 -79
- package/dist/bits/rating-group/components/rating-group-input.svelte +10 -0
- package/dist/bits/rating-group/components/rating-group-input.svelte.d.ts +18 -0
- package/dist/bits/rating-group/components/rating-group-item.svelte +38 -0
- package/dist/bits/rating-group/components/rating-group-item.svelte.d.ts +4 -0
- package/dist/bits/rating-group/components/rating-group.svelte +80 -0
- package/dist/bits/rating-group/components/rating-group.svelte.d.ts +4 -0
- package/dist/bits/rating-group/exports.d.ts +3 -0
- package/dist/bits/rating-group/exports.js +2 -0
- package/dist/bits/rating-group/index.d.ts +1 -0
- package/dist/bits/rating-group/index.js +1 -0
- package/dist/bits/rating-group/rating-group.svelte.d.ts +112 -0
- package/dist/bits/rating-group/rating-group.svelte.js +317 -0
- package/dist/bits/rating-group/types.d.ts +111 -0
- package/dist/bits/rating-group/types.js +1 -0
- package/dist/bits/scroll-area/scroll-area.svelte.d.ts +15 -19
- package/dist/bits/scroll-area/scroll-area.svelte.js +10 -10
- package/dist/bits/select/select.svelte.d.ts +28 -30
- package/dist/bits/select/select.svelte.js +36 -48
- package/dist/bits/separator/separator.svelte.d.ts +1 -2
- package/dist/bits/separator/separator.svelte.js +6 -3
- package/dist/bits/slider/slider.svelte.d.ts +17 -24
- package/dist/bits/slider/slider.svelte.js +15 -17
- package/dist/bits/switch/switch.svelte.d.ts +6 -8
- package/dist/bits/switch/switch.svelte.js +7 -5
- package/dist/bits/tabs/tabs.svelte.d.ts +5 -9
- package/dist/bits/tabs/tabs.svelte.js +11 -11
- package/dist/bits/time-field/time-field.svelte.d.ts +1 -3
- package/dist/bits/time-field/time-field.svelte.js +7 -5
- package/dist/bits/time-range-field/time-range-field.svelte.d.ts +1 -3
- package/dist/bits/time-range-field/time-range-field.svelte.js +7 -5
- package/dist/bits/toggle/toggle.svelte.d.ts +3 -3
- package/dist/bits/toggle/toggle.svelte.js +6 -3
- package/dist/bits/toggle-group/toggle-group.svelte.d.ts +1 -2
- package/dist/bits/toggle-group/toggle-group.svelte.js +8 -6
- package/dist/bits/toolbar/toolbar.svelte.d.ts +11 -18
- package/dist/bits/toolbar/toolbar.svelte.js +14 -17
- package/dist/bits/tooltip/tooltip.svelte.d.ts +13 -14
- package/dist/bits/tooltip/tooltip.svelte.js +7 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/attrs.d.ts +14 -0
- package/dist/internal/attrs.js +18 -0
- package/dist/internal/date-time/calendar-helpers.svelte.d.ts +1 -0
- package/dist/internal/date-time/calendar-helpers.svelte.js +18 -1
- package/dist/internal/use-arrow-navigation.d.ts +2 -2
- package/dist/internal/use-arrow-navigation.js +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import type { ReadableBoxedValues, WritableBoxedValues } from "../../internal/bo
|
|
|
4
4
|
import type { BitsKeyboardEvent, OnChangeFn, WithRefProps } from "../../internal/types.js";
|
|
5
5
|
import type { Direction, Orientation, SliderThumbPositioning } from "../../shared/index.js";
|
|
6
6
|
import type { SliderLabelPosition } from "./types.js";
|
|
7
|
+
declare const sliderAttrs: import("../../internal/attrs.js").BitsAttrs<readonly ["root", "thumb", "range", "tick", "tick-label", "thumb-label"]>;
|
|
7
8
|
type SliderBaseRootStateProps = WithRefProps<ReadableBoxedValues<{
|
|
8
9
|
disabled: boolean;
|
|
9
10
|
orientation: Orientation;
|
|
@@ -33,7 +34,6 @@ declare class SliderBaseRootState {
|
|
|
33
34
|
readonly style: {
|
|
34
35
|
readonly touchAction: string | undefined;
|
|
35
36
|
};
|
|
36
|
-
readonly "data-slider-root": "";
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
type SliderSingleRootStateProps = SliderBaseRootStateProps & ReadableBoxedValues<{
|
|
@@ -56,6 +56,7 @@ declare class SliderSingleRootState extends SliderBaseRootState {
|
|
|
56
56
|
handlePointerDown: (e: PointerEvent) => void;
|
|
57
57
|
handlePointerUp: () => void;
|
|
58
58
|
thumbsPropsArr: {
|
|
59
|
+
readonly [sliderAttrs.thumb]: "";
|
|
59
60
|
readonly role: "slider";
|
|
60
61
|
readonly "aria-valuemin": number;
|
|
61
62
|
readonly "aria-valuemax": number;
|
|
@@ -65,17 +66,16 @@ declare class SliderSingleRootState extends SliderBaseRootState {
|
|
|
65
66
|
readonly "data-value": number;
|
|
66
67
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
67
68
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
68
|
-
readonly "data-slider-thumb": "";
|
|
69
69
|
}[];
|
|
70
70
|
thumbsRenderArr: number[];
|
|
71
71
|
ticksPropsArr: {
|
|
72
|
+
readonly [sliderAttrs.tick]: "";
|
|
72
73
|
readonly "data-disabled": "" | undefined;
|
|
73
74
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
74
75
|
readonly "data-bounded": "" | undefined;
|
|
75
76
|
readonly "data-value": number;
|
|
76
77
|
readonly "data-selected": "" | undefined;
|
|
77
78
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
78
|
-
readonly "data-slider-tick": "";
|
|
79
79
|
}[];
|
|
80
80
|
ticksRenderArr: number[];
|
|
81
81
|
tickItemsArr: {
|
|
@@ -127,7 +127,8 @@ declare class SliderMultiRootState extends SliderBaseRootState {
|
|
|
127
127
|
handlePointerUp: () => void;
|
|
128
128
|
getAllThumbs: () => HTMLElement[];
|
|
129
129
|
updateValue: (thumbValue: number, idx: number) => void;
|
|
130
|
-
thumbsPropsArr: {
|
|
130
|
+
readonly thumbsPropsArr: {
|
|
131
|
+
readonly [sliderAttrs.thumb]: "";
|
|
131
132
|
readonly role: "slider";
|
|
132
133
|
readonly "aria-valuemin": number;
|
|
133
134
|
readonly "aria-valuemax": number;
|
|
@@ -137,27 +138,26 @@ declare class SliderMultiRootState extends SliderBaseRootState {
|
|
|
137
138
|
readonly "data-value": number | undefined;
|
|
138
139
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
139
140
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
140
|
-
readonly "data-slider-thumb": "";
|
|
141
141
|
}[];
|
|
142
|
-
thumbsRenderArr: number[];
|
|
143
|
-
ticksPropsArr: {
|
|
142
|
+
readonly thumbsRenderArr: number[];
|
|
143
|
+
readonly ticksPropsArr: {
|
|
144
|
+
readonly [sliderAttrs.tick]: "";
|
|
144
145
|
readonly "data-disabled": "" | undefined;
|
|
145
146
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
146
147
|
readonly "data-bounded": "" | undefined;
|
|
147
148
|
readonly "data-value": number;
|
|
148
149
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
149
|
-
readonly "data-slider-tick": "";
|
|
150
150
|
}[];
|
|
151
|
-
ticksRenderArr: number[];
|
|
152
|
-
tickItemsArr: {
|
|
151
|
+
readonly ticksRenderArr: number[];
|
|
152
|
+
readonly tickItemsArr: {
|
|
153
153
|
value: number;
|
|
154
154
|
index: number;
|
|
155
155
|
}[];
|
|
156
|
-
thumbItemsArr: {
|
|
156
|
+
readonly thumbItemsArr: {
|
|
157
157
|
value: number;
|
|
158
158
|
index: number;
|
|
159
159
|
}[];
|
|
160
|
-
snippetProps: {
|
|
160
|
+
readonly snippetProps: {
|
|
161
161
|
readonly ticks: number[];
|
|
162
162
|
readonly thumbs: number[];
|
|
163
163
|
readonly tickItems: {
|
|
@@ -175,7 +175,7 @@ declare class SliderRangeState {
|
|
|
175
175
|
readonly opts: SliderRangeStateProps;
|
|
176
176
|
readonly root: SliderRootState;
|
|
177
177
|
constructor(opts: SliderRangeStateProps, root: SliderRootState);
|
|
178
|
-
rangeStyles: {
|
|
178
|
+
readonly rangeStyles: {
|
|
179
179
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
180
180
|
alignContent?: import("csstype").Property.AlignContent | undefined;
|
|
181
181
|
alignItems?: import("csstype").Property.AlignItems | undefined;
|
|
@@ -1002,7 +1002,7 @@ declare class SliderRangeState {
|
|
|
1002
1002
|
textAnchor?: import("csstype").Property.TextAnchor | undefined;
|
|
1003
1003
|
vectorEffect?: import("csstype").Property.VectorEffect | undefined;
|
|
1004
1004
|
};
|
|
1005
|
-
props: {
|
|
1005
|
+
readonly props: {
|
|
1006
1006
|
readonly id: string;
|
|
1007
1007
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
1008
1008
|
readonly "data-disabled": "" | undefined;
|
|
@@ -1833,7 +1833,6 @@ declare class SliderRangeState {
|
|
|
1833
1833
|
textAnchor?: import("csstype").Property.TextAnchor | undefined;
|
|
1834
1834
|
vectorEffect?: import("csstype").Property.VectorEffect | undefined;
|
|
1835
1835
|
};
|
|
1836
|
-
readonly "data-slider-range": "";
|
|
1837
1836
|
};
|
|
1838
1837
|
}
|
|
1839
1838
|
type SliderThumbStateProps = WithRefProps & ReadableBoxedValues<{
|
|
@@ -1846,7 +1845,7 @@ declare class SliderThumbState {
|
|
|
1846
1845
|
readonly root: SliderRootState;
|
|
1847
1846
|
constructor(opts: SliderThumbStateProps, root: SliderRootState);
|
|
1848
1847
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
1849
|
-
props: {
|
|
1848
|
+
readonly props: {
|
|
1850
1849
|
readonly id: string;
|
|
1851
1850
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
1852
1851
|
readonly "data-active": "" | undefined;
|
|
@@ -1861,7 +1860,6 @@ declare class SliderThumbState {
|
|
|
1861
1860
|
readonly "data-value": number;
|
|
1862
1861
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
1863
1862
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1864
|
-
readonly "data-slider-thumb": "";
|
|
1865
1863
|
} | {
|
|
1866
1864
|
readonly id: string;
|
|
1867
1865
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
@@ -1877,7 +1875,6 @@ declare class SliderThumbState {
|
|
|
1877
1875
|
readonly "data-value": number | undefined;
|
|
1878
1876
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
1879
1877
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1880
|
-
readonly "data-slider-thumb": "";
|
|
1881
1878
|
};
|
|
1882
1879
|
}
|
|
1883
1880
|
type SliderTickStateProps = WithRefProps & ReadableBoxedValues<{
|
|
@@ -1887,7 +1884,7 @@ declare class SliderTickState {
|
|
|
1887
1884
|
readonly opts: SliderTickStateProps;
|
|
1888
1885
|
readonly root: SliderRootState;
|
|
1889
1886
|
constructor(opts: SliderTickStateProps, root: SliderRootState);
|
|
1890
|
-
props: {
|
|
1887
|
+
readonly props: {
|
|
1891
1888
|
readonly id: string;
|
|
1892
1889
|
readonly "data-disabled": "" | undefined;
|
|
1893
1890
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
@@ -1895,7 +1892,6 @@ declare class SliderTickState {
|
|
|
1895
1892
|
readonly "data-value": number;
|
|
1896
1893
|
readonly "data-selected": "" | undefined;
|
|
1897
1894
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1898
|
-
readonly "data-slider-tick": "";
|
|
1899
1895
|
} | {
|
|
1900
1896
|
readonly id: string;
|
|
1901
1897
|
readonly "data-disabled": "" | undefined;
|
|
@@ -1903,7 +1899,6 @@ declare class SliderTickState {
|
|
|
1903
1899
|
readonly "data-bounded": "" | undefined;
|
|
1904
1900
|
readonly "data-value": number;
|
|
1905
1901
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1906
|
-
readonly "data-slider-tick": "";
|
|
1907
1902
|
};
|
|
1908
1903
|
}
|
|
1909
1904
|
type SliderTickLabelStateProps = WithRefProps & ReadableBoxedValues<{
|
|
@@ -1914,7 +1909,7 @@ declare class SliderTickLabelState {
|
|
|
1914
1909
|
readonly opts: SliderTickLabelStateProps;
|
|
1915
1910
|
readonly root: SliderRootState;
|
|
1916
1911
|
constructor(opts: SliderTickLabelStateProps, root: SliderRootState);
|
|
1917
|
-
props: {
|
|
1912
|
+
readonly props: {
|
|
1918
1913
|
readonly id: string;
|
|
1919
1914
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
1920
1915
|
readonly "data-disabled": "" | undefined;
|
|
@@ -1923,7 +1918,6 @@ declare class SliderTickLabelState {
|
|
|
1923
1918
|
readonly "data-selected": "" | undefined;
|
|
1924
1919
|
readonly "data-position": SliderLabelPosition;
|
|
1925
1920
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1926
|
-
readonly "data-slider-tick-label": "";
|
|
1927
1921
|
};
|
|
1928
1922
|
}
|
|
1929
1923
|
type SliderThumbLabelStateProps = WithRefProps & ReadableBoxedValues<{
|
|
@@ -1942,7 +1936,6 @@ declare class SliderThumbLabelState {
|
|
|
1942
1936
|
readonly "data-active": "" | undefined;
|
|
1943
1937
|
readonly "data-position": SliderLabelPosition;
|
|
1944
1938
|
readonly style: import("../../shared/index.js").StyleProperties;
|
|
1945
|
-
readonly "data-slider-thumb-label": "";
|
|
1946
1939
|
};
|
|
1947
1940
|
}
|
|
1948
1941
|
type SliderRootState = SliderSingleRootState | SliderMultiRootState;
|
|
@@ -7,17 +7,15 @@ import { executeCallbacks, onMountEffect, attachRef, } from "svelte-toolbelt";
|
|
|
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 { getAriaDisabled, getAriaOrientation, getDataDisabled, getDataOrientation, } from "../../internal/attrs.js";
|
|
10
|
+
import { createBitsAttrs, getAriaDisabled, getAriaOrientation, getDataDisabled, getDataOrientation, } 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";
|
|
14
14
|
import { linearScale } from "../../internal/math.js";
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const SLIDER_TICK_LABEL_ATTR = "data-slider-tick-label";
|
|
20
|
-
const SLIDER_THUMB_LABEL_ATTR = "data-slider-thumb-label";
|
|
15
|
+
const sliderAttrs = createBitsAttrs({
|
|
16
|
+
component: "slider",
|
|
17
|
+
parts: ["root", "thumb", "range", "tick", "tick-label", "thumb-label"],
|
|
18
|
+
});
|
|
21
19
|
class SliderBaseRootState {
|
|
22
20
|
opts;
|
|
23
21
|
isActive = $state(false);
|
|
@@ -48,7 +46,7 @@ class SliderBaseRootState {
|
|
|
48
46
|
const node = this.opts.ref.current;
|
|
49
47
|
if (!node)
|
|
50
48
|
return [];
|
|
51
|
-
return Array.from(node.querySelectorAll(
|
|
49
|
+
return Array.from(node.querySelectorAll(sliderAttrs.selector("thumb")));
|
|
52
50
|
};
|
|
53
51
|
getThumbScale = () => {
|
|
54
52
|
// If trackPadding is explicitly set, use it directly instead of calculating from thumb size
|
|
@@ -92,7 +90,7 @@ class SliderBaseRootState {
|
|
|
92
90
|
style: {
|
|
93
91
|
touchAction: this.#touchAction,
|
|
94
92
|
},
|
|
95
|
-
[
|
|
93
|
+
[sliderAttrs.root]: "",
|
|
96
94
|
...attachRef(this.opts.ref),
|
|
97
95
|
}));
|
|
98
96
|
}
|
|
@@ -225,7 +223,7 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
225
223
|
"data-value": thumbValue,
|
|
226
224
|
"data-orientation": getDataOrientation(this.opts.orientation.current),
|
|
227
225
|
style,
|
|
228
|
-
[
|
|
226
|
+
[sliderAttrs.thumb]: "",
|
|
229
227
|
};
|
|
230
228
|
});
|
|
231
229
|
});
|
|
@@ -250,7 +248,7 @@ class SliderSingleRootState extends SliderBaseRootState {
|
|
|
250
248
|
"data-value": tickValue,
|
|
251
249
|
"data-selected": this.isTickValueSelected(tickValue) ? "" : undefined,
|
|
252
250
|
style,
|
|
253
|
-
[
|
|
251
|
+
[sliderAttrs.tick]: "",
|
|
254
252
|
};
|
|
255
253
|
});
|
|
256
254
|
});
|
|
@@ -428,7 +426,7 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
428
426
|
const node = this.opts.ref.current;
|
|
429
427
|
if (!node)
|
|
430
428
|
return [];
|
|
431
|
-
const thumbs = Array.from(node.querySelectorAll(
|
|
429
|
+
const thumbs = Array.from(node.querySelectorAll(sliderAttrs.selector("thumb")));
|
|
432
430
|
return thumbs;
|
|
433
431
|
};
|
|
434
432
|
updateValue = (thumbValue, idx) => {
|
|
@@ -487,7 +485,7 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
487
485
|
"data-value": thumbValue,
|
|
488
486
|
"data-orientation": getDataOrientation(this.opts.orientation.current),
|
|
489
487
|
style,
|
|
490
|
-
[
|
|
488
|
+
[sliderAttrs.thumb]: "",
|
|
491
489
|
};
|
|
492
490
|
});
|
|
493
491
|
});
|
|
@@ -513,7 +511,7 @@ class SliderMultiRootState extends SliderBaseRootState {
|
|
|
513
511
|
"data-bounded": bounded ? "" : undefined,
|
|
514
512
|
"data-value": tickValue,
|
|
515
513
|
style,
|
|
516
|
-
[
|
|
514
|
+
[sliderAttrs.tick]: "",
|
|
517
515
|
};
|
|
518
516
|
});
|
|
519
517
|
});
|
|
@@ -591,7 +589,7 @@ class SliderRangeState {
|
|
|
591
589
|
"data-orientation": getDataOrientation(this.root.opts.orientation.current),
|
|
592
590
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
593
591
|
style: this.rangeStyles,
|
|
594
|
-
[
|
|
592
|
+
[sliderAttrs.range]: "",
|
|
595
593
|
...attachRef(this.opts.ref),
|
|
596
594
|
}));
|
|
597
595
|
}
|
|
@@ -740,7 +738,7 @@ class SliderTickLabelState {
|
|
|
740
738
|
"data-selected": this.root.isTickValueSelected(tickValue) ? "" : undefined,
|
|
741
739
|
"data-position": labelPosition,
|
|
742
740
|
style,
|
|
743
|
-
[
|
|
741
|
+
[sliderAttrs["tick-label"]]: "",
|
|
744
742
|
...attachRef(this.opts.ref),
|
|
745
743
|
};
|
|
746
744
|
});
|
|
@@ -766,7 +764,7 @@ class SliderThumbLabelState {
|
|
|
766
764
|
"data-active": this.root.isThumbActive(this.opts.index.current) ? "" : undefined,
|
|
767
765
|
"data-position": labelPosition,
|
|
768
766
|
style,
|
|
769
|
-
[
|
|
767
|
+
[sliderAttrs["thumb-label"]]: "",
|
|
770
768
|
...attachRef(this.opts.ref),
|
|
771
769
|
};
|
|
772
770
|
});
|
|
@@ -14,21 +14,20 @@ declare class SwitchRootState {
|
|
|
14
14
|
constructor(opts: SwitchRootStateProps);
|
|
15
15
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
16
16
|
onclick(_: BitsPointerEvent): void;
|
|
17
|
-
sharedProps: {
|
|
17
|
+
readonly sharedProps: {
|
|
18
18
|
"data-disabled": "" | undefined;
|
|
19
19
|
"data-state": "checked" | "unchecked";
|
|
20
20
|
"data-required": "" | undefined;
|
|
21
21
|
};
|
|
22
|
-
snippetProps: {
|
|
22
|
+
readonly snippetProps: {
|
|
23
23
|
checked: boolean;
|
|
24
24
|
};
|
|
25
|
-
props: {
|
|
25
|
+
readonly props: {
|
|
26
26
|
readonly id: string;
|
|
27
27
|
readonly role: "switch";
|
|
28
28
|
readonly disabled: true | undefined;
|
|
29
29
|
readonly "aria-checked": "true" | "false" | "mixed";
|
|
30
30
|
readonly "aria-required": "true" | "false";
|
|
31
|
-
readonly "data-switch-root": "";
|
|
32
31
|
readonly onclick: (_: BitsPointerEvent) => void;
|
|
33
32
|
readonly onkeydown: (e: BitsKeyboardEvent) => void;
|
|
34
33
|
readonly "data-disabled": "" | undefined;
|
|
@@ -38,7 +37,7 @@ declare class SwitchRootState {
|
|
|
38
37
|
}
|
|
39
38
|
declare class SwitchInputState {
|
|
40
39
|
readonly root: SwitchRootState;
|
|
41
|
-
shouldRender: boolean;
|
|
40
|
+
readonly shouldRender: boolean;
|
|
42
41
|
constructor(root: SwitchRootState);
|
|
43
42
|
props: {
|
|
44
43
|
readonly type: "checkbox";
|
|
@@ -54,12 +53,11 @@ declare class SwitchThumbState {
|
|
|
54
53
|
readonly opts: SwitchThumbStateProps;
|
|
55
54
|
readonly root: SwitchRootState;
|
|
56
55
|
constructor(opts: SwitchThumbStateProps, root: SwitchRootState);
|
|
57
|
-
snippetProps: {
|
|
56
|
+
readonly snippetProps: {
|
|
58
57
|
checked: boolean;
|
|
59
58
|
};
|
|
60
|
-
props: {
|
|
59
|
+
readonly props: {
|
|
61
60
|
readonly id: string;
|
|
62
|
-
readonly "data-switch-thumb": "";
|
|
63
61
|
readonly "data-disabled": "" | undefined;
|
|
64
62
|
readonly "data-state": "checked" | "unchecked";
|
|
65
63
|
readonly "data-required": "" | undefined;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { attachRef } from "svelte-toolbelt";
|
|
2
2
|
import { Context } from "runed";
|
|
3
|
-
import { getAriaChecked, getAriaRequired, getDataChecked, getDataDisabled, getDataRequired, getDisabled, } from "../../internal/attrs.js";
|
|
3
|
+
import { getAriaChecked, getAriaRequired, getDataChecked, getDataDisabled, getDataRequired, getDisabled, createBitsAttrs, } from "../../internal/attrs.js";
|
|
4
4
|
import { kbd } from "../../internal/kbd.js";
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const switchAttrs = createBitsAttrs({
|
|
6
|
+
component: "switch",
|
|
7
|
+
parts: ["root", "thumb"],
|
|
8
|
+
});
|
|
7
9
|
class SwitchRootState {
|
|
8
10
|
opts;
|
|
9
11
|
constructor(opts) {
|
|
@@ -40,7 +42,7 @@ class SwitchRootState {
|
|
|
40
42
|
disabled: getDisabled(this.opts.disabled.current),
|
|
41
43
|
"aria-checked": getAriaChecked(this.opts.checked.current, false),
|
|
42
44
|
"aria-required": getAriaRequired(this.opts.required.current),
|
|
43
|
-
[
|
|
45
|
+
[switchAttrs.root]: "",
|
|
44
46
|
//
|
|
45
47
|
onclick: this.onclick,
|
|
46
48
|
onkeydown: this.onkeydown,
|
|
@@ -75,7 +77,7 @@ class SwitchThumbState {
|
|
|
75
77
|
props = $derived.by(() => ({
|
|
76
78
|
...this.root.sharedProps,
|
|
77
79
|
id: this.opts.id.current,
|
|
78
|
-
[
|
|
80
|
+
[switchAttrs.thumb]: "",
|
|
79
81
|
...attachRef(this.opts.ref),
|
|
80
82
|
}));
|
|
81
83
|
}
|
|
@@ -16,16 +16,15 @@ declare class TabsRootState {
|
|
|
16
16
|
readonly opts: TabsRootStateProps;
|
|
17
17
|
rovingFocusGroup: UseRovingFocusReturn;
|
|
18
18
|
triggerIds: string[];
|
|
19
|
-
valueToTriggerId: SvelteMap<string, string>;
|
|
20
|
-
valueToContentId: SvelteMap<string, string>;
|
|
19
|
+
readonly valueToTriggerId: SvelteMap<string, string>;
|
|
20
|
+
readonly valueToContentId: SvelteMap<string, string>;
|
|
21
21
|
constructor(opts: TabsRootStateProps);
|
|
22
22
|
registerTrigger(id: string, value: string): () => void;
|
|
23
23
|
registerContent(id: string, value: string): () => void;
|
|
24
24
|
setValue(v: string): void;
|
|
25
|
-
props: {
|
|
25
|
+
readonly props: {
|
|
26
26
|
readonly id: string;
|
|
27
27
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
28
|
-
readonly "data-tabs-root": "";
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
type TabsListStateProps = WithRefProps;
|
|
@@ -34,12 +33,11 @@ declare class TabsListState {
|
|
|
34
33
|
readonly opts: TabsListStateProps;
|
|
35
34
|
readonly root: TabsRootState;
|
|
36
35
|
constructor(opts: TabsListStateProps, root: TabsRootState);
|
|
37
|
-
props: {
|
|
36
|
+
readonly props: {
|
|
38
37
|
readonly id: string;
|
|
39
38
|
readonly role: "tablist";
|
|
40
39
|
readonly "aria-orientation": "horizontal" | "vertical";
|
|
41
40
|
readonly "data-orientation": "horizontal" | "vertical";
|
|
42
|
-
readonly "data-tabs-list": "";
|
|
43
41
|
readonly "data-disabled": "" | undefined;
|
|
44
42
|
};
|
|
45
43
|
}
|
|
@@ -55,7 +53,7 @@ declare class TabsTriggerState {
|
|
|
55
53
|
onfocus(_: BitsFocusEvent): void;
|
|
56
54
|
onclick(_: BitsMouseEvent): void;
|
|
57
55
|
onkeydown(e: BitsKeyboardEvent): void;
|
|
58
|
-
props: {
|
|
56
|
+
readonly props: {
|
|
59
57
|
readonly id: string;
|
|
60
58
|
readonly role: "tab";
|
|
61
59
|
readonly "data-state": "active" | "inactive";
|
|
@@ -64,7 +62,6 @@ declare class TabsTriggerState {
|
|
|
64
62
|
readonly "data-disabled": "" | undefined;
|
|
65
63
|
readonly "aria-selected": "true" | "false";
|
|
66
64
|
readonly "aria-controls": string | undefined;
|
|
67
|
-
readonly "data-tabs-trigger": "";
|
|
68
65
|
readonly disabled: true | undefined;
|
|
69
66
|
readonly tabindex: number;
|
|
70
67
|
readonly onclick: (_: BitsMouseEvent) => void;
|
|
@@ -88,7 +85,6 @@ declare class TabsContentState {
|
|
|
88
85
|
readonly "data-value": string;
|
|
89
86
|
readonly "data-state": "active" | "inactive";
|
|
90
87
|
readonly "aria-labelledby": string | undefined;
|
|
91
|
-
readonly "data-tabs-content": "";
|
|
92
88
|
};
|
|
93
89
|
}
|
|
94
90
|
export declare function useTabsRoot(props: TabsRootStateProps): TabsRootState;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SvelteMap } from "svelte/reactivity";
|
|
2
2
|
import { attachRef } from "svelte-toolbelt";
|
|
3
3
|
import { Context, watch } from "runed";
|
|
4
|
-
import { getAriaOrientation, getAriaSelected, getDataDisabled, getDataOrientation, getDisabled, getHidden, } from "../../internal/attrs.js";
|
|
4
|
+
import { createBitsAttrs, getAriaOrientation, getAriaSelected, getDataDisabled, getDataOrientation, getDisabled, getHidden, } from "../../internal/attrs.js";
|
|
5
5
|
import { kbd } from "../../internal/kbd.js";
|
|
6
6
|
import { useRovingFocus, } from "../../internal/use-roving-focus.svelte.js";
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const tabsAttrs = createBitsAttrs({
|
|
8
|
+
component: "tabs",
|
|
9
|
+
parts: ["root", "list", "trigger", "content"],
|
|
10
|
+
});
|
|
11
11
|
class TabsRootState {
|
|
12
12
|
opts;
|
|
13
13
|
rovingFocusGroup;
|
|
@@ -19,7 +19,7 @@ class TabsRootState {
|
|
|
19
19
|
constructor(opts) {
|
|
20
20
|
this.opts = opts;
|
|
21
21
|
this.rovingFocusGroup = useRovingFocus({
|
|
22
|
-
candidateAttr:
|
|
22
|
+
candidateAttr: tabsAttrs.trigger,
|
|
23
23
|
rootNode: this.opts.ref,
|
|
24
24
|
loop: this.opts.loop,
|
|
25
25
|
orientation: this.opts.orientation,
|
|
@@ -47,7 +47,7 @@ class TabsRootState {
|
|
|
47
47
|
props = $derived.by(() => ({
|
|
48
48
|
id: this.opts.id.current,
|
|
49
49
|
"data-orientation": getDataOrientation(this.opts.orientation.current),
|
|
50
|
-
[
|
|
50
|
+
[tabsAttrs.root]: "",
|
|
51
51
|
...attachRef(this.opts.ref),
|
|
52
52
|
}));
|
|
53
53
|
}
|
|
@@ -64,7 +64,7 @@ class TabsListState {
|
|
|
64
64
|
role: "tablist",
|
|
65
65
|
"aria-orientation": getAriaOrientation(this.root.opts.orientation.current),
|
|
66
66
|
"data-orientation": getDataOrientation(this.root.opts.orientation.current),
|
|
67
|
-
[
|
|
67
|
+
[tabsAttrs.list]: "",
|
|
68
68
|
"data-disabled": getDataDisabled(this.#isDisabled),
|
|
69
69
|
...attachRef(this.opts.ref),
|
|
70
70
|
}));
|
|
@@ -72,9 +72,9 @@ class TabsListState {
|
|
|
72
72
|
class TabsTriggerState {
|
|
73
73
|
opts;
|
|
74
74
|
root;
|
|
75
|
+
#tabIndex = $state(0);
|
|
75
76
|
#isActive = $derived.by(() => this.root.opts.value.current === this.opts.value.current);
|
|
76
77
|
#isDisabled = $derived.by(() => this.opts.disabled.current || this.root.opts.disabled.current);
|
|
77
|
-
#tabIndex = $state(0);
|
|
78
78
|
#ariaControls = $derived.by(() => this.root.valueToContentId.get(this.opts.value.current));
|
|
79
79
|
constructor(opts, root) {
|
|
80
80
|
this.opts = opts;
|
|
@@ -129,7 +129,7 @@ class TabsTriggerState {
|
|
|
129
129
|
"data-disabled": getDataDisabled(this.#isDisabled),
|
|
130
130
|
"aria-selected": getAriaSelected(this.#isActive),
|
|
131
131
|
"aria-controls": this.#ariaControls,
|
|
132
|
-
[
|
|
132
|
+
[tabsAttrs.trigger]: "",
|
|
133
133
|
disabled: getDisabled(this.#isDisabled),
|
|
134
134
|
tabindex: this.#tabIndex,
|
|
135
135
|
//
|
|
@@ -159,7 +159,7 @@ class TabsContentState {
|
|
|
159
159
|
"data-value": this.opts.value.current,
|
|
160
160
|
"data-state": getTabDataState(this.#isActive),
|
|
161
161
|
"aria-labelledby": this.#ariaLabelledBy,
|
|
162
|
-
[
|
|
162
|
+
[tabsAttrs.content]: "",
|
|
163
163
|
...attachRef(this.opts.ref),
|
|
164
164
|
}));
|
|
165
165
|
}
|
|
@@ -8,7 +8,7 @@ import { type TimeFormatter } from "../../internal/date-time/formatter.js";
|
|
|
8
8
|
import { type Announcer } from "../../internal/date-time/announcer.js";
|
|
9
9
|
import type { TimeValue } from "../../shared/date/types.js";
|
|
10
10
|
import type { TimeRangeFieldRootState } from "../time-range-field/time-range-field.svelte.js";
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const timeFieldAttrs: import("../../internal/attrs.js").BitsAttrs<readonly ["input", "label"]>;
|
|
12
12
|
type SegmentConfig = {
|
|
13
13
|
min: number | ((root: TimeFieldRootState) => number);
|
|
14
14
|
max: number | ((root: TimeFieldRootState) => number);
|
|
@@ -160,7 +160,6 @@ export declare class TimeFieldInputState {
|
|
|
160
160
|
readonly "aria-disabled": "true" | "false";
|
|
161
161
|
readonly "data-invalid": "" | undefined;
|
|
162
162
|
readonly "data-disabled": "" | undefined;
|
|
163
|
-
readonly "data-time-field-input": "";
|
|
164
163
|
};
|
|
165
164
|
}
|
|
166
165
|
declare class TimeFieldHiddenInputState {
|
|
@@ -184,7 +183,6 @@ declare class TimeFieldLabelState {
|
|
|
184
183
|
readonly id: string;
|
|
185
184
|
readonly "data-invalid": "" | undefined;
|
|
186
185
|
readonly "data-disabled": "" | undefined;
|
|
187
|
-
readonly "data-time-field-label": "";
|
|
188
186
|
readonly onclick: (_: BitsMouseEvent) => void;
|
|
189
187
|
};
|
|
190
188
|
}
|
|
@@ -2,7 +2,7 @@ import { CalendarDateTime, Time, ZonedDateTime } from "@internationalized/date";
|
|
|
2
2
|
import { onDestroyEffect, attachRef, box, DOMContext } from "svelte-toolbelt";
|
|
3
3
|
import { onMount, untrack } from "svelte";
|
|
4
4
|
import { Context, watch } from "runed";
|
|
5
|
-
import { getAriaDisabled, getAriaHidden, getAriaInvalid, getAriaReadonly, getDataDisabled, getDataInvalid, getDataReadonly, } from "../../internal/attrs.js";
|
|
5
|
+
import { createBitsAttrs, getAriaDisabled, getAriaHidden, getAriaInvalid, getAriaReadonly, getDataDisabled, getDataInvalid, getDataReadonly, } from "../../internal/attrs.js";
|
|
6
6
|
import { isBrowser, isNumberString } from "../../internal/is.js";
|
|
7
7
|
import { kbd } from "../../internal/kbd.js";
|
|
8
8
|
import { useId } from "../../internal/use-id.js";
|
|
@@ -13,8 +13,10 @@ import { toDate } from "../../internal/date-time/utils.js";
|
|
|
13
13
|
import { areAllTimeSegmentsFilled, convertTimeValueToTime, createTimeContent, getISOTimeValue, getTimeValueFromSegments, initTimeSegmentStates, isFirstTimeSegment, isTimeBefore, removeTimeDescriptionElement, setTimeDescription, } from "../../internal/date-time/field/time-helpers.js";
|
|
14
14
|
import { getFirstTimeSegment, handleTimeSegmentNavigation, isSegmentNavigationKey, moveToNextTimeSegment, moveToPrevTimeSegment, } from "../../internal/date-time/field/segments.js";
|
|
15
15
|
import { getDefaultHourCycle, isAcceptableSegmentKey, } from "../../internal/date-time/field/helpers.js";
|
|
16
|
-
export const
|
|
17
|
-
|
|
16
|
+
export const timeFieldAttrs = createBitsAttrs({
|
|
17
|
+
component: "time-field",
|
|
18
|
+
parts: ["input", "label"],
|
|
19
|
+
});
|
|
18
20
|
const SEGMENT_CONFIGS = {
|
|
19
21
|
hour: {
|
|
20
22
|
min: (root) => (root.hourCycle === 12 ? 1 : 0),
|
|
@@ -478,7 +480,7 @@ export class TimeFieldInputState {
|
|
|
478
480
|
"aria-disabled": getAriaDisabled(this.root.disabled.current),
|
|
479
481
|
"data-invalid": this.root.isInvalid ? "" : undefined,
|
|
480
482
|
"data-disabled": getDataDisabled(this.root.disabled.current),
|
|
481
|
-
[
|
|
483
|
+
[timeFieldAttrs.input]: "",
|
|
482
484
|
...attachRef(this.opts.ref, (v) => this.root.setFieldNode(v)),
|
|
483
485
|
}));
|
|
484
486
|
}
|
|
@@ -515,7 +517,7 @@ class TimeFieldLabelState {
|
|
|
515
517
|
id: this.opts.id.current,
|
|
516
518
|
"data-invalid": getDataInvalid(this.root.isInvalid),
|
|
517
519
|
"data-disabled": getDataDisabled(this.root.disabled.current),
|
|
518
|
-
[
|
|
520
|
+
[timeFieldAttrs.label]: "",
|
|
519
521
|
onclick: this.onclick,
|
|
520
522
|
...attachRef(this.opts.ref, (v) => this.root.setLabelNode(v)),
|
|
521
523
|
}));
|
|
@@ -8,7 +8,7 @@ import type { TimeSegmentPart } from "../../shared/index.js";
|
|
|
8
8
|
import type { WithRefProps } from "../../internal/types.js";
|
|
9
9
|
import type { TimeGranularity, TimeOnInvalid, TimeRange, TimeRangeValidator, TimeValue } from "../../shared/date/types.js";
|
|
10
10
|
import { type TimeFormatter } from "../../internal/date-time/formatter.js";
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const timeRangeFieldAttrs: import("../../internal/attrs.js").BitsAttrs<readonly ["root", "label"]>;
|
|
12
12
|
type TimeRangeFieldRootStateProps<T extends TimeValue = Time> = WithRefProps<WritableBoxedValues<{
|
|
13
13
|
value: TimeRange<T>;
|
|
14
14
|
placeholder: TimeValue;
|
|
@@ -62,7 +62,6 @@ export declare class TimeRangeFieldRootState<T extends TimeValue = Time> {
|
|
|
62
62
|
props: {
|
|
63
63
|
readonly id: string;
|
|
64
64
|
readonly role: "group";
|
|
65
|
-
readonly "data-time-range-field-root": "";
|
|
66
65
|
readonly "data-invalid": "" | undefined;
|
|
67
66
|
};
|
|
68
67
|
}
|
|
@@ -76,7 +75,6 @@ declare class TimeRangeFieldLabelState {
|
|
|
76
75
|
readonly id: string;
|
|
77
76
|
readonly "data-invalid": "" | undefined;
|
|
78
77
|
readonly "data-disabled": "" | undefined;
|
|
79
|
-
readonly "data-time-range-field-label": "";
|
|
80
78
|
readonly onclick: () => void;
|
|
81
79
|
};
|
|
82
80
|
}
|
|
@@ -2,13 +2,15 @@ import { box, onDestroyEffect, attachRef, DOMContext } from "svelte-toolbelt";
|
|
|
2
2
|
import { Context, watch } from "runed";
|
|
3
3
|
import { TimeFieldInputState, useTimeFieldRoot } from "../time-field/time-field.svelte.js";
|
|
4
4
|
import { useId } from "../../internal/use-id.js";
|
|
5
|
-
import { getDataDisabled, getDataInvalid } from "../../internal/attrs.js";
|
|
5
|
+
import { createBitsAttrs, getDataDisabled, getDataInvalid } from "../../internal/attrs.js";
|
|
6
6
|
import { createTimeFormatter } from "../../internal/date-time/formatter.js";
|
|
7
7
|
import { removeDescriptionElement } from "../../internal/date-time/field/helpers.js";
|
|
8
8
|
import { getFirstSegment } from "../../internal/date-time/field/segments.js";
|
|
9
9
|
import { convertTimeValueToTime, isTimeBefore, } from "../../internal/date-time/field/time-helpers.js";
|
|
10
|
-
export const
|
|
11
|
-
|
|
10
|
+
export const timeRangeFieldAttrs = createBitsAttrs({
|
|
11
|
+
component: "time-range-field",
|
|
12
|
+
parts: ["root", "label"],
|
|
13
|
+
});
|
|
12
14
|
export class TimeRangeFieldRootState {
|
|
13
15
|
opts;
|
|
14
16
|
startFieldState = undefined;
|
|
@@ -151,7 +153,7 @@ export class TimeRangeFieldRootState {
|
|
|
151
153
|
props = $derived.by(() => ({
|
|
152
154
|
id: this.opts.id.current,
|
|
153
155
|
role: "group",
|
|
154
|
-
[
|
|
156
|
+
[timeRangeFieldAttrs.root]: "",
|
|
155
157
|
"data-invalid": getDataInvalid(this.isInvalid),
|
|
156
158
|
...attachRef(this.opts.ref, (v) => (this.fieldNode = v)),
|
|
157
159
|
}));
|
|
@@ -176,7 +178,7 @@ class TimeRangeFieldLabelState {
|
|
|
176
178
|
// TODO: invalid state for field
|
|
177
179
|
"data-invalid": getDataInvalid(this.root.isInvalid),
|
|
178
180
|
"data-disabled": getDataDisabled(this.root.opts.disabled.current),
|
|
179
|
-
[
|
|
181
|
+
[timeRangeFieldAttrs.label]: "",
|
|
180
182
|
onclick: this.#onclick,
|
|
181
183
|
...attachRef(this.opts.ref, (v) => (this.root.labelNode = v)),
|
|
182
184
|
}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReadableBoxedValues, WritableBoxedValues } from "../../internal/box.svelte.js";
|
|
2
2
|
import type { BitsMouseEvent, WithRefProps } from "../../internal/types.js";
|
|
3
|
+
export declare const toggleAttrs: import("../../internal/attrs.js").BitsAttrs<readonly ["root"]>;
|
|
3
4
|
type ToggleRootStateProps = WithRefProps<ReadableBoxedValues<{
|
|
4
5
|
disabled: boolean;
|
|
5
6
|
}> & WritableBoxedValues<{
|
|
@@ -10,11 +11,10 @@ declare class ToggleRootState {
|
|
|
10
11
|
readonly opts: ToggleRootStateProps;
|
|
11
12
|
constructor(opts: ToggleRootStateProps);
|
|
12
13
|
onclick(_: BitsMouseEvent): void;
|
|
13
|
-
snippetProps: {
|
|
14
|
+
readonly snippetProps: {
|
|
14
15
|
pressed: boolean;
|
|
15
16
|
};
|
|
16
|
-
props: {
|
|
17
|
-
readonly "data-toggle-root": "";
|
|
17
|
+
readonly props: {
|
|
18
18
|
readonly id: string;
|
|
19
19
|
readonly "data-disabled": "" | undefined;
|
|
20
20
|
readonly "aria-pressed": "true" | "false";
|