arvue-ui 0.1.0
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/LICENSE +21 -0
- package/README.md +99 -0
- package/dist/all.css +1 -0
- package/dist/clsx.js +18 -0
- package/dist/clsx.js.map +1 -0
- package/dist/dialog/dialog.js +32 -0
- package/dist/dialog/dialog.js.map +1 -0
- package/dist/dialog/dialogClose.js +23 -0
- package/dist/dialog/dialogClose.js.map +1 -0
- package/dist/dialog/dialogContent.js +101 -0
- package/dist/dialog/dialogContent.js.map +1 -0
- package/dist/dialog/dialogDescription.js +31 -0
- package/dist/dialog/dialogDescription.js.map +1 -0
- package/dist/dialog/dialogFooter.js +27 -0
- package/dist/dialog/dialogFooter.js.map +1 -0
- package/dist/dialog/dialogHeader.js +27 -0
- package/dist/dialog/dialogHeader.js.map +1 -0
- package/dist/dialog/dialogOverlay.js +34 -0
- package/dist/dialog/dialogOverlay.js.map +1 -0
- package/dist/dialog/dialogTitle.js +31 -0
- package/dist/dialog/dialogTitle.js.map +1 -0
- package/dist/dialog/dialogTrigger.js +23 -0
- package/dist/dialog/dialogTrigger.js.map +1 -0
- package/dist/index.d.ts +155 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +295 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +12 -0
- package/package.json +64 -0
- package/src/dialog/Dialog.vue +27 -0
- package/src/dialog/DialogClose.vue +19 -0
- package/src/dialog/DialogContent.vue +94 -0
- package/src/dialog/DialogDescription.vue +25 -0
- package/src/dialog/DialogFooter.vue +24 -0
- package/src/dialog/DialogHeader.vue +24 -0
- package/src/dialog/DialogOverlay.vue +31 -0
- package/src/dialog/DialogTitle.vue +25 -0
- package/src/dialog/DialogTrigger.vue +17 -0
- package/src/dialog/dialog-content.css +42 -0
- package/src/dialog/dialog-description.css +3 -0
- package/src/dialog/dialog-footer.css +16 -0
- package/src/dialog/dialog-header.css +12 -0
- package/src/dialog/dialog-overlay.css +12 -0
- package/src/dialog/dialog-title.css +5 -0
- package/src/dialog/index.ts +38 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import './dialog-content.css';
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<DialogPortal>
|
|
7
|
+
<AnimatePresence as="div">
|
|
8
|
+
<DialogOverlay as-child>
|
|
9
|
+
<Motion
|
|
10
|
+
:initial="{ opacity: 0 }"
|
|
11
|
+
:animate="{ opacity: 1 }"
|
|
12
|
+
:exit="{ opacity: 0 }"
|
|
13
|
+
:transition="{
|
|
14
|
+
duration: .2,
|
|
15
|
+
ease: 'easeInOut',
|
|
16
|
+
}"
|
|
17
|
+
/>
|
|
18
|
+
</DialogOverlay>
|
|
19
|
+
<DialogContent
|
|
20
|
+
v-bind="{ ...$attrs, ...forwarded }"
|
|
21
|
+
:class="clsx('arvue-dialog-content', props.class)"
|
|
22
|
+
as-child
|
|
23
|
+
>
|
|
24
|
+
<Motion
|
|
25
|
+
:initial="{
|
|
26
|
+
y: '2rem',
|
|
27
|
+
opacity: 0,
|
|
28
|
+
}"
|
|
29
|
+
:animate="{
|
|
30
|
+
y: 0,
|
|
31
|
+
opacity: 1,
|
|
32
|
+
}"
|
|
33
|
+
:exit="{
|
|
34
|
+
y: '2rem',
|
|
35
|
+
opacity: 0,
|
|
36
|
+
}"
|
|
37
|
+
:transition="{
|
|
38
|
+
duration: .2,
|
|
39
|
+
ease: 'easeInOut',
|
|
40
|
+
}"
|
|
41
|
+
>
|
|
42
|
+
<slot/>
|
|
43
|
+
<DialogClose
|
|
44
|
+
v-if="showCloseButton"
|
|
45
|
+
class="arvue-dialog-close-button icon"
|
|
46
|
+
>
|
|
47
|
+
<i class="fas fa-times"/>
|
|
48
|
+
</DialogClose>
|
|
49
|
+
</Motion>
|
|
50
|
+
</DialogContent>
|
|
51
|
+
</AnimatePresence>
|
|
52
|
+
</DialogPortal>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts">
|
|
56
|
+
import type {
|
|
57
|
+
DialogContentEmits as RekaDialogContentEmits,
|
|
58
|
+
DialogContentProps as RekaDialogContentProps,
|
|
59
|
+
} from 'reka-ui'
|
|
60
|
+
import type { HTMLAttributes } from 'vue'
|
|
61
|
+
|
|
62
|
+
export interface DialogContentProps extends RekaDialogContentProps {
|
|
63
|
+
class?: HTMLAttributes['class']
|
|
64
|
+
showCloseButton?: boolean
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface DialogContentEmits extends RekaDialogContentEmits {
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
73
|
+
import { clsx } from 'clsx'
|
|
74
|
+
import { AnimatePresence, Motion } from 'motion-v'
|
|
75
|
+
import {
|
|
76
|
+
DialogContent,
|
|
77
|
+
DialogPortal,
|
|
78
|
+
useForwardPropsEmits,
|
|
79
|
+
} from 'reka-ui'
|
|
80
|
+
import { DialogClose, DialogOverlay } from '.'
|
|
81
|
+
|
|
82
|
+
defineOptions({
|
|
83
|
+
inheritAttrs: false,
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const props = withDefaults(defineProps<DialogContentProps>(), {
|
|
87
|
+
showCloseButton: true,
|
|
88
|
+
})
|
|
89
|
+
const emits = defineEmits<DialogContentEmits>()
|
|
90
|
+
|
|
91
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
92
|
+
|
|
93
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
94
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import "./dialog-description.css";
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<Primitive :class="clsx('arvue-dialog-description', props.class)">
|
|
7
|
+
<slot/>
|
|
8
|
+
</Primitive>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import type { DialogDescriptionProps as RekaDialogDescriptionProps } from 'reka-ui'
|
|
13
|
+
import type { HTMLAttributes } from 'vue'
|
|
14
|
+
|
|
15
|
+
export interface DialogDescriptionProps extends RekaDialogDescriptionProps{
|
|
16
|
+
class?: HTMLAttributes['class']
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { clsx } from 'clsx'
|
|
22
|
+
import { Primitive } from 'reka-ui'
|
|
23
|
+
|
|
24
|
+
const props = defineProps<DialogDescriptionProps>()
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import "./dialog-footer.css";
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<Primitive :class="clsx('arvue-dialog-footer', props.class)">
|
|
7
|
+
<slot/>
|
|
8
|
+
</Primitive>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import type { HTMLAttributes } from 'vue'
|
|
13
|
+
|
|
14
|
+
export interface DialogFooterProps {
|
|
15
|
+
class?: HTMLAttributes['class']
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { clsx } from 'clsx'
|
|
21
|
+
import { Primitive } from 'reka-ui'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<DialogFooterProps>()
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import "./dialog-header.css";
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<Primitive :class="clsx('arvue-dialog-header', props.class)">
|
|
7
|
+
<slot/>
|
|
8
|
+
</Primitive>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import type { HTMLAttributes } from 'vue'
|
|
13
|
+
|
|
14
|
+
export interface DialogHeaderProps {
|
|
15
|
+
class?: HTMLAttributes['class']
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { clsx } from 'clsx'
|
|
21
|
+
import { Primitive } from 'reka-ui'
|
|
22
|
+
|
|
23
|
+
const props = defineProps<DialogHeaderProps>()
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import './dialog-overlay.css';
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<DialogOverlay
|
|
7
|
+
v-bind="delegatedProps"
|
|
8
|
+
:class="clsx('arvue-dialog-overlay', props.class)"
|
|
9
|
+
>
|
|
10
|
+
<slot/>
|
|
11
|
+
</DialogOverlay>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import type { DialogOverlayProps as RekaDialogOverlayProps } from 'reka-ui'
|
|
16
|
+
import type { HTMLAttributes } from 'vue'
|
|
17
|
+
|
|
18
|
+
export interface DialogOverlayProps extends RekaDialogOverlayProps {
|
|
19
|
+
class?: HTMLAttributes['class']
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
25
|
+
import { clsx } from 'clsx'
|
|
26
|
+
import { DialogOverlay } from 'reka-ui'
|
|
27
|
+
|
|
28
|
+
const props = defineProps<DialogOverlayProps>()
|
|
29
|
+
|
|
30
|
+
const delegatedProps = reactiveOmit(props, 'class')
|
|
31
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@import "./dialog-title.css";
|
|
3
|
+
</style>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<Primitive :class="clsx('arvue-dialog-title', props.class)">
|
|
7
|
+
<slot/>
|
|
8
|
+
</Primitive>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import type { DialogTitleProps as RekaDialogTitleProps } from 'reka-ui'
|
|
13
|
+
import type { HTMLAttributes } from 'vue'
|
|
14
|
+
|
|
15
|
+
export interface DialogTitleProps extends RekaDialogTitleProps{
|
|
16
|
+
class?: HTMLAttributes['class']
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<script setup lang="ts">
|
|
21
|
+
import { clsx } from 'clsx'
|
|
22
|
+
import { Primitive } from 'reka-ui'
|
|
23
|
+
|
|
24
|
+
const props = defineProps<DialogTitleProps>()
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogTrigger v-bind="props">
|
|
3
|
+
<slot/>
|
|
4
|
+
</DialogTrigger>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts">
|
|
8
|
+
import type { DialogTriggerProps as RekaDialogTriggerProps } from 'reka-ui'
|
|
9
|
+
|
|
10
|
+
export interface DialogTriggerProps extends RekaDialogTriggerProps {}
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts">
|
|
14
|
+
import { DialogTrigger } from 'reka-ui'
|
|
15
|
+
|
|
16
|
+
const props = defineProps<DialogTriggerProps>()
|
|
17
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.arvue-dialog-content {
|
|
2
|
+
position: absolute;
|
|
3
|
+
top: 50%;
|
|
4
|
+
left: 50%;
|
|
5
|
+
translate: -50% -50%;
|
|
6
|
+
z-index: 10;
|
|
7
|
+
display: grid;
|
|
8
|
+
width: 100%;
|
|
9
|
+
max-width: calc(100% - 2rem);
|
|
10
|
+
gap: 2rem;
|
|
11
|
+
border-radius: 0.75rem;
|
|
12
|
+
padding: 1.5rem;
|
|
13
|
+
box-shadow: 0 0 70px var(--dialog-shadow-color);
|
|
14
|
+
background: var(--background-color-blank);
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@media (min-width: 760px) {
|
|
19
|
+
.arvue-dialog-content {
|
|
20
|
+
max-width: 600px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.arvue-dialog-content .arvue-dialog-close-button {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 1rem;
|
|
27
|
+
right: 1rem;
|
|
28
|
+
border-radius: 0.125rem;
|
|
29
|
+
opacity: 0.7;
|
|
30
|
+
transition: opacity var(--timing-fast) ease-in-out;
|
|
31
|
+
width: 1rem;
|
|
32
|
+
height: 1rem;
|
|
33
|
+
color: inherit;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.arvue-dialog-content .arvue-dialog-close-button:hover {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.arvue-dialog-content .arvue-dialog-close-button:disabled {
|
|
41
|
+
pointer-events: none;
|
|
42
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.arvue-dialog-footer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column-reverse;
|
|
4
|
+
gap: 0.5rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.arvue-dialog-footer button {
|
|
8
|
+
margin-right: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 760px) {
|
|
12
|
+
.arvue-dialog-footer {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
justify-content: flex-end;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export {
|
|
2
|
+
default as Dialog,
|
|
3
|
+
type DialogEmits,
|
|
4
|
+
type DialogProps,
|
|
5
|
+
} from './Dialog.vue'
|
|
6
|
+
export {
|
|
7
|
+
default as DialogClose,
|
|
8
|
+
type DialogCloseProps,
|
|
9
|
+
} from './DialogClose.vue'
|
|
10
|
+
export {
|
|
11
|
+
default as DialogContent,
|
|
12
|
+
type DialogContentEmits,
|
|
13
|
+
type DialogContentProps,
|
|
14
|
+
} from './DialogContent.vue'
|
|
15
|
+
export {
|
|
16
|
+
default as DialogDescription,
|
|
17
|
+
type DialogDescriptionProps,
|
|
18
|
+
} from './DialogDescription.vue'
|
|
19
|
+
export {
|
|
20
|
+
default as DialogFooter,
|
|
21
|
+
type DialogFooterProps,
|
|
22
|
+
} from './DialogFooter.vue'
|
|
23
|
+
export {
|
|
24
|
+
default as DialogHeader,
|
|
25
|
+
type DialogHeaderProps,
|
|
26
|
+
} from './DialogHeader.vue'
|
|
27
|
+
export {
|
|
28
|
+
default as DialogOverlay,
|
|
29
|
+
type DialogOverlayProps,
|
|
30
|
+
} from './DialogOverlay.vue'
|
|
31
|
+
export {
|
|
32
|
+
default as DialogTitle,
|
|
33
|
+
type DialogTitleProps,
|
|
34
|
+
} from './DialogTitle.vue'
|
|
35
|
+
export {
|
|
36
|
+
default as DialogTrigger,
|
|
37
|
+
type DialogTriggerProps,
|
|
38
|
+
} from './DialogTrigger.vue'
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dialog'
|