@teamix-evo/skills 0.11.0 → 0.12.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/package.json +1 -1
- package/src/teamix-evo-design-opentrek/SKILL.md +27 -19
- package/src/teamix-evo-design-opentrek/pages/dashboard-page/SKILL.md +429 -0
- package/src/teamix-evo-design-opentrek/pages/dashboard-page/patterns/dashboard-opentrek.md +268 -0
- package/src/teamix-evo-design-opentrek/pages/form-page/SKILL.md +423 -5
- package/src/teamix-evo-design-opentrek/pages/list-page/SKILL.md +396 -25
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/item-card-spec.md +386 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list-opentrek.md +739 -0
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/card-list.md +89 -363
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/standard-list-opentrek.md +318 -0
- package/src/teamix-evo-design-opentrek/patterns/dashboard.md +9 -16
- package/src/teamix-evo-design-uni-manager/SKILL.md +7 -0
- package/src/teamix-evo-manage/SKILL.md +66 -29
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/action-column-spec.md +0 -60
- package/src/teamix-evo-design-opentrek/pages/list-page/_shared/state-action-pattern.md +0 -51
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/advanced-filter-list.md +0 -94
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/drawer-list.md +0 -76
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/expandable-list.md +0 -70
- package/src/teamix-evo-design-opentrek/pages/list-page/patterns/l2-sidebar-list.md +0 -73
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# 业务卡片三件套完整规格(ItemCard / CardGrid / CardActionBar)
|
|
2
|
+
|
|
3
|
+
> 本文件自 v7.3 起从 `rules/card-component.json` 下沉至此。`common-components.json` 中 ItemCard/CardGrid/CardActionBar 的 `specRef` 指向本文件。
|
|
4
|
+
> 三件套用于列表页卡片视图;未来如 Dashboard / Workspace / Overview 需要复用,可直接引用本文件。
|
|
5
|
+
> **规范唯一来源** — 禁止在其他文件中重复定义卡片三件套的 variants/slots/states/tokens。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. ItemCard(业务卡片)
|
|
10
|
+
|
|
11
|
+
- **level**: ORGANISM
|
|
12
|
+
- **layer**: business
|
|
13
|
+
- **UI 组件库引用**: `components/card` → `Card` + `CardHeader` + `CardTitle` + `CardDescription` + `CardContent` + `CardFooter`
|
|
14
|
+
- **场景**:CardGrid 内的单个数据项卡片,含 Title/Description/Field/Supplementary/ActionBar 等 slot,可重复多次出现。
|
|
15
|
+
|
|
16
|
+
### 1.1 variants 变体
|
|
17
|
+
|
|
18
|
+
| 维度 | 选项 | 默认 | 说明 |
|
|
19
|
+
|------|------|------|------|
|
|
20
|
+
| density | minimal / standard / complex | standard | 信息密度,按选型矩阵决定 |
|
|
21
|
+
| iconStyle | avatar / tile | avatar | avatar=32×32 圆角(pure-card / standard-card);tile=40×40 大方块(view-toggle) |
|
|
22
|
+
| titleFontSize | 14px / 16px | — | iconStyle=avatar → 14px/500;iconStyle=tile → 16px/500 |
|
|
23
|
+
|
|
24
|
+
**iconStyle.avatar 详细**:
|
|
25
|
+
- size: 32×32(常规/复杂)/ 24×24(极简)
|
|
26
|
+
- shape: 圆角矩形 `var(--input-radius)`
|
|
27
|
+
- fallback: 首字母色块 + Glossy 光泽(见 §1.6)
|
|
28
|
+
- **UI 组件库引用**: `components/avatar` → `Avatar` (size='default'=32px / size='sm'=24px) + `AvatarFallback`
|
|
29
|
+
|
|
30
|
+
**iconStyle.tile 详细**:
|
|
31
|
+
- size: 40×40
|
|
32
|
+
- shape: 大方块(直角或微圆角)
|
|
33
|
+
- fallback: 纯图标,无首字母回退
|
|
34
|
+
- **UI 组件库引用**: `components/avatar` → `Avatar` (size='lg'=40px) + `AvatarFallback`
|
|
35
|
+
|
|
36
|
+
### 1.2 slots(5 个 slot 区,按 density 决定使用)
|
|
37
|
+
|
|
38
|
+
| Slot | minimal | standard | complex | 元素与样式 | UI 组件库引用 |
|
|
39
|
+
|------|---------|----------|---------|-----------|--------------|
|
|
40
|
+
| **CardTitleRow** | 必需 | 必需 | 必需 | icon + title + [badge] + [statusDot] | `Avatar` + `CardTitle` + `Badge` / `Tag` |
|
|
41
|
+
| **CardDescriptionRow** | 禁止 | 必需 | 必需 | text(standard: 12px/lineClamp 1;complex: 14px/lineClamp 2);color: `var(--gray-tertiary)` | `CardDescription` |
|
|
42
|
+
| **CardFieldRow** | 禁止 | 0-2 行(可选) | 2-4 行(可选) | fieldIcon(12×12) + fieldLabel(12px) + fieldValue(14px standard / 12px complex) | 内联 span 元素 |
|
|
43
|
+
| **CardSupplementaryRow** | 1 行(必需) | 0-1 行(可选) | 1 行(必需) | 元信息:创建人/时间/地域;icon(12×12) + label(12px) + value(12px) | 内联 span + `Tooltip` |
|
|
44
|
+
| **CardActionBar** | 必需 | 必需 | 必需 | 通过 slot 引用(见 §3) | 组合组件 |
|
|
45
|
+
|
|
46
|
+
**CardTitleRow 元素**:
|
|
47
|
+
- icon: minimal=24×24;standard=Avatar 32×32(avatar) / Icon 40×40(tile);complex=Avatar 32×32;borderRadius `var(--input-radius)`;flex-shrink 0
|
|
48
|
+
- **UI 组件库引用**: `components/avatar` → `Avatar` + `AvatarFallback`
|
|
49
|
+
- title: 由 variants.titleFontSize 决定;font-weight 500;color `var(--gray-primary)`;单行 truncate
|
|
50
|
+
- **UI 组件库引用**: `components/card` → `CardTitle`
|
|
51
|
+
- **subName**(可选): 12px / 400 / `var(--gray-tertiary)`;margin-top 2px 紧贴 title 下方;用于英文标识(如 "code-generator"/"self-improvement")
|
|
52
|
+
- **UI 组件库引用**: 原生 `<span>` 或 `components/typography` → `Text`
|
|
53
|
+
- badge(可选): 10px / padding 1px 4px / border-radius 2px;用于「企业版」「Beta」标识
|
|
54
|
+
- **UI 组件库引用**: `components/badge` → `Badge` (variant='secondary' / 'outline')
|
|
55
|
+
- **statusBadge**(可选): 12px / borderless Tag / 紧跟 title 后 gap 8px;"启用" = `var(--success)` + `var(--success-bg)` / "禁用" = `var(--gray-tertiary)` + `var(--gray-fill)`
|
|
56
|
+
- **UI 组件库引用**: `components/tag` → `Tag` (variant='borderless', color='success'/'default')
|
|
57
|
+
- **versionBadge**(可选): 12px / 500 / `var(--gray-secondary)` / **right-aligned**(`margin-left: auto`);用于版本号展示如 "v3.0.1"
|
|
58
|
+
- **UI 组件库引用**: 原生 `<span>` 或 `components/badge` → `Badge` (variant='outline')
|
|
59
|
+
- statusDot(可选): 6px 圆点;位置标题尾部或卡片右上角
|
|
60
|
+
- **UI 组件库引用**: `components/tag` → `Tag` (variant='status', status='success'/'error'/...)
|
|
61
|
+
|
|
62
|
+
**CardDescriptionRow CSS**:
|
|
63
|
+
```css
|
|
64
|
+
.card-desc {
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
text-overflow: ellipsis;
|
|
67
|
+
display: -webkit-box;
|
|
68
|
+
-webkit-line-clamp: N; /* standard=1 / complex=2 */
|
|
69
|
+
-webkit-box-orient: vertical;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
- **UI 组件库引用**: `components/card` → `CardDescription`
|
|
73
|
+
|
|
74
|
+
**CardFieldRow 元素与行内状态指示器**:
|
|
75
|
+
- fieldIcon(可选): 12-14px inline icon;color `var(--gray-tertiary)`
|
|
76
|
+
- **UI 组件库引用**: lucide-react 图标(12px size)
|
|
77
|
+
- fieldLabel: 12px / `var(--gray-tertiary)` / 后跟中文冒号 ":"
|
|
78
|
+
- fieldValue: 12px / `var(--gray-secondary)`(纯文本)
|
|
79
|
+
- **inlineStatus**(可选,替代 fieldValue): 带色彩和图标的状态值
|
|
80
|
+
- **UI 组件库引用**: `components/tag` → `Tag` (variant='borderless', size='sm') 或内联 span
|
|
81
|
+
|
|
82
|
+
**行内状态指示器样式表**(截图实证,出现在 Skills Hub 安全扫描/安装状态等字段):
|
|
83
|
+
|
|
84
|
+
| 状态值 | color token | icon (lucide 12px) | 用法 |
|
|
85
|
+
|--------|-------------|-------|------|
|
|
86
|
+
| "安全" | `var(--success)` | `shield-check` | 安全扫描通过 |
|
|
87
|
+
| "有风险" | `var(--destructive)` | `alert-triangle` | 安全扫描异常 |
|
|
88
|
+
| "已安装" | `var(--success)` | `check` | 安装完成 |
|
|
89
|
+
| "有更新" | `var(--warning)` | `refresh-cw` | 有可用更新 |
|
|
90
|
+
| "未安装" | `var(--gray-tertiary)` | 无 | 未安装状态 |
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
/* CardFieldRow inline-status */
|
|
94
|
+
.field-row { display: flex; align-items: center; gap: 4px; font-size: 12px; }
|
|
95
|
+
.field-row__label { color: var(--gray-tertiary); white-space: nowrap; }
|
|
96
|
+
.field-row__value { color: var(--gray-secondary); }
|
|
97
|
+
.field-row__status { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
|
|
98
|
+
.field-row__status--success { color: var(--success); }
|
|
99
|
+
.field-row__status--warning { color: var(--warning); }
|
|
100
|
+
.field-row__status--danger { color: var(--destructive); }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 1.3 rowGap(slot 间垂直间距,仅 standard 模式)
|
|
104
|
+
|
|
105
|
+
| from → to | gap |
|
|
106
|
+
|-----------|-----|
|
|
107
|
+
| CardTitleRow → CardDescriptionRow | 4px |
|
|
108
|
+
| CardDescriptionRow → CardFieldRow | 8px |
|
|
109
|
+
| CardFieldRow → CardSupplementaryRow | 4px |
|
|
110
|
+
|
|
111
|
+
### 1.4 structureByDensity(density 结构概览)
|
|
112
|
+
|
|
113
|
+
| density | rowsAscii | 高度 | actionBarMode |
|
|
114
|
+
|---------|-----------|------|----------------|
|
|
115
|
+
| minimal | CardTitleRow → CardSupplementaryRow → CardActionBar | ~100px | hover-fade |
|
|
116
|
+
| standard | CardTitleRow → CardDescriptionRow → CardFieldRow(0-2) → CardSupplementaryRow(0-1) → CardActionBar | ~160px | hover-slidebar(默认)/ always-visible(view-toggle 覆写)|
|
|
117
|
+
| complex | CardTitleRow → CardDescriptionRow(line-clamp:2) → CardFieldRow×2-4 → CardSupplementaryRow → CardActionBar(1-2行) | 240px+ | hover-slidebar |
|
|
118
|
+
|
|
119
|
+
### 1.5 states(卡片整体状态)
|
|
120
|
+
|
|
121
|
+
| state | border | background | shadow | actionBar |
|
|
122
|
+
|-------|--------|------------|--------|-----------|
|
|
123
|
+
| default | 1px solid `var(--gray-border)` | `var(--card)` | none | 由 actionBarMode 决定:hover-* 隐藏 / always-visible 常驻 |
|
|
124
|
+
| hover | 1px solid `var(--primary)` + breathing | `var(--card)` | `var(--shadow-sm)` | 可见 |
|
|
125
|
+
| focus | 2px solid `var(--primary)` | `var(--card)` | `var(--shadow-sm)` | 可见 |
|
|
126
|
+
| disabled | 1px solid `var(--gray-border)` | `var(--gray-fill)` | none | 隐藏 |
|
|
127
|
+
| **selected** | **2px solid `var(--primary)`** | **`var(--card)`** | **none** | 隐藏 |
|
|
128
|
+
|
|
129
|
+
**hover.breathingBorder CSS**:
|
|
130
|
+
```css
|
|
131
|
+
@keyframes breathing { 0%,100% { opacity:0.5 } 50% { opacity:1 } }
|
|
132
|
+
.card-hover-breathing { animation: breathing 2s ease-in-out infinite; }
|
|
133
|
+
```
|
|
134
|
+
应用在 hover 状态下的 border。
|
|
135
|
+
|
|
136
|
+
**clickBehavior**:
|
|
137
|
+
- 卡片主体点击:跳转 DetailPage 或进入编辑
|
|
138
|
+
- ActionBar 点击:执行对应 action,事件 `stopPropagation` 不影响卡片 hover
|
|
139
|
+
|
|
140
|
+
### 1.6 avatarPreset(色块头像系统,iconStyle=avatar 且无图片时)
|
|
141
|
+
|
|
142
|
+
- **UI 组件库引用**: `components/avatar` → `Avatar` + `AvatarFallback`
|
|
143
|
+
|
|
144
|
+
**colorClasses**(9 种):`bg-primary` / `bg-success` / `bg-type-mcp` / `bg-warning` / `bg-data-8` / `bg-data-1` / `bg-destructive` / `bg-brand-3` / `bg-data-4`
|
|
145
|
+
|
|
146
|
+
**fallbackPriority**:
|
|
147
|
+
1. avatar 字段为有效颜色 class → 色块 + 首字母
|
|
148
|
+
2. avatar 字段为有效图片 URL → `<img>` → 使用 `AvatarImage`
|
|
149
|
+
3. avatar 字段为空 → `name.charAt(0)` hash 到预设色 + 首字母 → 使用 `AvatarFallback`
|
|
150
|
+
|
|
151
|
+
**blockStyle**:
|
|
152
|
+
- size: 32×32
|
|
153
|
+
- borderRadius: `var(--input-radius)`
|
|
154
|
+
- textColor: `#fff`
|
|
155
|
+
- fontWeight: 600
|
|
156
|
+
- fontSize: 14px
|
|
157
|
+
- content: `name.charAt(0).toUpperCase()`
|
|
158
|
+
|
|
159
|
+
**glossy 光泽 CSS**(色块右侧叠加半透明白色渐变):
|
|
160
|
+
```css
|
|
161
|
+
.avatar-gloss {
|
|
162
|
+
position: absolute;
|
|
163
|
+
width: 18px; height: 32px;
|
|
164
|
+
right: 0; top: 0;
|
|
165
|
+
background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.2) 40%, transparent 100%);
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 1.7 constraints(硬约束)
|
|
171
|
+
|
|
172
|
+
- 标题:必须包含,禁止无标题卡片
|
|
173
|
+
- 标题长度:单行省略 (truncate)
|
|
174
|
+
- 描述长度:standard 1 行 / complex 最多 2 行 (`-webkit-line-clamp: 2`)
|
|
175
|
+
- 卡片嵌套:禁止业务卡片嵌套业务卡片(最多 1 级)
|
|
176
|
+
- 样式一致性:同一页面内 ItemCard 的 density + iconStyle 必须保持一致
|
|
177
|
+
- 深色模式:所有图标使用 mask-image 方案(见 [boundaries.md I1-I4](../../../boundaries.md))
|
|
178
|
+
|
|
179
|
+
### 1.8 tokens(设计 token 映射)
|
|
180
|
+
|
|
181
|
+
| 用途 | token |
|
|
182
|
+
|------|-------|
|
|
183
|
+
| background | `--card` |
|
|
184
|
+
| border | `--gray-border` |
|
|
185
|
+
| borderHover | `--primary` |
|
|
186
|
+
| shadowHover | `--shadow-sm` |
|
|
187
|
+
| radius | `--radius-lg` (12px) |
|
|
188
|
+
| iconRadius | `--input-radius` (8px) |
|
|
189
|
+
| titleColor | `--gray-primary` |
|
|
190
|
+
| fieldColor | `--gray-secondary` |
|
|
191
|
+
| descColor | `--gray-tertiary` |
|
|
192
|
+
| disabledBg | `--gray-fill` |
|
|
193
|
+
| transitionDuration | `--duration-normal` (200ms) |
|
|
194
|
+
| transitionEasing | `--easing-ease` |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 2. CardGrid(卡片网格)
|
|
199
|
+
|
|
200
|
+
- **level**: ORGANISM
|
|
201
|
+
- **layer**: business
|
|
202
|
+
- **shadcnImpl**: null(CSS Grid 实现,无独立 UI 组件)
|
|
203
|
+
- **场景**:承载多个 ItemCard,使用 CSS Grid `auto-fill` + `minmax` 自动响应式列数。
|
|
204
|
+
|
|
205
|
+
### 2.1 props
|
|
206
|
+
|
|
207
|
+
| prop | 取值 | 说明 |
|
|
208
|
+
|------|------|------|
|
|
209
|
+
| minWidth | 必须引用 `var(--card-grid-min-*)` | 最小列宽(H2 修复,禁止字面量) |
|
|
210
|
+
| gap | `var(--card-gap)` 默认 16px | 卡片间距 |
|
|
211
|
+
| alignContent | literal: `'start'` | 防止卡片拉伸变形 |
|
|
212
|
+
| children | `ItemCard[]` | 仅承载业务卡片 |
|
|
213
|
+
|
|
214
|
+
### 2.2 CSS 实现
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
.card-grid {
|
|
218
|
+
display: grid;
|
|
219
|
+
grid-template-columns: repeat(
|
|
220
|
+
auto-fill,
|
|
221
|
+
minmax(var(--card-grid-min, var(--card-grid-min-standard)), 1fr)
|
|
222
|
+
);
|
|
223
|
+
gap: var(--card-gap, 16px);
|
|
224
|
+
align-content: start;
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 2.3 presets(4 套预设)
|
|
229
|
+
|
|
230
|
+
| preset | minWidth | iconStyle | density | usedBy |
|
|
231
|
+
|--------|----------|-----------|---------|--------|
|
|
232
|
+
| **compact** | `var(--card-grid-min-compact)` (240px) | avatar | minimal | pure-card / standard-card |
|
|
233
|
+
| **standard** | `var(--card-grid-min-standard)` (300px) | avatar | standard | pure-card / standard-card |
|
|
234
|
+
| **feature** | `var(--card-grid-min-feature)` (360px) | avatar | complex | pure-card / standard-card |
|
|
235
|
+
| **comfortable** | `var(--card-grid-min-comfortable)` (320px) | tile | standard | view-toggle |
|
|
236
|
+
|
|
237
|
+
> Token 定义见 `rules/design-tokens.css`。
|
|
238
|
+
|
|
239
|
+
### 2.4 responsive(参考列数,由 auto-fill 自动计算,无需手写断点)
|
|
240
|
+
|
|
241
|
+
| viewport | columns |
|
|
242
|
+
|----------|---------|
|
|
243
|
+
| ≥1400px | 4 |
|
|
244
|
+
| 1080-1400px | 3 |
|
|
245
|
+
| 768-1080px | 2 |
|
|
246
|
+
| <768px | 1 |
|
|
247
|
+
|
|
248
|
+
### 2.5 constraints(硬约束)
|
|
249
|
+
|
|
250
|
+
- 禁止手动写 `grid-template-columns` 字面量(必须用 `minmax + var(--min-width)`)
|
|
251
|
+
- 禁止 `alignContent: stretch`(会导致卡片高度被拉伸变形)
|
|
252
|
+
- 禁止在 CardGrid 与 ItemCard 之间插入额外 wrapper
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 3. CardActionBar(卡片操作栏)
|
|
257
|
+
|
|
258
|
+
- **level**: MOLECULAR
|
|
259
|
+
- **layer**: business
|
|
260
|
+
- **shadcnImpl**: null
|
|
261
|
+
- **UI 组件库引用**: 组合使用 `components/button` → `Button` (variant='ghost', size='sm') + `components/dropdown-menu` → `DropdownMenu`(溢出操作)+ `components/separator` → `Separator`(按钮间分隔)
|
|
262
|
+
- **场景**:ItemCard 底部的操作栏 — 滑条式 (SlideBar) 设计,白底 + 主要文字色 + 等分宽度(v7.3.1 从主色底调整为白底以提升可读性与表单化一致性)。
|
|
263
|
+
|
|
264
|
+
### 3.1 props
|
|
265
|
+
|
|
266
|
+
| prop | 取值 | 说明 |
|
|
267
|
+
|------|------|------|
|
|
268
|
+
| actions | `Array<{ label, onClick, destructive? }>` | 操作列表 |
|
|
269
|
+
| mode | `'hover-slidebar' \| 'hover-fade' \| 'always-visible'` | 三态,默认由 ItemCard.density 决定,pattern 可覆写 |
|
|
270
|
+
| rows | 1 \| 2 | complex 模式可分行 |
|
|
271
|
+
|
|
272
|
+
### 3.2 containerSpec(容器规格)
|
|
273
|
+
|
|
274
|
+
```css
|
|
275
|
+
.card-action-bar {
|
|
276
|
+
position: absolute;
|
|
277
|
+
bottom: 0; left: 0; right: 0;
|
|
278
|
+
background: var(--card); /* v7.3.1 白底 */
|
|
279
|
+
border-top: 1px solid var(--gray-line); /* v7.3.1 顶部分割线代替主色底边 */
|
|
280
|
+
display: flex;
|
|
281
|
+
z-index: 2;
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
> **硬约束**:
|
|
286
|
+
> - 禁止撑开卡片高度(必须 `position: absolute`)
|
|
287
|
+
> - 背景色与 ContentCard 保持一致(`var(--card)`),全局调整背景时不需修改本节
|
|
288
|
+
|
|
289
|
+
### 3.3 actionButtonSpec(按钮规格)
|
|
290
|
+
|
|
291
|
+
| 属性 | 值 |
|
|
292
|
+
|------|---|
|
|
293
|
+
| flex | 1(等分宽度) |
|
|
294
|
+
| padding | 8px |
|
|
295
|
+
| text-align | center |
|
|
296
|
+
| color | `var(--gray-primary)`(v7.3.1 主要文字色) |
|
|
297
|
+
| font-size | 13px |
|
|
298
|
+
| font-weight | 500 |
|
|
299
|
+
| cursor | pointer |
|
|
300
|
+
| border-right | `1px solid var(--gray-line)`(v7.3.1 按钮间分隔为浅分割线) |
|
|
301
|
+
| last-child | border-right: none |
|
|
302
|
+
| hover-bg | `var(--gray-fill)`(v7.3.1 浅灰样式 hover) |
|
|
303
|
+
| hover-color | `var(--primary)`(v7.3.1 hover 文字高亮为主色,提高可交互发现性) |
|
|
304
|
+
|
|
305
|
+
**destructive 按钮**(醒目警示,保留原色机制):
|
|
306
|
+
- background: `transparent`(默认跟随白底)
|
|
307
|
+
- color: `var(--destructive)`(红色文字表警示)
|
|
308
|
+
- hover-bg: `var(--destructive-bg)`(浅红背景 #FEF2F2)
|
|
309
|
+
- hover-color: `var(--destructive)`(保持红色)
|
|
310
|
+
- 位置:始终放在最后
|
|
311
|
+
|
|
312
|
+
### 3.4 modes 实现表(三态完整 CSS)
|
|
313
|
+
|
|
314
|
+
##### hover-slidebar(默认;适用 standard / complex density)
|
|
315
|
+
- trigger: 鼠标 hover 卡片
|
|
316
|
+
- method: `transform: translateY(100%)` → `translateY(0)`
|
|
317
|
+
- duration: 200ms / easing: ease
|
|
318
|
+
- visual: 白底上滑,顶部 1px 浅灰分割线与上方内容区分
|
|
319
|
+
|
|
320
|
+
```css
|
|
321
|
+
.card-action-bar { transform: translateY(100%); transition: transform .2s ease; }
|
|
322
|
+
.card:hover .card-action-bar { transform: translateY(0); }
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
> **禁止**:使用 `max-height`(触发 reflow,性能差)
|
|
326
|
+
|
|
327
|
+
##### hover-fade(适用 minimal density)
|
|
328
|
+
- trigger: 鼠标 hover 卡片
|
|
329
|
+
- method: visibility + opacity 切换
|
|
330
|
+
- duration: 200ms / easing: ease
|
|
331
|
+
|
|
332
|
+
```css
|
|
333
|
+
.card-action-bar { visibility: hidden; opacity: 0; transition: all .2s ease; }
|
|
334
|
+
.card:hover .card-action-bar { visibility: visible; opacity: 1; }
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
> **禁止**:使用 `display: none`(会导致卡片高度变化)
|
|
338
|
+
|
|
339
|
+
##### always-visible(view-toggle 子类型覆写)
|
|
340
|
+
- trigger: 无需 hover,常驻底部可见
|
|
341
|
+
- method: 静态显示,无动画
|
|
342
|
+
|
|
343
|
+
```css
|
|
344
|
+
.card-action-bar {
|
|
345
|
+
transform: none;
|
|
346
|
+
visibility: visible;
|
|
347
|
+
opacity: 1;
|
|
348
|
+
position: absolute;
|
|
349
|
+
bottom: 0;
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
> **禁止**:跟随 hover 状态切换可见性
|
|
354
|
+
|
|
355
|
+
### 3.5 rowsRule(按钮行规则)
|
|
356
|
+
|
|
357
|
+
**single(rows=1)**:
|
|
358
|
+
- max: 4 个按钮
|
|
359
|
+
- buttonGap: 8px
|
|
360
|
+
- overflow: 操作 >5 个时,剩余进入「更多 ▾」Dropdown
|
|
361
|
+
- **UI 组件库引用**: `components/dropdown-menu` → `DropdownMenu` + `DropdownMenuTrigger` + `DropdownMenuContent` + `DropdownMenuItem`
|
|
362
|
+
|
|
363
|
+
**double(rows=2)**:
|
|
364
|
+
- row1: 高频操作(管理/编辑/详情等,≤4 个)
|
|
365
|
+
- row2: 低频操作 + 「更多 ▾」(续费/导出/删除等)
|
|
366
|
+
- buttonGap: 8px
|
|
367
|
+
- rowGap: 4px
|
|
368
|
+
|
|
369
|
+
### 3.6 actionBehavior(操作触发后的页面流转,引用 page-flow.json crudFlow)
|
|
370
|
+
|
|
371
|
+
| action | confirm | target | after |
|
|
372
|
+
|--------|---------|--------|-------|
|
|
373
|
+
| 查看/详情 | false | DetailPage | 返回保持筛选 |
|
|
374
|
+
| 编辑 | false | FormPage / Sheet | 保存后返回原页 |
|
|
375
|
+
| 导出 | false | 文件下载 | — |
|
|
376
|
+
| 删除 | Dialog 二次确认(level3)| API 调用 | 刷新列表 |
|
|
377
|
+
|
|
378
|
+
### 3.7 constraints(硬约束)
|
|
379
|
+
|
|
380
|
+
- **样式**:禁止使用文字按钮或 Primary Button 替代滑条式样式
|
|
381
|
+
- **背景**:`var(--card)` 白底(v7.3.1),与 ContentCard 保持一致;禁止使用主色底
|
|
382
|
+
- **文字**:`var(--gray-primary)` 主要文字色(v7.3.1);hover 转 `var(--primary)` 提示可点击
|
|
383
|
+
- **动画**:仅使用本节 §3.4 三态(hover-slidebar / hover-fade / always-visible),禁止 `display:none` / `max-height`
|
|
384
|
+
- **位置**:必须 `position: absolute; bottom: 0`,不撑开卡片高度
|
|
385
|
+
- **危险操作**:`color: var(--destructive)` 红色文字(v7.3.1 从红底调整),始终放在最后;hover-bg `var(--destructive-bg)`
|
|
386
|
+
- **按钮分隔**:相邻按钮使用 `1px solid var(--gray-line)` 右边框(v7.3.1 浅灰分割线),最后一个按钮无右边框
|