@innertia-solutions/nuxt-theme-spark 0.1.100 → 0.1.102
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/Nav/Tabs.vue +18 -2
- package/package.json +1 -1
package/components/Nav/Tabs.vue
CHANGED
|
@@ -10,11 +10,27 @@ interface Tab {
|
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<{
|
|
12
12
|
tabs: Tab[]
|
|
13
|
+
color?: string
|
|
13
14
|
activeClass?: string
|
|
14
15
|
}>(), {
|
|
15
|
-
|
|
16
|
+
color: 'blue',
|
|
16
17
|
})
|
|
17
18
|
|
|
19
|
+
const colorTextClass = computed(() => ({
|
|
20
|
+
blue: 'text-blue-600 dark:text-blue-400',
|
|
21
|
+
gray: 'text-slate-700 dark:text-slate-200',
|
|
22
|
+
slate: 'text-slate-700 dark:text-slate-200',
|
|
23
|
+
green: 'text-green-600 dark:text-green-400',
|
|
24
|
+
amber: 'text-amber-600 dark:text-amber-400',
|
|
25
|
+
red: 'text-red-600 dark:text-red-400',
|
|
26
|
+
purple: 'text-purple-600 dark:text-purple-400',
|
|
27
|
+
rose: 'text-rose-600 dark:text-rose-400',
|
|
28
|
+
}[props.color] ?? 'text-blue-600 dark:text-blue-400'))
|
|
29
|
+
|
|
30
|
+
const resolvedActiveClass = computed(() =>
|
|
31
|
+
props.activeClass ?? `bg-white dark:bg-slate-800 shadow-sm ${colorTextClass.value}`
|
|
32
|
+
)
|
|
33
|
+
|
|
18
34
|
const route = useRoute()
|
|
19
35
|
|
|
20
36
|
const isActive = (tab: Tab) =>
|
|
@@ -29,7 +45,7 @@ const isActive = (tab: Tab) =>
|
|
|
29
45
|
:to="tab.to"
|
|
30
46
|
class="flex items-center gap-x-2 px-4 py-2 text-xs font-bold rounded-lg transition-all"
|
|
31
47
|
:class="isActive(tab)
|
|
32
|
-
?
|
|
48
|
+
? resolvedActiveClass
|
|
33
49
|
: 'text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200'"
|
|
34
50
|
>
|
|
35
51
|
<component :is="tab.icon" v-if="tab.icon" class="size-4" />
|