@dargmuesli/nuxt-vio 1.2.2 → 1.3.0

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.
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <div class="h-px grow bg-gray-300 dark:bg-gray-600" />
3
+ </template>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <a
3
+ v-if="to.match(/^((ftp|http(s)?):\/\/|(mailto):)/)"
4
+ :aria-label="ariaLabel"
5
+ :class="classes"
6
+ :href="to"
7
+ :rel="
8
+ [...(nofollow ? ['nofollow'] : []), 'noopener', 'noreferrer'].join(' ')
9
+ "
10
+ target="_blank"
11
+ @click="emit('click')"
12
+ >
13
+ <slot />
14
+ </a>
15
+ <NuxtLink
16
+ v-else
17
+ :aria-label="ariaLabel"
18
+ :class="classes"
19
+ :to="isToRelative ? append(route.path, to) : to"
20
+ @click="emit('click')"
21
+ >
22
+ <slot />
23
+ </NuxtLink>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ export interface Props {
28
+ ariaLabel?: string
29
+ isColored?: boolean
30
+ isToRelative?: boolean
31
+ isUnderlined?: boolean
32
+ nofollow?: boolean
33
+ to: string
34
+ }
35
+ const props = withDefaults(defineProps<Props>(), {
36
+ ariaLabel: undefined,
37
+ isColored: true,
38
+ isToRelative: false,
39
+ isUnderlined: false,
40
+ nofollow: false,
41
+ })
42
+
43
+ const emit = defineEmits<{
44
+ (e: 'click'): void
45
+ }>()
46
+
47
+ const route = useRoute()
48
+
49
+ // computations
50
+ const classes = computed(() => {
51
+ return [
52
+ 'rounded',
53
+ ...(props.isColored ? ['text-link-dark dark:text-link-bright'] : []),
54
+ ...(props.isUnderlined ? ['underline'] : []),
55
+ ].join(' ')
56
+ })
57
+ </script>
@@ -0,0 +1,7 @@
1
+ <template>
2
+ <div class="p-4 md:px-8">
3
+ <main>
4
+ <slot />
5
+ </main>
6
+ </div>
7
+ </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -8,9 +8,11 @@
8
8
  "engines": {
9
9
  "node": "19"
10
10
  },
11
- "packageManager": "pnpm@8.1.1",
11
+ "packageManager": "pnpm@8.2.0",
12
12
  "files": [
13
+ "components",
13
14
  "composables",
15
+ "layouts",
14
16
  "server",
15
17
  "plugins",
16
18
  "utils",
@@ -29,8 +31,8 @@
29
31
  },
30
32
  "devDependencies": {
31
33
  "@nuxtjs/eslint-config-typescript": "12.0.0",
32
- "eslint": "8.37.0",
33
- "nuxt": "3.3.3",
34
- "typescript": "5.0.3"
34
+ "eslint": "8.38.0",
35
+ "nuxt": "3.4.0",
36
+ "typescript": "5.0.4"
35
37
  }
36
38
  }