@una-ui/nuxt-edge 1.0.0-alpha.0-29174790.64bb574 → 1.0.0-alpha.0-29175660.d51c006
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 -1
- package/dist/runtime/components/elements/dialog/Dialog.vue +73 -62
- package/dist/runtime/components/elements/dialog/Dialog.vue.d.ts +12 -9
- package/dist/runtime/components/elements/dialog/DialogClose.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogContent.vue +3 -2
- package/dist/runtime/components/elements/dialog/DialogContent.vue.d.ts +1 -0
- package/dist/runtime/components/elements/dialog/DialogDescription.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogFooter.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogHeader.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue +2 -2
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue.d.ts +1 -0
- package/dist/runtime/components/elements/dialog/DialogTitle.vue +1 -0
- package/dist/runtime/components/elements/dialog/DialogTrigger.vue +16 -0
- package/dist/runtime/components/elements/dialog/DialogTrigger.vue.d.ts +13 -0
- package/dist/runtime/types/dialog.d.ts +8 -3
- package/package.json +3 -3
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reactivePick } from "@vueuse/core";
|
|
3
|
-
import { DialogRoot,
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits, VisuallyHidden } from "reka-ui";
|
|
4
4
|
import { computed } from "vue";
|
|
5
5
|
import { randomId } from "../../../utils";
|
|
6
6
|
import DialogContent from "./DialogContent.vue";
|
|
@@ -9,6 +9,7 @@ import DialogFooter from "./DialogFooter.vue";
|
|
|
9
9
|
import DialogHeader from "./DialogHeader.vue";
|
|
10
10
|
import DialogScrollContent from "./DialogScrollContent.vue";
|
|
11
11
|
import DialogTitle from "./DialogTitle.vue";
|
|
12
|
+
import DialogTrigger from "./DialogTrigger.vue";
|
|
12
13
|
defineOptions({
|
|
13
14
|
inheritAttrs: false
|
|
14
15
|
});
|
|
@@ -21,11 +22,12 @@ const props = defineProps({
|
|
|
21
22
|
_dialogHeader: { type: Object, required: false },
|
|
22
23
|
_dialogFooter: { type: Object, required: false },
|
|
23
24
|
_dialogContent: { type: Object, required: false },
|
|
25
|
+
_dialogTrigger: { type: Object, required: false },
|
|
24
26
|
una: { type: Object, required: false },
|
|
25
27
|
open: { type: Boolean, required: false },
|
|
26
28
|
defaultOpen: { type: Boolean, required: false },
|
|
27
29
|
modal: { type: Boolean, required: false },
|
|
28
|
-
|
|
30
|
+
dismissible: { type: Boolean, required: false, default: true },
|
|
29
31
|
showClose: { type: Boolean, required: false, default: true },
|
|
30
32
|
overlay: { type: Boolean, required: false, default: true },
|
|
31
33
|
_dialogClose: { type: Object, required: false },
|
|
@@ -45,71 +47,80 @@ const rootPropsEmits = useForwardPropsEmits(rootProps, emits);
|
|
|
45
47
|
</script>
|
|
46
48
|
|
|
47
49
|
<template>
|
|
48
|
-
<DialogRoot
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
<DialogRoot
|
|
51
|
+
v-slot="{ open }"
|
|
52
|
+
data-slot="dialog"
|
|
53
|
+
v-bind="rootPropsEmits"
|
|
54
|
+
>
|
|
55
|
+
<slot>
|
|
56
|
+
<DialogTrigger
|
|
57
|
+
v-bind="_dialogTrigger"
|
|
58
|
+
as-child
|
|
59
|
+
>
|
|
60
|
+
<slot name="trigger" :open />
|
|
61
|
+
</DialogTrigger>
|
|
52
62
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
<component
|
|
64
|
+
:is="!scrollable ? DialogContent : DialogScrollContent"
|
|
65
|
+
v-bind="_dialogContent"
|
|
66
|
+
:_dialog-overlay
|
|
67
|
+
:_dialog-close
|
|
68
|
+
:scrollable
|
|
69
|
+
:show-close
|
|
70
|
+
:dismissible
|
|
71
|
+
:una
|
|
72
|
+
>
|
|
73
|
+
<VisuallyHidden v-if="title === DEFAULT_TITLE || !!$slots.title || (description === DEFAULT_DESCRIPTION || !!$slots.description)">
|
|
74
|
+
<DialogTitle v-if="title === DEFAULT_TITLE || !!$slots.title">
|
|
75
|
+
{{ title }}
|
|
76
|
+
</DialogTitle>
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
<DialogDescription v-if="description === DEFAULT_DESCRIPTION || !!$slots.description">
|
|
79
|
+
{{ description }}
|
|
80
|
+
</DialogDescription>
|
|
81
|
+
</VisuallyHidden>
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
<slot name="content">
|
|
84
|
+
<DialogHeader
|
|
85
|
+
v-if="!!$slots.header || (title !== DEFAULT_TITLE || !!$slots.title) || (description !== DEFAULT_DESCRIPTION || !!$slots.description)"
|
|
86
|
+
v-bind="_dialogHeader"
|
|
87
|
+
:una
|
|
88
|
+
>
|
|
89
|
+
<slot name="header">
|
|
90
|
+
<DialogTitle
|
|
91
|
+
v-if="$slots.title || title !== DEFAULT_TITLE"
|
|
92
|
+
v-bind="_dialogTitle"
|
|
93
|
+
:una
|
|
94
|
+
>
|
|
95
|
+
<slot name="title">
|
|
96
|
+
{{ title }}
|
|
97
|
+
</slot>
|
|
98
|
+
</DialogTitle>
|
|
89
99
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
<DialogDescription
|
|
101
|
+
v-if="$slots.description || description !== DEFAULT_DESCRIPTION"
|
|
102
|
+
v-bind="_dialogDescription"
|
|
103
|
+
:una
|
|
104
|
+
>
|
|
105
|
+
<slot name="description">
|
|
106
|
+
{{ description }}
|
|
107
|
+
</slot>
|
|
108
|
+
</DialogDescription>
|
|
109
|
+
</slot>
|
|
110
|
+
</DialogHeader>
|
|
101
111
|
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
<!-- body -->
|
|
113
|
+
<slot name="body" />
|
|
104
114
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
<DialogFooter
|
|
116
|
+
v-if="$slots.footer"
|
|
117
|
+
v-bind="_dialogFooter"
|
|
118
|
+
:una
|
|
119
|
+
>
|
|
120
|
+
<slot name="footer" />
|
|
121
|
+
</DialogFooter>
|
|
122
|
+
</slot>
|
|
123
|
+
</component>
|
|
124
|
+
</slot>
|
|
114
125
|
</DialogRoot>
|
|
115
126
|
</template>
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import type { NDialogProps } from '../../../types/index.js';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_6: {}, __VLS_11: {
|
|
3
3
|
open: any;
|
|
4
|
-
},
|
|
4
|
+
}, __VLS_27: {}, __VLS_32: {}, __VLS_37: {}, __VLS_42: {}, __VLS_44: {}, __VLS_49: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
|
|
6
|
+
default?: (props: typeof __VLS_6) => any;
|
|
7
7
|
} & {
|
|
8
|
-
|
|
8
|
+
trigger?: (props: typeof __VLS_11) => any;
|
|
9
9
|
} & {
|
|
10
|
-
|
|
10
|
+
content?: (props: typeof __VLS_27) => any;
|
|
11
11
|
} & {
|
|
12
|
-
|
|
12
|
+
header?: (props: typeof __VLS_32) => any;
|
|
13
13
|
} & {
|
|
14
|
-
|
|
14
|
+
title?: (props: typeof __VLS_37) => any;
|
|
15
15
|
} & {
|
|
16
|
-
|
|
16
|
+
description?: (props: typeof __VLS_42) => any;
|
|
17
17
|
} & {
|
|
18
|
-
|
|
18
|
+
body?: (props: typeof __VLS_44) => any;
|
|
19
|
+
} & {
|
|
20
|
+
footer?: (props: typeof __VLS_49) => any;
|
|
19
21
|
};
|
|
20
22
|
declare const __VLS_component: import("vue").DefineComponent<NDialogProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
23
|
"update:open": (value: boolean) => any;
|
|
@@ -23,6 +25,7 @@ declare const __VLS_component: import("vue").DefineComponent<NDialogProps, {}, {
|
|
|
23
25
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
24
26
|
}>, {
|
|
25
27
|
overlay: boolean;
|
|
28
|
+
dismissible: boolean;
|
|
26
29
|
showClose: boolean;
|
|
27
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
31
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -13,7 +13,7 @@ defineOptions({
|
|
|
13
13
|
inheritAttrs: false
|
|
14
14
|
});
|
|
15
15
|
const props = defineProps({
|
|
16
|
-
|
|
16
|
+
dismissible: { type: Boolean, required: false, default: true },
|
|
17
17
|
showClose: { type: Boolean, required: false, default: true },
|
|
18
18
|
overlay: { type: Boolean, required: false, default: true },
|
|
19
19
|
_dialogClose: { type: Object, required: false },
|
|
@@ -30,7 +30,7 @@ const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside"
|
|
|
30
30
|
const delegatedProps = reactiveOmit(props, ["class", "una", "_dialogOverlay", "_dialogClose"]);
|
|
31
31
|
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
32
32
|
const contentEvents = computed(() => {
|
|
33
|
-
if (props.
|
|
33
|
+
if (!props.dismissible) {
|
|
34
34
|
return {
|
|
35
35
|
pointerDownOutside: (e) => e.preventDefault(),
|
|
36
36
|
interactOutside: (e) => e.preventDefault(),
|
|
@@ -53,6 +53,7 @@ const contentEvents = computed(() => {
|
|
|
53
53
|
/>
|
|
54
54
|
|
|
55
55
|
<DialogContent
|
|
56
|
+
data-slot="dialog-content"
|
|
56
57
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
57
58
|
:class="cn(
|
|
58
59
|
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48%',
|
|
@@ -19,6 +19,7 @@ declare const __VLS_component: import("vue").DefineComponent<NDialogContentProps
|
|
|
19
19
|
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
21
|
overlay: boolean;
|
|
22
|
+
dismissible: boolean;
|
|
22
23
|
showClose: boolean;
|
|
23
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
25
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -14,6 +14,7 @@ const forwardedProps = useForwardProps(delegatedProps);
|
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
16
|
<DialogDescription
|
|
17
|
+
data-slot="dialog-description"
|
|
17
18
|
v-bind="forwardedProps"
|
|
18
19
|
:class="cn(
|
|
19
20
|
'dialog-description data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-48% data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-48%',
|
|
@@ -10,6 +10,7 @@ const props = defineProps({
|
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
12
|
<DialogOverlay
|
|
13
|
+
data-slot="dialog-overlay"
|
|
13
14
|
:class="cn(
|
|
14
15
|
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
15
16
|
!props.scrollable ? 'dialog-overlay' : 'dialog-scroll-overlay',
|
|
@@ -13,7 +13,7 @@ defineOptions({
|
|
|
13
13
|
inheritAttrs: false
|
|
14
14
|
});
|
|
15
15
|
const props = defineProps({
|
|
16
|
-
|
|
16
|
+
dismissible: { type: Boolean, required: false, default: true },
|
|
17
17
|
showClose: { type: Boolean, required: false, default: true },
|
|
18
18
|
overlay: { type: Boolean, required: false, default: true },
|
|
19
19
|
_dialogClose: { type: Object, required: false },
|
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "openAutoFocus", "closeAutoFocus"]);
|
|
30
30
|
const delegatedProps = reactiveOmit(props, ["class", "_dialogOverlay", "_dialogClose"]);
|
|
31
31
|
const contentEvents = computed(() => {
|
|
32
|
-
if (props.
|
|
32
|
+
if (!props.dismissible) {
|
|
33
33
|
return {
|
|
34
34
|
pointerDownOutside: (e) => e.preventDefault(),
|
|
35
35
|
interactOutside: (e) => e.preventDefault(),
|
|
@@ -19,6 +19,7 @@ declare const __VLS_component: import("vue").DefineComponent<NDialogContentProps
|
|
|
19
19
|
onCloseAutoFocus?: ((event: Event) => any) | undefined;
|
|
20
20
|
}>, {
|
|
21
21
|
overlay: boolean;
|
|
22
|
+
dismissible: boolean;
|
|
22
23
|
showClose: boolean;
|
|
23
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
25
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { DialogTrigger } from "reka-ui";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
asChild: { type: Boolean, required: false },
|
|
5
|
+
as: { type: null, required: false }
|
|
6
|
+
});
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<DialogTrigger
|
|
11
|
+
data-slot="dialog-trigger"
|
|
12
|
+
v-bind="props"
|
|
13
|
+
>
|
|
14
|
+
<slot />
|
|
15
|
+
</DialogTrigger>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DialogTriggerProps } from 'reka-ui';
|
|
2
|
+
declare var __VLS_6: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_6) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_component: import("vue").DefineComponent<DialogTriggerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DialogTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogRootProps, DialogTitleProps } from 'reka-ui';
|
|
1
|
+
import type { DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogRootProps, DialogTitleProps, DialogTriggerProps } from 'reka-ui';
|
|
2
2
|
import type { HTMLAttributes } from 'vue';
|
|
3
3
|
import type { NButtonProps } from './button.js';
|
|
4
|
-
export interface NDialogProps extends DialogRootProps, Pick<NDialogContentProps, '
|
|
4
|
+
export interface NDialogProps extends DialogRootProps, Pick<NDialogContentProps, 'dismissible' | 'showClose' | 'overlay' | '_dialogClose' | '_dialogOverlay'> {
|
|
5
5
|
/**
|
|
6
6
|
* The title of the dialog.
|
|
7
7
|
*/
|
|
@@ -11,7 +11,9 @@ export interface NDialogProps extends DialogRootProps, Pick<NDialogContentProps,
|
|
|
11
11
|
*/
|
|
12
12
|
description?: string;
|
|
13
13
|
/**
|
|
14
|
+
* If `true`, the dialog will have a scrollable body.
|
|
14
15
|
*
|
|
16
|
+
* @default false
|
|
15
17
|
*/
|
|
16
18
|
scrollable?: boolean;
|
|
17
19
|
_dialogTitle?: NDialogTitleProps;
|
|
@@ -19,6 +21,7 @@ export interface NDialogProps extends DialogRootProps, Pick<NDialogContentProps,
|
|
|
19
21
|
_dialogHeader?: NDialogHeaderProps;
|
|
20
22
|
_dialogFooter?: NDialogFooterProps;
|
|
21
23
|
_dialogContent?: NDialogContentProps;
|
|
24
|
+
_dialogTrigger?: NDialogTriggerProps;
|
|
22
25
|
/**
|
|
23
26
|
* `UnaUI` preset configuration
|
|
24
27
|
*
|
|
@@ -39,7 +42,7 @@ export interface NDialogContentProps extends DialogContentProps, BaseExtensions
|
|
|
39
42
|
/**
|
|
40
43
|
* Prevent close.
|
|
41
44
|
*/
|
|
42
|
-
|
|
45
|
+
dismissible?: boolean;
|
|
43
46
|
/**
|
|
44
47
|
* Show close button.
|
|
45
48
|
*
|
|
@@ -78,6 +81,8 @@ export interface NDialogFooterProps extends BaseExtensions {
|
|
|
78
81
|
}
|
|
79
82
|
export interface NDialogCloseProps extends DialogCloseProps, NButtonProps {
|
|
80
83
|
}
|
|
84
|
+
export interface NDialogTriggerProps extends DialogTriggerProps {
|
|
85
|
+
}
|
|
81
86
|
export interface NDialogUnaProps {
|
|
82
87
|
dialogTitle?: HTMLAttributes['class'];
|
|
83
88
|
dialogDescription?: HTMLAttributes['class'];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@una-ui/nuxt-edge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.0-
|
|
4
|
+
"version": "1.0.0-alpha.0-29175660.d51c006",
|
|
5
5
|
"description": "Nuxt module for @una-ui",
|
|
6
6
|
"author": "Phojie Rengel <phojrengel@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@nuxt/kit": "^3.17.5",
|
|
42
42
|
"@nuxtjs/color-mode": "^3.5.2",
|
|
43
43
|
"@tanstack/vue-table": "^8.21.3",
|
|
44
|
-
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-
|
|
45
|
-
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-
|
|
44
|
+
"@una-ui/extractor-vue-script": "npm:@una-ui/extractor-vue-script-edge@1.0.0-alpha.0-29175660.d51c006",
|
|
45
|
+
"@una-ui/preset": "npm:@una-ui/preset-edge@1.0.0-alpha.0-29175660.d51c006",
|
|
46
46
|
"@unocss/core": "^66.2.0",
|
|
47
47
|
"@unocss/nuxt": "^66.2.0",
|
|
48
48
|
"@unocss/preset-attributify": "^66.2.0",
|