@baishuyun/ai-design 2.0.50 → 2.0.52

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @baishuyun/ai-design
2
2
 
3
+ ## 2.0.52
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @baishuyun/types@3.0.43
9
+ - @baishuyun/ai-feat-utils@2.0.47
10
+
11
+ ## 2.0.51
12
+
13
+ ### Patch Changes
14
+
15
+ - fix mobile style
16
+ - Updated dependencies
17
+ - @baishuyun/ai-feat-utils@2.0.46
18
+
3
19
  ## 2.0.50
4
20
 
5
21
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ai-design",
3
- "version": "2.0.50",
3
+ "version": "2.0.52",
4
4
  "description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -60,8 +60,8 @@
60
60
  "tw-animate-css": "^1.4.0",
61
61
  "vaul": "^1.1.2",
62
62
  "zod": "^4.1.13",
63
- "@baishuyun/ai-feat-utils": "2.0.45",
64
- "@baishuyun/types": "3.0.42"
63
+ "@baishuyun/ai-feat-utils": "2.0.47",
64
+ "@baishuyun/types": "3.0.43"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "react": "^19.0.0",
@@ -84,7 +84,7 @@
84
84
  "vite": "^5.1.4",
85
85
  "vite-plugin-dts": "^4.5.4",
86
86
  "@baishuyun/tailwind-config": "3.0.9",
87
- "@baishuyun/types": "3.0.42",
87
+ "@baishuyun/types": "3.0.43",
88
88
  "@baishuyun/typescript-config": "2.0.9"
89
89
  },
90
90
  "keywords": [],
@@ -76,7 +76,7 @@ export const AgentDrawer = ({
76
76
  title="选择智能体"
77
77
  // DrawerContent 内联 style 强制 borderRadius: 0(会压掉方向圆角),
78
78
  // 用 !important 任意值恢复设计稿的顶部 10px 圆角
79
- className="rounded-t-[10px]!"
79
+ className="rounded-t-[20px]!"
80
80
  >
81
81
  <div className="flex flex-col">
82
82
  {/* 头部:标题 18px Bold + 关闭(设计稿 40434:34109,上 20、下 20、左右 12) */}
@@ -9,18 +9,13 @@ export interface AgentEntryCardProps {
9
9
  onLogClick: () => void;
10
10
  }
11
11
 
12
- export const AgentEntryCard = ({
13
- agent,
14
- className,
15
- onSelect,
16
- onLogClick,
17
- }: AgentEntryCardProps) => {
12
+ export const AgentEntryCard = ({ agent, className, onSelect, onLogClick }: AgentEntryCardProps) => {
18
13
  return (
19
14
  <div
20
15
  className={cn(
21
16
  'bg-white border border-[#e0e0e0] border-solid content-stretch flex flex-col items-start p-[16px] rounded-[10px] w-full drop-shadow-[0px_0px_5px_rgba(0,0,0,0.04)] hover:drop-shadow-[0px_0px_8px_rgba(0,0,0,0.1)]',
22
17
  transCls,
23
- className,
18
+ className
24
19
  )}
25
20
 
26
21
  onClick={onSelect}
@@ -32,7 +27,7 @@ export const AgentEntryCard = ({
32
27
  <div className="content-stretch flex gap-[10px] items-center min-w-0">
33
28
  <img
34
29
  alt={agent.name}
35
- className="rounded-[10px] shrink-0 size-[40px] object-cover"
30
+ className="rounded-[20px] shrink-0 size-[40px] object-cover"
36
31
  src={agent.icon}
37
32
  />
38
33
  <p className="font-bold leading-[normal] overflow-hidden shrink-0 text-[#030303] text-[18px] text-ellipsis whitespace-nowrap">
@@ -12,6 +12,7 @@ import { cn } from '../../../lib/utils';
12
12
  import { transCls } from '../../../const/ui';
13
13
  import { SolidArrowDownIcon, SearchIcon } from '../../bs-icons';
14
14
  import { useSelectPopoverPosition } from '../../../hooks/use-select-popover-position';
15
+ import { FontIcon } from '../../font-icon';
15
16
 
16
17
  const POPOVER_MAX_HEIGHT = 300;
17
18
 
@@ -172,14 +173,6 @@ function buildFormTree(items: FormSelectItem[], searchQuery: string): FormTreeIt
172
173
  return result;
173
174
  }
174
175
 
175
- // ── Form Icon ─────────────────────────────────────────────────────
176
-
177
- function getFormIconClass(icon: number): string {
178
- const isNew = icon >= 25;
179
- const newStr = isNew ? '-new' : '';
180
- return `node-icon icon-bsy-form${newStr} icon${newStr}-bsy-form-${icon}`;
181
- }
182
-
183
176
  // ── Entry Item ────────────────────────────────────────────────────
184
177
 
185
178
  function FormEntryItem({
@@ -204,10 +197,7 @@ function FormEntryItem({
204
197
  onClick={onClick}
205
198
  >
206
199
  <span className="flex items-center gap-[6px] min-w-0 flex-1">
207
- <i
208
- className={getFormIconClass(item.icon)}
209
- style={{ fontSize: 16, lineHeight: 1 }}
210
- />
200
+ <FontIcon name={item.icon} />
211
201
  <span className="text-[14px] leading-[normal] truncate">
212
202
  {item.name}
213
203
  </span>
@@ -658,10 +648,7 @@ export const FormSelect = forwardRef<HTMLDivElement, FormSelectProps>(
658
648
  className="flex items-center gap-[4px] bg-[#EEEEEE] rounded-[2px] h-[26px] px-[6px] shrink-0 max-w-[160px]"
659
649
  onClick={(e) => handleRemoveChip(form.id, e)}
660
650
  >
661
- <i
662
- className={getFormIconClass(form.icon ?? 0)}
663
- style={{ fontSize: 14, lineHeight: 1 }}
664
- />
651
+ <FontIcon name={form.icon ?? 0} style={{ fontSize: 14 }} />
665
652
  <span className="text-[14px] text-[#030303] truncate leading-[normal]">
666
653
  {form.name}
667
654
  </span>
@@ -683,10 +670,7 @@ export const FormSelect = forwardRef<HTMLDivElement, FormSelectProps>(
683
670
  <span className="flex items-center gap-[6px] min-w-0 flex-1">
684
671
  {selectedForm ? (
685
672
  <>
686
- <i
687
- className={getFormIconClass(selectedForm.icon ?? 0)}
688
- style={{ fontSize: 16, lineHeight: 1 }}
689
- />
673
+ <FontIcon name={selectedForm.icon ?? 0} />
690
674
  <span className="text-[14px] text-[#030303] leading-[normal] truncate">
691
675
  {selectedForm.name}
692
676
  </span>
@@ -9,7 +9,7 @@ export const BotAvatarAndName = ({
9
9
  icon?: React.ReactNode | string;
10
10
  variant?: 'default' | 'active';
11
11
  }) => {
12
- const size = variant === 'default' ? 20 : 24;
12
+ const size = variant === 'default' ? 16 : 24;
13
13
 
14
14
  if (!name) {
15
15
  return null;
@@ -16,12 +16,6 @@ export function getDepthPadding(depth: number): string {
16
16
  return DEPTH_PADDING[Math.min(depth, 5)] ?? DEPTH_PADDING[5];
17
17
  }
18
18
 
19
- export function getEntryIconClass(entry: IEntryDetail): string {
20
- const isNew = entry.icon >= 25;
21
- const newStr = isNew ? '-new' : '';
22
- return `node-icon icon-bsy-form${newStr} icon${newStr}-bsy-form-${entry.icon}`;
23
- }
24
-
25
19
  export function buildEntryTreeFromAliasMap(
26
20
  appDetail: IAppDetail,
27
21
  searchQuery: string
@@ -1,6 +1,7 @@
1
1
  import { cn } from '../../lib/utils';
2
2
  import { transCls } from '../../const/ui';
3
- import { getDepthPadding, getEntryIconClass } from './build-tree';
3
+ import { getDepthPadding } from './build-tree';
4
+ import { FontIcon } from '../font-icon';
4
5
  import type { EntryTreeItem } from './types';
5
6
 
6
7
  export function EntryItem({
@@ -26,16 +27,11 @@ export function EntryItem({
26
27
  onClick={onClick}
27
28
  >
28
29
  <span className="flex items-center gap-[6px] min-w-0 flex-1">
29
- <i
30
- className={
31
- item.iconClass
32
- ? item.iconClass
33
- : item.entry
34
- ? getEntryIconClass(item.entry)
35
- : 'node-icon icon-bsy-form icon-new-bsy-form-25'
36
- }
37
- style={{ fontSize: 16, lineHeight: 1 }}
38
- />
30
+ {item.iconClass ? (
31
+ <i className={item.iconClass} style={{ fontSize: 16, lineHeight: 1 }} />
32
+ ) : (
33
+ <FontIcon name={item.entry?.icon ?? 25} />
34
+ )}
39
35
  <span className="text-[14px] text-[#030303] truncate">
40
36
  {item.name}
41
37
  </span>
@@ -6,6 +6,7 @@ import { TreeItemNode } from './tree-item-node';
6
6
  import type { IAppDetail } from '@baishuyun/types';
7
7
  import type { BsEntrySelectChangeResult } from './types';
8
8
  import { SolidArrowDownIcon } from '../bs-icons';
9
+ import { FontIcon } from '../font-icon';
9
10
 
10
11
  const ChevronRightIcon = ({ size }: { size?: number }) => (
11
12
  <SolidArrowDownIcon className="-rotate-90" size={size} />
@@ -59,10 +60,7 @@ export function OtherAppSection({
59
60
  >
60
61
  <ChevronRightIcon size={18} />
61
62
  </span>
62
- <i
63
- className="node-icon icon-bsy-form icon-new-bsy-form-0"
64
- style={{ fontSize: 16, lineHeight: 1 }}
65
- />
63
+ <FontIcon name={0} />
66
64
  <span className="text-[14px] text-[#030303] truncate">
67
65
  {appDetail.name}
68
66
  </span>
@@ -11,9 +11,9 @@ import { cn } from '../../lib/utils';
11
11
  import { transCls } from '../../const/ui';
12
12
  import { IconBtn } from '../icon-btn';
13
13
  import { LeftArrowIcon, SolidArrowDownIcon, DividerIcon } from '../bs-icons';
14
+ import { FontIcon } from '../font-icon';
14
15
  import {
15
16
  buildEntryTreeFromAliasMap,
16
- getEntryIconClass,
17
17
  filterTreeBySearch,
18
18
  buildFlowCenterTree,
19
19
  } from './build-tree';
@@ -648,16 +648,11 @@ export function ScrollSlider({
648
648
  ),
649
649
  )}
650
650
  >
651
- <i
652
- className={
653
- node.iconClass
654
- ? node.iconClass
655
- : node.entry
656
- ? getEntryIconClass(node.entry)
657
- : 'node-icon icon-bsy-form icon-new-bsy-form-25'
658
- }
659
- style={{ fontSize: 16, lineHeight: 1 }}
660
- />
651
+ {node.iconClass ? (
652
+ <i className={node.iconClass} style={{ fontSize: 16, lineHeight: 1 }} />
653
+ ) : (
654
+ <FontIcon name={node.entry?.icon ?? 25} />
655
+ )}
661
656
  <span className="text-[14px] leading-[normal] truncate">
662
657
  {node.name}
663
658
  </span>