bits-ui 0.9.5 → 0.9.7
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/toggle-group/components/ToggleGroup.svelte +3 -3
- package/dist/bits/toggle-group/components/ToggleGroup.svelte.d.ts +4 -2
- package/dist/bits/toggle-group/components/ToggleGroupItem.svelte +1 -1
- package/dist/bits/toggle-group/components/ToggleGroupItem.svelte.d.ts +3 -5
- package/dist/bits/toggle-group/types.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { melt } from "@melt-ui/svelte";
|
|
2
2
|
import { setCtx, getAttrs } from "../ctx.js";
|
|
3
|
-
export let
|
|
3
|
+
export let type = "single";
|
|
4
4
|
export let disabled = void 0;
|
|
5
5
|
export let loop = void 0;
|
|
6
6
|
export let value = void 0;
|
|
@@ -13,7 +13,7 @@ const {
|
|
|
13
13
|
updateOption
|
|
14
14
|
} = setCtx({
|
|
15
15
|
disabled,
|
|
16
|
-
type
|
|
16
|
+
type,
|
|
17
17
|
defaultValue: value,
|
|
18
18
|
loop,
|
|
19
19
|
orientation,
|
|
@@ -37,7 +37,7 @@ $:
|
|
|
37
37
|
$:
|
|
38
38
|
updateOption("loop", loop);
|
|
39
39
|
$:
|
|
40
|
-
updateOption("type",
|
|
40
|
+
updateOption("type", type);
|
|
41
41
|
$:
|
|
42
42
|
updateOption("orientation", orientation);
|
|
43
43
|
$:
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Props } from "../types.js";
|
|
3
3
|
declare class __sveltets_Render<T extends "single" | "multiple"> {
|
|
4
4
|
props(): Props<T>;
|
|
5
|
-
events():
|
|
5
|
+
events(): {} & {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
6
8
|
slots(): {
|
|
7
9
|
default: {
|
|
8
10
|
builder: {
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { ItemProps } from "../types";
|
|
2
|
+
import type { ItemProps, ItemEvents } from "../types.js";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: ItemProps;
|
|
5
|
-
events: {
|
|
6
|
-
[evt: string]: CustomEvent<any>;
|
|
7
|
-
};
|
|
8
5
|
slots: {
|
|
9
6
|
default: {
|
|
10
|
-
builder: ((props: import("@melt-ui/svelte").ToggleGroupItemProps) => {
|
|
7
|
+
builder: ((props: import("@melt-ui/svelte/index.js").ToggleGroupItemProps) => {
|
|
11
8
|
readonly disabled: true | undefined;
|
|
12
9
|
readonly pressed: boolean;
|
|
13
10
|
readonly 'data-orientation': import("@melt-ui/svelte/internal/types").Orientation;
|
|
@@ -27,6 +24,7 @@ declare const __propDef: {
|
|
|
27
24
|
attrs: Record<string, string>;
|
|
28
25
|
};
|
|
29
26
|
};
|
|
27
|
+
events: ItemEvents;
|
|
30
28
|
};
|
|
31
29
|
export type ToggleGroupItemProps = typeof __propDef.props;
|
|
32
30
|
export type ToggleGroupItemEvents = typeof __propDef.events;
|
|
@@ -2,17 +2,17 @@ import type { CreateToggleGroupProps } from "@melt-ui/svelte";
|
|
|
2
2
|
import type { AsChild, Expand, HTMLDivAttributes, OmitValue, OnChangeFn } from "../../internal/index.js";
|
|
3
3
|
import type { HTMLButtonAttributes } from "svelte/elements";
|
|
4
4
|
import type { CustomEventHandler } from "../../index.js";
|
|
5
|
-
type Props<T extends "single" | "multiple"> = Expand<OmitValue<CreateToggleGroupProps
|
|
5
|
+
type Props<T extends "single" | "multiple"> = Expand<OmitValue<CreateToggleGroupProps<T>> & {
|
|
6
6
|
value?: CreateToggleGroupProps<T>["defaultValue"];
|
|
7
7
|
onValueChange?: OnChangeFn<CreateToggleGroupProps<T>["defaultValue"]>;
|
|
8
|
-
|
|
8
|
+
type?: T;
|
|
9
9
|
}> & AsChild & HTMLDivAttributes;
|
|
10
10
|
type ItemProps = {
|
|
11
11
|
value: string;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
} & AsChild & HTMLButtonAttributes;
|
|
14
|
-
type
|
|
14
|
+
type ItemEvents<T extends Element = HTMLButtonElement> = {
|
|
15
15
|
click: CustomEventHandler<MouseEvent, T>;
|
|
16
16
|
keydown: CustomEventHandler<KeyboardEvent, T>;
|
|
17
17
|
};
|
|
18
|
-
export type { Props, ItemProps, Props as ToggleGroupProps, ItemProps as ToggleGroupItemProps,
|
|
18
|
+
export type { Props, ItemProps, Props as ToggleGroupProps, ItemProps as ToggleGroupItemProps, ItemEvents, ItemEvents as ToggleGroupItemEvents };
|