flowcloudai-ui 0.1.1 → 0.1.2

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/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, ComponentType } from 'react';
3
+ import React__default, { ReactNode, ComponentType, MouseEvent, CSSProperties } from 'react';
4
4
 
5
5
  type Theme = 'light' | 'dark' | 'system';
6
6
  interface ThemeContextType {
@@ -18,11 +18,14 @@ declare function ThemeProvider({ children, defaultTheme, target }: Props): react
18
18
 
19
19
  type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'warning';
20
20
  type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
21
+ type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
21
22
  interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
22
23
  /** 按钮变体 */
23
24
  variant?: ButtonVariant;
24
25
  /** 尺寸 */
25
26
  size?: ButtonSize;
27
+ /** 圆角大小,不传则跟随 size 默认值 */
28
+ radius?: ButtonRadius;
26
29
  /** 是否禁用 */
27
30
  disabled?: boolean;
28
31
  /** 加载状态 */
@@ -54,7 +57,7 @@ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
54
57
  /** hover 边框色 */
55
58
  hoverBorderColor?: string;
56
59
  }
57
- declare function Button({ variant, size, disabled, loading, block, circle, iconOnly, iconLeft, iconRight, background, hoverBackground, activeBackground, color, hoverColor, activeColor, borderColor, hoverBorderColor, className, style, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
60
+ declare function Button({ variant, size, radius, disabled, loading, block, circle, iconOnly, iconLeft, iconRight, background, hoverBackground, activeBackground, color, hoverColor, activeColor, borderColor, hoverBorderColor, className, style, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
58
61
  interface ButtonGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
59
62
  children: React$1.ReactNode;
60
63
  }
@@ -65,10 +68,13 @@ interface ButtonToolbarProps extends React$1.HTMLAttributes<HTMLDivElement> {
65
68
  }
66
69
  declare function ButtonToolbar({ children, align, className, ...props }: ButtonToolbarProps): react_jsx_runtime.JSX.Element;
67
70
 
71
+ type CheckButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
68
72
  interface CheckButtonBase {
69
73
  onChange?: (checked: boolean) => void;
70
74
  disabled?: boolean;
71
75
  size?: 'sm' | 'md' | 'lg';
76
+ /** 轨道圆角,默认 full(胶囊形) */
77
+ radius?: CheckButtonRadius;
72
78
  labelLeft?: string;
73
79
  labelRight?: string;
74
80
  className?: string;
@@ -93,7 +99,7 @@ interface UncontrolledCheckButton extends CheckButtonBase {
93
99
  defaultChecked?: boolean;
94
100
  }
95
101
  type CheckButtonProps = ControlledCheckButton | UncontrolledCheckButton;
96
- declare function CheckButton({ checked: controlledChecked, defaultChecked, onChange, disabled, size, labelLeft, labelRight, trackBackground, checkedTrackBackground, thumbBackground, thumbDotColor, labelColor, className, style, }: CheckButtonProps): react_jsx_runtime.JSX.Element;
102
+ declare function CheckButton({ checked: controlledChecked, defaultChecked, onChange, disabled, size, radius, labelLeft, labelRight, trackBackground, checkedTrackBackground, thumbBackground, thumbDotColor, labelColor, className, style, }: CheckButtonProps): react_jsx_runtime.JSX.Element;
97
103
 
98
104
  type ShowThumb = 'auto' | 'hide' | 'show';
99
105
  type ThumbSize = 'thin' | 'normal' | 'thick';
@@ -136,6 +142,8 @@ interface SideBarItem {
136
142
  interface SideBarProps {
137
143
  /** 菜单项列表(受控) */
138
144
  items: SideBarItem[];
145
+ /** 底部固定菜单项(如设置、退出),始终显示在侧边栏底部 */
146
+ bottomItems?: SideBarItem[];
139
147
  /** 当前选中的 key(受控) */
140
148
  selectedKey: string;
141
149
  /** 是否折叠(受控) */
@@ -164,9 +172,12 @@ declare const SideBar: React__default.NamedExoticComponent<SideBarProps>;
164
172
 
165
173
  type InputSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
166
174
  type InputStatus = 'default' | 'error' | 'warning' | 'success';
167
- interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
175
+ type InputRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
176
+ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'onChange'> {
168
177
  size?: InputSize;
169
178
  status?: InputStatus;
179
+ /** 圆角大小,不传则使用默认值 md */
180
+ radius?: InputRadius;
170
181
  prefix?: React$1.ReactNode;
171
182
  suffix?: React$1.ReactNode;
172
183
  allowClear?: boolean;
@@ -174,6 +185,7 @@ interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>,
174
185
  addonBefore?: React$1.ReactNode;
175
186
  addonAfter?: React$1.ReactNode;
176
187
  helperText?: string;
188
+ onChange?: (value: string) => void;
177
189
  onClear?: () => void;
178
190
  }
179
191
  declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
@@ -211,15 +223,18 @@ interface SelectOption {
211
223
  disabled?: boolean;
212
224
  group?: string;
213
225
  }
226
+ type SelectRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
214
227
  interface SelectProps {
215
228
  options: SelectOption[];
216
229
  value?: string | number | (string | number)[];
217
230
  defaultValue?: string | number | (string | number)[];
218
- onChange?: (value: any) => void;
231
+ onChange?: (value: string | number | (string | number)[]) => void;
219
232
  placeholder?: string;
220
233
  searchable?: boolean;
221
234
  multiple?: boolean;
222
235
  disabled?: boolean;
236
+ /** 圆角大小,触发器和下拉框同步改变 */
237
+ radius?: SelectRadius;
223
238
  className?: string;
224
239
  style?: React$1.CSSProperties;
225
240
  virtualScroll?: boolean;
@@ -236,7 +251,7 @@ interface SelectProps {
236
251
  /** hover / 键盘高亮背景色 */
237
252
  hoverBackground?: string;
238
253
  }
239
- declare function Select({ options, value: controlledValue, defaultValue, onChange, placeholder, searchable, multiple, disabled, className, style, virtualScroll, virtualItemHeight, maxHeight, triggerBackground, triggerBorderColor, selectedColor, selectedBackground, hoverBackground, }: SelectProps): react_jsx_runtime.JSX.Element;
254
+ declare function Select({ options, value: controlledValue, defaultValue, onChange, placeholder, searchable, multiple, disabled, radius, className, style, virtualScroll, virtualItemHeight, maxHeight, triggerBackground, triggerBorderColor, selectedColor, selectedBackground, hoverBackground, }: SelectProps): react_jsx_runtime.JSX.Element;
240
255
 
241
256
  interface FlatCategory {
242
257
  id: string;
@@ -301,24 +316,17 @@ interface OrphanDialogProps {
301
316
  }
302
317
  declare function OrphanDialog({ orphans, onResolve, onClose }: OrphanDialogProps): react_jsx_runtime.JSX.Element | null;
303
318
 
304
- type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
305
319
  type AvatarShape = 'circle' | 'square';
306
- type AvatarLoadState = 'idle' | 'loading' | 'loaded' | 'error';
307
- type AvatarColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
308
320
  interface AvatarProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onError'> {
309
- children?: React__default.ReactNode;
310
321
  src?: string;
311
322
  fallbackSrc?: string;
312
- color?: string;
313
- colorVariant?: AvatarColorVariant;
314
- size?: AvatarSize;
323
+ size?: number | string;
315
324
  shape?: AvatarShape;
316
325
  alt?: string;
317
326
  lazyLoad?: boolean;
318
327
  onImageLoad?: () => void;
319
328
  onImageError?: (error?: Event) => void;
320
329
  bordered?: boolean;
321
- onStateChange?: (state: AvatarLoadState) => void;
322
330
  }
323
331
  declare const Avatar: React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLDivElement>>;
324
332
 
@@ -446,6 +454,18 @@ interface TabBarProps {
446
454
  addable?: boolean;
447
455
  /** 是否启用拖拽排序 */
448
456
  draggable?: boolean;
457
+ /**
458
+ * Tab 最小宽度比例(相对 window.innerWidth)。
459
+ * 当均分后每个 Tab 宽度 < window.innerWidth * minWidthRatio 时,切换为横向滚动模式。
460
+ * @default 0.07
461
+ */
462
+ minWidthRatio?: number;
463
+ /**
464
+ * Tab 最大宽度比例(相对 window.innerWidth)。
465
+ * 在固定模式下,单个 Tab 的宽度不会超过此值,防止子项很少时占满过多空间。
466
+ * @default 0.15
467
+ */
468
+ maxTabWidthRatio?: number;
449
469
  onChange: (activeKey: string) => void;
450
470
  onClose?: (key: string) => void;
451
471
  onAdd?: () => void;
@@ -508,11 +528,18 @@ interface MarkdownEditorProps {
508
528
  onAiComplete?: () => void;
509
529
  minHeight?: number;
510
530
  placeholder?: string;
531
+ /**
532
+ * 显示模式
533
+ * - edit: 编辑模式(工具栏含双栏切换按钮)
534
+ * - preview: 纯预览,只读渲染 Markdown,隐藏工具栏
535
+ * @default 'edit'
536
+ */
537
+ mode?: 'edit' | 'preview';
511
538
  background?: string;
512
539
  toolbarBackground?: string;
513
540
  borderColor?: string;
514
541
  }
515
- declare function MarkdownEditor({ value, onChange, onAiComplete, minHeight, placeholder, background, toolbarBackground, borderColor, }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
542
+ declare function MarkdownEditor({ value, onChange, onAiComplete, minHeight, placeholder, mode, background, toolbarBackground, borderColor, }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
516
543
 
517
544
  type ContextMenuDivider = {
518
545
  type: "divider";
@@ -599,4 +626,51 @@ interface ChatProps {
599
626
  }
600
627
  declare const Chat: React__default.FC<ChatProps>;
601
628
 
602
- export { type AlertMode, type AlertProps, AlertProvider, type AlertProviderProps, type AlertType, Avatar, type AvatarColorVariant, type AvatarLoadState, type AvatarProps, type AvatarShape, type AvatarSize, Button, ButtonGroup, ButtonToolbar, Card, type CardProps, type CategoryTreeNode, Chat, type ChatProps, CheckButton, type ContextMenuAction, type ContextMenuDivider, type ContextMenuItem, ContextMenuProvider, type ContextMenuProviderProps, type Conversation, DeleteDialog, type DeleteMode, type DropPosition, type FlatCategory, type FlatToTreeResult, Input, ListGroup, ListGroupItem, type ListGroupItemProps, type ListGroupProps, MarkdownEditor, type MarkdownEditorProps, type Message, type MessageRole, OrphanDialog, type OrphanResolution, type OrphanResolutionMap, RollingBox, Select, SideBar, type SideBarItem, type SideBarProps, Slider, SmartMessage, type SmartMessageProps, TabBar, type TabBarProps, type TabItem, TagItem, type TagItemProps, type TagSchema, type TagValue, type Theme, ThemeProvider, Tree, type TreeProps, VirtualList, findNodeInfo, flatToTree, isDescendantOf, lazyLoad, useAlert, useContextMenu, useTheme };
629
+ interface RelationNodeData {
630
+ iconType?: 'war' | 'target' | 'star' | 'award' | 'flag' | 'default' | 'user' | 'shield';
631
+ title: string;
632
+ subtitle: string;
633
+ description?: string;
634
+ imageUrl?: string;
635
+ status?: 'active' | 'inactive' | 'warning';
636
+ metadata?: Record<string, any>;
637
+ }
638
+ interface RelationEdgeData {
639
+ label?: string;
640
+ type?: 'solid' | 'dashed' | 'dotted';
641
+ color?: string;
642
+ animated?: boolean;
643
+ metadata?: Record<string, any>;
644
+ }
645
+ interface RelationProps {
646
+ nodes?: any[];
647
+ edges?: any[];
648
+ onNodeClick?: (nodeId: string, nodeData: RelationNodeData, event?: MouseEvent) => void;
649
+ onNodeDoubleClick?: (nodeId: string, nodeData: RelationNodeData) => void;
650
+ onEdgeClick?: (edgeId: string, edgeData?: RelationEdgeData) => void;
651
+ onConnect?: (connection: any) => void;
652
+ onNodesChange?: (nodes: any[]) => void;
653
+ onEdgesChange?: (edges: any[]) => void;
654
+ fitView?: boolean;
655
+ fitViewOptions?: any;
656
+ className?: string;
657
+ style?: CSSProperties;
658
+ height?: string | number;
659
+ width?: string | number;
660
+ defaultViewport?: {
661
+ x: number;
662
+ y: number;
663
+ zoom: number;
664
+ };
665
+ minZoom?: number;
666
+ maxZoom?: number;
667
+ snapToGrid?: boolean;
668
+ snapGrid?: [number, number];
669
+ enableEdgeCreation?: boolean;
670
+ enableNodeDrag?: boolean;
671
+ onNodeContextMenu?: (nodeId: string, nodeData: RelationNodeData) => void;
672
+ theme?: 'dark' | 'light';
673
+ }
674
+ declare const Relation: React.FC<RelationProps>;
675
+
676
+ export { type AlertMode, type AlertProps, AlertProvider, type AlertProviderProps, type AlertType, Avatar, type AvatarProps, type AvatarShape, Button, ButtonGroup, ButtonToolbar, Card, type CardProps, type CategoryTreeNode, Chat, type ChatProps, CheckButton, type ContextMenuAction, type ContextMenuDivider, type ContextMenuItem, ContextMenuProvider, type ContextMenuProviderProps, type Conversation, DeleteDialog, type DeleteMode, type DropPosition, type FlatCategory, type FlatToTreeResult, Input, ListGroup, ListGroupItem, type ListGroupItemProps, type ListGroupProps, MarkdownEditor, type MarkdownEditorProps, type Message, type MessageRole, OrphanDialog, type OrphanResolution, type OrphanResolutionMap, Relation, type RelationEdgeData, type RelationNodeData, type RelationProps, RollingBox, Select, SideBar, type SideBarItem, type SideBarProps, Slider, SmartMessage, type SmartMessageProps, TabBar, type TabBarProps, type TabItem, TagItem, type TagItemProps, type TagSchema, type TagValue, type Theme, ThemeProvider, Tree, type TreeProps, VirtualList, findNodeInfo, flatToTree, isDescendantOf, lazyLoad, useAlert, useContextMenu, useTheme };