@innertia-solutions/nuxt-theme-spark 0.1.23 → 0.1.25
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/components/Admin/Base.vue +48 -82
- package/components/Layout/Admin.vue +24 -2
- package/package.json +1 -1
- package/components/Admin/Header.vue +0 -32
|
@@ -1,93 +1,59 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const close
|
|
5
|
-
|
|
6
|
-
provide('vantage:sidebar', { isOpen, open, close })
|
|
2
|
+
const sidebar = inject<{ isOpen: Ref<boolean>; open: () => void; close: () => void } | null>('spark:sidebar', null)
|
|
3
|
+
const isOpen = computed(() => sidebar?.isOpen.value ?? false)
|
|
4
|
+
const close = () => sidebar?.close()
|
|
7
5
|
</script>
|
|
8
6
|
|
|
9
7
|
<template>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<svg class="shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
40
|
-
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
41
|
-
<polyline points="7 8 3 12 7 16" />
|
|
42
|
-
<line x1="21" x2="11" y1="12" y2="12" />
|
|
43
|
-
<line x1="21" x2="11" y1="6" y2="6" />
|
|
44
|
-
<line x1="21" x2="11" y1="18" y2="18" />
|
|
45
|
-
</svg>
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
</header>
|
|
49
|
-
|
|
50
|
-
<!-- Menu scrollable -->
|
|
51
|
-
<div class="flex-1 min-h-0 mt-1.5 overflow-y-auto
|
|
52
|
-
[&::-webkit-scrollbar]:w-2
|
|
53
|
-
[&::-webkit-scrollbar-thumb]:rounded-full
|
|
54
|
-
[&::-webkit-scrollbar-track]:bg-sidebar
|
|
55
|
-
[&::-webkit-scrollbar-thumb]:bg-sidebar-line">
|
|
56
|
-
<slot name="menu" />
|
|
8
|
+
<!-- Sidebar -->
|
|
9
|
+
<aside
|
|
10
|
+
tabindex="-1"
|
|
11
|
+
aria-label="Sidebar"
|
|
12
|
+
:class="[
|
|
13
|
+
'fixed inset-y-0 start-0 z-60 w-65 h-full',
|
|
14
|
+
'bg-sidebar border-e border-sidebar-line',
|
|
15
|
+
'transition-transform duration-300',
|
|
16
|
+
'lg:translate-x-0',
|
|
17
|
+
isOpen ? 'translate-x-0' : 'max-lg:-translate-x-full',
|
|
18
|
+
]"
|
|
19
|
+
>
|
|
20
|
+
<div class="flex flex-col h-full pt-3 lg:pt-6">
|
|
21
|
+
|
|
22
|
+
<!-- Logo + close mobile -->
|
|
23
|
+
<header class="h-11.5 ps-2 pe-2 lg:ps-5 flex items-center gap-x-1 shrink-0">
|
|
24
|
+
<slot name="logo" />
|
|
25
|
+
<div class="lg:hidden ms-auto">
|
|
26
|
+
<button type="button"
|
|
27
|
+
class="w-6 h-7 inline-flex justify-center items-center rounded-md border border-layer-line bg-layer text-muted-foreground-1 hover:bg-layer-hover"
|
|
28
|
+
@click="close">
|
|
29
|
+
<svg class="shrink-0 size-4" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
30
|
+
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
31
|
+
<polyline points="7 8 3 12 7 16" />
|
|
32
|
+
<line x1="21" x2="11" y1="12" y2="12" />
|
|
33
|
+
<line x1="21" x2="11" y1="6" y2="6" />
|
|
34
|
+
<line x1="21" x2="11" y1="18" y2="18" />
|
|
35
|
+
</svg>
|
|
36
|
+
</button>
|
|
57
37
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<!-- Top header -->
|
|
68
|
-
<header class="lg:ms-65 fixed top-0 inset-x-0 flex items-center z-40 bg-navbar border-b border-navbar-line h-14 px-4 sm:px-5 gap-x-3">
|
|
69
|
-
<!-- Mobile hamburger -->
|
|
70
|
-
<button type="button"
|
|
71
|
-
class="lg:hidden size-9 inline-flex justify-center items-center rounded-lg text-muted-foreground-1 hover:bg-muted-hover"
|
|
72
|
-
@click="open">
|
|
73
|
-
<svg class="size-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
74
|
-
<line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" />
|
|
75
|
-
</svg>
|
|
76
|
-
</button>
|
|
77
|
-
|
|
78
|
-
<!-- Left area (search or title) -->
|
|
79
|
-
<div class="flex-1 flex items-center">
|
|
80
|
-
<slot name="header-left" />
|
|
38
|
+
</header>
|
|
39
|
+
|
|
40
|
+
<!-- Menu scrollable -->
|
|
41
|
+
<div class="flex-1 min-h-0 mt-1.5 overflow-y-auto
|
|
42
|
+
[&::-webkit-scrollbar]:w-2
|
|
43
|
+
[&::-webkit-scrollbar-thumb]:rounded-full
|
|
44
|
+
[&::-webkit-scrollbar-track]:bg-sidebar
|
|
45
|
+
[&::-webkit-scrollbar-thumb]:bg-sidebar-line">
|
|
46
|
+
<slot name="menu" />
|
|
81
47
|
</div>
|
|
82
48
|
|
|
83
|
-
<!--
|
|
84
|
-
<div class="
|
|
85
|
-
<slot name="
|
|
49
|
+
<!-- User footer -->
|
|
50
|
+
<div class="shrink-0 border-t border-sidebar-line p-5">
|
|
51
|
+
<slot name="user-footer" />
|
|
86
52
|
</div>
|
|
87
|
-
</header>
|
|
88
53
|
|
|
89
|
-
|
|
90
|
-
|
|
54
|
+
</div>
|
|
55
|
+
</aside>
|
|
91
56
|
|
|
92
|
-
|
|
57
|
+
<!-- Main content -->
|
|
58
|
+
<slot />
|
|
93
59
|
</template>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
const isOpen = ref(false)
|
|
3
|
+
const open = () => { isOpen.value = true }
|
|
4
|
+
const close = () => { isOpen.value = false }
|
|
5
|
+
provide('spark:sidebar', { isOpen, open, close })
|
|
6
|
+
|
|
2
7
|
const showAnimation = ref(false)
|
|
3
8
|
onMounted(() => {
|
|
4
9
|
const seen = sessionStorage.getItem('auth-entered')
|
|
@@ -11,12 +16,29 @@ onMounted(() => {
|
|
|
11
16
|
|
|
12
17
|
<template>
|
|
13
18
|
<div :class="{ 'animate-entrance': showAnimation }">
|
|
19
|
+
<!-- Backdrop mobile -->
|
|
20
|
+
<Transition enter-from-class="opacity-0" enter-active-class="transition-opacity duration-300"
|
|
21
|
+
leave-to-class="opacity-0" leave-active-class="transition-opacity duration-300">
|
|
22
|
+
<div v-if="isOpen" class="lg:hidden fixed inset-0 z-50 bg-black/40 backdrop-blur-sm" @click="close" />
|
|
23
|
+
</Transition>
|
|
24
|
+
|
|
25
|
+
<!-- Top header -->
|
|
26
|
+
<header class="lg:ms-65 fixed top-0 inset-x-0 flex items-center z-40 bg-navbar border-b border-navbar-line h-14 px-4 sm:px-5 gap-x-3">
|
|
27
|
+
<button type="button"
|
|
28
|
+
class="lg:hidden size-9 inline-flex justify-center items-center rounded-lg text-muted-foreground-1 hover:bg-muted-hover"
|
|
29
|
+
@click="open">
|
|
30
|
+
<svg class="size-4" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
31
|
+
<line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" />
|
|
32
|
+
</svg>
|
|
33
|
+
</button>
|
|
34
|
+
<div class="flex-1 flex items-center"><slot name="header-left" /></div>
|
|
35
|
+
<div class="flex items-center gap-x-1"><slot name="header-right" /></div>
|
|
36
|
+
</header>
|
|
37
|
+
|
|
14
38
|
<AdminBase>
|
|
15
39
|
<template #logo><slot name="logo" /></template>
|
|
16
40
|
<template #menu><slot name="menu" /></template>
|
|
17
41
|
<template #user-footer><slot name="user-footer" /></template>
|
|
18
|
-
<template #header-left><slot name="header-left" /></template>
|
|
19
|
-
<template #header-right><slot name="header-right" /></template>
|
|
20
42
|
|
|
21
43
|
<div class="lg:ps-65 pt-14">
|
|
22
44
|
<slot />
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
defineProps<{
|
|
3
|
-
title?: string
|
|
4
|
-
}>()
|
|
5
|
-
|
|
6
|
-
const sidebar = inject('vantage:sidebar', null) as any
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<header class="sticky top-0 z-40 bg-white dark:bg-slate-800 border-b border-slate-200 dark:border-slate-700 px-4 lg:px-6 h-14 flex items-center gap-x-3">
|
|
11
|
-
<!-- Hamburger mobile -->
|
|
12
|
-
<button type="button"
|
|
13
|
-
class="lg:hidden size-8 flex items-center justify-center text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
14
|
-
@click="sidebar?.open()">
|
|
15
|
-
<svg class="size-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
16
|
-
<line x1="3" y1="6" x2="21" y2="6" /><line x1="3" y1="12" x2="21" y2="12" /><line x1="3" y1="18" x2="21" y2="18" />
|
|
17
|
-
</svg>
|
|
18
|
-
</button>
|
|
19
|
-
|
|
20
|
-
<!-- Left slot -->
|
|
21
|
-
<div class="flex-1 flex items-center gap-x-3">
|
|
22
|
-
<slot name="left">
|
|
23
|
-
<span v-if="title" class="text-sm font-medium text-slate-700 dark:text-slate-300">{{ title }}</span>
|
|
24
|
-
</slot>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<!-- Right slot -->
|
|
28
|
-
<div class="flex items-center gap-x-2">
|
|
29
|
-
<slot name="right" />
|
|
30
|
-
</div>
|
|
31
|
-
</header>
|
|
32
|
-
</template>
|