@innertia-solutions/nuxt-theme-spark 0.1.120 → 0.1.122

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.
@@ -28,7 +28,8 @@ const iconColorClass = computed(() => ({
28
28
  <div class="space-y-4">
29
29
 
30
30
  <!-- Page header card -->
31
- <div v-if="title" class="flex items-center justify-between bg-card border border-card-line rounded-2xl shadow-sm px-4 py-3">
31
+ <div v-if="title" class="sticky top-0 z-20 -mx-3 -mt-3 px-3 pt-3 pb-3 bg-background-1">
32
+ <div class="flex items-center justify-between bg-card border border-card-line rounded-2xl shadow-sm px-4 py-3">
32
33
  <div class="flex items-center gap-x-4 min-w-0">
33
34
  <div v-if="iconComponent" class="shrink-0 size-10 rounded-xl flex items-center justify-center border border-current/15" :class="iconColorClass">
34
35
  <component :is="iconComponent" class="size-5" stroke="1.5" />
@@ -50,6 +51,7 @@ const iconColorClass = computed(() => ({
50
51
  <slot name="actions" />
51
52
  </div>
52
53
  </div>
54
+ </div>
53
55
 
54
56
  <!-- Tabs -->
55
57
  <div v-if="$slots.tabs">
@@ -2,12 +2,11 @@
2
2
  defineProps<{
3
3
  title: string
4
4
  description?: string
5
- sticky?: boolean
6
5
  }>()
7
6
  </script>
8
7
 
9
8
  <template>
10
- <div :class="sticky ? 'sticky top-3 z-20' : ''">
9
+ <div class="sticky top-0 z-20 -mx-3 -mt-3 px-3 pt-3 pb-3 bg-background-1">
11
10
  <div class="flex items-center justify-between bg-card border border-card-line rounded-2xl shadow-sm px-4 py-3">
12
11
  <div class="flex items-center gap-x-4">
13
12
  <slot name="icon" />
@@ -3,21 +3,27 @@ const props = defineProps({
3
3
  endpoint: { type: String, required: true },
4
4
  })
5
5
 
6
- const config = useRuntimeConfig()
7
- const baseUrl = config.public?.apiBaseUrl ?? '/api'
6
+ const api = useApi()
7
+ const events = ref([])
8
+ const pending = ref(false)
9
+ const error = ref(null)
8
10
 
9
- const url = computed(() => `${baseUrl}/${props.endpoint}`)
11
+ const fetchHistory = async () => {
12
+ pending.value = true
13
+ error.value = null
14
+ try {
15
+ const data = await api.get(props.endpoint)
16
+ events.value = Array.isArray(data) ? data : (data.data ?? [])
17
+ } catch (e) {
18
+ error.value = e
19
+ } finally {
20
+ pending.value = false
21
+ }
22
+ }
10
23
 
11
- const { data: rawData, pending, error, refresh } = useFetch(url, {
12
- watch: [url],
13
- key: computed(() => `timeline-${props.endpoint}`),
14
- })
24
+ const refresh = fetchHistory
15
25
 
16
- const events = computed(() => {
17
- const d = rawData.value
18
- if (!d) return []
19
- return Array.isArray(d) ? d : (d.data ?? [])
20
- })
26
+ watch(() => props.endpoint, fetchHistory, { immediate: true })
21
27
 
22
28
  const typeConfig = {
23
29
  created: { color: 'bg-green-500', label: 'Creado', textColor: 'text-green-600 dark:text-green-400' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innertia-solutions/nuxt-theme-spark",
3
- "version": "0.1.120",
3
+ "version": "0.1.122",
4
4
  "description": "Innertia Solutions — Spark theme: backoffice, landing and mobile components and layouts",
5
5
  "keywords": [
6
6
  "nuxt",