@zjpcy/simple-design 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +0 -7
  2. package/dist/cjs/index.css +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/es/Anchor/index.js +1 -1
  5. package/dist/es/Breadcrumb/index.js +1 -0
  6. package/dist/es/Cascader/index.js +1 -0
  7. package/dist/es/Dropdown/index.js +1 -0
  8. package/dist/es/Icon/path.js +1 -1
  9. package/dist/es/Menu/index.js +1 -0
  10. package/dist/es/Modal/index.js +1 -1
  11. package/dist/es/Navigation/index.js +1 -0
  12. package/dist/es/Pagination/index.js +1 -0
  13. package/dist/es/Steps/index.js +1 -0
  14. package/dist/es/Table/index.js +1 -1
  15. package/dist/es/Tabs/index.js +1 -0
  16. package/dist/es/index.css +1 -1
  17. package/dist/es/index.js +1 -1
  18. package/dist/es/node_modules/i18next/dist/esm/i18next.js +1 -1
  19. package/dist/types/components/Breadcrumb/index.d.ts +5 -0
  20. package/dist/types/components/Breadcrumb/types.d.ts +9 -0
  21. package/dist/types/components/Cascader/index.d.ts +5 -0
  22. package/dist/types/components/Cascader/types.d.ts +35 -0
  23. package/dist/types/components/Dropdown/index.d.ts +5 -0
  24. package/dist/types/components/Dropdown/types.d.ts +25 -0
  25. package/dist/types/components/Hooks/useClickOutside.d.ts +4 -0
  26. package/dist/types/components/Menu/index.d.ts +4 -0
  27. package/dist/types/components/Menu/types.d.ts +18 -0
  28. package/dist/types/components/Modal/types.d.ts +1 -0
  29. package/dist/types/components/Navigation/index.d.ts +5 -0
  30. package/dist/types/components/Navigation/types.d.ts +43 -0
  31. package/dist/types/components/Pagination/index.d.ts +5 -0
  32. package/dist/types/components/Pagination/types.d.ts +29 -0
  33. package/dist/types/components/Steps/index.d.ts +5 -0
  34. package/dist/types/components/Steps/types.d.ts +31 -0
  35. package/dist/types/components/Table/index.d.ts +1 -1
  36. package/dist/types/components/Tabs/index.d.ts +5 -0
  37. package/dist/types/components/Tabs/types.d.ts +27 -0
  38. package/dist/types/components/index.d.ts +8 -0
  39. package/package.json +7 -2
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ export type DropdownType = 'text' | 'button';
3
+ export interface DropdownItem {
4
+ key: string;
5
+ label: React.ReactNode;
6
+ disabled?: boolean;
7
+ onClick?: () => void;
8
+ icon?: string | React.ReactNode;
9
+ }
10
+ export interface DropdownProps {
11
+ items: DropdownItem[];
12
+ type?: DropdownType;
13
+ children?: React.ReactNode;
14
+ trigger?: 'click' | 'hover';
15
+ placement?: 'top' | 'bottom' | 'left' | 'right';
16
+ disabled?: boolean;
17
+ open?: boolean;
18
+ ellipsis?: boolean;
19
+ className?: string;
20
+ style?: React.CSSProperties;
21
+ contentStyles?: React.CSSProperties;
22
+ getContainer?: () => HTMLElement;
23
+ onVisibleChange?: (visible: boolean) => void;
24
+ onChange?: (item: DropdownItem) => void;
25
+ }
@@ -0,0 +1,4 @@
1
+ import { type RefObject } from 'react';
2
+ type Event = MouseEvent | TouchEvent;
3
+ export declare const useClickOutside: <T extends HTMLElement>(ref: RefObject<T | null>, callback: (event: Event) => void) => void;
4
+ export {};
@@ -0,0 +1,4 @@
1
+ import './index.css';
2
+ import { MenuProps } from './types';
3
+ declare const Menu: React.FC<MenuProps>;
4
+ export default Menu;
@@ -0,0 +1,18 @@
1
+ export interface MenuItemProps {
2
+ key: string;
3
+ label: string;
4
+ icon?: React.ReactNode;
5
+ childrens?: MenuItemProps[];
6
+ }
7
+ export interface MenuProps {
8
+ mode: 'horizontal' | 'vertical' | 'inline-flex' | 'inline-block';
9
+ items: MenuItemProps[];
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ selectedKey?: string;
13
+ collapsed?: boolean;
14
+ onChange?: (info: MenuItemProps, key: string) => void;
15
+ menuItemStyle?: React.CSSProperties;
16
+ }
17
+ export interface ContextProps {
18
+ }
@@ -9,6 +9,7 @@ export interface ModalProps {
9
9
  direction?: 'center' | 'top-right' | 'bottom-right' | 'normal';
10
10
  top?: number;
11
11
  footer?: null | React.ReactNode;
12
+ bordered?: boolean;
12
13
  onCancel?: () => void;
13
14
  onOk?: () => void;
14
15
  children?: React.ReactNode;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { NavigationProps } from './types';
3
+ import './Navigation.css';
4
+ declare const Navigation: React.FC<NavigationProps>;
5
+ export default Navigation;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ export interface NavigationItem {
3
+ key: string;
4
+ name: string;
5
+ description?: string;
6
+ icon?: React.ReactNode;
7
+ childrens?: NavigationItem[];
8
+ disabled?: boolean;
9
+ }
10
+ export type NavigationMode = 'vertical' | 'horizontal';
11
+ export interface NavigationProps {
12
+ items: NavigationItem[];
13
+ selectedKey?: string;
14
+ collapsed?: boolean;
15
+ defaultOpenKeys?: string[];
16
+ mode?: NavigationMode;
17
+ closeOnOutsideClick?: boolean;
18
+ header?: React.ReactNode;
19
+ footer?: React.ReactNode;
20
+ onChange?: (item: NavigationItem, key: string) => void;
21
+ onCollapseChange?: (collapsed: boolean) => void;
22
+ className?: string;
23
+ style?: React.CSSProperties;
24
+ width?: number;
25
+ collapsedWidth?: number;
26
+ animationDuration?: number;
27
+ }
28
+ export interface NavigationState {
29
+ openKeys: string[];
30
+ selectedKey: string;
31
+ collapsed: boolean;
32
+ }
33
+ export interface NavigationContextType {
34
+ openKeys: string[];
35
+ selectedKey: string;
36
+ collapsed: boolean;
37
+ keyRef: React.RefObject<string>;
38
+ clickNodeRef: React.RefObject<NavigationItem | null>;
39
+ toggleOpenKey: (key: string) => void;
40
+ setSelectedKey: (key: string) => void;
41
+ toggleCollapsed: () => void;
42
+ }
43
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './Pagination.css';
3
+ import type { PaginationProps } from './types';
4
+ declare const Pagination: React.FC<PaginationProps>;
5
+ export default Pagination;
@@ -0,0 +1,29 @@
1
+ export interface PaginationProps {
2
+ total?: number;
3
+ current?: number;
4
+ defaultCurrent?: number;
5
+ pageSize?: number;
6
+ defaultPageSize?: number;
7
+ onChange?: {
8
+ (current: number): void;
9
+ (current: number, pageSize?: number): void;
10
+ };
11
+ pageSizeOptions?: string[];
12
+ showSizeChanger?: boolean;
13
+ showQuickJumper?: boolean;
14
+ showTotal?: (total: number, range: [number, number]) => React.ReactNode;
15
+ size?: 'default' | 'small';
16
+ /**
17
+ * 分页组件位置对齐方式
18
+ */
19
+ align?: 'flex-start' | 'center' | 'flex-end';
20
+ /**
21
+ * 自定义CSS类名
22
+ */
23
+ className?: string;
24
+ /**
25
+ * 自定义内联样式
26
+ */
27
+ style?: React.CSSProperties;
28
+ }
29
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { StepsProps } from './types';
3
+ import './Steps.css';
4
+ declare const Steps: React.FC<StepsProps>;
5
+ export default Steps;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export type StepStatus = 'wait' | 'process' | 'finish' | 'error';
3
+ export interface StepItem {
4
+ title?: React.ReactNode;
5
+ description?: React.ReactNode;
6
+ node?: React.ReactNode;
7
+ status?: StepStatus;
8
+ disabled?: boolean;
9
+ tailColor?: string;
10
+ tailTitle?: React.ReactNode;
11
+ tailType?: 'solid' | 'dashed';
12
+ }
13
+ export interface StepsProps {
14
+ current?: number;
15
+ status?: StepStatus;
16
+ direction?: 'horizontal' | 'vertical';
17
+ size?: 'default' | 'small';
18
+ type?: 'default' | 'panel';
19
+ items: StepItem[];
20
+ onChange?: (current: number) => void;
21
+ className?: string;
22
+ style?: React.CSSProperties;
23
+ }
24
+ export interface StepContextType {
25
+ current: number;
26
+ status: StepStatus;
27
+ direction: 'horizontal' | 'vertical';
28
+ size: 'default' | 'small';
29
+ type: 'default' | 'panel';
30
+ onChange?: (current: number) => void;
31
+ }
@@ -14,7 +14,7 @@ export interface PaginationProps {
14
14
  pageSize?: number;
15
15
  total?: number;
16
16
  current?: number;
17
- onChange?: (page: number, pageSize: number) => void;
17
+ onChange?: (page: number, pageSize?: number) => void;
18
18
  [key: string]: any;
19
19
  }
20
20
  interface TableProps {
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { TabsProps } from './types';
3
+ import './Tabs.css';
4
+ declare const Tabs: React.FC<TabsProps>;
5
+ export default Tabs;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ export interface TabItem {
3
+ key: string;
4
+ label: React.ReactNode;
5
+ content: React.ReactNode;
6
+ disabled?: boolean;
7
+ closable?: boolean;
8
+ icon?: React.ReactNode;
9
+ }
10
+ export type TabPlacement = 'top' | 'start' | 'end' | 'bottom';
11
+ export type TabType = 'line' | 'card';
12
+ export interface TabsProps {
13
+ items?: TabItem[];
14
+ activeKey?: string;
15
+ defaultActiveKey?: string;
16
+ onChange?: (key: string) => void;
17
+ onClose?: (key: string) => void;
18
+ tabsClosable?: boolean;
19
+ tabPlacement?: TabPlacement;
20
+ type?: TabType;
21
+ onAdd?: () => void;
22
+ className?: string;
23
+ style?: React.CSSProperties;
24
+ contentStyle?: React.CSSProperties;
25
+ draggable?: boolean;
26
+ onDragEnd?: (items: TabItem[]) => void;
27
+ }
@@ -1,4 +1,5 @@
1
1
  export { default as Button } from './Button';
2
+ export { default as Cascader } from './Cascader';
2
3
  export { default as ColorPicker } from './ColorPicker';
3
4
  export { default as CopyToClipboard, useOnCopy as useCopy } from './CopyToClipboard';
4
5
  export { default as Divider } from './Divider';
@@ -19,5 +20,12 @@ export { default as Typography } from './Typography';
19
20
  export { default as Masonry } from './Masonry';
20
21
  export { default as Space } from './Space';
21
22
  export { default as Anchor } from './Anchor';
23
+ export { default as Breadcrumb } from './Breadcrumb';
22
24
  export { default as I18nProvider, useI18n, load18n } from '../i18n/I18nProvider';
23
25
  export { default as i18n } from '../i18n/index';
26
+ export { default as Dropdown } from './Dropdown';
27
+ export { default as Menu } from './Menu';
28
+ export { default as Pagination } from './Pagination';
29
+ export { default as Navigation } from './Navigation';
30
+ export { default as Steps } from './Steps';
31
+ export { default as Tabs } from './Tabs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zjpcy/simple-design",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "IDP Studio Design System - React Component Library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -49,6 +49,7 @@
49
49
  "@vitejs/plugin-react": "^4.0.0",
50
50
  "autoprefixer": "^10.4.23",
51
51
  "css-loader": "^6.0.0",
52
+ "dnd-kit": "^0.0.2",
52
53
  "eslint": "^8.0.0",
53
54
  "eslint-plugin-react": "^7.32.0",
54
55
  "html-webpack-plugin": "^5.6.5",
@@ -75,10 +76,14 @@
75
76
  "webpack-dev-server": "^4.13.0"
76
77
  },
77
78
  "dependencies": {
79
+ "@dnd-kit/core": "^6.3.1",
80
+ "@dnd-kit/sortable": "^10.0.0",
81
+ "@dnd-kit/utilities": "^3.2.2",
78
82
  "classnames": "^2.3.0",
79
83
  "prismjs": "^1.30.0",
80
84
  "react-color": "^2.19.3",
81
- "react-syntax-highlighter": "^16.1.0"
85
+ "react-syntax-highlighter": "^16.1.0",
86
+ "styled-components": "^6.3.8"
82
87
  },
83
88
  "repository": {
84
89
  "type": "git",