zs_library 0.6.0 → 0.6.4

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.
@@ -1 +1,13 @@
1
- export declare const useSortableConfig: () => import('./context').SortableConfig<any, any>;
1
+ import { Theme } from '../../themes';
2
+ export declare const useSortableConfig: () => {
3
+ theme: Theme;
4
+ noLetters?: boolean;
5
+ typeConfigMap?: import('../..').TypeConfigMap;
6
+ dataTypeMenuConfigMap?: import('../..').DataTypeMenuConfigMap;
7
+ contextMenu?: false | import('../../context-menu').ContextMenuProps<any, any> | ((data: import('../..').SortItem<any, any>) => false | import('../../context-menu').ContextMenuProps<any, any>) | undefined;
8
+ pagingDotsBuilder?: (dots: React.ReactNode) => React.JSX.Element;
9
+ pagingDotBuilder?: ((item: import('../..').ListItem<any, any>, index: number, isActive: boolean) => React.JSX.Element) | undefined;
10
+ itemBuilder?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
11
+ itemIconBuilder?: ((item: import('../..').SortItem<any, any>) => React.ReactNode) | undefined;
12
+ contextMenuBuilder?: ((data: import('../..').SortItem<any, any>) => import('../../context-menu').ContextMenuProps<any, any>) | undefined;
13
+ };
@@ -0,0 +1,6 @@
1
+ import { motion } from 'motion/react';
2
+ import { FC } from 'react';
3
+ export interface ContentMenuContextProps extends React.ComponentProps<typeof motion.div> {
4
+ }
5
+ declare const ContextMenuContent: FC<ContentMenuContextProps>;
6
+ export default ContextMenuContent;
@@ -0,0 +1,5 @@
1
+ export interface HoverContextType {
2
+ hoveredIndex: number | null;
3
+ setHoveredIndex: (index: number | null) => void;
4
+ }
5
+ export declare const HoverContext: import('react').Context<HoverContextType>;
@@ -12,3 +12,11 @@ export interface ContextMenuProps<D, C> {
12
12
  }
13
13
  declare const ContextMenu: <D, C>(props: ContextMenuProps<D, C>) => import("react/jsx-runtime").JSX.Element;
14
14
  export default ContextMenu;
15
+ export { MenuItem } from './menu-item';
16
+ export { SubMenuItem } from './sub-menu-item';
17
+ export { SizeSubMenuContent } from './size-sub-menu-content';
18
+ export { HoverContext } from './hover-context';
19
+ export type { MenuItemProps } from './menu-item';
20
+ export type { SubMenuItemProps } from './sub-menu-item';
21
+ export type { SizeMenuItemProps } from './size-sub-menu-content';
22
+ export type { HoverContextType } from './hover-context';
@@ -0,0 +1,10 @@
1
+ export interface MenuItemProps {
2
+ icon?: React.ReactNode;
3
+ text: string;
4
+ color?: string;
5
+ textColor?: string;
6
+ onClick?: () => void;
7
+ index: number;
8
+ children?: React.ReactNode;
9
+ }
10
+ export declare const MenuItem: ({ icon, text, color, textColor, onClick, index, children, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export interface SizeMenuItemProps {
2
+ sizes: string[];
3
+ currentSize: string;
4
+ onSizeChange: (size: string) => void;
5
+ }
6
+ export declare const SizeSubMenuContent: ({ sizes, currentSize, onSizeChange }: SizeMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface SubMenuItemProps {
2
+ text: string;
3
+ icon: React.ReactNode;
4
+ index: number;
5
+ children: React.ReactNode;
6
+ color?: string;
7
+ textColor?: string;
8
+ }
9
+ export declare const SubMenuItem: ({ text, icon, index, children, color, textColor, ...props }: SubMenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,14 @@
1
1
  import { default as React } from 'react';
2
2
  import { SortItem } from '../types';
3
- export interface DockProps {
3
+ export interface DockProps<D, C> {
4
4
  /**
5
5
  * dock 项目列表
6
6
  */
7
- items?: SortItem[];
7
+ items?: SortItem<D, C>[];
8
8
  /**
9
9
  * 固定项目列表(在sortable之前显示,不可拖拽排序)
10
10
  */
11
- fixedItems?: SortItem[];
11
+ fixedItems?: SortItem<D, C>[];
12
12
  /**
13
13
  * dock 位置
14
14
  */
@@ -20,15 +20,15 @@ export interface DockProps {
20
20
  /**
21
21
  * dock 项目点击事件
22
22
  */
23
- onItemClick?: (item: SortItem) => void;
23
+ onItemClick?: (item: SortItem<D, C>) => void;
24
24
  /**
25
25
  * 自定义项目渲染
26
26
  */
27
- itemBuilder?: (item: SortItem, index: number) => React.ReactNode;
27
+ itemBuilder?: (item: SortItem<D, C>, index: number) => React.ReactNode;
28
28
  /**
29
29
  * 自定义固定项目渲染
30
30
  */
31
- fixedItemBuilder?: (item: SortItem, index: number) => React.ReactNode;
31
+ fixedItemBuilder?: (item: SortItem<D, C>, index: number) => React.ReactNode;
32
32
  /**
33
33
  * 是否显示启动台按钮
34
34
  */
@@ -44,7 +44,7 @@ export interface DockProps {
44
44
  /**
45
45
  * dock 项目列表变更事件
46
46
  */
47
- onDockItemsChange?: (items: SortItem[]) => void;
47
+ onDockItemsChange?: (items: SortItem<D, C>[]) => void;
48
48
  }
49
- declare const Dock: React.FC<DockProps>;
49
+ declare const Dock: <D, C>({ items, fixedItems, position, className, itemBuilder, fixedItemBuilder, showLaunchpad, onLaunchpadClick, onDrop, onDockItemsChange, }: DockProps<D, C>) => import("react/jsx-runtime").JSX.Element | null;
50
50
  export default Dock;
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { Theme } from '../themes';
2
3
  export interface StackedIconProps {
3
4
  /**
4
5
  * 点击事件
@@ -8,6 +9,10 @@ export interface StackedIconProps {
8
9
  * 自定义类名
9
10
  */
10
11
  className?: string;
12
+ /**
13
+ * 主题配置
14
+ */
15
+ theme?: Theme;
11
16
  }
12
17
  declare const StackedIcon: React.FC<StackedIconProps>;
13
18
  export default StackedIcon;
@@ -13,6 +13,7 @@ export interface SortableItemProps<D, C> {
13
13
  childrenLength?: number;
14
14
  contextMenuProps?: false | Partial<ContextMenuProps<D, C>>;
15
15
  icon?: React.ReactNode;
16
+ iconSize?: number;
16
17
  /**
17
18
  * 来源 当前仅支持 dock
18
19
  */
@@ -39,31 +39,7 @@ export interface SortableProps<D, C> {
39
39
  * 是否显示 dock
40
40
  */
41
41
  enabled?: boolean;
42
- /**
43
- * dock 位置
44
- */
45
- position?: "top" | "bottom" | "left" | "right";
46
- /**
47
- * dock 样式类名
48
- */
49
- className?: string;
50
- /**
51
- * 自定义 dock 项目渲染
52
- */
53
- itemBuilder?: DockProps["itemBuilder"];
54
- /**
55
- * 自定义固定项目渲染
56
- */
57
- fixedItemBuilder?: DockProps["fixedItemBuilder"];
58
- /**
59
- * 固定项目列表(在sortable之前显示,不可拖拽排序)
60
- */
61
- fixedItems?: DockProps["fixedItems"];
62
- /**
63
- * 是否显示启动台按钮
64
- */
65
- showLaunchpad?: boolean;
66
- };
42
+ } & Omit<DockProps<D, C>, "onDrop" | "onDockItemsChange">;
67
43
  }
68
44
  declare const Sortable: <D, C>(props: SortableProps<D, C>) => import("react/jsx-runtime").JSX.Element;
69
45
  export default Sortable;
@@ -1,5 +1,29 @@
1
1
  import { themeDark } from './dark';
2
2
  import { themeLight } from './light';
3
+ export interface BaseModalTheme {
4
+ mask?: {
5
+ backgroundColor?: string;
6
+ backdropFilter?: string;
7
+ };
8
+ content?: {
9
+ backgroundColor?: string;
10
+ backdropFilter?: string;
11
+ boxShadowColor?: string;
12
+ boxShadowBorderColor?: string;
13
+ borderColor?: string;
14
+ borderRadius?: string;
15
+ };
16
+ header?: {
17
+ textColor?: string;
18
+ };
19
+ scrollbar?: {
20
+ width?: string;
21
+ trackColor?: string;
22
+ thumbColor?: string;
23
+ thumbHoverColor?: string;
24
+ borderRadius?: string;
25
+ };
26
+ }
3
27
  export interface DockTheme {
4
28
  backgroundColor?: string;
5
29
  borderColor?: string;
@@ -7,20 +31,89 @@ export interface DockTheme {
7
31
  divider?: {
8
32
  color?: string;
9
33
  };
34
+ launchpad?: {
35
+ modal?: {
36
+ searchBox?: {
37
+ iconColor?: string;
38
+ iconFocusColor?: string;
39
+ backgroundColor?: string;
40
+ focusBackgroundColor?: string;
41
+ textColor?: string;
42
+ placeholderColor?: string;
43
+ shadowColor?: string;
44
+ clearButton?: {
45
+ backgroundColor?: string;
46
+ hoverBackgroundColor?: string;
47
+ textColor?: string;
48
+ };
49
+ };
50
+ };
51
+ icon?: {
52
+ textColor?: string;
53
+ backgroundColor?: string;
54
+ borderColor?: string;
55
+ shadowColor?: string;
56
+ hoverGlowColor?: string;
57
+ };
58
+ };
59
+ }
60
+ export interface LaunchpadTheme {
61
+ button?: {
62
+ backgroundColor?: string;
63
+ subBackgroundColor?: string;
64
+ thirdBackgroundColor?: string;
65
+ borderColor?: string;
66
+ hoverBackgroundColor?: string;
67
+ };
68
+ modal?: BaseModalTheme;
69
+ }
70
+ export interface ContextMenuTheme {
71
+ textColor?: string;
72
+ activeColor?: string;
73
+ dangerColor?: string;
74
+ backgroundColor?: string;
75
+ shadowColor?: string;
76
+ boxShadowBorderColor?: string;
77
+ borderColor?: string;
78
+ backdropFilter?: string;
79
+ }
80
+ export interface ItemsTheme {
81
+ textColor?: string;
82
+ iconBackgroundColor?: string;
83
+ iconShadowColor?: string;
84
+ groupIconBackgroundColor?: string;
85
+ groupIconShadowColor?: string;
86
+ infoModalBackgroundColor?: string;
87
+ groupModal?: {
88
+ backgroundColor?: string;
89
+ title?: {
90
+ textColor?: string;
91
+ backgroundColor?: string;
92
+ hoverBackgroundColor?: string;
93
+ focusBackgroundColor?: string;
94
+ shadowColor?: string;
95
+ placeholderColor?: string;
96
+ selectionBackgroundColor?: string;
97
+ };
98
+ };
99
+ }
100
+ export interface BaseTheme {
101
+ hoverColor?: string;
102
+ dangerColor?: string;
103
+ backgroundColor?: string;
104
+ textColor?: string;
105
+ shadowColor?: string;
106
+ boxShadowBorderColor?: string;
107
+ borderColor?: string;
108
+ backdropFilter?: string;
10
109
  }
11
110
  export interface Theme {
12
111
  token: {
13
- itemNameColor?: string;
14
- itemIconBackgroundColor?: string;
15
- itemIconShadowColor?: string;
16
- groupItemIconBackgroundColor?: string;
17
- groupItemIconShadowColor?: string;
18
- groupItemModalBackgroundColor?: string;
19
- contextMenuTextColor?: string;
20
- contextMenuActiveColor?: string;
21
- contextMenuBackgroundColor?: string;
22
- contextMenuShadowColor?: string;
112
+ base?: BaseTheme;
23
113
  dock?: DockTheme;
114
+ modal?: BaseModalTheme;
115
+ contextMenu?: ContextMenuTheme;
116
+ items?: ItemsTheme;
24
117
  };
25
118
  }
26
119
  export declare const defaultTheme: Theme;
@@ -0,0 +1,6 @@
1
+ import { Theme } from './index';
2
+ /**
3
+ * 合成完整主题配置
4
+ * 优先级:base外配置 > base配置 > 内置base配置
5
+ */
6
+ export declare function mergeTheme(theme: Theme | "light" | "dark"): Theme;