@saasmakers/ui 2.0.33 → 2.0.35
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.
|
@@ -29,7 +29,7 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
31
|
<div
|
|
32
|
-
class="group flex select-none items-center border border-gray-200 rounded-full bg-white px-3 py-2 text-
|
|
32
|
+
class="group flex select-none items-center border border-gray-200 rounded-full bg-white px-3 py-2 text-sm text-gray-800 font-normal shadow-sm transition-colors dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100"
|
|
33
33
|
:class="{ 'cursor-pointer': hasClose }"
|
|
34
34
|
role="button"
|
|
35
35
|
tabindex="0"
|
|
@@ -39,14 +39,14 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
39
39
|
>
|
|
40
40
|
<div class="pointer-events-none flex items-center flex-initial">
|
|
41
41
|
<BaseIcon
|
|
42
|
-
size="
|
|
42
|
+
size="xl"
|
|
43
43
|
:status="status"
|
|
44
44
|
/>
|
|
45
45
|
|
|
46
46
|
<BaseText
|
|
47
47
|
class="ml-2"
|
|
48
48
|
no-wrap
|
|
49
|
-
size="
|
|
49
|
+
size="sm"
|
|
50
50
|
:text="text"
|
|
51
51
|
/>
|
|
52
52
|
</div>
|
|
@@ -78,10 +78,8 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
78
78
|
</button>
|
|
79
79
|
|
|
80
80
|
<template v-if="hasClose">
|
|
81
|
-
<div class="ml-2 mr-1.5 h-5 border-l border-gray-200 flex-initial dark:border-gray-700" />
|
|
82
|
-
|
|
83
81
|
<BaseIcon
|
|
84
|
-
class="text-gray-400 transition-colors flex-initial dark:text-gray-500"
|
|
82
|
+
class="ml-2 text-gray-400 transition-colors flex-initial dark:text-gray-500"
|
|
85
83
|
:class="{
|
|
86
84
|
'group-hover:text-red-600 dark:group-hover:text-red-400': status === 'error',
|
|
87
85
|
'group-hover:text-indigo-600 dark:group-hover:text-indigo-400': status === 'info',
|
|
@@ -89,7 +87,7 @@ function onClose(event: KeyboardEvent | MouseEvent) {
|
|
|
89
87
|
'group-hover:text-orange-600 dark:group-hover:text-orange-400': status === 'warning',
|
|
90
88
|
}"
|
|
91
89
|
:icon="getLayerIcon('close')"
|
|
92
|
-
size="
|
|
90
|
+
size="xl"
|
|
93
91
|
/>
|
|
94
92
|
</template>
|
|
95
93
|
</div>
|
|
@@ -21,12 +21,17 @@ export default function useToast() {
|
|
|
21
21
|
action?: BaseToastAction
|
|
22
22
|
i18nParams?: Record<string, number | string>
|
|
23
23
|
message: string
|
|
24
|
+
replaceAll?: boolean
|
|
24
25
|
status?: BaseStatus
|
|
25
26
|
}) => {
|
|
26
27
|
if (!import.meta.client) {
|
|
27
28
|
return
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
if (params.replaceAll) {
|
|
32
|
+
clearToasts()
|
|
33
|
+
}
|
|
34
|
+
|
|
30
35
|
const text = params.message.includes(' ')
|
|
31
36
|
? params.message
|
|
32
37
|
: nuxtApp.$i18n.t(`toasts.${params.message}`, params.i18nParams ?? {})
|