kmcom-nuxt-layers 1.6.20 → 1.6.22

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,18 +1,44 @@
1
- export default {
1
+ type MastNavLink = {
2
+ id: string
3
+ label: string
4
+ to:
5
+ | string
6
+ | {
7
+ name: string
8
+ params?: Record<string, string | number>
9
+ query?: Record<string, string | number>
10
+ }
11
+ }
12
+
13
+ export default defineAppConfig({
2
14
  site: {
3
15
  title: '',
4
16
  subtitle: '',
5
17
  description: '',
6
18
  },
7
19
  mastNav: {
8
- links: [],
20
+ links: [] as MastNavLink[],
9
21
  scrollBehaviour: 'router',
10
22
  },
11
23
  uiLayer: {
12
24
  gradients: {
13
- brand: { shape: 'linear', direction: 'to-br', from: { color: 'primary', shade: 500 }, to: { color: 'secondary', shade: 600 } },
14
- subtle: { shape: 'linear', direction: 'to-b', from: { color: 'primary', shade: 100, opacity: 50 }, to: { color: 'transparent' } },
15
- hero: { shape: 'radial', from: { color: 'primary', shade: 400, opacity: 40 }, to: { color: 'transparent' } },
25
+ brand: {
26
+ shape: 'linear',
27
+ direction: 'to-br',
28
+ from: { color: 'primary', shade: 500 },
29
+ to: { color: 'secondary', shade: 600 },
30
+ },
31
+ subtle: {
32
+ shape: 'linear',
33
+ direction: 'to-b',
34
+ from: { color: 'primary', shade: 100, opacity: 50 },
35
+ to: { color: 'transparent' },
36
+ },
37
+ hero: {
38
+ shape: 'radial',
39
+ from: { color: 'primary', shade: 400, opacity: 40 },
40
+ to: { color: 'transparent' },
41
+ },
16
42
  },
17
43
  accentScenes: {
18
44
  hero: {
@@ -40,4 +66,4 @@ export default {
40
66
  },
41
67
  },
42
68
  },
43
- }
69
+ })
@@ -30,19 +30,19 @@ const resolvedBlobs = computed((): BlobConfig[] => {
30
30
  <component :is="tag" class="relative overflow-clip isolate">
31
31
  <div class="absolute inset-0 pointer-events-none" aria-hidden="true">
32
32
  <AccentBlob
33
- v-for="(blob, i) in resolvedBlobs"
34
- :key="i"
35
- :x="blob.x"
36
- :y="blob.y"
37
- v-bind="{
38
- ...(blob.size !== undefined && { size: blob.size }),
39
- ...(blob.blur !== undefined && { blur: blob.blur }),
40
- ...(blob.opacity !== undefined && { opacity: blob.opacity }),
41
- ...(blob.color !== undefined && { color: blob.color }),
42
- ...(blob.shade !== undefined && { shade: blob.shade }),
43
- ...(blob.customColor !== undefined && { customColor: blob.customColor }),
44
- }"
45
- />
33
+ v-for="(blob, i) in resolvedBlobs"
34
+ :key="i"
35
+ :x="blob.x"
36
+ :y="blob.y"
37
+ v-bind="{
38
+ ...(blob.size !== undefined && { size: blob.size }),
39
+ ...(blob.blur !== undefined && { blur: blob.blur }),
40
+ ...(blob.opacity !== undefined && { opacity: blob.opacity }),
41
+ ...(blob.color !== undefined && { color: blob.color }),
42
+ ...(blob.shade !== undefined && { shade: blob.shade }),
43
+ ...(blob.customColor !== undefined && { customColor: blob.customColor }),
44
+ }"
45
+ />
46
46
  </div>
47
47
  <div class="relative z-10">
48
48
  <slot />
@@ -5,7 +5,8 @@ const emit = defineEmits<{
5
5
  'close': []
6
6
  }>()
7
7
 
8
- const { links, scrollBehaviour } = useAppConfig().mastNav
8
+ type NavLink = { id: string; label: string; to: string | { name: string; params?: Record<string, string | number>; query?: Record<string, string | number> } }
9
+ const { links, scrollBehaviour } = useAppConfig().mastNav as { links: NavLink[]; scrollBehaviour: string }
9
10
  const activeSection = useState<string>('activeSection', () => '')
10
11
  const route = useRoute()
11
12
  const { close: closeNav } = useMastNav()
@@ -16,7 +17,7 @@ function dismiss() {
16
17
  closeNav()
17
18
  }
18
19
 
19
- function handleNav(link: { id: string; to: string | { name: string; params?: Record<string, unknown>; query?: Record<string, unknown> } }) {
20
+ function handleNav(link: NavLink) {
20
21
  if (scrollBehaviour === 'smooth-scroll' && route.name === 'index') {
21
22
  try { useSmoothScroll().scrollTo(`#${link.id}`) }
22
23
  catch {}
@@ -21,7 +21,7 @@ const modelValue = computed(() => (progress != null ? progress * 100 : undefined
21
21
 
22
22
  const progressProps = computed(() => ({
23
23
  ...(modelValue.value !== undefined && { modelValue: modelValue.value }),
24
- ...(color !== undefined && { color }),
24
+ ...(color !== undefined && { color: color as 'primary' | 'neutral' }),
25
25
  ...(size !== undefined && { size }),
26
26
  ...(orientation !== undefined && { orientation }),
27
27
  ...(status !== undefined && { status }),
@@ -1,6 +1,4 @@
1
1
  <script lang="ts" setup>
2
- import { usePreferredContrast } from '@vueuse/core'
3
-
4
2
  const id = useId()
5
3
  const contrast = usePreferredContrast()
6
4
 
@@ -60,7 +60,7 @@ export function useGradient(
60
60
 
61
61
  let resolved: GradientConfig
62
62
  if (typeof raw === 'string') {
63
- const preset = (appConfig.uiLayer as Record<string, unknown> | undefined)?.gradients as
63
+ const preset = (appConfig.uiLayer as Record<string, unknown> | undefined)?.['gradients'] as
64
64
  | Record<string, GradientConfig>
65
65
  | undefined
66
66
  resolved = preset?.[raw] ?? DEFAULT_CONFIG
@@ -1,4 +1,3 @@
1
- import { createSharedComposable } from '@vueuse/core'
2
1
  import MastNavModal from '../components/Mast/NavModal.vue'
3
2
 
4
3
  function _useMastNav() {
@@ -8,15 +8,15 @@ export function useAppToast() {
8
8
 
9
9
  return {
10
10
  success: (title: string, opts?: ToastOptions) =>
11
- toast.add({ title, icon: 'lucide:check-circle', color: 'success', ...opts }),
11
+ toast.add({ title, icon: 'lucide:check-circle', color: 'success' as 'primary', ...opts }),
12
12
 
13
13
  error: (title: string, opts?: ToastOptions) =>
14
- toast.add({ title, icon: 'lucide:x-circle', color: 'error', ...opts }),
14
+ toast.add({ title, icon: 'lucide:x-circle', color: 'error' as 'primary', ...opts }),
15
15
 
16
16
  info: (title: string, opts?: ToastOptions) =>
17
- toast.add({ title, icon: 'lucide:info', color: 'info', ...opts }),
17
+ toast.add({ title, icon: 'lucide:info', color: 'info' as 'primary', ...opts }),
18
18
 
19
19
  warning: (title: string, opts?: ToastOptions) =>
20
- toast.add({ title, icon: 'lucide:triangle-alert', color: 'warning', ...opts }),
20
+ toast.add({ title, icon: 'lucide:triangle-alert', color: 'warning' as 'primary', ...opts }),
21
21
  }
22
22
  }
@@ -1,4 +1,3 @@
1
- import { createSharedComposable } from '@vueuse/core'
2
1
  import type { Component } from 'vue'
3
2
 
4
3
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kmcom-nuxt-layers",
3
3
  "private": false,
4
- "version": "1.6.20",
4
+ "version": "1.6.22",
5
5
  "description": "Composable Nuxt 4 layers for building scalable Vue applications",
6
6
  "files": [
7
7
  "layers/*/nuxt.config.ts",