@zscloud/design 0.2.0
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/LICENSE +21 -0
- package/dist/_icon/app-icon.d.ts +8 -0
- package/dist/_icon/app-icons-mapping.d.ts +230 -0
- package/dist/_icon/icon.d.ts +12 -0
- package/dist/_icon/icons-mapping.d.ts +3866 -0
- package/dist/_icon/index.d.ts +3 -0
- package/dist/_icon/type.d.ts +14 -0
- package/dist/_utils.d.ts +17 -0
- package/dist/components/biz/app-base/index.d.ts +18 -0
- package/dist/components/biz/config/index.d.ts +15 -0
- package/dist/components/biz/constant/index.d.ts +8 -0
- package/dist/components/biz/copy/index.d.ts +6 -0
- package/dist/components/biz/date-value.d.ts +5 -0
- package/dist/components/biz/dropdown-action/index.d.ts +16 -0
- package/dist/components/biz/field/field-group.d.ts +5 -0
- package/dist/components/biz/field/field-operations.d.ts +9 -0
- package/dist/components/biz/field/index.d.ts +33 -0
- package/dist/components/biz/file-upload/index.d.ts +1 -0
- package/dist/components/biz/file-upload/types.d.ts +6 -0
- package/dist/components/biz/file-upload/utils/calc-file-hash.d.ts +36 -0
- package/dist/components/biz/file-upload/utils/request.d.ts +24 -0
- package/dist/components/biz/file-upload/worker/hash.worker.d.ts +0 -0
- package/dist/components/biz/file-upload/worker/simple-hash.work.d.ts +0 -0
- package/dist/components/biz/header/header-breadcrumb.d.ts +12 -0
- package/dist/components/biz/header/header-detail.d.ts +11 -0
- package/dist/components/biz/header/header-page.d.ts +8 -0
- package/dist/components/biz/header/index.d.ts +3 -0
- package/dist/components/biz/helper-doc/index.d.ts +8 -0
- package/dist/components/biz/hooks/use-admin-uuid.d.ts +1 -0
- package/dist/components/biz/info/index.d.ts +55 -0
- package/dist/components/biz/info-popover/index.d.ts +46 -0
- package/dist/components/biz/locale-container/index.d.ts +3 -0
- package/dist/components/biz/locale-container/type.d.ts +8 -0
- package/dist/components/biz/no-data/index.d.ts +12 -0
- package/dist/components/biz/panic-fallback/index.d.ts +1 -0
- package/dist/components/biz/smart-tip/index.d.ts +90 -0
- package/dist/components/biz/state/index.d.ts +25 -0
- package/dist/components/primitive/alert-dialog.d.ts +31 -0
- package/dist/components/primitive/alert.d.ts +16 -0
- package/dist/components/primitive/auto-complete.d.ts +20 -0
- package/dist/components/primitive/badge.d.ts +80 -0
- package/dist/components/primitive/breadcrumb.d.ts +26 -0
- package/dist/components/primitive/button.d.ts +15 -0
- package/dist/components/primitive/calendar.d.ts +8 -0
- package/dist/components/primitive/card.d.ts +27 -0
- package/dist/components/primitive/cascader.d.ts +117 -0
- package/dist/components/primitive/chart.d.ts +62 -0
- package/dist/components/primitive/checkbox-group.d.ts +14 -0
- package/dist/components/primitive/checkbox.d.ts +7 -0
- package/dist/components/primitive/code-editor/index.d.ts +67 -0
- package/dist/components/primitive/collapse.d.ts +17 -0
- package/dist/components/primitive/context-menu.d.ts +48 -0
- package/dist/components/primitive/date-picker.d.ts +44 -0
- package/dist/components/primitive/dialog.d.ts +66 -0
- package/dist/components/primitive/divider.d.ts +14 -0
- package/dist/components/primitive/drawer.d.ts +47 -0
- package/dist/components/primitive/dropdown-menu.d.ts +55 -0
- package/dist/components/primitive/file-upload/file-upload-single.d.ts +11 -0
- package/dist/components/primitive/file-upload/index.d.ts +1 -0
- package/dist/components/primitive/form.d.ts +32 -0
- package/dist/components/primitive/image-reader/index.d.ts +7 -0
- package/dist/components/primitive/input-number.d.ts +17 -0
- package/dist/components/primitive/input-password.d.ts +19 -0
- package/dist/components/primitive/input.d.ts +5 -0
- package/dist/components/primitive/json-viewer.d.ts +22 -0
- package/dist/components/primitive/label.d.ts +5 -0
- package/dist/components/primitive/link.d.ts +11 -0
- package/dist/components/primitive/loader.d.ts +3 -0
- package/dist/components/primitive/markdown/index.d.ts +30 -0
- package/dist/components/primitive/multi-select.d.ts +76 -0
- package/dist/components/primitive/pagination/index.d.ts +8 -0
- package/dist/components/primitive/pagination/pagination.d.ts +31 -0
- package/dist/components/primitive/popover-confirm.d.ts +32 -0
- package/dist/components/primitive/popover.d.ts +12 -0
- package/dist/components/primitive/progress.d.ts +32 -0
- package/dist/components/primitive/radio-group.d.ts +49 -0
- package/dist/components/primitive/range-picker.d.ts +18 -0
- package/dist/components/primitive/resizable.d.ts +25 -0
- package/dist/components/primitive/search-input.d.ts +8 -0
- package/dist/components/primitive/select.d.ts +74 -0
- package/dist/components/primitive/selection-cancellation.d.ts +9 -0
- package/dist/components/primitive/show.d.ts +8 -0
- package/dist/components/primitive/slider.d.ts +4 -0
- package/dist/components/primitive/spin.d.ts +52 -0
- package/dist/components/primitive/status-badge.d.ts +19 -0
- package/dist/components/primitive/steps.d.ts +75 -0
- package/dist/components/primitive/switch.d.ts +4 -0
- package/dist/components/primitive/tabs/hooks/use-persist-tab-store.d.ts +4 -0
- package/dist/components/primitive/tabs/interface/tab-memo.d.ts +5 -0
- package/dist/components/primitive/tabs/store/page-state-store.d.ts +17 -0
- package/dist/components/primitive/tabs/tabs.d.ts +40 -0
- package/dist/components/primitive/tabs/use-persist.d.ts +4 -0
- package/dist/components/primitive/tabs/use-store.d.ts +25 -0
- package/dist/components/primitive/tag-list.d.ts +22 -0
- package/dist/components/primitive/tag.d.ts +17 -0
- package/dist/components/primitive/text.d.ts +27 -0
- package/dist/components/primitive/textarea.d.ts +8 -0
- package/dist/components/primitive/time-picker.d.ts +41 -0
- package/dist/components/primitive/toast/toast.d.ts +17 -0
- package/dist/components/primitive/toast/toaster.d.ts +1 -0
- package/dist/components/primitive/toast/use-toast.d.ts +45 -0
- package/dist/components/primitive/tooltip/index.d.ts +38 -0
- package/dist/components/primitive/tooltip/use-placement.d.ts +4 -0
- package/dist/components/primitive/tree/index.d.ts +5 -0
- package/dist/components/primitive/tree/tree-node.d.ts +17 -0
- package/dist/components/primitive/tree/tree-select.d.ts +21 -0
- package/dist/components/primitive/tree/tree.d.ts +24 -0
- package/dist/components/primitive/tree/types.d.ts +123 -0
- package/dist/i18n/locales/en-US.json.d.ts +76 -0
- package/dist/i18n/locales/zh-CN.json.d.ts +76 -0
- package/dist/index.d.ts +113 -0
- package/dist/style.css +2 -0
- package/dist/utils/overlay-context.d.ts +34 -0
- package/dist/utils/use-container.d.ts +30 -0
- package/dist/utils/use-id.d.ts +1 -0
- package/dist/utils/use-overlay.d.ts +34 -0
- package/dist/zscloud-design.es.js +33683 -0
- package/package.json +116 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as DrawerPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
declare const DrawerRoot: {
|
|
5
|
+
({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayname: string;
|
|
7
|
+
};
|
|
8
|
+
declare const DrawerTrigger: React.ForwardRefExoticComponent<DrawerPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
declare const DrawerPortal: React.FC<DrawerPrimitive.DialogPortalProps>;
|
|
10
|
+
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<DrawerPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
className?: string;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
interface DrawerProps extends React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> {
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
placement?: "right" | "left" | "top" | "bottom";
|
|
17
|
+
open: boolean;
|
|
18
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
19
|
+
disableAutoZIndex?: boolean;
|
|
20
|
+
}
|
|
21
|
+
declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* 是否显示关闭按钮
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
closable?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 自定义关闭图标
|
|
31
|
+
*/
|
|
32
|
+
closeIcon?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* 点击关闭按钮的回调
|
|
35
|
+
*/
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
}
|
|
38
|
+
declare const DrawerHeader: (props: DrawerHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export interface DrawerFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const DrawerFooter: (props: DrawerFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export interface DrawerBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
44
|
+
children?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
declare const DrawerBody: (props: DrawerBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export { Drawer, DrawerRoot, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerContent, DrawerHeader, DrawerBody, DrawerFooter, };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
interface DropdownMenuContentProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {
|
|
14
|
+
open?: boolean;
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
disableAutoZIndex?: boolean;
|
|
17
|
+
collisionPadding?: number | {
|
|
18
|
+
top?: number;
|
|
19
|
+
right?: number;
|
|
20
|
+
bottom?: number;
|
|
21
|
+
left?: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
31
|
+
inset?: boolean;
|
|
32
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const DropdownMenuShortcut: {
|
|
35
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
interface DropdownItem {
|
|
39
|
+
key: string | number;
|
|
40
|
+
label?: React.ReactNode;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
tooltip?: React.ReactNode;
|
|
43
|
+
type?: "item" | "group" | "separator";
|
|
44
|
+
children?: DropdownItem[];
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
interface DropDownProps {
|
|
48
|
+
items: DropdownItem[];
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
onSelect: (event: DropdownItem) => void;
|
|
51
|
+
align?: "start" | "center" | "end";
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
declare const Dropdown: (props: DropDownProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
export { Dropdown, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, type DropDownProps, type DropdownItem, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface SingleFileUploadProps {
|
|
3
|
+
/** 原始文件数据 */
|
|
4
|
+
file: File;
|
|
5
|
+
onChange?: (file?: File) => void;
|
|
6
|
+
/** 文件名后缀 */
|
|
7
|
+
accept: string;
|
|
8
|
+
}
|
|
9
|
+
/** 适用于单文件上传、与表单配合的场景 */
|
|
10
|
+
export declare const FileUploadSingle: React.FC<SingleFileUploadProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './file-upload-single';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ControllerProps, FieldPath, FieldValues } from 'react-hook-form';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import('react-hook-form').FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
5
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const useFormField: () => {
|
|
7
|
+
invalid: boolean;
|
|
8
|
+
isDirty: boolean;
|
|
9
|
+
isTouched: boolean;
|
|
10
|
+
isValidating: boolean;
|
|
11
|
+
error?: import('react-hook-form').FieldError;
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
formItemId: string;
|
|
15
|
+
formDescriptionId: string;
|
|
16
|
+
formMessageId: string;
|
|
17
|
+
};
|
|
18
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export interface FormLabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> {
|
|
20
|
+
required?: boolean;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
info?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
declare const FormLabel: React.ForwardRefExoticComponent<FormLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
25
|
+
declare const FormControl: React.ForwardRefExoticComponent<Omit<import('@radix-ui/react-slot').SlotProps & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
26
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
27
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const FormRequiredIndicator: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
29
|
+
declare const FormRowContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
declare const FormHint: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
declare const FormNestedContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, FormRequiredIndicator, FormRowContainer, FormHint, FormNestedContainer, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InputProps } from './input';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface InputNumberProps extends InputProps {
|
|
4
|
+
value: number | "";
|
|
5
|
+
onValueChange: (value: number | "") => void;
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
controls?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 自定义小数点后保留位数
|
|
12
|
+
* 如果不设置,则根据 step 自动计算
|
|
13
|
+
*/
|
|
14
|
+
precision?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const InputNumber: React.ForwardRefExoticComponent<InputNumberProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
|
+
export { InputNumber };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Input } from './input';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface InputPasswordProps extends Omit<React.ComponentProps<typeof Input>, "type"> {
|
|
4
|
+
/**
|
|
5
|
+
* 是否显示切换密码可见性的按钮
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
visibilityToggle?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 自定义图标
|
|
11
|
+
*/
|
|
12
|
+
iconRender?: (visible: boolean) => React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 是否禁用
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const InputPassword: React.ForwardRefExoticComponent<Omit<InputPasswordProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export { InputPassword };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JsonViewProps } from '@uiw/react-json-view';
|
|
2
|
+
export interface JsonViewerProps {
|
|
3
|
+
/** JSON 数据源 */
|
|
4
|
+
value: JsonViewProps<object>["value"];
|
|
5
|
+
/** 根节点名称,null 表示不显示 */
|
|
6
|
+
keyName?: string;
|
|
7
|
+
/** 是否折叠。true=全部折叠,false=全部展开,number=折叠深度 */
|
|
8
|
+
collapsed?: boolean | number;
|
|
9
|
+
/** 是否显示数据类型标签 */
|
|
10
|
+
displayDataTypes?: boolean;
|
|
11
|
+
/** 是否显示对象/数组大小 */
|
|
12
|
+
displayObjectSize?: boolean;
|
|
13
|
+
/** 是否启用复制功能 */
|
|
14
|
+
enableClipboard?: boolean;
|
|
15
|
+
/** 超过此长度的字符串将被截断显示。设为 0 则不截断(完整展示)@default 0 */
|
|
16
|
+
shortenTextAfterLength?: number;
|
|
17
|
+
/** 自定义类名 */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 自定义样式(会与主题合并) */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function JsonViewer({ value, keyName, collapsed, displayDataTypes, displayObjectSize, enableClipboard, shortenTextAfterLength, className, style, }: JsonViewerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
4
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import('class-variance-authority/types').ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
5
|
+
export { Label };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextProps } from './text';
|
|
3
|
+
export interface LinkProps extends Omit<TextProps, "as"> {
|
|
4
|
+
/**
|
|
5
|
+
* 当设置为 true 时,Link 会将其所有 props 和样式传递给子元素
|
|
6
|
+
* 这样可以将任何元素(如 <a> 标签、React Router 的 Link)渲染为链接样式
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as ReactMarkdown } from 'react-markdown';
|
|
2
|
+
declare const Markdown: typeof ReactMarkdown;
|
|
3
|
+
declare const DocMarkdown: typeof ReactMarkdown;
|
|
4
|
+
/**
|
|
5
|
+
* MarkdownWithHtml - 支持渲染 HTML 标签的 Markdown 组件
|
|
6
|
+
*
|
|
7
|
+
* 使用 rehype-raw 插件来解析和渲染 Markdown 中内嵌的 HTML 标签。
|
|
8
|
+
* 适用于需要渲染包含 HTML 内容的 Markdown 文本,如模型介绍等场景。
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ 安全提示:此组件会渲染原始 HTML,请确保内容来源可信。
|
|
11
|
+
*/
|
|
12
|
+
declare const MarkdownWithHtml: typeof ReactMarkdown;
|
|
13
|
+
/**
|
|
14
|
+
* GithubMarkdown - GitHub 风格的 Markdown 渲染组件
|
|
15
|
+
*
|
|
16
|
+
* 使用 github-markdown-css 提供完整的 GitHub Markdown 样式,
|
|
17
|
+
* 包括标题、列表、表格、代码块、引用等所有元素的样式。
|
|
18
|
+
* 同时支持渲染 HTML 标签。
|
|
19
|
+
*
|
|
20
|
+
* 特性:
|
|
21
|
+
* - 支持跨域图片加载(添加 referrerPolicy 和 crossOrigin)
|
|
22
|
+
* - 图片加载失败时显示友好的占位符
|
|
23
|
+
* - 支持 HTML align 属性(center/right)
|
|
24
|
+
*
|
|
25
|
+
* 适用于模型介绍、文档展示等需要完整 Markdown 样式的场景。
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ 安全提示:此组件会渲染原始 HTML,请确保内容来源可信。
|
|
28
|
+
*/
|
|
29
|
+
declare const GithubMarkdown: typeof ReactMarkdown;
|
|
30
|
+
export { Markdown, DocMarkdown, MarkdownWithHtml, GithubMarkdown };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Variants for the multi-select component to handle different styles.
|
|
5
|
+
* Uses class-variance-authority (cva) to define different styles based on "variant" prop.
|
|
6
|
+
*/
|
|
7
|
+
declare const multiSelectVariants: (props?: ({
|
|
8
|
+
variant?: "default" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Option type for MultiSelect component
|
|
12
|
+
*/
|
|
13
|
+
interface MultiSelectOption {
|
|
14
|
+
/** The content to display for the option. Can be a string or React node. */
|
|
15
|
+
label: React.ReactNode;
|
|
16
|
+
/** The unique value associated with the option. */
|
|
17
|
+
value: string;
|
|
18
|
+
/** Optional string used for search filtering. If not provided, label will be used (only if label is a string). */
|
|
19
|
+
searchLabel?: string;
|
|
20
|
+
/** Optional icon component to display alongside the option. */
|
|
21
|
+
icon?: React.ComponentType<{
|
|
22
|
+
className?: string;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Props for MultiSelect component
|
|
27
|
+
*/
|
|
28
|
+
interface MultiSelectProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof multiSelectVariants> {
|
|
29
|
+
/**
|
|
30
|
+
* An array of option objects to be displayed in the multi-select component.
|
|
31
|
+
* Each option object has a label, value, and an optional icon.
|
|
32
|
+
*/
|
|
33
|
+
options: MultiSelectOption[];
|
|
34
|
+
/** 当前选中的值 */
|
|
35
|
+
selectedValues: MultiSelectOption[];
|
|
36
|
+
/** 选中值变化的回调函数 */
|
|
37
|
+
onSelectedValuesChange: (values: MultiSelectOption[]) => void;
|
|
38
|
+
/**
|
|
39
|
+
* The modality of the popover. When set to true, interaction with outside elements
|
|
40
|
+
* will be disabled and only popover content will be visible to screen readers.
|
|
41
|
+
* Optional, defaults to false.
|
|
42
|
+
*/
|
|
43
|
+
modalPopover?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* If true, renders the multi-select component as a child of another component.
|
|
46
|
+
* Optional, defaults to false.
|
|
47
|
+
*/
|
|
48
|
+
asChild?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Additional class names to apply custom styles to the multi-select component.
|
|
51
|
+
* Optional, can be used to add custom styles.
|
|
52
|
+
*/
|
|
53
|
+
className?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Props to pass to the PopoverContent portal.
|
|
56
|
+
* Optional, can be used to specify container for portal rendering.
|
|
57
|
+
*/
|
|
58
|
+
popoverPortalProps?: {
|
|
59
|
+
container?: HTMLElement;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Additional class names to apply to the PopoverContent.
|
|
63
|
+
* Optional, can be used to customize the dropdown content styles.
|
|
64
|
+
*/
|
|
65
|
+
popoverContentClassName?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 当options为空数组时显示的文本
|
|
68
|
+
*/
|
|
69
|
+
emptyPlaceholderText?: string;
|
|
70
|
+
/**
|
|
71
|
+
* 在输入框中显示的占位符文本(当没有选中项时显示)
|
|
72
|
+
*/
|
|
73
|
+
placeholder?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export type { MultiSelectProps, MultiSelectOption };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OnChangeFn, PaginationState } from '@tanstack/react-table';
|
|
2
|
+
interface IPaginationProps {
|
|
3
|
+
pagination: PaginationState;
|
|
4
|
+
setPagination: OnChangeFn<PaginationState>;
|
|
5
|
+
count: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const Pagination: (props: IPaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const PaginationRoot: {
|
|
3
|
+
({ className, ...props }: React.ComponentProps<"nav">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
7
|
+
declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
8
|
+
type PaginationLinkProps = {
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & React.ComponentProps<"button">;
|
|
12
|
+
declare const PaginationLink: {
|
|
13
|
+
({ className, isActive, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
declare const PaginationPrevious: {
|
|
17
|
+
({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
declare const PaginationNext: {
|
|
21
|
+
({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
interface IPaginationEllipsisProps extends React.ComponentProps<"span"> {
|
|
25
|
+
direction: "left" | "right";
|
|
26
|
+
}
|
|
27
|
+
declare const PaginationEllipsis: {
|
|
28
|
+
({ className, direction, ...props }: IPaginationEllipsisProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export { PaginationRoot, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface PopoverConfirmProps {
|
|
3
|
+
/** 确认提示标题 */
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
/** 确认提示描述(可选) */
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
/** 确认回调 */
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
/** 取消回调 */
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
/** 确认按钮文字 */
|
|
12
|
+
confirmText?: string;
|
|
13
|
+
/** 取消按钮文字 */
|
|
14
|
+
cancelText?: string;
|
|
15
|
+
/** 图标类型 */
|
|
16
|
+
type?: "warning" | "danger" | "info";
|
|
17
|
+
/** 是否禁用 */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** 弹出位置 */
|
|
20
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
21
|
+
/** 对齐方式 */
|
|
22
|
+
align?: "start" | "center" | "end";
|
|
23
|
+
/** 子元素(触发器) */
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** 自定义 className */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** 控制显示状态(受控模式) */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** 显示状态变化回调(受控模式) */
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const PopoverConfirm: React.FC<PopoverConfirmProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export interface PopoverContentProps extends React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> {
|
|
6
|
+
popoverPortalProps?: React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Portal>;
|
|
7
|
+
zIndex?: number;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
disableAutoZIndex?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<PopoverContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
4
|
+
declare const progressVariants: (props?: ({
|
|
5
|
+
size?: "s" | "m" | "l" | null | undefined;
|
|
6
|
+
variant?: "danger" | "alert" | "info" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>, VariantProps<typeof progressVariants> {
|
|
9
|
+
/**
|
|
10
|
+
* 进度值,范围 0-100
|
|
11
|
+
*/
|
|
12
|
+
value?: number;
|
|
13
|
+
/**
|
|
14
|
+
* 是否翻转进度条方向
|
|
15
|
+
* - false: 从左往右递增(默认)
|
|
16
|
+
* - true: 从右往左递增
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
inverted?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* 是否为不确定模式(来回滑动动画)
|
|
22
|
+
* 用于无法获取真实进度的操作
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
indeterminate?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 变体颜色
|
|
28
|
+
*/
|
|
29
|
+
variant?: "info" | "alert" | "danger";
|
|
30
|
+
}
|
|
31
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export { Progress };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
+
/**
|
|
5
|
+
* 支持的值类型:string | number | boolean
|
|
6
|
+
*/
|
|
7
|
+
export type RadioValue = string | number | boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 泛型选项类型,支持 string | number | boolean
|
|
10
|
+
*/
|
|
11
|
+
export type RadioOptionGeneric<T extends RadioValue = string> = {
|
|
12
|
+
value: T;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
tooltip?: React.ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* 保持向后兼容的类型别名
|
|
20
|
+
* @deprecated 请使用 RadioOptionGeneric<T> 以获得更好的类型支持
|
|
21
|
+
*/
|
|
22
|
+
export type RadioOption = RadioOptionGeneric<string>;
|
|
23
|
+
export interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
24
|
+
value: string;
|
|
25
|
+
label?: React.ReactNode;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
checked?: boolean;
|
|
28
|
+
tooltip?: React.ReactNode;
|
|
29
|
+
variant?: string;
|
|
30
|
+
}
|
|
31
|
+
declare const RadioGroupRoot: React.ForwardRefExoticComponent<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
declare const radioGroupVariants: (props?: ({
|
|
34
|
+
variant?: "button" | "basic" | null | undefined;
|
|
35
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
36
|
+
export interface RadioGroupProps<T extends RadioValue = string> extends Omit<React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>, "value" | "defaultValue" | "onValueChange" | "onChange">, VariantProps<typeof radioGroupVariants> {
|
|
37
|
+
options: RadioOptionGeneric<T>[];
|
|
38
|
+
value?: T;
|
|
39
|
+
defaultValue?: T;
|
|
40
|
+
onValueChange?: (value: T) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Ant Design Form.Item 兼容:当被 Form.Item 包裹时会注入 onChange
|
|
43
|
+
* 内部会自动桥接到 onValueChange
|
|
44
|
+
*/
|
|
45
|
+
onChange?: (value: T) => void;
|
|
46
|
+
}
|
|
47
|
+
declare const RadioGroup: <T extends RadioValue = string>(props: RadioGroupProps<T> & React.RefAttributes<React.ElementRef<typeof RadioGroupPrimitive.Root>>) => React.ReactElement;
|
|
48
|
+
export type { RadioGroupProps as RadioGroupRootProps };
|
|
49
|
+
export { RadioGroup, RadioGroupRoot, RadioGroupItem };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DateRange } from 'react-day-picker';
|
|
2
|
+
import { PopoverPortal } from '@radix-ui/react-popover';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
interface RangePickerProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
selected?: DateRange;
|
|
7
|
+
onSelect?: (range: DateRange | undefined) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
onConfirm?: () => void;
|
|
11
|
+
onClear?: () => void;
|
|
12
|
+
popoverPortalProps?: React.ComponentPropsWithoutRef<typeof PopoverPortal>;
|
|
13
|
+
}
|
|
14
|
+
export declare function RangePicker({ className, selected, onSelect, disabled, onConfirm, placeholder: _placeholder, onClear, popoverPortalProps, }: RangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace RangePicker {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
+
/**
|
|
4
|
+
* ResizablePanelGroup - 可调整大小的面板组容器
|
|
5
|
+
* @example
|
|
6
|
+
* <ResizablePanelGroup direction="horizontal">
|
|
7
|
+
* <ResizablePanel defaultSize={75}>左侧内容</ResizablePanel>
|
|
8
|
+
* <ResizableHandle />
|
|
9
|
+
* <ResizablePanel defaultSize={25}>右侧内容</ResizablePanel>
|
|
10
|
+
* </ResizablePanelGroup>
|
|
11
|
+
*/
|
|
12
|
+
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* ResizablePanel - 可调整大小的面板
|
|
15
|
+
*/
|
|
16
|
+
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export interface ResizableHandleProps extends React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> {
|
|
18
|
+
/** 是否显示拖拽手柄图标 */
|
|
19
|
+
withHandle?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ResizableHandle - 调整大小的拖拽条
|
|
23
|
+
*/
|
|
24
|
+
declare function ResizableHandle({ withHandle, className, ...props }: ResizableHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
onClear?: () => void;
|
|
4
|
+
onSearch?: (value: string) => void;
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const SearchInput: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export { SearchInput };
|