@fy-/fws-vue 0.7.1 → 0.7.3

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.
@@ -55,6 +55,7 @@ const onCall = (data: NotifProps) => {
55
55
  ctaText: data.ctaText,
56
56
  ctaLink: data.ctaLink,
57
57
  time: data.time,
58
+ type: data.type,
58
59
  ctaAction: data.ctaAction,
59
60
  };
60
61
 
@@ -77,81 +78,47 @@ onUnmounted(() => {
77
78
  <template>
78
79
  <ScaleTransition>
79
80
  <div
80
- id="mainNotif"
81
- ref="notif"
82
- class="w-full max-w-xs p-4 text-fv-neutral-500 bg-white rounded-lg shadow dark:bg-fv-neutral-800 dark:text-fv-neutral-400 absolute bottom-4 right-4 z-[16]"
81
+ id="alert-additional-content-1"
82
+ class="p-4 mb-4"
83
83
  role="alert"
84
+ :class="{
85
+ 'text-fv-neutral-800 border border-fv-neutral-300 rounded-lg bg-fv-neutral-50 dark:bg-gray-800 dark:text-fv-neutral-400 dark:border-fv-neutral-800':
86
+ currentNotif.type === 'info',
87
+ 'text-red-800 border border-red-300 rounded-lg bg-red-50 dark:bg-red-800 dark:text-red-300 dark:border-red-800':
88
+ currentNotif.type === 'warning',
89
+ 'text-green-800 border border-green-300 rounded-lg bg-green-50 dark:bg-green-800 dark:text-green-300 dark:border-green-800':
90
+ currentNotif.type === 'success',
91
+ }"
84
92
  v-if="currentNotif !== null"
85
93
  >
86
- <div class="flex">
94
+ <div class="flex items-center">
87
95
  <img
88
- class="w-8 h-8 rounded-full"
96
+ class="flex-shrink-0 w-4 h-4 me-2"
89
97
  :src="currentNotif.imgSrc"
90
98
  :alt="currentNotif.title"
91
99
  v-if="currentNotif.imgSrc"
92
100
  />
93
101
  <component
94
102
  :is="currentNotif.imgIcon"
95
- class="w-8 h-8 rounded-full"
103
+ class="flex-shrink-0 w-4 h-4 me-2"
96
104
  v-else
97
105
  />
98
- <div class="ms-3 text-sm font-normal">
99
- <span
100
- class="mb-1 text-sm font-semibold"
101
- :class="{
102
- 'text-fv-neutral-900 dark:text-white':
103
- currentNotif.type === 'info',
104
- 'text-red-900 dark:text-red-300': currentNotif.type === 'warning',
105
- 'text-green-900 dark:text-green-300':
106
- currentNotif.type === 'success',
107
- }"
108
- >
109
- {{ currentNotif.title }}
110
- </span>
111
- <div class="mb-2 text-sm font-normal" v-if="currentNotif.content">
112
- {{ currentNotif.content }}
113
- </div>
114
- <router-link
115
- v-if="currentNotif.ctaText && currentNotif.ctaLink"
116
- :to="currentNotif.ctaLink"
117
- class="btn primary small"
118
- >{{ currentNotif.ctaText }}</router-link
119
- >
120
- <button
121
- v-else-if="currentNotif.ctaText && currentNotif.ctaAction"
122
- @click="
123
- () => {
124
- // @ts-ignore
125
- currentNotif.ctaAction();
126
- hideNotif();
127
- }
128
- "
129
- class="btn primary small"
130
- >
131
- {{ currentNotif.ctaText }}
132
- </button>
133
- </div>
106
+ <span class="sr-only">Info</span>
107
+ <h3 class="text-lg font-medium" v-text="currentNotif.title" />
108
+ </div>
109
+ <div
110
+ class="mt-2 mb-4 text-sm"
111
+ v-text="currentNotif.content"
112
+ v-if="currentNotif.content"
113
+ />
114
+ <div class="flex">
134
115
  <button
135
116
  type="button"
136
- class="ms-auto -mx-1.5 -my-1.5 bg-white justify-center items-center flex-shrink-0 text-fv-neutral-400 hover:text-fv-neutral-900 rounded-lg focus:ring-2 focus:ring-fv-neutral-300 p-1.5 hover:bg-fv-neutral-100 inline-flex h-8 w-8 dark:text-fv-neutral-500 dark:hover:text-white dark:bg-fv-neutral-800 dark:hover:bg-fv-neutral-700"
117
+ class="btn primary small"
118
+ @click="hideNotif"
137
119
  aria-label="Close"
138
120
  >
139
- <span class="sr-only">Close</span>
140
- <svg
141
- class="w-3 h-3"
142
- aria-hidden="true"
143
- xmlns="http://www.w3.org/2000/svg"
144
- fill="none"
145
- viewBox="0 0 14 14"
146
- >
147
- <path
148
- stroke="currentColor"
149
- stroke-linecap="round"
150
- stroke-linejoin="round"
151
- stroke-width="2"
152
- d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"
153
- />
154
- </svg>
121
+ {{ $t("dismiss_cta") }}
155
122
  </button>
156
123
  </div>
157
124
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {