@baishuyun/ai-design 2.0.21 → 2.0.22

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,14 @@
1
1
  # @baishuyun/ai-design
2
2
 
3
+ ## 2.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - 标准动作完善
8
+ - Updated dependencies
9
+ - @baishuyun/ai-feat-utils@2.0.20
10
+ - @baishuyun/types@3.0.20
11
+
3
12
  ## 2.0.21
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baishuyun/ai-design",
3
- "version": "2.0.21",
3
+ "version": "2.0.22",
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.19",
64
- "@baishuyun/types": "3.0.19"
63
+ "@baishuyun/types": "3.0.20",
64
+ "@baishuyun/ai-feat-utils": "2.0.20"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "react": "^19.0.0",
@@ -83,9 +83,9 @@
83
83
  "typescript": "^5.5.0",
84
84
  "vite": "^5.1.4",
85
85
  "vite-plugin-dts": "^4.5.4",
86
- "@baishuyun/typescript-config": "2.0.9",
87
- "@baishuyun/types": "3.0.19",
88
- "@baishuyun/tailwind-config": "3.0.9"
86
+ "@baishuyun/types": "3.0.20",
87
+ "@baishuyun/tailwind-config": "3.0.9",
88
+ "@baishuyun/typescript-config": "2.0.9"
89
89
  },
90
90
  "keywords": [],
91
91
  "author": "",
@@ -71,6 +71,7 @@ export interface FormSelectProps {
71
71
  emptyLabel?: string;
72
72
  /** Max visible chips in the trigger in multiple mode (default 4). */
73
73
  maxVisibleChips?: number;
74
+ popoverOnly?: boolean;
74
75
  }
75
76
 
76
77
  // ── Tree types ────────────────────────────────────────────────────
@@ -376,6 +377,7 @@ export const FormSelect = forwardRef<HTMLDivElement, FormSelectProps>(
376
377
  allowEmpty = false,
377
378
  emptyLabel = '无',
378
379
  maxVisibleChips = 4,
380
+ popoverOnly,
379
381
  },
380
382
  ref,
381
383
  ) => {
@@ -613,6 +615,22 @@ export const FormSelect = forwardRef<HTMLDivElement, FormSelectProps>(
613
615
 
614
616
  const hasMultiSelection = multiple && selectedForms.length > 0;
615
617
 
618
+ if (popoverOnly) {
619
+ return (
620
+ <FormPopover
621
+ searchQuery={searchQuery}
622
+ onSearchChange={setSearchQuery}
623
+ tree={tree}
624
+ selectedIds={selectedIds}
625
+ onSelect={handleSelect}
626
+ hasSearch={hasSearch}
627
+ allowEmpty={allowEmpty && !multiple}
628
+ emptyLabel={emptyLabel}
629
+ onEmptySelect={handleEmptySelect}
630
+ />
631
+ );
632
+ }
633
+
616
634
  return (
617
635
  <div ref={ref} className={cn('relative inline-flex min-w-0 w-full', className)}>
618
636
  {/* Trigger */}
@@ -2,11 +2,13 @@ import { useMemo, useState, useCallback } from 'react';
2
2
  import { cn } from '../lib/utils';
3
3
  import { transCls } from '../const/ui';
4
4
  import { type AgentShortSummary as AgentSelectAgent } from '@baishuyun/types';
5
+ import classNames from 'classnames';
5
6
 
6
7
  export { type AgentSelectAgent };
7
8
 
8
9
  export interface AgentSelectProps {
9
10
  agents: Array<AgentSelectAgent>;
11
+ showAllItems?: boolean;
10
12
  showSearch?: boolean;
11
13
  activeAgent?: { id: string } | null;
12
14
  onSelect: (agent: AgentSelectAgent) => void | Promise<void>;
@@ -22,6 +24,7 @@ export const AgentSelect = ({
22
24
  showSearch = false,
23
25
  activeAgent,
24
26
  onSelect,
27
+ showAllItems,
25
28
  }: AgentSelectProps) => {
26
29
  const [searchQuery, setSearchQuery] = useState('');
27
30
 
@@ -48,6 +51,10 @@ export const AgentSelect = ({
48
51
  [onSelect]
49
52
  );
50
53
 
54
+ const overflowCls = classNames({
55
+ 'max-h-80 overflow-y-auto scrollbar-hide': !showAllItems
56
+ })
57
+
51
58
  return (
52
59
  <div className="flex flex-col">
53
60
  {showSearch && (
@@ -87,7 +94,7 @@ export const AgentSelect = ({
87
94
  </div>
88
95
  )}
89
96
 
90
- <div className="max-h-80 overflow-y-auto scrollbar-hide">
97
+ <div className={overflowCls}>
91
98
  {groups.map((group, groupIndex) => (
92
99
  <div key={group.label}>
93
100
  <div