flowcloudai-ui 0.1.0 → 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.css +1325 -587
- package/dist/index.d.ts +365 -79
- package/dist/index.js +1647 -629
- package/package.json +41 -41
- package/dist/index.cjs +0 -2302
- package/dist/index.d.cts +0 -390
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import React__default, { ReactNode, ComponentType } from 'react';
|
|
2
|
+
import * as React$1 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
|
-
|
|
21
|
+
type ButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
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
|
/** 加载状态 */
|
|
@@ -34,29 +37,58 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
34
37
|
/** 仅图标模式 */
|
|
35
38
|
iconOnly?: boolean;
|
|
36
39
|
/** 左侧图标 */
|
|
37
|
-
iconLeft?: React.ReactNode;
|
|
40
|
+
iconLeft?: React$1.ReactNode;
|
|
38
41
|
/** 右侧图标 */
|
|
39
|
-
iconRight?: React.ReactNode;
|
|
42
|
+
iconRight?: React$1.ReactNode;
|
|
43
|
+
/** 默认背景色 */
|
|
44
|
+
background?: string;
|
|
45
|
+
/** hover 背景色 */
|
|
46
|
+
hoverBackground?: string;
|
|
47
|
+
/** active 背景色 */
|
|
48
|
+
activeBackground?: string;
|
|
49
|
+
/** 默认文字色 */
|
|
50
|
+
color?: string;
|
|
51
|
+
/** hover 文字色 */
|
|
52
|
+
hoverColor?: string;
|
|
53
|
+
/** active 文字色 */
|
|
54
|
+
activeColor?: string;
|
|
55
|
+
/** 默认边框色 */
|
|
56
|
+
borderColor?: string;
|
|
57
|
+
/** hover 边框色 */
|
|
58
|
+
hoverBorderColor?: string;
|
|
40
59
|
}
|
|
41
|
-
declare function Button({ variant, size, disabled, loading, block, circle, iconOnly, iconLeft, iconRight, className, children, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
42
|
-
interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
43
|
-
children: React.ReactNode;
|
|
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;
|
|
61
|
+
interface ButtonGroupProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
62
|
+
children: React$1.ReactNode;
|
|
44
63
|
}
|
|
45
64
|
declare function ButtonGroup({ children, className, ...props }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
|
|
46
|
-
interface ButtonToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
47
|
-
children: React.ReactNode;
|
|
65
|
+
interface ButtonToolbarProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
66
|
+
children: React$1.ReactNode;
|
|
48
67
|
align?: 'left' | 'center' | 'right' | 'between';
|
|
49
68
|
}
|
|
50
69
|
declare function ButtonToolbar({ children, align, className, ...props }: ButtonToolbarProps): react_jsx_runtime.JSX.Element;
|
|
51
70
|
|
|
71
|
+
type CheckButtonRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
52
72
|
interface CheckButtonBase {
|
|
53
73
|
onChange?: (checked: boolean) => void;
|
|
54
74
|
disabled?: boolean;
|
|
55
75
|
size?: 'sm' | 'md' | 'lg';
|
|
76
|
+
/** 轨道圆角,默认 full(胶囊形) */
|
|
77
|
+
radius?: CheckButtonRadius;
|
|
56
78
|
labelLeft?: string;
|
|
57
79
|
labelRight?: string;
|
|
58
80
|
className?: string;
|
|
59
|
-
style?: React.CSSProperties;
|
|
81
|
+
style?: React$1.CSSProperties;
|
|
82
|
+
/** 未选中时轨道背景色 */
|
|
83
|
+
trackBackground?: string;
|
|
84
|
+
/** 选中时轨道背景色 */
|
|
85
|
+
checkedTrackBackground?: string;
|
|
86
|
+
/** 滑块背景色 */
|
|
87
|
+
thumbBackground?: string;
|
|
88
|
+
/** 滑块内部装饰色(选中时) */
|
|
89
|
+
thumbDotColor?: string;
|
|
90
|
+
/** 标签文字色 */
|
|
91
|
+
labelColor?: string;
|
|
60
92
|
}
|
|
61
93
|
interface ControlledCheckButton extends CheckButtonBase {
|
|
62
94
|
checked: boolean;
|
|
@@ -67,11 +99,11 @@ interface UncontrolledCheckButton extends CheckButtonBase {
|
|
|
67
99
|
defaultChecked?: boolean;
|
|
68
100
|
}
|
|
69
101
|
type CheckButtonProps = ControlledCheckButton | UncontrolledCheckButton;
|
|
70
|
-
declare function CheckButton({ checked: controlledChecked, defaultChecked, onChange, disabled, size, labelLeft, labelRight, 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;
|
|
71
103
|
|
|
72
104
|
type ShowThumb = 'auto' | 'hide' | 'show';
|
|
73
105
|
type ThumbSize = 'thin' | 'normal' | 'thick';
|
|
74
|
-
interface RollingBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
106
|
+
interface RollingBoxProps extends React$1.HTMLAttributes<HTMLDivElement> {
|
|
75
107
|
/** 滚动条显示模式 */
|
|
76
108
|
showThumb?: ShowThumb;
|
|
77
109
|
/** 水平滚动 */
|
|
@@ -83,50 +115,80 @@ interface RollingBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
83
115
|
/** 是否显示滚动轨道 */
|
|
84
116
|
showTrack?: boolean;
|
|
85
117
|
/** 内容 */
|
|
86
|
-
children: React.ReactNode;
|
|
118
|
+
children: React$1.ReactNode;
|
|
119
|
+
/** 滚动条颜色(show 模式下生效) */
|
|
120
|
+
thumbColor?: string;
|
|
121
|
+
/** hover 时滚动条颜色(auto 模式下生效) */
|
|
122
|
+
thumbHoverColor?: string;
|
|
123
|
+
/** 滚动中滚动条颜色(auto 模式下生效) */
|
|
124
|
+
thumbActiveColor?: string;
|
|
125
|
+
/** 轨道背景色(showTrack=true 时生效) */
|
|
126
|
+
trackColor?: string;
|
|
87
127
|
}
|
|
88
|
-
declare function RollingBox({ showThumb, horizontal, vertical, thumbSize, showTrack, children, className, ...props }: RollingBoxProps): react_jsx_runtime.JSX.Element;
|
|
128
|
+
declare function RollingBox({ showThumb, horizontal, vertical, thumbSize, showTrack, children, className, thumbColor, thumbHoverColor, thumbActiveColor, trackColor, style, ...props }: RollingBoxProps): react_jsx_runtime.JSX.Element;
|
|
89
129
|
|
|
90
|
-
interface
|
|
130
|
+
interface SideBarItem {
|
|
131
|
+
/** 唯一标识 */
|
|
91
132
|
key: string;
|
|
133
|
+
/** 显示文字(非折叠时显示,折叠时隐藏) */
|
|
92
134
|
label: string;
|
|
93
|
-
|
|
94
|
-
|
|
135
|
+
/** 图标,推荐传入 SVG 元素或 ReactNode */
|
|
136
|
+
icon?: React__default.ReactNode;
|
|
137
|
+
/** 是否禁用 */
|
|
95
138
|
disabled?: boolean;
|
|
139
|
+
/** 链接地址,有值时渲染为 <a> */
|
|
96
140
|
href?: string;
|
|
97
141
|
}
|
|
98
142
|
interface SideBarProps {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
collapsed
|
|
107
|
-
|
|
108
|
-
onCollapse?: (collapsed: boolean) => void;
|
|
109
|
-
className?: string;
|
|
143
|
+
/** 菜单项列表(受控) */
|
|
144
|
+
items: SideBarItem[];
|
|
145
|
+
/** 底部固定菜单项(如设置、退出),始终显示在侧边栏底部 */
|
|
146
|
+
bottomItems?: SideBarItem[];
|
|
147
|
+
/** 当前选中的 key(受控) */
|
|
148
|
+
selectedKey: string;
|
|
149
|
+
/** 是否折叠(受控) */
|
|
150
|
+
collapsed: boolean;
|
|
151
|
+
/** 展开时宽度,默认 240 */
|
|
110
152
|
width?: number;
|
|
153
|
+
/** 折叠时宽度,默认 64 */
|
|
111
154
|
collapsedWidth?: number;
|
|
155
|
+
/** 选中项变更 */
|
|
156
|
+
onSelect: (key: string) => void;
|
|
157
|
+
/** 折叠状态变更 */
|
|
158
|
+
onCollapse: (collapsed: boolean) => void;
|
|
159
|
+
/**
|
|
160
|
+
* 可覆盖的 CSS Variables(在 style 中设置):
|
|
161
|
+
* --sidebar-item-color 默认文字色
|
|
162
|
+
* --sidebar-item-bg 默认背景色
|
|
163
|
+
* --sidebar-item-hover-color hover 文字色
|
|
164
|
+
* --sidebar-item-hover-bg hover 背景色
|
|
165
|
+
* --sidebar-item-selected-color 选中文字色
|
|
166
|
+
* --sidebar-item-selected-bg 选中背景色
|
|
167
|
+
*/
|
|
168
|
+
className?: string;
|
|
169
|
+
style?: React__default.CSSProperties;
|
|
112
170
|
}
|
|
113
|
-
declare
|
|
171
|
+
declare const SideBar: React__default.NamedExoticComponent<SideBarProps>;
|
|
114
172
|
|
|
115
173
|
type InputSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
116
174
|
type InputStatus = 'default' | 'error' | 'warning' | 'success';
|
|
117
|
-
|
|
175
|
+
type InputRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
176
|
+
interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'onChange'> {
|
|
118
177
|
size?: InputSize;
|
|
119
178
|
status?: InputStatus;
|
|
120
|
-
|
|
121
|
-
|
|
179
|
+
/** 圆角大小,不传则使用默认值 md */
|
|
180
|
+
radius?: InputRadius;
|
|
181
|
+
prefix?: React$1.ReactNode;
|
|
182
|
+
suffix?: React$1.ReactNode;
|
|
122
183
|
allowClear?: boolean;
|
|
123
184
|
passwordToggle?: boolean;
|
|
124
|
-
addonBefore?: React.ReactNode;
|
|
125
|
-
addonAfter?: React.ReactNode;
|
|
185
|
+
addonBefore?: React$1.ReactNode;
|
|
186
|
+
addonAfter?: React$1.ReactNode;
|
|
126
187
|
helperText?: string;
|
|
188
|
+
onChange?: (value: string) => void;
|
|
127
189
|
onClear?: () => void;
|
|
128
190
|
}
|
|
129
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
191
|
+
declare const Input: React$1.ForwardRefExoticComponent<InputProps & React$1.RefAttributes<HTMLInputElement>>;
|
|
130
192
|
|
|
131
193
|
type SliderValue = number | [number, number];
|
|
132
194
|
type SliderOrientation = 'horizontal' | 'vertical';
|
|
@@ -143,8 +205,17 @@ interface SliderProps {
|
|
|
143
205
|
marks?: Record<number, string>;
|
|
144
206
|
tooltip?: boolean;
|
|
145
207
|
className?: string;
|
|
208
|
+
style?: React$1.CSSProperties;
|
|
209
|
+
trackBackground?: string;
|
|
210
|
+
fillBackground?: string;
|
|
211
|
+
thumbBackground?: string;
|
|
212
|
+
thumbBorderColor?: string;
|
|
213
|
+
markDotColor?: string;
|
|
214
|
+
markLabelColor?: string;
|
|
215
|
+
tooltipBackground?: string;
|
|
216
|
+
tooltipColor?: string;
|
|
146
217
|
}
|
|
147
|
-
declare function Slider({ value: controlledValue, defaultValue, onChange, min, max, step, range, orientation, disabled, marks, tooltip, className, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function Slider({ value: controlledValue, defaultValue, onChange, min, max, step, range, orientation, disabled, marks, tooltip, className, style, trackBackground, fillBackground, thumbBackground, thumbBorderColor, markDotColor, markLabelColor, tooltipBackground, tooltipColor, }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
148
219
|
|
|
149
220
|
interface SelectOption {
|
|
150
221
|
value: string | number;
|
|
@@ -152,21 +223,35 @@ interface SelectOption {
|
|
|
152
223
|
disabled?: boolean;
|
|
153
224
|
group?: string;
|
|
154
225
|
}
|
|
226
|
+
type SelectRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
155
227
|
interface SelectProps {
|
|
156
228
|
options: SelectOption[];
|
|
157
229
|
value?: string | number | (string | number)[];
|
|
158
230
|
defaultValue?: string | number | (string | number)[];
|
|
159
|
-
onChange?: (value:
|
|
231
|
+
onChange?: (value: string | number | (string | number)[]) => void;
|
|
160
232
|
placeholder?: string;
|
|
161
233
|
searchable?: boolean;
|
|
162
234
|
multiple?: boolean;
|
|
163
235
|
disabled?: boolean;
|
|
236
|
+
/** 圆角大小,触发器和下拉框同步改变 */
|
|
237
|
+
radius?: SelectRadius;
|
|
164
238
|
className?: string;
|
|
239
|
+
style?: React$1.CSSProperties;
|
|
165
240
|
virtualScroll?: boolean;
|
|
166
241
|
virtualItemHeight?: number;
|
|
167
242
|
maxHeight?: number;
|
|
243
|
+
/** 触发器背景色 */
|
|
244
|
+
triggerBackground?: string;
|
|
245
|
+
/** 触发器边框色 */
|
|
246
|
+
triggerBorderColor?: string;
|
|
247
|
+
/** 已选项文字色 */
|
|
248
|
+
selectedColor?: string;
|
|
249
|
+
/** 已选项背景色 */
|
|
250
|
+
selectedBackground?: string;
|
|
251
|
+
/** hover / 键盘高亮背景色 */
|
|
252
|
+
hoverBackground?: string;
|
|
168
253
|
}
|
|
169
|
-
declare function Select({ options, value: controlledValue, defaultValue, onChange, placeholder, searchable, multiple, disabled, className, virtualScroll, virtualItemHeight, maxHeight }: 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;
|
|
170
255
|
|
|
171
256
|
interface FlatCategory {
|
|
172
257
|
id: string;
|
|
@@ -231,38 +316,31 @@ interface OrphanDialogProps {
|
|
|
231
316
|
}
|
|
232
317
|
declare function OrphanDialog({ orphans, onResolve, onClose }: OrphanDialogProps): react_jsx_runtime.JSX.Element | null;
|
|
233
318
|
|
|
234
|
-
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
235
319
|
type AvatarShape = 'circle' | 'square';
|
|
236
|
-
type AvatarLoadState = 'idle' | 'loading' | 'loaded' | 'error';
|
|
237
|
-
type AvatarColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
238
320
|
interface AvatarProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onError'> {
|
|
239
|
-
children?: React__default.ReactNode;
|
|
240
321
|
src?: string;
|
|
241
322
|
fallbackSrc?: string;
|
|
242
|
-
|
|
243
|
-
colorVariant?: AvatarColorVariant;
|
|
244
|
-
size?: AvatarSize;
|
|
323
|
+
size?: number | string;
|
|
245
324
|
shape?: AvatarShape;
|
|
246
325
|
alt?: string;
|
|
247
326
|
lazyLoad?: boolean;
|
|
248
327
|
onImageLoad?: () => void;
|
|
249
328
|
onImageError?: (error?: Event) => void;
|
|
250
329
|
bordered?: boolean;
|
|
251
|
-
onStateChange?: (state: AvatarLoadState) => void;
|
|
252
330
|
}
|
|
253
331
|
declare const Avatar: React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
254
332
|
|
|
255
|
-
interface ListGroupItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
333
|
+
interface ListGroupItemProps extends React$1.LiHTMLAttributes<HTMLLIElement> {
|
|
256
334
|
active?: boolean;
|
|
257
335
|
disabled?: boolean;
|
|
258
|
-
onClick?: (event: React.MouseEvent<HTMLLIElement>) => void;
|
|
336
|
+
onClick?: (event: React$1.MouseEvent<HTMLLIElement>) => void;
|
|
259
337
|
}
|
|
260
|
-
interface ListGroupProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
338
|
+
interface ListGroupProps extends React$1.HTMLAttributes<HTMLUListElement> {
|
|
261
339
|
bordered?: boolean;
|
|
262
340
|
flush?: boolean;
|
|
263
341
|
}
|
|
264
|
-
declare const ListGroupItem: React.ForwardRefExoticComponent<ListGroupItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
265
|
-
declare const ListGroup: React.ForwardRefExoticComponent<ListGroupProps & React.RefAttributes<HTMLUListElement>>;
|
|
342
|
+
declare const ListGroupItem: React$1.ForwardRefExoticComponent<ListGroupItemProps & React$1.RefAttributes<HTMLLIElement>>;
|
|
343
|
+
declare const ListGroup: React$1.ForwardRefExoticComponent<ListGroupProps & React$1.RefAttributes<HTMLUListElement>>;
|
|
266
344
|
|
|
267
345
|
interface VirtualListProps<T = any> {
|
|
268
346
|
/** 数据源 */
|
|
@@ -272,7 +350,7 @@ interface VirtualListProps<T = any> {
|
|
|
272
350
|
/** 每项固定高度 */
|
|
273
351
|
itemHeight: number;
|
|
274
352
|
/** 渲染函数 */
|
|
275
|
-
renderItem: (item: T, index: number) => React.ReactNode;
|
|
353
|
+
renderItem: (item: T, index: number) => React$1.ReactNode;
|
|
276
354
|
/** 容器类名 */
|
|
277
355
|
className?: string;
|
|
278
356
|
/** 滚动偏移量(预加载区域) */
|
|
@@ -282,23 +360,28 @@ interface VirtualListProps<T = any> {
|
|
|
282
360
|
/** 滚动到底部回调 */
|
|
283
361
|
onScrollEnd?: () => void;
|
|
284
362
|
/** 容器样式 */
|
|
285
|
-
style?: React.CSSProperties;
|
|
363
|
+
style?: React$1.CSSProperties;
|
|
286
364
|
}
|
|
287
365
|
declare function VirtualList<T>({ data, height, itemHeight, renderItem, className, overscan, showScrollbar, onScrollEnd, style }: VirtualListProps<T>): react_jsx_runtime.JSX.Element;
|
|
288
366
|
|
|
289
367
|
type AlertType = "success" | "error" | "warning" | "info";
|
|
368
|
+
type AlertMode = "alert" | "confirm" | "toast";
|
|
290
369
|
type AlertProps = {
|
|
291
370
|
msg: string;
|
|
292
371
|
type: AlertType;
|
|
372
|
+
mode: AlertMode;
|
|
293
373
|
visible: boolean;
|
|
294
|
-
|
|
374
|
+
duration?: number;
|
|
295
375
|
choice: (res: string) => void;
|
|
296
376
|
};
|
|
297
|
-
|
|
377
|
+
interface AlertProviderProps {
|
|
298
378
|
children: ReactNode;
|
|
299
|
-
|
|
379
|
+
background?: string;
|
|
380
|
+
borderColor?: string;
|
|
381
|
+
}
|
|
382
|
+
declare function AlertProvider({ children, background, borderColor }: AlertProviderProps): react_jsx_runtime.JSX.Element;
|
|
300
383
|
declare const useAlert: () => {
|
|
301
|
-
showAlert: (msg: string, type: AlertType,
|
|
384
|
+
showAlert: (msg: string, type: AlertType, mode?: AlertMode, duration?: number) => Promise<string>;
|
|
302
385
|
};
|
|
303
386
|
|
|
304
387
|
interface LazyLoadOptions {
|
|
@@ -340,51 +423,254 @@ interface CardProps {
|
|
|
340
423
|
declare const Card: ({ image, imageSlot, imageHeight, title, description, actions, extraInfo, variant, hoverable, disabled, className, style, onClick, }: CardProps) => react_jsx_runtime.JSX.Element;
|
|
341
424
|
|
|
342
425
|
interface TabItem {
|
|
426
|
+
/** 唯一标识 */
|
|
343
427
|
key: string;
|
|
344
|
-
|
|
345
|
-
|
|
428
|
+
/** 标签显示内容 */
|
|
429
|
+
label: React__default.ReactNode;
|
|
430
|
+
/** 是否禁用 */
|
|
346
431
|
disabled?: boolean;
|
|
432
|
+
/** 是否可关闭(覆盖全局 closable) */
|
|
433
|
+
closable?: boolean;
|
|
347
434
|
}
|
|
348
|
-
interface
|
|
435
|
+
interface TabBarProps {
|
|
436
|
+
/** Tab 列表(受控) */
|
|
349
437
|
items: TabItem[];
|
|
350
|
-
|
|
351
|
-
|
|
438
|
+
/** 当前激活的 Tab key(受控) */
|
|
439
|
+
activeKey: string;
|
|
440
|
+
/**
|
|
441
|
+
* 布局变体
|
|
442
|
+
* - attached: 贴合模式 — 标签底部紧贴导航栏下边缘,底部线条作为激活指示器
|
|
443
|
+
* - floating: 悬浮模式 — 标签垂直居中悬浮,胶囊形态,背景填充作为激活指示器
|
|
444
|
+
* @default 'attached'
|
|
445
|
+
*/
|
|
446
|
+
variant?: 'attached' | 'floating';
|
|
447
|
+
/** TabBar 容器圆角 */
|
|
352
448
|
radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
449
|
+
/** 单个 Tab 项的圆角(仅在 floating 模式下或需要四周圆角时使用) */
|
|
450
|
+
tabRadius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
451
|
+
/** 是否显示关闭按钮 */
|
|
353
452
|
closable?: boolean;
|
|
453
|
+
/** 是否显示添加按钮 */
|
|
354
454
|
addable?: boolean;
|
|
355
|
-
|
|
455
|
+
/** 是否启用拖拽排序 */
|
|
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;
|
|
469
|
+
onChange: (activeKey: string) => void;
|
|
356
470
|
onClose?: (key: string) => void;
|
|
357
471
|
onAdd?: () => void;
|
|
472
|
+
onReorder?: (reorderedItems: TabItem[]) => void;
|
|
473
|
+
/** 每个 Tab 的自定义 className */
|
|
474
|
+
tabClassName?: string;
|
|
475
|
+
/** 激活态 Tab 的额外 className */
|
|
476
|
+
activeTabClassName?: string;
|
|
477
|
+
/** 每个 Tab 的自定义 inline style */
|
|
478
|
+
tabStyle?: React__default.CSSProperties;
|
|
479
|
+
/** 激活态 Tab 的自定义 inline style(会合并到 tabStyle 之上) */
|
|
480
|
+
activeTabStyle?: React__default.CSSProperties;
|
|
481
|
+
/** 自定义关闭图标渲染 */
|
|
482
|
+
renderCloseIcon?: (key: string) => React__default.ReactNode;
|
|
483
|
+
/** 自定义添加按钮渲染 */
|
|
484
|
+
renderAddButton?: () => React__default.ReactNode;
|
|
485
|
+
className?: string;
|
|
486
|
+
style?: React__default.CSSProperties;
|
|
487
|
+
/** 容器背景色 */
|
|
488
|
+
background?: string;
|
|
489
|
+
/** 标签默认文字色 */
|
|
490
|
+
tabColor?: string;
|
|
491
|
+
/** 标签 hover 文字色 */
|
|
492
|
+
tabHoverColor?: string;
|
|
493
|
+
/** 标签 hover 背景色 */
|
|
494
|
+
tabHoverBackground?: string;
|
|
495
|
+
/** 激活态文字色 */
|
|
496
|
+
tabActiveColor?: string;
|
|
497
|
+
/** 激活态背景色 */
|
|
498
|
+
tabActiveBackground?: string;
|
|
499
|
+
/** 激活态指示器颜色(attached 模式底线 / floating 模式无效) */
|
|
500
|
+
activeIndicatorColor?: string;
|
|
501
|
+
}
|
|
502
|
+
declare const TabBar: React__default.NamedExoticComponent<TabBarProps>;
|
|
503
|
+
|
|
504
|
+
interface TagSchema {
|
|
505
|
+
id: string;
|
|
506
|
+
name: string;
|
|
507
|
+
type: "number" | "string" | "boolean";
|
|
508
|
+
range_min?: number | null;
|
|
509
|
+
range_max?: number | null;
|
|
510
|
+
}
|
|
511
|
+
type TagValue = number | string | boolean;
|
|
512
|
+
interface TagItemProps {
|
|
513
|
+
schema: TagSchema;
|
|
514
|
+
value?: TagValue;
|
|
515
|
+
onChange?: (value: TagValue) => void;
|
|
516
|
+
/** show:展示态,双击可内联编辑;edit:始终为编辑控件 */
|
|
517
|
+
mode?: "show" | "edit";
|
|
518
|
+
background?: string;
|
|
519
|
+
color?: string;
|
|
520
|
+
borderColor?: string;
|
|
521
|
+
}
|
|
522
|
+
declare function TagItem({ schema, value, onChange, mode, background, color, borderColor, }: TagItemProps): react_jsx_runtime.JSX.Element;
|
|
523
|
+
|
|
524
|
+
interface MarkdownEditorProps {
|
|
525
|
+
value: string;
|
|
526
|
+
onChange: (v: string) => void;
|
|
527
|
+
/** AI 补全回调,传入时显示 AI 按钮,不传则隐藏 */
|
|
528
|
+
onAiComplete?: () => void;
|
|
529
|
+
minHeight?: number;
|
|
530
|
+
placeholder?: string;
|
|
531
|
+
/**
|
|
532
|
+
* 显示模式
|
|
533
|
+
* - edit: 编辑模式(工具栏含双栏切换按钮)
|
|
534
|
+
* - preview: 纯预览,只读渲染 Markdown,隐藏工具栏
|
|
535
|
+
* @default 'edit'
|
|
536
|
+
*/
|
|
537
|
+
mode?: 'edit' | 'preview';
|
|
538
|
+
background?: string;
|
|
539
|
+
toolbarBackground?: string;
|
|
540
|
+
borderColor?: string;
|
|
541
|
+
}
|
|
542
|
+
declare function MarkdownEditor({ value, onChange, onAiComplete, minHeight, placeholder, mode, background, toolbarBackground, borderColor, }: MarkdownEditorProps): react_jsx_runtime.JSX.Element;
|
|
543
|
+
|
|
544
|
+
type ContextMenuDivider = {
|
|
545
|
+
type: "divider";
|
|
546
|
+
};
|
|
547
|
+
type ContextMenuAction = {
|
|
548
|
+
label: string;
|
|
549
|
+
icon?: ReactNode;
|
|
550
|
+
onClick: () => void;
|
|
551
|
+
danger?: boolean;
|
|
552
|
+
disabled?: boolean;
|
|
553
|
+
};
|
|
554
|
+
type ContextMenuItem = ContextMenuAction | ContextMenuDivider;
|
|
555
|
+
interface ContextMenuProviderProps {
|
|
556
|
+
children: ReactNode;
|
|
557
|
+
background?: string;
|
|
558
|
+
borderColor?: string;
|
|
559
|
+
hoverBackground?: string;
|
|
560
|
+
}
|
|
561
|
+
declare function ContextMenuProvider({ children, background, borderColor, hoverBackground, }: ContextMenuProviderProps): react_jsx_runtime.JSX.Element;
|
|
562
|
+
declare const useContextMenu: () => {
|
|
563
|
+
showContextMenu: (e: React.MouseEvent, items: ContextMenuItem[]) => void;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
567
|
+
interface SmartMessageProps {
|
|
568
|
+
id: string;
|
|
569
|
+
content: string;
|
|
570
|
+
role: MessageRole;
|
|
571
|
+
timestamp?: Date;
|
|
572
|
+
status?: 'sending' | 'sent' | 'error';
|
|
573
|
+
toolName?: string;
|
|
574
|
+
toolResult?: any;
|
|
575
|
+
onCopy?: (content: string, role: MessageRole) => void;
|
|
358
576
|
className?: string;
|
|
359
577
|
style?: React__default.CSSProperties;
|
|
360
578
|
}
|
|
361
|
-
declare const
|
|
579
|
+
declare const SmartMessage: React__default.FC<SmartMessageProps>;
|
|
362
580
|
|
|
363
581
|
interface Message {
|
|
364
582
|
id: string;
|
|
365
583
|
content: string;
|
|
366
|
-
type:
|
|
584
|
+
type: MessageRole;
|
|
367
585
|
timestamp: Date;
|
|
368
586
|
status?: 'sending' | 'sent' | 'error';
|
|
587
|
+
toolName?: string;
|
|
588
|
+
toolResult?: any;
|
|
589
|
+
}
|
|
590
|
+
interface Conversation {
|
|
591
|
+
id: string;
|
|
592
|
+
title: string;
|
|
593
|
+
lastMessage: string;
|
|
594
|
+
timestamp: Date;
|
|
595
|
+
messages: Message[];
|
|
369
596
|
}
|
|
370
597
|
interface ChatProps {
|
|
371
598
|
messages?: Message[];
|
|
372
|
-
onSendMessage?: (message: string) => Promise<void> | void;
|
|
373
|
-
placeholder?: string;
|
|
374
599
|
title?: string;
|
|
375
|
-
|
|
600
|
+
loading?: boolean;
|
|
601
|
+
conversations?: Conversation[];
|
|
602
|
+
currentConversationId?: string;
|
|
603
|
+
emptyText?: string;
|
|
604
|
+
newConversationText?: string;
|
|
605
|
+
historyTitle?: string;
|
|
606
|
+
showHistoryButton?: boolean;
|
|
607
|
+
showMinimizeButton?: boolean;
|
|
376
608
|
showHeader?: boolean;
|
|
377
609
|
showFooter?: boolean;
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
610
|
+
autoScroll?: boolean;
|
|
611
|
+
onSwitchConversation?: (conversationId: string) => void;
|
|
612
|
+
onNewConversation?: () => void;
|
|
613
|
+
onDeleteConversation?: (conversationId: string) => void;
|
|
614
|
+
onMinimize?: () => void;
|
|
615
|
+
onRestore?: () => void;
|
|
616
|
+
onMessageCopy?: (message: Message) => void;
|
|
617
|
+
className?: string;
|
|
618
|
+
style?: React__default.CSSProperties;
|
|
619
|
+
headerClassName?: string;
|
|
620
|
+
headerStyle?: React__default.CSSProperties;
|
|
621
|
+
messagesClassName?: string;
|
|
622
|
+
messagesStyle?: React__default.CSSProperties;
|
|
623
|
+
bubbleClassName?: string;
|
|
624
|
+
height?: string;
|
|
625
|
+
width?: string;
|
|
387
626
|
}
|
|
388
627
|
declare const Chat: React__default.FC<ChatProps>;
|
|
389
628
|
|
|
390
|
-
|
|
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 };
|