@d0rich/esprit-design 0.2.1 → 0.2.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/CHANGELOG.md +31 -0
- package/dist/components/DChip.vue.d.ts +2 -0
- package/dist/components/DPagination.vue.d.ts +30 -0
- package/dist/components/DStats.vue.d.ts +27 -0
- package/dist/components/animations/DAnimationAccordion.vue.d.ts +23 -0
- package/dist/components/animations/DAnimationDefLetterD.vue.d.ts +2 -0
- package/dist/components/animations/DAnimationFloatingLetter.vue.d.ts +23 -0
- package/dist/components/animations/DAnimationHypnosis.vue.d.ts +23 -0
- package/dist/components/animations/DAnimationSpinner.vue.d.ts +23 -0
- package/dist/components/animations/index.d.ts +5 -0
- package/dist/components/buttons/DBigBangButton.vue.d.ts +35 -0
- package/dist/components/buttons/DBigBangButtonAnimation.vue.d.ts +2 -0
- package/dist/components/buttons/DBtn.vue.d.ts +97 -0
- package/dist/components/buttons/index.d.ts +4 -0
- package/dist/components/cards/DCard.vue.d.ts +24 -0
- package/dist/components/cards/DCardTitle.vue.d.ts +2 -0
- package/dist/components/cards/index.d.ts +3 -0
- package/dist/components/content/DAlert.vue.d.ts +21 -0
- package/dist/components/content/DQuote.vue.d.ts +21 -0
- package/dist/components/content/index.d.ts +3 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/lists/DActionsFan.vue.d.ts +55 -0
- package/dist/components/lists/DActionsList.vue.d.ts +50 -0
- package/dist/components/lists/index.d.ts +3 -0
- package/dist/components/utils/DWrapBackground.vue.d.ts +68 -0
- package/dist/components/utils/DWrapFocusHighlight.vue.d.ts +67 -0
- package/dist/components/utils/DWrapShape.vue.d.ts +33 -0
- package/dist/components/utils/index.d.ts +4 -0
- package/dist/composables/big-bang-button-utils.d.ts +3 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/router.d.ts +17 -0
- package/dist/composables/utils.d.ts +4 -0
- package/dist/esprit-design.js +4595 -0
- package/dist/esprit-design.umd.cjs +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/style.css +1 -0
- package/dist/utils/boundings.d.ts +16 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/pagination.d.ts +1 -0
- package/dist/utils/polygon-animation.d.ts +53 -0
- package/index.html +13 -0
- package/package.json +1 -4
- package/plugins/shadows.js +87 -0
- package/src/components/DChip.vue +32 -0
- package/src/components/DPagination.vue +91 -0
- package/src/components/DStats.vue +502 -0
- package/src/components/animations/DAnimationAccordion.vue +103 -0
- package/src/components/animations/DAnimationDefLetterD.vue +11 -0
- package/src/components/animations/DAnimationFloatingLetter.vue +58 -0
- package/src/components/animations/DAnimationHypnosis.vue +102 -0
- package/src/components/animations/DAnimationSpinner.vue +114 -0
- package/src/components/animations/index.ts +11 -0
- package/src/components/buttons/DBigBangButton.vue +70 -0
- package/src/components/buttons/DBigBangButtonAnimation.vue +117 -0
- package/src/components/buttons/DBtn.vue +106 -0
- package/src/components/buttons/index.ts +5 -0
- package/src/components/cards/DCard.vue +98 -0
- package/src/components/cards/DCardTitle.vue +67 -0
- package/src/components/cards/index.ts +4 -0
- package/src/components/content/DAlert.vue +112 -0
- package/src/components/content/DQuote.vue +71 -0
- package/src/components/content/index.ts +4 -0
- package/src/components/index.ts +12 -0
- package/src/components/lists/DActionsFan.vue +153 -0
- package/src/components/lists/DActionsList.vue +100 -0
- package/src/components/lists/index.ts +4 -0
- package/src/components/utils/DWrapBackground.vue +76 -0
- package/src/components/utils/DWrapFocusHighlight.vue +241 -0
- package/src/components/utils/DWrapShape.vue +170 -0
- package/src/components/utils/index.ts +7 -0
- package/src/composables/big-bang-button-utils.ts +7 -0
- package/src/composables/index.ts +2 -0
- package/src/composables/router.ts +66 -0
- package/src/composables/utils.ts +5 -0
- package/src/index.ts +3 -0
- package/src/style.css +3 -0
- package/src/utils/boundings.ts +35 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/pagination.ts +4 -0
- package/src/utils/polygon-animation.ts +139 -0
- package/src/vite-env.d.ts +1 -0
- package/tailwind.config.js +22 -0
- package/tsconfig.json +25 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +35 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DCardTitle',
|
|
6
|
+
components: {
|
|
7
|
+
DWrapShape
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="card__title">
|
|
14
|
+
<DWrapShape
|
|
15
|
+
class="card__title__content"
|
|
16
|
+
shape-class="card__title__content__shape"
|
|
17
|
+
>
|
|
18
|
+
<h3 class="card__title__content__text">
|
|
19
|
+
<slot />
|
|
20
|
+
</h3>
|
|
21
|
+
</DWrapShape>
|
|
22
|
+
<span class="ml-2 print:text-neutral-600">
|
|
23
|
+
<slot name="extra" />
|
|
24
|
+
</span>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.card__title {
|
|
30
|
+
@apply text-2xl md:text-3xl font-semibold -mt-5 mb-3
|
|
31
|
+
print:text-base print:ml-0 print:mb-0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.card__title__content {
|
|
35
|
+
@apply inline-block -ml-10
|
|
36
|
+
print:ml-0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card__title__content__text {
|
|
40
|
+
@apply p-5 text-white dark:text-black
|
|
41
|
+
print:p-0 print:text-inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.card__title__content__shape {
|
|
45
|
+
clip-path: polygon(
|
|
46
|
+
0.4em 0.4em,
|
|
47
|
+
100% 0%,
|
|
48
|
+
calc(100% - 0.4em) calc(100% - 0.4em),
|
|
49
|
+
0% 100%
|
|
50
|
+
);
|
|
51
|
+
@apply bg-black dark:bg-white
|
|
52
|
+
print:bg-transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.force-light .card__title__content__text {
|
|
56
|
+
@apply dark:text-white;
|
|
57
|
+
}
|
|
58
|
+
.force-light .card__title__content__shape {
|
|
59
|
+
@apply dark:bg-black;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@media print {
|
|
63
|
+
.card__title__content__shape {
|
|
64
|
+
clip-path: none;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
3
|
+
|
|
4
|
+
defineProps({
|
|
5
|
+
type: {
|
|
6
|
+
type: String as () => 'info' | 'question' | 'warning',
|
|
7
|
+
default: 'info'
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DWrapShape
|
|
14
|
+
class="d-alert"
|
|
15
|
+
:class="{
|
|
16
|
+
'd-alert--info': type === 'info',
|
|
17
|
+
'd-alert--question': type === 'question',
|
|
18
|
+
'd-alert--warning': type === 'warning'
|
|
19
|
+
}"
|
|
20
|
+
shape-class="d-alert__shape"
|
|
21
|
+
>
|
|
22
|
+
<template #bg-overlay>
|
|
23
|
+
<div class="d-alert__outline" />
|
|
24
|
+
</template>
|
|
25
|
+
<div class="d-alert__body">
|
|
26
|
+
<slot />
|
|
27
|
+
<svg
|
|
28
|
+
viewBox="0 0 1067 1067"
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
class="d-alert__sign"
|
|
31
|
+
>
|
|
32
|
+
<!-- info -->
|
|
33
|
+
<g v-if="type === 'info'">
|
|
34
|
+
<path
|
|
35
|
+
d="M202.481,1025.68l427.138,-769.216l171.992,106.943l-461.057,689.584l-138.073,-27.311Z"
|
|
36
|
+
/>
|
|
37
|
+
<path
|
|
38
|
+
d="M832.695,310.003l-170.011,-113.247l92.566,-170.289l218.937,122.443l-141.492,161.093Z"
|
|
39
|
+
/>
|
|
40
|
+
</g>
|
|
41
|
+
<!-- question -->
|
|
42
|
+
<g v-if="type === 'question'">
|
|
43
|
+
<path
|
|
44
|
+
d="M289.17,836.982l100.67,63.007l-27.42,149.27l-200.047,-83.328l126.797,-128.949Z"
|
|
45
|
+
/>
|
|
46
|
+
<path
|
|
47
|
+
d="M335.818,766.179l95.499,91.347l134.944,-217.987l249.128,-6.228l174.389,-139.096l14.533,-236.672l-170.237,-224.215l-170.238,-8.304l-242.9,124.564l114.184,64.358l178.542,-41.522l161.933,130.793l-68.51,205.53l-203.455,-53.978l-178.542,70.587l-89.27,240.823Z"
|
|
48
|
+
/>
|
|
49
|
+
</g>
|
|
50
|
+
<!-- warning -->
|
|
51
|
+
<g v-if="type === 'warning'">
|
|
52
|
+
<path
|
|
53
|
+
d="M304.988,722.034l335.792,-712.747l299.877,30.543l-514.204,743.146l-121.465,-60.942Z"
|
|
54
|
+
/>
|
|
55
|
+
<path
|
|
56
|
+
d="M253.974,839.059l148.42,40.169l-118.767,182.487l-131.537,-66.719l101.884,-155.937Z"
|
|
57
|
+
/>
|
|
58
|
+
</g>
|
|
59
|
+
</svg>
|
|
60
|
+
</div>
|
|
61
|
+
</DWrapShape>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<style>
|
|
65
|
+
.d-alert {
|
|
66
|
+
@apply font-dialog text-black dark:text-white mb-6 mt-12;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.d-alert__shape {
|
|
70
|
+
@apply bg-white dark:bg-black opacity-80;
|
|
71
|
+
clip-path: var(--shape-card--dense);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.d-alert__outline {
|
|
75
|
+
@apply absolute inset-0 bg-black dark:bg-white;
|
|
76
|
+
clip-path: var(--shape-card--dense__outline);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.d-alert--info .d-alert__outline {
|
|
80
|
+
@apply bg-cyan-500;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.d-alert--question .d-alert__outline {
|
|
84
|
+
@apply bg-yellow-500;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.d-alert--warning .d-alert__outline {
|
|
88
|
+
@apply bg-red-500;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.d-alert__body {
|
|
92
|
+
padding: var(--shape-card--dense__padding);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.d-alert__sign {
|
|
96
|
+
@apply absolute w-[5em] -top-[1.5em] -left-[1.5em]
|
|
97
|
+
pointer-events-none
|
|
98
|
+
sharp-shadow ss-white ss-r-1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.d-alert--info .d-alert__sign {
|
|
102
|
+
@apply fill-cyan-500;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.d-alert--question .d-alert__sign {
|
|
106
|
+
@apply fill-yellow-500;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.d-alert--warning .d-alert__sign {
|
|
110
|
+
@apply fill-red-500;
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
3
|
+
|
|
4
|
+
defineProps({
|
|
5
|
+
direction: {
|
|
6
|
+
type: String as () => 'left' | 'right',
|
|
7
|
+
default: 'right'
|
|
8
|
+
}
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<DWrapShape
|
|
14
|
+
tag="blockquote"
|
|
15
|
+
class="d-blockquote"
|
|
16
|
+
:class="{
|
|
17
|
+
'd-blockquote--left': direction === 'left',
|
|
18
|
+
'd-blockquote--right': direction === 'right'
|
|
19
|
+
}"
|
|
20
|
+
shape-class="d-blockquote__shape"
|
|
21
|
+
>
|
|
22
|
+
<template #bg-overlay>
|
|
23
|
+
<div class="d-blockquote__outline" />
|
|
24
|
+
</template>
|
|
25
|
+
<div class="d-blockquote__body">
|
|
26
|
+
<slot />
|
|
27
|
+
</div>
|
|
28
|
+
</DWrapShape>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.d-blockquote {
|
|
33
|
+
@apply font-dialog text-black dark:text-white my-6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.d-blockquote__outline {
|
|
37
|
+
@apply absolute inset-0 bg-black dark:bg-white;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.d-blockquote__shape {
|
|
41
|
+
@apply bg-white dark:bg-black opacity-80;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Right */
|
|
45
|
+
|
|
46
|
+
.d-blockquote--right .d-blockquote__body {
|
|
47
|
+
padding: var(--shape-bubble--right__padding);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.d-blockquote--right .d-blockquote__outline {
|
|
51
|
+
clip-path: var(--shape-bubble--right__outline);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.d-blockquote--right .d-blockquote__shape {
|
|
55
|
+
clip-path: var(--shape-bubble--right);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Left */
|
|
59
|
+
|
|
60
|
+
.d-blockquote--left .d-blockquote__body {
|
|
61
|
+
padding: var(--shape-bubble--left__padding);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.d-blockquote--left .d-blockquote__outline {
|
|
65
|
+
clip-path: var(--shape-bubble--left__outline);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.d-blockquote--left .d-blockquote__shape {
|
|
69
|
+
clip-path: var(--shape-bubble--left);
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import DChip from './DChip.vue'
|
|
2
|
+
import DPagination from './DPagination.vue'
|
|
3
|
+
import DStats from './DStats.vue'
|
|
4
|
+
|
|
5
|
+
export { DChip, DPagination, DStats }
|
|
6
|
+
|
|
7
|
+
export * from './animations'
|
|
8
|
+
export * from './buttons'
|
|
9
|
+
export * from './cards'
|
|
10
|
+
export * from './content'
|
|
11
|
+
export * from './lists'
|
|
12
|
+
export * from './utils'
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CSSProperties } from 'vue'
|
|
3
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
4
|
+
import DBtn from '../buttons/DBtn.vue'
|
|
5
|
+
|
|
6
|
+
export type ActionFanItem<TEmit = any> = {
|
|
7
|
+
title: string
|
|
8
|
+
emit?: TEmit
|
|
9
|
+
class?: string
|
|
10
|
+
style?: CSSProperties
|
|
11
|
+
shapeClass?: string
|
|
12
|
+
shapeStyle?: CSSProperties
|
|
13
|
+
attrs?: {
|
|
14
|
+
to?: string
|
|
15
|
+
href?: string
|
|
16
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string
|
|
17
|
+
[k: string]: any
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'DActionsFan',
|
|
23
|
+
components: {
|
|
24
|
+
DWrapShape,
|
|
25
|
+
DBtn
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
defineProps({
|
|
32
|
+
actions: {
|
|
33
|
+
type: Array as () => ActionFanItem[],
|
|
34
|
+
default: () => []
|
|
35
|
+
},
|
|
36
|
+
side: {
|
|
37
|
+
type: String as () => 'right' | 'left',
|
|
38
|
+
default: 'left'
|
|
39
|
+
},
|
|
40
|
+
filterClass: {
|
|
41
|
+
type: [String, Object as () => Record<string, boolean>],
|
|
42
|
+
default: ''
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
defineEmits(['actionFocus', 'actionUnfocus', 'actionChoose'])
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<!-- TODO: Use trigonometric functions to calculate size -->
|
|
51
|
+
<TransitionGroup
|
|
52
|
+
name="actions"
|
|
53
|
+
tag="ul"
|
|
54
|
+
:style="{
|
|
55
|
+
padding: `${Math.min(actions.length * 2, 15)}rem 0 ${Math.min(
|
|
56
|
+
actions.length * 3,
|
|
57
|
+
15
|
|
58
|
+
)}rem`
|
|
59
|
+
}"
|
|
60
|
+
>
|
|
61
|
+
<DWrapShape
|
|
62
|
+
v-for="(action, index) in actions"
|
|
63
|
+
:key="action.title"
|
|
64
|
+
tag="li"
|
|
65
|
+
class="d-actions-fan__list-item"
|
|
66
|
+
:filter-class="filterClass"
|
|
67
|
+
:class="{
|
|
68
|
+
[action.class ?? '']: true,
|
|
69
|
+
'd-actions-fan--right__list-item': side === 'right',
|
|
70
|
+
'd-actions-fan--left__list-item': side === 'left'
|
|
71
|
+
}"
|
|
72
|
+
:style="{
|
|
73
|
+
...action.style,
|
|
74
|
+
'--tw-rotate': `${
|
|
75
|
+
side === 'left' ? 12 - index * 18 : -12 + index * 18
|
|
76
|
+
}deg`
|
|
77
|
+
}"
|
|
78
|
+
:shape-class="{
|
|
79
|
+
'd-actions-fan__list-item__shape': true,
|
|
80
|
+
[action.shapeClass ?? '']: true,
|
|
81
|
+
'd-actions-fan--right__list-item__shape': side === 'right',
|
|
82
|
+
'd-actions-fan--left__list-item__shape': side === 'left'
|
|
83
|
+
}"
|
|
84
|
+
:shape-style="action.shapeStyle"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
class="d-actions-fan__list-item__body"
|
|
88
|
+
:class="{
|
|
89
|
+
'd-actions-fan--right__list-item__body': side === 'right'
|
|
90
|
+
}"
|
|
91
|
+
>
|
|
92
|
+
<DBtn
|
|
93
|
+
v-bind="action.attrs"
|
|
94
|
+
tag="button"
|
|
95
|
+
no-passive-highlight
|
|
96
|
+
@click="$emit('actionChoose', action.emit)"
|
|
97
|
+
@mouseenter="$emit('actionFocus', action.emit)"
|
|
98
|
+
@touchstart="$emit('actionFocus', action.emit)"
|
|
99
|
+
@focusin="$emit('actionFocus', action.emit)"
|
|
100
|
+
@mouseleave="$emit('actionUnfocus', action.emit)"
|
|
101
|
+
@touchend="$emit('actionUnfocus', action.emit)"
|
|
102
|
+
@focusout="$emit('actionUnfocus', action.emit)"
|
|
103
|
+
>
|
|
104
|
+
{{ action.title }}
|
|
105
|
+
</DBtn>
|
|
106
|
+
</div>
|
|
107
|
+
</DWrapShape>
|
|
108
|
+
</TransitionGroup>
|
|
109
|
+
</template>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
.d-actions-fan__list-item__shape {
|
|
113
|
+
@apply dark:bg-neutral-900;
|
|
114
|
+
}
|
|
115
|
+
.d-actions-fan--right__list-item__shape {
|
|
116
|
+
clip-path: polygon(calc(100% - 10px) 0, 100% 100%, 0 40%);
|
|
117
|
+
}
|
|
118
|
+
.d-actions-fan--left__list-item__shape {
|
|
119
|
+
clip-path: polygon(10px 0, 0 100%, 100% 40%);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.d-actions-fan__list-item {
|
|
123
|
+
@apply w-full transform -my-8;
|
|
124
|
+
}
|
|
125
|
+
.d-actions-fan--right__list-item {
|
|
126
|
+
@apply origin-left;
|
|
127
|
+
}
|
|
128
|
+
.d-actions-fan--left__list-item {
|
|
129
|
+
@apply origin-right;
|
|
130
|
+
}
|
|
131
|
+
.d-actions-fan__list-item__body {
|
|
132
|
+
@apply px-3 py-2;
|
|
133
|
+
}
|
|
134
|
+
.d-actions-fan--right__list-item__body {
|
|
135
|
+
@apply flex justify-end;
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
138
|
+
|
|
139
|
+
<!-- Transition -->
|
|
140
|
+
<style>
|
|
141
|
+
.actions-enter-active,
|
|
142
|
+
.actions-leave-active {
|
|
143
|
+
@apply transition-all;
|
|
144
|
+
}
|
|
145
|
+
.actions-enter-from {
|
|
146
|
+
--tw-rotate: -90deg !important;
|
|
147
|
+
@apply opacity-0;
|
|
148
|
+
}
|
|
149
|
+
.actions-leave-to {
|
|
150
|
+
--tw-rotate: 90deg !important;
|
|
151
|
+
@apply opacity-0;
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import DWrapFocusHighlight, {
|
|
3
|
+
type HighlightVariant
|
|
4
|
+
} from '../utils/DWrapFocusHighlight.vue'
|
|
5
|
+
import DWrapShape from '../utils/DWrapShape.vue'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'DActionsList',
|
|
9
|
+
components: {
|
|
10
|
+
DWrapFocusHighlight,
|
|
11
|
+
DWrapShape
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ActionListItem<TEmit = any> = {
|
|
16
|
+
title: string
|
|
17
|
+
emit?: TEmit
|
|
18
|
+
attrs?: {
|
|
19
|
+
to?: string
|
|
20
|
+
href?: string
|
|
21
|
+
target?: '_blank' | '_self' | '_parent' | '_top' | string
|
|
22
|
+
highlightVariant?: HighlightVariant
|
|
23
|
+
[k: string]: any
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
defineEmits(['actionFocus', 'actionUnfocus', 'actionChoose'])
|
|
30
|
+
|
|
31
|
+
defineProps({
|
|
32
|
+
actions: {
|
|
33
|
+
type: Array as () => ActionListItem[],
|
|
34
|
+
default: () => []
|
|
35
|
+
},
|
|
36
|
+
listClass: {
|
|
37
|
+
type: [String, Object as () => Record<string, boolean>],
|
|
38
|
+
default: ''
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
function getCurrentHighlightVariant(action: ActionListItem): HighlightVariant {
|
|
43
|
+
if (action.attrs?.highlightVariant) return action.attrs.highlightVariant
|
|
44
|
+
return 'negative-list-item'
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<DWrapShape shape-class="d-actions-list__shape">
|
|
50
|
+
<div class="d-actions-list__body">
|
|
51
|
+
<div class="d-actions-list__header">
|
|
52
|
+
<slot name="header" />
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<TransitionGroup
|
|
56
|
+
name="actions"
|
|
57
|
+
tag="ul"
|
|
58
|
+
class="d-actions-list__list"
|
|
59
|
+
:class="listClass"
|
|
60
|
+
>
|
|
61
|
+
<li v-for="action in actions" :key="action.title">
|
|
62
|
+
<DWrapFocusHighlight
|
|
63
|
+
v-bind="action.attrs"
|
|
64
|
+
tag="button"
|
|
65
|
+
:variant="getCurrentHighlightVariant(action)"
|
|
66
|
+
no-passive-link
|
|
67
|
+
@click="$emit('actionChoose', action.emit)"
|
|
68
|
+
@mouseenter="$emit('actionFocus', action.emit)"
|
|
69
|
+
@touchstart="$emit('actionFocus', action.emit)"
|
|
70
|
+
@focusin="$emit('actionFocus', action.emit)"
|
|
71
|
+
@mouseleave="$emit('actionUnfocus', action.emit)"
|
|
72
|
+
@touchend="$emit('actionUnfocus', action.emit)"
|
|
73
|
+
@focusout="$emit('actionUnfocus', action.emit)"
|
|
74
|
+
>
|
|
75
|
+
{{ action.title }}
|
|
76
|
+
</DWrapFocusHighlight>
|
|
77
|
+
</li>
|
|
78
|
+
</TransitionGroup>
|
|
79
|
+
</div>
|
|
80
|
+
</DWrapShape>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<style>
|
|
84
|
+
.d-actions-list__shape {
|
|
85
|
+
@apply dark:bg-neutral-900 dark:bg-opacity-80 backdrop-blur;
|
|
86
|
+
clip-path: polygon(10px 0, 0 100%, 100% calc(100% - 10px), 100% 13px);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.d-actions-list__body {
|
|
90
|
+
@apply p-7;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.d-actions-list__header {
|
|
94
|
+
@apply mb-4 font-serif text-lg;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.d-actions-list__list {
|
|
98
|
+
@apply relative [&_button]:font-sans [&_button]:font-bold [&_button]:text-left font-sans font-bold;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type StyleValue } from 'vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'DWrapBackground'
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
defineProps({
|
|
11
|
+
overlayClass: {
|
|
12
|
+
type: [String, Object as () => Record<string, boolean>],
|
|
13
|
+
default: ''
|
|
14
|
+
},
|
|
15
|
+
overlayStyle: {
|
|
16
|
+
type: Object as () => StyleValue,
|
|
17
|
+
default: () => {}
|
|
18
|
+
},
|
|
19
|
+
dotsClass: {
|
|
20
|
+
type: [String, Object as () => Record<string, boolean>],
|
|
21
|
+
default: ''
|
|
22
|
+
},
|
|
23
|
+
dotsStyle: {
|
|
24
|
+
type: Object as () => StyleValue,
|
|
25
|
+
default: () => {}
|
|
26
|
+
},
|
|
27
|
+
dots: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
tag: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'div'
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<Component :is="tag" class="mbg__main-container">
|
|
40
|
+
<div class="mbg__relative-container">
|
|
41
|
+
<div class="mbg__layer" :class="overlayClass" :style="overlayStyle" />
|
|
42
|
+
<div class="mbg__layer">
|
|
43
|
+
<slot name="svg" />
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
v-if="dots"
|
|
47
|
+
class="mbg__layer mbg__dots"
|
|
48
|
+
:class="dotsClass"
|
|
49
|
+
:style="dotsStyle"
|
|
50
|
+
/>
|
|
51
|
+
<div class="mbg__content">
|
|
52
|
+
<slot />
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</Component>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.mbg__main-container {
|
|
60
|
+
isolation: isolate;
|
|
61
|
+
}
|
|
62
|
+
.mbg__relative-container {
|
|
63
|
+
@apply relative w-full h-full;
|
|
64
|
+
}
|
|
65
|
+
.mbg__layer {
|
|
66
|
+
inset: 0;
|
|
67
|
+
@apply absolute;
|
|
68
|
+
}
|
|
69
|
+
.mbg__dots {
|
|
70
|
+
background: url('data:image/svg+xml;utf8,<svg width="100" height="100" transform="rotate(0)" opacity="0.2" version="1.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="%23250E17"><circle cx="25" cy="25" r="12.5"/><circle cx="75" cy="75" r="12.5"/><circle cx="75" cy="25" r="12.5"/><circle cx="25" cy="75" r="12.5"/></g></svg>');
|
|
71
|
+
background-size: 2rem;
|
|
72
|
+
}
|
|
73
|
+
.mbg__content {
|
|
74
|
+
@apply relative z-[1];
|
|
75
|
+
}
|
|
76
|
+
</style>
|