@996-design/996-ui 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/NOTICE.md +35 -0
- package/README.md +31 -0
- package/dist/cjs/index.cjs +4228 -0
- package/dist/cjs/index.cjs.map +41 -0
- package/dist/cjs/legacy-index.cjs +17297 -0
- package/dist/cjs/legacy-index.cjs.map +96 -0
- package/dist/cjs/pro/index.cjs +8544 -0
- package/dist/cjs/pro/index.cjs.map +35 -0
- package/dist/esm/index.js +4063 -0
- package/dist/esm/index.js.map +41 -0
- package/dist/esm/legacy-index.js +17294 -0
- package/dist/esm/legacy-index.js.map +96 -0
- package/dist/esm/pro/index.js +8554 -0
- package/dist/esm/pro/index.js.map +35 -0
- package/dist/styles.css +5816 -0
- package/dist/theme.css +601 -0
- package/dist/types/ConfigProvider.d.ts +195 -0
- package/dist/types/antd-theme.d.ts +12 -0
- package/dist/types/components/Alert.d.ts +51 -0
- package/dist/types/components/Avatar.d.ts +44 -0
- package/dist/types/components/Badge.d.ts +31 -0
- package/dist/types/components/Breadcrumb.d.ts +45 -0
- package/dist/types/components/Button.d.ts +42 -0
- package/dist/types/components/ButtonGroup.d.ts +13 -0
- package/dist/types/components/Card.d.ts +55 -0
- package/dist/types/components/Carousel.d.ts +70 -0
- package/dist/types/components/Checkbox.d.ts +43 -0
- package/dist/types/components/Collapse.d.ts +23 -0
- package/dist/types/components/ColorPicker.d.ts +143 -0
- package/dist/types/components/DataDisplayPrimitives.d.ts +205 -0
- package/dist/types/components/DataEntryPrimitives.d.ts +454 -0
- package/dist/types/components/Divider.d.ts +24 -0
- package/dist/types/components/Drawer.d.ts +68 -0
- package/dist/types/components/Dropdown.d.ts +41 -0
- package/dist/types/components/Empty.d.ts +14 -0
- package/dist/types/components/EmptyState.d.ts +6 -0
- package/dist/types/components/FeedbackPrimitives.d.ts +102 -0
- package/dist/types/components/Form.d.ts +67 -0
- package/dist/types/components/GameCover.d.ts +8 -0
- package/dist/types/components/Grid.d.ts +50 -0
- package/dist/types/components/Icon.d.ts +13 -0
- package/dist/types/components/IconButton.d.ts +14 -0
- package/dist/types/components/Input.d.ts +110 -0
- package/dist/types/components/InputNumber.d.ts +29 -0
- package/dist/types/components/LayoutPrimitives.d.ts +130 -0
- package/dist/types/components/List.d.ts +64 -0
- package/dist/types/components/Masonry.d.ts +43 -0
- package/dist/types/components/MenuList.d.ts +24 -0
- package/dist/types/components/Message.d.ts +58 -0
- package/dist/types/components/MessageToast.d.ts +27 -0
- package/dist/types/components/Modal.d.ts +123 -0
- package/dist/types/components/NavigationPrimitives.d.ts +73 -0
- package/dist/types/components/OtherPrimitives.d.ts +36 -0
- package/dist/types/components/Pagination.d.ts +18 -0
- package/dist/types/components/Panel.d.ts +8 -0
- package/dist/types/components/Popconfirm.d.ts +18 -0
- package/dist/types/components/Popover.d.ts +10 -0
- package/dist/types/components/PriceText.d.ts +9 -0
- package/dist/types/components/Progress.d.ts +57 -0
- package/dist/types/components/ProgressBar.d.ts +8 -0
- package/dist/types/components/ProgressButton.d.ts +9 -0
- package/dist/types/components/Radio.d.ts +67 -0
- package/dist/types/components/Rate.d.ts +17 -0
- package/dist/types/components/Result.d.ts +11 -0
- package/dist/types/components/SectionHeader.d.ts +11 -0
- package/dist/types/components/Segmented.d.ts +41 -0
- package/dist/types/components/SegmentedTabs.d.ts +42 -0
- package/dist/types/components/SelectInput.d.ts +33 -0
- package/dist/types/components/Skeleton.d.ts +54 -0
- package/dist/types/components/Slider.d.ts +48 -0
- package/dist/types/components/Spin.d.ts +21 -0
- package/dist/types/components/Splitter.d.ts +7 -0
- package/dist/types/components/StatCard.d.ts +10 -0
- package/dist/types/components/Statistic.d.ts +48 -0
- package/dist/types/components/StatusItem.d.ts +12 -0
- package/dist/types/components/Steps.d.ts +40 -0
- package/dist/types/components/Switch.d.ts +41 -0
- package/dist/types/components/Table.d.ts +61 -0
- package/dist/types/components/Tabs.d.ts +50 -0
- package/dist/types/components/Tag.d.ts +52 -0
- package/dist/types/components/TagPill.d.ts +7 -0
- package/dist/types/components/Tooltip.d.ts +64 -0
- package/dist/types/components/Typography.d.ts +374 -0
- package/dist/types/components/affix/utils.d.ts +10 -0
- package/dist/types/components/feedback/FloatButton.d.ts +51 -0
- package/dist/types/components/feedback/Watermark.d.ts +33 -0
- package/dist/types/components/feedback/globalHolder.d.ts +17 -0
- package/dist/types/components/form/statusContext.d.ts +18 -0
- package/dist/types/components/form/statusContext.type-smoke.d.ts +24 -0
- package/dist/types/components/splitter/Panel.d.ts +6 -0
- package/dist/types/components/splitter/SplitBar.d.ts +32 -0
- package/dist/types/components/splitter/interface.d.ts +89 -0
- package/dist/types/components/splitter/sizeUtil.d.ts +5 -0
- package/dist/types/components/splitter/useItems.d.ts +3 -0
- package/dist/types/components/splitter/useResizable.d.ts +9 -0
- package/dist/types/components/splitter/useResize.d.ts +9 -0
- package/dist/types/components/splitter/useSizes.d.ts +11 -0
- package/dist/types/components/table/columnState.d.ts +36 -0
- package/dist/types/components/table/pagination.d.ts +34 -0
- package/dist/types/components/table/selection.d.ts +23 -0
- package/dist/types/components/table/types.d.ts +163 -0
- package/dist/types/hooks/useReducedMotion.d.ts +1 -0
- package/dist/types/index.d.ts +44 -0
- package/dist/types/legacy-index.d.ts +136 -0
- package/dist/types/pro/index.d.ts +17 -0
- package/dist/types/tokens.d.ts +266 -0
- package/dist/types/utils/cn.d.ts +3 -0
- package/dist/types/utils/slots.d.ts +5 -0
- package/package.json +126 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
3
|
+
export interface MenuListItem {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly label: ReactNode;
|
|
6
|
+
readonly description?: ReactNode;
|
|
7
|
+
readonly avatar?: ReactNode;
|
|
8
|
+
readonly suffix?: ReactNode;
|
|
9
|
+
readonly disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type MenuListSlot = "root" | "item" | "avatar" | "content" | "label" | "description" | "suffix";
|
|
12
|
+
export interface MenuListProps {
|
|
13
|
+
readonly activeId?: string;
|
|
14
|
+
readonly className?: string;
|
|
15
|
+
readonly classNames?: SlotClassNames<MenuListSlot>;
|
|
16
|
+
readonly disabled?: boolean;
|
|
17
|
+
readonly items: readonly MenuListItem[];
|
|
18
|
+
readonly style?: CSSProperties;
|
|
19
|
+
readonly styles?: SlotStyles<MenuListSlot>;
|
|
20
|
+
readonly variant?: "menu" | "user" | "dropdown";
|
|
21
|
+
readonly onSelect?: (id: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function MenuList({ activeId, className, classNames, disabled, items, onSelect, style, styles, variant, }: MenuListProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { CSSProperties, Key, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type MessageNoticeType, type MessageType } from "./MessageToast";
|
|
3
|
+
export type { MessageType } from "./MessageToast";
|
|
4
|
+
export type NoticeType = MessageNoticeType;
|
|
5
|
+
type MessageSemanticSlot = "list" | "listContent" | "root" | "wrapper" | "icon" | "title";
|
|
6
|
+
export type MessageClassNames = Partial<Record<MessageSemanticSlot, string>>;
|
|
7
|
+
export type MessageStyles = Partial<Record<MessageSemanticSlot, CSSProperties>>;
|
|
8
|
+
type SemanticValue<Value, Props> = Value | ((info: {
|
|
9
|
+
readonly props: Props;
|
|
10
|
+
}) => Value);
|
|
11
|
+
export interface ConfigOptions {
|
|
12
|
+
readonly classNames?: SemanticValue<MessageClassNames, ArgsProps>;
|
|
13
|
+
readonly duration?: number;
|
|
14
|
+
readonly getContainer?: () => HTMLElement;
|
|
15
|
+
readonly maxCount?: number;
|
|
16
|
+
readonly pauseOnHover?: boolean;
|
|
17
|
+
readonly prefixCls?: string;
|
|
18
|
+
readonly rtl?: boolean;
|
|
19
|
+
readonly stack?: boolean | {
|
|
20
|
+
readonly threshold?: number;
|
|
21
|
+
};
|
|
22
|
+
readonly styles?: SemanticValue<MessageStyles, ArgsProps>;
|
|
23
|
+
readonly top?: number | string;
|
|
24
|
+
readonly transitionName?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ArgsProps {
|
|
27
|
+
readonly className?: string;
|
|
28
|
+
readonly classNames?: SemanticValue<MessageClassNames, ArgsProps>;
|
|
29
|
+
readonly content: ReactNode;
|
|
30
|
+
readonly duration?: number;
|
|
31
|
+
readonly icon?: ReactNode;
|
|
32
|
+
readonly key?: Key;
|
|
33
|
+
readonly onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
34
|
+
readonly onClose?: () => void;
|
|
35
|
+
readonly pauseOnHover?: boolean;
|
|
36
|
+
readonly style?: CSSProperties;
|
|
37
|
+
readonly styles?: SemanticValue<MessageStyles, ArgsProps>;
|
|
38
|
+
readonly type?: NoticeType;
|
|
39
|
+
}
|
|
40
|
+
export type MessageArgs = ArgsProps;
|
|
41
|
+
export type JointContent = ReactNode | ArgsProps;
|
|
42
|
+
export type TypeOpen = (content: JointContent, duration?: number | VoidFunction, onClose?: VoidFunction) => MessageType;
|
|
43
|
+
export type MessageOpen = TypeOpen;
|
|
44
|
+
export interface MessageInstance {
|
|
45
|
+
readonly destroy: (key?: Key) => void;
|
|
46
|
+
readonly error: TypeOpen;
|
|
47
|
+
readonly info: TypeOpen;
|
|
48
|
+
readonly loading: TypeOpen;
|
|
49
|
+
readonly open: (args: ArgsProps) => MessageType;
|
|
50
|
+
readonly success: TypeOpen;
|
|
51
|
+
readonly warning: TypeOpen;
|
|
52
|
+
}
|
|
53
|
+
export declare function useMessage(messageConfig?: ConfigOptions): readonly [MessageInstance, ReactElement];
|
|
54
|
+
export interface MessageMethods extends MessageInstance {
|
|
55
|
+
readonly config: (config: ConfigOptions) => void;
|
|
56
|
+
readonly useMessage: typeof useMessage;
|
|
57
|
+
}
|
|
58
|
+
export declare const message: MessageMethods;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { NotificationProps as RcNotificationProps } from "@rc-component/notification";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
4
|
+
export type MessageNoticeType = "success" | "warning" | "error" | "info" | "loading";
|
|
5
|
+
export interface MessageType extends PromiseLike<boolean> {
|
|
6
|
+
(): void;
|
|
7
|
+
}
|
|
8
|
+
type MessageToastRole = NonNullable<RcNotificationProps["role"]> & ("alert" | "status");
|
|
9
|
+
type MessageToastSlot = "root" | "icon" | "content" | "action" | "close";
|
|
10
|
+
export interface MessageToastProps {
|
|
11
|
+
readonly action?: ReactNode;
|
|
12
|
+
readonly children: ReactNode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
readonly classNames?: SlotClassNames<MessageToastSlot>;
|
|
15
|
+
readonly closable?: boolean;
|
|
16
|
+
readonly closeIcon?: ReactNode;
|
|
17
|
+
readonly icon?: ReactNode;
|
|
18
|
+
readonly onClose?: () => void;
|
|
19
|
+
readonly open?: boolean;
|
|
20
|
+
readonly role?: MessageToastRole;
|
|
21
|
+
readonly showIcon?: boolean;
|
|
22
|
+
readonly styles?: SlotStyles<MessageToastSlot>;
|
|
23
|
+
readonly type?: MessageNoticeType;
|
|
24
|
+
readonly variant?: "dark" | "light";
|
|
25
|
+
}
|
|
26
|
+
export declare function MessageToast({ action, children, className, classNames, closable, closeIcon, icon, onClose, open, role, showIcon, styles, type, variant, }: MessageToastProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { CSSProperties, ReactElement, MouseEvent as ReactMouseEvent, ReactNode, SyntheticEvent } from "react";
|
|
2
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
3
|
+
import { type ButtonProps } from "./Button";
|
|
4
|
+
type ModalSlot = "root" | "mask" | "wrapper" | "panel" | "header" | "title" | "close" | "body" | "footer";
|
|
5
|
+
export type ModalFooterRender = (originNode: ReactNode, extra: {
|
|
6
|
+
readonly OkBtn: () => ReactNode;
|
|
7
|
+
readonly CancelBtn: () => ReactNode;
|
|
8
|
+
}) => ReactNode;
|
|
9
|
+
export type MousePosition = {
|
|
10
|
+
readonly x: number;
|
|
11
|
+
readonly y: number;
|
|
12
|
+
} | null;
|
|
13
|
+
declare global {
|
|
14
|
+
interface Window {
|
|
15
|
+
__huaijiuModalClickPositionListener?: (event: globalThis.MouseEvent) => void;
|
|
16
|
+
__huaijiuModalClickPosition?: MousePosition;
|
|
17
|
+
__huaijiuModalClickPositionTimer?: number;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export interface ModalProps {
|
|
21
|
+
readonly afterClose?: () => void;
|
|
22
|
+
readonly afterOpenChange?: (open: boolean) => void;
|
|
23
|
+
readonly backIcon?: ReactNode;
|
|
24
|
+
readonly bodyStyle?: CSSProperties;
|
|
25
|
+
readonly cancelButtonProps?: Partial<Omit<ButtonProps, "children">>;
|
|
26
|
+
readonly cancelText?: ReactNode;
|
|
27
|
+
readonly centered?: boolean;
|
|
28
|
+
readonly children?: ReactNode;
|
|
29
|
+
readonly className?: string;
|
|
30
|
+
readonly classNames?: SlotClassNames<ModalSlot>;
|
|
31
|
+
readonly closeIcon?: ReactNode;
|
|
32
|
+
readonly closable?: boolean;
|
|
33
|
+
readonly confirmLoading?: boolean;
|
|
34
|
+
readonly destroyOnClose?: boolean;
|
|
35
|
+
readonly destroyOnHidden?: boolean;
|
|
36
|
+
readonly focusTrap?: boolean;
|
|
37
|
+
readonly focusTriggerAfterClose?: boolean;
|
|
38
|
+
readonly forceRender?: boolean;
|
|
39
|
+
readonly footer?: ReactNode | ModalFooterRender;
|
|
40
|
+
readonly getContainer?: false | HTMLElement | (() => HTMLElement);
|
|
41
|
+
readonly keyboard?: boolean;
|
|
42
|
+
readonly loading?: boolean;
|
|
43
|
+
readonly mask?: boolean;
|
|
44
|
+
readonly maskClosable?: boolean;
|
|
45
|
+
readonly maskStyle?: CSSProperties;
|
|
46
|
+
readonly maskTransitionName?: string;
|
|
47
|
+
readonly modalRender?: (node: ReactNode) => ReactNode;
|
|
48
|
+
readonly mousePosition?: MousePosition;
|
|
49
|
+
readonly okButtonProps?: Partial<Omit<ButtonProps, "children">>;
|
|
50
|
+
readonly okText?: ReactNode;
|
|
51
|
+
readonly open?: boolean;
|
|
52
|
+
readonly prefixCls?: string;
|
|
53
|
+
readonly rootClassName?: string;
|
|
54
|
+
readonly rootStyle?: CSSProperties;
|
|
55
|
+
readonly scrollLock?: boolean;
|
|
56
|
+
readonly style?: CSSProperties;
|
|
57
|
+
readonly styles?: SlotStyles<ModalSlot>;
|
|
58
|
+
readonly title?: ReactNode;
|
|
59
|
+
readonly titleAlign?: "start" | "center";
|
|
60
|
+
readonly titleIcon?: ReactNode;
|
|
61
|
+
readonly transitionName?: string;
|
|
62
|
+
readonly width?: number | string;
|
|
63
|
+
readonly wrapClassName?: string;
|
|
64
|
+
readonly zIndex?: number;
|
|
65
|
+
readonly onBack?: () => void;
|
|
66
|
+
readonly onCancel?: (event?: ReactMouseEvent<HTMLButtonElement> | SyntheticEvent | KeyboardEvent) => void;
|
|
67
|
+
readonly onClose?: () => void;
|
|
68
|
+
readonly onOk?: (event?: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
69
|
+
}
|
|
70
|
+
export type ModalStaticAction = (close: VoidFunction) => unknown;
|
|
71
|
+
export interface ModalFuncProps extends Omit<ModalProps, "children" | "onCancel" | "onOk" | "open" | "width"> {
|
|
72
|
+
readonly autoFocusButton?: null | "ok" | "cancel";
|
|
73
|
+
readonly content?: ReactNode;
|
|
74
|
+
readonly focusable?: {
|
|
75
|
+
readonly autoFocusButton?: null | "ok" | "cancel";
|
|
76
|
+
readonly focusTriggerAfterClose?: boolean;
|
|
77
|
+
readonly trap?: boolean;
|
|
78
|
+
};
|
|
79
|
+
readonly icon?: ReactNode;
|
|
80
|
+
readonly okCancel?: boolean;
|
|
81
|
+
readonly open?: boolean;
|
|
82
|
+
readonly title?: ReactNode;
|
|
83
|
+
readonly type?: "confirm" | "info" | "success" | "warn" | "warning" | "error";
|
|
84
|
+
readonly width?: number | string;
|
|
85
|
+
readonly onCancel?: ModalStaticAction;
|
|
86
|
+
readonly onOk?: ModalStaticAction;
|
|
87
|
+
}
|
|
88
|
+
export type ModalConfigUpdate = Partial<ModalFuncProps> | ((previous: ModalFuncProps) => ModalFuncProps);
|
|
89
|
+
export interface ModalFuncReturn {
|
|
90
|
+
readonly destroy: () => void;
|
|
91
|
+
readonly update: (nextProps: ModalConfigUpdate) => void;
|
|
92
|
+
}
|
|
93
|
+
export interface HookModalFuncReturn extends ModalFuncReturn, PromiseLike<boolean> {
|
|
94
|
+
}
|
|
95
|
+
export type ModalFunc = (props: ModalFuncProps) => ModalFuncReturn;
|
|
96
|
+
export type HookModalFunc = (props: ModalFuncProps) => HookModalFuncReturn;
|
|
97
|
+
export interface HookModalApi {
|
|
98
|
+
readonly confirm: HookModalFunc;
|
|
99
|
+
readonly error: HookModalFunc;
|
|
100
|
+
readonly info: HookModalFunc;
|
|
101
|
+
readonly success: HookModalFunc;
|
|
102
|
+
readonly warning: HookModalFunc;
|
|
103
|
+
}
|
|
104
|
+
export interface ModalGlobalConfig {
|
|
105
|
+
readonly rootPrefixCls?: string;
|
|
106
|
+
}
|
|
107
|
+
declare function ModalRoot({ afterClose, afterOpenChange, backIcon, bodyStyle, cancelButtonProps, cancelText, centered, children, className, classNames, closeIcon, closable, confirmLoading, destroyOnClose, destroyOnHidden, focusTrap, focusTriggerAfterClose, forceRender, footer, getContainer, keyboard, loading, mask, maskClosable, maskStyle, maskTransitionName, modalRender, mousePosition, okButtonProps, okText, onBack, onCancel, onClose, onOk, open, prefixCls, rootClassName, rootStyle, scrollLock, style, styles, title, titleAlign, titleIcon, transitionName, width, wrapClassName, zIndex, }: ModalProps): import("react").JSX.Element;
|
|
108
|
+
export declare function useModal(): readonly [HookModalApi, ReactElement];
|
|
109
|
+
export interface ModalStaticFunctions {
|
|
110
|
+
readonly confirm: ModalFunc;
|
|
111
|
+
readonly error: ModalFunc;
|
|
112
|
+
readonly info: ModalFunc;
|
|
113
|
+
readonly success: ModalFunc;
|
|
114
|
+
readonly warn: ModalFunc;
|
|
115
|
+
readonly warning: ModalFunc;
|
|
116
|
+
}
|
|
117
|
+
export type ModalComponent = typeof ModalRoot & ModalStaticFunctions & {
|
|
118
|
+
readonly config: (config: ModalGlobalConfig) => void;
|
|
119
|
+
readonly destroyAll: VoidFunction;
|
|
120
|
+
readonly useModal: typeof useModal;
|
|
121
|
+
};
|
|
122
|
+
export declare const Modal: ModalComponent;
|
|
123
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { MenuRef, MenuProps as RcMenuProps } from "@rc-component/menu";
|
|
2
|
+
import type { MenuInfo, MenuMode as RcMenuMode, SelectInfo } from "@rc-component/menu/es/interface";
|
|
3
|
+
import type { HTMLAttributes, Key, MouseEvent, ReactNode } from "react";
|
|
4
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
5
|
+
import type { AffixProps } from "./OtherPrimitives";
|
|
6
|
+
export interface AnchorItem {
|
|
7
|
+
readonly children?: readonly AnchorItem[];
|
|
8
|
+
readonly href: string;
|
|
9
|
+
readonly key?: string;
|
|
10
|
+
readonly target?: string;
|
|
11
|
+
readonly targetOffset?: number;
|
|
12
|
+
readonly title: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
type AnchorSlot = "root" | "item" | "itemTitle" | "indicator";
|
|
15
|
+
export interface AnchorProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "onClick"> {
|
|
16
|
+
readonly affix?: boolean | Omit<AffixProps, "children" | "offsetTop" | "target">;
|
|
17
|
+
readonly bounds?: number;
|
|
18
|
+
readonly classNames?: SlotClassNames<AnchorSlot>;
|
|
19
|
+
readonly direction?: "vertical" | "horizontal";
|
|
20
|
+
readonly getContainer?: () => HTMLElement | Window;
|
|
21
|
+
readonly getCurrentAnchor?: (activeLink: string) => string;
|
|
22
|
+
readonly items?: readonly AnchorItem[];
|
|
23
|
+
readonly offsetTop?: number;
|
|
24
|
+
readonly replace?: boolean;
|
|
25
|
+
readonly rootClassName?: string;
|
|
26
|
+
readonly showInkInFixed?: boolean;
|
|
27
|
+
readonly styles?: SlotStyles<AnchorSlot>;
|
|
28
|
+
readonly targetOffset?: number;
|
|
29
|
+
readonly onClick?: (event: MouseEvent<HTMLAnchorElement>, link: AnchorItem) => void;
|
|
30
|
+
readonly onChange?: (currentActiveLink: string) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface AnchorLinkProps {
|
|
33
|
+
readonly children?: ReactNode;
|
|
34
|
+
readonly href: string;
|
|
35
|
+
readonly target?: string;
|
|
36
|
+
readonly targetOffset?: number;
|
|
37
|
+
readonly title: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
declare function AnchorLink(_props: AnchorLinkProps): null;
|
|
40
|
+
declare function InternalAnchor({ affix, bounds, children, className, classNames, direction, getContainer, getCurrentAnchor, items, offsetTop, onChange, onClick, replace, rootClassName, showInkInFixed, style, styles, targetOffset, ...props }: AnchorProps): import("react").JSX.Element;
|
|
41
|
+
export declare const Anchor: typeof InternalAnchor & {
|
|
42
|
+
Link: typeof AnchorLink;
|
|
43
|
+
};
|
|
44
|
+
export type MenuMode = RcMenuMode;
|
|
45
|
+
export interface MenuItem {
|
|
46
|
+
readonly children?: readonly MenuItem[];
|
|
47
|
+
readonly className?: string;
|
|
48
|
+
readonly danger?: boolean;
|
|
49
|
+
readonly disabled?: boolean;
|
|
50
|
+
readonly extra?: ReactNode;
|
|
51
|
+
readonly icon?: ReactNode;
|
|
52
|
+
readonly itemIcon?: ReactNode;
|
|
53
|
+
readonly key?: Key;
|
|
54
|
+
readonly label?: ReactNode;
|
|
55
|
+
readonly style?: React.CSSProperties;
|
|
56
|
+
readonly type?: "item" | "submenu" | "group" | "divider";
|
|
57
|
+
}
|
|
58
|
+
export interface MenuProps extends Omit<RcMenuProps, "defaultOpenKeys" | "defaultSelectedKeys" | "items" | "onClick" | "onSelect" | "openKeys" | "prefixCls" | "selectedKeys"> {
|
|
59
|
+
readonly defaultOpenKeys?: readonly string[];
|
|
60
|
+
readonly defaultSelectedKeys?: readonly string[];
|
|
61
|
+
readonly items?: readonly (MenuItem | null)[];
|
|
62
|
+
readonly openKeys?: readonly string[];
|
|
63
|
+
readonly selectedKeys?: readonly string[];
|
|
64
|
+
readonly onClick?: (info: MenuInfo) => void;
|
|
65
|
+
readonly onSelect?: (info: SelectInfo) => void;
|
|
66
|
+
}
|
|
67
|
+
export declare const Menu: import("react").ForwardRefExoticComponent<MenuProps & import("react").RefAttributes<MenuRef>> & {
|
|
68
|
+
Divider: typeof import("@rc-component/menu").Divider;
|
|
69
|
+
Item: import("react").ForwardRefExoticComponent<import("@rc-component/menu").MenuItemProps & import("react").RefAttributes<HTMLElement>>;
|
|
70
|
+
ItemGroup: import("react").ForwardRefExoticComponent<Omit<import("@rc-component/menu").MenuItemGroupProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
71
|
+
SubMenu: import("react").ForwardRefExoticComponent<Omit<import("@rc-component/menu").SubMenuProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
72
|
+
};
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { composeRefs, useControllableValue, useLatest, warning } from "@996-design/996-utils";
|
|
2
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
3
|
+
declare function throttleByAnimationFrame<Args extends unknown[]>(callback: (...args: Args) => void): {
|
|
4
|
+
(...args: Args): void;
|
|
5
|
+
cancel(): void;
|
|
6
|
+
};
|
|
7
|
+
export interface AffixProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange"> {
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
readonly offsetBottom?: number;
|
|
10
|
+
readonly offsetTop?: number;
|
|
11
|
+
readonly prefixCls?: string;
|
|
12
|
+
readonly rootClassName?: string;
|
|
13
|
+
readonly target?: () => Window | HTMLElement | null;
|
|
14
|
+
readonly onChange?: (affixed?: boolean) => void;
|
|
15
|
+
/** Test hook called after an update request has been measured. */
|
|
16
|
+
readonly onTestUpdate?: () => void;
|
|
17
|
+
/** @internal AntD-compatible test hook. */
|
|
18
|
+
readonly onTestUpdatePosition?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface AffixRef {
|
|
21
|
+
readonly nativeElement: HTMLDivElement;
|
|
22
|
+
readonly updatePosition: ReturnType<typeof throttleByAnimationFrame>;
|
|
23
|
+
}
|
|
24
|
+
export declare const Affix: import("react").ForwardRefExoticComponent<AffixProps & import("react").RefAttributes<AffixRef>>;
|
|
25
|
+
export interface BorderBeamProps extends HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
readonly children?: ReactNode;
|
|
27
|
+
readonly duration?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function BorderBeam({ children, className, duration, style, ...props }: BorderBeamProps): import("react").JSX.Element;
|
|
30
|
+
export declare const Util: {
|
|
31
|
+
composeRefs: typeof composeRefs;
|
|
32
|
+
useControllableValue: typeof useControllableValue;
|
|
33
|
+
useLatest: typeof useLatest;
|
|
34
|
+
warning: typeof warning;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PaginationLocale, PaginationProps as RcPaginationProps } from "@rc-component/pagination";
|
|
2
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
3
|
+
import { type SelectOption, type SelectProps } from "./DataEntryPrimitives";
|
|
4
|
+
import { type InputSize } from "./Input";
|
|
5
|
+
export type { PaginationLocale };
|
|
6
|
+
export type PaginationSize = InputSize;
|
|
7
|
+
export type PaginationSizeChangerProps = SelectProps<number, SelectOption>;
|
|
8
|
+
type PaginationSlot = "root" | "item";
|
|
9
|
+
export interface PaginationProps extends Omit<RcPaginationProps, "classNames" | "pageSizeOptions" | "prefixCls" | "showSizeChanger" | "styles"> {
|
|
10
|
+
readonly classNames?: SlotClassNames<PaginationSlot>;
|
|
11
|
+
readonly pageSizeOptions?: readonly (number | string)[];
|
|
12
|
+
readonly responsive?: boolean;
|
|
13
|
+
readonly rootClassName?: string;
|
|
14
|
+
readonly showSizeChanger?: boolean | PaginationSizeChangerProps;
|
|
15
|
+
readonly size?: PaginationSize;
|
|
16
|
+
readonly styles?: SlotStyles<PaginationSlot>;
|
|
17
|
+
}
|
|
18
|
+
export declare function Pagination({ className, classNames, disabled, jumpNextIcon, jumpPrevIcon, locale, nextIcon, pageSizeOptions, prevIcon, responsive, rootClassName, showSizeChanger, size, sizeChangerRender, style, styles, ...paginationProps }: PaginationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
interface PanelProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
readonly as?: "article" | "section" | "div";
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly radius?: "sm" | "md";
|
|
6
|
+
}
|
|
7
|
+
export declare function Panel({ as: Component, children, className, radius, ...props }: PanelProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent, ReactNode } from "react";
|
|
2
|
+
import { type ButtonProps } from "./Button";
|
|
3
|
+
import { type PopoverProps } from "./Popover";
|
|
4
|
+
export interface PopconfirmProps extends Omit<PopoverProps, "content" | "title"> {
|
|
5
|
+
readonly cancelButtonProps?: Partial<Omit<ButtonProps, "children" | "onClick">>;
|
|
6
|
+
readonly cancelText?: ReactNode;
|
|
7
|
+
readonly description?: ReactNode;
|
|
8
|
+
readonly icon?: ReactNode;
|
|
9
|
+
readonly okButtonProps?: Partial<Omit<ButtonProps, "children" | "onClick">>;
|
|
10
|
+
readonly okText?: ReactNode;
|
|
11
|
+
readonly okType?: ButtonProps["type"];
|
|
12
|
+
readonly showCancel?: boolean;
|
|
13
|
+
readonly title: ReactNode;
|
|
14
|
+
readonly onCancel?: (event?: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
15
|
+
readonly onConfirm?: (event?: ReactMouseEvent<HTMLButtonElement>) => void | PromiseLike<void>;
|
|
16
|
+
readonly onPopupClick?: (event: ReactMouseEvent<HTMLElement>) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const Popconfirm: import("react").ForwardRefExoticComponent<PopconfirmProps & import("react").RefAttributes<import("@rc-component/tooltip").TooltipRef>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
import { type TooltipProps } from "./Tooltip";
|
|
3
|
+
type PopoverContent = ReactNode | (() => ReactNode);
|
|
4
|
+
export interface PopoverProps extends Omit<TooltipProps, "maxWidth" | "title" | "variant"> {
|
|
5
|
+
readonly content?: PopoverContent;
|
|
6
|
+
readonly overlayStyle?: CSSProperties;
|
|
7
|
+
readonly title?: PopoverContent;
|
|
8
|
+
}
|
|
9
|
+
export declare const Popover: import("react").ForwardRefExoticComponent<PopoverProps & import("react").RefAttributes<import("@rc-component/tooltip").TooltipRef>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface PriceTextProps {
|
|
2
|
+
readonly className?: string;
|
|
3
|
+
readonly freeLabel?: string;
|
|
4
|
+
readonly freeClassName?: string;
|
|
5
|
+
readonly originalPrice?: string | null;
|
|
6
|
+
readonly price: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function PriceText({ className, freeClassName, freeLabel, originalPrice, price, }: PriceTextProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ProgressProps as RcProgressProps } from "@rc-component/progress";
|
|
2
|
+
import type { AriaAttributes, CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
3
|
+
export type ProgressStatus = "normal" | "success" | "exception" | "active";
|
|
4
|
+
export type ProgressType = "line" | "circle" | "dashboard";
|
|
5
|
+
export type ProgressSize = "small" | "medium" | "middle" | "default";
|
|
6
|
+
export type ProgressStrokeLinecap = NonNullable<RcProgressProps["strokeLinecap"]>;
|
|
7
|
+
export type ProgressGapPlacement = "top" | "bottom" | "start" | "end";
|
|
8
|
+
export type ProgressGapPosition = "top" | "bottom" | "left" | "right";
|
|
9
|
+
export type ProgressGradient = {
|
|
10
|
+
readonly direction?: string;
|
|
11
|
+
} & Record<string, string | undefined>;
|
|
12
|
+
export interface ProgressSuccessProps {
|
|
13
|
+
readonly percent?: number;
|
|
14
|
+
readonly strokeColor?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ProgressPercentPosition {
|
|
17
|
+
readonly align?: "start" | "center" | "end";
|
|
18
|
+
readonly type?: "inner" | "outer";
|
|
19
|
+
}
|
|
20
|
+
export type ProgressSemanticSlot = "root" | "body" | "rail" | "track" | "indicator";
|
|
21
|
+
export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "className" | "style">, Pick<AriaAttributes, "aria-label" | "aria-labelledby"> {
|
|
22
|
+
readonly children?: ReactNode;
|
|
23
|
+
readonly className?: string;
|
|
24
|
+
readonly classNames?: Partial<Record<ProgressSemanticSlot, string>>;
|
|
25
|
+
readonly format?: (percent?: number, successPercent?: number) => ReactNode;
|
|
26
|
+
readonly gapDegree?: number;
|
|
27
|
+
readonly gapPlacement?: ProgressGapPlacement;
|
|
28
|
+
/** @deprecated Use `gapPlacement` instead. */
|
|
29
|
+
readonly gapPosition?: ProgressGapPosition;
|
|
30
|
+
readonly percent?: number;
|
|
31
|
+
readonly percentPosition?: ProgressPercentPosition;
|
|
32
|
+
readonly railColor?: string;
|
|
33
|
+
readonly rootClassName?: string;
|
|
34
|
+
readonly rounding?: (step: number) => number;
|
|
35
|
+
readonly showInfo?: boolean;
|
|
36
|
+
readonly size?: number | [number | string, number] | ProgressSize | {
|
|
37
|
+
readonly width?: number;
|
|
38
|
+
readonly height?: number;
|
|
39
|
+
};
|
|
40
|
+
readonly status?: ProgressStatus;
|
|
41
|
+
readonly steps?: number | {
|
|
42
|
+
readonly count: number;
|
|
43
|
+
readonly gap: number;
|
|
44
|
+
};
|
|
45
|
+
readonly strokeColor?: string | readonly string[] | ProgressGradient;
|
|
46
|
+
readonly strokeLinecap?: ProgressStrokeLinecap;
|
|
47
|
+
readonly strokeWidth?: number;
|
|
48
|
+
readonly style?: CSSProperties;
|
|
49
|
+
readonly styles?: Partial<Record<ProgressSemanticSlot, CSSProperties>>;
|
|
50
|
+
readonly success?: ProgressSuccessProps;
|
|
51
|
+
/** @deprecated Use `railColor` instead. */
|
|
52
|
+
readonly trailColor?: string;
|
|
53
|
+
readonly type?: ProgressType;
|
|
54
|
+
/** @deprecated Use `size` instead. */
|
|
55
|
+
readonly width?: number;
|
|
56
|
+
}
|
|
57
|
+
export declare const Progress: import("react").ForwardRefExoticComponent<ProgressProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface ProgressBarProps {
|
|
2
|
+
readonly className?: string;
|
|
3
|
+
readonly max?: number;
|
|
4
|
+
readonly tone?: "primary" | "success" | "achievement";
|
|
5
|
+
readonly value: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function ProgressBar({ className, max, tone, value, }: ProgressBarProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonProps, type ButtonTone } from "./Button";
|
|
2
|
+
interface ProgressButtonProps extends Omit<ButtonProps, "children" | "value"> {
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly max?: number;
|
|
5
|
+
readonly tone?: ButtonTone;
|
|
6
|
+
readonly value: number | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function ProgressButton({ className, disabled, label, max, tone, value, ...props }: ProgressButtonProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { CheckboxRef } from "@rc-component/checkbox";
|
|
2
|
+
import type { CSSProperties, HTMLAttributes, InputHTMLAttributes, MouseEventHandler, ReactElement, ReactNode, RefAttributes } from "react";
|
|
3
|
+
import type { SlotClassNames, SlotStyles } from "../utils/slots";
|
|
4
|
+
type RadioSlot = "root" | "icon" | "label";
|
|
5
|
+
export type RadioValue = string | number;
|
|
6
|
+
export type RadioGroupButtonStyle = "outline" | "solid";
|
|
7
|
+
export type RadioGroupOptionType = "default" | "button";
|
|
8
|
+
export type RadioSize = "small" | "medium" | "middle" | "large";
|
|
9
|
+
export type RadioRef = CheckboxRef;
|
|
10
|
+
export interface RadioProps<ValueType = RadioValue> extends Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "onChange" | "onMouseEnter" | "onMouseLeave" | "type" | "value"> {
|
|
11
|
+
readonly children?: ReactNode;
|
|
12
|
+
readonly classNames?: SlotClassNames<RadioSlot>;
|
|
13
|
+
readonly optionType?: RadioGroupOptionType;
|
|
14
|
+
readonly rootClassName?: string;
|
|
15
|
+
readonly skipGroup?: boolean;
|
|
16
|
+
readonly styles?: SlotStyles<RadioSlot>;
|
|
17
|
+
readonly value?: ValueType;
|
|
18
|
+
readonly onChange?: (event: RadioChangeEvent<ValueType>) => void;
|
|
19
|
+
readonly onMouseEnter?: MouseEventHandler<HTMLElement>;
|
|
20
|
+
readonly onMouseLeave?: MouseEventHandler<HTMLElement>;
|
|
21
|
+
}
|
|
22
|
+
export interface RadioChangeEventTarget<ValueType = RadioValue> extends RadioProps<ValueType> {
|
|
23
|
+
readonly checked: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface RadioChangeEvent<ValueType = RadioValue> {
|
|
26
|
+
readonly nativeEvent: MouseEvent;
|
|
27
|
+
readonly target: RadioChangeEventTarget<ValueType>;
|
|
28
|
+
readonly preventDefault: () => void;
|
|
29
|
+
readonly stopPropagation: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface RadioOptionType<ValueType = RadioValue> {
|
|
32
|
+
readonly className?: string;
|
|
33
|
+
readonly disabled?: boolean;
|
|
34
|
+
readonly id?: string;
|
|
35
|
+
readonly label: ReactNode;
|
|
36
|
+
readonly required?: boolean;
|
|
37
|
+
readonly style?: CSSProperties;
|
|
38
|
+
readonly title?: string;
|
|
39
|
+
readonly value: ValueType;
|
|
40
|
+
readonly onChange?: (event: RadioChangeEvent<ValueType>) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface RadioGroupProps<ValueType = RadioValue> extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "defaultValue" | "onChange"> {
|
|
43
|
+
readonly block?: boolean;
|
|
44
|
+
readonly buttonStyle?: RadioGroupButtonStyle;
|
|
45
|
+
readonly children?: ReactNode;
|
|
46
|
+
readonly defaultValue?: ValueType;
|
|
47
|
+
readonly disabled?: boolean;
|
|
48
|
+
readonly name?: string;
|
|
49
|
+
readonly optionType?: RadioGroupOptionType;
|
|
50
|
+
readonly options?: readonly (RadioOptionType<ValueType> | string | number)[];
|
|
51
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
52
|
+
readonly rootClassName?: string;
|
|
53
|
+
readonly size?: RadioSize;
|
|
54
|
+
readonly value?: ValueType;
|
|
55
|
+
readonly vertical?: boolean;
|
|
56
|
+
readonly onChange?: (event: RadioChangeEvent<ValueType>) => void;
|
|
57
|
+
readonly onValueChange?: (value: ValueType, event: RadioChangeEvent<ValueType>) => void;
|
|
58
|
+
}
|
|
59
|
+
type RadioStandaloneComponent = <ValueType = RadioValue>(props: RadioProps<ValueType> & RefAttributes<CheckboxRef>) => ReactElement;
|
|
60
|
+
type RadioGroupComponent = <ValueType = RadioValue>(props: RadioGroupProps<ValueType> & RefAttributes<HTMLDivElement>) => ReactElement;
|
|
61
|
+
type RadioCompoundComponent = RadioStandaloneComponent & {
|
|
62
|
+
readonly Button: RadioStandaloneComponent;
|
|
63
|
+
readonly Group: RadioGroupComponent;
|
|
64
|
+
readonly __ANT_RADIO: boolean;
|
|
65
|
+
};
|
|
66
|
+
export declare const Radio: RadioCompoundComponent;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import RcRate from "@rc-component/rate";
|
|
2
|
+
import type { ComponentPropsWithoutRef, ComponentRef, ReactElement, Ref } from "react";
|
|
3
|
+
import { type InputSize } from "./Input";
|
|
4
|
+
import { type TooltipProps } from "./Tooltip";
|
|
5
|
+
type RcRateProps = ComponentPropsWithoutRef<typeof RcRate>;
|
|
6
|
+
export type RateRef = ComponentRef<typeof RcRate>;
|
|
7
|
+
export type RateSize = InputSize;
|
|
8
|
+
export type RateTooltip = string | Omit<TooltipProps, "children">;
|
|
9
|
+
export interface RateProps extends RcRateProps {
|
|
10
|
+
readonly rootClassName?: string;
|
|
11
|
+
readonly size?: RateSize;
|
|
12
|
+
readonly tooltips?: readonly RateTooltip[];
|
|
13
|
+
}
|
|
14
|
+
export declare const Rate: (props: RateProps & {
|
|
15
|
+
readonly ref?: Ref<RateRef>;
|
|
16
|
+
}) => ReactElement;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export type ResultStatus = "success" | "error" | "info" | "warning" | 403 | 404 | 500 | "403" | "404" | "500";
|
|
3
|
+
export interface ResultProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
4
|
+
readonly extra?: ReactNode;
|
|
5
|
+
readonly icon?: ReactNode;
|
|
6
|
+
readonly rootClassName?: string;
|
|
7
|
+
readonly status?: ResultStatus;
|
|
8
|
+
readonly subTitle?: ReactNode;
|
|
9
|
+
readonly title?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function Result({ children, className, extra, icon, rootClassName, status, subTitle, title, ...props }: ResultProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
interface SectionHeaderProps {
|
|
3
|
+
readonly action?: ReactNode;
|
|
4
|
+
readonly className?: string;
|
|
5
|
+
readonly meta?: ReactNode;
|
|
6
|
+
readonly middle?: ReactNode;
|
|
7
|
+
readonly onAction?: () => void;
|
|
8
|
+
readonly title: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function SectionHeader({ action, className, meta, middle, onAction, title, }: SectionHeaderProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SegmentedLabeledOption as RcSegmentedLabeledOption, SegmentedProps as RcSegmentedProps, SegmentedRawOption, SegmentedValue } from "@rc-component/segmented";
|
|
2
|
+
import type { CSSProperties, ReactNode, RefAttributes } from "react";
|
|
3
|
+
import type { TooltipProps } from "./Tooltip";
|
|
4
|
+
export type { SegmentedValue } from "@rc-component/segmented";
|
|
5
|
+
export type SegmentedSize = "small" | "medium" | "middle" | "large" | "xs" | "sm" | "md" | "lg";
|
|
6
|
+
export type SegmentedSemanticSlot = "root" | "item" | "icon" | "label";
|
|
7
|
+
export type SegmentedClassNames<ValueType = SegmentedValue> = Partial<Record<SegmentedSemanticSlot, string>> | ((info: {
|
|
8
|
+
props: SegmentedProps<ValueType>;
|
|
9
|
+
}) => Partial<Record<SegmentedSemanticSlot, string>>);
|
|
10
|
+
export type SegmentedStyles<ValueType = SegmentedValue> = Partial<Record<SegmentedSemanticSlot, CSSProperties>> | ((info: {
|
|
11
|
+
props: SegmentedProps<ValueType>;
|
|
12
|
+
}) => Partial<Record<SegmentedSemanticSlot, CSSProperties>>);
|
|
13
|
+
export interface SegmentedLabeledOption<ValueType = SegmentedValue> extends Omit<RcSegmentedLabeledOption<ValueType>, "label"> {
|
|
14
|
+
readonly icon?: ReactNode;
|
|
15
|
+
readonly label?: ReactNode;
|
|
16
|
+
readonly tooltip?: string | Omit<TooltipProps, "children">;
|
|
17
|
+
}
|
|
18
|
+
export type SegmentedOption<ValueType = SegmentedRawOption> = ValueType | SegmentedLabeledOption<ValueType>;
|
|
19
|
+
export interface SegmentedLegacyItem<ValueType = SegmentedValue> {
|
|
20
|
+
readonly disabled?: boolean;
|
|
21
|
+
readonly icon?: ReactNode;
|
|
22
|
+
readonly id: ValueType;
|
|
23
|
+
readonly label: ReactNode;
|
|
24
|
+
readonly title?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SegmentedProps<ValueType = SegmentedValue> extends Omit<RcSegmentedProps<ValueType>, "classNames" | "disabled" | "itemRender" | "options" | "prefixCls" | "size" | "styles"> {
|
|
27
|
+
readonly block?: boolean;
|
|
28
|
+
readonly classNames?: SegmentedClassNames<ValueType>;
|
|
29
|
+
readonly disabled?: boolean;
|
|
30
|
+
readonly items?: readonly SegmentedLegacyItem<ValueType>[];
|
|
31
|
+
readonly options?: readonly SegmentedOption<ValueType>[];
|
|
32
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
33
|
+
readonly rootClassName?: string;
|
|
34
|
+
readonly shape?: "default" | "round";
|
|
35
|
+
readonly size?: SegmentedSize;
|
|
36
|
+
readonly styles?: SegmentedStyles<ValueType>;
|
|
37
|
+
}
|
|
38
|
+
declare const InternalSegmented: import("react").ForwardRefExoticComponent<Omit<SegmentedProps<SegmentedValue>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export declare const Segmented: (<ValueType>(props: SegmentedProps<ValueType> & RefAttributes<HTMLDivElement>) => ReturnType<typeof InternalSegmented>) & {
|
|
40
|
+
displayName?: string;
|
|
41
|
+
};
|