@tfdesign/b-end 1.0.8 → 1.0.10

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.
@@ -1109,14 +1109,20 @@ export const PREVIEW_REGISTRY = {
1109
1109
  component: CardPreview,
1110
1110
  tokenMap: CARD_TOKEN_MAP,
1111
1111
  jsxSource: cardJsxRaw,
1112
- configHiddenEnums: ['type', 'infoIconTone', 'infoMetaBadgeVariant', 'dataIconTone'],
1112
+ configHiddenEnums: ['type', 'infoMetaBadgeVariant', 'dataIconTone'],
1113
+ previewBgEnumBinding: {
1114
+ name: 'color',
1115
+ map: { grey: 'white', white: 'grey' },
1116
+ },
1113
1117
  enumTitles: {
1114
1118
  color: '颜色',
1119
+ infoIconTone: '图标色系',
1115
1120
  infoIconStyle: '图标样式',
1116
1121
  infoLayout: '图标位置',
1117
1122
  productInfoLayout: '图标位置',
1118
1123
  dataIconVisible: '是否显示图标',
1119
1124
  dataIconStyle: '图标样式',
1125
+ animatedTone: '图标色系',
1120
1126
  },
1121
1127
 
1122
1128
  controls: [
@@ -1127,14 +1133,15 @@ export const PREVIEW_REGISTRY = {
1127
1133
  options: [
1128
1134
  { id: 'default', label: '数据卡片' },
1129
1135
  { id: 'product', label: '商品卡片' },
1130
- { id: 'info', label: '信息卡片' },
1136
+ { id: 'info', label: '信息卡片1' },
1137
+ { id: 'info2', label: '信息卡片2' },
1131
1138
  ],
1132
1139
  default: 'default',
1133
1140
  },
1134
1141
  ],
1135
1142
 
1136
1143
  mapProps: (cv, enums) => {
1137
- const type = cv.category === 'product' || cv.category === 'info' ? cv.category : 'data';
1144
+ const type = ['product', 'info', 'info2'].includes(cv.category) ? cv.category : 'data';
1138
1145
  return {
1139
1146
  type,
1140
1147
  color: enums.color || 'white',
@@ -1146,14 +1153,21 @@ export const PREVIEW_REGISTRY = {
1146
1153
  infoMetaBadgeVariant: undefined,
1147
1154
  dataIconVisible: enums.dataIconVisible || 'hidden',
1148
1155
  dataIconStyle: enums.dataIconStyle || 'inverse',
1156
+ animatedTone: enums.animatedTone || 'grey',
1149
1157
  };
1150
1158
  },
1151
1159
 
1152
- getVisibleEnumProps: ({ enumProps, controlValues = {} }) => {
1160
+ getVisibleEnumProps: ({ enumProps, controlValues = {}, enumValues = {} }) => {
1153
1161
  const category = controlValues.category || 'default';
1154
1162
  const props = enumProps || [];
1155
1163
  if (category === 'info') {
1156
- return props.filter((prop) => ['color', 'infoIconStyle', 'infoLayout'].includes(prop.name));
1164
+ const visibleNames = ['color', 'infoLayout', 'infoIconStyle'];
1165
+ if ((enumValues.infoIconStyle || 'inverse') === 'tone') {
1166
+ visibleNames.push('infoIconTone');
1167
+ }
1168
+ return visibleNames
1169
+ .map((name) => props.find((prop) => prop.name === name))
1170
+ .filter(Boolean);
1157
1171
  }
1158
1172
  if (category === 'product') {
1159
1173
  const colorProp = props.find((prop) => prop.name === 'color');
@@ -1163,13 +1177,22 @@ export const PREVIEW_REGISTRY = {
1163
1177
  layoutProp ? { ...layoutProp, name: 'productInfoLayout', default: 'default' } : null,
1164
1178
  ].filter(Boolean);
1165
1179
  }
1166
- return props.filter((prop) => ['color', 'dataIconVisible', 'dataIconStyle'].includes(prop.name));
1180
+ if (category === 'info2') {
1181
+ return props.filter((prop) => ['color', 'animatedTone'].includes(prop.name));
1182
+ }
1183
+ const dataVisibleNames = ['color', 'dataIconVisible'];
1184
+ if ((enumValues.dataIconVisible || 'hidden') === 'visible') {
1185
+ dataVisibleNames.push('dataIconStyle');
1186
+ }
1187
+ return dataVisibleNames
1188
+ .map((name) => props.find((prop) => prop.name === name))
1189
+ .filter(Boolean);
1167
1190
  },
1168
1191
 
1169
1192
  generateUsage: (enums, cv = {}) => {
1170
1193
  const lines = [`import Card from './components/Card';`];
1171
1194
  const color = enums.color || 'white';
1172
- const type = cv.category === 'product' || cv.category === 'info' ? cv.category : 'data';
1195
+ const type = ['product', 'info', 'info2'].includes(cv.category) ? cv.category : 'data';
1173
1196
  lines.push('');
1174
1197
 
1175
1198
  if (type === 'data') {
@@ -1191,6 +1214,7 @@ export const PREVIEW_REGISTRY = {
1191
1214
  lines.push(' <Card');
1192
1215
  if (type === 'product') lines.push(' type="product"');
1193
1216
  if (type === 'info') lines.push(' type="info"');
1217
+ if (type === 'info2') lines.push(' type="info2"');
1194
1218
  if (color !== 'white') lines.push(` color="${color}"`);
1195
1219
  if (type === 'product') {
1196
1220
  lines.push(' title="海底捞门店通用双人套餐"');
@@ -1202,18 +1226,33 @@ export const PREVIEW_REGISTRY = {
1202
1226
  lines.push(' description="抖音官方 AI 创作能力,支持短视频脚本、标题推荐、封面文案和热点灵感生成,帮助创作者提升内容生产效率。"');
1203
1227
  lines.push(' infoIconName="magic-wand-01-stroked"');
1204
1228
  lines.push(` infoIconStyle="${enums.infoIconStyle || 'inverse'}"`);
1229
+ if ((enums.infoIconStyle || 'inverse') === 'tone') {
1230
+ lines.push(` infoIconTone="${enums.infoIconTone || 'pink'}"`);
1231
+ }
1205
1232
  lines.push(` infoLayout="${enums.infoLayout || 'icon-right'}"`);
1206
1233
  lines.push(' infoMetaBadge="官方能力"');
1207
1234
  lines.push(' infoMetaLabel="段然"');
1208
1235
  lines.push(' infoStats={[');
1209
- lines.push(' { iconName: "users-01-stroked", value: "128.6K" },');
1210
- lines.push(' { iconName: "star-01-stroked", value: "4.9" },');
1211
- lines.push(' { iconName: "play-circle-stroked", value: "立即体验" },');
1236
+ lines.push(' { iconName: "users-01-stroked", value: "128.6K", tooltip: "累计启用该能力的创作者数量" },');
1237
+ lines.push(' { iconName: "star-01-stroked", value: "4.9", tooltip: "用户综合评分,满分 5 分" },');
1238
+ lines.push(' { iconName: "check-circle-stroked", value: "98.6%", tooltip: "近 30 天内容生成任务成功完成率" },');
1212
1239
  lines.push(' ]}');
1240
+ } else if (type === 'info2') {
1241
+ lines.push(' title="智能策略生成"');
1242
+ lines.push(' description="基于业务目标、历史数据和运营规则,自动生成可执行策略建议。"');
1243
+ lines.push(' animatedIconName="magic-wand-01-stroked"');
1244
+ lines.push(` animatedTone="${enums.animatedTone || 'grey'}"`);
1245
+ lines.push(' animatedBadge="AI 推荐"');
1246
+ lines.push(' animatedActionText="立即体验"');
1247
+ lines.push(' onAction={() => {}}');
1213
1248
  } else {
1214
1249
  lines.push(' title="更新用户资料"');
1215
1250
  lines.push(' description="更新用户个人资料信息,支持修改昵称、头像、简介等。"');
1216
- lines.push(' stats={stats}');
1251
+ lines.push(' stats={[');
1252
+ lines.push(' { iconName: "users-01-stroked", value: "1,289", tooltip: "近 7 天触达用户数" },');
1253
+ lines.push(' { iconName: "message-chat-square-stroked", value: "1,289", tooltip: "近 7 天累计会话量" },');
1254
+ lines.push(' { iconName: "hearts-stroked", value: "276", tooltip: "近 7 天收藏或点赞次数" },');
1255
+ lines.push(' ]}');
1217
1256
  lines.push(' tags={["社区", "收藏星标"]}');
1218
1257
  if ((enums.dataIconVisible || 'hidden') === 'visible') {
1219
1258
  lines.push(' dataIconVisible="visible"');
@@ -188,7 +188,7 @@ export const SEMANTIC_CSS_MAP = {
188
188
  'text-tertiary': 'foreground-muted', 'text-disabled': 'foreground-disabled', 'text-inverse': 'foreground-inverse',
189
189
  'bg-page': 'page', 'bg-surface': 'surface', 'bg-elevated': 'elevated', 'bg-disabled': 'disabled', 'bg-card-secondary': 'card-secondary', 'bg-chat-incoming': 'chat-incoming', 'bg-chat-outgoing': 'chat-outgoing', 'bg-chat-outgoing-ai': 'chat-outgoing-ai',
190
190
  'fill-default': 'fill', 'fill-hover': 'fill-hover', 'fill-active': 'fill-active',
191
- 'border-default': 'border-default', 'border-strong': 'border-strong', 'border-brand': 'border-brand', 'border-brand-strong': 'border-brand-strong',
191
+ 'border-default': 'border-default', 'border-strong': 'border-strong', 'border-brand': 'border-brand',
192
192
  'overlay-bg': 'overlay', 'focus-ring': 'ring',
193
193
  };
194
194
 
@@ -227,9 +227,6 @@ export const TOKEN_SEMANTIC_MAP = {
227
227
  'border-default': { label: '默认描边', color: '#E4E7EC', primitiveRef: 'blueGrey-300' },
228
228
  'border-strong': { label: '强调/悬浮描边', color: '#D0D5DD', primitiveRef: 'blueGrey-400' },
229
229
  'border-brand': { label: '品牌描边', color: '#56D3BC', primitiveRef: 'brand-500' },
230
- 'border-brand-strong': { label: '品牌强调描边', color: '#32C4AC', primitiveRef: 'brand-600' },
231
- /** rgba 细线:ChatMessage 追问/执行流卡片描边;必须进 theme.css,否则 var() 失效时浏览器退化为深黑描边 */
232
- 'border-line-light': { label: '细线描边 rgba', color: 'rgba(22,24,35,0.08)' },
233
230
 
234
231
  // ── overlay: 蒙层 ──
235
232
  'overlay-bg': { label: '蒙层背景', color: 'rgba(22, 22, 26, 0.60)', primitiveRef: 'grey-950/60%' },
package/src/index.d.ts CHANGED
@@ -47,7 +47,7 @@ export interface IconProps extends TfdsCommonProps {
47
47
  }
48
48
  export const Icon: React.FC<IconProps>;
49
49
 
50
- /** NavBar — 业务竖向导航栏,集成品牌区、业务入口切换、平台首页模块高亮、主导航、底部工具按钮和用户头像。 */
50
+ /** NavBar — 业务竖向导航栏,集成品牌区、业务入口切换、统一 navItems 主导航、底部工具按钮和用户头像。 */
51
51
  export interface NavBarProps extends TfdsCommonProps {
52
52
  /** enum<ola | bytehi>, default: "ola" */
53
53
  platform?: "ola" | "bytehi";
@@ -67,6 +67,8 @@ export interface NavBarProps extends TfdsCommonProps {
67
67
  onAppChange?: (...args: any[]) => any;
68
68
  /** string, default: "平台首页" */
69
69
  moduleLabel?: string;
70
+ /** string, default: "home-smile-stroked" */
71
+ moduleIconName?: string;
70
72
  /** boolean, default: true */
71
73
  activeModule?: boolean;
72
74
  /** array, default: null */
@@ -153,10 +155,10 @@ export interface TagBarProps extends TfdsCommonProps {
153
155
  }
154
156
  export const TagBar: React.FC<TagBarProps>;
155
157
 
156
- /** Card — 业务信息摘要卡片,支持数据卡片、商品卡片和信息卡片三类结构。颜色使用遵循背景反衬原则:灰色背景用白底卡,白色背景用灰底卡。 */
158
+ /** Card — 业务信息摘要卡片,支持数据卡片、商品卡片、信息卡片1和信息卡片2。颜色使用遵循背景反衬原则:灰色背景用白底卡,白色背景用灰底卡。 */
157
159
  export interface CardProps extends TfdsCommonProps {
158
- /** enum<data | product | info>, default: "data" */
159
- type?: "data" | "product" | "info";
160
+ /** enum<data | product | info | info2 | animated>, default: "data" */
161
+ type?: "data" | "product" | "info" | "info2" | "animated";
160
162
  /** enum<white | grey>, default: "white" */
161
163
  color?: "white" | "grey";
162
164
  /** string, default: "智能服务近7天趋势分析" */
@@ -189,6 +191,14 @@ export interface CardProps extends TfdsCommonProps {
189
191
  dataIconTone?: "pink" | "blue" | "green" | "orange" | "purple" | "brand" | "grey";
190
192
  /** enum<tone | inverse>, default: "inverse" */
191
193
  dataIconStyle?: "tone" | "inverse";
194
+ /** enum<brand | blue | purple | green | orange | grey>, default: "grey" */
195
+ animatedTone?: "brand" | "blue" | "purple" | "green" | "orange" | "grey";
196
+ /** string, default: "magic-wand-01-stroked" */
197
+ animatedIconName?: string;
198
+ /** string, default: "AI 推荐" */
199
+ animatedBadge?: string;
200
+ /** string, default: "立即体验" */
201
+ animatedActionText?: string;
192
202
  /** string, default: "段然" */
193
203
  infoMetaLabel?: string;
194
204
  /** string, default: "官方能力" */
package/theme.css CHANGED
@@ -224,8 +224,6 @@
224
224
  --color-border-default: var(--color-blueGrey-300); /* 默认描边 ← blueGrey-300 */
225
225
  --color-border-strong: var(--color-blueGrey-400); /* 强调/悬浮描边 ← blueGrey-400 */
226
226
  --color-border-brand: var(--color-brand-500); /* 品牌描边 ← brand-500 */
227
- --color-border-brand-strong: var(--color-brand-600); /* 品牌强调描边 ← brand-600 */
228
- --color-border-line-light: rgba(22,24,35,0.08); /* 细线描边 rgba ← literal */
229
227
  --color-overlay: rgba(22, 22, 26, 0.60); /* 蒙层背景 ← grey-950/60% */
230
228
  --color-ring: var(--color-brand-500); /* 焦点环 ← brand-500 */
231
229