ep-craft 0.1.11 → 0.1.13

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.
@@ -21,10 +21,6 @@ export interface EpCraftResolverOptions {
21
21
  export declare function EpCraftResolver(options?: EpCraftResolverOptions): {
22
22
  type: "component";
23
23
  resolve: (name: string) => {
24
- name: string;
25
- from: string;
26
- sideEffects?: undefined;
27
- } | {
28
24
  name: string;
29
25
  from: string;
30
26
  sideEffects: string[] | undefined;
package/dist/resolver.js CHANGED
@@ -1,22 +1,23 @@
1
- function n(r = {}) {
2
- const { importStyle: o = !0 } = r;
1
+ function c(s = {}) {
2
+ const { importStyle: r = !0 } = s;
3
3
  return {
4
4
  type: "component",
5
- resolve: (t) => {
6
- if (!t.startsWith("Ep")) return;
7
- const e = t.slice(2);
8
- return e === "Button" || e === "ButtonGroup" ? {
9
- name: t,
10
- from: "ep-craft"
5
+ resolve: (e) => {
6
+ if (!e.startsWith("Ep")) return;
7
+ const t = e.slice(2);
8
+ return t === "Button" || t === "ButtonGroup" || t === "Tag" || t === "CheckTag" ? {
9
+ name: e,
10
+ from: "ep-craft",
11
+ sideEffects: r ? ["ep-craft/dist/index.css"] : void 0
11
12
  } : {
12
- name: `El${e}`,
13
+ name: `El${t}`,
13
14
  from: "ep-craft",
14
- sideEffects: o ? ["ep-craft/dist/index.css"] : void 0
15
+ sideEffects: r ? ["ep-craft/dist/index.css"] : void 0
15
16
  };
16
17
  }
17
18
  };
18
19
  }
19
20
  export {
20
- n as EpCraftResolver,
21
- n as default
21
+ c as EpCraftResolver,
22
+ c as default
22
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ep-craft",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "A Vue 3 component library based on element-plus with ep- prefix",
5
5
  "type": "module",
6
6
  "main": "./dist/ep-craft.js",
@@ -93,8 +93,6 @@ $button-plain-config: (
93
93
 
94
94
  @include b(button) {
95
95
  @include set-component-css-var('button', $button);
96
- // 默认按钮(未指定 type)样式与 primary 保持一致
97
- @include button-variant(primary);
98
96
  }
99
97
 
100
98
  @include b(button) {
@@ -174,25 +172,11 @@ $button-plain-config: (
174
172
  }
175
173
 
176
174
  @include when(plain) {
177
- // 默认朴素按钮样式与 primary + plain 保持一致
178
- $cfg: map.get($button-plain-config, primary);
179
- @include button-reverse-variant(
180
- $color-primary,
181
- list.nth($cfg, 2),
182
- list.nth($cfg, 3),
183
- list.nth($cfg, 4),
184
- list.nth($cfg, 5)
185
- );
186
-
187
- // plain 禁用态与 primary + plain disabled 保持一致:透明背景 + 主题色边框 + 整体 40% 透明
188
175
  &.is-disabled {
189
176
  &,
190
177
  &:hover,
191
178
  &:focus,
192
179
  &:active {
193
- color: getCssVar('color-primary');
194
- background-color: transparent;
195
- border-color: list.nth($cfg, 2);
196
180
  opacity: 0.4;
197
181
  }
198
182
  }
@@ -1,57 +1,96 @@
1
+ @use 'sass:color';
2
+ @use 'sass:map';
1
3
  @use 'mixins/mixins' as *;
2
4
  @use 'common/var' as *;
3
5
 
6
+ // 各类型选中态主色(依据 Figma 实心标签规范)
7
+ $haldur-check-tag-checked: (
8
+ 'primary': #1c64fd,
9
+ 'success': #12b886,
10
+ 'info': #a9acb8,
11
+ 'warning': #f57f00,
12
+ 'danger': #f14646,
13
+ );
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // CheckTag 可选标签
17
+ // 依据 Haldur Design System(Figma node 1443-21458 / 21470 / 21471 / 21472)
18
+ // 精确对齐各状态颜色、尺寸与圆角。
19
+ // ---------------------------------------------------------------------------
4
20
  @include b(check-tag) {
5
- background-color: getCssVar('color', 'info', 'light-9');
6
- border-radius: getCssVar('border-radius', 'base');
7
- color: getCssVar('color', 'info');
21
+ // 基础排版:14px / 22px 常规字重,圆角 4px,内边距 1px 8px
22
+ font-family: 'PingFang SC', sans-serif;
23
+ font-size: 14px;
24
+ line-height: 22px;
25
+ font-weight: 400;
26
+ border-radius: 4px;
27
+ padding: 1px 8px;
8
28
  cursor: pointer;
9
29
  display: inline-block;
10
- font-size: getCssVar('font-size', 'base');
11
- line-height: getCssVar('font-size', 'base');
12
- padding: 7px 15px;
13
30
  transition: getCssVar('transition', 'all');
14
- font-weight: bold;
15
31
 
32
+ // 未选中 默认:浅灰底 + 深色字
33
+ background-color: #f2f3f5;
34
+ color: #1d1f29;
35
+
36
+ // 未选中 悬停
16
37
  &:hover {
17
- background-color: getCssVar('color', 'info', 'light-7');
38
+ background-color: #e5e6eb;
39
+ }
40
+
41
+ // 未选中 禁用
42
+ @include when(disabled) {
43
+ background-color: #f2f3f5;
44
+ color: #c9cbd4;
45
+ cursor: not-allowed;
46
+
47
+ &:hover {
48
+ background-color: #f2f3f5;
49
+ }
18
50
  }
19
51
 
20
- @each $type in $types {
52
+ // 选中:实心底 + 白字(默认 primary 蓝)
53
+ @include when(checked) {
54
+ background-color: #1c64fd;
55
+ color: #fff;
56
+
57
+ // 选中 悬停
58
+ &:hover {
59
+ background-color: #164ed1;
60
+ }
61
+
62
+ // 选中 禁用
63
+ @include when(disabled) {
64
+ background-color: #b8cfff;
65
+ color: #fff;
66
+ cursor: not-allowed;
67
+
68
+ &:hover {
69
+ background-color: #b8cfff;
70
+ }
71
+ }
72
+ }
73
+
74
+ // 各类型选中态:实心主色 + 白字
75
+ @each $type, $main in $haldur-check-tag-checked {
21
76
  &.#{bem('check-tag', '', $type)} {
22
77
  @include when(checked) {
23
- background-color: getCssVar('color', $type, 'light-8');
24
- color: getCssVar('color', $type);
78
+ background-color: $main;
79
+ color: #fff;
25
80
 
81
+ // 悬停:加深主色
26
82
  &:hover {
27
- background-color: getCssVar('color', $type, 'light-7');
83
+ background-color: color.adjust($main, $lightness: -6%);
28
84
  }
29
85
 
86
+ // 禁用:主色浅化
30
87
  @include when(disabled) {
31
- background-color: getCssVar('color', $type, 'light-8');
32
- color: getCssVar('disabled-text-color');
88
+ background-color: color.mix(#fff, $main, 72%);
89
+ color: #fff;
33
90
  cursor: not-allowed;
34
91
 
35
92
  &:hover {
36
- background-color: getCssVar('color', $type, 'light-8');
37
- }
38
- }
39
- }
40
-
41
- @include when(disabled) {
42
- @if $type == 'primary' {
43
- background-color: getCssVar('color', 'info', 'light-9');
44
- } @else {
45
- background-color: getCssVar('color', $type, 'light-9');
46
- }
47
- color: getCssVar('disabled-text-color');
48
- cursor: not-allowed;
49
-
50
- &:hover {
51
- @if $type == 'primary' {
52
- background-color: getCssVar('color', 'info', 'light-9');
53
- } @else {
54
- background-color: getCssVar('color', $type, 'light-9');
93
+ background-color: color.mix(#fff, $main, 72%);
55
94
  }
56
95
  }
57
96
  }
@@ -193,3 +193,112 @@ $tag-icon-span-gap: map.merge(
193
193
  }
194
194
  }
195
195
  }
196
+
197
+ // ---------------------------------------------------------------------------
198
+ // Haldur Design System - Tag 样式覆盖
199
+ // 依据 Figma 设计规范(node 1433-12002)精确对齐颜色、尺寸与圆角。
200
+ // 通过覆盖 CSS 变量的方式实现,保留上方原有的结构与逻辑。
201
+ // ---------------------------------------------------------------------------
202
+
203
+ // 各类型的设计色板:(文字色, 浅色背景, 描边色)
204
+ $haldur-tag-colors: (
205
+ 'primary': (
206
+ 'main': #1c64fd,
207
+ 'light-bg': #f5f8ff,
208
+ 'border': #b8cfff,
209
+ ),
210
+ 'success': (
211
+ 'main': #12b886,
212
+ 'light-bg': #f3fbf9,
213
+ 'border': #b8eadb,
214
+ ),
215
+ 'info': (
216
+ 'main': #1d1f29,
217
+ 'light-bg': #f2f3f5,
218
+ 'border': #c9cbd4,
219
+ ),
220
+ 'warning': (
221
+ 'main': #f57f00,
222
+ 'light-bg': #fff6eb,
223
+ 'border': #ffd8a8,
224
+ ),
225
+ 'danger': (
226
+ 'main': #f14646,
227
+ 'light-bg': #fff5f5,
228
+ 'border': #ffc9c9,
229
+ ),
230
+ );
231
+
232
+ @include b(tag) {
233
+ // 基础排版:14px / 22px,圆角 4px,间距 4px,内边距 1px 8px
234
+ #{getCssVarName('tag-font-size')}: 14px;
235
+ #{getCssVarName('tag-border-radius')}: 4px;
236
+
237
+ font-family: 'PingFang SC', sans-serif;
238
+ line-height: 22px;
239
+ height: 24px;
240
+ padding: 1px calc(8px - #{$tag-border-width});
241
+ gap: 4px;
242
+
243
+ // light(默认):浅色背景 + 彩色文字,无边框
244
+ @each $type, $conf in $haldur-tag-colors {
245
+ &.#{bem('tag', '', $type)} {
246
+ #{getCssVarName('tag-bg-color')}: map.get($conf, 'light-bg');
247
+ #{getCssVarName('tag-border-color')}: map.get($conf, 'light-bg');
248
+ #{getCssVarName('tag-text-color')}: map.get($conf, 'main');
249
+ #{getCssVarName('tag-hover-color')}: map.get($conf, 'main');
250
+ }
251
+ }
252
+
253
+ // dark(实心):彩色背景 + 白色文字
254
+ @include m(dark) {
255
+ @each $type, $conf in $haldur-tag-colors {
256
+ $bg: map.get($conf, 'main');
257
+ @if $type == 'info' {
258
+ $bg: #4e5369;
259
+ }
260
+ &.#{bem('tag', '', $type)} {
261
+ #{getCssVarName('tag-bg-color')}: $bg;
262
+ #{getCssVarName('tag-border-color')}: $bg;
263
+ #{getCssVarName('tag-text-color')}: #fff;
264
+ }
265
+ }
266
+ }
267
+
268
+ // plain(带边框):浅色背景 + 彩色文字 + 彩色描边
269
+ @include m(plain) {
270
+ @each $type, $conf in $haldur-tag-colors {
271
+ &.#{bem('tag', '', $type)} {
272
+ #{getCssVarName('tag-bg-color')}: map.get($conf, 'light-bg');
273
+ #{getCssVarName('tag-border-color')}: map.get($conf, 'border');
274
+ #{getCssVarName('tag-text-color')}: map.get($conf, 'main');
275
+ }
276
+ }
277
+ }
278
+
279
+ // 图标尺寸对齐 12px
280
+ @include set-css-var-value('icon-size', 12px);
281
+
282
+ .#{$namespace}-tag__close {
283
+ margin-left: 0;
284
+ }
285
+
286
+ &.is-closable {
287
+ padding-right: calc(8px - #{$tag-border-width});
288
+ }
289
+
290
+ // 各尺寸标签高度:large 28px / default 24px / small 22px / mini 18px
291
+ $haldur-tag-height: (
292
+ 'large': 28px,
293
+ 'default': 24px,
294
+ 'small': 22px,
295
+ 'mini': 18px,
296
+ );
297
+
298
+ @each $size, $height in $haldur-tag-height {
299
+ @include m($size) {
300
+ height: $height;
301
+ }
302
+ }
303
+ }
304
+