bits-ui 0.11.1 → 0.11.2
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.
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
import type { CreateSelectProps, SelectOptionProps } from "@melt-ui/svelte";
|
|
7
7
|
import type { AsChild, Expand, OmitFloating, OnChangeFn } from "../../internal/index.js";
|
|
8
8
|
import type { ContentProps, ArrowProps } from "../floating/_types.js";
|
|
9
|
+
type Items<T> = {
|
|
10
|
+
value: T;
|
|
11
|
+
label?: string;
|
|
12
|
+
}[];
|
|
9
13
|
type Props<T = unknown, Multiple extends boolean = false> = Expand<OmitFloating<Omit<CreateSelectProps, "selected" | "defaultSelected" | "onSelectedChange">> & {
|
|
10
14
|
/**
|
|
11
15
|
* The selected value of the select.
|
|
@@ -30,9 +34,14 @@ type Props<T = unknown, Multiple extends boolean = false> = Expand<OmitFloating<
|
|
|
30
34
|
*/
|
|
31
35
|
onOpenChange?: OnChangeFn<boolean>;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* Whether or not multiple values can be selected.
|
|
34
38
|
*/
|
|
35
39
|
multiple?: Multiple;
|
|
40
|
+
/**
|
|
41
|
+
* Optional array of items to add type-safety to the
|
|
42
|
+
* `onSelectedChange` callback and `selected` prop.
|
|
43
|
+
*/
|
|
44
|
+
items?: Items<T>;
|
|
36
45
|
}>;
|
|
37
46
|
type GroupProps = AsChild;
|
|
38
47
|
type InputProps = AsChild;
|
|
@@ -17,6 +17,10 @@ declare class __sveltets_Render<T extends unknown, Multiple extends boolean> {
|
|
|
17
17
|
onSelectedChange?: import("../../../internal/types.js").OnChangeFn<import("@melt-ui/svelte/internal/types").WhenTrue<Multiple, import("@melt-ui/svelte/index.js").ComboboxOption<T>[], import("@melt-ui/svelte/index.js").ComboboxOption<T>, import("@melt-ui/svelte/index.js").ComboboxOption<T>[] | import("@melt-ui/svelte/index.js").ComboboxOption<T>> | undefined> | undefined;
|
|
18
18
|
open?: boolean | undefined;
|
|
19
19
|
onOpenChange?: import("../../../internal/types.js").OnChangeFn<boolean> | undefined;
|
|
20
|
+
items?: {
|
|
21
|
+
value: T;
|
|
22
|
+
label?: string | undefined;
|
|
23
|
+
}[] | undefined;
|
|
20
24
|
}, "multiple"> & {
|
|
21
25
|
items?: {
|
|
22
26
|
value: T;
|