@codecavepro/brand 2.6.0 → 2.7.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.
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { type MenuItem } from '../lib/menus/menuTypes.ts';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
section?: string;
|
|
7
|
+
current?: string;
|
|
8
|
+
subMenu: Record<string, MenuItem[]>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>();
|
|
12
|
+
|
|
13
|
+
const items = computed<MenuItem[]>(() => {
|
|
14
|
+
return props.section ? props.subMenu[props.section] ?? [] : [];
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
if (
|
|
18
|
+
props.current &&
|
|
19
|
+
props.section &&
|
|
20
|
+
!(props.subMenu[props.section] ?? []).some(i => i.name === props.current)
|
|
21
|
+
) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`SubNav: no item named "${props.current}" in SUB["${props.section}"]`
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<nav
|
|
30
|
+
v-if="items.length"
|
|
31
|
+
class="ds-subnav"
|
|
32
|
+
aria-label="Section"
|
|
33
|
+
>
|
|
34
|
+
<div class="ds-subnav-inner">
|
|
35
|
+
<ul class="flex w-max min-w-full flex-nowrap">
|
|
36
|
+
<li
|
|
37
|
+
v-for="item in items"
|
|
38
|
+
:key="item.name"
|
|
39
|
+
>
|
|
40
|
+
<a
|
|
41
|
+
class="btn btn-ghost whitespace-nowrap"
|
|
42
|
+
:href="item.href"
|
|
43
|
+
:aria-current="item.name === current ? 'page' : undefined"
|
|
44
|
+
>
|
|
45
|
+
{{ item.label }}
|
|
46
|
+
</a>
|
|
47
|
+
</li>
|
|
48
|
+
</ul>
|
|
49
|
+
</div>
|
|
50
|
+
</nav>
|
|
51
|
+
</template>
|
|
@@ -85,7 +85,7 @@ const handleCloseMenu = () => {
|
|
|
85
85
|
<span></span>
|
|
86
86
|
</button>
|
|
87
87
|
</div>
|
|
88
|
-
<nav v-if="isMenuOpen" class="h-full text-sm overflow-y-auto">
|
|
88
|
+
<nav v-if="isMenuOpen" class="h-full text-sm flex-1 overflow-y-auto min-h-0">
|
|
89
89
|
<div v-if="isServicesOpen">
|
|
90
90
|
<h2 class="text-center font-bold text-body-primary py-2.5">
|
|
91
91
|
{{ servicesItem?.submenuTitle }}
|
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { type MenuItem } from '../lib/menus/menuTypes';
|
|
4
|
-
|
|
5
|
-
interface Props {
|
|
6
|
-
items: MenuItem[];
|
|
7
|
-
}
|
|
8
|
-
const props = defineProps<Props>();
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<nav
|
|
13
|
-
v-if="items.length > 0"
|
|
14
|
-
class="ds-subnav"
|
|
15
|
-
aria-label="Section"
|
|
16
|
-
>
|
|
17
|
-
<div class="page-container ds-subnav-inner">
|
|
18
|
-
<ul>
|
|
19
|
-
<li
|
|
20
|
-
v-for="item in items"
|
|
21
|
-
:key="item.name"
|
|
22
|
-
>
|
|
23
|
-
<a
|
|
24
|
-
class="btn btn-ghost"
|
|
25
|
-
:href="`${item.href}`"
|
|
26
|
-
>
|
|
27
|
-
{{ item.label }}
|
|
28
|
-
</a>
|
|
29
|
-
</li>
|
|
30
|
-
</ul>
|
|
31
|
-
</div>
|
|
32
|
-
</nav>
|
|
33
|
-
</template>
|