@dargmuesli/nuxt-vio 1.8.3 → 1.10.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.10.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -34,16 +34,17 @@
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",
44
44
  "@nuxtjs/tailwindcss": "6.6.6",
45
45
  "@tailwindcss/typography": "0.5.9",
46
46
  "nuxt-seo-kit": "1.3.7",
47
+ "sweetalert2": "11.7.3",
47
48
  "vue-gtag": "2.0.1"
48
49
  },
49
50
  "devDependencies": {
@@ -51,7 +52,7 @@
51
52
  "@commitlint/config-conventional": "17.6.1",
52
53
  "@intlify/eslint-plugin-vue-i18n": "2.0.0",
53
54
  "@nuxtjs/eslint-config-typescript": "12.0.0",
54
- "eslint": "8.38.0",
55
+ "eslint": "8.39.0",
55
56
  "eslint-config-prettier": "8.8.0",
56
57
  "eslint-plugin-nuxt": "4.0.0",
57
58
  "eslint-plugin-prettier": "4.2.1",
@@ -59,12 +60,12 @@
59
60
  "husky": "8.0.3",
60
61
  "lint-staged": "13.2.1",
61
62
  "nuxt": "3.4.2",
62
- "prettier": "2.8.7",
63
- "stylelint": "15.5.0",
63
+ "prettier": "2.8.8",
64
+ "stylelint": "15.6.0",
64
65
  "stylelint-config-recommended-vue": "1.4.0",
65
66
  "stylelint-config-standard": "33.0.0",
66
67
  "stylelint-no-unsupported-browser-features": "6.1.0",
67
68
  "typescript": "5.0.4",
68
- "vue-tsc": "1.4.2"
69
+ "vue-tsc": "1.4.4"
69
70
  }
70
71
  }
package/utils/modal.ts ADDED
@@ -0,0 +1,16 @@
1
+ import Swal from 'sweetalert2'
2
+
3
+ export const showToast = ({ title }: { title: string }) =>
4
+ Swal.fire({
5
+ didOpen: (toast) => {
6
+ toast.addEventListener('mouseenter', Swal.stopTimer)
7
+ toast.addEventListener('mouseleave', Swal.resumeTimer)
8
+ },
9
+ icon: 'success',
10
+ position: 'bottom',
11
+ showConfirmButton: false,
12
+ timer: 3000,
13
+ timerProgressBar: true,
14
+ title,
15
+ toast: true,
16
+ })