@revojs/ui 0.2.63 → 0.2.64
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.
|
@@ -3,7 +3,7 @@ export type NotificationVariant = "error" | "attention" | "success" | "info";
|
|
|
3
3
|
export interface NotificationProps {
|
|
4
4
|
label?: string;
|
|
5
5
|
subtext?: string;
|
|
6
|
-
icon?: IconComponent;
|
|
6
|
+
icon?: IconComponent | null;
|
|
7
7
|
variant?: NotificationVariant;
|
|
8
8
|
announce?: boolean;
|
|
9
9
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:role="announce ? (variant === 'error' ? 'alert' : 'status') : undefined"
|
|
4
|
-
class="grid
|
|
5
|
-
:class="[
|
|
4
|
+
class="grid items-start gap-x-3 gap-y-3 rounded-ui border p-3 text-sm"
|
|
5
|
+
:class="[
|
|
6
|
+
variants[variant],
|
|
7
|
+
icon === null ? 'grid-cols-[minmax(0,1fr)]' : 'grid-cols-[auto_minmax(0,1fr)]',
|
|
8
|
+
$slots.actions && icon === null ? 'sm:grid-cols-[minmax(0,1fr)_auto]' : '',
|
|
9
|
+
$slots.actions && icon !== null ? 'sm:grid-cols-[auto_minmax(0,1fr)_auto]' : '',
|
|
10
|
+
]"
|
|
6
11
|
>
|
|
7
|
-
<Stack gap="0" class="shrink-0">
|
|
12
|
+
<Stack v-if="icon !== null" gap="0" class="shrink-0">
|
|
8
13
|
<slot name="icon">
|
|
9
14
|
<Icon :is="icon ?? icons[variant]" :size="20" />
|
|
10
15
|
</slot>
|
|
@@ -24,7 +29,8 @@
|
|
|
24
29
|
align="center"
|
|
25
30
|
gap="1"
|
|
26
31
|
wrap
|
|
27
|
-
class="
|
|
32
|
+
class="self-center"
|
|
33
|
+
:class="icon === null ? '' : 'col-start-2 sm:col-start-auto'"
|
|
28
34
|
>
|
|
29
35
|
<slot name="actions" />
|
|
30
36
|
</Stack>
|