@coffic/cosy-ui 0.9.14 → 0.9.15
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.
@@ -16,6 +16,11 @@
|
|
16
16
|
* <Alert type="success" title="操作成功">您的操作已成功完成</Alert>
|
17
17
|
* ```
|
18
18
|
*
|
19
|
+
* 不显示图标:
|
20
|
+
* ```astro
|
21
|
+
* <Alert type="warning" showIcon={false}>不显示图标的警告</Alert>
|
22
|
+
* ```
|
23
|
+
*
|
19
24
|
* 组合使用:
|
20
25
|
* ```astro
|
21
26
|
* <Alert
|
@@ -42,6 +47,7 @@
|
|
42
47
|
* @prop {string} [title] - 提示标题,可选
|
43
48
|
* @prop {string} [class] - 自定义 CSS 类名
|
44
49
|
* @prop {boolean} [closable=true] - 是否可关闭
|
50
|
+
* @prop {boolean} [showIcon=true] - 是否显示图标
|
45
51
|
* @prop {number} [bgOpacity=1] - 背景色透明度,取值范围 0~1,1 为不透明
|
46
52
|
*
|
47
53
|
* @slots
|
@@ -64,6 +70,7 @@ export interface AlertProps {
|
|
64
70
|
description?: string;
|
65
71
|
class?: string;
|
66
72
|
closable?: boolean;
|
73
|
+
showIcon?: boolean;
|
67
74
|
variant?: 'solid' | 'outline' | 'dash' | 'soft';
|
68
75
|
}
|
69
76
|
|
@@ -73,6 +80,7 @@ const {
|
|
73
80
|
description,
|
74
81
|
class: className = '',
|
75
82
|
closable = true,
|
83
|
+
showIcon = true,
|
76
84
|
variant = 'solid',
|
77
85
|
} = Astro.props as AlertProps;
|
78
86
|
|
@@ -99,9 +107,11 @@ const IconComponent = {
|
|
99
107
|
role="alert">
|
100
108
|
<div
|
101
109
|
class="cosy:flex cosy:flex-row cosy:items-center cosy:gap-4 cosy:justify-between cosy:w-full">
|
102
|
-
|
103
|
-
|
104
|
-
|
110
|
+
{
|
111
|
+
showIcon && (
|
112
|
+
<IconComponent class="cosy:btn cosy:btn-sm cosy:btn-ghost cosy:btn-circle" />
|
113
|
+
)
|
114
|
+
}
|
105
115
|
<div
|
106
116
|
class="cosy:flex cosy:flex-col cosy:items-start cosy:h-full cosy:flex-1">
|
107
117
|
{
|