@agentscope-ai/design 1.0.11 → 1.0.12
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 +241 -71
- package/lib/antd/styles/select.style.js +7 -1
- package/lib/antd/themes/bailianDarkTheme.json +7 -0
- package/lib/antd/themes/bailianTheme.json +7 -0
- package/lib/antd/themes/carbonDarkTheme.json +7 -0
- package/lib/antd/themes/carbonTheme.json +3 -0
- package/lib/antd/themes/generateTheme.d.ts +132 -0
- package/lib/antd/themes/generateTheme.js +328 -0
- package/lib/components/commonComponents/AlertDialog/index.d.ts +325 -37
- package/lib/components/commonComponents/AlertDialog/index.js +3 -153
- package/lib/components/commonComponents/AlertDialog/index.style.js +14 -2
- package/lib/components/commonComponents/AlertDialog/mobile.d.ts +38 -0
- package/lib/components/commonComponents/AlertDialog/mobile.js +188 -0
- package/lib/components/commonComponents/AlertDialog/pc.d.ts +38 -0
- package/lib/components/commonComponents/AlertDialog/pc.js +152 -0
- package/lib/components/commonComponents/Anchor/index.js +1 -1
- package/lib/components/commonComponents/Button/index.js +5 -3
- package/lib/components/commonComponents/CodeBlock/index.js +1 -2
- package/lib/components/commonComponents/CollapsePanel/index.js +1 -2
- package/lib/components/commonComponents/Drawer/index.style.js +42 -2
- package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.d.ts +3 -0
- package/lib/components/commonComponents/EllipsisTip/demo/demo2-1.js +21 -0
- package/lib/components/commonComponents/InputNumber/demo/demo1.js +0 -3
- package/lib/components/commonComponents/Modal/index.d.ts +2 -16
- package/lib/components/commonComponents/Modal/index.js +3 -71
- package/lib/components/commonComponents/Modal/index.style.js +62 -2
- package/lib/components/commonComponents/Modal/mobile.d.ts +28 -0
- package/lib/components/commonComponents/Modal/mobile.js +97 -0
- package/lib/components/commonComponents/Modal/pc.d.ts +28 -0
- package/lib/components/commonComponents/Modal/pc.js +72 -0
- package/lib/components/commonComponents/Pagination/index.js +4 -2
- package/lib/components/commonComponents/Pagination/index.style.js +11 -3
- package/lib/components/commonComponents/PromptsEditor/VarRender.js +6 -1
- package/lib/components/commonComponents/PromptsEditor/VarSelectInput.js +3 -2
- package/lib/components/commonComponents/PromptsEditor/demo/basic.js +2 -0
- package/lib/components/commonComponents/PromptsEditor/index.js +1 -1
- package/lib/components/commonComponents/RadioButton/index.js +1 -5
- package/lib/components/commonComponents/Table/demo/demo1.js +13 -23
- package/lib/components/commonComponents/Table/index.js +3 -1
- package/lib/components/commonComponents/Table/index.style.js +1 -3
- package/lib/components/commonComponents/Tag/index.d.ts +10 -1
- package/lib/components/commonComponents/Tag/index.js +13 -1
- package/lib/components/commonComponents/Tooltip/index.js +1 -2
- package/lib/config.d.ts +2 -0
- package/lib/i18n/index.js +3 -0
- package/lib/i18n/strings/index.d.ts +2 -0
- package/lib/index.d.ts +2 -4
- package/lib/index.js +2 -4
- package/lib/libs/env/index.d.ts +1 -1
- package/lib/libs/staticRenderer/index.js +12 -3
- package/lib/libs/utils/index.d.ts +1 -0
- package/lib/libs/utils/index.js +4 -0
- package/lib/typings.d.ts +2 -0
- package/package.json +19 -60
- package/lib/antd/styles/_readme.txt +0 -1
- package/lib/antd/themes/_readme.txt +0 -1
- package/lib/libs/generateCssVars/index.d.ts +0 -19
- package/lib/libs/generateCssVars/index.js +0 -39
- package/lib/libs/region/constant.d.ts +0 -6
- package/lib/libs/region/constant.js +0 -154
- package/lib/libs/region/index.d.ts +0 -2
- package/lib/libs/region/index.js +0 -18
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 主题生成器 - Theme Generator
|
|
3
|
+
|
|
4
|
+
* 核心功能:
|
|
5
|
+
* 1. 颜色空间转换(HEX/RGB/HSL)
|
|
6
|
+
* 2. 颜色调整和生成
|
|
7
|
+
* 3. 完整主题配置生成(支持浅色/暗色模式)
|
|
8
|
+
*
|
|
9
|
+
* 设计原则(参考 Radix Colors):
|
|
10
|
+
* - 浅色模式:背景 95-99% 亮度,边框 80-90% 亮度,文本 15-25% 亮度
|
|
11
|
+
* - 暗色模式:背景 0-10% 亮度,边框使用透明度,文本 85-95% 亮度
|
|
12
|
+
* - 状态色和装饰色在暗色模式下使用预设优化值
|
|
13
|
+
*
|
|
14
|
+
* 生成规则:
|
|
15
|
+
* - 主色 (Primary):从输入的主色生成,暗色模式自动调整亮度
|
|
16
|
+
* - 背景色系:基于 bgBase 生成,保持色相统一
|
|
17
|
+
* - 文本色系:基于 textBase 生成,保持色相统一
|
|
18
|
+
* - 边框色系:基于 bgBase 生成,饱和度提高以增强可见度
|
|
19
|
+
* - 填充色系:暗色模式基于文本色+透明度,浅色模式基于背景色
|
|
20
|
+
* - 状态色/装饰色/阴影:暗色模式使用预设优化值,浅色模式使用配置文件
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import themeDataDark from "./bailianDarkTheme.json";
|
|
24
|
+
import themeData from "./bailianTheme.json";
|
|
25
|
+
|
|
26
|
+
// ==================== 颜色转换工具函数 ====================
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* HEX 转 RGB
|
|
30
|
+
*/
|
|
31
|
+
var hexToRgb = function hexToRgb(hex) {
|
|
32
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
33
|
+
return result ? {
|
|
34
|
+
r: parseInt(result[1], 16),
|
|
35
|
+
g: parseInt(result[2], 16),
|
|
36
|
+
b: parseInt(result[3], 16)
|
|
37
|
+
} : null;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* RGB 转 HEX
|
|
42
|
+
*/
|
|
43
|
+
var rgbToHex = function rgbToHex(r, g, b) {
|
|
44
|
+
return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* RGB 转 HSL
|
|
49
|
+
*/
|
|
50
|
+
var rgbToHsl = function rgbToHsl(r, g, b) {
|
|
51
|
+
r /= 255;
|
|
52
|
+
g /= 255;
|
|
53
|
+
b /= 255;
|
|
54
|
+
var max = Math.max(r, g, b),
|
|
55
|
+
min = Math.min(r, g, b);
|
|
56
|
+
var h,
|
|
57
|
+
s,
|
|
58
|
+
l = (max + min) / 2;
|
|
59
|
+
if (max === min) {
|
|
60
|
+
h = s = 0;
|
|
61
|
+
} else {
|
|
62
|
+
var d = max - min;
|
|
63
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
64
|
+
switch (max) {
|
|
65
|
+
case r:
|
|
66
|
+
h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
|
|
67
|
+
break;
|
|
68
|
+
case g:
|
|
69
|
+
h = ((b - r) / d + 2) / 6;
|
|
70
|
+
break;
|
|
71
|
+
case b:
|
|
72
|
+
h = ((r - g) / d + 4) / 6;
|
|
73
|
+
break;
|
|
74
|
+
default:
|
|
75
|
+
h = 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
h: h * 360,
|
|
80
|
+
s: s * 100,
|
|
81
|
+
l: l * 100
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* HSL 转 RGB
|
|
87
|
+
*/
|
|
88
|
+
var hslToRgb = function hslToRgb(h, s, l) {
|
|
89
|
+
h /= 360;
|
|
90
|
+
s /= 100;
|
|
91
|
+
l /= 100;
|
|
92
|
+
var r, g, b;
|
|
93
|
+
if (s === 0) {
|
|
94
|
+
r = g = b = l;
|
|
95
|
+
} else {
|
|
96
|
+
var hue2rgb = function hue2rgb(p, q, t) {
|
|
97
|
+
if (t < 0) t += 1;
|
|
98
|
+
if (t > 1) t -= 1;
|
|
99
|
+
if (t < 1 / 6) return p + (q - p) * 6 * t;
|
|
100
|
+
if (t < 1 / 2) return q;
|
|
101
|
+
if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
|
|
102
|
+
return p;
|
|
103
|
+
};
|
|
104
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
105
|
+
var p = 2 * l - q;
|
|
106
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
107
|
+
g = hue2rgb(p, q, h);
|
|
108
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
r: Math.round(r * 255),
|
|
112
|
+
g: Math.round(g * 255),
|
|
113
|
+
b: Math.round(b * 255)
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// ==================== 颜色调整函数 ====================
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 调整颜色的亮度和饱和度(相对调整)
|
|
121
|
+
*/
|
|
122
|
+
var adjustColor = function adjustColor(hex, lightness) {
|
|
123
|
+
var saturation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
124
|
+
var rgb = hexToRgb(hex);
|
|
125
|
+
if (!rgb) return hex;
|
|
126
|
+
var hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
127
|
+
hsl.l = Math.max(0, Math.min(100, hsl.l + lightness));
|
|
128
|
+
hsl.s = Math.max(0, Math.min(100, hsl.s + saturation));
|
|
129
|
+
var newRgb = hslToRgb(hsl.h, hsl.s, hsl.l);
|
|
130
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 生成指定亮度的颜色(绝对值)
|
|
135
|
+
*/
|
|
136
|
+
var generateColorWithLightness = function generateColorWithLightness(hex, targetLightness) {
|
|
137
|
+
var targetSaturation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
138
|
+
var rgb = hexToRgb(hex);
|
|
139
|
+
if (!rgb) return hex;
|
|
140
|
+
var hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
141
|
+
hsl.l = targetLightness;
|
|
142
|
+
if (targetSaturation !== null) {
|
|
143
|
+
hsl.s = targetSaturation;
|
|
144
|
+
}
|
|
145
|
+
var newRgb = hslToRgb(hsl.h, hsl.s, hsl.l);
|
|
146
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* 基于基础色生成色阶(保持色相,调整亮度和饱和度)
|
|
151
|
+
*/
|
|
152
|
+
var generateColorScale = function generateColorScale(baseHex, lightness) {
|
|
153
|
+
var saturationMultiplier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
154
|
+
var rgb = hexToRgb(baseHex);
|
|
155
|
+
if (!rgb) return baseHex;
|
|
156
|
+
var hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
157
|
+
hsl.l = lightness;
|
|
158
|
+
hsl.s = Math.max(0, Math.min(100, hsl.s * saturationMultiplier));
|
|
159
|
+
var newRgb = hslToRgb(hsl.h, hsl.s, hsl.l);
|
|
160
|
+
return rgbToHex(newRgb.r, newRgb.g, newRgb.b);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
// ==================== 主题生成函数 ====================
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* 生成完整主题
|
|
167
|
+
* @param {string} primaryHex - 主色调
|
|
168
|
+
* @param {string} bgBaseHex - 背景基础色
|
|
169
|
+
* @param {string} textBaseHex - 文本基础色
|
|
170
|
+
* @param {boolean} darkMode - 是否为暗色模式
|
|
171
|
+
* @returns {Object} 完整的主题配置对象
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
var generateTheme = function generateTheme(_ref) {
|
|
175
|
+
var primaryHex = _ref.primaryHex,
|
|
176
|
+
bgBaseHex = _ref.bgBaseHex,
|
|
177
|
+
textBaseHex = _ref.textBaseHex,
|
|
178
|
+
_ref$darkMode = _ref.darkMode,
|
|
179
|
+
darkMode = _ref$darkMode === void 0 ? false : _ref$darkMode;
|
|
180
|
+
bgBaseHex = bgBaseHex || (darkMode ? '#000000' : '#ffffff');
|
|
181
|
+
textBaseHex = textBaseHex || (darkMode ? '#E7E7ED' : '#1a1a1a');
|
|
182
|
+
var rgb = hexToRgb(primaryHex);
|
|
183
|
+
if (!rgb) return null;
|
|
184
|
+
var hsl = rgbToHsl(rgb.r, rgb.g, rgb.b);
|
|
185
|
+
|
|
186
|
+
// 获取背景色和文本色的 RGB 和 HSL
|
|
187
|
+
var bgBaseRgb = hexToRgb(bgBaseHex);
|
|
188
|
+
var textBaseRgb = hexToRgb(textBaseHex);
|
|
189
|
+
var bgBaseHsl = bgBaseRgb ? rgbToHsl(bgBaseRgb.r, bgBaseRgb.g, bgBaseRgb.b) : {
|
|
190
|
+
h: 210,
|
|
191
|
+
s: 8,
|
|
192
|
+
l: darkMode ? 5 : 99
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// 参考 Radix Colors 的色阶系统
|
|
196
|
+
// 浅色模式:
|
|
197
|
+
// Scale 1-3: 背景色 (95-99% 亮度)
|
|
198
|
+
// Scale 6-8: 边框色、填充色 (80-90% 亮度)
|
|
199
|
+
// Scale 11-12: 文本色 (15-25% 亮度)
|
|
200
|
+
// 暗色模式:
|
|
201
|
+
// Scale 1-3: 背景色 (0-10% 亮度)
|
|
202
|
+
// Scale 6-8: 边框色、填充色 (带透明度)
|
|
203
|
+
// Scale 11-12: 文本色 (85-95% 亮度)
|
|
204
|
+
|
|
205
|
+
var baseSaturation = Math.max(8, Math.min(hsl.s, 40)); // 主色背景(如 primaryBg)使用低饱和度
|
|
206
|
+
var borderSaturation = Math.max(12, Math.min(hsl.s * 0.6, 35)); // 主色边框(如 primaryBorder)使用的饱和度
|
|
207
|
+
|
|
208
|
+
// 生成主色相关的颜色
|
|
209
|
+
var theme = {
|
|
210
|
+
// 保留边框圆角配置
|
|
211
|
+
borderRadiusXS: themeData.borderRadiusXS,
|
|
212
|
+
borderRadiusSM: themeData.borderRadiusSM,
|
|
213
|
+
borderRadius: themeData.borderRadius,
|
|
214
|
+
borderRadiusLG: themeData.borderRadiusLG,
|
|
215
|
+
borderRadiusXL: themeData.borderRadiusXL,
|
|
216
|
+
borderRadiusFull: themeData.borderRadiusFull,
|
|
217
|
+
wireframe: themeData.wireframe,
|
|
218
|
+
// 主色系 - 暗色模式下生成适配的主色
|
|
219
|
+
colorPrimary: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
|
|
220
|
+
colorPrimaryHover: darkMode ? generateColorWithLightness(primaryHex, Math.min(hsl.l + 10, 55), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? 10 : -10, 0),
|
|
221
|
+
colorPrimaryActive: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 10, 35), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? -10 : -20, 0),
|
|
222
|
+
colorPrimaryBg: darkMode ? generateColorWithLightness(primaryHex, 13, baseSaturation * 0.6) // 暗色模式:深色背景
|
|
223
|
+
: generateColorWithLightness(primaryHex, 96, baseSaturation * 0.8),
|
|
224
|
+
// 浅色模式:浅色背景
|
|
225
|
+
colorPrimaryBgHover: darkMode ? generateColorWithLightness(primaryHex, 13, baseSaturation * 0.6) : generateColorWithLightness(primaryHex, 94, baseSaturation),
|
|
226
|
+
colorPrimaryBorder: darkMode ? generateColorWithLightness(primaryHex, 17, borderSaturation * 0.8) : generateColorWithLightness(primaryHex, 88, borderSaturation * 0.8),
|
|
227
|
+
colorPrimaryBorderHover: darkMode ? generateColorWithLightness(primaryHex, 22, borderSaturation) : generateColorWithLightness(primaryHex, 82, borderSaturation),
|
|
228
|
+
colorPrimaryText: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
|
|
229
|
+
colorPrimaryTextHover: darkMode ? generateColorWithLightness(primaryHex, Math.min(hsl.l + 10, 55), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? 10 : -10, 0),
|
|
230
|
+
colorPrimaryTextActive: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 10, 35), hsl.s * 0.95) : adjustColor(primaryHex, hsl.l < 50 ? -10 : -20, 0),
|
|
231
|
+
// 文本颜色 - 基于 textBase 的色相生成(Scale 11-12)
|
|
232
|
+
colorTextBase: textBaseHex,
|
|
233
|
+
colorText: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.88)"),
|
|
234
|
+
colorTextSecondary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.65)"),
|
|
235
|
+
colorTextTertiary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.45)"),
|
|
236
|
+
colorTextQuaternary: "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.25)"),
|
|
237
|
+
colorTextWhite: '#fff',
|
|
238
|
+
// 背景颜色 - 基于 bgBase 的色相生成 (Scale 1-3)
|
|
239
|
+
colorBgBase: bgBaseHex,
|
|
240
|
+
colorBgContainer: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:稍微亮一点 (5-8%)
|
|
241
|
+
: generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 1, 99), 0.8),
|
|
242
|
+
// 浅色:稍微深一点
|
|
243
|
+
colorBgElevated: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:与 container 相同
|
|
244
|
+
: bgBaseHex,
|
|
245
|
+
// 浅色:使用 bgBase 本身
|
|
246
|
+
colorBgLayout: darkMode ? generateColorScale(bgBaseHex, Math.min(bgBaseHsl.l + 3, 8), 1.2) // 暗色:与 container 相同
|
|
247
|
+
: generateColorScale(bgBaseHex, Math.max(bgBaseHsl.l - 2, 96), 1.2),
|
|
248
|
+
// 浅色:稍微深一点
|
|
249
|
+
colorBgSpotlight: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 1.2)).b, ", 0.85)") : "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.85)"),
|
|
250
|
+
colorBgMask: darkMode ? "rgba(".concat(bgBaseRgb.r, ", ").concat(bgBaseRgb.g, ", ").concat(bgBaseRgb.b, ", 0.8)") : "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.45)"),
|
|
251
|
+
// 边框和填充 - 暗色模式使用透明度,浅色模式使用实色
|
|
252
|
+
colorBorder: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 28, 2)).b, ", 0.8)") // 暗色:中等亮度 + 透明度
|
|
253
|
+
: generateColorScale(bgBaseHex, 81, 2.5),
|
|
254
|
+
// 浅色:实色边框
|
|
255
|
+
colorBorderSecondary: darkMode ? "rgba(".concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).r, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).g, ", ").concat(hexToRgb(generateColorScale(bgBaseHex, 22, 1.8)).b, ", 0.8)") : generateColorScale(bgBaseHex, 88, 2),
|
|
256
|
+
colorFill: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.18)") // 暗色:基于文本色的透明填充
|
|
257
|
+
: generateColorScale(bgBaseHex, 81, 2.5) + '5c',
|
|
258
|
+
colorFillSecondary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.12)") : generateColorScale(bgBaseHex, 81, 2.5) + '33',
|
|
259
|
+
colorFillTertiary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.08)") : generateColorScale(bgBaseHex, 81, 2.5) + '26',
|
|
260
|
+
colorFillQuaternary: darkMode ? "rgba(".concat(textBaseRgb.r, ", ").concat(textBaseRgb.g, ", ").concat(textBaseRgb.b, ", 0.04)") : generateColorScale(bgBaseHex, 81, 2.5) + '1a',
|
|
261
|
+
colorFillDisable: darkMode ? generateColorScale(textBaseHex, 55, 0.8) // 暗色:中等亮度的灰色
|
|
262
|
+
: generateColorScale(bgBaseHex, 86, 1.8),
|
|
263
|
+
// 链接色 - 暗色模式下生成适配的颜色
|
|
264
|
+
colorLink: darkMode ? generateColorWithLightness(primaryHex, Math.max(hsl.l - 5, 42), hsl.s * 0.95) : primaryHex,
|
|
265
|
+
// 状态色 - 暗色模式下使用预设值
|
|
266
|
+
colorInfo: darkMode ? themeDataDark.colorInfo : themeData.colorInfo,
|
|
267
|
+
colorInfoHover: darkMode ? themeDataDark.colorInfoHover : themeData.colorInfoHover,
|
|
268
|
+
colorInfoText: darkMode ? themeDataDark.colorInfoText : themeData.colorInfoText,
|
|
269
|
+
colorInfoBg: darkMode ? themeDataDark.colorInfoBg : themeData.colorInfoBg,
|
|
270
|
+
colorInfoBgHover: darkMode ? themeDataDark.colorInfoBgHover : themeData.colorInfoBgHover,
|
|
271
|
+
colorInfoBorder: darkMode ? themeDataDark.colorInfoBorder : themeData.colorInfoBorder,
|
|
272
|
+
colorInfoBorderHover: darkMode ? themeDataDark.colorInfoBorderHover : themeData.colorInfoBorderHover,
|
|
273
|
+
colorSuccess: darkMode ? themeDataDark.colorSuccess : themeData.colorSuccess,
|
|
274
|
+
colorSuccessHover: darkMode ? themeDataDark.colorSuccessHover : themeData.colorSuccessHover,
|
|
275
|
+
colorSuccessBg: darkMode ? themeDataDark.colorSuccessBg : themeData.colorSuccessBg,
|
|
276
|
+
colorSuccessBgHover: darkMode ? themeDataDark.colorSuccessBgHover : themeData.colorSuccessBgHover,
|
|
277
|
+
colorSuccessBorder: darkMode ? themeDataDark.colorSuccessBorder : themeData.colorSuccessBorder,
|
|
278
|
+
colorSuccessBorderHover: darkMode ? themeDataDark.colorSuccessBorderHover : themeData.colorSuccessBorderHover,
|
|
279
|
+
colorWarning: darkMode ? themeDataDark.colorWarning : themeData.colorWarning,
|
|
280
|
+
colorWarningHover: darkMode ? themeDataDark.colorWarningHover : themeData.colorWarningHover,
|
|
281
|
+
colorWarningBg: darkMode ? themeDataDark.colorWarningBg : themeData.colorWarningBg,
|
|
282
|
+
colorWarningBgHover: darkMode ? themeDataDark.colorWarningBgHover : themeData.colorWarningBgHover,
|
|
283
|
+
colorWarningBorder: darkMode ? themeDataDark.colorWarningBorder : themeData.colorWarningBorder,
|
|
284
|
+
colorWarningBorderHover: darkMode ? themeDataDark.colorWarningBorderHover : themeData.colorWarningBorderHover,
|
|
285
|
+
colorError: darkMode ? themeDataDark.colorError : themeData.colorError,
|
|
286
|
+
colorErrorHover: darkMode ? themeDataDark.colorErrorHover : themeData.colorErrorHover,
|
|
287
|
+
colorErrorBg: darkMode ? themeDataDark.colorErrorBg : themeData.colorErrorBg,
|
|
288
|
+
colorErrorBgHover: darkMode ? themeDataDark.colorErrorBgHover : themeData.colorErrorBgHover,
|
|
289
|
+
colorErrorBorder: darkMode ? themeDataDark.colorErrorBorder : themeData.colorErrorBorder,
|
|
290
|
+
colorErrorBorderHover: darkMode ? themeDataDark.colorErrorBorderHover : themeData.colorErrorBorderHover,
|
|
291
|
+
// 装饰色 - 暗色模式下使用预设值
|
|
292
|
+
colorPurple: darkMode ? themeDataDark.colorPurple : themeData.colorPurple,
|
|
293
|
+
colorPurpleHover: darkMode ? themeDataDark.colorPurpleHover : themeData.colorPurpleHover,
|
|
294
|
+
colorPurpleBg: darkMode ? themeDataDark.colorPurpleBg : themeData.colorPurpleBg,
|
|
295
|
+
colorPink: darkMode ? themeDataDark.colorPink : themeData.colorPink,
|
|
296
|
+
colorPinkHover: darkMode ? themeDataDark.colorPinkHover : themeData.colorPinkHover,
|
|
297
|
+
colorPinkBg: darkMode ? themeDataDark.colorPinkBg : themeData.colorPinkBg,
|
|
298
|
+
colorYellow: darkMode ? themeDataDark.colorYellow : themeData.colorYellow,
|
|
299
|
+
colorYellowHover: darkMode ? themeDataDark.colorYellowHover : themeData.colorYellowHover,
|
|
300
|
+
colorYellowBg: darkMode ? themeDataDark.colorYellowBg : themeData.colorYellowBg,
|
|
301
|
+
colorOrange: darkMode ? themeDataDark.colorOrange : themeData.colorOrange,
|
|
302
|
+
colorOrangeHover: darkMode ? themeDataDark.colorOrangeHover : themeData.colorOrangeHover,
|
|
303
|
+
colorOrangeBg: darkMode ? themeDataDark.colorOrangeBg : themeData.colorOrangeBg,
|
|
304
|
+
colorTeal: darkMode ? themeDataDark.colorTeal : themeData.colorTeal,
|
|
305
|
+
colorTealHover: darkMode ? themeDataDark.colorTealHover : themeData.colorTealHover,
|
|
306
|
+
colorTealBg: darkMode ? themeDataDark.colorTealBg : themeData.colorTealBg,
|
|
307
|
+
colorBlue: darkMode ? themeDataDark.colorBlue : themeData.colorBlue,
|
|
308
|
+
colorBlueHover: darkMode ? themeDataDark.colorBlueHover : themeData.colorBlueHover,
|
|
309
|
+
colorBlueBg: darkMode ? themeDataDark.colorBlueBg : themeData.colorBlueBg,
|
|
310
|
+
colorMauve: darkMode ? themeDataDark.colorMauve : themeData.colorMauve,
|
|
311
|
+
colorMauveHover: darkMode ? themeDataDark.colorMauveHover : themeData.colorMauveHover,
|
|
312
|
+
colorMauveBg: darkMode ? themeDataDark.colorMauveBg : themeData.colorMauveBg,
|
|
313
|
+
colorSlate: darkMode ? themeDataDark.colorSlate : themeData.colorSlate || '#1E293B',
|
|
314
|
+
colorSlateHover: darkMode ? themeDataDark.colorSlateHover : themeData.colorSlateHover || '#475569',
|
|
315
|
+
colorSlateBg: darkMode ? themeDataDark.colorSlateBg : themeData.colorSlateBg || '#E2E8F0',
|
|
316
|
+
colorLavender: darkMode ? themeDataDark.colorLavender : themeData.colorLavender || '#A77BFF',
|
|
317
|
+
colorLavenderHover: darkMode ? themeDataDark.colorLavenderHover : themeData.colorLavenderHover || '#BB99FF',
|
|
318
|
+
colorLavenderBg: darkMode ? themeDataDark.colorLavenderBg : themeData.colorLavenderBg || 'rgba(226, 212, 255, 0.8)',
|
|
319
|
+
// 阴影 - 暗色模式使用预设值
|
|
320
|
+
boxShadow: darkMode ? themeDataDark.boxShadow : themeData.boxShadow,
|
|
321
|
+
boxShadowSecondary: darkMode ? themeDataDark.boxShadowSecondary : themeData.boxShadowSecondary,
|
|
322
|
+
boxShadowTertiary: darkMode ? themeDataDark.boxShadowTertiary : themeData.boxShadowTertiary,
|
|
323
|
+
boxShadowTertiaryLeft: darkMode ? themeDataDark.boxShadowTertiaryLeft : themeData.boxShadowTertiaryLeft,
|
|
324
|
+
boxShadowInput: darkMode ? themeDataDark.boxShadowInput : themeData.boxShadowInput
|
|
325
|
+
};
|
|
326
|
+
return theme;
|
|
327
|
+
};
|
|
328
|
+
export default generateTheme;
|