@ysgroup/ui 0.1.44 → 0.1.45

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": "@ysgroup/ui",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -11,7 +11,7 @@
11
11
  "pdfjs-dist": "6.5.438"
12
12
  },
13
13
  "peerDependencies": {
14
- "@ysgroup/theme": ">=0.2.6",
14
+ "@ysgroup/theme": ">=0.3.0",
15
15
  "element-plus": ">=2.9",
16
16
  "vue": ">=3.5"
17
17
  },
@@ -25,6 +25,6 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "docx-preview": "^0.4.1",
28
- "@ysgroup/theme": "^0.2.6"
28
+ "@ysgroup/theme": "^0.3.0"
29
29
  }
30
30
  }
@@ -22,9 +22,9 @@ defineProps<{
22
22
  vertical-align: middle;
23
23
  }
24
24
  .ys-bool-mark.is-yes {
25
- color: #5bb07a;
25
+ color: var(--ys-color-success);
26
26
  }
27
27
  .ys-bool-mark.is-no {
28
- color: #e6e9f0;
28
+ color: color-mix(in srgb, var(--ys-color-text-3) 35%, var(--ys-color-bg-elevated));
29
29
  }
30
30
  </style>
@@ -251,7 +251,7 @@ function toggleSidebar() {
251
251
  }
252
252
  .ys-layout__menu.is-active {
253
253
  background: var(--ys-color-primary);
254
- color: #fff;
254
+ color: var(--ys-color-on-solid);
255
255
  }
256
256
  .ys-layout__content {
257
257
  flex: 1;
@@ -74,7 +74,7 @@ const emit = defineEmits<{ open: [app: AppCard] }>();
74
74
  align-items: center;
75
75
  justify-content: center;
76
76
  background: var(--ys-color-primary);
77
- color: #fff;
77
+ color: var(--ys-color-on-solid);
78
78
  font-size: 22px;
79
79
  font-weight: 600;
80
80
  }
@@ -26,8 +26,8 @@ const roleClass = computed(() => {
26
26
  : "custom";
27
27
  });
28
28
  /**
29
- * 扩展角色与内置角色同一做法:浅色底、深色字、浅色边。暗色主题下也保持浅底,
30
- * 所以底色和边框按白色调配,不能按当前主题背景调配,否则深字压在深底上看不清。
29
+ * 扩展角色与内置角色同一做法:只给一个角色色,底色、边框、文字都由它和当前主题派生——
30
+ * 亮色是浅底深字,暗色是带一点角色色的深底、提亮的字,两种模式都清楚,不会在暗色里冒出一块亮片。
31
31
  */
32
32
  const customStyle = computed(() => {
33
33
  if (
@@ -35,11 +35,7 @@ const customStyle = computed(() => {
35
35
  !/^#[0-9a-fA-F]{6}$/.test(props.color ?? "")
36
36
  )
37
37
  return undefined;
38
- return {
39
- "--ys-role-text": props.color,
40
- "--ys-role-border": `color-mix(in srgb, ${props.color} 42%, #fff)`,
41
- "--ys-role-bg": `color-mix(in srgb, ${props.color} 8%, #fff)`,
42
- };
38
+ return { "--ys-role-color": props.color };
43
39
  });
44
40
  const displayLabel = computed(
45
41
  () =>
@@ -62,50 +58,37 @@ const displayLabel = computed(
62
58
  </template>
63
59
 
64
60
  <style scoped>
61
+ /* 文字往一级文字色里混:亮色变深、暗色变亮,对比度都够;底色、边框往卡片底色里混。 */
65
62
  .ys-role-tag {
66
- --ys-role-bg: #f8fafc;
67
- --ys-role-text: #475569;
68
- --ys-role-border: #cbd5e1;
63
+ --ys-role-color: #64748b;
69
64
 
70
- border-color: var(--ys-role-border);
71
- background-color: var(--ys-role-bg);
72
- color: var(--ys-role-text);
65
+ border-color: color-mix(in srgb, var(--ys-role-color) 42%, var(--ys-color-bg-elevated));
66
+ background-color: color-mix(in srgb, var(--ys-role-color) 10%, var(--ys-color-bg-elevated));
67
+ color: color-mix(in srgb, var(--ys-role-color) 74%, var(--ys-color-text-1));
73
68
  font-weight: 600;
74
69
  }
75
70
 
76
71
  .ys-role-tag--root {
77
- --ys-role-bg: #f5f3ff;
78
- --ys-role-text: #6d28d9;
79
- --ys-role-border: #c4b5fd;
72
+ --ys-role-color: #7c3aed;
80
73
  }
81
74
 
82
75
  .ys-role-tag--admin {
83
- --ys-role-bg: #fff1f2;
84
- --ys-role-text: #be123c;
85
- --ys-role-border: #fda4af;
76
+ --ys-role-color: #e11d48;
86
77
  }
87
78
 
88
79
  .ys-role-tag--manager {
89
- --ys-role-bg: #fffbeb;
90
- --ys-role-text: #a16207;
91
- --ys-role-border: #fcd34d;
80
+ --ys-role-color: #d97706;
92
81
  }
93
82
 
94
83
  .ys-role-tag--editor {
95
- --ys-role-bg: #ecfdf5;
96
- --ys-role-text: #047857;
97
- --ys-role-border: #6ee7b7;
84
+ --ys-role-color: #059669;
98
85
  }
99
86
 
100
87
  .ys-role-tag--viewer {
101
- --ys-role-bg: #eff6ff;
102
- --ys-role-text: #2563eb;
103
- --ys-role-border: #93c5fd;
88
+ --ys-role-color: #2563eb;
104
89
  }
105
90
 
106
91
  .ys-role-tag--initiate {
107
- --ys-role-bg: #f1f5f9;
108
- --ys-role-text: #475569;
109
- --ys-role-border: #94a3b8;
92
+ --ys-role-color: #64748b;
110
93
  }
111
94
  </style>
@@ -106,16 +106,16 @@ function select(action: YsRowAction) {
106
106
  --item-color: var(--ys-color-primary);
107
107
  }
108
108
  .ys-row-action__item.is-accent {
109
- --item-color: #0f8f83;
109
+ --item-color: var(--ys-color-accent);
110
110
  }
111
111
  .ys-row-action__item.is-warning {
112
- --item-color: #b7791f;
112
+ --item-color: var(--ys-color-warning);
113
113
  }
114
114
  .ys-row-action__item.is-success {
115
115
  --item-color: var(--ys-color-success);
116
116
  }
117
117
  .ys-row-action__item.is-neutral {
118
- --item-color: #58677f;
118
+ --item-color: var(--ys-color-text-2);
119
119
  }
120
120
  .ys-row-action__item.is-danger {
121
121
  --item-color: var(--ys-color-danger);