@innertia-solutions/nuxt-theme-spark 0.1.22 → 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,73 +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-slate-50 dark:bg-slate-900 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-white dark:bg-slate-800 border-e border-slate-200 dark:border-slate-700',
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-slate-200 bg-white text-slate-500 hover:bg-slate-50 dark:bg-slate-800 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-700"
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-slate-100
55
- [&::-webkit-scrollbar-thumb]:bg-slate-300
56
- dark:[&::-webkit-scrollbar-track]:bg-slate-700
57
- dark:[&::-webkit-scrollbar-thumb]:bg-slate-500">
58
- <slot name="menu" />
59
- </div>
60
-
61
- <!-- User footer -->
62
- <div class="shrink-0 border-t border-slate-200 dark:border-slate-700 p-5">
63
- <slot name="user-footer" />
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>
64
37
  </div>
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" />
47
+ </div>
65
48
 
49
+ <!-- User footer -->
50
+ <div class="shrink-0 border-t border-sidebar-line p-5">
51
+ <slot name="user-footer" />
66
52
  </div>
67
- </aside>
68
53
 
69
- <!-- Main content -->
70
- <slot />
54
+ </div>
55
+ </aside>
71
56
 
72
- </div>
57
+ <!-- Main content -->
58
+ <slot />
73
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,31 @@ 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
42
 
19
- <div class="lg:ps-65">
43
+ <div class="lg:ps-65 pt-14">
20
44
  <slot />
21
45
  </div>
22
46
  </AdminBase>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innertia-solutions/nuxt-theme-spark",
3
- "version": "0.1.22",
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",
@@ -43,4 +43,4 @@
43
43
  "nuxt": "^4.4.2",
44
44
  "vue": "^3.5.0"
45
45
  }
46
- }
46
+ }