feat(ui): 新增 EntryRow / EntryTile,收掉应用里两套手写内容卡

- EntryRow:头像 + 标题(可带角标)+ 单行描述,整行可点;
  点击语义内置(无修饰键接管,按住 Ctrl/Cmd/Shift/Alt 保留浏览器默认)
- EntryTile:上图下文白卡,由 Card padding=none hoverable + Cover 拼成
- 展示页 #cards 补两个示例与 props,COMPONENTS.md 补契约与 changelog

兼容性:纯新增;应用侧的旧类名(.app-card / .ces-card / .ces-body)随之删除
This commit is contained in:
2026-11-01 16:08:39 +08:00
parent 50056a7154
commit 17a09f22b6
7 changed files with 247 additions and 1 deletions
+39 -1
View File
@@ -1,4 +1,4 @@
import { Badge, Card, Icon, IconButton, Space } from '../../src'
import { Badge, Card, EntryRow, EntryTile, Icon, IconButton, ItemBadge, Space } from '../../src'
import { Demo } from '../components/Demo'
import { PropsTable } from '../components/PropsTable'
import { Section } from '../components/Section'
@@ -94,12 +94,50 @@ export function Cards() {
</Card>
</Demo>
<Demo
title="条目行与条目磁贴"
desc="同一份内容数据的两种版式:EntryRow 是横向一行(头像 + 标题 + 描述),EntryTile 是上图下文的白卡。点击语义一致——不带修饰键时接管点击,按住 Ctrl/Cmd 时保留浏览器默认行为。"
layout="column"
code={`<EntryRow title="GitHub" description="代码托管与开源社区" fallback="G" badge={<ItemBadge tone="hot">HOT</ItemBadge>} />
<EntryTile title="可塑性极强的玻璃" description="前沿科技" ratio={16 / 10} />`}
>
<EntryRow
title="GitHub"
description="代码托管与开源社区"
fallback="G"
badge={<ItemBadge tone="hot">HOT</ItemBadge>}
onOpen={() => undefined}
/>
<EntryRow title="知乎" description="深度内容问答社区" fallback="知" onOpen={() => undefined} />
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, minmax(0, 1fr))', gap: 'var(--su-space-3)' }}>
<EntryTile
title="可塑性极强的玻璃,在设计师手里能变成什么"
description="前沿科技"
ratio={16 / 10}
onOpen={() => undefined}
/>
<EntryTile title="废旧共享单车如何变成微型共享…" description="环保设计" ratio={16 / 10} />
</div>
</Demo>
<PropsTable
rows={[
{ name: 'as', type: "'div' | 'section' | 'article' | 'aside'", defaultValue: "'div'", desc: '渲染标签,按语义选' },
{ name: 'padding', type: "'none' | 'sm' | 'md' | 'lg'", defaultValue: "'md'", desc: '内边距档位' },
{ name: 'hoverable', type: 'boolean', defaultValue: 'false', desc: '悬停加深阴影' },
{ name: 'className / style', type: 'string / CSSProperties', desc: '布局微调,例如绝对定位角标' },
{ name: 'EntryRow.title', type: 'string', required: true, desc: '标题' },
{ name: 'EntryRow.description', type: 'string', desc: '单行描述' },
{ name: 'EntryRow.href', type: 'string', desc: '整行链接地址' },
{ name: 'EntryRow.avatar / fallback', type: 'string', desc: '头像图片 / 首字占位' },
{ name: 'EntryRow.verified', type: 'boolean', desc: '头像右下角认证勾' },
{ name: 'EntryRow.badge', type: 'ReactNode', desc: '标题右侧角标(如 HOT)' },
{ name: 'EntryRow.onOpen', type: '() => void', desc: '接管点击;不传保持链接行为' },
{ name: 'EntryTile.title', type: 'string', required: true, desc: '标题' },
{ name: 'EntryTile.description', type: 'string', desc: '单行描述' },
{ name: 'EntryTile.cover', type: 'string', desc: '封面地址' },
{ name: 'EntryTile.ratio', type: 'number', defaultValue: '16 / 10', desc: '封面宽高比' },
{ name: 'EntryTile.onOpen', type: '() => void', desc: '点击整张卡' },
]}
/>
</Section>