srcdev-nuxt-components 5.0.0 → 5.0.1

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.
@@ -15,6 +15,7 @@ html {
15
15
 
16
16
  transition: background-color 0.4s ease, color 0.4s ease;
17
17
  scrollbar-gutter: stable;
18
+ overflow-x: hidden;
18
19
  }
19
20
  body,
20
21
  p,
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <div class="layout-row" :class="elementClasses">
3
- <component :is="tag" :data-testid="dataTestid" class="layout-row-inner" :class="variant">
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
- </component>
8
- </div>
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,85 @@
1
+ <template>
2
+ <ul class="home-link-navigation" aria-label="Home Navigation">
3
+ <li class="home-link"><a href="/">Logo</a></li>
4
+ <li class="skip-links">
5
+ <ul class="skip-links-nav">
6
+ <li class="skip-link-item"><a href="#main-content" class="skip-link" ref="skipLink">Skip to main content</a></li>
7
+ <li class="skip-link-item"><a href="#footer" class="skip-link">Skip to footer</a></li>
8
+ </ul>
9
+ </li>
10
+ </ul>
11
+ </template>
12
+
13
+ <script lang="ts" setup></script>
14
+
15
+ <style lang="css">
16
+ .home-link-navigation {
17
+ position: relative;
18
+ list-style: none;
19
+ padding: 0;
20
+
21
+ .skip-links {
22
+ list-style: none;
23
+ background-color: black;
24
+ padding: 0;
25
+ margin: 0;
26
+ position: absolute;
27
+ top: 40px;
28
+ left: 0;
29
+ height: 0;
30
+ overflow: hidden;
31
+ transition: height 0.3s ease-in-out;
32
+
33
+ &:focus-within {
34
+ height: auto;
35
+ z-index: 1000;
36
+ }
37
+
38
+ .skip-links-nav {
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 0.2rem;
42
+ background-color: black;
43
+
44
+ border: 1px solid white;
45
+
46
+ list-style: none;
47
+ padding: 0.2rem;
48
+ margin: 0;
49
+
50
+ .skip-link-item {
51
+ padding: 0.2rem;
52
+
53
+ .skip-link {
54
+ display: block;
55
+ color: white;
56
+ text-decoration: none;
57
+ margin: 0.2rem;
58
+
59
+ padding: 0.8rem 1.2rem;
60
+ text-wrap: nowrap;
61
+
62
+ &:focus-visible {
63
+ outline: 2px solid white;
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ /* .skip-link {
72
+ position: absolute;
73
+ top: -40px;
74
+ left: 0;
75
+ background: #000;
76
+ color: #fff;
77
+ padding: 8px 12px;
78
+ text-decoration: none;
79
+ transition: top 0.3s;
80
+ }
81
+
82
+ .skip-link:focus {
83
+ top: 0;
84
+ } */
85
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-components",
3
3
  "type": "module",
4
- "version": "5.0.0",
4
+ "version": "5.0.1",
5
5
  "main": "nuxt.config.ts",
6
6
  "scripts": {
7
7
  "clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",