@zjpcy/simple-design 1.2.2 → 1.2.10

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.
Files changed (58) hide show
  1. package/dist/cjs/index.css +1 -1
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/es/Button/Button.js +1 -1
  4. package/dist/es/Checkbox/index.js +1 -0
  5. package/dist/es/Drawer/index.js +1 -0
  6. package/dist/es/Grid/index.js +1 -0
  7. package/dist/es/Grid/styles.js +1 -0
  8. package/dist/es/Hooks/useClickOutside.js +1 -0
  9. package/dist/es/Input/InputBase.js +1 -1
  10. package/dist/es/Input/Password.js +1 -0
  11. package/dist/es/Input/Textarea.js +1 -0
  12. package/dist/es/Input/index.js +1 -1
  13. package/dist/es/Layout/LayoutContext.js +1 -0
  14. package/dist/es/Layout/index.js +1 -0
  15. package/dist/es/Layout/styles.js +1 -0
  16. package/dist/es/Menu/index.js +1 -1
  17. package/dist/es/Popconfirm/index.js +1 -0
  18. package/dist/es/Progress/index.js +1 -0
  19. package/dist/es/Table/SortableRow.js +1 -0
  20. package/dist/es/Table/index.js +1 -1
  21. package/dist/es/Tag/index.js +1 -0
  22. package/dist/es/index.css +1 -1
  23. package/dist/es/index.js +1 -1
  24. package/dist/types/components/Button/Button.d.ts +3 -2
  25. package/dist/types/components/Drawer/index.d.ts +6 -0
  26. package/dist/types/components/Drawer/styles.d.ts +0 -0
  27. package/dist/types/components/Drawer/types.d.ts +71 -0
  28. package/dist/types/components/Grid/index.d.ts +14 -0
  29. package/dist/types/components/Grid/styles.d.ts +22 -0
  30. package/dist/types/components/Grid/types.d.ts +49 -0
  31. package/dist/types/components/Input/AutoComplete.d.ts +0 -0
  32. package/dist/types/components/Input/InputBase.d.ts +2 -0
  33. package/dist/types/components/Input/Password.d.ts +11 -0
  34. package/dist/types/components/Input/Textarea.d.ts +51 -0
  35. package/dist/types/components/Input/index.d.ts +6 -2
  36. package/dist/types/components/Layout/LayoutContext.d.ts +15 -0
  37. package/dist/types/components/Layout/index.d.ts +86 -0
  38. package/dist/types/components/Layout/styles.d.ts +40 -0
  39. package/dist/types/components/Layout/types.d.ts +112 -0
  40. package/dist/types/components/Menu/index.d.ts +8 -1
  41. package/dist/types/components/Menu/styles.d.ts +7 -0
  42. package/dist/types/components/Menu/types.d.ts +56 -7
  43. package/dist/types/components/Popconfirm/index.d.ts +6 -0
  44. package/dist/types/components/Popconfirm/styles.d.ts +0 -0
  45. package/dist/types/components/Popconfirm/types.d.ts +28 -0
  46. package/dist/types/components/Progress/index.d.ts +6 -0
  47. package/dist/types/components/Progress/styles.d.ts +0 -0
  48. package/dist/types/components/Progress/types.d.ts +38 -0
  49. package/dist/types/components/Table/SortableRow.d.ts +26 -0
  50. package/dist/types/components/Table/index.d.ts +5 -1
  51. package/dist/types/components/Tag/index.d.ts +6 -0
  52. package/dist/types/components/Tag/styles.d.ts +52 -0
  53. package/dist/types/components/Tag/types.d.ts +46 -0
  54. package/dist/types/components/index.d.ts +12 -2
  55. package/package.json +1 -1
  56. package/dist/es/Navigation/index.js +0 -1
  57. package/dist/types/components/Navigation/index.d.ts +0 -5
  58. package/dist/types/components/Navigation/types.d.ts +0 -43
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ export type DrawerPlacement = 'left' | 'right' | 'top' | 'bottom';
3
+ export interface DrawerProps {
4
+ /** 是否可见 */
5
+ open: boolean;
6
+ /** 抽屉标题 */
7
+ title?: React.ReactNode;
8
+ /** 抽屉宽度(placement为left或right时有效) */
9
+ width?: number | string;
10
+ /** 抽屉高度(placement为top或bottom时有效) */
11
+ height?: number | string;
12
+ /** 抽屉位置 */
13
+ placement?: DrawerPlacement;
14
+ /** 点击遮罩层是否允许关闭 */
15
+ maskClosable?: boolean;
16
+ /** 是否显示遮罩层 */
17
+ mask?: boolean;
18
+ /** 关闭回调函数 */
19
+ onClose: () => void;
20
+ /** 抽屉内容 */
21
+ children?: React.ReactNode;
22
+ /** 额外类名 */
23
+ className?: string;
24
+ /** 抽屉样式 */
25
+ style?: React.CSSProperties;
26
+ /** 遮罩层样式 */
27
+ maskStyle?: React.CSSProperties;
28
+ /** 遮罩层类名 */
29
+ maskClassName?: string;
30
+ /** 内容区域类名 */
31
+ contentClassName?: string;
32
+ /** 内容区域样式 */
33
+ contentStyle?: React.CSSProperties;
34
+ /** 头部内容:false表示不显示,React.ReactNode表示自定义内容,未传值则显示默认的标题和关闭按钮 */
35
+ header?: React.ReactNode | false;
36
+ /** 头部类名 */
37
+ headerClassName?: string;
38
+ /** 头部样式 */
39
+ headerStyle?: React.CSSProperties;
40
+ /** 页脚:false表示不显示,React.ReactNode表示自定义内容,未传值则显示默认的取消和确认按钮 */
41
+ footer?: React.ReactNode | false;
42
+ /** 页脚类名 */
43
+ footerClassName?: string;
44
+ /** 页脚样式 */
45
+ footerStyle?: React.CSSProperties;
46
+ /** 指定挂载节点,默认为false渲染在当前DOM中 */
47
+ getContainer?: (() => HTMLElement) | HTMLElement | false;
48
+ /** 关闭后是否销毁子元素 */
49
+ destroyOnClose?: boolean;
50
+ /** 是否显示关闭按钮 */
51
+ closable?: boolean;
52
+ /** z-index层级 */
53
+ zIndex?: number;
54
+ /** 是否加载中状态 */
55
+ loading?: boolean;
56
+ /** 自定义加载图标 */
57
+ loadingIcon?: React.ReactNode;
58
+ /** 是否支持拖拽调整大小,默认false */
59
+ resizable?: boolean;
60
+ /** 拖拽手柄大小(像素),默认8px */
61
+ resizeHandleSize?: number;
62
+ /** 拖拽时最小宽度 */
63
+ minWidth?: number;
64
+ /** 拖拽时最小高度 */
65
+ minHeight?: number;
66
+ /** 大小变化回调 */
67
+ onChange?: (size: {
68
+ width?: number;
69
+ height?: number;
70
+ }) => void;
71
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { GridProps, RowProps, ColProps } from './types';
3
+ import './Grid.css';
4
+ export declare const Col: React.ForwardRefExoticComponent<ColProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const RowComponent: React.ForwardRefExoticComponent<RowProps & React.RefAttributes<HTMLDivElement>>;
6
+ export declare const Row: typeof RowComponent & {
7
+ Col: typeof Col;
8
+ };
9
+ declare const Grid: React.ForwardRefExoticComponent<React.PropsWithoutRef<GridProps> & React.RefAttributes<HTMLDivElement>> & {
10
+ Row: typeof Row;
11
+ Col: typeof Col;
12
+ };
13
+ export default Grid;
14
+ export * from './types';
@@ -0,0 +1,22 @@
1
+ export declare const GridWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ width?: number | string;
3
+ height?: number | string;
4
+ gap?: number | string;
5
+ padding?: number | string;
6
+ backgroundColor?: string;
7
+ }>> & string;
8
+ export declare const RowWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
+ span?: number;
10
+ rowGap?: number | string;
11
+ align?: string;
12
+ justify?: string;
13
+ wrap?: boolean;
14
+ }>> & string;
15
+ export declare const ColWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
+ span?: number;
17
+ offset?: number;
18
+ push?: number;
19
+ pull?: number;
20
+ order?: number;
21
+ gap?: number | string;
22
+ }>> & string;
@@ -0,0 +1,49 @@
1
+ export interface GridProps {
2
+ children?: React.ReactNode;
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ /** 宽度,默认为 100% */
6
+ width?: number | string;
7
+ /** 高度 */
8
+ height?: number | string;
9
+ /** 栅格间距 */
10
+ gap?: number | string;
11
+ /** 内边距 */
12
+ padding?: number | string;
13
+ /** 背景色 */
14
+ backgroundColor?: string;
15
+ }
16
+ export interface RowProps {
17
+ children?: React.ReactNode;
18
+ className?: string;
19
+ style?: React.CSSProperties;
20
+ /** 栅格占位格数,总共 24 格 */
21
+ span?: number;
22
+ /** 栅格水平间距(Col 之间的间距) */
23
+ gap?: number | string;
24
+ /** 栅格垂直间距(Row 之间的上下间距) */
25
+ rowGap?: number | string;
26
+ /** 对齐方式 */
27
+ align?: 'flex-start' | 'center' | 'flex-end' | 'stretch';
28
+ /** 主轴对齐方式 */
29
+ justify?: 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
30
+ /** 是否换行 */
31
+ wrap?: boolean;
32
+ }
33
+ export interface ColProps {
34
+ children?: React.ReactNode;
35
+ className?: string;
36
+ style?: React.CSSProperties;
37
+ /** 栅格占位格数,总共 24 格 */
38
+ span?: number;
39
+ /** 栅格左侧间隔格数 */
40
+ offset?: number;
41
+ /** 栅格向右移动格数 */
42
+ push?: number;
43
+ /** 栅格向左移动格数 */
44
+ pull?: number;
45
+ /** 栅格顺序 */
46
+ order?: number;
47
+ /** 栅格间距,优先级最高 */
48
+ gap?: number | string;
49
+ }
File without changes
@@ -27,6 +27,8 @@ export interface InputProps {
27
27
  labelClassName?: string;
28
28
  /** 标签的样式 */
29
29
  labelStyle?: React.CSSProperties;
30
+ /** 错误状态(由 Form 组件传入,InputBase 内部不使用,需剔除避免传递给 input) */
31
+ error?: boolean;
30
32
  }
31
33
  declare const InputBase: React.FC<InputProps>;
32
34
  export default InputBase;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { InputProps } from './InputBase';
3
+ import './Input.css';
4
+ export interface PasswordProps extends Omit<InputProps, 'type' | 'suffix'> {
5
+ /** 是否默认可见密码 */
6
+ defaultVisible?: boolean;
7
+ /** 切换可见性时的回调 */
8
+ onVisibleChange?: (visible: boolean) => void;
9
+ }
10
+ declare const Password: React.FC<PasswordProps>;
11
+ export default Password;
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import './Input.css';
3
+ export interface TextareaProps {
4
+ placeholder?: string;
5
+ width?: string | number;
6
+ height?: string | number;
7
+ className?: string;
8
+ style?: React.CSSProperties;
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
12
+ onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
13
+ onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
14
+ onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
15
+ disabled?: boolean;
16
+ readOnly?: boolean;
17
+ rows?: number;
18
+ cols?: number;
19
+ maxLength?: number;
20
+ showCount?: boolean;
21
+ clear?: boolean;
22
+ /** 默认提示信息 */
23
+ extra?: string | React.ReactNode;
24
+ /** 标签文案,显示在输入框前面 */
25
+ label?: string | React.ReactNode;
26
+ /** 标签到输入框的距离 */
27
+ labelGap?: string | number;
28
+ /** 标签的CSS类名 */
29
+ labelClassName?: string;
30
+ /** 标签的样式 */
31
+ labelStyle?: React.CSSProperties;
32
+ /** 是否可调整大小 */
33
+ resizable?: boolean;
34
+ /** 拖拽手柄大小(像素) */
35
+ resizeHandleSize?: number;
36
+ /** 最小宽度 */
37
+ minWidth?: number;
38
+ /** 最大宽度 */
39
+ maxWidth?: number;
40
+ /** 最小高度 */
41
+ minHeight?: number;
42
+ /** 最大高度 */
43
+ maxHeight?: number;
44
+ /** 大小变化回调 */
45
+ onResize?: (size: {
46
+ width?: number;
47
+ height?: number;
48
+ }) => void;
49
+ }
50
+ declare const Textarea: React.FC<TextareaProps>;
51
+ export default Textarea;
@@ -2,11 +2,15 @@ import React from 'react';
2
2
  import { InputProps } from './InputBase';
3
3
  import Search from './Search';
4
4
  import NumberInput, { NumberInputProps } from './Number';
5
- export type { InputProps, NumberInputProps };
5
+ import Textarea, { TextareaProps } from './Textarea';
6
+ import Password, { PasswordProps } from './Password';
7
+ export type { InputProps, NumberInputProps, TextareaProps, PasswordProps };
6
8
  type InputComponent = React.FC<InputProps> & {
7
9
  Search: typeof Search;
8
10
  Number: typeof NumberInput;
11
+ Textarea: typeof Textarea;
12
+ Password: typeof Password;
9
13
  };
10
14
  declare const Input: InputComponent;
11
- export { Search, NumberInput };
15
+ export { Search, NumberInput, Textarea, Password };
12
16
  export default Input;
@@ -0,0 +1,15 @@
1
+ import React, { ReactNode } from 'react';
2
+ interface LayoutContextType {
3
+ siderCollapsed: boolean;
4
+ setSiderCollapsed: (collapsed: boolean) => void;
5
+ zeroWidthMode: boolean;
6
+ setZeroWidthMode: (mode: boolean) => void;
7
+ onExpand: () => void;
8
+ setOnExpand: (fn: () => void) => void;
9
+ }
10
+ declare const LayoutContext: React.Context<LayoutContextType | undefined>;
11
+ export declare const LayoutProvider: React.FC<{
12
+ children: ReactNode;
13
+ }>;
14
+ export declare const useLayoutContext: () => LayoutContextType;
15
+ export { LayoutContext };
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import './Layout.css';
3
+ import { LayoutProps, LayoutHeaderProps, LayoutContentProps, LayoutFooterProps, LayoutSiderProps } from './types';
4
+ /**
5
+ * Layout 页面布局组件
6
+ *
7
+ * Layout 提供页面级别的布局模式,包含 Header、Content、Footer、Sider 四部分。
8
+ * 支持多种布局方式:顶栏、侧栏、内容区、页脚的灵活组合。
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <Layout>
13
+ * <Layout.Header>Header</Layout.Header>
14
+ * <Layout>
15
+ * <Layout.Sider>Sider</Layout.Sider>
16
+ * <Layout.Content>Content</Layout.Content>
17
+ * </Layout>
18
+ * <Layout.Footer>Footer</Layout.Footer>
19
+ * </Layout>
20
+ * ```
21
+ */
22
+ interface LayoutComponent extends React.FC<LayoutProps> {
23
+ Header: typeof Header;
24
+ Sider: typeof Sider;
25
+ Content: typeof Content;
26
+ Footer: typeof Footer;
27
+ }
28
+ /**
29
+ * Layout.Header 头部区域组件
30
+ *
31
+ * 通常用于显示页面标题、导航等
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <Layout.Header fixed height={64}>
36
+ * <div>Logo</div>
37
+ * </Layout.Header>
38
+ * ```
39
+ */
40
+ export declare const Header: React.FC<LayoutHeaderProps>;
41
+ /**
42
+ * Layout.Sider 侧边栏组件
43
+ *
44
+ * 通常用于显示导航菜单,支持收缩功能
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <Layout.Sider
49
+ * width={200}
50
+ * collapsible
51
+ * collapsed={collapsed}
52
+ * onCollapse={(collapsed) => setCollapsed(collapsed)}
53
+ * >
54
+ * <Menu />
55
+ * </Layout.Sider>
56
+ * ```
57
+ */
58
+ export declare const Sider: React.FC<LayoutSiderProps>;
59
+ /**
60
+ * Layout.Content 内容区域组件
61
+ *
62
+ * 主要内容展示区域
63
+ *
64
+ * @example
65
+ * ```tsx
66
+ * <Layout.Content>
67
+ * <p>Page content goes here</p>
68
+ * </Layout.Content>
69
+ * ```
70
+ */
71
+ export declare const Content: React.FC<LayoutContentProps>;
72
+ /**
73
+ * Layout.Footer 页脚区域组件
74
+ *
75
+ * 通常用于显示版权信息、辅助链接等
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * <Layout.Footer height={48}>
80
+ * <div>© 2025 Your Company</div>
81
+ * </Layout.Footer>
82
+ * ```
83
+ */
84
+ export declare const Footer: React.FC<LayoutFooterProps>;
85
+ declare const Layout: LayoutComponent;
86
+ export default Layout;
@@ -0,0 +1,40 @@
1
+ export declare const LayoutWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ $hasSider?: boolean;
3
+ $theme?: "light" | "dark";
4
+ }>> & string;
5
+ export declare const HeaderWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
6
+ $fixed?: boolean;
7
+ $height?: string | number;
8
+ $theme?: "light" | "dark";
9
+ $bgColor?: string;
10
+ }>> & string;
11
+ export declare const SiderWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
12
+ $width?: string | number;
13
+ $collapsedWidth?: number;
14
+ $collapsed?: boolean;
15
+ $fixed?: boolean;
16
+ $zeroWidthMode?: boolean;
17
+ $theme?: "light" | "dark";
18
+ }>> & string;
19
+ export declare const SiderContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
20
+ $collapsed?: boolean;
21
+ }>> & string;
22
+ export declare const SiderTrigger: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
23
+ $collapsed?: boolean;
24
+ $placement?: "top" | "bottom";
25
+ $zeroWidthMode?: boolean;
26
+ $theme?: "light" | "dark";
27
+ }>> & string;
28
+ export declare const ZeroWidthTriggerInContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
29
+ export declare const LayoutInnerWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
30
+ $hasSider?: boolean;
31
+ }>> & string;
32
+ export declare const ContentWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
33
+ $fixed?: boolean;
34
+ $theme?: "light" | "dark";
35
+ }>> & string;
36
+ export declare const FooterWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {
37
+ $fixed?: boolean;
38
+ $height?: string | number;
39
+ $theme?: "light" | "dark";
40
+ }>> & string;
@@ -0,0 +1,112 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * Layout 组件属性接口
4
+ */
5
+ export interface LayoutProps {
6
+ /** 自定义类名 */
7
+ className?: string;
8
+ /** 自定义样式 */
9
+ style?: CSSProperties;
10
+ /** 是否包含 Sider(会影响布局) */
11
+ hasSider?: boolean;
12
+ /** 主题模式 */
13
+ theme?: 'light' | 'dark';
14
+ /** 子元素 */
15
+ children?: ReactNode;
16
+ }
17
+ /**
18
+ * Layout.Header 组件属性接口
19
+ */
20
+ export interface LayoutHeaderProps {
21
+ /** 自定义类名 */
22
+ className?: string;
23
+ /** 自定义样式 */
24
+ style?: CSSProperties;
25
+ /** 子元素 */
26
+ children?: ReactNode;
27
+ /** 头部高度 */
28
+ height?: string | number;
29
+ /** 固定头部 */
30
+ fixed?: boolean;
31
+ /** 主题模式 */
32
+ theme?: 'light' | 'dark';
33
+ }
34
+ /**
35
+ * Layout.Content 组件属性接口
36
+ */
37
+ export interface LayoutContentProps {
38
+ /** 自定义类名 */
39
+ className?: string;
40
+ /** 自定义样式 */
41
+ style?: CSSProperties;
42
+ /** 子元素 */
43
+ children?: ReactNode;
44
+ /** 主题模式 */
45
+ theme?: 'light' | 'dark';
46
+ }
47
+ /**
48
+ * Layout.Footer 组件属性接口
49
+ */
50
+ export interface LayoutFooterProps {
51
+ /** 自定义类名 */
52
+ className?: string;
53
+ /** 自定义样式 */
54
+ style?: CSSProperties;
55
+ /** 子元素 */
56
+ children?: ReactNode;
57
+ /** 页脚高度 */
58
+ height?: string | number;
59
+ /** 固定页脚 */
60
+ fixed?: boolean;
61
+ /** 主题模式 */
62
+ theme?: 'light' | 'dark';
63
+ }
64
+ /**
65
+ * Layout.Sider 组件属性接口
66
+ */
67
+ export interface LayoutSiderProps {
68
+ /** 自定义类名 */
69
+ className?: string;
70
+ /** 自定义样式 */
71
+ style?: CSSProperties;
72
+ /** 子元素 */
73
+ children?: ReactNode;
74
+ /** 侧边栏宽度 */
75
+ width?: string | number;
76
+ /** 收缩宽度 */
77
+ collapsedWidth?: number;
78
+ /** 是否可收缩 */
79
+ collapsible?: boolean;
80
+ /** 是否收缩 */
81
+ collapsed?: boolean;
82
+ /** 收缩/展开时的回调 */
83
+ onCollapse?: (collapsed: boolean) => void;
84
+ /** 收缩按钮的触发器 */
85
+ trigger?: ReactNode;
86
+ /** 收缩按钮位置,默认为 'bottom' */
87
+ triggerPlacement?: 'top' | 'bottom';
88
+ /** 是否使用完全收缩模式(收缩时宽度为0,并显示浮动展开按钮) */
89
+ zeroWidthMode?: boolean;
90
+ /** 侧边栏位置(暂未实现,预留) */
91
+ placement?: 'left' | 'right';
92
+ /** 是否固定 */
93
+ fixed?: boolean;
94
+ /** 主题模式 */
95
+ theme?: 'light' | 'dark';
96
+ }
97
+ /**
98
+ * 布局配置接口
99
+ */
100
+ export interface LayoutConfig {
101
+ /** 默认主题配置 */
102
+ theme: {
103
+ headerBg: string;
104
+ headerHeight: string;
105
+ footerBg: string;
106
+ footerHeight: string;
107
+ siderBg: string;
108
+ siderWidth: string;
109
+ siderCollapsedWidth: string;
110
+ contentBg: string;
111
+ };
112
+ }
@@ -1,4 +1,11 @@
1
- import './index.css';
1
+ import React from 'react';
2
2
  import { MenuProps } from './types';
3
+ import './index.css';
4
+ /**
5
+ * Menu 菜单导航组件
6
+ *
7
+ * 为页面和功能提供导航的菜单列表,支持水平顶部导航和垂直菜单
8
+ * 子菜单内嵌在菜单区域,支持缩起/展开功能
9
+ */
3
10
  declare const Menu: React.FC<MenuProps>;
4
11
  export default Menu;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Menu 组件 JSS 样式
3
+ *
4
+ * 如果需要使用 JSS 样式,可以在此定义
5
+ * 目前主要使用 CSS 文件 (index.css) 进行样式定义
6
+ */
7
+ export {};
@@ -1,18 +1,67 @@
1
- export interface MenuItemProps {
1
+ import React from 'react';
2
+ /**
3
+ * 菜单项数据类型
4
+ */
5
+ export interface MenuItem {
6
+ /** 菜单项唯一标识 */
2
7
  key: string;
8
+ /** 菜单项显示文本 */
3
9
  label: string;
10
+ /** 菜单项图标 */
4
11
  icon?: React.ReactNode;
5
- childrens?: MenuItemProps[];
12
+ /** 子菜单项数组 */
13
+ children?: MenuItem[];
14
+ /** 是否禁用 */
15
+ disabled?: boolean;
6
16
  }
17
+ /**
18
+ * 菜单模式类型
19
+ */
20
+ export type MenuMode = 'horizontal' | 'vertical' | 'inline';
21
+ /**
22
+ * 菜单主题类型
23
+ */
24
+ export type MenuTheme = 'light' | 'dark';
25
+ /**
26
+ * Menu 组件 Props
27
+ */
7
28
  export interface MenuProps {
8
- mode: 'horizontal' | 'vertical' | 'inline-flex' | 'inline-block';
9
- items: MenuItemProps[];
29
+ /** 菜单模式 */
30
+ mode?: MenuMode;
31
+ /** 菜单项数组 */
32
+ items: MenuItem[];
33
+ /** 自定义 CSS 类名 */
10
34
  className?: string;
35
+ /** 自定义样式 */
11
36
  style?: React.CSSProperties;
37
+ /** 当前选中的菜单项key */
12
38
  selectedKey?: string;
39
+ /** 默认展开的菜单项key数组 */
40
+ defaultOpenKeys?: string[];
41
+ /** 展开的菜单项key数组(受控模式) */
42
+ openKeys?: string[];
43
+ /** 折叠状态,仅对 vertical 模式有效 */
13
44
  collapsed?: boolean;
14
- onChange?: (info: MenuItemProps, key: string) => void;
15
- menuItemStyle?: React.CSSProperties;
45
+ /** 菜单是否显示(受控模式),默认 true */
46
+ open?: boolean;
47
+ /** 菜单主题 */
48
+ theme?: MenuTheme;
49
+ /** 菜单项点击回调函数 */
50
+ onChange?: (info: MenuItem, key: string) => void;
51
+ /** 展开/折叠回调函数 */
52
+ onOpenChange?: (openKeys: string[]) => void;
16
53
  }
17
- export interface ContextProps {
54
+ /**
55
+ * 菜单项组件 Props
56
+ */
57
+ export interface MenuItemComponentProps {
58
+ item: MenuItem;
59
+ level: number;
60
+ mode: MenuMode;
61
+ collapsed?: boolean;
62
+ theme?: MenuTheme;
63
+ openKeySet: Set<string>;
64
+ selectedKey: string;
65
+ onItemClick: (item: MenuItem, key: string) => void;
66
+ onToggleOpen: (key: string) => void;
18
67
  }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { PopconfirmProps } from './types';
3
+ import './Popconfirm.css';
4
+ declare const Popconfirm: React.FC<PopconfirmProps>;
5
+ export default Popconfirm;
6
+ export type { PopconfirmProps, PopconfirmPlacement } from './types';
File without changes
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ export type PopconfirmPlacement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
3
+ export interface PopconfirmProps {
4
+ title?: ReactNode;
5
+ description?: ReactNode;
6
+ okText?: string;
7
+ cancelText?: string;
8
+ okButtonProps?: {
9
+ variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'link';
10
+ loading?: boolean;
11
+ disabled?: boolean;
12
+ };
13
+ cancelButtonProps?: {
14
+ variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'link';
15
+ disabled?: boolean;
16
+ };
17
+ onConfirm?: () => void | Promise<void>;
18
+ onCancel?: () => void;
19
+ disabled?: boolean;
20
+ icon?: ReactNode;
21
+ placement?: PopconfirmPlacement;
22
+ showCancel?: boolean;
23
+ getContainer?: HTMLElement | (() => HTMLElement) | false;
24
+ className?: string;
25
+ style?: React.CSSProperties;
26
+ children: React.ReactElement;
27
+ }
28
+ export default PopconfirmProps;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ProgressProps, ProgressStatus, ProgressType } from './types';
3
+ import './Progress.css';
4
+ declare const Progress: React.FC<ProgressProps>;
5
+ export default Progress;
6
+ export type { ProgressProps, ProgressType, ProgressStatus };
File without changes