srcdev-nuxt-components 6.1.18 → 6.1.20
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.
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
>
|
|
7
7
|
<div class="display-prompt-wrapper" :data-theme="theme" :class="[elementClasses]" data-test-id="display-prompt">
|
|
8
8
|
<div class="display-prompt-inner">
|
|
9
|
-
<div class="display-prompt-icon" data-test-id="prompt-icon">
|
|
9
|
+
<div class="display-prompt-icon" data-test-id="prompt-icon" aria-hidden="true">
|
|
10
10
|
<slot name="customDecoratorIcon">
|
|
11
11
|
<Icon :name="displayPromptIcons[theme] ?? 'akar-icons:circle-alert'" class="icon" :color="iconColor" />
|
|
12
12
|
</slot>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<Teleport to="body">
|
|
3
3
|
<div
|
|
4
4
|
v-if="privateToastState"
|
|
5
|
-
class="display-
|
|
5
|
+
class="display-toast"
|
|
6
6
|
:class="[
|
|
7
7
|
elementClasses,
|
|
8
8
|
{
|
|
@@ -13,30 +13,32 @@
|
|
|
13
13
|
hide: isHiding,
|
|
14
14
|
},
|
|
15
15
|
]"
|
|
16
|
+
:data-theme="theme"
|
|
16
17
|
>
|
|
17
18
|
<slot v-if="slots.default"></slot>
|
|
18
19
|
|
|
19
|
-
<div v-else class="display-
|
|
20
|
-
<div class="
|
|
21
|
-
<
|
|
22
|
-
<Icon name="akar-icons:
|
|
23
|
-
</
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
<div v-else class="display-toast-inner">
|
|
21
|
+
<div class="toast-icon" aria-hidden="true">
|
|
22
|
+
<slot name="customToastIcon">
|
|
23
|
+
<Icon :name="defaultThemeIcons[props.theme] ?? 'akar-icons:info'" class="icon" />
|
|
24
|
+
</slot>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="toast-message">{{ toastDisplayText }}</div>
|
|
27
|
+
<div class="toast-action">
|
|
28
|
+
<button @click.prevent="closeToast">
|
|
29
|
+
<Icon name="material-symbols:close" class="icon" />
|
|
30
|
+
<span class="sr-only">Close</span>
|
|
31
|
+
</button>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
32
|
-
<div v-if="displayDurationInt > 0" @transitionend="closeToast()" class="display-
|
|
34
|
+
<div v-if="displayDurationInt > 0" @transitionend="closeToast()" class="display-toast-progress"></div>
|
|
33
35
|
</div>
|
|
34
36
|
</Teleport>
|
|
35
37
|
</template>
|
|
36
38
|
<script setup lang="ts">
|
|
37
39
|
const props = defineProps({
|
|
38
40
|
theme: {
|
|
39
|
-
type: String
|
|
41
|
+
type: String as PropType<"primary" | "secondary" | "tertiary" | "ghost" | "error" | "info" | "success" | "warning">,
|
|
40
42
|
default: "ghost",
|
|
41
43
|
validator(value: string) {
|
|
42
44
|
return ["primary", "secondary", "tertiary", "ghost", "error", "info", "success", "warning"].includes(value)
|
|
@@ -60,16 +62,20 @@ const props = defineProps({
|
|
|
60
62
|
},
|
|
61
63
|
})
|
|
62
64
|
|
|
65
|
+
const defaultThemeIcons = {
|
|
66
|
+
primary: "akar-icons:info",
|
|
67
|
+
secondary: "akar-icons:info",
|
|
68
|
+
tertiary: "akar-icons:info",
|
|
69
|
+
ghost: "akar-icons:info",
|
|
70
|
+
error: "akar-icons:circle-alert",
|
|
71
|
+
info: "akar-icons:info",
|
|
72
|
+
success: "akar-icons:info",
|
|
73
|
+
warning: "akar-icons:circle-alert",
|
|
74
|
+
}
|
|
75
|
+
|
|
63
76
|
const slots = useSlots()
|
|
64
77
|
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
65
78
|
|
|
66
|
-
watch(
|
|
67
|
-
() => props.styleClassPassthrough,
|
|
68
|
-
() => {
|
|
69
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
|
|
73
79
|
const privateToastState = ref(false)
|
|
74
80
|
const isHiding = ref(false)
|
|
75
81
|
const publicToastState = defineModel<boolean>({ default: false })
|
|
@@ -94,6 +100,13 @@ const closeToast = async () => {
|
|
|
94
100
|
sendCloseEvent()
|
|
95
101
|
}
|
|
96
102
|
|
|
103
|
+
watch(
|
|
104
|
+
() => props.styleClassPassthrough,
|
|
105
|
+
() => {
|
|
106
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
|
|
97
110
|
watch(
|
|
98
111
|
() => publicToastState.value,
|
|
99
112
|
async (newValue, previousValue) => {
|
|
@@ -111,7 +124,7 @@ watch(
|
|
|
111
124
|
)
|
|
112
125
|
</script>
|
|
113
126
|
|
|
114
|
-
<style lang="css">
|
|
127
|
+
<style scoped lang="css">
|
|
115
128
|
@keyframes fade-in {
|
|
116
129
|
5% {
|
|
117
130
|
opacity: 1;
|
|
@@ -151,7 +164,7 @@ watch(
|
|
|
151
164
|
}
|
|
152
165
|
}
|
|
153
166
|
|
|
154
|
-
.display-
|
|
167
|
+
.display-toast {
|
|
155
168
|
display: block;
|
|
156
169
|
overflow: hidden;
|
|
157
170
|
position: fixed;
|
|
@@ -189,24 +202,24 @@ watch(
|
|
|
189
202
|
animation: hide v-bind(revealDuration)
|
|
190
203
|
linear(
|
|
191
204
|
0,
|
|
192
|
-
0.
|
|
193
|
-
0.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
1.
|
|
197
|
-
1.046
|
|
198
|
-
1.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
0.
|
|
203
|
-
|
|
205
|
+
0.006 53.7%,
|
|
206
|
+
0.986 61.5%,
|
|
207
|
+
1.014 73.4%,
|
|
208
|
+
1.087 76.1%,
|
|
209
|
+
1.074 78.4%,
|
|
210
|
+
1.046 80.4%,
|
|
211
|
+
1.002 82.3%,
|
|
212
|
+
0.862 85.9%,
|
|
213
|
+
0.651 89.4%,
|
|
214
|
+
0.123 96.5%,
|
|
215
|
+
0.029 98.4%,
|
|
216
|
+
0
|
|
204
217
|
)
|
|
205
218
|
forwards;
|
|
206
219
|
}
|
|
207
220
|
|
|
208
221
|
&:hover {
|
|
209
|
-
.display-
|
|
222
|
+
.display-toast-progress {
|
|
210
223
|
animation-play-state: paused;
|
|
211
224
|
}
|
|
212
225
|
}
|
|
@@ -216,12 +229,19 @@ watch(
|
|
|
216
229
|
right: 24px;
|
|
217
230
|
}
|
|
218
231
|
|
|
219
|
-
|
|
220
|
-
left
|
|
221
|
-
|
|
232
|
+
&:not(.full-width) {
|
|
233
|
+
&.left {
|
|
234
|
+
left: 24px;
|
|
235
|
+
}
|
|
222
236
|
|
|
223
|
-
|
|
224
|
-
|
|
237
|
+
&.right {
|
|
238
|
+
right: 24px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&.center {
|
|
242
|
+
left: 50%;
|
|
243
|
+
/* transform: translateX(-50%); */
|
|
244
|
+
}
|
|
225
245
|
}
|
|
226
246
|
|
|
227
247
|
&.top {
|
|
@@ -233,85 +253,99 @@ watch(
|
|
|
233
253
|
transform: translateY(30px);
|
|
234
254
|
}
|
|
235
255
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
border-radius: 12px;
|
|
240
|
-
background-color: #9ce6a8;
|
|
241
|
-
color: white;
|
|
242
|
-
|
|
243
|
-
&.success {
|
|
244
|
-
background-color: var(--green-4);
|
|
245
|
-
border-color: var(--green-2);
|
|
246
|
-
}
|
|
247
|
-
&.error {
|
|
248
|
-
background-color: var(--red-3);
|
|
249
|
-
border-color: var(--red-2);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.display-notification-body {
|
|
254
|
-
display: flex;
|
|
255
|
-
flex-direction: row;
|
|
256
|
-
padding: 6px 12px 10px 12px;
|
|
257
|
-
}
|
|
256
|
+
/*
|
|
257
|
+
* Styles for the display toast component
|
|
258
|
+
*/
|
|
258
259
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
260
|
+
&.has-theme {
|
|
261
|
+
padding-inline-start: 6px;
|
|
262
|
+
background-color: var(--colour-theme-8);
|
|
263
|
+
|
|
264
|
+
border: 0.1rem solid var(--colour-theme-8);
|
|
265
|
+
border-start-start-radius: 8px;
|
|
266
|
+
border-end-start-radius: 8px;
|
|
267
|
+
overflow: hidden;
|
|
268
|
+
|
|
269
|
+
.display-toast-inner {
|
|
270
|
+
display: grid;
|
|
271
|
+
grid-template-columns: auto 1fr auto;
|
|
272
|
+
gap: 12px;
|
|
273
|
+
align-items: center;
|
|
274
|
+
background-color: var(--gray-10);
|
|
275
|
+
border-start-start-radius: 8px;
|
|
276
|
+
border-end-start-radius: 8px;
|
|
277
|
+
padding: 12px 14px;
|
|
278
|
+
overflow: hidden;
|
|
279
|
+
|
|
280
|
+
.toast-icon {
|
|
281
|
+
display: inline-flex;
|
|
282
|
+
align-items: center;
|
|
283
|
+
justify-content: center;
|
|
284
|
+
margin-right: 12px;
|
|
285
|
+
|
|
286
|
+
.icon {
|
|
287
|
+
color: var(--colour-theme-0);
|
|
288
|
+
display: inline-block;
|
|
289
|
+
font-size: 2.5rem;
|
|
290
|
+
font-style: normal;
|
|
291
|
+
font-weight: normal;
|
|
292
|
+
overflow: hidden;
|
|
278
293
|
}
|
|
279
294
|
}
|
|
280
295
|
|
|
281
|
-
.
|
|
282
|
-
|
|
283
|
-
|
|
296
|
+
.toast-message {
|
|
297
|
+
display: flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
font-size: var(--step-4);
|
|
300
|
+
font-weight: normal;
|
|
301
|
+
line-height: 1.3;
|
|
302
|
+
color: var(--colour-theme-0);
|
|
303
|
+
margin: 0;
|
|
304
|
+
padding: 0;
|
|
284
305
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
|
|
307
|
+
.toast-action {
|
|
308
|
+
display: flex;
|
|
309
|
+
align-items: center;
|
|
310
|
+
justify-content: center;
|
|
311
|
+
margin-left: 12px;
|
|
312
|
+
|
|
313
|
+
button {
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
justify-content: center;
|
|
317
|
+
background: var(--colour-theme-10);
|
|
318
|
+
border: 0.1rem solid var(--colour-theme-8);
|
|
319
|
+
outline: 0.1rem solid transparent;
|
|
320
|
+
border-radius: 50%;
|
|
321
|
+
box-shadow: none;
|
|
322
|
+
color: var(--colour-theme-0);
|
|
323
|
+
cursor: pointer;
|
|
324
|
+
font-size: var(--step-4);
|
|
325
|
+
font-weight: bold;
|
|
326
|
+
padding: 0.5rem;
|
|
327
|
+
text-decoration: underline;
|
|
328
|
+
|
|
329
|
+
transition: all 0.3s ease;
|
|
330
|
+
|
|
331
|
+
.icon {
|
|
332
|
+
font-size: 1.5rem;
|
|
333
|
+
vertical-align: middle;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
&:hover {
|
|
337
|
+
box-shadow: none;
|
|
338
|
+
background-color: var(--colour-theme-8);
|
|
339
|
+
color: var(--colour-theme-0);
|
|
340
|
+
outline: 0.1rem solid var(--colour-theme-3);
|
|
341
|
+
outline-offset: 0.2rem;
|
|
308
342
|
}
|
|
309
343
|
}
|
|
310
344
|
}
|
|
311
345
|
}
|
|
312
346
|
}
|
|
313
347
|
|
|
314
|
-
.display-
|
|
348
|
+
.display-toast-progress {
|
|
315
349
|
position: absolute;
|
|
316
350
|
right: 8px;
|
|
317
351
|
bottom: 4px;
|
|
@@ -319,7 +353,7 @@ watch(
|
|
|
319
353
|
height: 3px;
|
|
320
354
|
transform: scaleX(0);
|
|
321
355
|
transform-origin: right;
|
|
322
|
-
background: linear-gradient(to right,
|
|
356
|
+
background: linear-gradient(to right, var(--colour-theme-2), var(--colour-theme-8));
|
|
323
357
|
border-radius: inherit;
|
|
324
358
|
animation: progress v-bind(progressDuration) linear forwards;
|
|
325
359
|
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="tag" class="magnetic-navigation" :class="[elementClasses]">
|
|
3
|
+
<nav>
|
|
4
|
+
<ul>
|
|
5
|
+
<li><a href="#">Home</a></li>
|
|
6
|
+
<li><a href="#">About</a></li>
|
|
7
|
+
<li><a href="#">Blog</a></li>
|
|
8
|
+
<li><a href="#">Contact</a></li>
|
|
9
|
+
</ul>
|
|
10
|
+
</nav>
|
|
11
|
+
</component>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
tag: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "div",
|
|
19
|
+
validator(value: string) {
|
|
20
|
+
return ["div", "header", "footer", "nav"].includes(value)
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
styleClassPassthrough: {
|
|
24
|
+
type: Array as PropType<string[]>,
|
|
25
|
+
default: () => [],
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
30
|
+
|
|
31
|
+
watch(
|
|
32
|
+
() => props.styleClassPassthrough,
|
|
33
|
+
() => {
|
|
34
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<style lang="css">
|
|
40
|
+
.magnetic-navigation {
|
|
41
|
+
/*
|
|
42
|
+
--_background-image: url("/images/rotating-carousel/image-3.webp");
|
|
43
|
+
|
|
44
|
+
background-image: var(--_background-image);
|
|
45
|
+
background-size: cover;
|
|
46
|
+
background-position: 0 -400px;
|
|
47
|
+
background-attachment: fixed;
|
|
48
|
+
*/
|
|
49
|
+
/* padding-block: 200px 2000px; */
|
|
50
|
+
|
|
51
|
+
nav {
|
|
52
|
+
width: fit-content;
|
|
53
|
+
margin: 3rem auto;
|
|
54
|
+
background: hsl(0 0% 0% / 0.8);
|
|
55
|
+
|
|
56
|
+
padding: 8px;
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
|
|
59
|
+
isolation: isolate;
|
|
60
|
+
|
|
61
|
+
anchor-name: --hovered-link;
|
|
62
|
+
|
|
63
|
+
li:hover {
|
|
64
|
+
anchor-name: --hovered-link;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&::before,
|
|
68
|
+
&::after {
|
|
69
|
+
content: "";
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: calc(anchor(bottom) - 10px);
|
|
72
|
+
left: calc(anchor(left) + 1rem);
|
|
73
|
+
right: calc(anchor(right) + 1rem);
|
|
74
|
+
bottom: calc(anchor(bottom) + 5px);
|
|
75
|
+
border-radius: 10px;
|
|
76
|
+
|
|
77
|
+
position-anchor: --hovered-link;
|
|
78
|
+
|
|
79
|
+
transition: 500ms
|
|
80
|
+
linear(
|
|
81
|
+
0,
|
|
82
|
+
0.029 1.6%,
|
|
83
|
+
0.123 3.5%,
|
|
84
|
+
0.651 10.6%,
|
|
85
|
+
0.862 14.1%,
|
|
86
|
+
1.002 17.7%,
|
|
87
|
+
1.046 19.6%,
|
|
88
|
+
1.074 21.6%,
|
|
89
|
+
1.087 23.9%,
|
|
90
|
+
1.086 26.6%,
|
|
91
|
+
1.014 38.5%,
|
|
92
|
+
0.994 46.3%,
|
|
93
|
+
1
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&::before {
|
|
98
|
+
z-index: -1;
|
|
99
|
+
background: rgb(0 0 0 / 0.2);
|
|
100
|
+
backdrop-filter: blur(2px);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&::after {
|
|
104
|
+
z-index: -2;
|
|
105
|
+
background-image: var(--_background-image);
|
|
106
|
+
background-size: cover;
|
|
107
|
+
background-position: var(--_background-position);
|
|
108
|
+
background-attachment: fixed;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:has(a:hover)::before,
|
|
112
|
+
&:has(a:hover)::after {
|
|
113
|
+
top: anchor(top);
|
|
114
|
+
left: anchor(left);
|
|
115
|
+
right: anchor(right);
|
|
116
|
+
bottom: anchor(bottom);
|
|
117
|
+
|
|
118
|
+
@supports (corner-shape: squircle) {
|
|
119
|
+
corner-shape: squircle;
|
|
120
|
+
border-radius: 50%;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:has(li:first-of-type a:hover)::before,
|
|
125
|
+
&:has(li:first-of-type a:hover)::after {
|
|
126
|
+
@supports (corner-shape: squircle) {
|
|
127
|
+
border-radius: 32px 50% 50% 32px;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&:has(li:last-of-type a:hover)::before,
|
|
132
|
+
&:has(li:last-of-type a:hover)::after {
|
|
133
|
+
@supports (corner-shape: squircle) {
|
|
134
|
+
border-radius: 50% 32px 32px 50%;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
@supports (corner-shape: squircle) {
|
|
139
|
+
border-radius: 24px;
|
|
140
|
+
corner-shape: squircle;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
> ul {
|
|
144
|
+
padding: 0;
|
|
145
|
+
margin: 0;
|
|
146
|
+
list-style: none;
|
|
147
|
+
display: flex;
|
|
148
|
+
gap: 24px;
|
|
149
|
+
|
|
150
|
+
a {
|
|
151
|
+
display: block;
|
|
152
|
+
padding: 1rem;
|
|
153
|
+
text-decoration: none;
|
|
154
|
+
color: white;
|
|
155
|
+
font-size: var(--step-7);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
</style>
|
package/package.json
CHANGED