@tfdesign/b-end 1.0.4
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/AI_READ_FIRST.md +131 -0
- package/LICENSE +21 -0
- package/README.md +353 -0
- package/package.json +67 -0
- package/scripts/check-tfds-contract.mjs +334 -0
- package/scripts/check-tfds-integration.mjs +263 -0
- package/scripts/postinstall-cursor-skill.mjs +382 -0
- package/scripts/setup.mjs +520 -0
- package/skills/tfds/CHECKLIST.md +205 -0
- package/skills/tfds/COMMON_FAILURES.md +238 -0
- package/skills/tfds/DESIGN_PRINCIPLES.md +477 -0
- package/skills/tfds/GLOBAL_DESIGN_RULES.md +636 -0
- package/skills/tfds/LAYOUT_RECIPES.md +140 -0
- package/skills/tfds/LAYOUT_RULES.md +1355 -0
- package/skills/tfds/PAGE_ARCHETYPES.md +201 -0
- package/skills/tfds/SKILL.md +188 -0
- package/skills/tfds/components.index.json +7305 -0
- package/skills/tfds/components.summary.json +1809 -0
- package/src/_b_end_runtime/components/AiSuggestionShared.jsx +166 -0
- package/src/_b_end_runtime/components/Avatar.jsx +325 -0
- package/src/_b_end_runtime/components/Avatar.tokens.js +76 -0
- package/src/_b_end_runtime/components/AvatarGridPreview.jsx +56 -0
- package/src/_b_end_runtime/components/AvatarGroup.jsx +80 -0
- package/src/_b_end_runtime/components/AvatarGroup.tokens.js +28 -0
- package/src/_b_end_runtime/components/Button.jsx +144 -0
- package/src/_b_end_runtime/components/Button.tokens.js +90 -0
- package/src/_b_end_runtime/components/Card.jsx +460 -0
- package/src/_b_end_runtime/components/Card.tokens.js +124 -0
- package/src/_b_end_runtime/components/CardPreview.jsx +51 -0
- package/src/_b_end_runtime/components/ChatBubble.jsx +384 -0
- package/src/_b_end_runtime/components/ChatBubble.tokens.js +60 -0
- package/src/_b_end_runtime/components/ChatBubblePreview.jsx +129 -0
- package/src/_b_end_runtime/components/ChatInput.jsx +1399 -0
- package/src/_b_end_runtime/components/ChatInput.tokens.js +75 -0
- package/src/_b_end_runtime/components/ChatMessage.jsx +2215 -0
- package/src/_b_end_runtime/components/ChatMessage.tokens.js +257 -0
- package/src/_b_end_runtime/components/ChatMessagePreview.jsx +388 -0
- package/src/_b_end_runtime/components/Checkbox.jsx +317 -0
- package/src/_b_end_runtime/components/Checkbox.tokens.js +59 -0
- package/src/_b_end_runtime/components/ConversationList.jsx +1264 -0
- package/src/_b_end_runtime/components/ConversationList.tokens.js +135 -0
- package/src/_b_end_runtime/components/ConversationListPreview.jsx +108 -0
- package/src/_b_end_runtime/components/CustomerServiceWorkspaceFrame.jsx +324 -0
- package/src/_b_end_runtime/components/CustomerServiceWorkspaceFrame.tokens.js +69 -0
- package/src/_b_end_runtime/components/DatePicker.jsx +739 -0
- package/src/_b_end_runtime/components/DatePicker.tokens.js +99 -0
- package/src/_b_end_runtime/components/Empty.jsx +141 -0
- package/src/_b_end_runtime/components/Empty.tokens.js +40 -0
- package/src/_b_end_runtime/components/Form.jsx +609 -0
- package/src/_b_end_runtime/components/Form.tokens.js +77 -0
- package/src/_b_end_runtime/components/FormFieldStack.jsx +123 -0
- package/src/_b_end_runtime/components/FormFieldStack.tokens.js +12 -0
- package/src/_b_end_runtime/components/FormTitle.jsx +119 -0
- package/src/_b_end_runtime/components/FormTitle.tokens.js +87 -0
- package/src/_b_end_runtime/components/FullScreenPage.jsx +97 -0
- package/src/_b_end_runtime/components/FullScreenPage.tokens.js +19 -0
- package/src/_b_end_runtime/components/Icon.jsx +172 -0
- package/src/_b_end_runtime/components/Icon.tokens.js +26 -0
- package/src/_b_end_runtime/components/IconGridPreview.jsx +277 -0
- package/src/_b_end_runtime/components/InfoDisplayPanel.jsx +620 -0
- package/src/_b_end_runtime/components/InfoDisplayPanel.tokens.js +71 -0
- package/src/_b_end_runtime/components/InfoDisplayPanelPreview.jsx +133 -0
- package/src/_b_end_runtime/components/Input.jsx +258 -0
- package/src/_b_end_runtime/components/Input.tokens.js +68 -0
- package/src/_b_end_runtime/components/InputNumber.jsx +242 -0
- package/src/_b_end_runtime/components/InputNumber.tokens.js +55 -0
- package/src/_b_end_runtime/components/Modal.jsx +155 -0
- package/src/_b_end_runtime/components/Modal.tokens.js +73 -0
- package/src/_b_end_runtime/components/NavBar.jsx +842 -0
- package/src/_b_end_runtime/components/NavBar.tokens.js +97 -0
- package/src/_b_end_runtime/components/NavBarPreview.jsx +11 -0
- package/src/_b_end_runtime/components/Radio.jsx +227 -0
- package/src/_b_end_runtime/components/Radio.tokens.js +59 -0
- package/src/_b_end_runtime/components/Select.jsx +766 -0
- package/src/_b_end_runtime/components/Select.tokens.js +99 -0
- package/src/_b_end_runtime/components/Sheet.jsx +132 -0
- package/src/_b_end_runtime/components/Sheet.tokens.js +61 -0
- package/src/_b_end_runtime/components/Slider.jsx +346 -0
- package/src/_b_end_runtime/components/Slider.tokens.js +47 -0
- package/src/_b_end_runtime/components/Switch.jsx +124 -0
- package/src/_b_end_runtime/components/Switch.tokens.js +38 -0
- package/src/_b_end_runtime/components/Table.jsx +1338 -0
- package/src/_b_end_runtime/components/Table.tokens.js +147 -0
- package/src/_b_end_runtime/components/TablePreview.jsx +599 -0
- package/src/_b_end_runtime/components/Tabs.jsx +149 -0
- package/src/_b_end_runtime/components/Tabs.tokens.js +102 -0
- package/src/_b_end_runtime/components/Tag.jsx +199 -0
- package/src/_b_end_runtime/components/Tag.tokens.js +171 -0
- package/src/_b_end_runtime/components/TagBar.jsx +1134 -0
- package/src/_b_end_runtime/components/TagBar.tokens.js +75 -0
- package/src/_b_end_runtime/components/TagGridPreview.jsx +23 -0
- package/src/_b_end_runtime/components/TagInput.jsx +382 -0
- package/src/_b_end_runtime/components/TagInput.tokens.js +52 -0
- package/src/_b_end_runtime/components/TextArea.jsx +363 -0
- package/src/_b_end_runtime/components/TextArea.tokens.js +65 -0
- package/src/_b_end_runtime/components/TimePicker.jsx +444 -0
- package/src/_b_end_runtime/components/TimePicker.tokens.js +77 -0
- package/src/_b_end_runtime/components/Toast.jsx +120 -0
- package/src/_b_end_runtime/components/Toast.tokens.js +146 -0
- package/src/_b_end_runtime/components/Tooltip.jsx +282 -0
- package/src/_b_end_runtime/components/Tooltip.tokens.js +48 -0
- package/src/_b_end_runtime/components/TooltipPreview.jsx +50 -0
- package/src/_b_end_runtime/components/Upload.jsx +455 -0
- package/src/_b_end_runtime/components/Upload.tokens.js +47 -0
- package/src/_b_end_runtime/components/avatar-assets/avatar-default.png +0 -0
- package/src/_b_end_runtime/components/avatar-group-assets/avatar-group-1.png +0 -0
- package/src/_b_end_runtime/components/avatar-group-assets/avatar-group-2.png +0 -0
- package/src/_b_end_runtime/components/avatar-group-assets/avatar-group-3.png +0 -0
- package/src/_b_end_runtime/components/avatar-group-assets/avatar-group-4.png +0 -0
- package/src/_b_end_runtime/components/avatar-group-assets/avatar-group-5.png +0 -0
- package/src/_b_end_runtime/components/empty-assets/administrator-1.svg +40 -0
- package/src/_b_end_runtime/components/empty-assets/administrator-2.svg +33 -0
- package/src/_b_end_runtime/components/empty-assets/construction.svg +33 -0
- package/src/_b_end_runtime/components/empty-assets/failure.svg +49 -0
- package/src/_b_end_runtime/components/empty-assets/idle.svg +34 -0
- package/src/_b_end_runtime/components/empty-assets/no-access.svg +36 -0
- package/src/_b_end_runtime/components/empty-assets/no-content.svg +77 -0
- package/src/_b_end_runtime/components/empty-assets/no-result.svg +61 -0
- package/src/_b_end_runtime/components/empty-assets/not-found.svg +46 -0
- package/src/_b_end_runtime/components/empty-assets/success.svg +38 -0
- package/src/_b_end_runtime/components/file-type-assets/batch-report.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/catcat.svg +21 -0
- package/src/_b_end_runtime/components/file-type-assets/code.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/conversation.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/document.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/feishu-card.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/feishu-sheet.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/feishu.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/image.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/index.js +105 -0
- package/src/_b_end_runtime/components/file-type-assets/knowledge.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/pdf.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/pe.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/strategy.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/table.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/webpage.png +0 -0
- package/src/_b_end_runtime/components/file-type-assets/xmind.png +0 -0
- package/src/_b_end_runtime/components/icons/icon-data.js +12496 -0
- package/src/_b_end_runtime/components/nav-bar-assets/bytehi-logo-mark.svg +21 -0
- package/src/_b_end_runtime/components/table-assets/avatar.png +0 -0
- package/src/_b_end_runtime/components/table-assets/button.png +0 -0
- package/src/_b_end_runtime/components/table-assets/icon-chevron-down.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/avatar.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/button.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/checkbox.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/icon-chevron-right.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/icon.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/semi-icons-handle.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/semi-icons-tree-triangle-right.png +0 -0
- package/src/_b_end_runtime/components/table-cell-assets/switch.png +0 -0
- package/src/_b_end_runtime/components/tagShared.js +3 -0
- package/src/_b_end_runtime/components/team-avatar-assets/chengcheng-murphy.png +0 -0
- package/src/_b_end_runtime/components/team-avatar-assets/duan-ran.png +0 -0
- package/src/_b_end_runtime/components/team-avatar-assets/guo-zhezhi.png +0 -0
- package/src/_b_end_runtime/components/team-avatar-assets/li-siru.png +0 -0
- package/src/_b_end_runtime/components/team-avatar-assets/liu-delin.png +0 -0
- package/src/_b_end_runtime/components.js +3499 -0
- package/src/_b_end_runtime/index.js +9 -0
- package/src/_b_end_runtime/page-patterns/BasePageFramePattern.jsx +395 -0
- package/src/_b_end_runtime/page-patterns/ChatConversationPattern.jsx +989 -0
- package/src/_b_end_runtime/page-patterns/ChatHomePagePattern.jsx +281 -0
- package/src/_b_end_runtime/page-patterns/CopilotPagePattern.jsx +380 -0
- package/src/_b_end_runtime/page-patterns/CustomerServiceWorkspaceFramePattern.jsx +392 -0
- package/src/_b_end_runtime/page-patterns/IMConversationPattern.jsx +590 -0
- package/src/_b_end_runtime/page-patterns/McpManagementPage.jsx +237 -0
- package/src/_b_end_runtime/page-patterns/StrategyListPage.jsx +189 -0
- package/src/_b_end_runtime/page-patterns/TabTopBarListPage.jsx +594 -0
- package/src/_b_end_runtime/page-patterns/VariableManagementPage.jsx +87 -0
- package/src/_b_end_runtime/page-patterns/pageListShared.jsx +177 -0
- package/src/_b_end_runtime/patterns.js +428 -0
- package/src/_b_end_runtime/preview-registry.jsx +4719 -0
- package/src/_b_end_runtime/teamMembers.js +56 -0
- package/src/_b_end_runtime/tokens.js +500 -0
- package/src/index.d.ts +1073 -0
- package/src/index.js +52 -0
- package/theme.css +350 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pageListShared — B 端"列表页"模板共享工具
|
|
3
|
+
*
|
|
4
|
+
* 把所有列表型页面(变量管理、MCP 管理等)复用的 UI 子组件、列定义、
|
|
5
|
+
* 数据装配函数集中在这里,方便每个独立模板页直接 import 使用,
|
|
6
|
+
* 业务接入时只需替换数据源(list)和文案配置(标题/筛选项/按钮)。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import Checkbox from '../components/Checkbox';
|
|
10
|
+
import FormTitle from '../components/FormTitle';
|
|
11
|
+
import Icon from '../components/Icon';
|
|
12
|
+
import Input from '../components/Input';
|
|
13
|
+
import { TEAM_MEMBERS } from '../teamMembers';
|
|
14
|
+
|
|
15
|
+
/* 列表页右侧"业务上下文胶囊"统一文案,跟随当前所选业务(这里固定为 demo 文案) */
|
|
16
|
+
export const PAGE_CONTEXT_LABEL = '抖音主端-在线客服&网络呼入';
|
|
17
|
+
export const WHITE_CARD_STYLE = {
|
|
18
|
+
background: 'var(--color-white, #FFFFFF)',
|
|
19
|
+
borderRadius: '12px',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/* ── 表格列定义(所有列表型模板共用:名称 / 类型 / 描述 / 创建人 / 状态 / 更新时间 / 操作) ── */
|
|
23
|
+
export const LIST_COLUMNS = [
|
|
24
|
+
{ key: 'name', dataIndex: 'name', title: '工具名称', type: 'text', width: 220 },
|
|
25
|
+
{ key: 'tag', dataIndex: 'tag', title: '类型', type: 'tag', width: 120 },
|
|
26
|
+
{ key: 'desc', dataIndex: 'desc', title: '描述', type: 'text', width: 320 },
|
|
27
|
+
{ key: 'creator', dataIndex: 'creator', title: '创建人', type: 'avatar', width: 152 },
|
|
28
|
+
{ key: 'status', dataIndex: 'status', title: '状态', type: 'status', width: 120 },
|
|
29
|
+
{ key: 'updatedAt', dataIndex: 'updatedAt', title: '更新时间', type: 'datetime', width: 180 },
|
|
30
|
+
{ key: 'actions', dataIndex: 'actions', title: '操作', type: 'actions', width: 168 },
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const ACTION_BUTTONS = [
|
|
34
|
+
{ key: 'edit', label: '编辑' },
|
|
35
|
+
{ key: 'detail', label: '详情' },
|
|
36
|
+
{ key: 'more', kind: 'more' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const CREATOR_POOL = TEAM_MEMBERS;
|
|
40
|
+
|
|
41
|
+
const STATUS_OPTIONS = [
|
|
42
|
+
{ label: '已启用', tone: 'success' },
|
|
43
|
+
{ label: '调试中', tone: 'warning' },
|
|
44
|
+
{ label: '已停用', tone: 'danger' },
|
|
45
|
+
{ label: '审核中', tone: 'warning' },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const UPDATED_AT_POOL = [
|
|
49
|
+
'2026-04-21 10:30:00',
|
|
50
|
+
'2026-04-20 18:45:00',
|
|
51
|
+
'2026-04-19 14:12:00',
|
|
52
|
+
'2026-04-18 09:20:00',
|
|
53
|
+
'2026-04-17 16:05:00',
|
|
54
|
+
'2026-04-16 11:08:00',
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
function makeCreator(index) {
|
|
58
|
+
const base = CREATOR_POOL[index % CREATOR_POOL.length];
|
|
59
|
+
return {
|
|
60
|
+
name: base.name,
|
|
61
|
+
avatarType: 'image',
|
|
62
|
+
avatarSrc: base.avatarSrc,
|
|
63
|
+
avatarAlt: `${base.name}头像`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function makeStatus(index) {
|
|
68
|
+
return STATUS_OPTIONS[index % STATUS_OPTIONS.length];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 把"业务原始数据"批量套上 mock 的创建人 / 状态 / 更新时间 / 操作按钮,
|
|
73
|
+
* 形成 Table 可直接消费的 dataSource。
|
|
74
|
+
*
|
|
75
|
+
* @param {string} keyPrefix — 行 id 前缀(建议跟模板 key 一致,便于 React diff)
|
|
76
|
+
* @param {Array<{name: string, tag: string, desc: string}>} list — 业务原始数据
|
|
77
|
+
*/
|
|
78
|
+
export function buildListDataSource(keyPrefix, list) {
|
|
79
|
+
if (!Array.isArray(list)) return [];
|
|
80
|
+
return list.map((item, index) => ({
|
|
81
|
+
id: `${keyPrefix}-${index}`,
|
|
82
|
+
name: item.name,
|
|
83
|
+
tag: [{ label: item.tag, variant: 'white' }],
|
|
84
|
+
desc: item.desc,
|
|
85
|
+
creator: makeCreator(index),
|
|
86
|
+
status: makeStatus(index),
|
|
87
|
+
updatedAt: UPDATED_AT_POOL[index % UPDATED_AT_POOL.length],
|
|
88
|
+
actions: ACTION_BUTTONS.map((action) => ({ ...action, onClick: () => {} })),
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 页面标题栏(白卡内、子 Tab 之下)
|
|
94
|
+
* 结构:左侧 FormTitle level-1 + 业务上下文胶囊;右侧可选 actions。
|
|
95
|
+
*/
|
|
96
|
+
export function PageHeader({ title, contextLabel, actions }) {
|
|
97
|
+
const suffix = contextLabel ? (
|
|
98
|
+
<span
|
|
99
|
+
className="inline-flex shrink-0 items-center justify-center rounded-full text-blueGrey-700 whitespace-nowrap"
|
|
100
|
+
style={{
|
|
101
|
+
background: 'var(--color-fill, rgba(45,66,107,0.06))',
|
|
102
|
+
padding: '6px 12px',
|
|
103
|
+
fontSize: '12px',
|
|
104
|
+
lineHeight: '16px',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{contextLabel}
|
|
108
|
+
</span>
|
|
109
|
+
) : null;
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<div className="flex min-w-0 shrink-0 items-center justify-between gap-3" style={{ minHeight: '36px' }}>
|
|
113
|
+
<FormTitle
|
|
114
|
+
variant="level-1"
|
|
115
|
+
title={title}
|
|
116
|
+
titleSuffix={suffix}
|
|
117
|
+
className="min-w-[120px] flex-1"
|
|
118
|
+
/>
|
|
119
|
+
{actions && (
|
|
120
|
+
<div className="flex shrink-0 flex-wrap items-center justify-end gap-2">
|
|
121
|
+
{actions}
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* 筛选栏(白卡内、标题栏之下)
|
|
130
|
+
* 结构:左侧 300px 搜索框 + 一组 FilterPill(白底圆角胶囊 + 文字 + 下拉箭头)
|
|
131
|
+
* + 1 个 Checkbox 胶囊"我创建的"。
|
|
132
|
+
*
|
|
133
|
+
* @param {string[]} filters — 下拉筛选项的标签文案数组
|
|
134
|
+
* @param {string} [checkboxLabel='我创建的'] — 末尾 Checkbox 胶囊文案;传 null 则隐藏
|
|
135
|
+
*/
|
|
136
|
+
export function FilterBar({ filters = [], checkboxLabel = '我创建的' }) {
|
|
137
|
+
return (
|
|
138
|
+
<div className="flex items-center shrink-0 flex-wrap" style={{ gap: '8px' }}>
|
|
139
|
+
<Input
|
|
140
|
+
placeholder="搜索"
|
|
141
|
+
prefix={<Icon name="search-md-stroked" />}
|
|
142
|
+
className="max-w-full"
|
|
143
|
+
style={{ flex: '0 1 240px', width: '240px', minWidth: '200px', '--size-input-width': '100%' }}
|
|
144
|
+
/>
|
|
145
|
+
{filters.map((label) => (
|
|
146
|
+
<FilterPill key={label} label={label} />
|
|
147
|
+
))}
|
|
148
|
+
{checkboxLabel && <FilterCheckPill label={checkboxLabel} />}
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* 单个筛选触发器:白底 + 描边 + 圆角胶囊 + 文字 + chevron */
|
|
154
|
+
function FilterPill({ label }) {
|
|
155
|
+
return (
|
|
156
|
+
<button
|
|
157
|
+
type="button"
|
|
158
|
+
className="inline-flex items-center shrink-0 cursor-pointer bg-white rounded-full border border-border-default text-sm font-semibold text-blueGrey-800 hover:bg-fill transition-colors duration-150"
|
|
159
|
+
style={{ height: '32px', padding: '0 12px', gap: '8px' }}
|
|
160
|
+
>
|
|
161
|
+
<span>{label}</span>
|
|
162
|
+
<Icon name="chevron-down-stroked" className="text-blueGrey-600" />
|
|
163
|
+
</button>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Checkbox 类型的筛选项:白底圆角胶囊里嵌一个 Checkbox */
|
|
168
|
+
function FilterCheckPill({ label }) {
|
|
169
|
+
return (
|
|
170
|
+
<div
|
|
171
|
+
className="inline-flex items-center shrink-0 bg-white rounded-full border border-border-default"
|
|
172
|
+
style={{ height: '32px', padding: '0 12px' }}
|
|
173
|
+
>
|
|
174
|
+
<Checkbox size="md">{label}</Checkbox>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|