@weni/unnnic-system 3.11.1-alpha.5 → 3.11.3-alpha.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.
- package/CHANGELOG.md +1 -1
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/{es-93614497.mjs → es-9cccca43.mjs} +1 -1
- package/dist/{index-d2424def.mjs → index-386c3448.mjs} +804 -803
- package/dist/{pt-br-fdeacb5b.mjs → pt-br-9303b2c4.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +2 -2
- package/package.json +1 -1
- package/src/components/Drawer/Drawer.vue +1 -1
- package/src/components/Toast/Toast.vue +12 -8
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
>
|
|
8
8
|
<aside
|
|
9
9
|
v-if="isVisible"
|
|
10
|
-
:class="['unnnic-toast', `unnnic-toast--${
|
|
11
|
-
:role="
|
|
12
|
-
:aria-live="
|
|
10
|
+
:class="['unnnic-toast', `unnnic-toast--${validType}`]"
|
|
11
|
+
:role="validType === 'error' ? 'alert' : 'status'"
|
|
12
|
+
:aria-live="validType === 'error' ? 'assertive' : 'polite'"
|
|
13
13
|
data-testid="toast"
|
|
14
14
|
>
|
|
15
15
|
<section
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
>
|
|
23
23
|
<UnnnicIcon
|
|
24
24
|
:icon="typeConfig.icon"
|
|
25
|
-
:scheme="typeConfig.scheme"
|
|
25
|
+
:scheme="typeConfig.scheme as SchemeColor"
|
|
26
26
|
size="ant"
|
|
27
27
|
data-testid="toast-type-icon"
|
|
28
28
|
/>
|
|
@@ -95,6 +95,13 @@ const emit = defineEmits<ToastEmits>();
|
|
|
95
95
|
const isVisible = ref(false);
|
|
96
96
|
let timeoutId: number | null = null;
|
|
97
97
|
|
|
98
|
+
const validType = computed(() => {
|
|
99
|
+
if (['informational', 'attention', 'success', 'error'].includes(props.type)) {
|
|
100
|
+
return props.type;
|
|
101
|
+
}
|
|
102
|
+
return 'informational';
|
|
103
|
+
});
|
|
104
|
+
|
|
98
105
|
const typeConfig = computed(() => {
|
|
99
106
|
const configMap = {
|
|
100
107
|
informational: { icon: 'info', scheme: 'blue-500' },
|
|
@@ -103,10 +110,7 @@ const typeConfig = computed(() => {
|
|
|
103
110
|
error: { icon: 'cancel', scheme: 'red-500' },
|
|
104
111
|
};
|
|
105
112
|
|
|
106
|
-
return configMap[
|
|
107
|
-
icon: string;
|
|
108
|
-
scheme: SchemeColor;
|
|
109
|
-
};
|
|
113
|
+
return configMap[validType.value];
|
|
110
114
|
});
|
|
111
115
|
|
|
112
116
|
const handleClose = () => {
|