bits-ui 0.9.1 → 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/accordion/ctx.d.ts +1 -1
- package/dist/bits/alert-dialog/components/AlertDialog.svelte +11 -32
- package/dist/bits/alert-dialog/components/AlertDialog.svelte.d.ts +7 -3
- package/dist/bits/alert-dialog/components/AlertDialogContent.svelte +12 -17
- package/dist/bits/alert-dialog/components/AlertDialogContent.svelte.d.ts +1 -1
- package/dist/bits/alert-dialog/components/AlertDialogDescription.svelte +7 -1
- package/dist/bits/alert-dialog/components/AlertDialogOverlay.svelte +7 -7
- package/dist/bits/alert-dialog/components/AlertDialogTitle.svelte +7 -1
- package/dist/bits/alert-dialog/components/AlertDialogTrigger.svelte.d.ts +0 -1
- package/dist/bits/alert-dialog/ctx.d.ts +17 -21
- package/dist/bits/alert-dialog/ctx.js +1 -5
- package/dist/bits/context-menu/components/ContextMenu.svelte.d.ts +6 -2
- package/dist/bits/context-menu/components/ContextMenuContent.svelte +7 -1
- package/dist/bits/context-menu/components/ContextMenuSub.svelte.d.ts +6 -2
- 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/context-menu/components/ContextMenuTrigger.svelte.d.ts +1 -0
- package/dist/bits/context-menu/ctx.d.ts +37 -36
- package/dist/bits/dialog/components/Dialog.svelte +11 -35
- package/dist/bits/dialog/components/Dialog.svelte.d.ts +8 -4
- package/dist/bits/dialog/components/DialogContent.svelte +12 -17
- package/dist/bits/dialog/components/DialogContent.svelte.d.ts +1 -1
- package/dist/bits/dialog/components/DialogDescription.svelte +7 -1
- package/dist/bits/dialog/components/DialogOverlay.svelte +7 -7
- package/dist/bits/dialog/components/DialogTitle.svelte +7 -1
- package/dist/bits/dialog/components/DialogTrigger.svelte.d.ts +0 -1
- package/dist/bits/dialog/ctx.d.ts +17 -21
- package/dist/bits/dialog/ctx.js +1 -5
- package/dist/bits/dropdown-menu/components/DropdownMenu.svelte +6 -1
- package/dist/bits/dropdown-menu/components/DropdownMenu.svelte.d.ts +4 -0
- package/dist/bits/dropdown-menu/components/DropdownMenuContent.svelte +7 -1
- package/dist/bits/dropdown-menu/components/DropdownMenuSub.svelte +7 -2
- package/dist/bits/dropdown-menu/components/DropdownMenuSub.svelte.d.ts +4 -0
- 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/dropdown-menu/ctx.d.ts +35 -35
- package/dist/bits/link-preview/components/LinkPreview.svelte +7 -2
- package/dist/bits/link-preview/components/LinkPreview.svelte.d.ts +4 -0
- package/dist/bits/link-preview/components/LinkPreviewContent.svelte +7 -1
- package/dist/bits/link-preview/components/LinkPreviewTrigger.svelte +7 -1
- package/dist/bits/link-preview/ctx.d.ts +12 -12
- package/dist/bits/menubar/components/Menubar.svelte +11 -2
- package/dist/bits/menubar/components/Menubar.svelte.d.ts +3 -0
- package/dist/bits/menubar/components/MenubarContent.svelte +7 -1
- package/dist/bits/menubar/components/MenubarMenu.svelte +7 -2
- package/dist/bits/menubar/components/MenubarMenu.svelte.d.ts +6 -1
- package/dist/bits/menubar/components/MenubarSub.svelte +7 -2
- package/dist/bits/menubar/components/MenubarSub.svelte.d.ts +4 -0
- 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 +52 -42
- package/dist/bits/popover/components/Popover.svelte +6 -1
- package/dist/bits/popover/components/Popover.svelte.d.ts +5 -1
- 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 +7 -7
- package/dist/bits/select/components/Select.svelte +11 -2
- package/dist/bits/select/components/Select.svelte.d.ts +6 -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/select/components/SelectTrigger.svelte.d.ts +0 -1
- package/dist/bits/select/ctx.d.ts +6 -7
- 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/Tooltip.svelte +7 -2
- package/dist/bits/tooltip/components/Tooltip.svelte.d.ts +6 -2
- package/dist/bits/tooltip/components/TooltipContent.svelte +7 -1
- package/dist/bits/tooltip/components/TooltipTrigger.svelte +7 -1
- package/dist/bits/tooltip/ctx.d.ts +4 -4
- package/dist/internal/attrs.d.ts +1 -1
- package/dist/internal/index.d.ts +0 -1
- package/dist/internal/index.js +0 -1
- package/package.json +13 -13
- package/dist/internal/transition.d.ts +0 -11
- package/dist/internal/transition.js +0 -55
|
@@ -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,7 +6,7 @@ type GetReturn = AccordionReturn;
|
|
|
6
6
|
export declare function setCtx<Multiple extends boolean>(props: CreateAccordionProps<Multiple>): {
|
|
7
7
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
8
8
|
ids: {
|
|
9
|
-
|
|
9
|
+
[x: string]: string;
|
|
10
10
|
};
|
|
11
11
|
elements: {
|
|
12
12
|
root: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<import("svelte/store").Stores | undefined, import("svelte/action").Action<any, any, Record<never, any>>, () => {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { derived } from "svelte/store";
|
|
2
2
|
import { setCtx } from "../ctx.js";
|
|
3
|
-
import { onDestroy } from "svelte";
|
|
4
|
-
import { isBrowser } from "../../../internal/is.js";
|
|
5
3
|
export let preventScroll = void 0;
|
|
6
4
|
export let closeOnEscape = void 0;
|
|
7
5
|
export let closeOnOutsideClick = false;
|
|
@@ -9,9 +7,6 @@ export let portal = void 0;
|
|
|
9
7
|
export let forceVisible = true;
|
|
10
8
|
export let open = void 0;
|
|
11
9
|
export let onOpenChange = void 0;
|
|
12
|
-
const transitionTimes = writable({});
|
|
13
|
-
const tOpen = writable(open);
|
|
14
|
-
let timeout = 0;
|
|
15
10
|
const {
|
|
16
11
|
states: { open: localOpen },
|
|
17
12
|
updateOption,
|
|
@@ -23,38 +18,22 @@ const {
|
|
|
23
18
|
portal,
|
|
24
19
|
forceVisible,
|
|
25
20
|
defaultOpen: open,
|
|
26
|
-
transitionTimes,
|
|
27
|
-
tOpen,
|
|
28
21
|
onOpenChange: ({ next }) => {
|
|
29
22
|
if (open !== next) {
|
|
30
23
|
onOpenChange?.(next);
|
|
24
|
+
open = next;
|
|
31
25
|
}
|
|
32
|
-
if (next !== $tOpen) {
|
|
33
|
-
tOpen.set(next);
|
|
34
|
-
if (!next) {
|
|
35
|
-
window.clearTimeout(timeout);
|
|
36
|
-
timeout = window.setTimeout(
|
|
37
|
-
() => {
|
|
38
|
-
localOpen.set(next);
|
|
39
|
-
},
|
|
40
|
-
$transitionTimes.out ? $transitionTimes.out * 0.6 : 0
|
|
41
|
-
);
|
|
42
|
-
open = !next;
|
|
43
|
-
return !next;
|
|
44
|
-
} else {
|
|
45
|
-
open = next;
|
|
46
|
-
return next;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
open = next;
|
|
50
26
|
return next;
|
|
51
27
|
}
|
|
52
28
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
29
|
+
const idValues = derived(
|
|
30
|
+
[ids.content, ids.description, ids.title],
|
|
31
|
+
([$contentId, $descriptionId, $titleId]) => ({
|
|
32
|
+
content: $contentId,
|
|
33
|
+
description: $descriptionId,
|
|
34
|
+
title: $titleId
|
|
35
|
+
})
|
|
36
|
+
);
|
|
58
37
|
$:
|
|
59
38
|
open !== void 0 && localOpen.set(open);
|
|
60
39
|
$:
|
|
@@ -69,4 +48,4 @@ $:
|
|
|
69
48
|
updateOption("forceVisible", forceVisible);
|
|
70
49
|
</script>
|
|
71
50
|
|
|
72
|
-
<slot {
|
|
51
|
+
<slot ids={$idValues} />
|
|
@@ -5,9 +5,14 @@ declare const __propDef: {
|
|
|
5
5
|
closeOnEscape?: boolean | undefined;
|
|
6
6
|
closeOnOutsideClick?: boolean | undefined;
|
|
7
7
|
forceVisible?: boolean | undefined;
|
|
8
|
+
ids?: {
|
|
9
|
+
content: string;
|
|
10
|
+
description: string;
|
|
11
|
+
title: string;
|
|
12
|
+
} | undefined;
|
|
8
13
|
portal?: string | HTMLElement | null | undefined;
|
|
9
|
-
openFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
10
14
|
closeFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
15
|
+
openFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
11
16
|
open?: boolean | undefined;
|
|
12
17
|
onOpenChange?: import("../../../internal/types.js").OnChangeFn<boolean> | undefined;
|
|
13
18
|
};
|
|
@@ -18,9 +23,8 @@ declare const __propDef: {
|
|
|
18
23
|
default: {
|
|
19
24
|
ids: {
|
|
20
25
|
content: string;
|
|
21
|
-
title: string;
|
|
22
26
|
description: string;
|
|
23
|
-
|
|
27
|
+
title: string;
|
|
24
28
|
};
|
|
25
29
|
};
|
|
26
30
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import { melt } from "@melt-ui/svelte";
|
|
2
|
-
import { setTransitionTimes } from "../../../internal/index.js";
|
|
3
2
|
import { getCtx, getAttrs } from "../ctx.js";
|
|
4
3
|
export let transition = void 0;
|
|
5
4
|
export let transitionConfig = void 0;
|
|
@@ -7,33 +6,29 @@ export let inTransition = void 0;
|
|
|
7
6
|
export let inTransitionConfig = void 0;
|
|
8
7
|
export let outTransition = void 0;
|
|
9
8
|
export let outTransitionConfig = void 0;
|
|
9
|
+
export let id = void 0;
|
|
10
10
|
export let asChild = false;
|
|
11
11
|
const {
|
|
12
12
|
elements: { content },
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
states: { open },
|
|
14
|
+
ids
|
|
15
15
|
} = getCtx();
|
|
16
16
|
$:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
inTransition,
|
|
21
|
-
inTransitionConfig,
|
|
22
|
-
outTransition,
|
|
23
|
-
outTransitionConfig
|
|
24
|
-
});
|
|
17
|
+
if (id) {
|
|
18
|
+
ids.content.set(id);
|
|
19
|
+
}
|
|
25
20
|
$:
|
|
26
21
|
builder = $content;
|
|
27
22
|
const attrs = getAttrs("content");
|
|
28
23
|
</script>
|
|
29
24
|
|
|
30
|
-
{#if asChild && $
|
|
25
|
+
{#if asChild && $open}
|
|
31
26
|
<slot {builder} {attrs} />
|
|
32
|
-
{:else if transition && $
|
|
27
|
+
{:else if transition && $open}
|
|
33
28
|
<div transition:transition={transitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
34
29
|
<slot {builder} {attrs} />
|
|
35
30
|
</div>
|
|
36
|
-
{:else if inTransition && outTransition && $
|
|
31
|
+
{:else if inTransition && outTransition && $open}
|
|
37
32
|
<div
|
|
38
33
|
in:inTransition={inTransitionConfig}
|
|
39
34
|
out:outTransition={outTransitionConfig}
|
|
@@ -43,15 +38,15 @@ const attrs = getAttrs("content");
|
|
|
43
38
|
>
|
|
44
39
|
<slot {builder} {attrs} />
|
|
45
40
|
</div>
|
|
46
|
-
{:else if inTransition && $
|
|
41
|
+
{:else if inTransition && $open}
|
|
47
42
|
<div in:inTransition={inTransitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
48
43
|
<slot {builder} {attrs} />
|
|
49
44
|
</div>
|
|
50
|
-
{:else if outTransition && $
|
|
45
|
+
{:else if outTransition && $open}
|
|
51
46
|
<div out:outTransition={outTransitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
52
47
|
<slot {builder} {attrs} />
|
|
53
48
|
</div>
|
|
54
|
-
{:else if $
|
|
49
|
+
{:else if $open}
|
|
55
50
|
<div {...builder} use:builder.action {...$$restProps} {...attrs}>
|
|
56
51
|
<slot {builder} {attrs} />
|
|
57
52
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import {
|
|
2
|
+
import type { Transition } from "../../../internal/index.js";
|
|
3
3
|
declare class __sveltets_Render<T extends Transition, In extends Transition, Out extends Transition> {
|
|
4
4
|
props(): {
|
|
5
5
|
transition?: T | undefined;
|
|
@@ -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");
|
|
@@ -9,28 +9,28 @@ export let outTransitionConfig = void 0;
|
|
|
9
9
|
export let asChild = false;
|
|
10
10
|
const {
|
|
11
11
|
elements: { overlay },
|
|
12
|
-
|
|
12
|
+
states: { open }
|
|
13
13
|
} = getCtx();
|
|
14
14
|
$:
|
|
15
15
|
builder = $overlay;
|
|
16
16
|
const attrs = getAttrs("overlay");
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
|
-
{#if asChild && $
|
|
19
|
+
{#if asChild && $open}
|
|
20
20
|
<slot {builder} {attrs} />
|
|
21
|
-
{:else if transition && $
|
|
21
|
+
{:else if transition && $open}
|
|
22
22
|
<div transition:transition={transitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs} />
|
|
23
|
-
{:else if inTransition && outTransition && $
|
|
23
|
+
{:else if inTransition && outTransition && $open}
|
|
24
24
|
<div
|
|
25
25
|
in:inTransition={inTransitionConfig}
|
|
26
26
|
out:outTransition={outTransitionConfig}
|
|
27
27
|
{...builder} use:builder.action
|
|
28
28
|
{...$$restProps}
|
|
29
29
|
/>
|
|
30
|
-
{:else if inTransition && $
|
|
30
|
+
{:else if inTransition && $open}
|
|
31
31
|
<div in:inTransition={inTransitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs} />
|
|
32
|
-
{:else if outTransition && $
|
|
32
|
+
{:else if outTransition && $open}
|
|
33
33
|
<div out:outTransition={outTransitionConfig} {...builder} use:builder.action {...$$restProps} {...attrs} />
|
|
34
|
-
{:else if $
|
|
34
|
+
{:else if $open}
|
|
35
35
|
<div {...builder} use:builder.action {...$$restProps} {...attrs} />
|
|
36
36
|
{/if}
|
|
@@ -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");
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
/// <reference types="svelte" />
|
|
2
2
|
import { type Dialog as AlertDialogReturn, type CreateDialogProps as CreateAlertDialogProps } from "@melt-ui/svelte";
|
|
3
|
-
|
|
4
|
-
type SetProps = CreateAlertDialogProps & TransitionTimesProp & TOpen;
|
|
5
|
-
type GetReturn = AlertDialogReturn & TransitionTimesProp & TOpen;
|
|
3
|
+
type SetProps = CreateAlertDialogProps;
|
|
6
4
|
export declare const getAttrs: (part: "action" | "content" | "trigger" | "cancel" | "description" | "overlay" | "portal" | "title") => Record<string, string>;
|
|
7
5
|
export declare function setCtx(props: SetProps): {
|
|
8
6
|
updateOption: <K extends string, V extends unknown>(key: K, value: V | undefined) => void;
|
|
9
7
|
ids: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
trigger: string;
|
|
8
|
+
title: import("svelte/store").Writable<string>;
|
|
9
|
+
description: import("svelte/store").Writable<string>;
|
|
10
|
+
content: import("svelte/store").Writable<string>;
|
|
14
11
|
};
|
|
15
12
|
elements: {
|
|
16
|
-
content: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], (node: HTMLElement) => {
|
|
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) => {
|
|
17
14
|
destroy: () => void;
|
|
18
|
-
}, ([$isVisible]: [boolean]) => {
|
|
15
|
+
}, ([$isVisible, $contentId, $descriptionId, $titleId]: [boolean, string, string, string]) => {
|
|
19
16
|
id: string;
|
|
20
17
|
role: "dialog" | "alertdialog";
|
|
21
18
|
'aria-describedby': string;
|
|
@@ -25,21 +22,20 @@ export declare function setCtx(props: SetProps): {
|
|
|
25
22
|
hidden: boolean | undefined;
|
|
26
23
|
style: string;
|
|
27
24
|
}, string>;
|
|
28
|
-
trigger: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<{
|
|
25
|
+
trigger: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[{
|
|
29
26
|
update: (updater: import("svelte/store").Updater<boolean>, sideEffect?: ((newValue: boolean) => void) | undefined) => void;
|
|
30
27
|
set: (this: void, value: boolean) => void;
|
|
31
28
|
subscribe(this: void, run: import("svelte/store").Subscriber<boolean>, invalidate?: import("svelte/store").Invalidator<boolean> | undefined): import("svelte/store").Unsubscriber;
|
|
32
|
-
}, (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown" | "click">, ($open: boolean) => {
|
|
33
|
-
readonly id: string;
|
|
29
|
+
}, import("svelte/store").Writable<string>], (node: HTMLElement) => import("@melt-ui/svelte/internal/types").MeltActionReturn<"keydown" | "click">, ([$open, $contentId]: [boolean, string]) => {
|
|
34
30
|
readonly 'aria-haspopup': "dialog";
|
|
35
31
|
readonly 'aria-expanded': boolean;
|
|
36
32
|
readonly 'aria-controls': string;
|
|
37
33
|
readonly type: "button";
|
|
38
34
|
}, string>;
|
|
39
|
-
title: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<import("svelte/store").
|
|
35
|
+
title: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Writable<string>], import("svelte/action").Action<any, any, Record<never, any>>, ([$titleId]: [string]) => {
|
|
40
36
|
id: string;
|
|
41
37
|
}, string>;
|
|
42
|
-
description: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<import("svelte/store").
|
|
38
|
+
description: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Writable<string>], import("svelte/action").Action<any, any, Record<never, any>>, ([$descriptionId]: [string]) => {
|
|
43
39
|
id: string;
|
|
44
40
|
}, string>;
|
|
45
41
|
overlay: import("@melt-ui/svelte/internal/helpers").ExplicitBuilderReturn<[import("svelte/store").Readable<boolean>], <Node_1 extends unknown>(node: HTMLElement) => {
|
|
@@ -68,18 +64,18 @@ export declare function setCtx(props: SetProps): {
|
|
|
68
64
|
};
|
|
69
65
|
};
|
|
70
66
|
options: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
closeOnOutsideClick: import("svelte/store").Writable<boolean>;
|
|
67
|
+
open?: import("svelte/store").Writable<import("svelte/store").Writable<boolean> | undefined> | undefined;
|
|
68
|
+
forceVisible: import("svelte/store").Writable<boolean>;
|
|
74
69
|
role: import("svelte/store").Writable<"dialog" | "alertdialog">;
|
|
75
70
|
defaultOpen: import("svelte/store").Writable<boolean>;
|
|
76
|
-
open?: import("svelte/store").Writable<import("svelte/store").Writable<boolean> | undefined> | undefined;
|
|
77
71
|
onOpenChange?: import("svelte/store").Writable<import("@melt-ui/svelte/internal/helpers").ChangeFn<boolean> | undefined> | undefined;
|
|
72
|
+
preventScroll: import("svelte/store").Writable<boolean>;
|
|
78
73
|
portal: import("svelte/store").Writable<string | HTMLElement | null>;
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
closeOnOutsideClick: import("svelte/store").Writable<boolean>;
|
|
75
|
+
closeOnEscape: import("svelte/store").Writable<boolean>;
|
|
81
76
|
closeFocus: import("svelte/store").Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
77
|
+
openFocus: import("svelte/store").Writable<import("@melt-ui/svelte").FocusProp | undefined>;
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
|
-
export declare function getCtx():
|
|
80
|
+
export declare function getCtx(): AlertDialogReturn;
|
|
85
81
|
export {};
|
|
@@ -18,11 +18,7 @@ export function setCtx(props) {
|
|
|
18
18
|
...removeUndefined(props),
|
|
19
19
|
role: "alertdialog"
|
|
20
20
|
});
|
|
21
|
-
setContext(NAME,
|
|
22
|
-
...alertDialog,
|
|
23
|
-
transitionTimes: props.transitionTimes,
|
|
24
|
-
tOpen: props.tOpen
|
|
25
|
-
});
|
|
21
|
+
setContext(NAME, alertDialog);
|
|
26
22
|
return {
|
|
27
23
|
...alertDialog,
|
|
28
24
|
updateOption: getOptionUpdater(alertDialog.options)
|
|
@@ -8,6 +8,10 @@ declare const __propDef: {
|
|
|
8
8
|
positioning?: import("@melt-ui/svelte/internal/actions").FloatingConfig | undefined;
|
|
9
9
|
arrowSize?: number | undefined;
|
|
10
10
|
forceVisible?: boolean | undefined;
|
|
11
|
+
ids?: {
|
|
12
|
+
trigger: string;
|
|
13
|
+
menu: string;
|
|
14
|
+
} | undefined;
|
|
11
15
|
portal?: string | HTMLElement | null | undefined;
|
|
12
16
|
closeFocus?: import("@melt-ui/svelte/index.js").FocusProp | undefined;
|
|
13
17
|
dir?: import("@melt-ui/svelte/internal/types").TextDirection | undefined;
|
|
@@ -22,8 +26,8 @@ declare const __propDef: {
|
|
|
22
26
|
slots: {
|
|
23
27
|
default: {
|
|
24
28
|
ids: {
|
|
25
|
-
menu: string
|
|
26
|
-
trigger: string
|
|
29
|
+
menu: import("svelte/store").Writable<string>;
|
|
30
|
+
trigger: import("svelte/store").Writable<string>;
|
|
27
31
|
};
|
|
28
32
|
};
|
|
29
33
|
};
|
|
@@ -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");
|
|
@@ -5,6 +5,10 @@ declare const __propDef: {
|
|
|
5
5
|
onOpenChange?: import("@melt-ui/svelte/internal/helpers").ChangeFn<boolean> | undefined;
|
|
6
6
|
positioning?: import("@melt-ui/svelte/internal/actions").FloatingConfig | undefined;
|
|
7
7
|
arrowSize?: number | undefined;
|
|
8
|
+
ids?: {
|
|
9
|
+
trigger: string;
|
|
10
|
+
menu: string;
|
|
11
|
+
} | undefined;
|
|
8
12
|
disabled?: boolean | undefined;
|
|
9
13
|
};
|
|
10
14
|
events: {
|
|
@@ -13,8 +17,8 @@ declare const __propDef: {
|
|
|
13
17
|
slots: {
|
|
14
18
|
default: {
|
|
15
19
|
subIds: {
|
|
16
|
-
menu: string
|
|
17
|
-
trigger: string
|
|
20
|
+
menu: import("svelte/store").Writable<string>;
|
|
21
|
+
trigger: import("svelte/store").Writable<string>;
|
|
18
22
|
};
|
|
19
23
|
};
|
|
20
24
|
};
|
|
@@ -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");
|