bits-ui 1.0.0-next.17 → 1.0.0-next.19
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/combobox/components/combobox-input.svelte +2 -2
- package/dist/bits/combobox/components/combobox-trigger.svelte +2 -2
- package/dist/bits/combobox/components/combobox.svelte +9 -7
- package/dist/bits/combobox/exports.d.ts +8 -8
- package/dist/bits/combobox/exports.js +8 -8
- package/dist/bits/combobox/types.d.ts +1 -1
- package/dist/bits/dialog/components/dialog-content.svelte +1 -1
- package/dist/bits/index.d.ts +0 -1
- package/dist/bits/index.js +0 -1
- package/dist/bits/menu/menu.svelte.js +2 -2
- package/dist/bits/menubar/menubar.svelte.js +1 -1
- package/dist/bits/{listbox/components/listbox-content-static.svelte → select/components/select-content-static.svelte} +6 -6
- package/dist/bits/{listbox/components/listbox-group-heading.svelte.d.ts → select/components/select-content-static.svelte.d.ts} +4 -4
- package/dist/bits/select/components/select-content.svelte +56 -35
- package/dist/bits/select/components/select-group-heading.svelte +3 -3
- package/dist/bits/select/components/select-group.svelte +4 -3
- package/dist/bits/{listbox/components/listbox-hidden-input.svelte → select/components/select-hidden-input.svelte} +4 -4
- package/dist/bits/{listbox/components/listbox-hidden-input.svelte.d.ts → select/components/select-hidden-input.svelte.d.ts} +4 -4
- package/dist/bits/select/components/select-item.svelte +14 -9
- package/dist/bits/select/components/select-scroll-down-button.svelte +20 -9
- package/dist/bits/select/components/select-scroll-down-button.svelte.d.ts +2 -2
- package/dist/bits/select/components/select-scroll-up-button.svelte +21 -10
- package/dist/bits/select/components/select-trigger.svelte +5 -7
- package/dist/bits/select/components/select-viewport.svelte +10 -0
- package/dist/bits/select/components/select.svelte +54 -56
- package/dist/bits/select/exports.d.ts +4 -7
- package/dist/bits/select/exports.js +3 -6
- package/dist/bits/select/select.svelte.d.ts +272 -258
- package/dist/bits/select/select.svelte.js +764 -831
- package/dist/bits/select/types.d.ts +128 -79
- package/dist/bits/slider/components/slider.svelte +2 -2
- package/dist/bits/slider/slider.svelte.d.ts +2 -2
- package/dist/bits/slider/slider.svelte.js +4 -4
- package/dist/bits/slider/types.d.ts +3 -2
- package/dist/bits/utilities/popper-layer/popper-layer.svelte +1 -3
- package/dist/internal/arrays.d.ts +23 -0
- package/dist/internal/arrays.js +35 -0
- package/dist/internal/date-time/calendar-helpers.svelte.js +6 -1
- package/dist/internal/use-body-scroll-lock.svelte.js +53 -42
- package/dist/internal/use-data-typeahead.svelte.d.ts +12 -0
- package/dist/internal/use-data-typeahead.svelte.js +30 -0
- package/dist/internal/use-dom-typeahead.svelte.d.ts +11 -0
- package/dist/internal/use-dom-typeahead.svelte.js +30 -0
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
- package/dist/bits/listbox/components/listbox-content-static.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-content.svelte +0 -76
- package/dist/bits/listbox/components/listbox-content.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-group-heading.svelte +0 -32
- package/dist/bits/listbox/components/listbox-group.svelte +0 -32
- package/dist/bits/listbox/components/listbox-group.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-item.svelte +0 -43
- package/dist/bits/listbox/components/listbox-item.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-scroll-down-button.svelte +0 -39
- package/dist/bits/listbox/components/listbox-scroll-down-button.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-scroll-up-button.svelte +0 -39
- package/dist/bits/listbox/components/listbox-scroll-up-button.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-trigger.svelte +0 -35
- package/dist/bits/listbox/components/listbox-trigger.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox-viewport.svelte +0 -54
- package/dist/bits/listbox/components/listbox-viewport.svelte.d.ts +0 -19
- package/dist/bits/listbox/components/listbox.svelte +0 -81
- package/dist/bits/listbox/components/listbox.svelte.d.ts +0 -18
- package/dist/bits/listbox/exports.d.ts +0 -12
- package/dist/bits/listbox/exports.js +0 -11
- package/dist/bits/listbox/index.d.ts +0 -1
- package/dist/bits/listbox/index.js +0 -1
- package/dist/bits/listbox/listbox.svelte.d.ts +0 -399
- package/dist/bits/listbox/listbox.svelte.js +0 -973
- package/dist/bits/listbox/types.d.ts +0 -177
- package/dist/bits/listbox/types.js +0 -1
- package/dist/bits/select/components/select-arrow.svelte +0 -21
- package/dist/bits/select/components/select-arrow.svelte.d.ts +0 -18
- package/dist/bits/select/components/select-content-floating.svelte +0 -73
- package/dist/bits/select/components/select-content-floating.svelte.d.ts +0 -33
- package/dist/bits/select/components/select-content-impl.svelte +0 -90
- package/dist/bits/select/components/select-content-impl.svelte.d.ts +0 -90
- package/dist/bits/select/components/select-content-item-aligned.svelte +0 -37
- package/dist/bits/select/components/select-content-item-aligned.svelte.d.ts +0 -29
- package/dist/bits/select/components/select-icon.svelte +0 -36
- package/dist/bits/select/components/select-icon.svelte.d.ts +0 -19
- package/dist/bits/select/components/select-item-text.svelte +0 -39
- package/dist/bits/select/components/select-item-text.svelte.d.ts +0 -19
- package/dist/bits/select/components/select-native.svelte +0 -36
- package/dist/bits/select/components/select-native.svelte.d.ts +0 -30
- package/dist/bits/select/components/select-provider.svelte +0 -10
- package/dist/bits/select/components/select-provider.svelte.d.ts +0 -23
- package/dist/bits/select/components/select-scroll-down-button-mounted.svelte +0 -33
- package/dist/bits/select/components/select-scroll-down-button-mounted.svelte.d.ts +0 -29
- package/dist/bits/select/components/select-scroll-up-button-mounted.svelte +0 -33
- package/dist/bits/select/components/select-scroll-up-button-mounted.svelte.d.ts +0 -29
- package/dist/bits/select/components/select-separator.svelte +0 -32
- package/dist/bits/select/components/select-separator.svelte.d.ts +0 -19
- package/dist/bits/select/components/select-value.svelte +0 -35
- package/dist/bits/select/components/select-value.svelte.d.ts +0 -19
- package/dist/internal/use-typeahead.svelte.d.ts +0 -34
- package/dist/internal/use-typeahead.svelte.js +0 -64
|
@@ -1,282 +1,332 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Credit to the Radix UI team for the original implementation.
|
|
5
|
-
*/
|
|
6
|
-
import { type ReadableBox, type WritableBox } from "svelte-toolbelt";
|
|
7
|
-
import type { ReadableBoxedValues, WritableBoxedValues } from "../../internal/box.svelte.js";
|
|
8
|
-
import type { Direction } from "../../shared/index.js";
|
|
9
|
-
import { type Typeahead } from "../../internal/use-typeahead.svelte.js";
|
|
1
|
+
import { Previous } from "runed";
|
|
2
|
+
import type { InteractOutsideEvent } from "../utilities/dismissible-layer/types.js";
|
|
3
|
+
import type { Box, ReadableBoxedValues, WritableBoxedValues } from "../../internal/box.svelte.js";
|
|
10
4
|
import type { WithRefProps } from "../../internal/types.js";
|
|
11
|
-
export declare const
|
|
5
|
+
export declare const INTERACTION_KEYS: string[];
|
|
6
|
+
export declare const FIRST_KEYS: string[];
|
|
7
|
+
export declare const LAST_KEYS: string[];
|
|
8
|
+
export declare const FIRST_LAST_KEYS: string[];
|
|
12
9
|
export declare const SELECTION_KEYS: string[];
|
|
13
10
|
export declare const CONTENT_MARGIN = 10;
|
|
14
|
-
|
|
15
|
-
export declare const setSelectTriggerContext: (value: SelectTriggerState) => SelectTriggerState;
|
|
16
|
-
export declare const setSelectContentContext: (value: SelectContentState) => SelectContentState, getSelectContentContext: <T extends SelectContentState | null | undefined = SelectContentState>(fallback?: T | undefined) => T extends null ? SelectContentState | null : SelectContentState;
|
|
17
|
-
export declare const setSelectItemContext: (value: SelectItemState) => SelectItemState, getSelectItemContext: <T extends SelectItemState | null | undefined = SelectItemState>(fallback?: T | undefined) => T extends null ? SelectItemState | null : SelectItemState;
|
|
18
|
-
export declare const setSelectContentItemAlignedContext: (value: SelectItemAlignedPositionState) => SelectItemAlignedPositionState, getSelectContentItemAlignedContext: <T extends SelectItemAlignedPositionState | null | undefined = SelectItemAlignedPositionState>(fallback?: T | undefined) => T extends null ? SelectItemAlignedPositionState | null : SelectItemAlignedPositionState;
|
|
19
|
-
type SelectRootStateProps = WritableBoxedValues<{
|
|
20
|
-
open: boolean;
|
|
21
|
-
value: string;
|
|
22
|
-
}> & ReadableBoxedValues<{
|
|
23
|
-
dir: Direction;
|
|
11
|
+
type SelectBaseRootStateProps = ReadableBoxedValues<{
|
|
24
12
|
disabled: boolean;
|
|
25
13
|
required: boolean;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
name: string;
|
|
15
|
+
loop: boolean;
|
|
16
|
+
scrollAlignment: "nearest" | "center";
|
|
17
|
+
items: {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
}> & WritableBoxedValues<{
|
|
23
|
+
open: boolean;
|
|
24
|
+
}> & {
|
|
25
|
+
isCombobox: boolean;
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
declare class SelectBaseRootState {
|
|
28
|
+
disabled: SelectBaseRootStateProps["disabled"];
|
|
29
|
+
required: SelectBaseRootStateProps["required"];
|
|
30
|
+
name: SelectBaseRootStateProps["name"];
|
|
31
|
+
loop: SelectBaseRootStateProps["loop"];
|
|
32
|
+
open: SelectBaseRootStateProps["open"];
|
|
33
|
+
scrollAlignment: SelectBaseRootStateProps["scrollAlignment"];
|
|
34
|
+
items: SelectBaseRootStateProps["items"];
|
|
35
|
+
touchedInput: boolean;
|
|
36
|
+
inputValue: string;
|
|
37
|
+
inputNode: HTMLElement | null;
|
|
44
38
|
contentNode: HTMLElement | null;
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
triggerNode: HTMLElement | null;
|
|
40
|
+
valueId: string;
|
|
41
|
+
highlightedNode: HTMLElement | null;
|
|
42
|
+
highlightedValue: string | null;
|
|
43
|
+
highlightedId: string | undefined;
|
|
44
|
+
highlightedLabel: string | null;
|
|
45
|
+
isUsingKeyboard: boolean;
|
|
46
|
+
isCombobox: boolean;
|
|
47
|
+
bitsAttrs: SelectBitsAttrs;
|
|
48
|
+
triggerPointerDownPos: {
|
|
47
49
|
x: number;
|
|
48
50
|
y: number;
|
|
49
|
-
} | null
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
nativeOptionsArr: ReadableBox<SelectNativeOption>[];
|
|
53
|
-
isFormControl: {
|
|
54
|
-
readonly current: boolean;
|
|
55
|
-
};
|
|
56
|
-
constructor(props: SelectRootStateProps);
|
|
57
|
-
handleClose: () => void;
|
|
58
|
-
focusTriggerNode: (preventScroll?: boolean) => void;
|
|
59
|
-
onNativeOptionAdd: (option: ReadableBox<SelectNativeOption>) => void;
|
|
60
|
-
onNativeOptionRemove: (option: ReadableBox<SelectNativeOption>) => void;
|
|
61
|
-
getTriggerTypeaheadCandidateNodes: () => HTMLElement[];
|
|
51
|
+
} | null;
|
|
52
|
+
constructor(props: SelectBaseRootStateProps);
|
|
53
|
+
setHighlightedNode: (node: HTMLElement | null) => void;
|
|
62
54
|
getCandidateNodes: () => HTMLElement[];
|
|
55
|
+
setHighlightedToFirstCandidate: () => void;
|
|
56
|
+
getNodeByValue: (value: string) => HTMLElement | null;
|
|
57
|
+
setOpen: (open: boolean) => void;
|
|
58
|
+
toggleOpen: () => void;
|
|
59
|
+
handleOpen: () => void;
|
|
60
|
+
handleClose: () => void;
|
|
61
|
+
toggleMenu: () => void;
|
|
63
62
|
}
|
|
64
|
-
type
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
declare class
|
|
63
|
+
type SelectSingleRootStateProps = SelectBaseRootStateProps & WritableBoxedValues<{
|
|
64
|
+
value: string;
|
|
65
|
+
}>;
|
|
66
|
+
declare class SelectSingleRootState extends SelectBaseRootState {
|
|
68
67
|
#private;
|
|
69
|
-
|
|
68
|
+
value: SelectSingleRootStateProps["value"];
|
|
69
|
+
isMulti: false;
|
|
70
|
+
hasValue: boolean;
|
|
71
|
+
currentLabel: string;
|
|
72
|
+
candidateLabels: string[];
|
|
73
|
+
dataTypeaheadEnabled: boolean;
|
|
74
|
+
constructor(props: SelectSingleRootStateProps);
|
|
75
|
+
includesItem: (itemValue: string) => boolean;
|
|
76
|
+
toggleItem: (itemValue: string, itemLabel?: string) => void;
|
|
77
|
+
}
|
|
78
|
+
type SelectMultipleRootStateProps = SelectBaseRootStateProps & WritableBoxedValues<{
|
|
79
|
+
value: string[];
|
|
80
|
+
}>;
|
|
81
|
+
declare class SelectMultipleRootState extends SelectBaseRootState {
|
|
82
|
+
#private;
|
|
83
|
+
value: SelectMultipleRootStateProps["value"];
|
|
84
|
+
isMulti: true;
|
|
85
|
+
hasValue: boolean;
|
|
86
|
+
constructor(props: SelectMultipleRootStateProps);
|
|
87
|
+
includesItem: (itemValue: string) => boolean;
|
|
88
|
+
toggleItem: (itemValue: string, itemLabel?: string) => void;
|
|
89
|
+
}
|
|
90
|
+
type SelectRootState = SelectSingleRootState | SelectMultipleRootState;
|
|
91
|
+
type SelectInputStateProps = WithRefProps;
|
|
92
|
+
declare class SelectInputState {
|
|
93
|
+
#private;
|
|
94
|
+
root: SelectRootState;
|
|
95
|
+
constructor(props: SelectInputStateProps, root: SelectRootState);
|
|
70
96
|
props: {
|
|
97
|
+
readonly [x: string]: string | true | ((e: KeyboardEvent) => Promise<void>) | ((e: Event & {
|
|
98
|
+
currentTarget: HTMLInputElement;
|
|
99
|
+
}) => void) | undefined;
|
|
71
100
|
readonly id: string;
|
|
72
|
-
readonly disabled: boolean;
|
|
73
101
|
readonly role: "combobox";
|
|
74
|
-
readonly
|
|
75
|
-
readonly "aria-
|
|
102
|
+
readonly disabled: true | undefined;
|
|
103
|
+
readonly "aria-activedescendant": string | undefined;
|
|
104
|
+
readonly "aria-autocomplete": "list";
|
|
76
105
|
readonly "aria-expanded": "true" | "false";
|
|
77
|
-
readonly "aria-required": "true" | "false";
|
|
78
|
-
readonly "aria-autocomplete": "none";
|
|
79
|
-
readonly dir: Direction;
|
|
80
106
|
readonly "data-state": "open" | "closed";
|
|
81
107
|
readonly "data-disabled": "" | undefined;
|
|
82
|
-
readonly
|
|
83
|
-
readonly
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
readonly onpointerup: (e: PointerEvent) => void;
|
|
87
|
-
readonly onkeydown: (e: KeyboardEvent) => void;
|
|
108
|
+
readonly onkeydown: (e: KeyboardEvent) => Promise<void>;
|
|
109
|
+
readonly oninput: (e: Event & {
|
|
110
|
+
currentTarget: HTMLInputElement;
|
|
111
|
+
}) => void;
|
|
88
112
|
};
|
|
89
113
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
constructor(root:
|
|
114
|
+
type SelectComboTriggerStateProps = WithRefProps;
|
|
115
|
+
declare class SelectComboTriggerState {
|
|
116
|
+
#private;
|
|
117
|
+
root: SelectBaseRootState;
|
|
118
|
+
constructor(props: SelectComboTriggerStateProps, root: SelectBaseRootState);
|
|
95
119
|
props: {
|
|
120
|
+
readonly [x: string]: string | true | ((e: KeyboardEvent) => void) | ((e: MouseEvent) => void) | undefined;
|
|
96
121
|
readonly id: string;
|
|
122
|
+
readonly disabled: true | undefined;
|
|
123
|
+
readonly "aria-haspopup": "listbox";
|
|
97
124
|
readonly "data-state": "open" | "closed";
|
|
98
125
|
readonly "data-disabled": "" | undefined;
|
|
99
|
-
readonly
|
|
100
|
-
readonly
|
|
101
|
-
readonly pointerEvents: "none";
|
|
102
|
-
};
|
|
126
|
+
readonly onpointerdown: (e: MouseEvent) => void;
|
|
127
|
+
readonly onkeydown: (e: KeyboardEvent) => void;
|
|
103
128
|
};
|
|
104
129
|
}
|
|
105
|
-
|
|
130
|
+
type SelectTriggerStateProps = WithRefProps;
|
|
131
|
+
declare class SelectTriggerState {
|
|
132
|
+
#private;
|
|
106
133
|
root: SelectRootState;
|
|
107
|
-
constructor(root: SelectRootState);
|
|
134
|
+
constructor(props: SelectTriggerStateProps, root: SelectRootState);
|
|
135
|
+
props: {
|
|
136
|
+
readonly [x: string]: string | true | ((e: KeyboardEvent) => void) | ((e: PointerEvent) => void) | undefined;
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly disabled: true | undefined;
|
|
139
|
+
readonly "aria-haspopup": "listbox";
|
|
140
|
+
readonly "data-state": "open" | "closed";
|
|
141
|
+
readonly "data-disabled": "" | undefined;
|
|
142
|
+
readonly onpointerdown: (e: PointerEvent) => void;
|
|
143
|
+
readonly onkeydown: (e: KeyboardEvent) => void;
|
|
144
|
+
readonly onclick: (e: MouseEvent) => void;
|
|
145
|
+
readonly onpointerup: (e: PointerEvent) => void;
|
|
146
|
+
};
|
|
108
147
|
}
|
|
109
|
-
type SelectContentStateProps = WithRefProps
|
|
110
|
-
|
|
111
|
-
}>>;
|
|
112
|
-
export declare class SelectContentState {
|
|
148
|
+
type SelectContentStateProps = WithRefProps;
|
|
149
|
+
declare class SelectContentState {
|
|
113
150
|
#private;
|
|
114
151
|
id: SelectContentStateProps["id"];
|
|
115
152
|
ref: SelectContentStateProps["ref"];
|
|
116
|
-
root: SelectRootState;
|
|
117
153
|
viewportNode: HTMLElement | null;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
selectedItemText: WritableBox<HTMLElement | null>;
|
|
121
|
-
position: SelectContentStateProps["position"];
|
|
122
|
-
isPositioned: WritableBox<boolean>;
|
|
123
|
-
firstValidItemFound: WritableBox<boolean>;
|
|
124
|
-
typeahead: Typeahead;
|
|
125
|
-
alignedPositionState: SelectItemAlignedPositionState | null;
|
|
154
|
+
root: SelectRootState;
|
|
155
|
+
isPositioned: boolean;
|
|
126
156
|
constructor(props: SelectContentStateProps, root: SelectRootState);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
selectedItemNode: HTMLElement;
|
|
131
|
-
selectedItemTextNode: HTMLElement | null;
|
|
132
|
-
} | {
|
|
133
|
-
selectedItemNode: null;
|
|
134
|
-
selectedItemTextNode: null;
|
|
157
|
+
handleInteractOutside: (e: InteractOutsideEvent) => void;
|
|
158
|
+
snippetProps: {
|
|
159
|
+
open: boolean;
|
|
135
160
|
};
|
|
136
|
-
focusSelectedItem: () => void;
|
|
137
|
-
itemRegister: (value: string, disabled: boolean) => void;
|
|
138
|
-
itemTextRegister: (node: HTMLElement | null, value: string, disabled: boolean) => void;
|
|
139
161
|
props: {
|
|
162
|
+
readonly [x: string]: string | (() => void) | {
|
|
163
|
+
readonly "--bits-combobox-content-transform-origin": string;
|
|
164
|
+
readonly "--bits-combobox-content-available-width": string;
|
|
165
|
+
readonly "--bits-combobox-content-available-height": string;
|
|
166
|
+
readonly "--bits-combobox-anchor-width": string;
|
|
167
|
+
readonly "--bits-combobox-anchor-height": string;
|
|
168
|
+
readonly "--bits-select-content-transform-origin"?: undefined;
|
|
169
|
+
readonly "--bits-select-content-available-width"?: undefined;
|
|
170
|
+
readonly "--bits-select-content-available-height"?: undefined;
|
|
171
|
+
readonly "--bits-select-anchor-width"?: undefined;
|
|
172
|
+
readonly "--bits-select-anchor-height"?: undefined;
|
|
173
|
+
readonly display: "flex";
|
|
174
|
+
readonly flexDirection: "column";
|
|
175
|
+
readonly outline: "none";
|
|
176
|
+
readonly boxSizing: "border-box";
|
|
177
|
+
} | {
|
|
178
|
+
readonly "--bits-select-content-transform-origin": string;
|
|
179
|
+
readonly "--bits-select-content-available-width": string;
|
|
180
|
+
readonly "--bits-select-content-available-height": string;
|
|
181
|
+
readonly "--bits-select-anchor-width": string;
|
|
182
|
+
readonly "--bits-select-anchor-height": string;
|
|
183
|
+
readonly "--bits-combobox-content-transform-origin"?: undefined;
|
|
184
|
+
readonly "--bits-combobox-content-available-width"?: undefined;
|
|
185
|
+
readonly "--bits-combobox-content-available-height"?: undefined;
|
|
186
|
+
readonly "--bits-combobox-anchor-width"?: undefined;
|
|
187
|
+
readonly "--bits-combobox-anchor-height"?: undefined;
|
|
188
|
+
readonly display: "flex";
|
|
189
|
+
readonly flexDirection: "column";
|
|
190
|
+
readonly outline: "none";
|
|
191
|
+
readonly boxSizing: "border-box";
|
|
192
|
+
};
|
|
140
193
|
readonly id: string;
|
|
141
194
|
readonly role: "listbox";
|
|
142
195
|
readonly "data-state": "open" | "closed";
|
|
143
196
|
readonly style: {
|
|
197
|
+
readonly "--bits-combobox-content-transform-origin": string;
|
|
198
|
+
readonly "--bits-combobox-content-available-width": string;
|
|
199
|
+
readonly "--bits-combobox-content-available-height": string;
|
|
200
|
+
readonly "--bits-combobox-anchor-width": string;
|
|
201
|
+
readonly "--bits-combobox-anchor-height": string;
|
|
202
|
+
readonly "--bits-select-content-transform-origin"?: undefined;
|
|
203
|
+
readonly "--bits-select-content-available-width"?: undefined;
|
|
204
|
+
readonly "--bits-select-content-available-height"?: undefined;
|
|
205
|
+
readonly "--bits-select-anchor-width"?: undefined;
|
|
206
|
+
readonly "--bits-select-anchor-height"?: undefined;
|
|
144
207
|
readonly display: "flex";
|
|
145
208
|
readonly flexDirection: "column";
|
|
146
209
|
readonly outline: "none";
|
|
210
|
+
readonly boxSizing: "border-box";
|
|
211
|
+
} | {
|
|
212
|
+
readonly "--bits-select-content-transform-origin": string;
|
|
213
|
+
readonly "--bits-select-content-available-width": string;
|
|
214
|
+
readonly "--bits-select-content-available-height": string;
|
|
215
|
+
readonly "--bits-select-anchor-width": string;
|
|
216
|
+
readonly "--bits-select-anchor-height": string;
|
|
217
|
+
readonly "--bits-combobox-content-transform-origin"?: undefined;
|
|
218
|
+
readonly "--bits-combobox-content-available-width"?: undefined;
|
|
219
|
+
readonly "--bits-combobox-content-available-height"?: undefined;
|
|
220
|
+
readonly "--bits-combobox-anchor-width"?: undefined;
|
|
221
|
+
readonly "--bits-combobox-anchor-height"?: undefined;
|
|
222
|
+
readonly display: "flex";
|
|
223
|
+
readonly flexDirection: "column";
|
|
224
|
+
readonly outline: "none";
|
|
225
|
+
readonly boxSizing: "border-box";
|
|
147
226
|
};
|
|
148
|
-
readonly
|
|
149
|
-
readonly onkeydown: (e: KeyboardEvent) => void;
|
|
150
|
-
readonly tabIndex: -1;
|
|
151
|
-
readonly "data-select-content": "";
|
|
227
|
+
readonly onpointermove: () => void;
|
|
152
228
|
};
|
|
153
229
|
}
|
|
154
230
|
type SelectItemStateProps = WithRefProps<ReadableBoxedValues<{
|
|
155
231
|
value: string;
|
|
156
232
|
disabled: boolean;
|
|
157
|
-
|
|
233
|
+
label: string;
|
|
234
|
+
onHighlight: () => void;
|
|
235
|
+
onUnhighlight: () => void;
|
|
158
236
|
}>>;
|
|
159
237
|
declare class SelectItemState {
|
|
160
238
|
#private;
|
|
161
239
|
root: SelectRootState;
|
|
162
|
-
content: SelectContentState;
|
|
163
|
-
textId: WritableBox<string | undefined>;
|
|
164
240
|
value: SelectItemStateProps["value"];
|
|
241
|
+
label: SelectItemStateProps["label"];
|
|
242
|
+
onHighlight: SelectItemStateProps["onHighlight"];
|
|
243
|
+
onUnhighlight: SelectItemStateProps["onUnhighlight"];
|
|
165
244
|
disabled: SelectItemStateProps["disabled"];
|
|
166
|
-
textValue: SelectItemStateProps["textValue"];
|
|
167
245
|
isSelected: boolean;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
constructor(props: SelectItemStateProps,
|
|
172
|
-
|
|
246
|
+
isHighlighted: boolean;
|
|
247
|
+
prevHighlighted: Previous<boolean>;
|
|
248
|
+
textId: string;
|
|
249
|
+
constructor(props: SelectItemStateProps, root: SelectRootState);
|
|
250
|
+
snippetProps: {
|
|
251
|
+
selected: boolean;
|
|
252
|
+
highlighted: boolean;
|
|
253
|
+
};
|
|
173
254
|
setTextId: (id: string) => void;
|
|
174
|
-
handleSelect: (e?: PointerEvent) => Promise<void>;
|
|
175
255
|
props: {
|
|
256
|
+
readonly [x: string]: string | ((e: PointerEvent) => void) | undefined;
|
|
176
257
|
readonly id: string;
|
|
177
|
-
readonly
|
|
178
|
-
readonly "
|
|
179
|
-
readonly "data-highlighted": "" | undefined;
|
|
180
|
-
readonly "aria-selected": "true" | "false";
|
|
181
|
-
readonly "data-state": "checked" | "unchecked";
|
|
182
|
-
readonly "aria-disabled": "true" | "false";
|
|
258
|
+
readonly "aria-selected": "true" | undefined;
|
|
259
|
+
readonly "data-value": string;
|
|
183
260
|
readonly "data-disabled": "" | undefined;
|
|
261
|
+
readonly "data-highlighted": "" | undefined;
|
|
184
262
|
readonly "data-selected": "" | undefined;
|
|
185
|
-
readonly "data-
|
|
186
|
-
readonly
|
|
187
|
-
readonly "data-select-item": "";
|
|
188
|
-
readonly onfocus: () => void;
|
|
189
|
-
readonly onpointermove: (e: PointerEvent) => Promise<void>;
|
|
190
|
-
readonly onpointerleave: (e: PointerEvent) => Promise<void>;
|
|
263
|
+
readonly "data-label": string;
|
|
264
|
+
readonly onpointermove: (_: PointerEvent) => void;
|
|
191
265
|
readonly onpointerdown: (e: PointerEvent) => void;
|
|
192
|
-
readonly onpointerup: (e: PointerEvent) =>
|
|
193
|
-
readonly onkeydown: (e: KeyboardEvent) => Promise<void>;
|
|
194
|
-
readonly onblur: () => void;
|
|
195
|
-
readonly ontouchend: (e: TouchEvent) => void;
|
|
266
|
+
readonly onpointerup: (e: PointerEvent) => void;
|
|
196
267
|
};
|
|
197
268
|
}
|
|
198
|
-
type
|
|
199
|
-
declare class
|
|
269
|
+
type SelectGroupStateProps = WithRefProps;
|
|
270
|
+
declare class SelectGroupState {
|
|
200
271
|
#private;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
readonly key: string;
|
|
205
|
-
readonly value: string;
|
|
206
|
-
readonly disabled: boolean;
|
|
207
|
-
readonly innerHTML: string | null | undefined;
|
|
208
|
-
}>;
|
|
209
|
-
constructor(props: SelectItemTextStateProps, item: SelectItemState);
|
|
272
|
+
root: SelectBaseRootState;
|
|
273
|
+
labelNode: HTMLElement | null;
|
|
274
|
+
constructor(props: SelectGroupStateProps, root: SelectBaseRootState);
|
|
210
275
|
props: {
|
|
276
|
+
readonly [x: string]: string | undefined;
|
|
211
277
|
readonly id: string;
|
|
212
|
-
readonly
|
|
278
|
+
readonly role: "group";
|
|
279
|
+
readonly "aria-labelledby": string | undefined;
|
|
213
280
|
};
|
|
214
281
|
}
|
|
215
|
-
type
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
content: SelectContentState;
|
|
221
|
-
shouldExpandOnScroll: boolean;
|
|
222
|
-
shouldReposition: boolean;
|
|
223
|
-
contentWrapperId: string;
|
|
224
|
-
onPlaced: SelectItemAlignedPositionStateProps["onPlaced"];
|
|
225
|
-
contentZIndex: string;
|
|
226
|
-
constructor(props: SelectItemAlignedPositionStateProps, content: SelectContentState);
|
|
227
|
-
position: () => void;
|
|
228
|
-
handleScrollButtonChange: (id: string) => void;
|
|
229
|
-
wrapperProps: {
|
|
230
|
-
readonly id: string;
|
|
231
|
-
readonly style: {
|
|
232
|
-
readonly display: "flex";
|
|
233
|
-
readonly flexDirection: "column";
|
|
234
|
-
readonly position: "fixed";
|
|
235
|
-
readonly zIndex: string;
|
|
236
|
-
};
|
|
237
|
-
readonly "data-select-content-wrapper": "";
|
|
238
|
-
};
|
|
282
|
+
type SelectGroupHeadingStateProps = WithRefProps;
|
|
283
|
+
declare class SelectGroupHeadingState {
|
|
284
|
+
#private;
|
|
285
|
+
group: SelectGroupState;
|
|
286
|
+
constructor(props: SelectGroupHeadingStateProps, group: SelectGroupState);
|
|
239
287
|
props: {
|
|
288
|
+
readonly [x: string]: string;
|
|
240
289
|
readonly id: string;
|
|
241
|
-
readonly style: {
|
|
242
|
-
readonly boxSizing: "border-box";
|
|
243
|
-
readonly maxHeight: "100%";
|
|
244
|
-
};
|
|
245
290
|
};
|
|
246
291
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
292
|
+
type SelectHiddenInputStateProps = ReadableBoxedValues<{
|
|
293
|
+
value: string;
|
|
294
|
+
}>;
|
|
295
|
+
declare class SelectHiddenInputState {
|
|
296
|
+
#private;
|
|
297
|
+
root: SelectBaseRootState;
|
|
298
|
+
shouldRender: boolean;
|
|
299
|
+
constructor(props: SelectHiddenInputStateProps, root: SelectBaseRootState);
|
|
251
300
|
props: {
|
|
252
|
-
readonly
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
};
|
|
301
|
+
readonly disabled: true | undefined;
|
|
302
|
+
readonly required: true | undefined;
|
|
303
|
+
readonly name: string;
|
|
304
|
+
readonly value: string;
|
|
305
|
+
readonly style: string;
|
|
306
|
+
readonly tabindex: -1;
|
|
307
|
+
readonly onfocus: (e: FocusEvent) => void;
|
|
260
308
|
};
|
|
261
309
|
}
|
|
262
310
|
type SelectViewportStateProps = WithRefProps;
|
|
263
311
|
declare class SelectViewportState {
|
|
264
312
|
#private;
|
|
265
|
-
|
|
266
|
-
ref: SelectViewportStateProps["ref"];
|
|
313
|
+
root: SelectBaseRootState;
|
|
267
314
|
content: SelectContentState;
|
|
268
315
|
prevScrollTop: number;
|
|
269
316
|
constructor(props: SelectViewportStateProps, content: SelectContentState);
|
|
270
317
|
props: {
|
|
318
|
+
readonly [x: string]: string | {
|
|
319
|
+
readonly position: "relative";
|
|
320
|
+
readonly flex: 1;
|
|
321
|
+
readonly overflow: "auto";
|
|
322
|
+
};
|
|
271
323
|
readonly id: string;
|
|
272
324
|
readonly role: "presentation";
|
|
273
|
-
readonly "data-select-viewport": "";
|
|
274
325
|
readonly style: {
|
|
275
326
|
readonly position: "relative";
|
|
276
327
|
readonly flex: 1;
|
|
277
328
|
readonly overflow: "auto";
|
|
278
329
|
};
|
|
279
|
-
readonly onscroll: (e: WheelEvent) => void;
|
|
280
330
|
};
|
|
281
331
|
}
|
|
282
332
|
type SelectScrollButtonImplStateProps = WithRefProps<ReadableBoxedValues<{
|
|
@@ -287,7 +337,7 @@ declare class SelectScrollButtonImplState {
|
|
|
287
337
|
id: SelectScrollButtonImplStateProps["id"];
|
|
288
338
|
ref: SelectScrollButtonImplStateProps["ref"];
|
|
289
339
|
content: SelectContentState;
|
|
290
|
-
|
|
340
|
+
root: SelectBaseRootState;
|
|
291
341
|
autoScrollTimer: number | null;
|
|
292
342
|
onAutoScroll: () => void;
|
|
293
343
|
mounted: SelectScrollButtonImplStateProps["mounted"];
|
|
@@ -295,7 +345,7 @@ declare class SelectScrollButtonImplState {
|
|
|
295
345
|
clearAutoScrollTimer: () => void;
|
|
296
346
|
props: {
|
|
297
347
|
readonly id: string;
|
|
298
|
-
readonly "aria-hidden": "true";
|
|
348
|
+
readonly "aria-hidden": "true" | undefined;
|
|
299
349
|
readonly style: {
|
|
300
350
|
readonly flexShrink: 0;
|
|
301
351
|
};
|
|
@@ -307,13 +357,13 @@ declare class SelectScrollButtonImplState {
|
|
|
307
357
|
declare class SelectScrollDownButtonState {
|
|
308
358
|
state: SelectScrollButtonImplState;
|
|
309
359
|
content: SelectContentState;
|
|
360
|
+
root: SelectBaseRootState;
|
|
310
361
|
canScrollDown: boolean;
|
|
311
362
|
constructor(state: SelectScrollButtonImplState);
|
|
312
363
|
handleAutoScroll: () => void;
|
|
313
364
|
props: {
|
|
314
|
-
readonly "data-select-scroll-down-button": "";
|
|
315
365
|
readonly id: string;
|
|
316
|
-
readonly "aria-hidden": "true";
|
|
366
|
+
readonly "aria-hidden": "true" | undefined;
|
|
317
367
|
readonly style: {
|
|
318
368
|
readonly flexShrink: 0;
|
|
319
369
|
};
|
|
@@ -325,13 +375,13 @@ declare class SelectScrollDownButtonState {
|
|
|
325
375
|
declare class SelectScrollUpButtonState {
|
|
326
376
|
state: SelectScrollButtonImplState;
|
|
327
377
|
content: SelectContentState;
|
|
378
|
+
root: SelectBaseRootState;
|
|
328
379
|
canScrollUp: boolean;
|
|
329
380
|
constructor(state: SelectScrollButtonImplState);
|
|
330
381
|
handleAutoScroll: () => void;
|
|
331
382
|
props: {
|
|
332
|
-
readonly "data-select-scroll-up-button": "";
|
|
333
383
|
readonly id: string;
|
|
334
|
-
readonly "aria-hidden": "true";
|
|
384
|
+
readonly "aria-hidden": "true" | undefined;
|
|
335
385
|
readonly style: {
|
|
336
386
|
readonly flexShrink: 0;
|
|
337
387
|
};
|
|
@@ -340,74 +390,38 @@ declare class SelectScrollUpButtonState {
|
|
|
340
390
|
readonly onpointerleave: () => void;
|
|
341
391
|
};
|
|
342
392
|
}
|
|
343
|
-
type
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
type SelectSeparatorStateProps = WithRefProps;
|
|
366
|
-
declare class SelectSeparatorState {
|
|
367
|
-
#private;
|
|
368
|
-
constructor(props: SelectSeparatorStateProps);
|
|
369
|
-
props: {
|
|
370
|
-
readonly id: string;
|
|
371
|
-
readonly "data-select-separator": "";
|
|
372
|
-
readonly "aria-hidden": "true" | undefined;
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
type SelectArrowStateProps = WithRefProps;
|
|
376
|
-
declare class SelectArrowState {
|
|
377
|
-
#private;
|
|
378
|
-
constructor(props: SelectArrowStateProps);
|
|
379
|
-
props: {
|
|
380
|
-
readonly id: string;
|
|
381
|
-
readonly "data-select-arrow": "";
|
|
382
|
-
readonly "aria-hidden": "true" | undefined;
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
type SelectIconStateProps = WithRefProps;
|
|
386
|
-
declare class SelectIconState {
|
|
387
|
-
#private;
|
|
388
|
-
constructor(props: SelectIconStateProps);
|
|
389
|
-
props: {
|
|
390
|
-
readonly id: string;
|
|
391
|
-
readonly "data-select-icon": "";
|
|
392
|
-
readonly "aria-hidden": "true" | undefined;
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
export declare function useSelectRoot(props: SelectRootStateProps): SelectRootState;
|
|
396
|
-
export declare function useSelectContentFrag(): SelectContentFragState;
|
|
393
|
+
type InitSelectProps = {
|
|
394
|
+
type: "single" | "multiple";
|
|
395
|
+
value: Box<string> | Box<string[]>;
|
|
396
|
+
} & ReadableBoxedValues<{
|
|
397
|
+
disabled: boolean;
|
|
398
|
+
required: boolean;
|
|
399
|
+
loop: boolean;
|
|
400
|
+
scrollAlignment: "nearest" | "center";
|
|
401
|
+
name: string;
|
|
402
|
+
items: {
|
|
403
|
+
value: string;
|
|
404
|
+
label: string;
|
|
405
|
+
disabled?: boolean;
|
|
406
|
+
}[];
|
|
407
|
+
}> & WritableBoxedValues<{
|
|
408
|
+
open: boolean;
|
|
409
|
+
}> & {
|
|
410
|
+
isCombobox: boolean;
|
|
411
|
+
};
|
|
412
|
+
export declare function useSelectRoot(props: InitSelectProps): SelectRootState;
|
|
413
|
+
export declare function useSelectInput(props: SelectInputStateProps): SelectInputState;
|
|
397
414
|
export declare function useSelectContent(props: SelectContentStateProps): SelectContentState;
|
|
398
|
-
export declare function useSelectItemAlignedPosition(props: SelectItemAlignedPositionStateProps): SelectItemAlignedPositionState;
|
|
399
|
-
export declare function useSelectFloatingPosition(): SelectFloatingPositionState;
|
|
400
415
|
export declare function useSelectTrigger(props: SelectTriggerStateProps): SelectTriggerState;
|
|
401
|
-
export declare function
|
|
416
|
+
export declare function useSelectComboTrigger(props: SelectComboTriggerStateProps): SelectComboTriggerState;
|
|
402
417
|
export declare function useSelectItem(props: SelectItemStateProps): SelectItemState;
|
|
403
|
-
export declare function useSelectItemText(props: SelectItemTextStateProps): SelectItemTextState;
|
|
404
418
|
export declare function useSelectViewport(props: SelectViewportStateProps): SelectViewportState;
|
|
405
419
|
export declare function useSelectScrollUpButton(props: SelectScrollButtonImplStateProps): SelectScrollUpButtonState;
|
|
406
420
|
export declare function useSelectScrollDownButton(props: SelectScrollButtonImplStateProps): SelectScrollDownButtonState;
|
|
407
421
|
export declare function useSelectGroup(props: SelectGroupStateProps): SelectGroupState;
|
|
408
422
|
export declare function useSelectGroupHeading(props: SelectGroupHeadingStateProps): SelectGroupHeadingState;
|
|
409
|
-
export declare function
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
export declare function
|
|
423
|
+
export declare function useSelectHiddenInput(props: SelectHiddenInputStateProps): SelectHiddenInputState;
|
|
424
|
+
declare const selectParts: readonly ["trigger", "content", "item", "viewport", "scroll-up-button", "scroll-down-button", "group", "group-label", "separator", "arrow", "input", "content-wrapper", "item-text", "value"];
|
|
425
|
+
type SelectBitsAttrs = Record<(typeof selectParts)[number], string>;
|
|
426
|
+
export declare function getSelectBitsAttrs(root: SelectBaseRootState): SelectBitsAttrs;
|
|
413
427
|
export {};
|