srcdev-nuxt-components 5.0.0 → 5.0.2
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<
|
|
2
|
+
<component :is="tag" class="layout-row" :class="elementClasses" :id :tab-index="isLandmark ? 0 : null" :aria-label="isLandmark ? 'Layout Row Landmark' : undefined">
|
|
3
|
+
<div :data-testid="dataTestid" class="layout-row-inner" :class="variant">
|
|
4
4
|
<div>
|
|
5
5
|
<slot name="default"></slot>
|
|
6
6
|
</div>
|
|
7
|
-
</
|
|
8
|
-
</
|
|
7
|
+
</div>
|
|
8
|
+
</component>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script lang="ts">
|
|
@@ -51,10 +51,18 @@ const props = defineProps({
|
|
|
51
51
|
return VARIANT_CLASSES.includes(value);
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
|
+
id: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: null,
|
|
57
|
+
},
|
|
54
58
|
styleClassPassthrough: {
|
|
55
59
|
type: Array as PropType<string[]>,
|
|
56
60
|
default: () => [],
|
|
57
61
|
},
|
|
62
|
+
isLandmark: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
58
66
|
});
|
|
59
67
|
|
|
60
68
|
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
@@ -387,6 +387,15 @@ watch(
|
|
|
387
387
|
padding: 12px;
|
|
388
388
|
|
|
389
389
|
.main-navigation {
|
|
390
|
+
/* Set up some global vars */
|
|
391
|
+
--_link-padding-block: 0.8rem;
|
|
392
|
+
--_link-padding-inline: 0.2rem;
|
|
393
|
+
--_link-margin-block: 0.1rem;
|
|
394
|
+
--_link-margin-inline: 0.1rem;
|
|
395
|
+
--_link-focus-visible-outline-width: 0.2rem;
|
|
396
|
+
--_link-border-default: 2px solid transparent;
|
|
397
|
+
--_link-border-bottom-hover: var(--green-8);
|
|
398
|
+
|
|
390
399
|
grid-area: navStack;
|
|
391
400
|
display: flex;
|
|
392
401
|
flex-wrap: nowrap;
|
|
@@ -417,6 +426,8 @@ watch(
|
|
|
417
426
|
width: var(--_main-navigation-item-width);
|
|
418
427
|
overflow: hidden;
|
|
419
428
|
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
|
|
429
|
+
padding-block: var(--_link-focus-visible-outline-width);
|
|
430
|
+
padding-inline: var(--_link-focus-visible-outline-width);
|
|
420
431
|
|
|
421
432
|
.main-navigation-link {
|
|
422
433
|
display: flex;
|
|
@@ -426,6 +437,17 @@ watch(
|
|
|
426
437
|
text-decoration: none;
|
|
427
438
|
margin-inline-start: 0;
|
|
428
439
|
transition: var(--_link-visibility-transition);
|
|
440
|
+
|
|
441
|
+
padding-block: var(--_link-padding-block);
|
|
442
|
+
padding-inline: var(--_link-padding-inline);
|
|
443
|
+
margin-block: var(--_link-margin-block);
|
|
444
|
+
margin-inline: var(--_link-margin-inline);
|
|
445
|
+
border-bottom: var(--_link-border-default);
|
|
446
|
+
|
|
447
|
+
&:hover {
|
|
448
|
+
cursor: pointer;
|
|
449
|
+
border-bottom-color: var(--_link-border-bottom-hover);
|
|
450
|
+
}
|
|
429
451
|
}
|
|
430
452
|
|
|
431
453
|
.main-navigation-details {
|
|
@@ -436,6 +458,10 @@ watch(
|
|
|
436
458
|
|
|
437
459
|
&[open] {
|
|
438
460
|
--_icon-transform: scaleY(-1);
|
|
461
|
+
|
|
462
|
+
.main-navigation-details-summary {
|
|
463
|
+
border-bottom-color: var(--_link-border-bottom-hover);
|
|
464
|
+
}
|
|
439
465
|
}
|
|
440
466
|
|
|
441
467
|
.has-toggle-icon {
|
|
@@ -451,6 +477,12 @@ watch(
|
|
|
451
477
|
}
|
|
452
478
|
|
|
453
479
|
.main-navigation-details-summary {
|
|
480
|
+
padding-block: var(--_link-padding-block);
|
|
481
|
+
padding-inline: var(--_link-padding-inline);
|
|
482
|
+
margin-block: var(--_link-margin-block);
|
|
483
|
+
margin-inline: var(--_link-margin-inline);
|
|
484
|
+
border-bottom: var(--_link-border-default);
|
|
485
|
+
|
|
454
486
|
&::-webkit-details-marker,
|
|
455
487
|
&::marker {
|
|
456
488
|
display: none;
|
|
@@ -458,6 +490,7 @@ watch(
|
|
|
458
490
|
|
|
459
491
|
&:hover {
|
|
460
492
|
cursor: pointer;
|
|
493
|
+
border-bottom-color: var(--_link-border-bottom-hover);
|
|
461
494
|
}
|
|
462
495
|
|
|
463
496
|
.decorator-icon {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul class="home-link-navigation" aria-label="Home Navigation">
|
|
3
|
+
<li v-if="hasHomeLink" class="home-link">
|
|
4
|
+
<slot name="homeLink">
|
|
5
|
+
<NuxtLink to="/" class="home-link-default">Logo</NuxtLink>
|
|
6
|
+
</slot>
|
|
7
|
+
</li>
|
|
8
|
+
<li class="skip-links">
|
|
9
|
+
<ul class="skip-links-nav">
|
|
10
|
+
<li class="skip-link-item"><a href="#main-content" class="skip-link" ref="skipLink">Skip to main content</a></li>
|
|
11
|
+
<li class="skip-link-item"><a href="#footer" class="skip-link">Skip to footer</a></li>
|
|
12
|
+
</ul>
|
|
13
|
+
</li>
|
|
14
|
+
</ul>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
const slots = useSlots();
|
|
19
|
+
const hasHomeLink = ref(slots.homeLink !== undefined);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style lang="css">
|
|
23
|
+
.home-link-navigation {
|
|
24
|
+
position: relative;
|
|
25
|
+
list-style: none;
|
|
26
|
+
padding: 0;
|
|
27
|
+
|
|
28
|
+
.skip-links {
|
|
29
|
+
list-style: none;
|
|
30
|
+
background-color: black;
|
|
31
|
+
padding: 0;
|
|
32
|
+
margin: 0;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 40px;
|
|
35
|
+
left: 0;
|
|
36
|
+
height: 0;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
transition: height 0.3s ease-in-out;
|
|
39
|
+
|
|
40
|
+
&:focus-within {
|
|
41
|
+
height: auto;
|
|
42
|
+
z-index: 1000;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.skip-links-nav {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
gap: 0.2rem;
|
|
49
|
+
background-color: black;
|
|
50
|
+
|
|
51
|
+
border: 1px solid white;
|
|
52
|
+
|
|
53
|
+
list-style: none;
|
|
54
|
+
padding: 0.2rem;
|
|
55
|
+
margin: 0;
|
|
56
|
+
|
|
57
|
+
.skip-link-item {
|
|
58
|
+
padding: 0.2rem;
|
|
59
|
+
|
|
60
|
+
.skip-link {
|
|
61
|
+
display: block;
|
|
62
|
+
color: white;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
margin: 0.2rem;
|
|
65
|
+
|
|
66
|
+
padding: 0.8rem 1.2rem;
|
|
67
|
+
text-wrap: nowrap;
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: 2px solid white;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* .skip-link {
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: -40px;
|
|
81
|
+
left: 0;
|
|
82
|
+
background: #000;
|
|
83
|
+
color: #fff;
|
|
84
|
+
padding: 8px 12px;
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
transition: top 0.3s;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.skip-link:focus {
|
|
90
|
+
top: 0;
|
|
91
|
+
} */
|
|
92
|
+
</style>
|
package/package.json
CHANGED