@d0rich/esprit-design 0.3.4 → 0.3.6
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 +12 -0
- package/dist/components/buttons/DBtn.vue.d.ts +2 -2
- package/dist/components/lists/DActionsList.vue.d.ts +17 -15
- package/dist/components/utils/DWrapBackground.vue.d.ts +6 -3
- package/dist/components/utils/DWrapFocusHighlight.vue.d.ts +1 -1
- package/dist/components/utils/DWrapShape.vue.d.ts +8 -4
- package/dist/esprit-design.js +784 -754
- package/dist/esprit-design.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/buttons/DBtn.vue +1 -1
- package/src/components/lists/DActionsList.vue +13 -13
- package/src/components/utils/DWrapBackground.vue +30 -12
- package/src/components/utils/DWrapFocusHighlight.vue +36 -15
- package/src/components/utils/DWrapShape.vue +53 -11
|
@@ -12,7 +12,9 @@ export default {
|
|
|
12
12
|
|
|
13
13
|
<script setup lang="ts">
|
|
14
14
|
export type HighlightVariant =
|
|
15
|
+
| 'tile'
|
|
15
16
|
| 'negative-tile'
|
|
17
|
+
| 'composite-tile'
|
|
16
18
|
| 'list-item'
|
|
17
19
|
| 'negative-list-item'
|
|
18
20
|
| 'composite-list-item'
|
|
@@ -69,19 +71,30 @@ const currentComponent = computed(() => {
|
|
|
69
71
|
class="d-focus-hl__hl--negative-tile"
|
|
70
72
|
/>
|
|
71
73
|
<div
|
|
72
|
-
v-else-if="variant === '
|
|
73
|
-
class="d-focus-hl__hl--
|
|
74
|
+
v-else-if="variant === 'tile' || variant === 'composite-tile'"
|
|
75
|
+
class="d-focus-hl__hl--tile"
|
|
74
76
|
:class="colorClass"
|
|
75
77
|
/>
|
|
76
78
|
<div
|
|
77
79
|
v-else-if="variant === 'negative-list-item'"
|
|
78
80
|
class="d-focus-hl__hl--negative-list-item"
|
|
79
81
|
/>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
<div
|
|
83
|
+
v-else-if="variant === 'list-item' || variant === 'composite-list-item'"
|
|
84
|
+
class="d-focus-hl__hl--list-item"
|
|
85
|
+
:class="colorClass"
|
|
86
|
+
/>
|
|
87
|
+
|
|
84
88
|
<slot />
|
|
89
|
+
|
|
90
|
+
<div
|
|
91
|
+
v-if="variant === 'composite-tile'"
|
|
92
|
+
class="d-focus-hl__hl--negative-tile"
|
|
93
|
+
/>
|
|
94
|
+
<div
|
|
95
|
+
v-else-if="variant === 'composite-list-item'"
|
|
96
|
+
class="d-focus-hl__hl--negative-list-item"
|
|
97
|
+
/>
|
|
85
98
|
</Component>
|
|
86
99
|
</DWrapShape>
|
|
87
100
|
</template>
|
|
@@ -89,7 +102,7 @@ const currentComponent = computed(() => {
|
|
|
89
102
|
<!-- common -->
|
|
90
103
|
<style>
|
|
91
104
|
.d-focus-hl {
|
|
92
|
-
@apply relative;
|
|
105
|
+
@apply relative isolate;
|
|
93
106
|
}
|
|
94
107
|
.d-focus-hl--default-color {
|
|
95
108
|
@apply bg-red-600;
|
|
@@ -98,11 +111,11 @@ const currentComponent = computed(() => {
|
|
|
98
111
|
|
|
99
112
|
<!-- negative-tile -->
|
|
100
113
|
<style>
|
|
101
|
-
.d-focus-hl:has(.d-focus-hl__hl--negative-tile) {
|
|
114
|
+
.d-focus-hl:has(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
102
115
|
@apply w-fit;
|
|
103
116
|
}
|
|
104
117
|
|
|
105
|
-
.d-focus-hl > .d-focus-hl__hl--negative-tile {
|
|
118
|
+
.d-focus-hl > :is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
106
119
|
width: 0%;
|
|
107
120
|
height: 0%;
|
|
108
121
|
top: 50%;
|
|
@@ -110,23 +123,31 @@ const currentComponent = computed(() => {
|
|
|
110
123
|
content: '';
|
|
111
124
|
opacity: 0;
|
|
112
125
|
pointer-events: none;
|
|
113
|
-
@apply absolute
|
|
126
|
+
@apply absolute transition-all;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.d-focus-hl > .d-focus-hl__hl--negative-tile {
|
|
130
|
+
@apply backdrop-invert;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.d-focus-hl > .d-focus-hl__hl--tile {
|
|
134
|
+
@apply -z-10;
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
.d-focus-hl:hover > .d-focus-hl__hl--negative-tile,
|
|
117
|
-
.d-focusable:focus .d-focus-hl__hl--negative-tile {
|
|
137
|
+
.d-focus-hl:hover > :is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile),
|
|
138
|
+
.d-focusable:focus :is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
118
139
|
opacity: 1;
|
|
119
140
|
animation: hl--negative-tile-animation linear 1s infinite;
|
|
120
141
|
}
|
|
121
142
|
|
|
122
|
-
.d-focus-hl:hover > .d-focus-hl__hl--negative-tile {
|
|
143
|
+
.d-focus-hl:hover > :is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
123
144
|
width: 110%;
|
|
124
145
|
height: 130%;
|
|
125
146
|
top: -15%;
|
|
126
147
|
left: -5%;
|
|
127
148
|
}
|
|
128
149
|
|
|
129
|
-
.d-focusable:focus .d-focus-hl__hl--negative-tile {
|
|
150
|
+
.d-focusable:focus :is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
130
151
|
width: 140% !important;
|
|
131
152
|
height: 200% !important;
|
|
132
153
|
top: -50% !important;
|
|
@@ -142,7 +163,7 @@ const currentComponent = computed(() => {
|
|
|
142
163
|
),
|
|
143
164
|
.d-focus-hl--active
|
|
144
165
|
)
|
|
145
|
-
:is(.d-focus-hl__hl--negative-tile) {
|
|
166
|
+
:is(.d-focus-hl__hl--negative-tile, .d-focus-hl__hl--tile) {
|
|
146
167
|
opacity: 1;
|
|
147
168
|
width: 120% !important;
|
|
148
169
|
height: 120% !important;
|
|
@@ -1,27 +1,69 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { type StyleValue } from 'vue'
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type StyleValue, computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
defineOptions({
|
|
5
5
|
name: 'DWrapShape'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
defineProps<{
|
|
6
|
+
})
|
|
7
|
+
const props = defineProps<{
|
|
11
8
|
shapeClass?: string | Record<string, boolean>
|
|
12
9
|
shapeStyle?: StyleValue
|
|
13
10
|
filterClass?: string | Record<string, boolean>
|
|
14
11
|
filterStyle?: StyleValue
|
|
15
12
|
tag?: string
|
|
16
13
|
}>()
|
|
14
|
+
|
|
15
|
+
const slots = defineSlots<{
|
|
16
|
+
'shape-content'?: () => {}
|
|
17
|
+
'bg-overlay'?: () => {}
|
|
18
|
+
default?: () => {}
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
function isClassEmpty(
|
|
22
|
+
cls: string | Record<string, boolean> | undefined
|
|
23
|
+
): boolean {
|
|
24
|
+
if (!cls) return true
|
|
25
|
+
if (typeof cls === 'string') return !cls.trim()
|
|
26
|
+
return Object.keys(cls).length === 0
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isStyleEmpty(style: StyleValue): boolean {
|
|
30
|
+
if (typeof style === 'string') return !style.trim()
|
|
31
|
+
if (Array.isArray(style)) return style.length === 0
|
|
32
|
+
if (style === null) return true
|
|
33
|
+
if (style === undefined) return true
|
|
34
|
+
return Object.keys(style).length === 0
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const isShapeCustomized = computed(() => {
|
|
38
|
+
if (slots['shape-content']) return true
|
|
39
|
+
if (!isClassEmpty(props.shapeClass)) return true
|
|
40
|
+
return !isStyleEmpty(props.shapeStyle)
|
|
41
|
+
})
|
|
42
|
+
const isFilterCustomized = computed(() => {
|
|
43
|
+
if (!isClassEmpty(props.filterClass)) return true
|
|
44
|
+
return !isStyleEmpty(props.filterStyle)
|
|
45
|
+
})
|
|
17
46
|
</script>
|
|
18
47
|
|
|
19
48
|
<template>
|
|
20
49
|
<Component :is="tag ?? 'div'">
|
|
21
50
|
<div class="d-shape">
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
51
|
+
<div
|
|
52
|
+
v-if="isShapeCustomized || slots['bg-overlay'] || isFilterCustomized"
|
|
53
|
+
class="d-shape__bg-filter"
|
|
54
|
+
:class="filterClass"
|
|
55
|
+
:style="filterStyle"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
v-if="isShapeCustomized || slots['bg-overlay']"
|
|
59
|
+
class="d-shape__bg-wrapper"
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
v-if="isShapeCustomized"
|
|
63
|
+
class="d-shape__bg"
|
|
64
|
+
:class="shapeClass"
|
|
65
|
+
:style="shapeStyle"
|
|
66
|
+
>
|
|
25
67
|
<slot name="shape-content" />
|
|
26
68
|
</div>
|
|
27
69
|
<slot name="bg-overlay" />
|