@icen.ai/ui 0.4.0 → 0.8.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/AGENTS.md +256 -0
- package/README.md +47 -13
- package/dist/base.css +31 -4
- package/dist/behaviors/accordion.d.mts +4 -0
- package/dist/behaviors/accordion.mjs +4 -3
- package/dist/behaviors/ai-chat.d.mts +57 -0
- package/dist/behaviors/ai-chat.mjs +557 -0
- package/dist/behaviors/ai-composer.d.mts +112 -0
- package/dist/behaviors/ai-composer.mjs +2032 -0
- package/dist/behaviors/ai-core.d.mts +151 -0
- package/dist/behaviors/ai-core.mjs +491 -0
- package/dist/behaviors/ai-diff.d.mts +53 -0
- package/dist/behaviors/ai-diff.mjs +282 -0
- package/dist/behaviors/ai-panel.d.mts +98 -0
- package/dist/behaviors/ai-panel.mjs +1012 -0
- package/dist/behaviors/ai-provider.d.mts +198 -0
- package/dist/behaviors/ai-provider.mjs +1055 -0
- package/dist/behaviors/ai-tool.d.mts +18 -0
- package/dist/behaviors/ai-tool.mjs +2125 -0
- package/dist/behaviors/ai-tools.d.mts +81 -0
- package/dist/behaviors/ai-tools.mjs +1658 -0
- package/dist/behaviors/back-top.d.mts +20 -0
- package/dist/behaviors/back-top.mjs +101 -0
- package/dist/behaviors/carousel.d.mts +4 -0
- package/dist/behaviors/carousel.mjs +34 -16
- package/dist/behaviors/charts.d.mts +250 -0
- package/dist/behaviors/charts.mjs +1301 -448
- package/dist/behaviors/command-palette.d.mts +8 -0
- package/dist/behaviors/command-palette.mjs +189 -0
- package/dist/behaviors/context-menu.d.mts +36 -0
- package/dist/behaviors/context-menu.mjs +6 -2
- package/dist/behaviors/copy.d.mts +4 -0
- package/dist/behaviors/copy.mjs +7 -6
- package/dist/behaviors/datatable.d.mts +78 -0
- package/dist/behaviors/datatable.mjs +54 -11
- package/dist/behaviors/date-picker.d.mts +4 -0
- package/dist/behaviors/date-picker.mjs +296 -0
- package/dist/behaviors/dropdown.d.mts +4 -0
- package/dist/behaviors/dropdown.mjs +7 -3
- package/dist/behaviors/input.d.mts +4 -0
- package/dist/behaviors/input.mjs +184 -8
- package/dist/behaviors/modal.d.mts +11 -0
- package/dist/behaviors/modal.mjs +11 -6
- package/dist/behaviors/nav.d.mts +7 -0
- package/dist/behaviors/nav.mjs +25 -9
- package/dist/behaviors/notification.d.mts +172 -0
- package/dist/behaviors/notification.mjs +908 -0
- package/dist/behaviors/popover.d.mts +46 -0
- package/dist/behaviors/popover.mjs +2 -1
- package/dist/behaviors/select.d.mts +4 -0
- package/dist/behaviors/select.mjs +268 -34
- package/dist/behaviors/sidebar.d.mts +4 -0
- package/dist/behaviors/sidebar.mjs +4 -3
- package/dist/behaviors/slider.d.mts +4 -0
- package/dist/behaviors/slider.mjs +4 -3
- package/dist/behaviors/split-pane.d.mts +4 -0
- package/dist/behaviors/split-pane.mjs +102 -0
- package/dist/behaviors/tabs.d.mts +8 -0
- package/dist/behaviors/tabs.mjs +44 -19
- package/dist/behaviors/tag-input.d.mts +4 -0
- package/dist/behaviors/tag-input.mjs +12 -3
- package/dist/behaviors/theme.d.mts +25 -0
- package/dist/behaviors/theme.mjs +3 -1
- package/dist/behaviors/toast.d.mts +26 -0
- package/dist/behaviors/toast.mjs +24 -18
- package/dist/behaviors/tree.d.mts +4 -0
- package/dist/behaviors/tree.mjs +4 -3
- package/dist/behaviors/upload.d.mts +4 -0
- package/dist/behaviors/upload.mjs +205 -17
- package/dist/components/ai-chat.css +1037 -0
- package/dist/components/ai-chat.mjs +3 -0
- package/dist/components/ai-composer.mjs +3 -0
- package/dist/components/ai-context.mjs +2 -0
- package/dist/components/ai-diff.css +311 -0
- package/dist/components/ai-diff.mjs +3 -0
- package/dist/components/ai-files.mjs +3 -0
- package/dist/components/ai-message.mjs +3 -0
- package/dist/components/ai-panel.css +682 -0
- package/dist/components/ai-reasoning.mjs +3 -0
- package/dist/components/ai-subagent.mjs +2 -0
- package/dist/components/ai-todo.mjs +2 -0
- package/dist/components/ai-tool-call.mjs +2 -0
- package/dist/components/ai-tool.css +532 -0
- package/dist/components/ai-usage.mjs +3 -0
- package/dist/components/back-top.css +88 -0
- package/dist/components/back-top.mjs +3 -0
- package/dist/components/badge.css +127 -0
- package/dist/components/badge.mjs +2 -0
- package/dist/components/breadcrumb.css +53 -0
- package/dist/components/btn.css +4 -7
- package/dist/components/card.css +66 -1
- package/dist/components/chart-bar.css +10 -0
- package/dist/components/chart-calendar.mjs +5 -0
- package/dist/components/chart-gauge.css +1 -1
- package/dist/components/chart-heatmap.css +40 -0
- package/dist/components/chart-scatter.css +24 -0
- package/dist/components/chart-scatter.mjs +4 -0
- package/dist/components/charts.css +86 -1
- package/dist/components/charts.mjs +1 -0
- package/dist/components/command-palette.css +246 -0
- package/dist/components/command-palette.mjs +3 -0
- package/dist/components/content.css +221 -8
- package/dist/components/copy.css +93 -0
- package/dist/components/copy.mjs +3 -0
- package/dist/components/datatable.css +4 -8
- package/dist/components/date-picker.css +240 -0
- package/dist/components/date-picker.mjs +3 -0
- package/dist/components/empty.css +69 -3
- package/dist/components/feedback.css +241 -10
- package/dist/components/form.css +129 -11
- package/dist/components/form.mjs +2 -0
- package/dist/components/input.css +25 -2
- package/dist/components/layout.css +36 -36
- package/dist/components/media.css +153 -6
- package/dist/components/menu.css +2 -2
- package/dist/components/modal.css +1 -1
- package/dist/components/nav.css +106 -2
- package/dist/components/notification.css +387 -0
- package/dist/components/notification.mjs +3 -0
- package/dist/components/pagination.css +1 -1
- package/dist/components/panel.css +104 -9
- package/dist/components/pill.css +82 -12
- package/dist/components/scroll-area.css +112 -0
- package/dist/components/scroll-area.mjs +2 -0
- package/dist/components/segmented.css +80 -5
- package/dist/components/segmented.mjs +1 -0
- package/dist/components/select.css +104 -17
- package/dist/components/sidebar.css +119 -1
- package/dist/components/slider.css +113 -0
- package/dist/components/split-pane.css +111 -0
- package/dist/components/split-pane.mjs +3 -0
- package/dist/components/stat.css +131 -12
- package/dist/components/steps.css +98 -1
- package/dist/components/switch.css +145 -7
- package/dist/components/table.css +111 -29
- package/dist/components/tabs.css +132 -22
- package/dist/components/tag-input.css +4 -4
- package/dist/components/tag.css +164 -0
- package/dist/components/tag.mjs +2 -0
- package/dist/components/toast.css +122 -5
- package/dist/components/toolbar.css +101 -0
- package/dist/components/toolbar.mjs +2 -0
- package/dist/components/tooltip.css +2 -2
- package/dist/components/upload.css +61 -4
- package/dist/index.d.mts +37 -0
- package/dist/index.mjs +9409 -929
- package/dist/registry.json +176 -4
- package/dist/retro-effects.css +21 -17
- package/dist/tokens/colors.css +4 -1
- package/dist/tokens/retro-effects.css +21 -17
- package/dist/tokens/style-profiles.css +21 -0
- package/dist/tokens.css +25 -1
- package/dist/ui.css +9616 -2839
- package/docs/spec/ai-native.md +659 -0
- package/package.json +15 -5
package/dist/components/nav.css
CHANGED
|
@@ -25,7 +25,12 @@
|
|
|
25
25
|
backdrop-filter: blur(12px) saturate(1.1);
|
|
26
26
|
-webkit-backdrop-filter: blur(12px) saturate(1.1);
|
|
27
27
|
border-bottom: 1px solid var(--token-outline-soft);
|
|
28
|
-
transition:
|
|
28
|
+
transition:
|
|
29
|
+
background-color var(--icen-tx-slow),
|
|
30
|
+
border-color var(--icen-tx-slow),
|
|
31
|
+
box-shadow var(--icen-tx-slow),
|
|
32
|
+
transform var(--icen-tx-slow),
|
|
33
|
+
backdrop-filter var(--icen-tx-slow);
|
|
29
34
|
}
|
|
30
35
|
.nav:has(.nav-bottom) {
|
|
31
36
|
height: auto;
|
|
@@ -82,6 +87,7 @@
|
|
|
82
87
|
.nav-bottom { width: 100%; padding-top: var(--density-space-xs); }
|
|
83
88
|
|
|
84
89
|
.nav-btn {
|
|
90
|
+
position: relative;
|
|
85
91
|
display: inline-flex;
|
|
86
92
|
align-items: center;
|
|
87
93
|
gap: var(--density-space-xs);
|
|
@@ -113,7 +119,7 @@
|
|
|
113
119
|
.nav-btn.is-active,
|
|
114
120
|
.nav-btn[aria-current='page'] {
|
|
115
121
|
background: var(--token-accent);
|
|
116
|
-
color: var(--token-on-accent
|
|
122
|
+
color: var(--token-on-accent);
|
|
117
123
|
font-weight: 500;
|
|
118
124
|
box-shadow: var(--token-shadow-elevated);
|
|
119
125
|
}
|
|
@@ -159,3 +165,101 @@
|
|
|
159
165
|
@media (prefers-reduced-motion: reduce) {
|
|
160
166
|
.nav, .nav-btn { transition: none; }
|
|
161
167
|
}
|
|
168
|
+
|
|
169
|
+
/* ── 增强 ── */
|
|
170
|
+
|
|
171
|
+
/* 导航搜索槽 */
|
|
172
|
+
.nav-search {
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: var(--density-space-xs);
|
|
176
|
+
padding: 0 var(--density-space-sm);
|
|
177
|
+
height: 32px;
|
|
178
|
+
min-width: 180px;
|
|
179
|
+
background: var(--token-control);
|
|
180
|
+
border: 1px solid var(--token-outline-soft);
|
|
181
|
+
border-radius: var(--radius-full);
|
|
182
|
+
color: var(--token-text-faint);
|
|
183
|
+
font-size: var(--density-font-size-sm);
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
transition: border-color var(--icen-tx-fast);
|
|
186
|
+
}
|
|
187
|
+
.nav-search:hover { border-color: var(--token-accent); }
|
|
188
|
+
.nav-search svg { width: 14px; height: 14px; flex-shrink: 0; }
|
|
189
|
+
.nav-search-kbd {
|
|
190
|
+
margin-left: auto;
|
|
191
|
+
padding: 1px 5px;
|
|
192
|
+
font-size: var(--density-font-size-2xs);
|
|
193
|
+
font-family: var(--font-mono);
|
|
194
|
+
color: var(--token-text-faint);
|
|
195
|
+
background: var(--token-fill-2);
|
|
196
|
+
border-radius: var(--radius-xs);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* 导航按钮上的通知徽标 */
|
|
200
|
+
.nav-btn-badge {
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: 2px;
|
|
203
|
+
right: 2px;
|
|
204
|
+
min-width: 8px;
|
|
205
|
+
height: 8px;
|
|
206
|
+
padding: 0;
|
|
207
|
+
background: var(--token-error);
|
|
208
|
+
border: 1.5px solid var(--token-surface-glass);
|
|
209
|
+
border-radius: var(--radius-full);
|
|
210
|
+
pointer-events: none;
|
|
211
|
+
}
|
|
212
|
+
.nav-btn-badge--count {
|
|
213
|
+
min-width: 16px;
|
|
214
|
+
height: 16px;
|
|
215
|
+
padding: 0 4px;
|
|
216
|
+
font-size: var(--density-font-size-2xs);
|
|
217
|
+
font-weight: 700;
|
|
218
|
+
color: var(--token-on-accent);
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
justify-content: center;
|
|
222
|
+
line-height: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* 链接式导航项(a 标签替代 button) */
|
|
226
|
+
.nav-link {
|
|
227
|
+
display: inline-flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
gap: var(--density-space-xs);
|
|
230
|
+
padding: 6px var(--density-space-sm);
|
|
231
|
+
font-size: var(--density-font-size-md);
|
|
232
|
+
color: var(--token-text-muted);
|
|
233
|
+
text-decoration: none;
|
|
234
|
+
border-radius: var(--radius-full);
|
|
235
|
+
transition: color var(--icen-tx-fast), background-color var(--icen-tx-fast);
|
|
236
|
+
}
|
|
237
|
+
.nav-link:hover {
|
|
238
|
+
color: var(--token-text);
|
|
239
|
+
background: var(--token-control-hover);
|
|
240
|
+
text-decoration: none;
|
|
241
|
+
}
|
|
242
|
+
.nav-link.is-active,
|
|
243
|
+
.nav-link[aria-current='page'] {
|
|
244
|
+
color: var(--token-accent);
|
|
245
|
+
background: var(--token-accent-subtle);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* 导航用户区(头像 + 下拉触发器) */
|
|
249
|
+
.nav-user {
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
align-items: center;
|
|
252
|
+
gap: var(--density-space-xs);
|
|
253
|
+
padding: 3px var(--density-space-xs) 3px 3px;
|
|
254
|
+
border-radius: var(--radius-full);
|
|
255
|
+
border: 1px solid var(--token-outline-soft);
|
|
256
|
+
background: var(--token-surface);
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
transition: border-color var(--icen-tx-fast);
|
|
259
|
+
}
|
|
260
|
+
.nav-user:hover { border-color: var(--token-accent); }
|
|
261
|
+
.nav-user-name {
|
|
262
|
+
font-size: var(--density-font-size-sm);
|
|
263
|
+
color: var(--token-text);
|
|
264
|
+
}
|
|
265
|
+
.nav-user svg { width: 12px; height: 12px; color: var(--token-text-faint); }
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @icen.ai/ui — Component: notification(通知栈 v2,与 behaviors/notification 配套)
|
|
3
|
+
*
|
|
4
|
+
* 与 toast / alert 的差异(三件正交):
|
|
5
|
+
* - toast = 瞬时轻提示(2.6s 自动消失),右下角
|
|
6
|
+
* - alert = 内嵌警示条(页面流内,非浮层)
|
|
7
|
+
* - notification = 持久通知栈(右上角),工程级:
|
|
8
|
+
* 进度条 / 倒计时 / 头像 / 多按钮 / 已读未读 / 优先级 / hover 暂停 / 详情链接 / 折叠堆叠
|
|
9
|
+
*
|
|
10
|
+
* 完整契约(由 behavior 渲染):
|
|
11
|
+
* <div class="notification-container" role="region" aria-label="通知" data-position="top-right">
|
|
12
|
+
* <div class="notification [notification--success|warning|error|info]
|
|
13
|
+
* [.is-priority] [.is-unread] [.is-progress] [.is-clickable] [.is-paused]
|
|
14
|
+
* [.has-avatar]" role="alert|button">
|
|
15
|
+
* <span class="notification-icon">…svg 或 img.notification-avatar…</span>
|
|
16
|
+
* <div class="notification-content">
|
|
17
|
+
* <p class="notification-title">标题</p>
|
|
18
|
+
* <p class="notification-message">正文(支持换行)</p>
|
|
19
|
+
* <div class="notification-actions">
|
|
20
|
+
* <button class="notification-action [--primary|--danger]">按钮</button>
|
|
21
|
+
* </div>
|
|
22
|
+
* <div class="notification-link-wrap">
|
|
23
|
+
* <a class="notification-link" href="…">查看详情</a>
|
|
24
|
+
* </div>
|
|
25
|
+
* <div class="notification-progress">
|
|
26
|
+
* <div class="notification-progress-bar" style="width:64%"></div>
|
|
27
|
+
* <span class="notification-progress-label">64%</span>
|
|
28
|
+
* </div>
|
|
29
|
+
* </div>
|
|
30
|
+
* <button class="notification-close" aria-label="关闭">×</button>
|
|
31
|
+
* <div class="notification-countdown">
|
|
32
|
+
* <div class="notification-countdown-fill" style="animation-duration:5000ms"></div>
|
|
33
|
+
* </div>
|
|
34
|
+
* </div>
|
|
35
|
+
* </div>
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
.notification-container {
|
|
39
|
+
position: fixed;
|
|
40
|
+
top: var(--density-space-md);
|
|
41
|
+
right: var(--density-space-md);
|
|
42
|
+
z-index: var(--z-toast);
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: var(--density-space-sm);
|
|
46
|
+
width: 360px;
|
|
47
|
+
max-width: calc(100vw - var(--density-space-lg));
|
|
48
|
+
pointer-events: none;
|
|
49
|
+
}
|
|
50
|
+
.notification-container[data-position='top-left'] {
|
|
51
|
+
right: auto;
|
|
52
|
+
left: var(--density-space-md);
|
|
53
|
+
}
|
|
54
|
+
.notification-container[data-position='bottom-left'] {
|
|
55
|
+
top: auto;
|
|
56
|
+
bottom: var(--density-space-md);
|
|
57
|
+
right: auto;
|
|
58
|
+
left: var(--density-space-md);
|
|
59
|
+
}
|
|
60
|
+
.notification-container[data-position='bottom-right'] {
|
|
61
|
+
top: auto;
|
|
62
|
+
bottom: var(--density-space-md);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.notification {
|
|
66
|
+
pointer-events: auto;
|
|
67
|
+
position: relative;
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: flex-start;
|
|
70
|
+
gap: var(--density-space-sm);
|
|
71
|
+
background: var(--token-card-strong);
|
|
72
|
+
color: var(--token-text);
|
|
73
|
+
border: 1px solid var(--token-outline-soft);
|
|
74
|
+
border-left: 3px solid var(--token-info);
|
|
75
|
+
border-radius: var(--radius-md);
|
|
76
|
+
box-shadow: var(--token-shadow-overlay);
|
|
77
|
+
padding: var(--density-space-md) var(--density-space-md) var(--density-space-md) var(--density-space-sm);
|
|
78
|
+
overflow: hidden; /* 倒计时进度条贴底 */
|
|
79
|
+
animation: icen-notif-in var(--icen-tx-normal);
|
|
80
|
+
}
|
|
81
|
+
.notification.notification--success { border-left-color: var(--token-success); }
|
|
82
|
+
.notification.notification--warning { border-left-color: var(--token-warning); }
|
|
83
|
+
.notification.notification--error { border-left-color: var(--token-error); }
|
|
84
|
+
.notification.notification--info { border-left-color: var(--token-info); }
|
|
85
|
+
|
|
86
|
+
/* ── 优先级:高优先级强调(左侧加粗 + 更强阴影)── */
|
|
87
|
+
.notification.is-priority {
|
|
88
|
+
border-left-width: 4px;
|
|
89
|
+
box-shadow: var(--token-shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--token-accent) 24%, transparent);
|
|
90
|
+
}
|
|
91
|
+
.notification.is-priority.notification--success { box-shadow: var(--token-shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--token-success) 28%, transparent); }
|
|
92
|
+
.notification.is-priority.notification--warning { box-shadow: var(--token-shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--token-warning) 28%, transparent); }
|
|
93
|
+
.notification.is-priority.notification--error { box-shadow: var(--token-shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--token-error) 28%, transparent); }
|
|
94
|
+
|
|
95
|
+
/* ── 未读:标题左侧 4px 强调点 + 加粗 ── */
|
|
96
|
+
.notification.is-unread .notification-title::before {
|
|
97
|
+
content: '';
|
|
98
|
+
display: inline-block;
|
|
99
|
+
width: 6px;
|
|
100
|
+
height: 6px;
|
|
101
|
+
margin-right: 6px;
|
|
102
|
+
margin-bottom: 1px;
|
|
103
|
+
vertical-align: middle;
|
|
104
|
+
border-radius: var(--radius-full);
|
|
105
|
+
background: var(--token-accent);
|
|
106
|
+
flex-shrink: 0;
|
|
107
|
+
}
|
|
108
|
+
.notification.is-unread.notification--success .notification-title::before { background: var(--token-success); }
|
|
109
|
+
.notification.is-unread.notification--warning .notification-title::before { background: var(--token-warning); }
|
|
110
|
+
.notification.is-unread.notification--error .notification-title::before { background: var(--token-error); }
|
|
111
|
+
|
|
112
|
+
/* ── 可点击:整条 hover 抬升 ── */
|
|
113
|
+
.notification.is-clickable {
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
transition:
|
|
116
|
+
transform var(--icen-tx-fast),
|
|
117
|
+
border-color var(--icen-tx-fast),
|
|
118
|
+
box-shadow var(--icen-tx-fast);
|
|
119
|
+
}
|
|
120
|
+
.notification.is-clickable:hover {
|
|
121
|
+
transform: translateY(-1px);
|
|
122
|
+
border-color: var(--token-accent);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ── 图标 ── */
|
|
126
|
+
.notification-icon {
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
width: 22px;
|
|
132
|
+
height: 22px;
|
|
133
|
+
margin-top: 1px;
|
|
134
|
+
border-radius: var(--radius-full);
|
|
135
|
+
color: var(--token-text-faint);
|
|
136
|
+
}
|
|
137
|
+
.notification-icon svg { width: 16px; height: 16px; }
|
|
138
|
+
.notification--success .notification-icon { color: var(--token-success); }
|
|
139
|
+
.notification--warning .notification-icon { color: var(--token-warning); }
|
|
140
|
+
.notification--error .notification-icon { color: var(--token-error); }
|
|
141
|
+
.notification--info .notification-icon { color: var(--token-info); }
|
|
142
|
+
|
|
143
|
+
/* 头像(圆形图) */
|
|
144
|
+
.notification-avatar {
|
|
145
|
+
width: 28px;
|
|
146
|
+
height: 28px;
|
|
147
|
+
border-radius: var(--radius-full);
|
|
148
|
+
object-fit: cover;
|
|
149
|
+
display: block;
|
|
150
|
+
}
|
|
151
|
+
.notification.has-avatar .notification-icon {
|
|
152
|
+
width: 28px;
|
|
153
|
+
height: 28px;
|
|
154
|
+
margin-top: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* 进度通知的图标默认走品牌色 */
|
|
158
|
+
.notification.is-progress:not(.notification--success):not(.notification--warning):not(.notification--error) .notification-icon {
|
|
159
|
+
color: var(--token-accent);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* ── 内容区 ── */
|
|
163
|
+
.notification-content {
|
|
164
|
+
flex: 1;
|
|
165
|
+
min-width: 0;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: 2px;
|
|
169
|
+
}
|
|
170
|
+
.notification-title {
|
|
171
|
+
margin: 0;
|
|
172
|
+
font-size: var(--density-font-size-md);
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
line-height: 1.4;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
text-overflow: ellipsis;
|
|
177
|
+
}
|
|
178
|
+
.notification.is-unread .notification-title {
|
|
179
|
+
font-weight: 700;
|
|
180
|
+
}
|
|
181
|
+
.notification-message {
|
|
182
|
+
margin: 0;
|
|
183
|
+
font-size: var(--density-font-size-sm);
|
|
184
|
+
color: var(--token-text-muted);
|
|
185
|
+
line-height: 1.5;
|
|
186
|
+
word-break: break-word;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ── 多动作按钮 ── */
|
|
190
|
+
.notification-actions {
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-wrap: wrap;
|
|
193
|
+
gap: var(--density-space-xs);
|
|
194
|
+
margin-top: var(--density-space-sm);
|
|
195
|
+
}
|
|
196
|
+
.notification-action {
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
height: 24px;
|
|
200
|
+
padding: 0 var(--density-space-sm);
|
|
201
|
+
border: 1px solid var(--token-outline-soft);
|
|
202
|
+
border-radius: var(--radius-sm);
|
|
203
|
+
background: var(--token-fill-1);
|
|
204
|
+
color: var(--token-text-muted);
|
|
205
|
+
font: inherit;
|
|
206
|
+
font-size: var(--density-font-size-xs);
|
|
207
|
+
font-weight: 500;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
-webkit-tap-highlight-color: transparent;
|
|
210
|
+
transition: background-color var(--icen-tx-fast), color var(--icen-tx-fast), border-color var(--icen-tx-fast);
|
|
211
|
+
}
|
|
212
|
+
.notification-action:hover {
|
|
213
|
+
background: var(--token-fill-2);
|
|
214
|
+
color: var(--token-text);
|
|
215
|
+
border-color: var(--token-accent);
|
|
216
|
+
}
|
|
217
|
+
.notification-action:focus-visible {
|
|
218
|
+
outline: none;
|
|
219
|
+
box-shadow: var(--icen-ring);
|
|
220
|
+
}
|
|
221
|
+
/* primary:实底 accent */
|
|
222
|
+
.notification-action--primary {
|
|
223
|
+
background: var(--token-accent);
|
|
224
|
+
color: var(--token-on-accent);
|
|
225
|
+
border-color: var(--token-accent);
|
|
226
|
+
}
|
|
227
|
+
.notification-action--primary:hover {
|
|
228
|
+
background: var(--token-accent-deep, var(--token-accent));
|
|
229
|
+
color: var(--token-on-accent);
|
|
230
|
+
border-color: var(--token-accent-deep, var(--token-accent));
|
|
231
|
+
}
|
|
232
|
+
/* danger:实底 error */
|
|
233
|
+
.notification-action--danger {
|
|
234
|
+
background: var(--token-error);
|
|
235
|
+
color: var(--token-on-accent);
|
|
236
|
+
border-color: var(--token-error);
|
|
237
|
+
}
|
|
238
|
+
.notification-action--danger:hover {
|
|
239
|
+
filter: brightness(0.92);
|
|
240
|
+
color: var(--token-on-accent);
|
|
241
|
+
border-color: var(--token-error);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ── 详情链接 ── */
|
|
245
|
+
.notification-link-wrap {
|
|
246
|
+
margin-top: var(--density-space-xs);
|
|
247
|
+
}
|
|
248
|
+
.notification-link {
|
|
249
|
+
font-size: var(--density-font-size-sm);
|
|
250
|
+
color: var(--token-accent);
|
|
251
|
+
text-decoration: none;
|
|
252
|
+
border-bottom: 1px dashed color-mix(in srgb, var(--token-accent) 40%, transparent);
|
|
253
|
+
transition: color var(--icen-tx-fast), border-color var(--icen-tx-fast);
|
|
254
|
+
}
|
|
255
|
+
.notification-link:hover {
|
|
256
|
+
color: var(--token-accent-deep, var(--token-accent));
|
|
257
|
+
border-bottom-style: solid;
|
|
258
|
+
}
|
|
259
|
+
.notification-link:focus-visible {
|
|
260
|
+
outline: none;
|
|
261
|
+
border-radius: var(--radius-xs);
|
|
262
|
+
box-shadow: var(--icen-ring);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* ── 进度条 ── */
|
|
266
|
+
.notification-progress {
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: var(--density-space-sm);
|
|
270
|
+
margin-top: var(--density-space-sm);
|
|
271
|
+
}
|
|
272
|
+
.notification-progress-track {
|
|
273
|
+
flex: 1 1 auto;
|
|
274
|
+
height: 4px;
|
|
275
|
+
background: var(--token-fill-2);
|
|
276
|
+
border-radius: var(--radius-full);
|
|
277
|
+
overflow: hidden;
|
|
278
|
+
}
|
|
279
|
+
.notification-progress-bar {
|
|
280
|
+
height: 100%;
|
|
281
|
+
background: var(--token-accent);
|
|
282
|
+
border-radius: var(--radius-full);
|
|
283
|
+
transition: width var(--icen-tx-normal) var(--ease-out);
|
|
284
|
+
}
|
|
285
|
+
.notification.notification--success .notification-progress-bar { background: var(--token-success); }
|
|
286
|
+
.notification.notification--warning .notification-progress-bar { background: var(--token-warning); }
|
|
287
|
+
.notification.notification--error .notification-progress-bar { background: var(--token-error); }
|
|
288
|
+
.notification-progress-label {
|
|
289
|
+
flex: 0 0 auto;
|
|
290
|
+
font-size: var(--density-font-size-xs);
|
|
291
|
+
color: var(--token-text-muted);
|
|
292
|
+
font-variant-numeric: tabular-nums;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* ── 关闭按钮 ── */
|
|
296
|
+
.notification-close {
|
|
297
|
+
display: inline-flex;
|
|
298
|
+
align-items: center;
|
|
299
|
+
justify-content: center;
|
|
300
|
+
flex-shrink: 0;
|
|
301
|
+
width: 20px;
|
|
302
|
+
height: 20px;
|
|
303
|
+
padding: 0;
|
|
304
|
+
border: 0;
|
|
305
|
+
border-radius: var(--radius-xs);
|
|
306
|
+
background: transparent;
|
|
307
|
+
color: var(--token-text-faint);
|
|
308
|
+
cursor: pointer;
|
|
309
|
+
-webkit-tap-highlight-color: transparent;
|
|
310
|
+
transition: color var(--icen-tx-fast), background-color var(--icen-tx-fast);
|
|
311
|
+
}
|
|
312
|
+
.notification-close:hover {
|
|
313
|
+
color: var(--token-text);
|
|
314
|
+
background: var(--token-fill-1);
|
|
315
|
+
}
|
|
316
|
+
.notification-close:focus-visible {
|
|
317
|
+
outline: none;
|
|
318
|
+
box-shadow: var(--icen-ring);
|
|
319
|
+
}
|
|
320
|
+
.notification-close svg { width: 12px; height: 12px; }
|
|
321
|
+
|
|
322
|
+
/* ── 倒计时进度条(底部贴边) ── */
|
|
323
|
+
.notification-countdown {
|
|
324
|
+
position: absolute;
|
|
325
|
+
left: 0;
|
|
326
|
+
right: 0;
|
|
327
|
+
bottom: 0;
|
|
328
|
+
height: 2px;
|
|
329
|
+
background: transparent;
|
|
330
|
+
overflow: hidden;
|
|
331
|
+
}
|
|
332
|
+
.notification-countdown-fill {
|
|
333
|
+
height: 100%;
|
|
334
|
+
width: 100%;
|
|
335
|
+
transform-origin: left;
|
|
336
|
+
background: var(--token-text-faint);
|
|
337
|
+
opacity: 0.35;
|
|
338
|
+
animation-name: icen-notif-countdown;
|
|
339
|
+
animation-timing-function: linear;
|
|
340
|
+
animation-fill-mode: forwards;
|
|
341
|
+
animation-play-state: running;
|
|
342
|
+
}
|
|
343
|
+
.notification.notification--success .notification-countdown-fill { background: var(--token-success); opacity: 0.6; }
|
|
344
|
+
.notification.notification--warning .notification-countdown-fill { background: var(--token-warning); opacity: 0.6; }
|
|
345
|
+
.notification.notification--error .notification-countdown-fill { background: var(--token-error); opacity: 0.6; }
|
|
346
|
+
.notification.is-paused .notification-countdown-fill {
|
|
347
|
+
animation-play-state: paused;
|
|
348
|
+
}
|
|
349
|
+
@keyframes icen-notif-countdown {
|
|
350
|
+
from { transform: scaleX(1); }
|
|
351
|
+
to { transform: scaleX(0); }
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/* ── 暂停态(hover 时) ── */
|
|
355
|
+
.notification.is-paused {
|
|
356
|
+
box-shadow: var(--token-shadow-overlay), 0 0 0 1px color-mix(in srgb, var(--token-accent) 14%, transparent);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/* ── 退场动画 ── */
|
|
360
|
+
.notification.is-leaving {
|
|
361
|
+
opacity: 0;
|
|
362
|
+
transform: translateX(20px);
|
|
363
|
+
transition:
|
|
364
|
+
opacity var(--icen-tx-normal),
|
|
365
|
+
transform var(--icen-tx-normal);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@keyframes icen-notif-in {
|
|
369
|
+
from { opacity: 0; transform: translateX(20px); }
|
|
370
|
+
to { opacity: 1; transform: translateX(0); }
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
@media (max-width: 480px) {
|
|
374
|
+
.notification-container {
|
|
375
|
+
width: auto;
|
|
376
|
+
left: var(--density-space-sm);
|
|
377
|
+
right: var(--density-space-sm);
|
|
378
|
+
}
|
|
379
|
+
.notification { padding: var(--density-space-sm) var(--density-space-sm) var(--density-space-sm) 10px; }
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
@media (prefers-reduced-motion: reduce) {
|
|
383
|
+
.notification { animation: none; }
|
|
384
|
+
.notification.is-leaving { transform: none; }
|
|
385
|
+
.notification-countdown-fill { animation: none; transform-origin: left; }
|
|
386
|
+
.notification-progress-bar { transition: none; }
|
|
387
|
+
}
|
|
@@ -2,19 +2,32 @@
|
|
|
2
2
|
* @icen.ai/ui — Component: panel(白卡片容器 + 标题栏 + 可选 footer)
|
|
3
3
|
*
|
|
4
4
|
* 完整契约:
|
|
5
|
-
* <div class="panel
|
|
5
|
+
* <div class="panel [panel--flush] [panel--accent]
|
|
6
|
+
* [panel--collapsible] [.is-collapsed]">
|
|
6
7
|
* <div class="panel-title">
|
|
7
|
-
* <
|
|
8
|
-
*
|
|
8
|
+
* <div class="panel-title-text">
|
|
9
|
+
* <span>标题</span>
|
|
10
|
+
* <span class="panel-subtitle">副标题描述</span> ← 可选
|
|
11
|
+
* </div>
|
|
12
|
+
* <div class="panel-title-actions">
|
|
13
|
+
* <button class="btn btn-sm">…</button>
|
|
14
|
+
* <button class="panel-toggle" aria-expanded="true"> ← collapsible 模式
|
|
15
|
+
* <svg class="panel-toggle-icon">…chevron…</svg>
|
|
16
|
+
* </button>
|
|
17
|
+
* </div>
|
|
9
18
|
* </div>
|
|
10
19
|
* <div class="panel-body">…</div>
|
|
11
20
|
* <div class="panel-foot">…可选底栏</div>
|
|
12
21
|
* </div>
|
|
13
22
|
*
|
|
14
23
|
* --flush:body 不留 padding,使用方自行处理内层布局。
|
|
24
|
+
* --collapsible:标题栏出现展开/折叠钮(behavior 可选,也可靠纯 CSS details/summary)。
|
|
25
|
+
* --accent:强调色标题边。
|
|
26
|
+
* .panel-subtitle:标题下方的副标题/描述文字。
|
|
27
|
+
* .panel.is-collapsed:折叠态——隐藏 body + foot。
|
|
15
28
|
*/
|
|
16
29
|
|
|
17
|
-
.panel
|
|
30
|
+
.panel {
|
|
18
31
|
background: var(--token-surface);
|
|
19
32
|
border: 1px solid var(--token-line-soft);
|
|
20
33
|
border-radius: var(--radius-lg);
|
|
@@ -22,6 +35,8 @@
|
|
|
22
35
|
margin-bottom: var(--density-space-lg);
|
|
23
36
|
overflow: hidden;
|
|
24
37
|
}
|
|
38
|
+
|
|
39
|
+
/* ── 标题栏 ── */
|
|
25
40
|
.panel-title {
|
|
26
41
|
display: flex;
|
|
27
42
|
align-items: center;
|
|
@@ -35,9 +50,24 @@
|
|
|
35
50
|
text-transform: uppercase;
|
|
36
51
|
font-weight: 600;
|
|
37
52
|
}
|
|
38
|
-
.panel-title
|
|
53
|
+
.panel-title-text {
|
|
39
54
|
flex: 1;
|
|
40
55
|
min-width: 0;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 1px;
|
|
59
|
+
}
|
|
60
|
+
.panel-title-text > span:first-child {
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
}
|
|
65
|
+
.panel-subtitle {
|
|
66
|
+
font-size: var(--density-font-size-xs);
|
|
67
|
+
font-weight: 400;
|
|
68
|
+
letter-spacing: 0;
|
|
69
|
+
text-transform: none;
|
|
70
|
+
color: var(--token-text-faint);
|
|
41
71
|
overflow: hidden;
|
|
42
72
|
text-overflow: ellipsis;
|
|
43
73
|
white-space: nowrap;
|
|
@@ -49,12 +79,61 @@
|
|
|
49
79
|
flex-shrink: 0;
|
|
50
80
|
}
|
|
51
81
|
|
|
82
|
+
/* ── 可折叠钮 ── */
|
|
83
|
+
.panel-toggle {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
width: 24px;
|
|
88
|
+
height: 24px;
|
|
89
|
+
padding: 0;
|
|
90
|
+
border: none;
|
|
91
|
+
background: transparent;
|
|
92
|
+
color: var(--token-text-faint);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
border-radius: var(--radius-xs);
|
|
95
|
+
transition: color var(--icen-tx-fast), background-color var(--icen-tx-fast);
|
|
96
|
+
}
|
|
97
|
+
.panel-toggle:hover {
|
|
98
|
+
color: var(--token-text);
|
|
99
|
+
background: var(--token-fill-1);
|
|
100
|
+
}
|
|
101
|
+
.panel-toggle:focus-visible {
|
|
102
|
+
outline: none;
|
|
103
|
+
box-shadow: var(--icen-ring);
|
|
104
|
+
}
|
|
105
|
+
.panel-toggle-icon {
|
|
106
|
+
width: 14px;
|
|
107
|
+
height: 14px;
|
|
108
|
+
transition: transform var(--icen-tx-fast);
|
|
109
|
+
}
|
|
110
|
+
.panel.is-collapsed .panel-toggle-icon {
|
|
111
|
+
transform: rotate(-90deg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* ── 折叠态:隐藏 body + foot,去掉标题栏底边 ── */
|
|
115
|
+
.panel.is-collapsed .panel-body,
|
|
116
|
+
.panel.is-collapsed .panel-foot {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
.panel.is-collapsed .panel-title {
|
|
120
|
+
border-bottom-color: transparent;
|
|
121
|
+
}
|
|
122
|
+
.panel--collapsible .panel-body {
|
|
123
|
+
animation: panel-expand var(--icen-tx-normal) var(--ease-out);
|
|
124
|
+
}
|
|
125
|
+
@keyframes panel-expand {
|
|
126
|
+
from { opacity: 0; transform: translateY(-8px); }
|
|
127
|
+
to { opacity: 1; transform: translateY(0); }
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* ── body / foot ── */
|
|
52
131
|
.panel-body {
|
|
53
132
|
padding: var(--density-space-md);
|
|
54
133
|
font-size: var(--density-font-size-md);
|
|
55
134
|
line-height: 1.6;
|
|
56
135
|
}
|
|
57
|
-
.panel
|
|
136
|
+
.panel--flush .panel-body { padding: 0; }
|
|
58
137
|
|
|
59
138
|
.panel-foot {
|
|
60
139
|
display: flex;
|
|
@@ -66,9 +145,25 @@
|
|
|
66
145
|
background: color-mix(in srgb, var(--token-bg-soft) 50%, transparent);
|
|
67
146
|
}
|
|
68
147
|
|
|
69
|
-
/*
|
|
70
|
-
.panel
|
|
71
|
-
.panel
|
|
148
|
+
/* ── 强调变体 ── */
|
|
149
|
+
.panel--accent { border-color: color-mix(in srgb, var(--token-accent) 30%, transparent); }
|
|
150
|
+
.panel--accent .panel-title {
|
|
72
151
|
color: var(--token-accent);
|
|
73
152
|
background: var(--token-accent-subtle);
|
|
74
153
|
}
|
|
154
|
+
|
|
155
|
+
/* ── 平面变体(无阴影,嵌套时用) ── */
|
|
156
|
+
.panel--flat {
|
|
157
|
+
box-shadow: none;
|
|
158
|
+
background: var(--token-bg-soft);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* ── 可折叠模式:标题栏可点(纯 CSS 方案用 details/summary) ── */
|
|
162
|
+
.panel--collapsible .panel-title {
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@media (prefers-reduced-motion: reduce) {
|
|
167
|
+
.panel-toggle-icon { transition: none; }
|
|
168
|
+
.panel--collapsible .panel-body { animation: none; }
|
|
169
|
+
}
|