bits-ui 0.9.2 → 0.9.3
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/components/Accordion.svelte +3 -4
- package/dist/bits/accordion/components/Accordion.svelte.d.ts +0 -3
- package/dist/bits/alert-dialog/components/AlertDialogContent.svelte +7 -1
- package/dist/bits/alert-dialog/components/AlertDialogDescription.svelte +7 -1
- package/dist/bits/alert-dialog/components/AlertDialogTitle.svelte +7 -1
- package/dist/bits/alert-dialog/ctx.d.ts +1 -1
- package/dist/bits/context-menu/components/ContextMenuContent.svelte +7 -1
- package/dist/bits/context-menu/components/ContextMenuSubContent.svelte +7 -1
- package/dist/bits/context-menu/components/ContextMenuSubTrigger.svelte +7 -1
- package/dist/bits/context-menu/components/ContextMenuTrigger.svelte +7 -1
- package/dist/bits/dialog/components/DialogContent.svelte +7 -1
- package/dist/bits/dialog/components/DialogDescription.svelte +7 -1
- package/dist/bits/dialog/components/DialogTitle.svelte +7 -1
- package/dist/bits/dialog/ctx.d.ts +1 -1
- package/dist/bits/dropdown-menu/components/DropdownMenuContent.svelte +7 -1
- package/dist/bits/dropdown-menu/components/DropdownMenuSubContent.svelte +7 -1
- package/dist/bits/dropdown-menu/components/DropdownMenuSubTrigger.svelte +7 -1
- package/dist/bits/dropdown-menu/components/DropdownMenuTrigger.svelte +7 -1
- package/dist/bits/link-preview/components/LinkPreviewContent.svelte +7 -1
- package/dist/bits/link-preview/components/LinkPreviewTrigger.svelte +7 -1
- package/dist/bits/menubar/components/Menubar.svelte +5 -0
- package/dist/bits/menubar/components/MenubarContent.svelte +7 -1
- package/dist/bits/menubar/components/MenubarSubContent.svelte +7 -1
- package/dist/bits/menubar/components/MenubarSubTrigger.svelte +7 -1
- package/dist/bits/menubar/components/MenubarTrigger.svelte +7 -1
- package/dist/bits/menubar/ctx.d.ts +4 -2
- package/dist/bits/popover/components/PopoverContent.svelte +7 -1
- package/dist/bits/popover/components/PopoverTrigger.svelte +7 -1
- package/dist/bits/popover/ctx.d.ts +1 -1
- package/dist/bits/select/components/SelectContent.svelte +7 -1
- package/dist/bits/select/components/SelectLabel.svelte +9 -3
- package/dist/bits/select/components/SelectTrigger.svelte +7 -1
- package/dist/bits/slider/components/Slider.svelte +3 -4
- package/dist/bits/slider/components/Slider.svelte.d.ts +0 -3
- package/dist/bits/slider/components/SliderInput.svelte.d.ts +1 -1
- package/dist/bits/slider/components/SliderThumb.svelte +1 -1
- package/dist/bits/slider/components/SliderThumb.svelte.d.ts +1 -0
- package/dist/bits/slider/ctx.d.ts +0 -3
- package/dist/bits/tooltip/components/TooltipContent.svelte +7 -1
- package/dist/bits/tooltip/components/TooltipTrigger.svelte +7 -1
- package/dist/internal/attrs.d.ts +1 -1
- package/package.json +2 -2
|
@@ -8,8 +8,7 @@ export let asChild = false;
|
|
|
8
8
|
const {
|
|
9
9
|
elements: { root },
|
|
10
10
|
states: { value: localValue },
|
|
11
|
-
updateOption
|
|
12
|
-
ids
|
|
11
|
+
updateOption
|
|
13
12
|
} = setCtx({
|
|
14
13
|
multiple,
|
|
15
14
|
disabled,
|
|
@@ -34,9 +33,9 @@ const attrs = getAttrs("root");
|
|
|
34
33
|
</script>
|
|
35
34
|
|
|
36
35
|
{#if asChild}
|
|
37
|
-
<slot {builder} {attrs}
|
|
36
|
+
<slot {builder} {attrs} />
|
|
38
37
|
{:else}
|
|
39
38
|
<div {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
40
|
-
<slot {builder} {attrs}
|
|
39
|
+
<slot {builder} {attrs} />
|
|
41
40
|
</div>
|
|
42
41
|
{/if}
|
|
@@ -6,11 +6,17 @@ export let inTransition = void 0;
|
|
|
6
6
|
export let inTransitionConfig = void 0;
|
|
7
7
|
export let outTransition = void 0;
|
|
8
8
|
export let outTransitionConfig = void 0;
|
|
9
|
+
export let id = void 0;
|
|
9
10
|
export let asChild = false;
|
|
10
11
|
const {
|
|
11
12
|
elements: { content },
|
|
12
|
-
states: { open }
|
|
13
|
+
states: { open },
|
|
14
|
+
ids
|
|
13
15
|
} = getCtx();
|
|
16
|
+
$:
|
|
17
|
+
if (id) {
|
|
18
|
+
ids.content.set(id);
|
|
19
|
+
}
|
|
14
20
|
$:
|
|
15
21
|
builder = $content;
|
|
16
22
|
const attrs = getAttrs("content");
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<script>import { melt } from "@melt-ui/svelte";
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
export let asChild = false;
|
|
4
|
+
export let id = void 0;
|
|
4
5
|
const {
|
|
5
|
-
elements: { description }
|
|
6
|
+
elements: { description },
|
|
7
|
+
ids
|
|
6
8
|
} = getCtx();
|
|
9
|
+
$:
|
|
10
|
+
if (id) {
|
|
11
|
+
ids.description.set(id);
|
|
12
|
+
}
|
|
7
13
|
$:
|
|
8
14
|
builder = $description;
|
|
9
15
|
const attrs = getAttrs("description");
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
export let level = "h2";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { title }
|
|
7
|
+
elements: { title },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
10
|
+
$:
|
|
11
|
+
if (id) {
|
|
12
|
+
ids.title.set(id);
|
|
13
|
+
}
|
|
8
14
|
$:
|
|
9
15
|
builder = $title;
|
|
10
16
|
const attrs = getAttrs("title");
|
|
@@ -6,8 +6,8 @@ export declare function setCtx(props: SetProps): {
|
|
|
6
6
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
7
7
|
ids: {
|
|
8
8
|
title: import("svelte/store").Writable<string>;
|
|
9
|
-
content: import("svelte/store").Writable<string>;
|
|
10
9
|
description: import("svelte/store").Writable<string>;
|
|
10
|
+
content: import("svelte/store").Writable<string>;
|
|
11
11
|
};
|
|
12
12
|
elements: {
|
|
13
13
|
content: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>], (node: HTMLElement) => {
|
|
@@ -9,11 +9,17 @@ export let inTransitionConfig = void 0;
|
|
|
9
9
|
export let outTransition = void 0;
|
|
10
10
|
export let outTransitionConfig = void 0;
|
|
11
11
|
export let asChild = false;
|
|
12
|
+
export let id = void 0;
|
|
12
13
|
const {
|
|
13
14
|
elements: { menu },
|
|
14
|
-
states: { open }
|
|
15
|
+
states: { open },
|
|
16
|
+
ids
|
|
15
17
|
} = getContent(sideOffset);
|
|
16
18
|
const dispatch = createDispatcher();
|
|
19
|
+
$:
|
|
20
|
+
if (id) {
|
|
21
|
+
ids.menu.set(id);
|
|
22
|
+
}
|
|
17
23
|
$:
|
|
18
24
|
builder = $menu;
|
|
19
25
|
const attrs = getAttrs("content");
|
|
@@ -8,12 +8,18 @@ export let inTransitionConfig = void 0;
|
|
|
8
8
|
export let outTransition = void 0;
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
|
+
export let id = void 0;
|
|
11
12
|
const {
|
|
12
13
|
elements: { subMenu },
|
|
13
|
-
states: { subOpen }
|
|
14
|
+
states: { subOpen },
|
|
15
|
+
ids
|
|
14
16
|
} = getSubContent();
|
|
15
17
|
$:
|
|
16
18
|
builder = $subMenu;
|
|
19
|
+
$:
|
|
20
|
+
if (id) {
|
|
21
|
+
ids.menu.set(id);
|
|
22
|
+
}
|
|
17
23
|
const dispatch = createDispatcher();
|
|
18
24
|
const attrs = getAttrs("sub-content");
|
|
19
25
|
</script>
|
|
@@ -4,10 +4,16 @@ import { disabledAttrs } from "../../../internal/index.js";
|
|
|
4
4
|
import { createDispatcher } from "../../../internal/events.js";
|
|
5
5
|
export let disabled = false;
|
|
6
6
|
export let asChild = false;
|
|
7
|
+
export let id = void 0;
|
|
7
8
|
const {
|
|
8
|
-
elements: { subTrigger }
|
|
9
|
+
elements: { subTrigger },
|
|
10
|
+
ids
|
|
9
11
|
} = getSubMenuCtx();
|
|
10
12
|
const dispatch = createDispatcher();
|
|
13
|
+
$:
|
|
14
|
+
if (id) {
|
|
15
|
+
ids.trigger.set(id);
|
|
16
|
+
}
|
|
11
17
|
$:
|
|
12
18
|
builder = $subTrigger;
|
|
13
19
|
$:
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
|
@@ -7,10 +7,16 @@ export let inTransitionConfig = void 0;
|
|
|
7
7
|
export let outTransition = void 0;
|
|
8
8
|
export let outTransitionConfig = void 0;
|
|
9
9
|
export let asChild = false;
|
|
10
|
+
export let id = void 0;
|
|
10
11
|
const {
|
|
11
12
|
elements: { content },
|
|
12
|
-
states: { open }
|
|
13
|
+
states: { open },
|
|
14
|
+
ids
|
|
13
15
|
} = getCtx();
|
|
16
|
+
$:
|
|
17
|
+
if (id) {
|
|
18
|
+
ids.content.set(id);
|
|
19
|
+
}
|
|
14
20
|
$:
|
|
15
21
|
builder = $content;
|
|
16
22
|
const attrs = getAttrs("content");
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<script>import { melt } from "@melt-ui/svelte";
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
export let asChild = false;
|
|
4
|
+
export let id = void 0;
|
|
4
5
|
const {
|
|
5
|
-
elements: { description }
|
|
6
|
+
elements: { description },
|
|
7
|
+
ids
|
|
6
8
|
} = getCtx();
|
|
9
|
+
$:
|
|
10
|
+
if (id) {
|
|
11
|
+
ids.description.set(id);
|
|
12
|
+
}
|
|
7
13
|
$:
|
|
8
14
|
builder = $description;
|
|
9
15
|
const attrs = getAttrs("description");
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
export let level = "h2";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { title }
|
|
7
|
+
elements: { title },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
10
|
+
$:
|
|
11
|
+
if (id) {
|
|
12
|
+
ids.title.set(id);
|
|
13
|
+
}
|
|
8
14
|
$:
|
|
9
15
|
builder = $title;
|
|
10
16
|
const attrs = getAttrs("title");
|
|
@@ -6,8 +6,8 @@ export declare function setCtx(props: SetProps): {
|
|
|
6
6
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
7
7
|
ids: {
|
|
8
8
|
title: import("svelte/store").Writable<string>;
|
|
9
|
-
content: import("svelte/store").Writable<string>;
|
|
10
9
|
description: import("svelte/store").Writable<string>;
|
|
10
|
+
content: import("svelte/store").Writable<string>;
|
|
11
11
|
};
|
|
12
12
|
elements: {
|
|
13
13
|
content: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>], (node: HTMLElement) => {
|
|
@@ -9,10 +9,16 @@ export let inTransitionConfig = void 0;
|
|
|
9
9
|
export let outTransition = void 0;
|
|
10
10
|
export let outTransitionConfig = void 0;
|
|
11
11
|
export let asChild = false;
|
|
12
|
+
export let id = void 0;
|
|
12
13
|
const {
|
|
13
14
|
elements: { menu },
|
|
14
|
-
states: { open }
|
|
15
|
+
states: { open },
|
|
16
|
+
ids
|
|
15
17
|
} = getContent(sideOffset);
|
|
18
|
+
$:
|
|
19
|
+
if (id) {
|
|
20
|
+
ids.menu.set(id);
|
|
21
|
+
}
|
|
16
22
|
$:
|
|
17
23
|
builder = $menu;
|
|
18
24
|
const attrs = getAttrs("content");
|
|
@@ -8,11 +8,17 @@ export let inTransitionConfig = void 0;
|
|
|
8
8
|
export let outTransition = void 0;
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
|
+
export let id = void 0;
|
|
11
12
|
const {
|
|
12
13
|
elements: { subMenu },
|
|
13
|
-
states: { subOpen }
|
|
14
|
+
states: { subOpen },
|
|
15
|
+
ids
|
|
14
16
|
} = getSubContent();
|
|
15
17
|
const dispatch = createDispatcher();
|
|
18
|
+
$:
|
|
19
|
+
if (id) {
|
|
20
|
+
ids.menu.set(id);
|
|
21
|
+
}
|
|
16
22
|
$:
|
|
17
23
|
builder = $subMenu;
|
|
18
24
|
const attrs = getAttrs("sub-content");
|
|
@@ -4,10 +4,16 @@ import { getSubTrigger, getAttrs } from "../ctx.js";
|
|
|
4
4
|
import { createDispatcher } from "../../../internal/events.js";
|
|
5
5
|
export let disabled = false;
|
|
6
6
|
export let asChild = false;
|
|
7
|
+
export let id = void 0;
|
|
7
8
|
const {
|
|
8
|
-
elements: { subTrigger }
|
|
9
|
+
elements: { subTrigger },
|
|
10
|
+
ids
|
|
9
11
|
} = getSubTrigger();
|
|
10
12
|
const dispatch = createDispatcher();
|
|
13
|
+
$:
|
|
14
|
+
if (id) {
|
|
15
|
+
ids.trigger.set(id);
|
|
16
|
+
}
|
|
11
17
|
$:
|
|
12
18
|
builder = $subTrigger;
|
|
13
19
|
$:
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
|
@@ -8,10 +8,16 @@ export let inTransitionConfig = void 0;
|
|
|
8
8
|
export let outTransition = void 0;
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
|
+
export let id = void 0;
|
|
11
12
|
const {
|
|
12
13
|
elements: { content },
|
|
13
|
-
states: { open }
|
|
14
|
+
states: { open },
|
|
15
|
+
ids
|
|
14
16
|
} = getCtx();
|
|
17
|
+
$:
|
|
18
|
+
if (id) {
|
|
19
|
+
ids.content.set(id);
|
|
20
|
+
}
|
|
15
21
|
$:
|
|
16
22
|
builder = $content;
|
|
17
23
|
const attrs = getAttrs("content");
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
|
@@ -4,6 +4,7 @@ import { derived } from "svelte/store";
|
|
|
4
4
|
export let loop = true;
|
|
5
5
|
export let closeOnEscape = true;
|
|
6
6
|
export let asChild = false;
|
|
7
|
+
export let id = void 0;
|
|
7
8
|
const {
|
|
8
9
|
elements: { menubar },
|
|
9
10
|
updateOption,
|
|
@@ -12,6 +13,10 @@ const {
|
|
|
12
13
|
const idValues = derived([ids.menubar], ([$menubarId]) => ({
|
|
13
14
|
menubar: $menubarId
|
|
14
15
|
}));
|
|
16
|
+
$:
|
|
17
|
+
if (id) {
|
|
18
|
+
ids.menubar.set(id);
|
|
19
|
+
}
|
|
15
20
|
$:
|
|
16
21
|
updateOption("loop", loop);
|
|
17
22
|
$:
|
|
@@ -9,11 +9,17 @@ export let inTransitionConfig = void 0;
|
|
|
9
9
|
export let outTransition = void 0;
|
|
10
10
|
export let outTransitionConfig = void 0;
|
|
11
11
|
export let asChild = false;
|
|
12
|
+
export let id = void 0;
|
|
12
13
|
const {
|
|
13
14
|
elements: { menu },
|
|
14
|
-
states: { open }
|
|
15
|
+
states: { open },
|
|
16
|
+
ids
|
|
15
17
|
} = getContent(sideOffset);
|
|
16
18
|
const dispatch = createDispatcher();
|
|
19
|
+
$:
|
|
20
|
+
if (id) {
|
|
21
|
+
ids.menu.set(id);
|
|
22
|
+
}
|
|
17
23
|
$:
|
|
18
24
|
builder = $menu;
|
|
19
25
|
const attrs = getAttrs("content");
|
|
@@ -8,11 +8,17 @@ export let inTransitionConfig = void 0;
|
|
|
8
8
|
export let outTransition = void 0;
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
|
+
export let id = void 0;
|
|
11
12
|
const {
|
|
12
13
|
elements: { subMenu },
|
|
13
|
-
states: { subOpen }
|
|
14
|
+
states: { subOpen },
|
|
15
|
+
ids
|
|
14
16
|
} = getSubMenuCtx();
|
|
15
17
|
const dispatch = createDispatcher();
|
|
18
|
+
$:
|
|
19
|
+
if (id) {
|
|
20
|
+
ids.menu.set(id);
|
|
21
|
+
}
|
|
16
22
|
$:
|
|
17
23
|
builder = $subMenu;
|
|
18
24
|
const attrs = getAttrs("sub-content");
|
|
@@ -4,10 +4,16 @@ import { getSubMenuCtx, getAttrs } from "../ctx.js";
|
|
|
4
4
|
import { createDispatcher } from "../../../internal/events.js";
|
|
5
5
|
export let disabled = false;
|
|
6
6
|
export let asChild = false;
|
|
7
|
+
export let id = void 0;
|
|
7
8
|
const {
|
|
8
|
-
elements: { subTrigger }
|
|
9
|
+
elements: { subTrigger },
|
|
10
|
+
ids
|
|
9
11
|
} = getSubMenuCtx();
|
|
10
12
|
const dispatch = createDispatcher();
|
|
13
|
+
$:
|
|
14
|
+
if (id) {
|
|
15
|
+
ids.trigger.set(id);
|
|
16
|
+
}
|
|
11
17
|
$:
|
|
12
18
|
builder = $subTrigger;
|
|
13
19
|
$:
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { getMenuCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getMenuCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
|
@@ -22,7 +22,8 @@ export declare function setCtx(props: MenubarProps): {
|
|
|
22
22
|
builders: {
|
|
23
23
|
createMenu: (props?: import("@melt-ui/svelte/dist/builders/menu")._CreateMenuProps | undefined) => {
|
|
24
24
|
ids: {
|
|
25
|
-
|
|
25
|
+
menu: import("svelte/store").Writable<string>;
|
|
26
|
+
trigger: import("svelte/store").Writable<string>;
|
|
26
27
|
};
|
|
27
28
|
elements: {
|
|
28
29
|
menu: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[Readable<boolean>, import("svelte/store").Writable<string | HTMLElement | null | undefined>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">, ([$isVisible, $portal, $menuId, $triggerId, $menubarId]: [boolean, string | HTMLElement | null | undefined, string, string, string]) => {
|
|
@@ -225,7 +226,8 @@ export declare function getCtx(): MenubarReturn;
|
|
|
225
226
|
export declare function setMenuCtx(props: CreateMenubarMenuProps): {
|
|
226
227
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
227
228
|
ids: {
|
|
228
|
-
|
|
229
|
+
menu: import("svelte/store").Writable<string>;
|
|
230
|
+
trigger: import("svelte/store").Writable<string>;
|
|
229
231
|
};
|
|
230
232
|
elements: {
|
|
231
233
|
menu: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[Readable<boolean>, import("svelte/store").Writable<string | HTMLElement | null | undefined>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>, import("svelte/store").Writable<string>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown">, ([$isVisible, $portal, $menuId, $triggerId, $menubarId]: [boolean, string | HTMLElement | null | undefined, string, string, string]) => {
|
|
@@ -7,10 +7,16 @@ export let inTransitionConfig = void 0;
|
|
|
7
7
|
export let outTransition = void 0;
|
|
8
8
|
export let outTransitionConfig = void 0;
|
|
9
9
|
export let asChild = false;
|
|
10
|
+
export let id = void 0;
|
|
10
11
|
const {
|
|
11
12
|
elements: { content },
|
|
12
|
-
states: { open }
|
|
13
|
+
states: { open },
|
|
14
|
+
ids
|
|
13
15
|
} = getCtx();
|
|
16
|
+
$:
|
|
17
|
+
if (id) {
|
|
18
|
+
ids.content.set(id);
|
|
19
|
+
}
|
|
14
20
|
$:
|
|
15
21
|
builder = $content;
|
|
16
22
|
const attrs = getAttrs("content");
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
|
@@ -58,8 +58,8 @@ export declare function setCtx(props: CreatePopoverProps): {
|
|
|
58
58
|
closeOnOutsideClick: import("svelte/store").Writable<boolean>;
|
|
59
59
|
closeOnEscape: import("svelte/store").Writable<boolean>;
|
|
60
60
|
closeFocus: import("svelte/store").Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
61
|
-
openFocus: import("svelte/store").Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
62
61
|
disableFocusTrap: import("svelte/store").Writable<boolean>;
|
|
62
|
+
openFocus: import("svelte/store").Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
export declare function getCtx(): PopoverReturn;
|
|
@@ -8,13 +8,19 @@ export let inTransitionConfig = void 0;
|
|
|
8
8
|
export let outTransition = void 0;
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
|
+
export let id = void 0;
|
|
11
12
|
const {
|
|
12
13
|
elements: { menu },
|
|
13
|
-
states: { open }
|
|
14
|
+
states: { open },
|
|
15
|
+
ids
|
|
14
16
|
} = getCtx();
|
|
15
17
|
const dispatch = createDispatcher();
|
|
16
18
|
$:
|
|
17
19
|
builder = $menu;
|
|
20
|
+
$:
|
|
21
|
+
if (id) {
|
|
22
|
+
ids.menu.set(id);
|
|
23
|
+
}
|
|
18
24
|
const attrs = getAttrs("content");
|
|
19
25
|
</script>
|
|
20
26
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<script>import { melt } from "@melt-ui/svelte";
|
|
2
|
-
import { getGroupLabel, getAttrs } from "../ctx.js";
|
|
2
|
+
import { getGroupLabel, getAttrs, getCtx } from "../ctx.js";
|
|
3
3
|
export let asChild = false;
|
|
4
|
-
|
|
4
|
+
export let id = void 0;
|
|
5
|
+
const { ids } = getCtx();
|
|
6
|
+
const { groupLabel, id: groupId } = getGroupLabel();
|
|
5
7
|
$:
|
|
6
|
-
|
|
8
|
+
if (id) {
|
|
9
|
+
ids.label.set(id);
|
|
10
|
+
}
|
|
11
|
+
$:
|
|
12
|
+
builder = $groupLabel(groupId);
|
|
7
13
|
const attrs = getAttrs("label");
|
|
8
14
|
</script>
|
|
9
15
|
|
|
@@ -3,8 +3,14 @@ import { getCtx, getAttrs } from "../ctx.js";
|
|
|
3
3
|
import { createDispatcher } from "../../../internal/events.js";
|
|
4
4
|
export let asChild = false;
|
|
5
5
|
const {
|
|
6
|
-
elements: { trigger }
|
|
6
|
+
elements: { trigger },
|
|
7
|
+
ids
|
|
7
8
|
} = getCtx();
|
|
9
|
+
export let id = void 0;
|
|
10
|
+
$:
|
|
11
|
+
if (id) {
|
|
12
|
+
ids.trigger.set(id);
|
|
13
|
+
}
|
|
8
14
|
const dispatch = createDispatcher();
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
@@ -11,8 +11,7 @@ export let asChild = false;
|
|
|
11
11
|
const {
|
|
12
12
|
elements: { root },
|
|
13
13
|
states: { value: localValue, ticks },
|
|
14
|
-
updateOption
|
|
15
|
-
ids
|
|
14
|
+
updateOption
|
|
16
15
|
} = setCtx({
|
|
17
16
|
disabled,
|
|
18
17
|
min,
|
|
@@ -46,9 +45,9 @@ const attrs = getAttrs("root");
|
|
|
46
45
|
</script>
|
|
47
46
|
|
|
48
47
|
{#if asChild}
|
|
49
|
-
<slot {builder} {attrs}
|
|
48
|
+
<slot {builder} {attrs} ticks={$ticks} />
|
|
50
49
|
{:else}
|
|
51
50
|
<span {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
52
|
-
<slot {builder} {attrs}
|
|
51
|
+
<slot {builder} {attrs} ticks={$ticks} />
|
|
53
52
|
</span>
|
|
54
53
|
{/if}
|
|
@@ -20,6 +20,7 @@ declare const __propDef: {
|
|
|
20
20
|
contextmenu?: string | null | undefined;
|
|
21
21
|
title?: string | null | undefined;
|
|
22
22
|
role?: import("svelte/elements.js").AriaRole | null | undefined;
|
|
23
|
+
id?: string | null | undefined;
|
|
23
24
|
type?: import("svelte/elements.js").HTMLInputTypeAttribute | null | undefined;
|
|
24
25
|
accesskey?: string | null | undefined;
|
|
25
26
|
autofocus?: boolean | null | undefined;
|
|
@@ -28,7 +29,6 @@ declare const __propDef: {
|
|
|
28
29
|
dir?: string | null | undefined;
|
|
29
30
|
draggable?: import("svelte/elements.js").Booleanish | null | undefined;
|
|
30
31
|
enterkeyhint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | null | undefined;
|
|
31
|
-
id?: string | null | undefined;
|
|
32
32
|
lang?: string | null | undefined;
|
|
33
33
|
part?: string | null | undefined;
|
|
34
34
|
slot?: string | null | undefined;
|
|
@@ -3,9 +3,6 @@ import { type CreateSliderProps, type Slider as SliderReturn } from "@melt-ui/sv
|
|
|
3
3
|
export declare const getAttrs: (part: "root" | "input" | "range" | "thumb" | "tick") => Record<string, string>;
|
|
4
4
|
export declare function setCtx(props: CreateSliderProps): {
|
|
5
5
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
6
|
-
ids: {
|
|
7
|
-
[x: string]: string;
|
|
8
|
-
};
|
|
9
6
|
elements: {
|
|
10
7
|
root: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Writable<boolean>, import("svelte/store").Writable<"horizontal" | "vertical">], import("svelte/action").Action<any, any, Record<never, any>>, ([$disabled, $orientation]: [boolean, "horizontal" | "vertical"]) => {
|
|
11
8
|
disabled: boolean | undefined;
|
|
@@ -9,11 +9,17 @@ export let outTransition = void 0;
|
|
|
9
9
|
export let outTransitionConfig = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
11
|
export let sideOffset = 4;
|
|
12
|
+
export let id = void 0;
|
|
12
13
|
const {
|
|
13
14
|
elements: { content },
|
|
14
|
-
states: { open }
|
|
15
|
+
states: { open },
|
|
16
|
+
ids
|
|
15
17
|
} = getCtx(sideOffset);
|
|
16
18
|
const dispatch = createDispatcher();
|
|
19
|
+
$:
|
|
20
|
+
if (id) {
|
|
21
|
+
ids.content.set(id);
|
|
22
|
+
}
|
|
17
23
|
$:
|
|
18
24
|
builder = $content;
|
|
19
25
|
const attrs = getAttrs("content");
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
import { createDispatcher } from "../../../internal/index.js";
|
|
3
3
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
4
4
|
export let asChild = false;
|
|
5
|
+
export let id = void 0;
|
|
5
6
|
const {
|
|
6
|
-
elements: { trigger }
|
|
7
|
+
elements: { trigger },
|
|
8
|
+
ids
|
|
7
9
|
} = getCtx();
|
|
8
10
|
const dispatch = createDispatcher();
|
|
11
|
+
$:
|
|
12
|
+
if (id) {
|
|
13
|
+
ids.trigger.set(id);
|
|
14
|
+
}
|
|
9
15
|
$:
|
|
10
16
|
builder = $trigger;
|
|
11
17
|
const attrs = getAttrs("trigger");
|
package/dist/internal/attrs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Bit } from "@/content/api-reference/index.js";
|
|
2
2
|
export declare function createBitAttrs<T extends readonly string[]>(bit: Bit, parts: T): (part: T[number]) => Record<string, string>;
|
|
3
|
-
export declare function disabledAttrs(disabled: boolean): {
|
|
3
|
+
export declare function disabledAttrs(disabled: boolean | undefined | null): {
|
|
4
4
|
"aria-disabled": boolean;
|
|
5
5
|
"data-disabled": string;
|
|
6
6
|
} | {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bits-ui",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "github:huntabyte/bits-ui",
|
|
6
6
|
"scripts": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"types": "./dist/index.d.ts",
|
|
93
93
|
"type": "module",
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"@melt-ui/svelte": "0.
|
|
95
|
+
"@melt-ui/svelte": "0.61.1",
|
|
96
96
|
"nanoid": "^5.0.3"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|