@ew-color-picker/style 2.0.10 → 2.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.
@@ -0,0 +1,92 @@
1
+ .ew-button {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ height: 32px;
6
+ padding: 0 15px;
7
+ box-sizing: border-box;
8
+ border: 1px solid #dcdfe6;
9
+ border-radius: var(--btn-radius, 4px);
10
+ background: #fff;
11
+ color: #606266;
12
+ font-family: inherit;
13
+ font-size: 14px;
14
+ line-height: 1;
15
+ white-space: nowrap;
16
+ cursor: pointer;
17
+ outline: none;
18
+ transition: color 0.2s, border-color 0.2s, background-color 0.2s;
19
+ }
20
+
21
+ .ew-button:hover {
22
+ border-color: #4096ef;
23
+ color: #4096ef;
24
+ }
25
+
26
+ .ew-button--primary {
27
+ border-color: #4096ef;
28
+ background: #4096ef;
29
+ color: #fff;
30
+ }
31
+
32
+ .ew-button--primary:hover {
33
+ border-color: #66b1ff;
34
+ background: #66b1ff;
35
+ color: #fff;
36
+ }
37
+
38
+ .ew-button--danger {
39
+ border-color: #f56c6c;
40
+ background: #f56c6c;
41
+ color: #fff;
42
+ }
43
+
44
+ .ew-button--danger:hover {
45
+ border-color: #f78989;
46
+ background: #f78989;
47
+ color: #fff;
48
+ }
49
+
50
+ .ew-button--text {
51
+ border-color: transparent;
52
+ background: transparent;
53
+ color: #4096ef;
54
+ }
55
+
56
+ .ew-button--text:hover {
57
+ border-color: transparent;
58
+ background: transparent;
59
+ color: #66b1ff;
60
+ }
61
+
62
+ .ew-button--small {
63
+ height: 28px;
64
+ padding: 0 11px;
65
+ font-size: 12px;
66
+ }
67
+
68
+ .ew-button--large {
69
+ height: 36px;
70
+ padding: 0 19px;
71
+ font-size: 14px;
72
+ }
73
+
74
+ .ew-button--block {
75
+ display: flex;
76
+ width: 100%;
77
+ }
78
+
79
+ .ew-button:disabled,
80
+ .ew-button--disabled {
81
+ border-color: #e4e7ed;
82
+ background: #f5f7fa;
83
+ color: #c0c4cc;
84
+ cursor: not-allowed;
85
+ }
86
+
87
+ .ew-button--primary:disabled,
88
+ .ew-button--danger:disabled {
89
+ border-color: #a0cfff;
90
+ background: #a0cfff;
91
+ color: #fff;
92
+ }
@@ -0,0 +1 @@
1
+ .ew-button{display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 15px;box-sizing:border-box;border:1px solid #dcdfe6;border-radius:var(--btn-radius, 4px);background:#fff;color:#606266;font-family:inherit;font-size:14px;line-height:1;white-space:nowrap;cursor:pointer;outline:none;transition:color .2s,border-color .2s,background-color .2s}.ew-button:hover{border-color:#4096ef;color:#4096ef}.ew-button--primary{border-color:#4096ef;background:#4096ef;color:#fff}.ew-button--primary:hover{border-color:#66b1ff;background:#66b1ff;color:#fff}.ew-button--danger{border-color:#f56c6c;background:#f56c6c;color:#fff}.ew-button--danger:hover{border-color:#f78989;background:#f78989;color:#fff}.ew-button--text{border-color:rgba(0,0,0,0);background:rgba(0,0,0,0);color:#4096ef}.ew-button--text:hover{border-color:rgba(0,0,0,0);background:rgba(0,0,0,0);color:#66b1ff}.ew-button--small{height:28px;padding:0 11px;font-size:12px}.ew-button--large{height:36px;padding:0 19px;font-size:14px}.ew-button--block{display:flex;width:100%}.ew-button:disabled,.ew-button--disabled{border-color:#e4e7ed;background:#f5f7fa;color:#c0c4cc;cursor:not-allowed}.ew-button--primary:disabled,.ew-button--danger:disabled{border-color:#a0cfff;background:#a0cfff;color:#fff}
package/dist/input.css ADDED
@@ -0,0 +1,53 @@
1
+ .ew-input {
2
+ width: 100%;
3
+ height: 32px;
4
+ padding: 0 11px;
5
+ box-sizing: border-box;
6
+ border: 1px solid #dcdfe6;
7
+ border-radius: var(--input-radius, 4px);
8
+ background: #fff;
9
+ color: #303133;
10
+ font-family: inherit;
11
+ font-size: 14px;
12
+ line-height: 1.5;
13
+ outline: none;
14
+ transition: border-color 0.2s, box-shadow 0.2s;
15
+ }
16
+
17
+ .ew-input:hover {
18
+ border-color: #c0c4cc;
19
+ }
20
+
21
+ .ew-input:focus {
22
+ border-color: #4096ef;
23
+ box-shadow: 0 0 0 2px rgba(64, 150, 239, 0.12);
24
+ }
25
+
26
+ .ew-input::placeholder {
27
+ color: #a8abb2;
28
+ }
29
+
30
+ .ew-input--small {
31
+ height: 28px;
32
+ padding: 0 9px;
33
+ font-size: 12px;
34
+ }
35
+
36
+ .ew-input--large {
37
+ height: 36px;
38
+ padding: 0 13px;
39
+ font-size: 14px;
40
+ }
41
+
42
+ .ew-input:disabled,
43
+ .ew-input--disabled {
44
+ border-color: #e4e7ed;
45
+ background: #f5f7fa;
46
+ color: #c0c4cc;
47
+ cursor: not-allowed;
48
+ }
49
+
50
+ .ew-input--readonly {
51
+ background: #fafafa;
52
+ cursor: default;
53
+ }
@@ -0,0 +1 @@
1
+ .ew-input{width:100%;height:32px;padding:0 11px;box-sizing:border-box;border:1px solid #dcdfe6;border-radius:var(--input-radius, 4px);background:#fff;color:#303133;font-family:inherit;font-size:14px;line-height:1.5;outline:none;transition:border-color .2s,box-shadow .2s}.ew-input:hover{border-color:#c0c4cc}.ew-input:focus{border-color:#4096ef;box-shadow:0 0 0 2px rgba(64,150,239,.12)}.ew-input::placeholder{color:#a8abb2}.ew-input--small{height:28px;padding:0 9px;font-size:12px}.ew-input--large{height:36px;padding:0 13px;font-size:14px}.ew-input:disabled,.ew-input--disabled{border-color:#e4e7ed;background:#f5f7fa;color:#c0c4cc;cursor:not-allowed}.ew-input--readonly{background:#fafafa;cursor:default}
package/dist/select.css CHANGED
@@ -181,32 +181,4 @@
181
181
  .ew-select--large .ew-select__option {
182
182
  padding: 8px 12px;
183
183
  font-size: 14px;
184
- }
185
-
186
- .ew-select__tooltip {
187
- position: fixed;
188
- z-index: 3000;
189
- max-width: 240px;
190
- padding: 4px 8px;
191
- border-radius: 4px;
192
- background: rgba(0, 0, 0, 0.78);
193
- color: #fff;
194
- font-family: inherit;
195
- font-size: 12px;
196
- line-height: 1.4;
197
- white-space: normal;
198
- word-break: break-word;
199
- pointer-events: none;
200
- opacity: 0;
201
- transform: translateY(-100%);
202
- transition: opacity 0.15s;
203
- box-sizing: border-box;
204
- }
205
-
206
- .ew-select__tooltip--visible {
207
- opacity: 1;
208
- }
209
-
210
- .ew-select__tooltip--bottom {
211
- transform: none;
212
184
  }
@@ -1 +1 @@
1
- .ew-select{position:relative;display:inline-block;width:100%;min-width:0;font-family:inherit;box-sizing:border-box}.ew-select__trigger{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;height:var(--select-height, 32px);padding:var(--select-padding, 0 10px);border:var(--select-border-width, 1.5px) solid #d9d9d9;border-radius:var(--select-radius, 8px);background:#fff;color:#222;font-family:inherit;font-size:var(--select-font-size, 14px);line-height:1;text-align:left;cursor:pointer;box-sizing:border-box;transition:border-color .2s}.ew-select__trigger:focus{outline:none;border-color:#4096ef}.ew-select--open .ew-select__trigger{border-color:#4096ef}.ew-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ew-select__value--placeholder{color:#999}.ew-select__clear{display:inline-flex;align-items:center;justify-content:center;flex:0 0 var(--select-clear-size, 12px);width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);color:#999;border-radius:50%;cursor:pointer;transition:color .15s}.ew-select__clear:hover{color:#666}.ew-select__clear--hidden{display:none}.ew-select__clear-icon{display:block;width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);pointer-events:none}.ew-select__arrow{display:flex;align-items:center;justify-content:center;flex:0 0 var(--select-arrow-size, 12px);width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);color:#999;transition:transform .2s}.ew-select--open .ew-select__arrow{transform:rotate(180deg)}.ew-select__arrow-icon{display:block;width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);pointer-events:none}.ew-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:3;display:none;max-height:200px;overflow-y:auto;padding:4px;border:1px solid #e5e6eb;border-radius:8px;background:#fff;box-shadow:0 4px 16px rgba(0,0,0,.12);box-sizing:border-box}.ew-select--open .ew-select__dropdown{display:block}.ew-select__option{padding:6px 10px;border-radius:6px;color:#333;font-size:13px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background .15s}.ew-select__option:hover,.ew-select__option--active{background:#f0f8ff}.ew-select__option--selected{color:#4096ef;font-weight:500}.ew-select__option--disabled{color:#ccc;background:rgba(0,0,0,0);cursor:not-allowed}.ew-select--disabled{cursor:not-allowed}.ew-select--disabled .ew-select__trigger{border-color:#e5e6eb;background:#f7f8fa;color:#ccc;cursor:not-allowed}.ew-select--small .ew-select__trigger{height:24px;padding:0 8px;font-size:12px;border-radius:6px}.ew-select--small .ew-select__option{padding:4px 8px;font-size:12px}.ew-select--large .ew-select__trigger{height:40px;padding:0 12px;font-size:15px}.ew-select--large .ew-select__option{padding:8px 12px;font-size:14px}.ew-select__tooltip{position:fixed;z-index:3000;max-width:240px;padding:4px 8px;border-radius:4px;background:rgba(0,0,0,.78);color:#fff;font-family:inherit;font-size:12px;line-height:1.4;white-space:normal;word-break:break-word;pointer-events:none;opacity:0;transform:translateY(-100%);transition:opacity .15s;box-sizing:border-box}.ew-select__tooltip--visible{opacity:1}.ew-select__tooltip--bottom{transform:none}
1
+ .ew-select{position:relative;display:inline-block;width:100%;min-width:0;font-family:inherit;box-sizing:border-box}.ew-select__trigger{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;height:var(--select-height, 32px);padding:var(--select-padding, 0 10px);border:var(--select-border-width, 1.5px) solid #d9d9d9;border-radius:var(--select-radius, 8px);background:#fff;color:#222;font-family:inherit;font-size:var(--select-font-size, 14px);line-height:1;text-align:left;cursor:pointer;box-sizing:border-box;transition:border-color .2s}.ew-select__trigger:focus{outline:none;border-color:#4096ef}.ew-select--open .ew-select__trigger{border-color:#4096ef}.ew-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ew-select__value--placeholder{color:#999}.ew-select__clear{display:inline-flex;align-items:center;justify-content:center;flex:0 0 var(--select-clear-size, 12px);width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);color:#999;border-radius:50%;cursor:pointer;transition:color .15s}.ew-select__clear:hover{color:#666}.ew-select__clear--hidden{display:none}.ew-select__clear-icon{display:block;width:var(--select-clear-size, 12px);height:var(--select-clear-size, 12px);pointer-events:none}.ew-select__arrow{display:flex;align-items:center;justify-content:center;flex:0 0 var(--select-arrow-size, 12px);width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);color:#999;transition:transform .2s}.ew-select--open .ew-select__arrow{transform:rotate(180deg)}.ew-select__arrow-icon{display:block;width:var(--select-arrow-size, 12px);height:var(--select-arrow-size, 12px);pointer-events:none}.ew-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:3;display:none;max-height:200px;overflow-y:auto;padding:4px;border:1px solid #e5e6eb;border-radius:8px;background:#fff;box-shadow:0 4px 16px rgba(0,0,0,.12);box-sizing:border-box}.ew-select--open .ew-select__dropdown{display:block}.ew-select__option{padding:6px 10px;border-radius:6px;color:#333;font-size:13px;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;transition:background .15s}.ew-select__option:hover,.ew-select__option--active{background:#f0f8ff}.ew-select__option--selected{color:#4096ef;font-weight:500}.ew-select__option--disabled{color:#ccc;background:rgba(0,0,0,0);cursor:not-allowed}.ew-select--disabled{cursor:not-allowed}.ew-select--disabled .ew-select__trigger{border-color:#e5e6eb;background:#f7f8fa;color:#ccc;cursor:not-allowed}.ew-select--small .ew-select__trigger{height:24px;padding:0 8px;font-size:12px;border-radius:6px}.ew-select--small .ew-select__option{padding:4px 8px;font-size:12px}.ew-select--large .ew-select__trigger{height:40px;padding:0 12px;font-size:15px}.ew-select--large .ew-select__option{padding:8px 12px;font-size:14px}
@@ -0,0 +1,85 @@
1
+ .ew-tooltip {
2
+ position: fixed;
3
+ z-index: 3000;
4
+ box-sizing: border-box;
5
+ max-width: var(--ew-tooltip-max-width, none);
6
+ padding: 5px 10px;
7
+ border-radius: 4px;
8
+ font-family: inherit;
9
+ font-size: 12px;
10
+ line-height: 1.4;
11
+ text-align: left;
12
+ word-break: break-word;
13
+ pointer-events: none;
14
+ opacity: 0;
15
+ visibility: hidden;
16
+ transition: opacity 0.2s ease, visibility 0.2s ease;
17
+ }
18
+
19
+ .ew-tooltip--dark {
20
+ --ew-tooltip-bg: #303133;
21
+ --ew-tooltip-color: #fff;
22
+ --ew-tooltip-border-color: transparent;
23
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
24
+ }
25
+
26
+ .ew-tooltip--light {
27
+ --ew-tooltip-bg: #fff;
28
+ --ew-tooltip-color: #303133;
29
+ --ew-tooltip-border-color: #e4e7ed;
30
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
31
+ }
32
+
33
+ .ew-tooltip--dark,
34
+ .ew-tooltip--light {
35
+ background: var(--ew-tooltip-bg);
36
+ color: var(--ew-tooltip-color);
37
+ border: 1px solid var(--ew-tooltip-border-color);
38
+ box-shadow: var(--ew-tooltip-shadow);
39
+ }
40
+
41
+ .ew-tooltip--visible {
42
+ opacity: 1;
43
+ visibility: visible;
44
+ }
45
+
46
+ .ew-tooltip--enterable {
47
+ pointer-events: auto;
48
+ }
49
+
50
+ .ew-tooltip__content {
51
+ display: block;
52
+ }
53
+
54
+ .ew-tooltip__arrow {
55
+ position: absolute;
56
+ width: 8px;
57
+ height: 8px;
58
+ box-sizing: border-box;
59
+ background: inherit;
60
+ border: 1px solid transparent;
61
+ border-color: transparent;
62
+ transform: rotate(45deg);
63
+ pointer-events: none;
64
+ z-index: -1;
65
+ }
66
+
67
+ .ew-tooltip[data-placement^=top] .ew-tooltip__arrow {
68
+ border-right-color: var(--ew-tooltip-border-color);
69
+ border-bottom-color: var(--ew-tooltip-border-color);
70
+ }
71
+
72
+ .ew-tooltip[data-placement^=bottom] .ew-tooltip__arrow {
73
+ border-left-color: var(--ew-tooltip-border-color);
74
+ border-top-color: var(--ew-tooltip-border-color);
75
+ }
76
+
77
+ .ew-tooltip[data-placement^=left] .ew-tooltip__arrow {
78
+ border-top-color: var(--ew-tooltip-border-color);
79
+ border-right-color: var(--ew-tooltip-border-color);
80
+ }
81
+
82
+ .ew-tooltip[data-placement^=right] .ew-tooltip__arrow {
83
+ border-left-color: var(--ew-tooltip-border-color);
84
+ border-bottom-color: var(--ew-tooltip-border-color);
85
+ }
@@ -0,0 +1 @@
1
+ .ew-tooltip{position:fixed;z-index:3000;box-sizing:border-box;max-width:var(--ew-tooltip-max-width, none);padding:5px 10px;border-radius:4px;font-family:inherit;font-size:12px;line-height:1.4;text-align:left;word-break:break-word;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s ease}.ew-tooltip--dark{--ew-tooltip-bg: #303133;--ew-tooltip-color: #fff;--ew-tooltip-border-color: transparent;--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2)}.ew-tooltip--light{--ew-tooltip-bg: #fff;--ew-tooltip-color: #303133;--ew-tooltip-border-color: #e4e7ed;--ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1)}.ew-tooltip--dark,.ew-tooltip--light{background:var(--ew-tooltip-bg);color:var(--ew-tooltip-color);border:1px solid var(--ew-tooltip-border-color);box-shadow:var(--ew-tooltip-shadow)}.ew-tooltip--visible{opacity:1;visibility:visible}.ew-tooltip--enterable{pointer-events:auto}.ew-tooltip__content{display:block}.ew-tooltip__arrow{position:absolute;width:8px;height:8px;box-sizing:border-box;background:inherit;border:1px solid rgba(0,0,0,0);border-color:rgba(0,0,0,0);transform:rotate(45deg);pointer-events:none;z-index:-1}.ew-tooltip[data-placement^=top] .ew-tooltip__arrow{border-right-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=bottom] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-top-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=left] .ew-tooltip__arrow{border-top-color:var(--ew-tooltip-border-color);border-right-color:var(--ew-tooltip-border-color)}.ew-tooltip[data-placement^=right] .ew-tooltip__arrow{border-left-color:var(--ew-tooltip-border-color);border-bottom-color:var(--ew-tooltip-border-color)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ew-color-picker/style",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "EW Color Picker Styles",
5
5
  "main": "dist/index.css",
6
6
  "style": "dist/index.css",
@@ -0,0 +1,96 @@
1
+ @import './variable.scss';
2
+ // 类名前缀,可通过 @use ... with ($prefix: "my-") 自定义,需与 JS 侧 prefix 选项保持一致
3
+ $prefix: "ew-" !default;
4
+
5
+ .#{$prefix}button {
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ height: 32px;
10
+ padding: 0 15px;
11
+ box-sizing: border-box;
12
+ border: 1px solid #dcdfe6;
13
+ border-radius: var(--btn-radius, 4px);
14
+ background: #fff;
15
+ color: #606266;
16
+ font-family: inherit;
17
+ font-size: 14px;
18
+ line-height: 1;
19
+ white-space: nowrap;
20
+ cursor: pointer;
21
+ outline: none;
22
+ transition: color 0.2s, border-color 0.2s, background-color 0.2s;
23
+ }
24
+
25
+ .#{$prefix}button:hover {
26
+ border-color: #4096ef;
27
+ color: #4096ef;
28
+ }
29
+
30
+ .#{$prefix}button--primary {
31
+ border-color: #4096ef;
32
+ background: #4096ef;
33
+ color: #fff;
34
+ }
35
+
36
+ .#{$prefix}button--primary:hover {
37
+ border-color: #66b1ff;
38
+ background: #66b1ff;
39
+ color: #fff;
40
+ }
41
+
42
+ .#{$prefix}button--danger {
43
+ border-color: #f56c6c;
44
+ background: #f56c6c;
45
+ color: #fff;
46
+ }
47
+
48
+ .#{$prefix}button--danger:hover {
49
+ border-color: #f78989;
50
+ background: #f78989;
51
+ color: #fff;
52
+ }
53
+
54
+ .#{$prefix}button--text {
55
+ border-color: transparent;
56
+ background: transparent;
57
+ color: #4096ef;
58
+ }
59
+
60
+ .#{$prefix}button--text:hover {
61
+ border-color: transparent;
62
+ background: transparent;
63
+ color: #66b1ff;
64
+ }
65
+
66
+ .#{$prefix}button--small {
67
+ height: 28px;
68
+ padding: 0 11px;
69
+ font-size: 12px;
70
+ }
71
+
72
+ .#{$prefix}button--large {
73
+ height: 36px;
74
+ padding: 0 19px;
75
+ font-size: 14px;
76
+ }
77
+
78
+ .#{$prefix}button--block {
79
+ display: flex;
80
+ width: 100%;
81
+ }
82
+
83
+ .#{$prefix}button:disabled,
84
+ .#{$prefix}button--disabled {
85
+ border-color: #e4e7ed;
86
+ background: #f5f7fa;
87
+ color: #c0c4cc;
88
+ cursor: not-allowed;
89
+ }
90
+
91
+ .#{$prefix}button--primary:disabled,
92
+ .#{$prefix}button--danger:disabled {
93
+ border-color: #a0cfff;
94
+ background: #a0cfff;
95
+ color: #fff;
96
+ }
package/src/input.scss ADDED
@@ -0,0 +1,57 @@
1
+ @import './variable.scss';
2
+ // 类名前缀,可通过 @use ... with ($prefix: "my-") 自定义,需与 JS 侧 prefix 选项保持一致
3
+ $prefix: "ew-" !default;
4
+
5
+ .#{$prefix}input {
6
+ width: 100%;
7
+ height: 32px;
8
+ padding: 0 11px;
9
+ box-sizing: border-box;
10
+ border: 1px solid #dcdfe6;
11
+ border-radius: var(--input-radius, 4px);
12
+ background: #fff;
13
+ color: #303133;
14
+ font-family: inherit;
15
+ font-size: 14px;
16
+ line-height: 1.5;
17
+ outline: none;
18
+ transition: border-color 0.2s, box-shadow 0.2s;
19
+ }
20
+
21
+ .#{$prefix}input:hover {
22
+ border-color: #c0c4cc;
23
+ }
24
+
25
+ .#{$prefix}input:focus {
26
+ border-color: #4096ef;
27
+ box-shadow: 0 0 0 2px rgba(64, 150, 239, 0.12);
28
+ }
29
+
30
+ .#{$prefix}input::placeholder {
31
+ color: #a8abb2;
32
+ }
33
+
34
+ .#{$prefix}input--small {
35
+ height: 28px;
36
+ padding: 0 9px;
37
+ font-size: 12px;
38
+ }
39
+
40
+ .#{$prefix}input--large {
41
+ height: 36px;
42
+ padding: 0 13px;
43
+ font-size: 14px;
44
+ }
45
+
46
+ .#{$prefix}input:disabled,
47
+ .#{$prefix}input--disabled {
48
+ border-color: #e4e7ed;
49
+ background: #f5f7fa;
50
+ color: #c0c4cc;
51
+ cursor: not-allowed;
52
+ }
53
+
54
+ .#{$prefix}input--readonly {
55
+ background: #fafafa;
56
+ cursor: default;
57
+ }
package/src/select.scss CHANGED
@@ -186,33 +186,3 @@ $prefix: "ew-" !default;
186
186
  padding: 8px 12px;
187
187
  font-size: 14px;
188
188
  }
189
-
190
- // 文字被截断时的悬浮提示
191
- .#{$prefix}select__tooltip {
192
- position: fixed;
193
- z-index: 3000;
194
- max-width: 240px;
195
- padding: 4px 8px;
196
- border-radius: 4px;
197
- background: rgba(0, 0, 0, 0.78);
198
- color: #fff;
199
- font-family: inherit;
200
- font-size: 12px;
201
- line-height: 1.4;
202
- white-space: normal;
203
- word-break: break-word;
204
- pointer-events: none;
205
- opacity: 0;
206
- transform: translateY(-100%);
207
- transition: opacity 0.15s;
208
- box-sizing: border-box;
209
- }
210
-
211
- .#{$prefix}select__tooltip--visible {
212
- opacity: 1;
213
- }
214
-
215
- // 上方空间不足时展示在锚点下方
216
- .#{$prefix}select__tooltip--bottom {
217
- transform: none;
218
- }
@@ -0,0 +1,98 @@
1
+ @import './variable.scss';
2
+ // 类名前缀,可通过 @use ... with ($prefix: "my-") 自定义,需与 JS 侧 prefix 选项保持一致
3
+ $prefix: "ew-" !default;
4
+
5
+ // 悬浮提示(供 Select / Checkbox / Gradient 等复用,能力对齐 el-tooltip)
6
+ .#{$prefix}tooltip {
7
+ position: fixed;
8
+ z-index: 3000;
9
+ box-sizing: border-box;
10
+ max-width: var(--ew-tooltip-max-width, none);
11
+ padding: 5px 10px;
12
+ border-radius: 4px;
13
+ font-family: inherit;
14
+ font-size: 12px;
15
+ line-height: 1.4;
16
+ text-align: left;
17
+ word-break: break-word;
18
+ pointer-events: none;
19
+ opacity: 0;
20
+ visibility: hidden;
21
+ transition: opacity 0.2s ease, visibility 0.2s ease;
22
+ }
23
+
24
+ // 主题:dark(默认)
25
+ .#{$prefix}tooltip--dark {
26
+ --ew-tooltip-bg: #303133;
27
+ --ew-tooltip-color: #fff;
28
+ --ew-tooltip-border-color: transparent;
29
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
30
+ }
31
+
32
+ // 主题:light
33
+ .#{$prefix}tooltip--light {
34
+ --ew-tooltip-bg: #fff;
35
+ --ew-tooltip-color: #303133;
36
+ --ew-tooltip-border-color: #e4e7ed;
37
+ --ew-tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
38
+ }
39
+
40
+ .#{$prefix}tooltip--dark,
41
+ .#{$prefix}tooltip--light {
42
+ background: var(--ew-tooltip-bg);
43
+ color: var(--ew-tooltip-color);
44
+ border: 1px solid var(--ew-tooltip-border-color);
45
+ box-shadow: var(--ew-tooltip-shadow);
46
+ }
47
+
48
+ .#{$prefix}tooltip--visible {
49
+ opacity: 1;
50
+ visibility: visible;
51
+ }
52
+
53
+ // enterable:允许鼠标移入浮层内容
54
+ .#{$prefix}tooltip--enterable {
55
+ pointer-events: auto;
56
+ }
57
+
58
+ .#{$prefix}tooltip__content {
59
+ display: block;
60
+ }
61
+
62
+ // 箭头:旋转方块,只给朝向视口外侧的两条边描边,内侧与浮层背景重合
63
+ .#{$prefix}tooltip__arrow {
64
+ position: absolute;
65
+ width: 8px;
66
+ height: 8px;
67
+ box-sizing: border-box;
68
+ background: inherit;
69
+ border: 1px solid transparent;
70
+ border-color: transparent;
71
+ transform: rotate(45deg);
72
+ pointer-events: none;
73
+ z-index: -1;
74
+ }
75
+
76
+ // 浮层在上方,箭头朝下:可见边为原始 right + bottom
77
+ .#{$prefix}tooltip[data-placement^="top"] .#{$prefix}tooltip__arrow {
78
+ border-right-color: var(--ew-tooltip-border-color);
79
+ border-bottom-color: var(--ew-tooltip-border-color);
80
+ }
81
+
82
+ // 浮层在下方,箭头朝上:可见边为原始 left + top
83
+ .#{$prefix}tooltip[data-placement^="bottom"] .#{$prefix}tooltip__arrow {
84
+ border-left-color: var(--ew-tooltip-border-color);
85
+ border-top-color: var(--ew-tooltip-border-color);
86
+ }
87
+
88
+ // 浮层在左侧,箭头朝右:可见边为原始 top + right
89
+ .#{$prefix}tooltip[data-placement^="left"] .#{$prefix}tooltip__arrow {
90
+ border-top-color: var(--ew-tooltip-border-color);
91
+ border-right-color: var(--ew-tooltip-border-color);
92
+ }
93
+
94
+ // 浮层在右侧,箭头朝左:可见边为原始 left + bottom
95
+ .#{$prefix}tooltip[data-placement^="right"] .#{$prefix}tooltip__arrow {
96
+ border-left-color: var(--ew-tooltip-border-color);
97
+ border-bottom-color: var(--ew-tooltip-border-color);
98
+ }