@frigear-nu/base 0.0.5 → 0.1.0
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/app/app.config.ts
CHANGED
package/app/app.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare module 'nuxt/schema' {
|
|
2
2
|
interface AppConfigInput {
|
|
3
3
|
header?: {
|
|
4
|
+
/** Show the colour-mode toggle in the header (default `true`). */
|
|
5
|
+
colorMode?: boolean
|
|
4
6
|
icon?: {
|
|
5
7
|
desktop?: boolean
|
|
6
8
|
mobile?: boolean
|
|
@@ -14,6 +16,8 @@ declare module 'nuxt/schema' {
|
|
|
14
16
|
|
|
15
17
|
interface AppConfig {
|
|
16
18
|
header?: {
|
|
19
|
+
/** Show the colour-mode toggle in the header (default `true`). */
|
|
20
|
+
colorMode?: boolean
|
|
17
21
|
icon?: {
|
|
18
22
|
desktop?: boolean
|
|
19
23
|
mobile?: boolean
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
const { data: config } = await useConfig()
|
|
3
3
|
const { data: navigation } = useMenu('main')
|
|
4
4
|
const multiLocale = useRuntimeConfig().public.multiLocale === true
|
|
5
|
+
// Off when the account menu offers Appearance instead (the footer toggle stays for signed-out visitors).
|
|
6
|
+
const appConfig = useAppConfig()
|
|
7
|
+
const colorModeButton = computed(() => appConfig.header?.colorMode !== false)
|
|
5
8
|
</script>
|
|
6
9
|
|
|
7
10
|
<template>
|
|
@@ -18,7 +21,7 @@ const multiLocale = useRuntimeConfig().public.multiLocale === true
|
|
|
18
21
|
<template #right>
|
|
19
22
|
<AppHeaderCTA />
|
|
20
23
|
<LanguageSelect v-if="multiLocale" />
|
|
21
|
-
<UColorModeButton />
|
|
24
|
+
<UColorModeButton v-if="colorModeButton" />
|
|
22
25
|
<AppHeaderRight />
|
|
23
26
|
</template>
|
|
24
27
|
|
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
import type { ContentNavigationItem } from '@nuxt/content'
|
|
3
3
|
|
|
4
4
|
const { data: config } = await useConfig()
|
|
5
|
+
// The same entries as the desktop header (`main` menu, including items modules add); the content config's
|
|
6
|
+
// `navigation` when the menu has none.
|
|
7
|
+
const { data: menu } = await useMenu('main')
|
|
8
|
+
const appConfig = useAppConfig()
|
|
5
9
|
|
|
6
10
|
const items = computed(() => {
|
|
7
|
-
|
|
11
|
+
// The content config's `navigation` is only a list when the host sets one.
|
|
12
|
+
const fallback = Array.isArray(config.value?.navigation) ? config.value.navigation : []
|
|
13
|
+
const source = menu.value?.length ? menu.value : fallback
|
|
14
|
+
const iconOnMobile = appConfig.header?.icon?.mobile
|
|
8
15
|
|
|
9
16
|
if (typeof iconOnMobile === 'boolean' && !iconOnMobile) {
|
|
10
|
-
return
|
|
17
|
+
return source.map(item => ({
|
|
11
18
|
...item,
|
|
12
19
|
icon: undefined,
|
|
13
20
|
}))
|
|
14
21
|
} else {
|
|
15
|
-
return
|
|
22
|
+
return source
|
|
16
23
|
}
|
|
17
24
|
})
|
|
18
25
|
|
|
@@ -21,15 +28,15 @@ const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|
|
21
28
|
|
|
22
29
|
<template>
|
|
23
30
|
<div class="mt-4">
|
|
24
|
-
<UPageGrid v-if="
|
|
31
|
+
<UPageGrid v-if="items?.length">
|
|
25
32
|
<UPageCard
|
|
26
|
-
v-for="item in items
|
|
33
|
+
v-for="item in items"
|
|
27
34
|
:key="item.label"
|
|
28
35
|
:title="item.label"
|
|
29
36
|
:icon="item.icon"
|
|
30
37
|
:description="item.description"
|
|
31
38
|
:to="item.to"
|
|
32
|
-
class="
|
|
39
|
+
class="hover:shadow-lg"
|
|
33
40
|
variant="subtle"
|
|
34
41
|
:ui="{ title: 'text-xl font-semibold' }"
|
|
35
42
|
/>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frigear-nu/base",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Shared Nuxt layer for Frigear websites - bundled modules, UI defaults, content collections, layouts and routing.",
|
|
5
5
|
"homepage": "https://docs.frigear.dev/layers/base",
|
|
6
6
|
"repository": {
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@comark/nuxt": "0.6.2",
|
|
27
|
-
"@frigear-nu/menu": "0.0
|
|
27
|
+
"@frigear-nu/menu": "0.1.0",
|
|
28
28
|
"@iconify-json/lucide": "^1.2.127",
|
|
29
29
|
"@iconify-json/simple-icons": "^1.2.94",
|
|
30
|
-
"@nuxt/content": "3.16.
|
|
31
|
-
"@nuxt/fonts": "^0.
|
|
30
|
+
"@nuxt/content": "^3.16.1",
|
|
31
|
+
"@nuxt/fonts": "^1.0.0",
|
|
32
32
|
"@nuxt/hints": "^1.1.4",
|
|
33
33
|
"@nuxt/icon": "^2.5.1",
|
|
34
34
|
"@nuxt/image": "^2.1.0",
|
|
35
|
-
"@nuxt/kit": "^4.6.
|
|
36
|
-
"@nuxt/schema": "^4.6.
|
|
37
|
-
"@nuxt/ui": "^4.11.
|
|
35
|
+
"@nuxt/kit": "^4.6.1",
|
|
36
|
+
"@nuxt/schema": "^4.6.1",
|
|
37
|
+
"@nuxt/ui": "^4.11.2",
|
|
38
38
|
"@nuxtjs/device": "4.0.0",
|
|
39
39
|
"@nuxtjs/i18n": "^10.6.0",
|
|
40
40
|
"@nuxtjs/robots": "^7.0.2",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"zod": "^4.5.4"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"nuxt": "^4.6.
|
|
53
|
+
"nuxt": "^4.6.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@nuxt/eslint": "^1.17.0",
|
|
57
|
-
"eslint": "^10.
|
|
57
|
+
"eslint": "^10.12.0",
|
|
58
58
|
"nuxt": "^4.6.1",
|
|
59
59
|
"typescript": "^6.0.3",
|
|
60
60
|
"vue-tsc": "^3.3.11"
|