z-biz-tool-shared 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/README.md +10 -0
- package/dist/agent/AgentManager.d.ts +15 -0
- package/dist/agent/AgentManager.d.ts.map +1 -0
- package/dist/agent/AgentManager.js +152 -0
- package/dist/agent/AgentManager.js.map +1 -0
- package/dist/agent/AgentPanel.d.ts +3 -0
- package/dist/agent/AgentPanel.d.ts.map +1 -0
- package/dist/agent/AgentPanel.js +98 -0
- package/dist/agent/AgentPanel.js.map +1 -0
- package/dist/agent/QueryHistoryViewer.d.ts +15 -0
- package/dist/agent/QueryHistoryViewer.d.ts.map +1 -0
- package/dist/agent/QueryHistoryViewer.js +78 -0
- package/dist/agent/QueryHistoryViewer.js.map +1 -0
- package/dist/agent/SQLEditor.d.ts +8 -0
- package/dist/agent/SQLEditor.d.ts.map +1 -0
- package/dist/agent/SQLEditor.js +40 -0
- package/dist/agent/SQLEditor.js.map +1 -0
- package/dist/agent/index.d.ts +6 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +7 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/types.d.ts +35 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +2 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/ai/AIManager.d.ts +17 -0
- package/dist/ai/AIManager.d.ts.map +1 -0
- package/dist/ai/AIManager.js +191 -0
- package/dist/ai/AIManager.js.map +1 -0
- package/dist/ai/context.d.ts +17 -0
- package/dist/ai/context.d.ts.map +1 -0
- package/dist/ai/context.js +82 -0
- package/dist/ai/context.js.map +1 -0
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +5 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/types.d.ts +43 -0
- package/dist/ai/types.d.ts.map +1 -0
- package/dist/ai/types.js +2 -0
- package/dist/ai/types.js.map +1 -0
- package/dist/components/GlobalShortcutHandler.d.ts +17 -0
- package/dist/components/GlobalShortcutHandler.d.ts.map +1 -0
- package/dist/components/GlobalShortcutHandler.js +74 -0
- package/dist/components/GlobalShortcutHandler.js.map +1 -0
- package/dist/components/Navbar.d.ts +16 -0
- package/dist/components/Navbar.d.ts.map +1 -0
- package/dist/components/Navbar.js +136 -0
- package/dist/components/Navbar.js.map +1 -0
- package/dist/components/ProgressIndicator.d.ts +12 -0
- package/dist/components/ProgressIndicator.d.ts.map +1 -0
- package/dist/components/ProgressIndicator.js +6 -0
- package/dist/components/ProgressIndicator.js.map +1 -0
- package/dist/components/ShortcutDisplay.d.ts +8 -0
- package/dist/components/ShortcutDisplay.d.ts.map +1 -0
- package/dist/components/ShortcutDisplay.js +5 -0
- package/dist/components/ShortcutDisplay.js.map +1 -0
- package/dist/components/Spotlight.d.ts +22 -0
- package/dist/components/Spotlight.d.ts.map +1 -0
- package/dist/components/Spotlight.js +208 -0
- package/dist/components/Spotlight.js.map +1 -0
- package/dist/components/SpotlightProvider.d.ts +5 -0
- package/dist/components/SpotlightProvider.d.ts.map +1 -0
- package/dist/components/SpotlightProvider.js +22 -0
- package/dist/components/SpotlightProvider.js.map +1 -0
- package/dist/components/StateIndicator.d.ts +11 -0
- package/dist/components/StateIndicator.d.ts.map +1 -0
- package/dist/components/StateIndicator.js +12 -0
- package/dist/components/StateIndicator.js.map +1 -0
- package/dist/components/UIDesignSystem.d.ts +124 -0
- package/dist/components/UIDesignSystem.d.ts.map +1 -0
- package/dist/components/UIDesignSystem.js +222 -0
- package/dist/components/UIDesignSystem.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/interactions/index.d.ts +2 -0
- package/dist/interactions/index.d.ts.map +1 -0
- package/dist/interactions/index.js +3 -0
- package/dist/interactions/index.js.map +1 -0
- package/dist/interactions/interactionPatterns.d.ts +155 -0
- package/dist/interactions/interactionPatterns.d.ts.map +1 -0
- package/dist/interactions/interactionPatterns.js +180 -0
- package/dist/interactions/interactionPatterns.js.map +1 -0
- package/dist/notifications/ToastContainer.d.ts +3 -0
- package/dist/notifications/ToastContainer.d.ts.map +1 -0
- package/dist/notifications/ToastContainer.js +14 -0
- package/dist/notifications/ToastContainer.js.map +1 -0
- package/dist/notifications/index.d.ts +3 -0
- package/dist/notifications/index.d.ts.map +1 -0
- package/dist/notifications/index.js +4 -0
- package/dist/notifications/index.js.map +1 -0
- package/dist/notifications/notificationManager.d.ts +18 -0
- package/dist/notifications/notificationManager.d.ts.map +1 -0
- package/dist/notifications/notificationManager.js +68 -0
- package/dist/notifications/notificationManager.js.map +1 -0
- package/dist/notifications/types.d.ts +9 -0
- package/dist/notifications/types.d.ts.map +1 -0
- package/dist/notifications/types.js +2 -0
- package/dist/notifications/types.js.map +1 -0
- package/dist/shared/AppShell.d.ts +14 -0
- package/dist/shared/AppShell.d.ts.map +1 -0
- package/dist/shared/AppShell.js +94 -0
- package/dist/shared/AppShell.js.map +1 -0
- package/dist/shared/CollapsiblePanel.d.ts +31 -0
- package/dist/shared/CollapsiblePanel.d.ts.map +1 -0
- package/dist/shared/CollapsiblePanel.js +140 -0
- package/dist/shared/CollapsiblePanel.js.map +1 -0
- package/dist/shared/DragHandle.d.ts +37 -0
- package/dist/shared/DragHandle.d.ts.map +1 -0
- package/dist/shared/DragHandle.js +85 -0
- package/dist/shared/DragHandle.js.map +1 -0
- package/dist/shared/Omnibar.d.ts +19 -0
- package/dist/shared/Omnibar.d.ts.map +1 -0
- package/dist/shared/Omnibar.js +258 -0
- package/dist/shared/Omnibar.js.map +1 -0
- package/dist/shared/States.d.ts +22 -0
- package/dist/shared/States.d.ts.map +1 -0
- package/dist/shared/States.js +190 -0
- package/dist/shared/States.js.map +1 -0
- package/dist/shared/TabsBar.d.ts +7 -0
- package/dist/shared/TabsBar.d.ts.map +1 -0
- package/dist/shared/TabsBar.js +186 -0
- package/dist/shared/TabsBar.js.map +1 -0
- package/dist/shared/ThemeContext.d.ts +17 -0
- package/dist/shared/ThemeContext.d.ts.map +1 -0
- package/dist/shared/ThemeContext.js +134 -0
- package/dist/shared/ThemeContext.js.map +1 -0
- package/dist/shared/designTokens.d.ts +54 -0
- package/dist/shared/designTokens.d.ts.map +1 -0
- package/dist/shared/designTokens.js +58 -0
- package/dist/shared/designTokens.js.map +1 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +10 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/useKeyboardShortcuts.d.ts +37 -0
- package/dist/shared/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/shared/useKeyboardShortcuts.js +161 -0
- package/dist/shared/useKeyboardShortcuts.js.map +1 -0
- package/dist/shortcuts/index.d.ts +3 -0
- package/dist/shortcuts/index.d.ts.map +1 -0
- package/dist/shortcuts/index.js +4 -0
- package/dist/shortcuts/index.js.map +1 -0
- package/dist/shortcuts/shortcutManager.d.ts +26 -0
- package/dist/shortcuts/shortcutManager.d.ts.map +1 -0
- package/dist/shortcuts/shortcutManager.js +90 -0
- package/dist/shortcuts/shortcutManager.js.map +1 -0
- package/dist/shortcuts/types.d.ts +8 -0
- package/dist/shortcuts/types.d.ts.map +1 -0
- package/dist/shortcuts/types.js +2 -0
- package/dist/shortcuts/types.js.map +1 -0
- package/dist/styles/designTokens.d.ts +181 -0
- package/dist/styles/designTokens.d.ts.map +1 -0
- package/dist/styles/designTokens.js +199 -0
- package/dist/styles/designTokens.js.map +1 -0
- package/dist/styles/globalStyles.d.ts +8 -0
- package/dist/styles/globalStyles.d.ts.map +1 -0
- package/dist/styles/globalStyles.js +216 -0
- package/dist/styles/globalStyles.js.map +1 -0
- package/dist/styles/index.d.ts +3 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/index.js +4 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/theme/ThemeContext.d.ts +17 -0
- package/dist/theme/ThemeContext.d.ts.map +1 -0
- package/dist/theme/ThemeContext.js +60 -0
- package/dist/theme/ThemeContext.js.map +1 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +5 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/themeManager.d.ts +12 -0
- package/dist/theme/themeManager.d.ts.map +1 -0
- package/dist/theme/themeManager.js +160 -0
- package/dist/theme/themeManager.js.map +1 -0
- package/dist/theme/types.d.ts +16 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +3 -0
- package/dist/theme/types.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '../theme';
|
|
3
|
+
// 设计令牌
|
|
4
|
+
export const DESIGN_TOKENS = {
|
|
5
|
+
borderRadius: {
|
|
6
|
+
sm: '4px',
|
|
7
|
+
md: '8px',
|
|
8
|
+
lg: '12px',
|
|
9
|
+
xl: '16px',
|
|
10
|
+
'2xl': '24px',
|
|
11
|
+
full: '9999px'
|
|
12
|
+
},
|
|
13
|
+
boxShadow: {
|
|
14
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
15
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
16
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
17
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
|
18
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',
|
|
19
|
+
none: 'none'
|
|
20
|
+
},
|
|
21
|
+
spacing: {
|
|
22
|
+
xs: '4px',
|
|
23
|
+
sm: '8px',
|
|
24
|
+
md: '16px',
|
|
25
|
+
lg: '24px',
|
|
26
|
+
xl: '32px',
|
|
27
|
+
'2xl': '48px',
|
|
28
|
+
'3xl': '64px'
|
|
29
|
+
},
|
|
30
|
+
fontSize: {
|
|
31
|
+
xs: '12px',
|
|
32
|
+
sm: '14px',
|
|
33
|
+
base: '16px',
|
|
34
|
+
lg: '18px',
|
|
35
|
+
xl: '20px',
|
|
36
|
+
'2xl': '24px',
|
|
37
|
+
'3xl': '30px',
|
|
38
|
+
'4xl': '36px'
|
|
39
|
+
},
|
|
40
|
+
fontWeight: {
|
|
41
|
+
light: '300',
|
|
42
|
+
normal: '400',
|
|
43
|
+
medium: '500',
|
|
44
|
+
semibold: '600',
|
|
45
|
+
bold: '700'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// 图标组件
|
|
49
|
+
export const Icon = ({ name, size = 24, className = '', color }) => {
|
|
50
|
+
const icons = {
|
|
51
|
+
search: _jsx("path", { d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }),
|
|
52
|
+
menu: (_jsx(_Fragment, { children: _jsx("path", { d: "M4 6h16M4 12h16M4 18h16" }) })),
|
|
53
|
+
close: _jsx("path", { d: "M6 18L18 6M6 6l12 12" }),
|
|
54
|
+
settings: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" }), _jsx("path", { d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" })] })),
|
|
55
|
+
plus: _jsx("path", { d: "M12 4v16m8-8H4" }),
|
|
56
|
+
edit: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V9z" }), _jsx("path", { d: "M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z" })] })),
|
|
57
|
+
trash: (_jsxs(_Fragment, { children: [_jsx("path", { d: "M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2" }), _jsx("path", { d: "M10 11v6M14 11v6" })] })),
|
|
58
|
+
check: _jsx("path", { d: "M5 13l4 4L19 7" }),
|
|
59
|
+
x: _jsx("path", { d: "M6 18L18 6M6 6l12 12" }),
|
|
60
|
+
chevronDown: _jsx("path", { d: "M19 9l-7 7-7-7" }),
|
|
61
|
+
chevronRight: _jsx("path", { d: "M9 5l7 7-7 7" }),
|
|
62
|
+
file: _jsx("path", { d: "M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z" }),
|
|
63
|
+
folder: (_jsx(_Fragment, { children: _jsx("path", { d: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" }) })),
|
|
64
|
+
terminal: _jsx("path", { d: "M4 17l6-6-6-6" }),
|
|
65
|
+
bolt: _jsx("path", { d: "M13 2L3 14h9l-1 8 10-12h-9l1-8z" }),
|
|
66
|
+
cpu: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "4", y: "4", width: "16", height: "16", rx: "2", ry: "2" }), _jsx("rect", { x: "9", y: "9", width: "6", height: "6" }), _jsx("path", { d: "M9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3" })] })),
|
|
67
|
+
globe: (_jsxs(_Fragment, { children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M2 12h20M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z" })] })),
|
|
68
|
+
robot: (_jsxs(_Fragment, { children: [_jsx("rect", { x: "3", y: "11", width: "18", height: "10", rx: "2" }), _jsx("circle", { cx: "12", cy: "5", r: "2" }), _jsx("path", { d: "M12 7v4M8 11v-2M16 11v-2" })] }))
|
|
69
|
+
};
|
|
70
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: icons[name] || _jsx("circle", { cx: "12", cy: "12", r: "10" }) }));
|
|
71
|
+
};
|
|
72
|
+
// 空状态组件
|
|
73
|
+
export const EmptyState = ({ icon = 'file', title, description, action, className = '' }) => {
|
|
74
|
+
const { themeColors } = useTheme();
|
|
75
|
+
return (_jsxs("div", { className: `flex flex-col items-center justify-center py-16 text-center ${className}`, style: { color: themeColors.textSecondary }, children: [_jsx("div", { className: "mb-6", children: _jsx(Icon, { name: icon, size: 64, color: themeColors.textSecondary }) }), _jsx("h3", { className: "text-lg font-medium mb-2", style: { color: themeColors.text }, children: title }), description && (_jsx("p", { className: "max-w-md mb-6", style: { color: themeColors.textSecondary }, children: description })), action && _jsx("div", { children: action })] }));
|
|
76
|
+
};
|
|
77
|
+
// 加载状态组件
|
|
78
|
+
export const LoadingSpinner = ({ size = 'md', color, className = '' }) => {
|
|
79
|
+
const sizeStyles = {
|
|
80
|
+
sm: { width: '16px', height: '16px', borderWidth: '2px' },
|
|
81
|
+
md: { width: '24px', height: '24px', borderWidth: '3px' },
|
|
82
|
+
lg: { width: '40px', height: '40px', borderWidth: '4px' }
|
|
83
|
+
};
|
|
84
|
+
const { themeColors } = useTheme();
|
|
85
|
+
return (_jsx("div", { className: `animate-spin rounded-full border-t-transparent ${className}`, style: {
|
|
86
|
+
...sizeStyles[size],
|
|
87
|
+
borderColor: color || themeColors.textSecondary
|
|
88
|
+
} }));
|
|
89
|
+
};
|
|
90
|
+
// Skeleton 组件
|
|
91
|
+
export const Skeleton = ({ width = '100%', height = '20px', borderRadius = '4px', className = '' }) => {
|
|
92
|
+
return (_jsx("div", { className: `animate-pulse bg-gray-200 dark:bg-gray-700 ${className}`, style: {
|
|
93
|
+
width,
|
|
94
|
+
height,
|
|
95
|
+
borderRadius
|
|
96
|
+
} }));
|
|
97
|
+
};
|
|
98
|
+
// 按钮组件
|
|
99
|
+
export const Button = ({ children, onClick, variant = 'primary', size = 'md', disabled = false, className = '', icon }) => {
|
|
100
|
+
const { themeColors } = useTheme();
|
|
101
|
+
// 基础样式
|
|
102
|
+
const baseStyle = {
|
|
103
|
+
display: 'inline-flex',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
gap: '8px',
|
|
107
|
+
border: 'none',
|
|
108
|
+
borderRadius: '8px',
|
|
109
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
110
|
+
fontWeight: '500',
|
|
111
|
+
transition: 'all 0.2s',
|
|
112
|
+
opacity: disabled ? 0.5 : 1
|
|
113
|
+
};
|
|
114
|
+
// 尺寸样式
|
|
115
|
+
const sizeStyles = {
|
|
116
|
+
sm: { padding: '6px 12px', fontSize: '14px' },
|
|
117
|
+
md: { padding: '10px 20px', fontSize: '16px' },
|
|
118
|
+
lg: { padding: '14px 28px', fontSize: '18px' }
|
|
119
|
+
};
|
|
120
|
+
// 变体样式
|
|
121
|
+
const variantStyles = {
|
|
122
|
+
primary: {
|
|
123
|
+
backgroundColor: themeColors.primary,
|
|
124
|
+
color: themeColors.text
|
|
125
|
+
},
|
|
126
|
+
secondary: {
|
|
127
|
+
backgroundColor: themeColors.surface,
|
|
128
|
+
color: themeColors.text,
|
|
129
|
+
border: `1px solid ${themeColors.border}`
|
|
130
|
+
},
|
|
131
|
+
danger: {
|
|
132
|
+
backgroundColor: '#ef4444',
|
|
133
|
+
color: 'white'
|
|
134
|
+
},
|
|
135
|
+
ghost: {
|
|
136
|
+
backgroundColor: 'transparent',
|
|
137
|
+
color: themeColors.text
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const currentStyle = {
|
|
141
|
+
...baseStyle,
|
|
142
|
+
...sizeStyles[size],
|
|
143
|
+
...variantStyles[variant]
|
|
144
|
+
};
|
|
145
|
+
return (_jsxs("button", { style: currentStyle, onClick: onClick, disabled: disabled, className: className, children: [icon && _jsx("span", { className: "text-lg", children: icon }), children] }));
|
|
146
|
+
};
|
|
147
|
+
// 输入框组件
|
|
148
|
+
export const Input = ({ value, onChange, placeholder = '', type = 'text', disabled = false, icon, error }) => {
|
|
149
|
+
const { themeColors } = useTheme();
|
|
150
|
+
return (_jsxs("div", { className: "relative", children: [_jsxs("div", { className: "flex items-center px-4 py-3 rounded-lg border transition-colors", style: {
|
|
151
|
+
backgroundColor: themeColors.surface,
|
|
152
|
+
borderColor: error ? '#ef4444' : themeColors.border,
|
|
153
|
+
color: themeColors.text
|
|
154
|
+
}, children: [icon && _jsx("span", { className: "mr-3 text-lg", children: icon }), _jsx("input", { type: type, value: value, onChange: onChange, placeholder: placeholder, disabled: disabled, className: "flex-1 bg-transparent border-none outline-none", style: {
|
|
155
|
+
color: themeColors.text
|
|
156
|
+
} })] }), error && (_jsx("p", { className: "mt-2 text-sm text-red-500", children: error }))] }));
|
|
157
|
+
};
|
|
158
|
+
// 文本框组件
|
|
159
|
+
export const Textarea = ({ value, onChange, placeholder = '', rows = 4, disabled = false }) => {
|
|
160
|
+
const { themeColors } = useTheme();
|
|
161
|
+
return (_jsx("div", { className: "rounded-lg border p-4 transition-colors", style: {
|
|
162
|
+
backgroundColor: themeColors.surface,
|
|
163
|
+
borderColor: themeColors.border
|
|
164
|
+
}, children: _jsx("textarea", { value: value, onChange: onChange, placeholder: placeholder, disabled: disabled, rows: rows, className: "w-full bg-transparent border-none outline-none resize-y", style: {
|
|
165
|
+
color: themeColors.text
|
|
166
|
+
} }) }));
|
|
167
|
+
};
|
|
168
|
+
// 卡片组件
|
|
169
|
+
export const Card = ({ children, className = '', title, footer }) => {
|
|
170
|
+
const { themeColors } = useTheme();
|
|
171
|
+
return (_jsxs("div", { className: `rounded-xl border overflow-hidden ${className}`, style: {
|
|
172
|
+
backgroundColor: themeColors.surface,
|
|
173
|
+
borderColor: themeColors.border
|
|
174
|
+
}, children: [title && (_jsx("div", { className: "px-6 py-4 border-b", style: { borderColor: themeColors.border }, children: _jsx("h3", { className: "text-lg font-semibold", style: { color: themeColors.text }, children: title }) })), _jsx("div", { className: "p-6", children: children }), footer && (_jsx("div", { className: "px-6 py-4 border-t", style: { borderColor: themeColors.border }, children: footer }))] }));
|
|
175
|
+
};
|
|
176
|
+
// 标签组件
|
|
177
|
+
export const Badge = ({ children, variant = 'default', size = 'md', className = '' }) => {
|
|
178
|
+
const { themeColors } = useTheme();
|
|
179
|
+
const variantStyles = {
|
|
180
|
+
success: { backgroundColor: '#4caf50', color: 'white' },
|
|
181
|
+
warning: { backgroundColor: '#ff9800', color: 'black' },
|
|
182
|
+
error: { backgroundColor: '#f44336', color: 'white' },
|
|
183
|
+
info: { backgroundColor: '#2196f3', color: 'white' },
|
|
184
|
+
default: {
|
|
185
|
+
backgroundColor: themeColors.background,
|
|
186
|
+
color: themeColors.textSecondary
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const sizeStyles = {
|
|
190
|
+
sm: { padding: '4px 8px', fontSize: '12px' },
|
|
191
|
+
md: { padding: '6px 12px', fontSize: '14px' },
|
|
192
|
+
lg: { padding: '8px 16px', fontSize: '16px' }
|
|
193
|
+
};
|
|
194
|
+
return (_jsx("span", { className: `inline-flex items-center rounded-md ${className}`, style: {
|
|
195
|
+
...variantStyles[variant],
|
|
196
|
+
...sizeStyles[size]
|
|
197
|
+
}, children: children }));
|
|
198
|
+
};
|
|
199
|
+
// 分割线组件
|
|
200
|
+
export const Divider = ({ orientation = 'horizontal', className = '' }) => {
|
|
201
|
+
const { themeColors } = useTheme();
|
|
202
|
+
const baseStyle = {
|
|
203
|
+
borderColor: themeColors.border
|
|
204
|
+
};
|
|
205
|
+
return orientation === 'horizontal' ? (_jsx("div", { className: `w-full h-px ${className}`, style: baseStyle })) : (_jsx("div", { className: `h-full w-px ${className}`, style: baseStyle }));
|
|
206
|
+
};
|
|
207
|
+
// 模态框组件
|
|
208
|
+
export const Modal = ({ isOpen, onClose, title, children, size = 'md' }) => {
|
|
209
|
+
const { themeColors } = useTheme();
|
|
210
|
+
const sizeStyles = {
|
|
211
|
+
sm: 'max-w-md',
|
|
212
|
+
md: 'max-w-lg',
|
|
213
|
+
lg: 'max-w-2xl',
|
|
214
|
+
xl: 'max-w-4xl'
|
|
215
|
+
};
|
|
216
|
+
if (!isOpen)
|
|
217
|
+
return null;
|
|
218
|
+
return (_jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center overflow-y-auto overflow-x-hidden bg-black/50 backdrop-blur-sm p-4", onClick: onClose, children: _jsxs("div", { className: `relative w-full max-h-[90vh] overflow-y-auto rounded-xl shadow-2xl ${sizeStyles[size]}`, onClick: (e) => e.stopPropagation(), style: {
|
|
219
|
+
backgroundColor: themeColors.surface
|
|
220
|
+
}, children: [_jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b", style: { borderColor: themeColors.border }, children: [_jsx("h3", { className: "text-xl font-semibold", style: { color: themeColors.text }, children: title }), _jsx("button", { onClick: onClose, className: "rounded-lg p-1 hover:bg-gray-100 dark:hover:bg-gray-700", style: { color: themeColors.textSecondary }, children: _jsx(Icon, { name: "close", size: 20 }) })] }), _jsx("div", { className: "p-6", children: children }), _jsxs("div", { className: "flex items-center justify-end gap-3 px-6 py-4 border-t", style: { borderColor: themeColors.border }, children: [_jsx(Button, { variant: "secondary", onClick: onClose, children: "\u53D6\u6D88" }), _jsx(Button, { onClick: onClose, children: "\u786E\u5B9A" })] })] }) }));
|
|
221
|
+
};
|
|
222
|
+
//# sourceMappingURL=UIDesignSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UIDesignSystem.js","sourceRoot":"","sources":["../../src/components/UIDesignSystem.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO;AACP,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY,EAAE;QACZ,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,QAAQ;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,iCAAiC;QACrC,EAAE,EAAE,uEAAuE;QAC3E,EAAE,EAAE,yEAAyE;QAC7E,EAAE,EAAE,2EAA2E;QAC/E,KAAK,EAAE,uCAAuC;QAC9C,IAAI,EAAE,MAAM;KACb;IACD,OAAO,EAAE;QACP,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;KACd;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,MAAM;QACV,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;KACd;IACD,UAAU,EAAE;QACV,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,KAAK;KACZ;CACF,CAAC;AAEF,OAAO;AACP,MAAM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
|
+
export * from './ShortcutDisplay';
|
|
2
|
+
export * from './StateIndicator';
|
|
3
|
+
export * from './ProgressIndicator';
|
|
4
|
+
export * from './Spotlight';
|
|
5
|
+
export * from './SpotlightProvider';
|
|
6
|
+
export * from './GlobalShortcutHandler';
|
|
7
|
+
export * from './Navbar';
|
|
8
|
+
export * from './UIDesignSystem';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// 共享组件导出
|
|
2
|
+
export * from './ShortcutDisplay';
|
|
3
|
+
export * from './StateIndicator';
|
|
4
|
+
export * from './ProgressIndicator';
|
|
5
|
+
export * from './Spotlight';
|
|
6
|
+
export * from './SpotlightProvider';
|
|
7
|
+
export * from './GlobalShortcutHandler';
|
|
8
|
+
export * from './Navbar';
|
|
9
|
+
export * from './UIDesignSystem';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './ai';
|
|
2
|
+
export * from './agent';
|
|
3
|
+
export * from './theme';
|
|
4
|
+
export * from './shortcuts';
|
|
5
|
+
export * from './notifications';
|
|
6
|
+
export * from './components';
|
|
7
|
+
export * from './interactions';
|
|
8
|
+
export * from './styles';
|
|
9
|
+
export { AppShell, Omnibar, TabsBar, DragHandle, type DragHandleProps, ThemeToggle, ThemeSelector, LoadingState, ErrorState, CollapsiblePanel, useKeyboardShortcuts, formatShortcut, type ShortcutSpec, ShortcutBadge, ShortcutPanel, radius, shadow, size, motion, gradient, hoverBackground, backgroundGradient, } from './shared';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AAIzB,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,KAAK,eAAe,EACpB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,KAAK,YAAY,EACjB,aAAa,EACb,aAAa,EACb,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EACf,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// 核心模块导出
|
|
2
|
+
export * from './ai';
|
|
3
|
+
export * from './agent';
|
|
4
|
+
export * from './theme';
|
|
5
|
+
export * from './shortcuts';
|
|
6
|
+
export * from './notifications';
|
|
7
|
+
export * from './components';
|
|
8
|
+
export * from './interactions';
|
|
9
|
+
export * from './styles';
|
|
10
|
+
// shared 模块与 theme/components 存在重名成员
|
|
11
|
+
// (ThemeProvider/useTheme、EmptyState),顶层只显式导出无冲突部分
|
|
12
|
+
export { AppShell, Omnibar, TabsBar, DragHandle, ThemeToggle, ThemeSelector, LoadingState, ErrorState, CollapsiblePanel, useKeyboardShortcuts, formatShortcut, ShortcutBadge, ShortcutPanel, radius, shadow, size, motion, gradient, hoverBackground, backgroundGradient, } from './shared';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AAEzB,qCAAqC;AACrC,mDAAmD;AACnD,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EAEV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EAEd,aAAa,EACb,aAAa,EACb,MAAM,EACN,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,eAAe,EACf,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interactions/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 交互设计规范
|
|
3
|
+
* z-biz-tool 交互设计指南
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 交互原则
|
|
7
|
+
* 1. 直观 - 用户无需思考就知道如何操作
|
|
8
|
+
* 2. 反馈 - 每个操作都有明确的反馈
|
|
9
|
+
* 3. 一致 - 相似操作保持一致的行为
|
|
10
|
+
* 4. 效率 - 提供快捷键和快速操作
|
|
11
|
+
* 5. 安全 - 防止误操作,支持撤销
|
|
12
|
+
*/
|
|
13
|
+
export declare const INTERACTION_PATTERNS: {
|
|
14
|
+
keyboard: {
|
|
15
|
+
spotlight: string;
|
|
16
|
+
commandPalette: string;
|
|
17
|
+
search: string;
|
|
18
|
+
settings: string;
|
|
19
|
+
help: string;
|
|
20
|
+
};
|
|
21
|
+
feedback: {
|
|
22
|
+
success: {
|
|
23
|
+
duration: number;
|
|
24
|
+
animation: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
};
|
|
27
|
+
error: {
|
|
28
|
+
duration: number;
|
|
29
|
+
animation: string;
|
|
30
|
+
icon: string;
|
|
31
|
+
};
|
|
32
|
+
warning: {
|
|
33
|
+
duration: number;
|
|
34
|
+
animation: string;
|
|
35
|
+
icon: string;
|
|
36
|
+
};
|
|
37
|
+
info: {
|
|
38
|
+
duration: number;
|
|
39
|
+
animation: string;
|
|
40
|
+
icon: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
loading: {
|
|
44
|
+
spinner: {
|
|
45
|
+
duration: number;
|
|
46
|
+
animation: string;
|
|
47
|
+
};
|
|
48
|
+
skeleton: {
|
|
49
|
+
duration: number;
|
|
50
|
+
animation: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
empty: {
|
|
54
|
+
icon: string;
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
action: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const USER_FLOWS: {
|
|
61
|
+
quickAction: {
|
|
62
|
+
trigger: string;
|
|
63
|
+
destination: string;
|
|
64
|
+
actions: string[];
|
|
65
|
+
completion: string;
|
|
66
|
+
};
|
|
67
|
+
fileOperation: {
|
|
68
|
+
steps: string[];
|
|
69
|
+
undoable: boolean;
|
|
70
|
+
progress: boolean;
|
|
71
|
+
};
|
|
72
|
+
aiOperation: {
|
|
73
|
+
trigger: string;
|
|
74
|
+
processing: string;
|
|
75
|
+
result: string;
|
|
76
|
+
followUp: string[];
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export declare const InteractionFeedback: {
|
|
80
|
+
toast: {
|
|
81
|
+
showSuccess: (_message: string, _duration?: number) => void;
|
|
82
|
+
showError: (_message: string, _duration?: number) => void;
|
|
83
|
+
showWarning: (_message: string, _duration?: number) => void;
|
|
84
|
+
showInfo: (_message: string, _duration?: number) => void;
|
|
85
|
+
};
|
|
86
|
+
progress: {
|
|
87
|
+
show: (_message: string, _value: number) => void;
|
|
88
|
+
update: (_value: number) => void;
|
|
89
|
+
complete: () => void;
|
|
90
|
+
cancel: () => void;
|
|
91
|
+
};
|
|
92
|
+
highlight: {
|
|
93
|
+
element: (_element: HTMLElement, _color?: string) => void;
|
|
94
|
+
line: (_line: number, _color?: string) => void;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
export declare const DRAG_DROP: {
|
|
98
|
+
start: {
|
|
99
|
+
delay: number;
|
|
100
|
+
minDistance: number;
|
|
101
|
+
ghostOpacity: number;
|
|
102
|
+
};
|
|
103
|
+
during: {
|
|
104
|
+
cursor: string;
|
|
105
|
+
snap: boolean;
|
|
106
|
+
preview: boolean;
|
|
107
|
+
};
|
|
108
|
+
end: {
|
|
109
|
+
dropZoneHighlight: boolean;
|
|
110
|
+
animation: string;
|
|
111
|
+
callback: (_dropped: boolean) => void;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
export declare const CLICK: {
|
|
115
|
+
single: {
|
|
116
|
+
delay: number;
|
|
117
|
+
action: string;
|
|
118
|
+
visual: string;
|
|
119
|
+
};
|
|
120
|
+
double: {
|
|
121
|
+
delay: number;
|
|
122
|
+
action: string;
|
|
123
|
+
visual: string;
|
|
124
|
+
};
|
|
125
|
+
right: {
|
|
126
|
+
action: string;
|
|
127
|
+
position: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export declare const KEYBOARD: {
|
|
131
|
+
navigation: {
|
|
132
|
+
arrowUp: string;
|
|
133
|
+
arrowDown: string;
|
|
134
|
+
arrowLeft: string;
|
|
135
|
+
arrowRight: string;
|
|
136
|
+
pageUp: string;
|
|
137
|
+
pageDown: string;
|
|
138
|
+
};
|
|
139
|
+
actions: {
|
|
140
|
+
enter: string;
|
|
141
|
+
escape: string;
|
|
142
|
+
delete: string;
|
|
143
|
+
tab: string;
|
|
144
|
+
shiftTab: string;
|
|
145
|
+
};
|
|
146
|
+
shortcuts: {
|
|
147
|
+
cmdC: string;
|
|
148
|
+
cmdV: string;
|
|
149
|
+
cmdX: string;
|
|
150
|
+
cmdA: string;
|
|
151
|
+
cmdZ: string;
|
|
152
|
+
cmdShiftZ: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=interactionPatterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionPatterns.d.ts","sourceRoot":"","sources":["../../src/interactions/interactionPatterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAGH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDhC,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;CAuBtB,CAAC;AAGF,eAAO,MAAM,mBAAmB;;gCAGJ,MAAM,cAAc,MAAM;8BAC5B,MAAM,cAAc,MAAM;gCACxB,MAAM,cAAc,MAAM;6BAC7B,MAAM,cAAc,MAAM;;;yBAK9B,MAAM,UAAU,MAAM;yBACtB,MAAM;;;;;4BAOH,WAAW,WAAW,MAAM;sBAClC,MAAM,WAAW,MAAM;;CAExC,CAAC;AAGF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;6BAmBG,OAAO;;CAE/B,CAAC;AAGF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;CAoBjB,CAAC;AAGF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;CA6BpB,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 交互设计规范
|
|
3
|
+
* z-biz-tool 交互设计指南
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 交互原则
|
|
7
|
+
* 1. 直观 - 用户无需思考就知道如何操作
|
|
8
|
+
* 2. 反馈 - 每个操作都有明确的反馈
|
|
9
|
+
* 3. 一致 - 相似操作保持一致的行为
|
|
10
|
+
* 4. 效率 - 提供快捷键和快速操作
|
|
11
|
+
* 5. 安全 - 防止误操作,支持撤销
|
|
12
|
+
*/
|
|
13
|
+
// 交互模式
|
|
14
|
+
export const INTERACTION_PATTERNS = {
|
|
15
|
+
// 快捷键模式
|
|
16
|
+
keyboard: {
|
|
17
|
+
spotlight: 'Cmd+Shift+Space',
|
|
18
|
+
commandPalette: 'Cmd+K',
|
|
19
|
+
search: 'Cmd+F',
|
|
20
|
+
settings: 'Cmd+,',
|
|
21
|
+
help: 'F1'
|
|
22
|
+
},
|
|
23
|
+
// 操作反馈模式
|
|
24
|
+
feedback: {
|
|
25
|
+
success: {
|
|
26
|
+
duration: 3000,
|
|
27
|
+
animation: 'slide-in',
|
|
28
|
+
icon: 'check'
|
|
29
|
+
},
|
|
30
|
+
error: {
|
|
31
|
+
duration: 5000,
|
|
32
|
+
animation: 'slide-in',
|
|
33
|
+
icon: 'x'
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
duration: 4000,
|
|
37
|
+
animation: 'slide-in',
|
|
38
|
+
icon: 'warning'
|
|
39
|
+
},
|
|
40
|
+
info: {
|
|
41
|
+
duration: 3000,
|
|
42
|
+
animation: 'slide-in',
|
|
43
|
+
icon: 'info'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
// 加载状态模式
|
|
47
|
+
loading: {
|
|
48
|
+
spinner: {
|
|
49
|
+
duration: 1500,
|
|
50
|
+
animation: 'spin'
|
|
51
|
+
},
|
|
52
|
+
skeleton: {
|
|
53
|
+
duration: 1000,
|
|
54
|
+
animation: 'pulse'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
// 空状态模式
|
|
58
|
+
empty: {
|
|
59
|
+
icon: 'file',
|
|
60
|
+
title: '暂无数据',
|
|
61
|
+
description: '点击按钮添加新内容',
|
|
62
|
+
action: '添加'
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
// 用户操作流程
|
|
66
|
+
export const USER_FLOWS = {
|
|
67
|
+
// 快速操作流程
|
|
68
|
+
quickAction: {
|
|
69
|
+
trigger: '快捷键',
|
|
70
|
+
destination: 'Spotlight',
|
|
71
|
+
actions: ['搜索', '选择', '执行'],
|
|
72
|
+
completion: '自动关闭'
|
|
73
|
+
},
|
|
74
|
+
// 文件操作流程
|
|
75
|
+
fileOperation: {
|
|
76
|
+
steps: ['选择文件', '选择操作', '确认执行', '查看结果'],
|
|
77
|
+
undoable: true,
|
|
78
|
+
progress: true
|
|
79
|
+
},
|
|
80
|
+
// AI 操作流程
|
|
81
|
+
aiOperation: {
|
|
82
|
+
trigger: '输入提示词',
|
|
83
|
+
processing: 'AI 分析',
|
|
84
|
+
result: '展示结果',
|
|
85
|
+
followUp: ['继续对话', '复制内容', '保存到知识库']
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
// 交互反馈组件
|
|
89
|
+
export const InteractionFeedback = {
|
|
90
|
+
// 快速反馈
|
|
91
|
+
toast: {
|
|
92
|
+
showSuccess: (_message, _duration) => { },
|
|
93
|
+
showError: (_message, _duration) => { },
|
|
94
|
+
showWarning: (_message, _duration) => { },
|
|
95
|
+
showInfo: (_message, _duration) => { }
|
|
96
|
+
},
|
|
97
|
+
// 持久反馈
|
|
98
|
+
progress: {
|
|
99
|
+
show: (_message, _value) => { },
|
|
100
|
+
update: (_value) => { },
|
|
101
|
+
complete: () => { },
|
|
102
|
+
cancel: () => { }
|
|
103
|
+
},
|
|
104
|
+
// 视觉反馈
|
|
105
|
+
highlight: {
|
|
106
|
+
element: (_element, _color) => { },
|
|
107
|
+
line: (_line, _color) => { }
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
// 拖拽交互规范
|
|
111
|
+
export const DRAG_DROP = {
|
|
112
|
+
// 拖拽开始
|
|
113
|
+
start: {
|
|
114
|
+
delay: 0,
|
|
115
|
+
minDistance: 5,
|
|
116
|
+
ghostOpacity: 0.8
|
|
117
|
+
},
|
|
118
|
+
// 拖拽过程
|
|
119
|
+
during: {
|
|
120
|
+
cursor: 'grabbing',
|
|
121
|
+
snap: true,
|
|
122
|
+
preview: true
|
|
123
|
+
},
|
|
124
|
+
// 拖拽结束
|
|
125
|
+
end: {
|
|
126
|
+
dropZoneHighlight: true,
|
|
127
|
+
animation: 'slide',
|
|
128
|
+
callback: (_dropped) => { }
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
// 点击交互规范
|
|
132
|
+
export const CLICK = {
|
|
133
|
+
// 单击
|
|
134
|
+
single: {
|
|
135
|
+
delay: 0,
|
|
136
|
+
action: '选择/打开',
|
|
137
|
+
visual: 'highlight'
|
|
138
|
+
},
|
|
139
|
+
// 双击
|
|
140
|
+
double: {
|
|
141
|
+
delay: 300,
|
|
142
|
+
action: '编辑/打开',
|
|
143
|
+
visual: 'expand'
|
|
144
|
+
},
|
|
145
|
+
// 右键
|
|
146
|
+
right: {
|
|
147
|
+
action: '上下文菜单',
|
|
148
|
+
position: 'mouse'
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
// 键盘交互规范
|
|
152
|
+
export const KEYBOARD = {
|
|
153
|
+
// 导航
|
|
154
|
+
navigation: {
|
|
155
|
+
arrowUp: '上移',
|
|
156
|
+
arrowDown: '下移',
|
|
157
|
+
arrowLeft: '左移',
|
|
158
|
+
arrowRight: '右移',
|
|
159
|
+
pageUp: '上一页',
|
|
160
|
+
pageDown: '下一页'
|
|
161
|
+
},
|
|
162
|
+
// 操作
|
|
163
|
+
actions: {
|
|
164
|
+
enter: '执行/确认',
|
|
165
|
+
escape: '取消/关闭',
|
|
166
|
+
delete: '删除',
|
|
167
|
+
tab: '切换焦点',
|
|
168
|
+
shiftTab: '反向切换焦点'
|
|
169
|
+
},
|
|
170
|
+
// 组合键
|
|
171
|
+
shortcuts: {
|
|
172
|
+
cmdC: '复制',
|
|
173
|
+
cmdV: '粘贴',
|
|
174
|
+
cmdX: '剪切',
|
|
175
|
+
cmdA: '全选',
|
|
176
|
+
cmdZ: '撤销',
|
|
177
|
+
cmdShiftZ: '重做'
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=interactionPatterns.js.map
|