@robot-admin/layout 2.1.0 → 2.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robot-admin/layout",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Layout and settings management system for Robot Admin - v2.0 with decoupled architecture",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -62,15 +62,15 @@
62
62
  "devDependencies": {
63
63
  "@robot-admin/theme": "workspace:*",
64
64
  "@types/node": "^22.13.9",
65
- "@vitejs/plugin-vue": "^5.2.1",
65
+ "@vitejs/plugin-vue": "^6.0.5",
66
66
  "naive-ui": "^2.41.0",
67
67
  "pinia": "^3.0.1",
68
68
  "sass": "^1.83.4",
69
69
  "typescript": "~5.8.0",
70
- "vite": "^7.0.0",
71
- "vite-plugin-dts": "^4.3.0",
70
+ "vite": "^8.0.1",
71
+ "vite-plugin-dts": "^4.5.4",
72
72
  "vue": "^3.5.13",
73
73
  "vue-router": "^4.5.0",
74
- "vue-tsc": "^2.1.6"
74
+ "vue-tsc": "^3.2.6"
75
75
  }
76
76
  }
@@ -15,6 +15,32 @@
15
15
  * --primary-color : 主题色
16
16
  */
17
17
 
18
+ // ==================== 🎨 菜单样式自定义变量(可在主项目覆盖)====================
19
+ .layout-container {
20
+ // 菜单项圆角
21
+ --menu-border-radius: 10px;
22
+
23
+ // 一级菜单父项激活效果(子菜单展开状态)- 较淡
24
+ --menu-parent-gradient-start: rgba(99, 102, 241, 0.10);
25
+ --menu-parent-gradient-end: rgba(139, 92, 246, 0.06);
26
+ --menu-parent-border-color: rgba(99, 102, 241, 0.45);
27
+ --menu-parent-border-width: 2px;
28
+ --menu-parent-shadow: 0 2px 6px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(99, 102, 241, 0.06);
29
+
30
+ // 二级菜单选中效果(当前页面)- 明显更亮,层级清晰
31
+ --menu-selected-gradient-start: rgba(99, 102, 241, 0.22);
32
+ --menu-selected-gradient-end: rgba(139, 92, 246, 0.16);
33
+ --menu-selected-border-color: rgba(99, 102, 241, 0.75);
34
+ --menu-selected-border-width: 3px;
35
+ --menu-selected-shadow: 0 2px 12px rgba(99, 102, 241, 0.22), 0 4px 24px rgba(99, 102, 241, 0.15);
36
+
37
+ // 毛玻璃效果强度
38
+ --menu-parent-blur: 14px;
39
+ --menu-parent-saturate: 130%;
40
+ --menu-selected-blur: 16px;
41
+ --menu-selected-saturate: 135%;
42
+ }
43
+
18
44
  // ==================== 基础布局样式 ====================
19
45
  .layout-container {
20
46
  height: 100vh;
@@ -178,7 +204,7 @@
178
204
  background: linear-gradient(135deg,
179
205
  rgba(255, 255, 255, 0.08) 0%,
180
206
  rgba(255, 255, 255, 0.04) 100%);
181
- border-radius: 8px;
207
+ border-radius: 10px;
182
208
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
183
209
  z-index: -1;
184
210
  box-shadow:
@@ -189,7 +215,7 @@
189
215
 
190
216
  /* 菜单项内容容器 - 卡片质感 */
191
217
  .layout-container .n-menu-item-content {
192
- border-radius: 8px;
218
+ border-radius: var(--menu-border-radius, 10px);
193
219
  background: transparent;
194
220
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
195
221
  position: relative;
@@ -204,7 +230,7 @@
204
230
  bottom: 0;
205
231
  border: 1px solid rgba(255, 255, 255, 0.06);
206
232
  border-left: 2px solid transparent;
207
- border-radius: 8px;
233
+ border-radius: var(--menu-border-radius, 10px);
208
234
  pointer-events: none;
209
235
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
210
236
  }
@@ -216,7 +242,7 @@
216
242
 
217
243
  &::before {
218
244
  background: rgba(255, 255, 255, 0.1);
219
- border-radius: 8px;
245
+ border-radius: 10px;
220
246
  box-shadow:
221
247
  0 4px 16px rgba(0, 0, 0, 0.12),
222
248
  inset 0 1px 0 rgba(255, 255, 255, 0.12);
@@ -226,11 +252,11 @@
226
252
  .layout-container .n-menu-item:hover .n-menu-item-content {
227
253
  backdrop-filter: blur(12px);
228
254
  -webkit-backdrop-filter: blur(12px);
229
- border-radius: 8px;
255
+ border-radius: 10px;
230
256
 
231
257
  &::after {
232
258
  border-left-color: rgba(99, 102, 241, 0.4);
233
- border-radius: 8px;
259
+ border-radius: 10px;
234
260
  box-shadow:
235
261
  0 0 15px rgba(99, 102, 241, 0.15),
236
262
  inset 0 1px 1px rgba(255, 255, 255, 0.1);
@@ -242,30 +268,35 @@
242
268
  color: var(--n-item-icon-color-active-hover);
243
269
  }
244
270
 
245
- /* Active/选中状态 - 高级卡片激活效果 */
271
+ /* Active/选中状态 - 二级菜单选中(当前页面)- 略强玻璃质感 */
246
272
  .layout-container .n-menu-item--selected,
247
273
  .layout-container .n-menu-item-content--selected {
274
+ background: transparent !important; /* 覆盖 Naive UI 默认背景 */
275
+
248
276
  &::before {
249
- background: linear-gradient(90deg,
250
- rgba(99, 102, 241, 0.18) 0%,
251
- rgba(139, 92, 246, 0.12) 100%);
252
- border-radius: 8px;
277
+ background: linear-gradient(135deg,
278
+ var(--menu-selected-gradient-start, rgba(99, 102, 241, 0.22)) 0%,
279
+ var(--menu-selected-gradient-end, rgba(139, 92, 246, 0.16)) 100%) !important;
280
+ border-radius: var(--menu-border-radius, 10px);
253
281
  box-shadow:
254
- 0 3px 12px rgba(99, 102, 241, 0.25),
255
- inset 0 1px 0 rgba(99, 102, 241, 0.2);
282
+ var(--menu-selected-shadow, 0 2px 12px rgba(99, 102, 241, 0.22), 0 4px 24px rgba(99, 102, 241, 0.15)),
283
+ inset 0 1px 2px rgba(99, 102, 241, 0.12),
284
+ inset 0 0 0 1px rgba(255, 255, 255, 0.08);
256
285
  }
257
286
  }
258
287
 
259
288
  .layout-container .n-menu-item--selected .n-menu-item-content,
260
289
  .layout-container .n-menu-item-content--selected {
261
- backdrop-filter: blur(14px) saturate(130%);
262
- -webkit-backdrop-filter: blur(14px) saturate(130%);
290
+ background: transparent !important; /* 覆盖 Naive UI 默认背景 */
291
+ backdrop-filter: blur(var(--menu-selected-blur, 16px)) saturate(var(--menu-selected-saturate, 135%));
292
+ -webkit-backdrop-filter: blur(var(--menu-selected-blur, 16px)) saturate(var(--menu-selected-saturate, 135%));
263
293
 
264
294
  &::after {
265
- border-left: 3px solid rgba(99, 102, 241, 0.8);
295
+ border-left: var(--menu-selected-border-width, 3px) solid var(--menu-selected-border-color, rgba(99, 102, 241, 0.75));
296
+ border-radius: var(--menu-border-radius, 10px);
266
297
  box-shadow:
267
- 0 0 20px rgba(99, 102, 241, 0.25),
268
- inset 0 1px 1px rgba(255, 255, 255, 0.15);
298
+ 0 0 14px rgba(99, 102, 241, 0.25),
299
+ inset 0 1px 2px rgba(255, 255, 255, 0.12);
269
300
  }
270
301
  }
271
302
 
@@ -280,21 +311,28 @@
280
311
  transform: scale(0.98);
281
312
  }
282
313
 
283
- /* 子菜单父项样式 */
314
+ /* 子菜单父项样式 - 一级菜单展开状态(较淡玻璃质感)*/
284
315
  .layout-container .n-menu-item-content--child-active {
316
+ background: transparent !important; /* 覆盖 Naive UI 默认背景 */
317
+
285
318
  &::before {
286
- background: rgba(99, 102, 241, 0.1);
319
+ background: linear-gradient(135deg,
320
+ var(--menu-parent-gradient-start, rgba(99, 102, 241, 0.10)) 0%,
321
+ var(--menu-parent-gradient-end, rgba(139, 92, 246, 0.06)) 100%) !important;
322
+ border-radius: var(--menu-border-radius, 10px);
287
323
  box-shadow:
288
- 0 2px 12px rgba(99, 102, 241, 0.12),
289
- inset 0 1px 0 rgba(255, 255, 255, 0.08);
324
+ var(--menu-parent-shadow, 0 2px 6px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(99, 102, 241, 0.06)),
325
+ inset 0 1px 2px rgba(99, 102, 241, 0.06),
326
+ inset 0 0 0 1px rgba(255, 255, 255, 0.05);
290
327
  }
291
328
 
292
329
  &::after {
293
- border-left: 2px solid rgba(99, 102, 241, 0.5);
330
+ border-left: var(--menu-parent-border-width, 2px) solid var(--menu-parent-border-color, rgba(99, 102, 241, 0.45));
331
+ border-radius: var(--menu-border-radius, 10px);
294
332
  }
295
333
 
296
- backdrop-filter: blur(10px);
297
- -webkit-backdrop-filter: blur(10px);
334
+ backdrop-filter: blur(var(--menu-parent-blur, 14px)) saturate(var(--menu-parent-saturate, 130%));
335
+ -webkit-backdrop-filter: blur(var(--menu-parent-blur, 14px)) saturate(var(--menu-parent-saturate, 130%));
298
336
  }
299
337
 
300
338
  /* 一级菜单项对齐 */
@@ -401,23 +439,29 @@
401
439
  color: var(--n-item-color-active) !important;
402
440
  }
403
441
 
404
- /* 折叠菜单选中状态 - 毛玻璃效果 */
442
+ /* 折叠菜单选中状态 - 使用二级选中效果变量 */
405
443
  .layout-container .n-menu.n-menu--collapsed .n-menu-item-content--child-active {
444
+ background: transparent !important; /* 覆盖 Naive UI 默认背景 */
445
+
406
446
  &::before {
407
447
  background: linear-gradient(135deg,
408
- rgba(99, 102, 241, 0.25) 0%,
409
- rgba(139, 92, 246, 0.2) 100%);
410
- border-radius: 10px;
448
+ var(--menu-selected-gradient-start, rgba(99, 102, 241, 0.22)) 0%,
449
+ var(--menu-selected-gradient-end, rgba(139, 92, 246, 0.16)) 100%) !important;
450
+ border-radius: var(--menu-border-radius, 10px);
411
451
  box-shadow:
412
- 0 8px 24px rgba(99, 102, 241, 0.3),
413
- inset 0 1px 1px rgba(255, 255, 255, 0.2);
452
+ var(--menu-selected-shadow, 0 2px 12px rgba(99, 102, 241, 0.22), 0 4px 24px rgba(99, 102, 241, 0.15)),
453
+ inset 0 1px 2px rgba(99, 102, 241, 0.12),
454
+ inset 0 0 0 1px rgba(255, 255, 255, 0.08);
414
455
  }
415
456
 
416
- backdrop-filter: blur(16px) saturate(150%);
417
- -webkit-backdrop-filter: blur(16px) saturate(150%);
457
+ backdrop-filter: blur(var(--menu-selected-blur, 16px)) saturate(var(--menu-selected-saturate, 135%));
458
+ -webkit-backdrop-filter: blur(var(--menu-selected-blur, 16px)) saturate(var(--menu-selected-saturate, 135%));
418
459
 
419
460
  &::after {
420
- box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
461
+ border-radius: var(--menu-border-radius, 10px);
462
+ box-shadow:
463
+ 0 0 14px rgba(99, 102, 241, 0.25),
464
+ 0 0 20px rgba(99, 102, 241, 0.15);
421
465
  }
422
466
  }
423
467
 
@@ -154,7 +154,8 @@
154
154
 
155
155
  // 圆角/动画选择
156
156
  .radius-group,
157
- .transition-group {
157
+ .transition-group,
158
+ .menu-expand-group {
158
159
  width: 100%;
159
160
 
160
161
  :deep(.n-radio-button) {
@@ -269,11 +270,10 @@
269
270
  height: 48px;
270
271
  color: #999; // 默认:灰色
271
272
  transition: all 0.3s ease;
273
+ }
272
274
 
273
- // SVG rect 强制继承 color
274
- :deep(rect) {
275
- fill: currentColor !important;
276
- }
275
+ :deep(.layout-svg rect) {
276
+ fill: currentColor !important;
277
277
  }
278
278
  .layout-label {
279
279
  font-size: 13px;