@shwfed/nuxt 0.10.13 → 0.10.15
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/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/app.d.vue.ts +2 -1
- package/dist/runtime/components/app.vue.d.ts +2 -1
- package/dist/runtime/components/button.d.vue.ts +63 -4
- package/dist/runtime/components/button.vue +12 -2
- package/dist/runtime/components/button.vue.d.ts +63 -4
- package/dist/runtime/components/modal.d.vue.ts +53 -0
- package/dist/runtime/components/modal.vue +141 -0
- package/dist/runtime/components/modal.vue.d.ts +53 -0
- package/dist/runtime/components/ui/app/App.d.vue.ts +7 -5
- package/dist/runtime/components/ui/app/App.vue +23 -8
- package/dist/runtime/components/ui/app/App.vue.d.ts +7 -5
- package/dist/runtime/components/ui/app/OverlayHost.d.vue.ts +3 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue +91 -0
- package/dist/runtime/components/ui/app/OverlayHost.vue.d.ts +3 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +52 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +52 -0
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +54 -2
- package/dist/runtime/components/ui/buttons/Buttons.vue +56 -3
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +54 -2
- package/dist/runtime/components/ui/buttons/schema.d.ts +307 -0
- package/dist/runtime/components/ui/buttons/schema.js +11 -2
- package/dist/runtime/components/ui/drawer/Drawer.d.vue.ts +31 -0
- package/dist/runtime/components/ui/drawer/Drawer.vue +38 -0
- package/dist/runtime/components/ui/drawer/Drawer.vue.d.ts +31 -0
- package/dist/runtime/components/ui/drawer/DrawerClose.d.vue.ts +14 -0
- package/dist/runtime/components/ui/drawer/DrawerClose.vue +19 -0
- package/dist/runtime/components/ui/drawer/DrawerClose.vue.d.ts +14 -0
- package/dist/runtime/components/ui/drawer/DrawerContent.d.vue.ts +20 -0
- package/dist/runtime/components/ui/drawer/DrawerContent.vue +50 -0
- package/dist/runtime/components/ui/drawer/DrawerContent.vue.d.ts +20 -0
- package/dist/runtime/components/ui/drawer/DrawerDescription.d.vue.ts +18 -0
- package/dist/runtime/components/ui/drawer/DrawerDescription.vue +26 -0
- package/dist/runtime/components/ui/drawer/DrawerDescription.vue.d.ts +18 -0
- package/dist/runtime/components/ui/drawer/DrawerFooter.d.vue.ts +17 -0
- package/dist/runtime/components/ui/drawer/DrawerFooter.vue +15 -0
- package/dist/runtime/components/ui/drawer/DrawerFooter.vue.d.ts +17 -0
- package/dist/runtime/components/ui/drawer/DrawerHeader.d.vue.ts +17 -0
- package/dist/runtime/components/ui/drawer/DrawerHeader.vue +15 -0
- package/dist/runtime/components/ui/drawer/DrawerHeader.vue.d.ts +17 -0
- package/dist/runtime/components/ui/drawer/DrawerOverlay.d.vue.ts +7 -0
- package/dist/runtime/components/ui/drawer/DrawerOverlay.vue +19 -0
- package/dist/runtime/components/ui/drawer/DrawerOverlay.vue.d.ts +7 -0
- package/dist/runtime/components/ui/drawer/DrawerTitle.d.vue.ts +18 -0
- package/dist/runtime/components/ui/drawer/DrawerTitle.vue +26 -0
- package/dist/runtime/components/ui/drawer/DrawerTitle.vue.d.ts +18 -0
- package/dist/runtime/components/ui/drawer/DrawerTrigger.d.vue.ts +14 -0
- package/dist/runtime/components/ui/drawer/DrawerTrigger.vue +19 -0
- package/dist/runtime/components/ui/drawer/DrawerTrigger.vue.d.ts +14 -0
- package/dist/runtime/components/ui/drawer/index.d.ts +8 -0
- package/dist/runtime/components/ui/drawer/index.js +8 -0
- package/dist/runtime/composables/useOverlay.d.ts +86 -0
- package/dist/runtime/composables/useOverlay.js +201 -0
- package/dist/runtime/layouts/default.d.vue.ts +2 -1
- package/dist/runtime/layouts/default.vue.d.ts +2 -1
- package/dist/runtime/plugins/overlay/index.d.ts +6 -0
- package/dist/runtime/plugins/overlay/index.js +12 -0
- package/dist/runtime/plugins/toast/index.d.ts +2 -2
- package/package.json +2 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawerDescriptionProps } from 'vaul-vue';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = DrawerDescriptionProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { useForwardProps } from "reka-ui";
|
|
4
|
+
import { DrawerDescription } from "vaul-vue";
|
|
5
|
+
import { cn } from "../../../utils/cn";
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false
|
|
8
|
+
});
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
asChild: { type: Boolean, required: false },
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
class: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
15
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<DrawerDescription
|
|
20
|
+
data-slot="drawer-description"
|
|
21
|
+
v-bind="forwardedProps"
|
|
22
|
+
:class="cn('text-zinc-700 text-sm', props.class)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</DrawerDescription>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawerDescriptionProps } from 'vaul-vue';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = DrawerDescriptionProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { cn } from "../../../utils/cn";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
class: { type: null, required: false }
|
|
5
|
+
});
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div
|
|
10
|
+
data-slot="drawer-footer"
|
|
11
|
+
:class="cn('mt-auto flex flex-col gap-2 p-4', props.class)"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { cn } from "../../../utils/cn";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
class: { type: null, required: false }
|
|
5
|
+
});
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div
|
|
10
|
+
data-slot="drawer-header"
|
|
11
|
+
:class="cn('flex flex-col gap-2 p-4 text-center sm:text-left', props.class)"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { DrawerOverlay } from "vaul-vue";
|
|
3
|
+
import { cn } from "../../../utils/cn";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
class: { type: null, required: false }
|
|
6
|
+
});
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DrawerOverlay
|
|
11
|
+
data-slot="drawer-overlay"
|
|
12
|
+
:class="
|
|
13
|
+
cn(
|
|
14
|
+
'data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
15
|
+
props.class
|
|
16
|
+
)
|
|
17
|
+
"
|
|
18
|
+
/>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawerTitleProps } from 'vaul-vue';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = DrawerTitleProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactiveOmit } from "@vueuse/core";
|
|
3
|
+
import { useForwardProps } from "reka-ui";
|
|
4
|
+
import { DrawerTitle } from "vaul-vue";
|
|
5
|
+
import { cn } from "../../../utils/cn";
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false
|
|
8
|
+
});
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
asChild: { type: Boolean, required: false },
|
|
11
|
+
as: { type: null, required: false },
|
|
12
|
+
class: { type: null, required: false }
|
|
13
|
+
});
|
|
14
|
+
const delegatedProps = reactiveOmit(props, "class");
|
|
15
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<DrawerTitle
|
|
20
|
+
data-slot="drawer-title"
|
|
21
|
+
v-bind="forwardedProps"
|
|
22
|
+
:class="cn('text-lg leading-none font-semibold', props.class)"
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</DrawerTitle>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawerTitleProps } from 'vaul-vue';
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
type __VLS_Props = DrawerTitleProps & {
|
|
4
|
+
class?: HTMLAttributes['class'];
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DrawerTriggerProps } from 'vaul-vue';
|
|
2
|
+
declare var __VLS_8: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<DrawerTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DrawerTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { DrawerTrigger } from "vaul-vue";
|
|
3
|
+
defineOptions({
|
|
4
|
+
inheritAttrs: false
|
|
5
|
+
});
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
asChild: { type: Boolean, required: false },
|
|
8
|
+
as: { type: null, required: false }
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DrawerTrigger
|
|
14
|
+
data-slot="drawer-trigger"
|
|
15
|
+
v-bind="props"
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</DrawerTrigger>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DrawerTriggerProps } from 'vaul-vue';
|
|
2
|
+
declare var __VLS_8: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_8) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import("vue").DefineComponent<DrawerTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DrawerTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Drawer } from './Drawer.vue.js';
|
|
2
|
+
export { default as DrawerClose } from './DrawerClose.vue.js';
|
|
3
|
+
export { default as DrawerContent } from './DrawerContent.vue.js';
|
|
4
|
+
export { default as DrawerDescription } from './DrawerDescription.vue.js';
|
|
5
|
+
export { default as DrawerFooter } from './DrawerFooter.vue.js';
|
|
6
|
+
export { default as DrawerHeader } from './DrawerHeader.vue.js';
|
|
7
|
+
export { default as DrawerTitle } from './DrawerTitle.vue.js';
|
|
8
|
+
export { default as DrawerTrigger } from './DrawerTrigger.vue.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as Drawer } from "./Drawer.vue";
|
|
2
|
+
export { default as DrawerClose } from "./DrawerClose.vue";
|
|
3
|
+
export { default as DrawerContent } from "./DrawerContent.vue";
|
|
4
|
+
export { default as DrawerDescription } from "./DrawerDescription.vue";
|
|
5
|
+
export { default as DrawerFooter } from "./DrawerFooter.vue";
|
|
6
|
+
export { default as DrawerHeader } from "./DrawerHeader.vue";
|
|
7
|
+
export { default as DrawerTitle } from "./DrawerTitle.vue";
|
|
8
|
+
export { default as DrawerTrigger } from "./DrawerTrigger.vue";
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Context, Deferred, Effect, type Scope } from 'effect';
|
|
2
|
+
import { type VNode } from 'vue';
|
|
3
|
+
export type OverlayAbortReason = 'close-all' | 'definition' | 'dismiss' | 'owner' | 'scope';
|
|
4
|
+
export type OverlayAborted = Readonly<{
|
|
5
|
+
_tag: 'OverlayAborted';
|
|
6
|
+
reason: OverlayAbortReason;
|
|
7
|
+
}>;
|
|
8
|
+
export type OverlayResult = OverlayAborted | unknown;
|
|
9
|
+
export type OverlayShellProps = Readonly<{
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
showCloseButton?: boolean;
|
|
13
|
+
breakpoint?: string;
|
|
14
|
+
dismissible?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type OverlayBodyProps = Readonly<Record<string, unknown>>;
|
|
17
|
+
export type OverlaySessionInput = Readonly<{
|
|
18
|
+
shell?: Partial<OverlayShellProps>;
|
|
19
|
+
props?: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
export type OverlaySessionPatch = Readonly<{
|
|
22
|
+
shell?: Partial<OverlayShellProps>;
|
|
23
|
+
props?: Record<string, unknown>;
|
|
24
|
+
}>;
|
|
25
|
+
export type OverlaySlotProps = Readonly<{
|
|
26
|
+
props: OverlayBodyProps;
|
|
27
|
+
shell: OverlayShellProps;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
close: (value?: unknown) => void;
|
|
30
|
+
patch: (nextProps: Record<string, unknown>) => void;
|
|
31
|
+
isDesktop: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export type OverlayBodyRender = (props: OverlaySlotProps) => Array<VNode>;
|
|
34
|
+
export type OverlayDefinition = Readonly<{
|
|
35
|
+
definitionId: string;
|
|
36
|
+
ownerId: string;
|
|
37
|
+
render: OverlayBodyRender;
|
|
38
|
+
shell?: OverlayShellProps;
|
|
39
|
+
}>;
|
|
40
|
+
type OverlaySession = {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
definitionId: string;
|
|
43
|
+
shell: OverlayShellProps;
|
|
44
|
+
props: Record<string, unknown>;
|
|
45
|
+
deferred: Deferred.Deferred<OverlayResult, never>;
|
|
46
|
+
};
|
|
47
|
+
export type OverlayHandle = Readonly<{
|
|
48
|
+
sessionId: string;
|
|
49
|
+
patch: (patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
50
|
+
close: (value?: unknown) => Effect.Effect<void>;
|
|
51
|
+
result: Effect.Effect<OverlayResult>;
|
|
52
|
+
}>;
|
|
53
|
+
export type OverlayDefinitionNotFoundError = Readonly<{
|
|
54
|
+
_tag: 'OverlayDefinitionNotFoundError';
|
|
55
|
+
definitionId: string;
|
|
56
|
+
}>;
|
|
57
|
+
export interface OverlayRuntime {
|
|
58
|
+
definitions: Readonly<Record<string, OverlayDefinition>>;
|
|
59
|
+
sessions: ReadonlyArray<OverlaySession>;
|
|
60
|
+
topSession: OverlaySession | undefined;
|
|
61
|
+
registerDefinition: (definition: OverlayDefinition) => void;
|
|
62
|
+
unregisterDefinition: (definitionId: string, ownerId?: string) => void;
|
|
63
|
+
syncDefinitions: (ownerId: string, definitions: Array<OverlayDefinition>) => void;
|
|
64
|
+
isOpen: (sessionId: string) => boolean;
|
|
65
|
+
patchSync: (sessionId: string, patch: OverlaySessionPatch) => void;
|
|
66
|
+
closeSync: (sessionId: string, value?: unknown) => void;
|
|
67
|
+
closeTopSync: () => void;
|
|
68
|
+
closeAllSync: () => void;
|
|
69
|
+
open: (definitionId: string, options?: OverlaySessionInput) => Effect.Effect<OverlayHandle, OverlayDefinitionNotFoundError, Scope.Scope>;
|
|
70
|
+
patch: (sessionId: string, patch: OverlaySessionPatch) => Effect.Effect<void>;
|
|
71
|
+
close: (sessionId: string, value?: unknown) => Effect.Effect<void>;
|
|
72
|
+
closeTop: () => Effect.Effect<void>;
|
|
73
|
+
closeAll: () => Effect.Effect<void>;
|
|
74
|
+
}
|
|
75
|
+
declare const OverlayService_base: Context.TagClass<OverlayService, "shwfed/OverlayService", OverlayRuntime>;
|
|
76
|
+
export declare class OverlayService extends OverlayService_base {
|
|
77
|
+
}
|
|
78
|
+
export declare function isOverlayAborted(value: unknown): value is OverlayAborted;
|
|
79
|
+
export declare function useOverlay(): OverlayRuntime;
|
|
80
|
+
export declare function provideOverlay<A, E, R>(effect: Effect.Effect<A, E, R>, runtime?: OverlayRuntime): Effect.Effect<A, E, Exclude<R, OverlayService>>;
|
|
81
|
+
export declare function openOverlay(definitionId: string, options?: OverlaySessionInput): Effect.Effect<OverlayHandle, OverlayDefinitionNotFoundError, OverlayService | Scope.Scope>;
|
|
82
|
+
export declare function patchOverlay(sessionId: string, patch: OverlaySessionPatch): Effect.Effect<void, never, OverlayService>;
|
|
83
|
+
export declare function closeOverlay(sessionId: string, value?: unknown): Effect.Effect<void, never, OverlayService>;
|
|
84
|
+
export declare function closeTopOverlay(): Effect.Effect<void, never, OverlayService>;
|
|
85
|
+
export declare function closeAllOverlays(): Effect.Effect<void, never, OverlayService>;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Context, Deferred, Effect } from "effect";
|
|
2
|
+
import { reactive, ref } from "vue";
|
|
3
|
+
export class OverlayService extends Context.Tag("shwfed/OverlayService")() {
|
|
4
|
+
}
|
|
5
|
+
function createAborted(reason) {
|
|
6
|
+
return {
|
|
7
|
+
_tag: "OverlayAborted",
|
|
8
|
+
reason
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function createDefinitionNotFoundError(definitionId) {
|
|
12
|
+
return {
|
|
13
|
+
_tag: "OverlayDefinitionNotFoundError",
|
|
14
|
+
definitionId
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function isOverlayAborted(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && Reflect.get(value, "_tag") === "OverlayAborted" && typeof Reflect.get(value, "reason") === "string";
|
|
19
|
+
}
|
|
20
|
+
function createOverlayRuntime() {
|
|
21
|
+
const definitions = reactive({});
|
|
22
|
+
const sessions = ref([]);
|
|
23
|
+
function findSessionIndex(sessionId) {
|
|
24
|
+
return sessions.value.findIndex((session) => session.sessionId === sessionId);
|
|
25
|
+
}
|
|
26
|
+
function getDefinition(definitionId) {
|
|
27
|
+
return Reflect.get(definitions, definitionId);
|
|
28
|
+
}
|
|
29
|
+
function getSession(sessionId) {
|
|
30
|
+
return sessions.value.find((session) => session.sessionId === sessionId);
|
|
31
|
+
}
|
|
32
|
+
function removeSession(sessionId) {
|
|
33
|
+
const index = findSessionIndex(sessionId);
|
|
34
|
+
if (index < 0) {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
const [session] = sessions.value.splice(index, 1);
|
|
38
|
+
return session;
|
|
39
|
+
}
|
|
40
|
+
function closeInternal(sessionId, value) {
|
|
41
|
+
return Effect.gen(function* () {
|
|
42
|
+
const session = removeSession(sessionId);
|
|
43
|
+
if (!session) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
yield* Deferred.succeed(session.deferred, value);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function closeDefinitionSessions(definitionId, reason) {
|
|
50
|
+
const targetSessions = sessions.value.filter((session) => session.definitionId === definitionId).map((session) => session.sessionId);
|
|
51
|
+
for (const sessionId of targetSessions) {
|
|
52
|
+
void Effect.runPromise(closeInternal(sessionId, createAborted(reason)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function registerDefinition(definition) {
|
|
56
|
+
Reflect.set(definitions, definition.definitionId, definition);
|
|
57
|
+
}
|
|
58
|
+
function unregisterDefinition(definitionId, ownerId) {
|
|
59
|
+
const definition = getDefinition(definitionId);
|
|
60
|
+
if (!definition) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (ownerId !== void 0 && definition.ownerId !== ownerId) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
Reflect.deleteProperty(definitions, definitionId);
|
|
67
|
+
closeDefinitionSessions(definitionId, ownerId === void 0 ? "definition" : "owner");
|
|
68
|
+
}
|
|
69
|
+
function syncDefinitions(ownerId, nextDefinitions) {
|
|
70
|
+
const nextIds = nextDefinitions.map((definition) => definition.definitionId);
|
|
71
|
+
const currentIds = Object.values(definitions).filter((definition) => definition.ownerId === ownerId).map((definition) => definition.definitionId);
|
|
72
|
+
for (const definitionId of currentIds) {
|
|
73
|
+
if (!nextIds.includes(definitionId)) {
|
|
74
|
+
unregisterDefinition(definitionId, ownerId);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (const definition of nextDefinitions) {
|
|
78
|
+
registerDefinition(definition);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function patchSync(sessionId, patch) {
|
|
82
|
+
const session = getSession(sessionId);
|
|
83
|
+
if (!session) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (patch.shell) {
|
|
87
|
+
session.shell = {
|
|
88
|
+
...session.shell,
|
|
89
|
+
...patch.shell
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (patch.props) {
|
|
93
|
+
session.props = {
|
|
94
|
+
...session.props,
|
|
95
|
+
...patch.props
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function closeSync(sessionId, value) {
|
|
100
|
+
void Effect.runPromise(closeInternal(sessionId, value));
|
|
101
|
+
}
|
|
102
|
+
function closeTopSync() {
|
|
103
|
+
const topSession = sessions.value.at(-1);
|
|
104
|
+
if (!topSession) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
closeSync(topSession.sessionId, createAborted("dismiss"));
|
|
108
|
+
}
|
|
109
|
+
function closeAllSync() {
|
|
110
|
+
const sessionIds = sessions.value.map((session) => session.sessionId);
|
|
111
|
+
for (const sessionId of sessionIds) {
|
|
112
|
+
closeSync(sessionId, createAborted("close-all"));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function createHandle(session) {
|
|
116
|
+
return {
|
|
117
|
+
sessionId: session.sessionId,
|
|
118
|
+
patch: (patch) => Effect.sync(() => {
|
|
119
|
+
patchSync(session.sessionId, patch);
|
|
120
|
+
}),
|
|
121
|
+
close: (value) => closeInternal(session.sessionId, value),
|
|
122
|
+
result: Deferred.await(session.deferred)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const runtime = {
|
|
126
|
+
get definitions() {
|
|
127
|
+
return definitions;
|
|
128
|
+
},
|
|
129
|
+
get sessions() {
|
|
130
|
+
return sessions.value;
|
|
131
|
+
},
|
|
132
|
+
get topSession() {
|
|
133
|
+
return sessions.value.at(-1);
|
|
134
|
+
},
|
|
135
|
+
registerDefinition,
|
|
136
|
+
unregisterDefinition,
|
|
137
|
+
syncDefinitions,
|
|
138
|
+
isOpen: (sessionId) => findSessionIndex(sessionId) >= 0,
|
|
139
|
+
patchSync,
|
|
140
|
+
closeSync,
|
|
141
|
+
closeTopSync,
|
|
142
|
+
closeAllSync,
|
|
143
|
+
open: (definitionId, options) => Effect.acquireRelease(
|
|
144
|
+
Effect.gen(function* () {
|
|
145
|
+
const definition = getDefinition(definitionId);
|
|
146
|
+
if (!definition) {
|
|
147
|
+
return yield* Effect.fail(createDefinitionNotFoundError(definitionId));
|
|
148
|
+
}
|
|
149
|
+
const deferred = yield* Deferred.make();
|
|
150
|
+
const session = {
|
|
151
|
+
sessionId: crypto.randomUUID(),
|
|
152
|
+
definitionId,
|
|
153
|
+
shell: {
|
|
154
|
+
...definition.shell,
|
|
155
|
+
...options?.shell
|
|
156
|
+
},
|
|
157
|
+
props: {
|
|
158
|
+
...options?.props
|
|
159
|
+
},
|
|
160
|
+
deferred
|
|
161
|
+
};
|
|
162
|
+
sessions.value.push(session);
|
|
163
|
+
return createHandle(session);
|
|
164
|
+
}),
|
|
165
|
+
(handle) => closeInternal(handle.sessionId, createAborted("scope"))
|
|
166
|
+
),
|
|
167
|
+
patch: (sessionId, patch) => Effect.sync(() => {
|
|
168
|
+
patchSync(sessionId, patch);
|
|
169
|
+
}),
|
|
170
|
+
close: (sessionId, value) => closeInternal(sessionId, value),
|
|
171
|
+
closeTop: () => Effect.sync(() => {
|
|
172
|
+
closeTopSync();
|
|
173
|
+
}),
|
|
174
|
+
closeAll: () => Effect.sync(() => {
|
|
175
|
+
closeAllSync();
|
|
176
|
+
})
|
|
177
|
+
};
|
|
178
|
+
return runtime;
|
|
179
|
+
}
|
|
180
|
+
const overlayRuntime = createOverlayRuntime();
|
|
181
|
+
export function useOverlay() {
|
|
182
|
+
return overlayRuntime;
|
|
183
|
+
}
|
|
184
|
+
export function provideOverlay(effect, runtime = overlayRuntime) {
|
|
185
|
+
return effect.pipe(Effect.provideService(OverlayService, runtime));
|
|
186
|
+
}
|
|
187
|
+
export function openOverlay(definitionId, options) {
|
|
188
|
+
return Effect.flatMap(OverlayService, (overlay) => overlay.open(definitionId, options));
|
|
189
|
+
}
|
|
190
|
+
export function patchOverlay(sessionId, patch) {
|
|
191
|
+
return Effect.flatMap(OverlayService, (overlay) => overlay.patch(sessionId, patch));
|
|
192
|
+
}
|
|
193
|
+
export function closeOverlay(sessionId, value) {
|
|
194
|
+
return Effect.flatMap(OverlayService, (overlay) => overlay.close(sessionId, value));
|
|
195
|
+
}
|
|
196
|
+
export function closeTopOverlay() {
|
|
197
|
+
return Effect.flatMap(OverlayService, (overlay) => overlay.closeTop());
|
|
198
|
+
}
|
|
199
|
+
export function closeAllOverlays() {
|
|
200
|
+
return Effect.flatMap(OverlayService, (overlay) => overlay.closeAll());
|
|
201
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
|
+
import type { OverlayService as OverlayRuntimeService } from '../composables/useOverlay.js';
|
|
2
3
|
import type { Sidebar as SidebarType } from '../composables/useNavigationTabs.js';
|
|
3
|
-
type CommandEffect = import('effect').Effect.Effect<void>;
|
|
4
|
+
type CommandEffect = import('effect').Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
5
|
type ProfileCommandInputItem = Readonly<{
|
|
5
6
|
id: string | number;
|
|
6
7
|
title: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Scope } from 'effect';
|
|
2
|
+
import type { OverlayService as OverlayRuntimeService } from '../composables/useOverlay.js';
|
|
2
3
|
import type { Sidebar as SidebarType } from '../composables/useNavigationTabs.js';
|
|
3
|
-
type CommandEffect = import('effect').Effect.Effect<void>;
|
|
4
|
+
type CommandEffect = import('effect').Effect.Effect<void, never, Scope.Scope | OverlayRuntimeService>;
|
|
4
5
|
type ProfileCommandInputItem = Readonly<{
|
|
5
6
|
id: string | number;
|
|
6
7
|
title: string;
|