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.d.cts DELETED
@@ -1,390 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import React__default, { ReactNode, ComponentType } from 'react';
4
-
5
- type Theme = 'light' | 'dark' | 'system';
6
- interface ThemeContextType {
7
- theme: Theme;
8
- resolvedTheme: 'light' | 'dark';
9
- setTheme: (theme: Theme) => void;
10
- }
11
- declare function useTheme(): ThemeContextType;
12
- interface Props {
13
- children: ReactNode;
14
- defaultTheme?: Theme;
15
- target?: HTMLElement;
16
- }
17
- declare function ThemeProvider({ children, defaultTheme, target }: Props): react_jsx_runtime.JSX.Element;
18
-
19
- type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'warning';
20
- type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
21
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
22
- /** 按钮变体 */
23
- variant?: ButtonVariant;
24
- /** 尺寸 */
25
- size?: ButtonSize;
26
- /** 是否禁用 */
27
- disabled?: boolean;
28
- /** 加载状态 */
29
- loading?: boolean;
30
- /** 块级按钮(宽度100%) */
31
- block?: boolean;
32
- /** 圆形按钮 */
33
- circle?: boolean;
34
- /** 仅图标模式 */
35
- iconOnly?: boolean;
36
- /** 左侧图标 */
37
- iconLeft?: React.ReactNode;
38
- /** 右侧图标 */
39
- iconRight?: React.ReactNode;
40
- }
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;
44
- }
45
- declare function ButtonGroup({ children, className, ...props }: ButtonGroupProps): react_jsx_runtime.JSX.Element;
46
- interface ButtonToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
47
- children: React.ReactNode;
48
- align?: 'left' | 'center' | 'right' | 'between';
49
- }
50
- declare function ButtonToolbar({ children, align, className, ...props }: ButtonToolbarProps): react_jsx_runtime.JSX.Element;
51
-
52
- interface CheckButtonBase {
53
- onChange?: (checked: boolean) => void;
54
- disabled?: boolean;
55
- size?: 'sm' | 'md' | 'lg';
56
- labelLeft?: string;
57
- labelRight?: string;
58
- className?: string;
59
- style?: React.CSSProperties;
60
- }
61
- interface ControlledCheckButton extends CheckButtonBase {
62
- checked: boolean;
63
- defaultChecked?: never;
64
- }
65
- interface UncontrolledCheckButton extends CheckButtonBase {
66
- checked?: never;
67
- defaultChecked?: boolean;
68
- }
69
- type CheckButtonProps = ControlledCheckButton | UncontrolledCheckButton;
70
- declare function CheckButton({ checked: controlledChecked, defaultChecked, onChange, disabled, size, labelLeft, labelRight, className, style, }: CheckButtonProps): react_jsx_runtime.JSX.Element;
71
-
72
- type ShowThumb = 'auto' | 'hide' | 'show';
73
- type ThumbSize = 'thin' | 'normal' | 'thick';
74
- interface RollingBoxProps extends React.HTMLAttributes<HTMLDivElement> {
75
- /** 滚动条显示模式 */
76
- showThumb?: ShowThumb;
77
- /** 水平滚动 */
78
- horizontal?: boolean;
79
- /** 垂直滚动(默认) */
80
- vertical?: boolean;
81
- /** 自定义滚动条宽度 */
82
- thumbSize?: ThumbSize;
83
- /** 是否显示滚动轨道 */
84
- showTrack?: boolean;
85
- /** 内容 */
86
- children: React.ReactNode;
87
- }
88
- declare function RollingBox({ showThumb, horizontal, vertical, thumbSize, showTrack, children, className, ...props }: RollingBoxProps): react_jsx_runtime.JSX.Element;
89
-
90
- interface MenuItem {
91
- key: string;
92
- label: string;
93
- icon?: React.ReactNode;
94
- children?: MenuItem[];
95
- disabled?: boolean;
96
- href?: string;
97
- }
98
- interface SideBarProps {
99
- items: MenuItem[];
100
- selectedKeys?: string[];
101
- defaultSelectedKeys?: string[];
102
- openKeys?: string[];
103
- defaultOpenKeys?: string[];
104
- onSelect?: (keys: string[]) => void;
105
- onOpenChange?: (keys: string[]) => void;
106
- collapsed?: boolean;
107
- defaultCollapsed?: boolean;
108
- onCollapse?: (collapsed: boolean) => void;
109
- className?: string;
110
- width?: number;
111
- collapsedWidth?: number;
112
- }
113
- declare function SideBar({ items, selectedKeys: controlledSelected, defaultSelectedKeys, openKeys: controlledOpen, defaultOpenKeys, onSelect, onOpenChange, collapsed: controlledCollapsed, defaultCollapsed, onCollapse, className, width, collapsedWidth, }: SideBarProps): react_jsx_runtime.JSX.Element;
114
-
115
- type InputSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
116
- type InputStatus = 'default' | 'error' | 'warning' | 'success';
117
- interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
118
- size?: InputSize;
119
- status?: InputStatus;
120
- prefix?: React.ReactNode;
121
- suffix?: React.ReactNode;
122
- allowClear?: boolean;
123
- passwordToggle?: boolean;
124
- addonBefore?: React.ReactNode;
125
- addonAfter?: React.ReactNode;
126
- helperText?: string;
127
- onClear?: () => void;
128
- }
129
- declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
130
-
131
- type SliderValue = number | [number, number];
132
- type SliderOrientation = 'horizontal' | 'vertical';
133
- interface SliderProps {
134
- value?: SliderValue;
135
- defaultValue?: SliderValue;
136
- onChange?: (value: SliderValue) => void;
137
- min?: number;
138
- max?: number;
139
- step?: number;
140
- range?: boolean;
141
- orientation?: SliderOrientation;
142
- disabled?: boolean;
143
- marks?: Record<number, string>;
144
- tooltip?: boolean;
145
- className?: string;
146
- }
147
- declare function Slider({ value: controlledValue, defaultValue, onChange, min, max, step, range, orientation, disabled, marks, tooltip, className, }: SliderProps): react_jsx_runtime.JSX.Element;
148
-
149
- interface SelectOption {
150
- value: string | number;
151
- label: string;
152
- disabled?: boolean;
153
- group?: string;
154
- }
155
- interface SelectProps {
156
- options: SelectOption[];
157
- value?: string | number | (string | number)[];
158
- defaultValue?: string | number | (string | number)[];
159
- onChange?: (value: any) => void;
160
- placeholder?: string;
161
- searchable?: boolean;
162
- multiple?: boolean;
163
- disabled?: boolean;
164
- className?: string;
165
- virtualScroll?: boolean;
166
- virtualItemHeight?: number;
167
- maxHeight?: number;
168
- }
169
- declare function Select({ options, value: controlledValue, defaultValue, onChange, placeholder, searchable, multiple, disabled, className, virtualScroll, virtualItemHeight, maxHeight }: SelectProps): react_jsx_runtime.JSX.Element;
170
-
171
- interface FlatCategory {
172
- id: string;
173
- parent_id: string | null;
174
- name: string;
175
- sort_order: number;
176
- project_id?: string;
177
- [key: string]: unknown;
178
- }
179
- interface CategoryTreeNode {
180
- key: string;
181
- title: string;
182
- children: CategoryTreeNode[];
183
- raw: FlatCategory;
184
- }
185
- interface FlatToTreeResult {
186
- roots: CategoryTreeNode[];
187
- orphans: CategoryTreeNode[];
188
- }
189
- declare function flatToTree(list: FlatCategory[]): FlatToTreeResult;
190
- /** Find a node and its context in the tree. */
191
- declare function findNodeInfo(nodes: CategoryTreeNode[], key: string, parent?: CategoryTreeNode | null): {
192
- node: CategoryTreeNode;
193
- parent: CategoryTreeNode | null;
194
- siblings: CategoryTreeNode[];
195
- index: number;
196
- } | null;
197
- /** Returns true if `targetKey` is a descendant of `ancestorKey`. */
198
- declare function isDescendantOf(roots: CategoryTreeNode[], ancestorKey: string, targetKey: string): boolean;
199
-
200
- type DeleteMode = 'lift' | 'cascade';
201
- interface DeleteDialogProps {
202
- node: CategoryTreeNode | null;
203
- onClose: () => void;
204
- /** Parent handles DB logic. mode='lift' → move children & entries up; mode='cascade' → delete all. */
205
- onDelete: (key: string, mode: DeleteMode) => Promise<void>;
206
- }
207
- declare function DeleteDialog({ node, onClose, onDelete }: DeleteDialogProps): react_jsx_runtime.JSX.Element | null;
208
-
209
- type DropPosition = 'before' | 'after' | 'into';
210
- interface TreeProps {
211
- treeData: CategoryTreeNode[];
212
- onRename?: (key: string, newName: string) => Promise<void>;
213
- onCreate?: (parentKey: string | null) => Promise<string>;
214
- onDelete?: (key: string, mode: DeleteMode) => Promise<void>;
215
- onMove?: (key: string, targetKey: string, position: DropPosition) => Promise<void>;
216
- onSelect?: (key: string) => void;
217
- selectedKey?: string;
218
- searchable?: boolean;
219
- scrollHeight?: string;
220
- className?: string;
221
- }
222
- declare function Tree({ treeData, onRename, onCreate, onDelete, onMove, onSelect, selectedKey, searchable, scrollHeight, className, }: TreeProps): react_jsx_runtime.JSX.Element;
223
-
224
- type OrphanResolution = 'lift' | 'remove';
225
- type OrphanResolutionMap = Record<string, OrphanResolution>;
226
- interface OrphanDialogProps {
227
- orphans: CategoryTreeNode[];
228
- onResolve: (resolutions: OrphanResolutionMap) => void;
229
- /** Dismiss without resolving — orphans will be silently excluded from the tree. */
230
- onClose: () => void;
231
- }
232
- declare function OrphanDialog({ orphans, onResolve, onClose }: OrphanDialogProps): react_jsx_runtime.JSX.Element | null;
233
-
234
- type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
235
- type AvatarShape = 'circle' | 'square';
236
- type AvatarLoadState = 'idle' | 'loading' | 'loaded' | 'error';
237
- type AvatarColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
238
- interface AvatarProps extends Omit<React__default.HTMLAttributes<HTMLDivElement>, 'onError'> {
239
- children?: React__default.ReactNode;
240
- src?: string;
241
- fallbackSrc?: string;
242
- color?: string;
243
- colorVariant?: AvatarColorVariant;
244
- size?: AvatarSize;
245
- shape?: AvatarShape;
246
- alt?: string;
247
- lazyLoad?: boolean;
248
- onImageLoad?: () => void;
249
- onImageError?: (error?: Event) => void;
250
- bordered?: boolean;
251
- onStateChange?: (state: AvatarLoadState) => void;
252
- }
253
- declare const Avatar: React__default.ForwardRefExoticComponent<AvatarProps & React__default.RefAttributes<HTMLDivElement>>;
254
-
255
- interface ListGroupItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
256
- active?: boolean;
257
- disabled?: boolean;
258
- onClick?: (event: React.MouseEvent<HTMLLIElement>) => void;
259
- }
260
- interface ListGroupProps extends React.HTMLAttributes<HTMLUListElement> {
261
- bordered?: boolean;
262
- flush?: boolean;
263
- }
264
- declare const ListGroupItem: React.ForwardRefExoticComponent<ListGroupItemProps & React.RefAttributes<HTMLLIElement>>;
265
- declare const ListGroup: React.ForwardRefExoticComponent<ListGroupProps & React.RefAttributes<HTMLUListElement>>;
266
-
267
- interface VirtualListProps<T = any> {
268
- /** 数据源 */
269
- data: T[];
270
- /** 容器高度 */
271
- height: number;
272
- /** 每项固定高度 */
273
- itemHeight: number;
274
- /** 渲染函数 */
275
- renderItem: (item: T, index: number) => React.ReactNode;
276
- /** 容器类名 */
277
- className?: string;
278
- /** 滚动偏移量(预加载区域) */
279
- overscan?: number;
280
- /** 是否显示滚动条 */
281
- showScrollbar?: boolean;
282
- /** 滚动到底部回调 */
283
- onScrollEnd?: () => void;
284
- /** 容器样式 */
285
- style?: React.CSSProperties;
286
- }
287
- declare function VirtualList<T>({ data, height, itemHeight, renderItem, className, overscan, showScrollbar, onScrollEnd, style }: VirtualListProps<T>): react_jsx_runtime.JSX.Element;
288
-
289
- type AlertType = "success" | "error" | "warning" | "info";
290
- type AlertProps = {
291
- msg: string;
292
- type: AlertType;
293
- visible: boolean;
294
- confirm?: boolean;
295
- choice: (res: string) => void;
296
- };
297
- declare function AlertProvider({ children }: {
298
- children: ReactNode;
299
- }): react_jsx_runtime.JSX.Element;
300
- declare const useAlert: () => {
301
- showAlert: (msg: string, type: AlertType, confirm?: boolean) => Promise<string>;
302
- };
303
-
304
- interface LazyLoadOptions {
305
- fallback?: ReactNode;
306
- timeout?: number;
307
- }
308
- declare function lazyLoad<T extends ComponentType<any>>(importFn: () => Promise<{
309
- default: T;
310
- }>, options?: LazyLoadOptions): (props: any) => react_jsx_runtime.JSX.Element;
311
-
312
- interface CardProps {
313
- /** 图片地址 */
314
- image?: string;
315
- /** 图片区域自定义内容(优先级高于 image) */
316
- imageSlot?: ReactNode;
317
- /** 图片高度 */
318
- imageHeight?: number | string;
319
- /** 标题 */
320
- title?: ReactNode;
321
- /** 描述文字 */
322
- description?: ReactNode;
323
- /** 底部操作区域 */
324
- actions?: ReactNode;
325
- /** 额外信息(价格、时间、标签等) */
326
- extraInfo?: ReactNode;
327
- /** 卡片变体 */
328
- variant?: 'default' | 'bordered' | 'shadow' | 'outline';
329
- /** 是否可悬停 */
330
- hoverable?: boolean;
331
- /** 是否禁用 */
332
- disabled?: boolean;
333
- /** 自定义类名 */
334
- className?: string;
335
- /** 自定义样式 */
336
- style?: React__default.CSSProperties;
337
- /** 点击卡片回调 */
338
- onClick?: () => void;
339
- }
340
- declare const Card: ({ image, imageSlot, imageHeight, title, description, actions, extraInfo, variant, hoverable, disabled, className, style, onClick, }: CardProps) => react_jsx_runtime.JSX.Element;
341
-
342
- interface TabItem {
343
- key: string;
344
- label: ReactNode;
345
- content?: ReactNode;
346
- disabled?: boolean;
347
- }
348
- interface TabsProps {
349
- items: TabItem[];
350
- activeKey?: string;
351
- defaultActiveKey?: string;
352
- radius?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
353
- closable?: boolean;
354
- addable?: boolean;
355
- onChange?: (activeKey: string) => void;
356
- onClose?: (key: string) => void;
357
- onAdd?: () => void;
358
- className?: string;
359
- style?: React__default.CSSProperties;
360
- }
361
- declare const Tabs: ({ items, activeKey: controlledActiveKey, defaultActiveKey, radius, closable, addable, onChange, onClose, onAdd, className, style, }: TabsProps) => react_jsx_runtime.JSX.Element;
362
-
363
- interface Message {
364
- id: string;
365
- content: string;
366
- type: 'user' | 'assistant' | 'system';
367
- timestamp: Date;
368
- status?: 'sending' | 'sent' | 'error';
369
- }
370
- interface ChatProps {
371
- messages?: Message[];
372
- onSendMessage?: (message: string) => Promise<void> | void;
373
- placeholder?: string;
374
- title?: string;
375
- height?: string;
376
- showHeader?: boolean;
377
- showFooter?: boolean;
378
- loading?: boolean;
379
- disabled?: boolean;
380
- theme?: 'light' | 'dark';
381
- userName?: string;
382
- assistantName?: string;
383
- onTyping?: (isTyping: boolean) => void;
384
- maxInputLength?: number;
385
- autoFocus?: boolean;
386
- enableCopy?: boolean;
387
- }
388
- declare const Chat: React__default.FC<ChatProps>;
389
-
390
- export { type AlertProps, AlertProvider, 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, DeleteDialog, type DeleteMode, type DropPosition, type FlatCategory, type FlatToTreeResult, Input, ListGroup, ListGroupItem, type ListGroupItemProps, type ListGroupProps, type Message, OrphanDialog, type OrphanResolution, type OrphanResolutionMap, RollingBox, Select, SideBar, Slider, type TabItem, Tabs, type TabsProps, type Theme, ThemeProvider, Tree, type TreeProps, VirtualList, findNodeInfo, flatToTree, isDescendantOf, lazyLoad, useAlert, useTheme };