@innertia-solutions/nuxt-theme-spark 0.1.23 → 0.1.24

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,93 +1,59 @@
1
1
  <script setup lang="ts">
2
- const isOpen = ref(false)
3
- const open = () => { isOpen.value = true }
4
- const close = () => { isOpen.value = false }
5
-
6
- provide('vantage:sidebar', { isOpen, open, close })
2
+ const sidebar = inject<{ isOpen: Ref<boolean>; open: () => void; close: () => void } | null>('vantage:sidebar', null)
3
+ const isOpen = computed(() => sidebar?.isOpen.value ?? false)
4
+ const close = () => sidebar?.close()
7
5
  </script>
8
6
 
9
7
  <template>
10
- <div class="bg-surface min-h-screen">
11
-
12
- <!-- Backdrop mobile -->
13
- <Transition enter-from-class="opacity-0" enter-active-class="transition-opacity duration-300"
14
- leave-to-class="opacity-0" leave-active-class="transition-opacity duration-300">
15
- <div v-if="isOpen" class="lg:hidden fixed inset-0 z-50 bg-black/40 backdrop-blur-sm" @click="close" />
16
- </Transition>
17
-
18
- <!-- Sidebar -->
19
- <aside
20
- tabindex="-1"
21
- aria-label="Sidebar"
22
- :class="[
23
- 'fixed inset-y-0 start-0 z-60 w-65 h-full',
24
- 'bg-sidebar border-e border-sidebar-line',
25
- 'transition-transform duration-300',
26
- 'lg:translate-x-0',
27
- isOpen ? 'translate-x-0' : 'max-lg:-translate-x-full',
28
- ]"
29
- >
30
- <div class="flex flex-col h-full pt-3 lg:pt-6">
31
-
32
- <!-- Logo + close mobile -->
33
- <header class="h-11.5 ps-2 pe-2 lg:ps-5 flex items-center gap-x-1 shrink-0">
34
- <slot name="logo" />
35
- <div class="lg:hidden ms-auto">
36
- <button type="button"
37
- 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"
38
- @click="close">
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
- <!-- User footer -->
60
- <div class="shrink-0 border-t border-sidebar-line p-5">
61
- <slot name="user-footer" />
62
- </div>
63
-
64
- </div>
65
- </aside>
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
- <!-- Right actions -->
84
- <div class="flex items-center gap-x-1">
85
- <slot name="header-right" />
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
- <!-- Main content (below fixed header) -->
90
- <slot />
54
+ </div>
55
+ </aside>
91
56
 
92
- </div>
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('vantage: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,6 +1,6 @@
1
1
  {
2
2
  "name": "@innertia-solutions/nuxt-theme-spark",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Innertia Solutions — Spark theme: backoffice, landing and mobile components and layouts",
5
5
  "keywords": [
6
6
  "nuxt",