@dargmuesli/nuxt-vio 1.8.3 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,65 @@
1
+ <template>
2
+ <VioLink
3
+ v-if="to"
4
+ :aria-label="ariaLabel"
5
+ :class="classesComputed"
6
+ :disabled="disabled"
7
+ :is-colored="false"
8
+ :is-to-relative="isToRelative"
9
+ :to="to"
10
+ @click="emit('click')"
11
+ >
12
+ <slot name="prefix" />
13
+ <slot />
14
+ <slot name="suffix" />
15
+ </VioLink>
16
+ <button
17
+ v-else
18
+ :aria-label="ariaLabel"
19
+ :class="classesComputed"
20
+ :disabled="disabled"
21
+ :type="type"
22
+ @click="emit('click')"
23
+ >
24
+ <slot name="prefix" />
25
+ <slot />
26
+ <slot name="suffix" />
27
+ </button>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ export interface Props {
32
+ ariaLabel: string
33
+ classes?: string
34
+ disabled?: boolean
35
+ isBlock?: boolean
36
+ isLinkColored?: boolean
37
+ isToRelative?: boolean
38
+ to?: string
39
+ type?: 'button' | 'submit' | 'reset'
40
+ }
41
+ const props = withDefaults(defineProps<Props>(), {
42
+ classes: undefined,
43
+ disabled: false,
44
+ isBlock: false,
45
+ isLinkColored: false,
46
+ isToRelative: false,
47
+ to: undefined,
48
+ type: 'button',
49
+ })
50
+
51
+ const emit = defineEmits<{
52
+ (e: 'click'): void
53
+ }>()
54
+
55
+ // computations
56
+ const classesComputed = computed(() => {
57
+ return [
58
+ props.classes,
59
+ ...(props.isBlock
60
+ ? ['block']
61
+ : ['inline-flex items-center justify-center gap-2']),
62
+ ...(props.isLinkColored ? ['text-link-dark dark:text-link-bright'] : []),
63
+ ].join(' ')
64
+ })
65
+ </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "1.8.3",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,10 +34,10 @@
34
34
  "lint:js": "eslint --cache --ext .js,.ts,.vue --ignore-path .gitignore .",
35
35
  "lint:staged": "pnpm lint-staged",
36
36
  "lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
37
- "lint:ts": "pnpm nuxt typecheck"
37
+ "lint:ts": "nuxt typecheck"
38
38
  },
39
39
  "dependencies": {
40
- "@dargmuesli/nuxt-cookie-control": "5.6.0",
40
+ "@dargmuesli/nuxt-cookie-control": "5.7.0",
41
41
  "@http-util/status-i18n": "0.6.2",
42
42
  "@nuxtjs/html-validator": "1.2.5",
43
43
  "@nuxtjs/i18n": "8.0.0-beta.10",
@@ -51,7 +51,7 @@
51
51
  "@commitlint/config-conventional": "17.6.1",
52
52
  "@intlify/eslint-plugin-vue-i18n": "2.0.0",
53
53
  "@nuxtjs/eslint-config-typescript": "12.0.0",
54
- "eslint": "8.38.0",
54
+ "eslint": "8.39.0",
55
55
  "eslint-config-prettier": "8.8.0",
56
56
  "eslint-plugin-nuxt": "4.0.0",
57
57
  "eslint-plugin-prettier": "4.2.1",
@@ -59,12 +59,12 @@
59
59
  "husky": "8.0.3",
60
60
  "lint-staged": "13.2.1",
61
61
  "nuxt": "3.4.2",
62
- "prettier": "2.8.7",
63
- "stylelint": "15.5.0",
62
+ "prettier": "2.8.8",
63
+ "stylelint": "15.6.0",
64
64
  "stylelint-config-recommended-vue": "1.4.0",
65
65
  "stylelint-config-standard": "33.0.0",
66
66
  "stylelint-no-unsupported-browser-features": "6.1.0",
67
67
  "typescript": "5.0.4",
68
- "vue-tsc": "1.4.2"
68
+ "vue-tsc": "1.4.4"
69
69
  }
70
70
  }