orizon 0.1.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/README.md +101 -0
- package/dist/components/affix/Affix.d.ts +4 -0
- package/dist/components/affix/index.d.ts +2 -0
- package/dist/components/affix/types.d.ts +10 -0
- package/dist/components/alert/Alert.d.ts +4 -0
- package/dist/components/alert/ErrorBoundary.d.ts +12 -0
- package/dist/components/alert/index.d.ts +8 -0
- package/dist/components/alert/types.d.ts +45 -0
- package/dist/components/anchor/Anchor.d.ts +4 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/types.d.ts +47 -0
- package/dist/components/app/App.d.ts +13 -0
- package/dist/components/app/index.d.ts +7 -0
- package/dist/components/app/types.d.ts +9 -0
- package/dist/components/auto-complete/AutoComplete.d.ts +4 -0
- package/dist/components/auto-complete/index.d.ts +3 -0
- package/dist/components/auto-complete/types.d.ts +36 -0
- package/dist/components/avatar/Avatar.d.ts +5 -0
- package/dist/components/avatar/index.d.ts +7 -0
- package/dist/components/avatar/types.d.ts +49 -0
- package/dist/components/badge/Badge.d.ts +5 -0
- package/dist/components/badge/index.d.ts +7 -0
- package/dist/components/badge/types.d.ts +45 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +4 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/types.d.ts +35 -0
- package/dist/components/button/Button.d.ts +4 -0
- package/dist/components/button/ButtonGroup.d.ts +4 -0
- package/dist/components/button/index.d.ts +8 -0
- package/dist/components/button/types.d.ts +35 -0
- package/dist/components/calendar/Calendar.d.ts +4 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/calendar/types.d.ts +45 -0
- package/dist/components/card/Card.d.ts +6 -0
- package/dist/components/card/index.d.ts +8 -0
- package/dist/components/card/types.d.ts +53 -0
- package/dist/components/carousel/Carousel.d.ts +4 -0
- package/dist/components/carousel/index.d.ts +3 -0
- package/dist/components/carousel/types.d.ts +41 -0
- package/dist/components/cascader/Cascader.d.ts +4 -0
- package/dist/components/cascader/index.d.ts +3 -0
- package/dist/components/cascader/types.d.ts +42 -0
- package/dist/components/checkbox/Checkbox.d.ts +4 -0
- package/dist/components/checkbox/CheckboxGroup.d.ts +10 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/types.d.ts +55 -0
- package/dist/components/collapse/Collapse.d.ts +4 -0
- package/dist/components/collapse/index.d.ts +3 -0
- package/dist/components/collapse/types.d.ts +58 -0
- package/dist/components/color-picker/ColorPicker.d.ts +4 -0
- package/dist/components/color-picker/index.d.ts +3 -0
- package/dist/components/color-picker/types.d.ts +30 -0
- package/dist/components/date-picker/DatePicker.d.ts +9 -0
- package/dist/components/date-picker/RangePicker.d.ts +4 -0
- package/dist/components/date-picker/index.d.ts +8 -0
- package/dist/components/date-picker/types.d.ts +60 -0
- package/dist/components/descriptions/Descriptions.d.ts +4 -0
- package/dist/components/descriptions/index.d.ts +3 -0
- package/dist/components/descriptions/types.d.ts +55 -0
- package/dist/components/divider/Divider.d.ts +4 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/types.d.ts +19 -0
- package/dist/components/drawer/Drawer.d.ts +4 -0
- package/dist/components/drawer/index.d.ts +3 -0
- package/dist/components/drawer/types.d.ts +49 -0
- package/dist/components/dropdown/Dropdown.d.ts +4 -0
- package/dist/components/dropdown/DropdownButton.d.ts +4 -0
- package/dist/components/dropdown/index.d.ts +8 -0
- package/dist/components/dropdown/types.d.ts +76 -0
- package/dist/components/empty/Empty.d.ts +12 -0
- package/dist/components/empty/index.d.ts +8 -0
- package/dist/components/empty/types.d.ts +15 -0
- package/dist/components/flex/Flex.d.ts +4 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/types.d.ts +21 -0
- package/dist/components/float-button/BackTop.d.ts +4 -0
- package/dist/components/float-button/FloatButton.d.ts +4 -0
- package/dist/components/float-button/FloatButtonGroup.d.ts +4 -0
- package/dist/components/float-button/index.d.ts +10 -0
- package/dist/components/float-button/types.d.ts +42 -0
- package/dist/components/form/Form.d.ts +7 -0
- package/dist/components/form/FormContext.d.ts +3 -0
- package/dist/components/form/FormErrorList.d.ts +6 -0
- package/dist/components/form/FormItem.d.ts +7 -0
- package/dist/components/form/FormList.d.ts +6 -0
- package/dist/components/form/index.d.ts +16 -0
- package/dist/components/form/types.d.ts +148 -0
- package/dist/components/form/useForm.d.ts +21 -0
- package/dist/components/grid/Col.d.ts +4 -0
- package/dist/components/grid/Row.d.ts +4 -0
- package/dist/components/grid/RowContext.d.ts +4 -0
- package/dist/components/grid/index.d.ts +3 -0
- package/dist/components/grid/types.d.ts +53 -0
- package/dist/components/image/Image.d.ts +5 -0
- package/dist/components/image/index.d.ts +7 -0
- package/dist/components/image/types.d.ts +48 -0
- package/dist/components/input/Input.d.ts +4 -0
- package/dist/components/input/OTP.d.ts +4 -0
- package/dist/components/input/Password.d.ts +4 -0
- package/dist/components/input/Search.d.ts +4 -0
- package/dist/components/input/TextArea.d.ts +4 -0
- package/dist/components/input/index.d.ts +14 -0
- package/dist/components/input/types.d.ts +126 -0
- package/dist/components/input-number/InputNumber.d.ts +4 -0
- package/dist/components/input-number/index.d.ts +3 -0
- package/dist/components/input-number/types.d.ts +42 -0
- package/dist/components/layout/Layout.d.ts +7 -0
- package/dist/components/layout/Sider.d.ts +4 -0
- package/dist/components/layout/index.d.ts +11 -0
- package/dist/components/layout/types.d.ts +52 -0
- package/dist/components/list/List.d.ts +9 -0
- package/dist/components/list/index.d.ts +11 -0
- package/dist/components/list/types.d.ts +83 -0
- package/dist/components/masonry/Masonry.d.ts +4 -0
- package/dist/components/masonry/index.d.ts +3 -0
- package/dist/components/masonry/types.d.ts +11 -0
- package/dist/components/mentions/Mentions.d.ts +4 -0
- package/dist/components/mentions/index.d.ts +3 -0
- package/dist/components/mentions/types.d.ts +33 -0
- package/dist/components/menu/Menu.d.ts +4 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/types.d.ts +66 -0
- package/dist/components/message/MessageContainer.d.ts +7 -0
- package/dist/components/message/index.d.ts +8 -0
- package/dist/components/message/messageManager.d.ts +3 -0
- package/dist/components/message/types.d.ts +52 -0
- package/dist/components/message/useMessage.d.ts +3 -0
- package/dist/components/modal/ConfirmModal.d.ts +7 -0
- package/dist/components/modal/Modal.d.ts +4 -0
- package/dist/components/modal/index.d.ts +9 -0
- package/dist/components/modal/staticMethods.d.ts +6 -0
- package/dist/components/modal/types.d.ts +92 -0
- package/dist/components/modal/useModal.d.ts +3 -0
- package/dist/components/notification/NotificationContainer.d.ts +10 -0
- package/dist/components/notification/index.d.ts +8 -0
- package/dist/components/notification/notificationManager.d.ts +3 -0
- package/dist/components/notification/types.d.ts +69 -0
- package/dist/components/notification/useNotification.d.ts +3 -0
- package/dist/components/pagination/Pagination.d.ts +4 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/types.d.ts +34 -0
- package/dist/components/popconfirm/Popconfirm.d.ts +4 -0
- package/dist/components/popconfirm/index.d.ts +3 -0
- package/dist/components/popconfirm/types.d.ts +39 -0
- package/dist/components/popover/Popover.d.ts +4 -0
- package/dist/components/popover/index.d.ts +3 -0
- package/dist/components/popover/types.d.ts +31 -0
- package/dist/components/progress/Progress.d.ts +4 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/types.d.ts +39 -0
- package/dist/components/qrcode/QRCode.d.ts +4 -0
- package/dist/components/qrcode/index.d.ts +3 -0
- package/dist/components/qrcode/types.d.ts +32 -0
- package/dist/components/radio/Radio.d.ts +4 -0
- package/dist/components/radio/RadioButton.d.ts +4 -0
- package/dist/components/radio/RadioGroup.d.ts +12 -0
- package/dist/components/radio/index.d.ts +10 -0
- package/dist/components/radio/types.d.ts +72 -0
- package/dist/components/rate/Rate.d.ts +4 -0
- package/dist/components/rate/index.d.ts +3 -0
- package/dist/components/rate/types.d.ts +18 -0
- package/dist/components/result/Result.d.ts +4 -0
- package/dist/components/result/index.d.ts +3 -0
- package/dist/components/result/types.d.ts +20 -0
- package/dist/components/segmented/Segmented.d.ts +4 -0
- package/dist/components/segmented/index.d.ts +3 -0
- package/dist/components/segmented/types.d.ts +30 -0
- package/dist/components/select/Select.d.ts +4 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/types.d.ts +65 -0
- package/dist/components/skeleton/Skeleton.d.ts +4 -0
- package/dist/components/skeleton/SkeletonElements.d.ts +8 -0
- package/dist/components/skeleton/index.d.ts +12 -0
- package/dist/components/skeleton/types.d.ts +76 -0
- package/dist/components/slider/Slider.d.ts +4 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/types.d.ts +29 -0
- package/dist/components/space/Compact.d.ts +4 -0
- package/dist/components/space/Space.d.ts +4 -0
- package/dist/components/space/index.d.ts +8 -0
- package/dist/components/space/types.d.ts +30 -0
- package/dist/components/spin/Spin.d.ts +4 -0
- package/dist/components/spin/index.d.ts +3 -0
- package/dist/components/spin/types.d.ts +28 -0
- package/dist/components/splitter/Panel.d.ts +4 -0
- package/dist/components/splitter/Splitter.d.ts +4 -0
- package/dist/components/splitter/index.d.ts +8 -0
- package/dist/components/splitter/types.d.ts +25 -0
- package/dist/components/statistic/Statistic.d.ts +5 -0
- package/dist/components/statistic/index.d.ts +7 -0
- package/dist/components/statistic/types.d.ts +37 -0
- package/dist/components/steps/Steps.d.ts +4 -0
- package/dist/components/steps/index.d.ts +2 -0
- package/dist/components/steps/types.d.ts +54 -0
- package/dist/components/switch/Switch.d.ts +4 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/types.d.ts +25 -0
- package/dist/components/table/Table.d.ts +6 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/types.d.ts +162 -0
- package/dist/components/tabs/Tabs.d.ts +4 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/types.d.ts +51 -0
- package/dist/components/tag/Tag.d.ts +5 -0
- package/dist/components/tag/index.d.ts +7 -0
- package/dist/components/tag/types.d.ts +32 -0
- package/dist/components/time-picker/TimePicker.d.ts +5 -0
- package/dist/components/time-picker/TimeRangePicker.d.ts +4 -0
- package/dist/components/time-picker/index.d.ts +8 -0
- package/dist/components/time-picker/types.d.ts +48 -0
- package/dist/components/timeline/Timeline.d.ts +4 -0
- package/dist/components/timeline/index.d.ts +3 -0
- package/dist/components/timeline/types.d.ts +35 -0
- package/dist/components/tooltip/Tooltip.d.ts +4 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/types.d.ts +33 -0
- package/dist/components/tour/Tour.d.ts +4 -0
- package/dist/components/tour/index.d.ts +3 -0
- package/dist/components/tour/types.d.ts +63 -0
- package/dist/components/transfer/Transfer.d.ts +4 -0
- package/dist/components/transfer/index.d.ts +3 -0
- package/dist/components/transfer/types.d.ts +40 -0
- package/dist/components/tree/Tree.d.ts +5 -0
- package/dist/components/tree/index.d.ts +7 -0
- package/dist/components/tree/types.d.ts +103 -0
- package/dist/components/tree-select/TreeSelect.d.ts +4 -0
- package/dist/components/tree-select/index.d.ts +3 -0
- package/dist/components/tree-select/types.d.ts +48 -0
- package/dist/components/typography/Typography.d.ts +12 -0
- package/dist/components/typography/index.d.ts +10 -0
- package/dist/components/typography/types.d.ts +92 -0
- package/dist/components/upload/Dragger.d.ts +4 -0
- package/dist/components/upload/Upload.d.ts +4 -0
- package/dist/components/upload/index.d.ts +8 -0
- package/dist/components/upload/types.d.ts +59 -0
- package/dist/components/watermark/Watermark.d.ts +4 -0
- package/dist/components/watermark/index.d.ts +3 -0
- package/dist/components/watermark/types.d.ts +43 -0
- package/dist/config-provider/ConfigProvider.d.ts +5 -0
- package/dist/config-provider/context.d.ts +7 -0
- package/dist/config-provider/index.d.ts +3 -0
- package/dist/config-provider/theme.d.ts +7 -0
- package/dist/config-provider/types.d.ts +23 -0
- package/dist/hooks/useComponentSize.d.ts +2 -0
- package/dist/hooks/useConfig.d.ts +1 -0
- package/dist/index.d.ts +138 -0
- package/dist/orizon.cjs.js +244 -0
- package/dist/orizon.es.js +61213 -0
- package/dist/preset.css +160 -0
- package/dist/vite.svg +1 -0
- package/package.json +96 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties, MouseEvent } from 'react';
|
|
2
|
+
import { ButtonProps } from '../button';
|
|
3
|
+
export type ModalType = "confirm" | "info" | "success" | "error" | "warning";
|
|
4
|
+
export interface ModalProps {
|
|
5
|
+
/** Whether the modal is visible */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** Callback when OK button is clicked */
|
|
8
|
+
onOk?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
/** Callback when Cancel button or close is triggered */
|
|
10
|
+
onCancel?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
/** Title of the modal */
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** Footer content. Pass null to hide footer. */
|
|
14
|
+
footer?: ReactNode | null | ((originNode: ReactNode, extra: {
|
|
15
|
+
OkBtn: React.FC;
|
|
16
|
+
CancelBtn: React.FC;
|
|
17
|
+
}) => ReactNode);
|
|
18
|
+
/** Width of the modal */
|
|
19
|
+
width?: string | number;
|
|
20
|
+
/** Whether to center the modal vertically */
|
|
21
|
+
centered?: boolean;
|
|
22
|
+
/** Whether to show close button */
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
/** Custom close icon */
|
|
25
|
+
closeIcon?: ReactNode;
|
|
26
|
+
/** Whether OK button shows loading */
|
|
27
|
+
confirmLoading?: boolean;
|
|
28
|
+
/** Destroy child elements when closed */
|
|
29
|
+
destroyOnHidden?: boolean;
|
|
30
|
+
/** Whether to show mask */
|
|
31
|
+
mask?: boolean;
|
|
32
|
+
/** Whether clicking mask closes the modal */
|
|
33
|
+
maskClosable?: boolean;
|
|
34
|
+
/** OK button text */
|
|
35
|
+
okText?: ReactNode;
|
|
36
|
+
/** Cancel button text */
|
|
37
|
+
cancelText?: ReactNode;
|
|
38
|
+
/** OK button type */
|
|
39
|
+
okType?: ButtonProps["type"];
|
|
40
|
+
/** OK button extra props */
|
|
41
|
+
okButtonProps?: Partial<ButtonProps>;
|
|
42
|
+
/** Cancel button extra props */
|
|
43
|
+
cancelButtonProps?: Partial<ButtonProps>;
|
|
44
|
+
/** Callback after close animation */
|
|
45
|
+
afterClose?: () => void;
|
|
46
|
+
/** Callback after open/close animation */
|
|
47
|
+
afterOpenChange?: (open: boolean) => void;
|
|
48
|
+
/** Whether to support keyboard (Esc to close) */
|
|
49
|
+
keyboard?: boolean;
|
|
50
|
+
/** z-index of the modal */
|
|
51
|
+
zIndex?: number;
|
|
52
|
+
/** Show loading state */
|
|
53
|
+
loading?: boolean;
|
|
54
|
+
/** Custom modal render */
|
|
55
|
+
modalRender?: (node: ReactNode) => ReactNode;
|
|
56
|
+
/** Wrapper class name */
|
|
57
|
+
wrapClassName?: string;
|
|
58
|
+
/** Children content */
|
|
59
|
+
children?: ReactNode;
|
|
60
|
+
/** Extra class name */
|
|
61
|
+
className?: string;
|
|
62
|
+
/** Inline style */
|
|
63
|
+
style?: CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
export interface ModalStaticConfig extends Omit<ModalProps, "open"> {
|
|
66
|
+
/** Content of the modal */
|
|
67
|
+
content?: ReactNode;
|
|
68
|
+
/** Type of the modal */
|
|
69
|
+
type?: ModalType;
|
|
70
|
+
/** Custom icon */
|
|
71
|
+
icon?: ReactNode;
|
|
72
|
+
/** Auto focus the OK button */
|
|
73
|
+
autoFocusButton?: "ok" | "cancel" | null;
|
|
74
|
+
}
|
|
75
|
+
export interface ModalStaticFunctions {
|
|
76
|
+
confirm: (config: ModalStaticConfig) => ModalReturnType;
|
|
77
|
+
info: (config: ModalStaticConfig) => ModalReturnType;
|
|
78
|
+
success: (config: ModalStaticConfig) => ModalReturnType;
|
|
79
|
+
error: (config: ModalStaticConfig) => ModalReturnType;
|
|
80
|
+
warning: (config: ModalStaticConfig) => ModalReturnType;
|
|
81
|
+
}
|
|
82
|
+
export interface ModalReturnType {
|
|
83
|
+
destroy: () => void;
|
|
84
|
+
update: (config: Partial<ModalStaticConfig>) => void;
|
|
85
|
+
}
|
|
86
|
+
export interface ModalHookAPI {
|
|
87
|
+
confirm: (config: ModalStaticConfig) => ModalReturnType;
|
|
88
|
+
info: (config: ModalStaticConfig) => ModalReturnType;
|
|
89
|
+
success: (config: ModalStaticConfig) => ModalReturnType;
|
|
90
|
+
error: (config: ModalStaticConfig) => ModalReturnType;
|
|
91
|
+
warning: (config: ModalStaticConfig) => ModalReturnType;
|
|
92
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NotificationInstance, NotificationPlacement } from './types';
|
|
2
|
+
interface NotificationContainerProps {
|
|
3
|
+
notifications: NotificationInstance[];
|
|
4
|
+
placement: NotificationPlacement;
|
|
5
|
+
top?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
onClose: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function NotificationContainer({ notifications, placement, top, bottom, onClose, }: NotificationContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useNotification } from './useNotification';
|
|
2
|
+
import { NotificationAPI } from './types';
|
|
3
|
+
type NotificationApiWithHook = NotificationAPI & {
|
|
4
|
+
useNotification: typeof useNotification;
|
|
5
|
+
};
|
|
6
|
+
declare const notification: NotificationApiWithHook;
|
|
7
|
+
export { notification };
|
|
8
|
+
export type { NotificationAPI, NotificationConfig, NotificationGlobalConfig, NotificationType, NotificationPlacement, } from './types';
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type NotificationType = "success" | "error" | "info" | "warning";
|
|
3
|
+
export type NotificationPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight";
|
|
4
|
+
export interface NotificationConfig {
|
|
5
|
+
/** Notification title */
|
|
6
|
+
message?: ReactNode;
|
|
7
|
+
/** Alias for message */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/** Description content */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** Duration in seconds (0 means no auto-close) */
|
|
12
|
+
duration?: number;
|
|
13
|
+
/** Placement of the notification */
|
|
14
|
+
placement?: NotificationPlacement;
|
|
15
|
+
/** Custom icon */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
/** Unique key */
|
|
18
|
+
key?: string | number;
|
|
19
|
+
/** Action buttons area */
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
/** Show countdown progress bar */
|
|
22
|
+
showProgress?: boolean;
|
|
23
|
+
/** Pause countdown on hover */
|
|
24
|
+
pauseOnHover?: boolean;
|
|
25
|
+
/** Extra class name */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** Inline style */
|
|
28
|
+
style?: CSSProperties;
|
|
29
|
+
/** Click handler */
|
|
30
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
31
|
+
/** Called when notification closes */
|
|
32
|
+
onClose?: () => void;
|
|
33
|
+
/** Notification type */
|
|
34
|
+
type?: NotificationType;
|
|
35
|
+
/** Whether to show close button */
|
|
36
|
+
closable?: boolean;
|
|
37
|
+
/** Custom close icon */
|
|
38
|
+
closeIcon?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
export interface NotificationGlobalConfig {
|
|
41
|
+
/** Bottom offset */
|
|
42
|
+
bottom?: number;
|
|
43
|
+
/** Top offset */
|
|
44
|
+
top?: number;
|
|
45
|
+
/** Default placement */
|
|
46
|
+
placement?: NotificationPlacement;
|
|
47
|
+
/** Maximum count */
|
|
48
|
+
maxCount?: number;
|
|
49
|
+
/** Stack behavior */
|
|
50
|
+
stack?: boolean | {
|
|
51
|
+
threshold?: number;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface NotificationAPI {
|
|
55
|
+
success: (config: NotificationConfig) => void;
|
|
56
|
+
error: (config: NotificationConfig) => void;
|
|
57
|
+
info: (config: NotificationConfig) => void;
|
|
58
|
+
warning: (config: NotificationConfig) => void;
|
|
59
|
+
open: (config: NotificationConfig) => void;
|
|
60
|
+
destroy: (key?: string | number) => void;
|
|
61
|
+
config: (options: NotificationGlobalConfig) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface NotificationInstance {
|
|
64
|
+
id: string;
|
|
65
|
+
config: NotificationConfig;
|
|
66
|
+
type?: NotificationType;
|
|
67
|
+
closing: boolean;
|
|
68
|
+
createdAt: number;
|
|
69
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type PaginationSize = "small" | "default";
|
|
3
|
+
export interface PaginationProps {
|
|
4
|
+
/** Current page number (controlled) */
|
|
5
|
+
current?: number;
|
|
6
|
+
/** Default current page (uncontrolled) */
|
|
7
|
+
defaultCurrent?: number;
|
|
8
|
+
/** Number of items per page */
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
/** Default page size (uncontrolled) */
|
|
11
|
+
defaultPageSize?: number;
|
|
12
|
+
/** Total number of data items */
|
|
13
|
+
total: number;
|
|
14
|
+
/** Show a page size select */
|
|
15
|
+
showSizeChanger?: boolean;
|
|
16
|
+
/** Available page sizes for the size changer */
|
|
17
|
+
pageSizeOptions?: number[];
|
|
18
|
+
/** Show a quick jumper input */
|
|
19
|
+
showQuickJumper?: boolean;
|
|
20
|
+
/** Show total count; can be a render function */
|
|
21
|
+
showTotal?: (total: number, range: [number, number]) => ReactNode;
|
|
22
|
+
/** Simple mode (no page numbers) */
|
|
23
|
+
simple?: boolean;
|
|
24
|
+
/** Callback when page or pageSize changes */
|
|
25
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
26
|
+
/** Callback when pageSize changes */
|
|
27
|
+
onShowSizeChange?: (current: number, size: number) => void;
|
|
28
|
+
/** Whether pagination is disabled */
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/** Size of pagination */
|
|
31
|
+
size?: PaginationSize;
|
|
32
|
+
/** Extra class name */
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonProps } from '../button';
|
|
3
|
+
export type PopconfirmPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
4
|
+
export interface PopconfirmProps {
|
|
5
|
+
/** Title of the confirm popup */
|
|
6
|
+
title: ReactNode | (() => ReactNode);
|
|
7
|
+
/** Description text */
|
|
8
|
+
description?: ReactNode | (() => ReactNode);
|
|
9
|
+
/** Callback when OK is clicked */
|
|
10
|
+
onConfirm?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
/** Callback when Cancel is clicked */
|
|
12
|
+
onCancel?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
/** OK button text */
|
|
14
|
+
okText?: ReactNode;
|
|
15
|
+
/** Cancel button text */
|
|
16
|
+
cancelText?: ReactNode;
|
|
17
|
+
/** OK button type */
|
|
18
|
+
okType?: ButtonProps["type"];
|
|
19
|
+
/** OK button extra props */
|
|
20
|
+
okButtonProps?: Partial<ButtonProps>;
|
|
21
|
+
/** Cancel button extra props */
|
|
22
|
+
cancelButtonProps?: Partial<ButtonProps>;
|
|
23
|
+
/** Custom icon */
|
|
24
|
+
icon?: ReactNode;
|
|
25
|
+
/** Whether the popconfirm is disabled */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Placement of the popup */
|
|
28
|
+
placement?: PopconfirmPlacement;
|
|
29
|
+
/** Controlled open state */
|
|
30
|
+
open?: boolean;
|
|
31
|
+
/** Callback when open state changes */
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
/** Whether to show cancel button */
|
|
34
|
+
showCancel?: boolean;
|
|
35
|
+
/** Trigger element */
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
/** Extra class name */
|
|
38
|
+
className?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type PopoverPlacement = "top" | "topLeft" | "topRight" | "bottom" | "bottomLeft" | "bottomRight" | "left" | "leftTop" | "leftBottom" | "right" | "rightTop" | "rightBottom";
|
|
3
|
+
export type PopoverTrigger = "hover" | "focus" | "click";
|
|
4
|
+
export interface PopoverProps {
|
|
5
|
+
/** Popover body content */
|
|
6
|
+
content?: ReactNode | (() => ReactNode);
|
|
7
|
+
/** Popover title */
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/** Trigger mode */
|
|
10
|
+
trigger?: PopoverTrigger;
|
|
11
|
+
/** Placement */
|
|
12
|
+
placement?: PopoverPlacement;
|
|
13
|
+
/** Controlled open state */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/** Default open state */
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
/** Callback when open changes */
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
/** Whether to show arrow */
|
|
20
|
+
arrow?: boolean;
|
|
21
|
+
/** Overlay class name */
|
|
22
|
+
overlayClassName?: string;
|
|
23
|
+
/** Overlay style */
|
|
24
|
+
overlayStyle?: CSSProperties;
|
|
25
|
+
/** Mouse enter delay (seconds) */
|
|
26
|
+
mouseEnterDelay?: number;
|
|
27
|
+
/** Mouse leave delay (seconds) */
|
|
28
|
+
mouseLeaveDelay?: number;
|
|
29
|
+
/** Children trigger element */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const Progress: import('react').ForwardRefExoticComponent<import('./types').ProgressProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
|
+
export { Progress };
|
|
3
|
+
export type { ProgressProps, ProgressType, ProgressStatus, ProgressStrokeLinecap, ProgressSuccessConfig, ProgressSize, } from './types';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type ProgressType = "line" | "circle" | "dashboard";
|
|
3
|
+
export type ProgressStatus = "success" | "exception" | "normal" | "active";
|
|
4
|
+
export type ProgressStrokeLinecap = "round" | "butt" | "square";
|
|
5
|
+
export interface ProgressSuccessConfig {
|
|
6
|
+
percent?: number;
|
|
7
|
+
strokeColor?: string;
|
|
8
|
+
}
|
|
9
|
+
export type ProgressSize = "small" | "default" | [number, number];
|
|
10
|
+
export interface ProgressProps {
|
|
11
|
+
/** Completion percentage */
|
|
12
|
+
percent?: number;
|
|
13
|
+
/** Type of progress bar */
|
|
14
|
+
type?: ProgressType;
|
|
15
|
+
/** Status of the progress */
|
|
16
|
+
status?: ProgressStatus;
|
|
17
|
+
/** Stroke color */
|
|
18
|
+
strokeColor?: string | string[] | Record<string, string>;
|
|
19
|
+
/** Whether to show info text */
|
|
20
|
+
showInfo?: boolean;
|
|
21
|
+
/** Size of the progress */
|
|
22
|
+
size?: ProgressSize;
|
|
23
|
+
/** Number of steps (for segmented line) */
|
|
24
|
+
steps?: number;
|
|
25
|
+
/** Custom format function */
|
|
26
|
+
format?: (percent?: number, successPercent?: number) => ReactNode;
|
|
27
|
+
/** Stroke linecap style */
|
|
28
|
+
strokeLinecap?: ProgressStrokeLinecap;
|
|
29
|
+
/** Success segment config */
|
|
30
|
+
success?: ProgressSuccessConfig;
|
|
31
|
+
/** Rail (track) color */
|
|
32
|
+
railColor?: string;
|
|
33
|
+
/** Stroke width in px */
|
|
34
|
+
strokeWidth?: number;
|
|
35
|
+
/** Extra class name */
|
|
36
|
+
className?: string;
|
|
37
|
+
/** Inline style */
|
|
38
|
+
style?: CSSProperties;
|
|
39
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type QRCodeErrorLevel = "L" | "M" | "Q" | "H";
|
|
3
|
+
export type QRCodeStatus = "active" | "expired" | "loading" | "scanned";
|
|
4
|
+
export type QRCodeType = "canvas" | "svg";
|
|
5
|
+
export interface QRCodeProps {
|
|
6
|
+
/** The value/URL to encode in the QR code */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Size in pixels */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** QR code color */
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Background color */
|
|
13
|
+
bgColor?: string;
|
|
14
|
+
/** Whether to show border */
|
|
15
|
+
bordered?: boolean;
|
|
16
|
+
/** Error correction level */
|
|
17
|
+
errorLevel?: QRCodeErrorLevel;
|
|
18
|
+
/** Center icon URL */
|
|
19
|
+
icon?: string;
|
|
20
|
+
/** Icon size in pixels */
|
|
21
|
+
iconSize?: number;
|
|
22
|
+
/** Status of the QR code */
|
|
23
|
+
status?: QRCodeStatus;
|
|
24
|
+
/** Render type */
|
|
25
|
+
type?: QRCodeType;
|
|
26
|
+
/** Callback when refresh is clicked for expired status */
|
|
27
|
+
onRefresh?: () => void;
|
|
28
|
+
/** Extra class name */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Style */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RadioGroupProps, ComponentSize } from './types';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface RadioGroupContextValue {
|
|
4
|
+
value: any;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
onChange: (value: any) => void;
|
|
7
|
+
buttonStyle?: "outline" | "solid";
|
|
8
|
+
size?: ComponentSize;
|
|
9
|
+
}
|
|
10
|
+
export declare const RadioGroupContext: React.Context<RadioGroupContextValue | null>;
|
|
11
|
+
declare const InternalRadioGroup: React.FC<RadioGroupProps>;
|
|
12
|
+
export { InternalRadioGroup };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InternalRadio } from './Radio';
|
|
2
|
+
import { InternalRadioGroup } from './RadioGroup';
|
|
3
|
+
import { RadioButton } from './RadioButton';
|
|
4
|
+
type RadioComponent = typeof InternalRadio & {
|
|
5
|
+
Group: typeof InternalRadioGroup;
|
|
6
|
+
Button: typeof RadioButton;
|
|
7
|
+
};
|
|
8
|
+
declare const Radio: RadioComponent;
|
|
9
|
+
export { Radio };
|
|
10
|
+
export type { RadioProps, RadioGroupProps, RadioButtonProps, RadioChangeEvent, RadioOptionType, } from './types';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ComponentSize = "small" | "middle" | "large";
|
|
3
|
+
export interface RadioChangeEvent {
|
|
4
|
+
target: {
|
|
5
|
+
checked: boolean;
|
|
6
|
+
value: any;
|
|
7
|
+
};
|
|
8
|
+
stopPropagation: () => void;
|
|
9
|
+
preventDefault: () => void;
|
|
10
|
+
nativeEvent: Event | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface RadioProps {
|
|
13
|
+
/** Whether the radio is checked (controlled) */
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/** Default checked state (uncontrolled) */
|
|
16
|
+
defaultChecked?: boolean;
|
|
17
|
+
/** Whether the radio is disabled */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Value of this radio */
|
|
20
|
+
value?: any;
|
|
21
|
+
/** Callback when state changes */
|
|
22
|
+
onChange?: (e: RadioChangeEvent) => void;
|
|
23
|
+
/** Label content */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/** Additional class name */
|
|
26
|
+
className?: string;
|
|
27
|
+
/** ID attribute */
|
|
28
|
+
id?: string;
|
|
29
|
+
/** Name attribute */
|
|
30
|
+
name?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RadioOptionType {
|
|
33
|
+
label: ReactNode;
|
|
34
|
+
value: string | number;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface RadioGroupProps {
|
|
38
|
+
/** Options to render */
|
|
39
|
+
options?: (string | number | RadioOptionType)[];
|
|
40
|
+
/** Controlled selected value */
|
|
41
|
+
value?: any;
|
|
42
|
+
/** Default selected value */
|
|
43
|
+
defaultValue?: any;
|
|
44
|
+
/** Callback when selected value changes */
|
|
45
|
+
onChange?: (e: RadioChangeEvent) => void;
|
|
46
|
+
/** Render as button-styled options */
|
|
47
|
+
optionType?: "default" | "button";
|
|
48
|
+
/** Button style variant (only when optionType="button") */
|
|
49
|
+
buttonStyle?: "outline" | "solid";
|
|
50
|
+
/** Size of the radio group */
|
|
51
|
+
size?: ComponentSize;
|
|
52
|
+
/** Disable all radios in the group */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/** Whether buttons take full width */
|
|
55
|
+
block?: boolean;
|
|
56
|
+
/** Additional class name */
|
|
57
|
+
className?: string;
|
|
58
|
+
/** Name attribute for all radios */
|
|
59
|
+
name?: string;
|
|
60
|
+
/** Child content (alternative to options prop) */
|
|
61
|
+
children?: ReactNode;
|
|
62
|
+
}
|
|
63
|
+
export interface RadioButtonProps {
|
|
64
|
+
/** Value of this radio button */
|
|
65
|
+
value: any;
|
|
66
|
+
/** Whether the radio button is disabled */
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
/** Label content */
|
|
69
|
+
children?: ReactNode;
|
|
70
|
+
/** Additional class name */
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface RateProps {
|
|
3
|
+
value?: number;
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
count?: number;
|
|
7
|
+
allowHalf?: boolean;
|
|
8
|
+
allowClear?: boolean;
|
|
9
|
+
character?: ReactNode | ((info: {
|
|
10
|
+
index: number;
|
|
11
|
+
value: number;
|
|
12
|
+
}) => ReactNode);
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
tooltips?: string[];
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
onHoverChange?: (value: number) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type ResultStatus = "success" | "error" | "info" | "warning" | 404 | 403 | 500;
|
|
3
|
+
export interface ResultProps {
|
|
4
|
+
/** Result status */
|
|
5
|
+
status?: ResultStatus;
|
|
6
|
+
/** Title text */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** Sub title text */
|
|
9
|
+
subTitle?: ReactNode;
|
|
10
|
+
/** Custom icon */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Extra action area */
|
|
13
|
+
extra?: ReactNode;
|
|
14
|
+
/** Children content */
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
/** Extra class name */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Inline style */
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
export type SegmentedSize = "large" | "middle" | "small";
|
|
3
|
+
export interface SegmentedOption {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: string | number;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export type SegmentedOptionType = string | number | SegmentedOption;
|
|
11
|
+
export interface SegmentedProps {
|
|
12
|
+
/** Options for the segmented control */
|
|
13
|
+
options: SegmentedOptionType[];
|
|
14
|
+
/** Currently selected value (controlled) */
|
|
15
|
+
value?: string | number;
|
|
16
|
+
/** Default selected value */
|
|
17
|
+
defaultValue?: string | number;
|
|
18
|
+
/** Callback when selection changes */
|
|
19
|
+
onChange?: (value: string | number) => void;
|
|
20
|
+
/** Full width */
|
|
21
|
+
block?: boolean;
|
|
22
|
+
/** Disable all options */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Size */
|
|
25
|
+
size?: SegmentedSize;
|
|
26
|
+
/** Extra class name */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** Style */
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
}
|