flowcloudai-ui 0.1.1 → 0.1.3
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.css +378 -483
- package/dist/index.d.ts +96 -16
- package/dist/index.js +830 -340
- package/package.json +41 -42
- package/dist/index.cjs +0 -2837
- package/dist/index.d.cts +0 -602
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
|
-
|
|
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:
|
|
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
|
-
|
|
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;
|
|
@@ -478,6 +498,12 @@ interface TabBarProps {
|
|
|
478
498
|
tabActiveBackground?: string;
|
|
479
499
|
/** 激活态指示器颜色(attached 模式底线 / floating 模式无效) */
|
|
480
500
|
activeIndicatorColor?: string;
|
|
501
|
+
/**
|
|
502
|
+
* 将 TabBar 空白区域标记为 Tauri 窗口拖拽区域。
|
|
503
|
+
* 开启后,标签之外的空白处可拖动窗口;标签、关闭、添加按钮已内置 no-drag 保护。
|
|
504
|
+
* @default false
|
|
505
|
+
*/
|
|
506
|
+
tauriDragRegion?: boolean;
|
|
481
507
|
}
|
|
482
508
|
declare const TabBar: React__default.NamedExoticComponent<TabBarProps>;
|
|
483
509
|
|
|
@@ -508,11 +534,18 @@ interface MarkdownEditorProps {
|
|
|
508
534
|
onAiComplete?: () => void;
|
|
509
535
|
minHeight?: number;
|
|
510
536
|
placeholder?: string;
|
|
537
|
+
/**
|
|
538
|
+
* 显示模式
|
|
539
|
+
* - edit: 编辑模式(工具栏含双栏切换按钮)
|
|
540
|
+
* - preview: 纯预览,只读渲染 Markdown,隐藏工具栏
|
|
541
|
+
* @default 'edit'
|
|
542
|
+
*/
|
|
543
|
+
mode?: 'edit' | 'preview';
|
|
511
544
|
background?: string;
|
|
512
545
|
toolbarBackground?: string;
|
|
513
546
|
borderColor?: string;
|
|
514
547
|
}
|
|
515
|
-
declare function MarkdownEditor({ value, onChange, onAiComplete, minHeight, placeholder, background, toolbarBackground, borderColor, }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
|
|
548
|
+
declare function MarkdownEditor({ value, onChange, onAiComplete, minHeight, placeholder, mode, background, toolbarBackground, borderColor, }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
|
|
516
549
|
|
|
517
550
|
type ContextMenuDivider = {
|
|
518
551
|
type: "divider";
|
|
@@ -599,4 +632,51 @@ interface ChatProps {
|
|
|
599
632
|
}
|
|
600
633
|
declare const Chat: React__default.FC<ChatProps>;
|
|
601
634
|
|
|
602
|
-
|
|
635
|
+
interface RelationNodeData {
|
|
636
|
+
iconType?: 'war' | 'target' | 'star' | 'award' | 'flag' | 'default' | 'user' | 'shield';
|
|
637
|
+
title: string;
|
|
638
|
+
subtitle: string;
|
|
639
|
+
description?: string;
|
|
640
|
+
imageUrl?: string;
|
|
641
|
+
status?: 'active' | 'inactive' | 'warning';
|
|
642
|
+
metadata?: Record<string, any>;
|
|
643
|
+
}
|
|
644
|
+
interface RelationEdgeData {
|
|
645
|
+
label?: string;
|
|
646
|
+
type?: 'solid' | 'dashed' | 'dotted';
|
|
647
|
+
color?: string;
|
|
648
|
+
animated?: boolean;
|
|
649
|
+
metadata?: Record<string, any>;
|
|
650
|
+
}
|
|
651
|
+
interface RelationProps {
|
|
652
|
+
nodes?: any[];
|
|
653
|
+
edges?: any[];
|
|
654
|
+
onNodeClick?: (nodeId: string, nodeData: RelationNodeData, event?: MouseEvent) => void;
|
|
655
|
+
onNodeDoubleClick?: (nodeId: string, nodeData: RelationNodeData) => void;
|
|
656
|
+
onEdgeClick?: (edgeId: string, edgeData?: RelationEdgeData) => void;
|
|
657
|
+
onConnect?: (connection: any) => void;
|
|
658
|
+
onNodesChange?: (nodes: any[]) => void;
|
|
659
|
+
onEdgesChange?: (edges: any[]) => void;
|
|
660
|
+
fitView?: boolean;
|
|
661
|
+
fitViewOptions?: any;
|
|
662
|
+
className?: string;
|
|
663
|
+
style?: CSSProperties;
|
|
664
|
+
height?: string | number;
|
|
665
|
+
width?: string | number;
|
|
666
|
+
defaultViewport?: {
|
|
667
|
+
x: number;
|
|
668
|
+
y: number;
|
|
669
|
+
zoom: number;
|
|
670
|
+
};
|
|
671
|
+
minZoom?: number;
|
|
672
|
+
maxZoom?: number;
|
|
673
|
+
snapToGrid?: boolean;
|
|
674
|
+
snapGrid?: [number, number];
|
|
675
|
+
enableEdgeCreation?: boolean;
|
|
676
|
+
enableNodeDrag?: boolean;
|
|
677
|
+
onNodeContextMenu?: (nodeId: string, nodeData: RelationNodeData) => void;
|
|
678
|
+
theme?: 'dark' | 'light';
|
|
679
|
+
}
|
|
680
|
+
declare const Relation: React.FC<RelationProps>;
|
|
681
|
+
|
|
682
|
+
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 };
|