@qsxy/element-plus-react 1.0.1 → 1.0.2

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.
Files changed (66) hide show
  1. package/dist/Calendar/Calendar.js +12 -3
  2. package/dist/Calendar/Footer.js +4 -2
  3. package/dist/Calendar/QuarterPanel.d.ts +4 -0
  4. package/dist/Calendar/QuarterPanel.js +109 -0
  5. package/dist/Calendar/WeekPanel.js +1 -1
  6. package/dist/Calendar/typings.d.ts +1 -1
  7. package/dist/Card/Card.js +9 -4
  8. package/dist/Card/typings.d.ts +1 -1
  9. package/dist/Cascader/Cascader.js +1 -1
  10. package/dist/DatePicker/DatePicker.js +38 -12
  11. package/dist/DatePicker/DateRangePicker.js +27 -9
  12. package/dist/DatePicker/main.js +1 -1
  13. package/dist/DatePicker/typings.d.ts +1 -1
  14. package/dist/DateTimePicker/DateTimePicker.js +2 -2
  15. package/dist/Input/Input.1.d.ts +16 -0
  16. package/dist/Input/Input.1.js +376 -0
  17. package/dist/Input/Input.js +137 -121
  18. package/dist/Input/InputRange.js +1 -1
  19. package/dist/Input/TextArea.js +87 -12
  20. package/dist/Input/typings.d.ts +15 -5
  21. package/dist/Input/useComposition.d.ts +23 -0
  22. package/dist/Input/useComposition.js +63 -0
  23. package/dist/Input/utils.d.ts +6 -0
  24. package/dist/Input/utils.js +91 -0
  25. package/dist/InputNumber/InputNumber.js +1 -1
  26. package/dist/InputNumber/typings.d.ts +1 -1
  27. package/dist/Select/Option.js +30 -14
  28. package/dist/Select/SelectContext.d.ts +3 -4
  29. package/dist/Select/SelectCore.d.ts +2 -2
  30. package/dist/Select/SelectCore.js +164 -447
  31. package/dist/Select/SelectDropdown.js +67 -145
  32. package/dist/Select/typings.d.ts +47 -21
  33. package/dist/Select/useSelect.d.ts +125 -0
  34. package/dist/Select/useSelect.js +516 -0
  35. package/dist/Table/util.js +6 -5
  36. package/dist/Tag/Tag.js +22 -17
  37. package/dist/TimePicker/TimePicker.js +2 -2
  38. package/dist/TreeSelect/TreeSelect.js +2 -2
  39. package/dist/Util/aria.d.ts +25 -0
  40. package/dist/Util/aria.js +118 -0
  41. package/dist/hooks/useCalcInputWidth.d.ts +8 -0
  42. package/dist/hooks/useCalcInputWidth.js +30 -0
  43. package/dist/hooks/useComposition.d.ts +16 -0
  44. package/dist/hooks/useComposition.js +39 -0
  45. package/dist/hooks/useCursor.d.ts +2 -0
  46. package/dist/hooks/useCursor.js +52 -0
  47. package/dist/hooks/useFocusController.d.ts +27 -0
  48. package/dist/hooks/useFocusController.js +72 -0
  49. package/dist/index.css +1 -1
  50. package/dist/locale/en.d.ts +15 -0
  51. package/dist/locale/en.js +15 -0
  52. package/dist/locale/zhCn.d.ts +15 -0
  53. package/dist/locale/zhCn.js +15 -0
  54. package/package.json +1 -1
  55. package/theme-chalk/calendar/index.scss +1 -0
  56. package/theme-chalk/calendar/quarter-table.scss +78 -0
  57. package/theme-chalk/common/var.scss +1 -1
  58. package/theme-chalk/input/input.scss +424 -578
  59. package/theme-chalk/input/input.scss--bak +578 -0
  60. package/theme-chalk/select/index.scss +272 -247
  61. package/theme-chalk/select/index.scss--bak +247 -0
  62. package/theme-chalk/select/option-group.scss +2 -2
  63. package/theme-chalk/select/option.scss +2 -2
  64. package/theme-chalk/select/select-dropdown.scss +2 -2
  65. package/theme-chalk/tag.scss +181 -203
  66. package/theme-chalk/tag.scss--bak +203 -0
@@ -0,0 +1,247 @@
1
+ @use '../mixins/config' as *;
2
+
3
+ .#{$namespace}-select {
4
+ --#{$namespace}-select-border-color-hover: var(--#{$namespace}-border-color-hover);
5
+ --#{$namespace}-select-disabled-border: var(--#{$namespace}-disabled-border-color);
6
+ --#{$namespace}-select-close-hover-color: var(--#{$namespace}-text-color-secondary);
7
+ --#{$namespace}-select-input-color: var(--#{$namespace}-text-color-placeholder);
8
+ --#{$namespace}-select-multiple-input-color: var(--#{$namespace}-text-color-regular);
9
+ --#{$namespace}-select-input-focus-border-color: var(--#{$namespace}-color-primary);
10
+ }
11
+
12
+ .#{$namespace}-select {
13
+ display: inline-block;
14
+ position: relative;
15
+ // height: 32px;
16
+ // line-height: 32px;
17
+ font-size: 14px;
18
+ zoom: 1;
19
+ *display: inline;
20
+ width: 100%;
21
+
22
+ .#{$namespace}-select__trigger {
23
+ cursor: pointer;
24
+ }
25
+
26
+ .#{$namespace}-input__inner {
27
+ cursor: pointer;
28
+ display: inline-flex;
29
+ }
30
+
31
+ &.is-disabled {
32
+ .#{$namespace}-input__inner {
33
+ cursor: not-allowed;
34
+ }
35
+
36
+ .#{$namespace}-select__tags .#{$namespace}-tag--info {
37
+ background-color: var(--#{$namespace}-fill-color-darker);
38
+ }
39
+ }
40
+
41
+ .#{$namespace}-select__tags {
42
+ & > span {
43
+ display: inline-block;
44
+ }
45
+
46
+ .#{$namespace}-tag {
47
+ box-sizing: border-box;
48
+ border-color: transparent;
49
+ margin: 2px 6px 2px 0;
50
+ }
51
+ }
52
+
53
+ .#{$namespace}-select-tags-wrapper.has-prefix {
54
+ margin-left: 6px;
55
+ }
56
+ }
57
+
58
+ // .#{$namespace}-select--large {
59
+ // height: var(--#{$namespace}-component-size-large);
60
+ // line-height: var(--#{$namespace}-component-size-large);
61
+ // }
62
+
63
+ // .#{$namespace}-select--small {
64
+ // height: var(--#{$namespace}-component-size-small);
65
+ // line-height: var(--#{$namespace}-component-size-small);
66
+ // }
67
+
68
+ .#{$namespace}-select__tags {
69
+ position: absolute;
70
+ line-height: normal;
71
+ white-space: normal;
72
+ z-index: 1;
73
+ top: 50%;
74
+ transform: translateY(-50%);
75
+ display: flex;
76
+ align-items: center;
77
+ flex-wrap: wrap;
78
+ margin-right: 30px;
79
+ }
80
+
81
+ .#{$namespace}-select .#{$namespace}-select__tags .#{$namespace}-tag--info {
82
+ background-color: var(--#{$namespace}-fill-color);
83
+ }
84
+
85
+ .#{$namespace}-select-dorpdown {
86
+ .#{$namespace}-select-dropdown__wrap {
87
+ max-height: 274px;
88
+ }
89
+
90
+ .#{$namespace}-select-dropdown__list {
91
+ // box-sizing: border-box;
92
+ // width: 100%;
93
+ // border-radius: 4px;
94
+ // background-clip: padding-box;
95
+
96
+ position: relative;
97
+ // overflow-x: hidden;
98
+ // overflow-y: auto;
99
+ margin: 4px 0;
100
+ padding: 0;
101
+ max-height: 240px;
102
+ -webkit-overflow-scrolling: touch;
103
+ font-size: 14px;
104
+
105
+ .#{$namespace}-select-dropdown__item {
106
+ display: list-item;
107
+ cursor: pointer;
108
+ margin: 0;
109
+ padding: 0 15px;
110
+ list-style: none;
111
+ -webkit-touch-callout: none;
112
+ position: relative;
113
+ white-space: nowrap;
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ color: var(--#{$namespace}-text-color-regular);
117
+ height: 34px;
118
+ line-height: 34px;
119
+ box-sizing: border-box;
120
+ cursor: pointer;
121
+
122
+ &.selected {
123
+ color: var(--#{$namespace}-color-primary);
124
+ }
125
+
126
+ &.hover {
127
+ background-color: var(--#{$namespace}-fill-color-light);
128
+ }
129
+
130
+ &.is-disabled {
131
+ color: var(--#{$namespace}-text-color-placeholder);
132
+ cursor: not-allowed;
133
+
134
+ &.hover {
135
+ background-color: transparent;
136
+ color: var(--#{$namespace}-text-color-placeholder);
137
+ }
138
+ }
139
+
140
+ &.no-data,
141
+ &.loading {
142
+ text-align: center;
143
+ margin: -4px 0;
144
+ }
145
+ }
146
+ }
147
+
148
+ .#{$namespace}-select__search {
149
+ position: relative;
150
+ z-index: 1010;
151
+ margin: 0;
152
+ padding: 3px 4px;
153
+ white-space: nowrap;
154
+
155
+ .#{$namespace}-clear {
156
+ cursor: pointer;
157
+ pointer-events: unset;
158
+ }
159
+ }
160
+
161
+ &.is-multiple .#{$namespace}-select-dropdown__item.selected:after {
162
+ content: '';
163
+ position: absolute;
164
+ top: 50%;
165
+ right: 20px;
166
+ border-top: none;
167
+ border-right: none;
168
+ background-repeat: no-repeat;
169
+ background-position: center;
170
+ background: var(--#{$namespace}-bg-color-primary, var(--#{$namespace}-color-primary));
171
+ mask: url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E")
172
+ no-repeat;
173
+ mask-size: 100% 100%;
174
+ -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E")
175
+ no-repeat;
176
+ -webkit-mask-size: 100% 100%;
177
+ transform: translateY(-50%);
178
+ width: 16px;
179
+ height: 16px;
180
+ }
181
+ }
182
+
183
+ .#{$namespace}-select-group {
184
+ margin: 0;
185
+ padding: 0;
186
+
187
+ & .#{$namespace}-select-dropdown__item {
188
+ padding-left: 20px;
189
+ }
190
+ }
191
+
192
+ .#{$namespace}-select-group__wrap {
193
+ position: relative;
194
+ list-style: none;
195
+ margin: 0;
196
+ padding: 0;
197
+
198
+ &:not(:last-of-type) {
199
+ padding-bottom: 24px;
200
+
201
+ &::after {
202
+ content: '';
203
+ position: absolute;
204
+ display: block;
205
+ left: 20px;
206
+ right: 20px;
207
+ bottom: 12px;
208
+ height: 1px;
209
+ background: var(--#{$namespace}-border-color-light);
210
+ }
211
+ }
212
+ }
213
+
214
+ .#{$namespace}-select-group__split {
215
+ .#{$namespace}-select-group__split-dash {
216
+ position: absolute;
217
+ left: 20px;
218
+ right: 20px;
219
+ height: 1px;
220
+ background: #e4e7ed;
221
+ }
222
+ }
223
+
224
+ .#{$namespace}-select-group__title {
225
+ padding-left: 20px;
226
+ font-size: 12px;
227
+ color: var(--#{$namespace}-color-info);
228
+ line-height: 30px;
229
+ }
230
+
231
+ .#{$namespace}-select__input {
232
+ border: none;
233
+ outline: none;
234
+ padding: 0;
235
+ margin-left: 15px;
236
+ color: var(--#{$namespace}-select-multiple-input-color);
237
+ font-size: 14px;
238
+ appearance: none;
239
+ height: 28px;
240
+ background-color: transparent;
241
+ }
242
+
243
+ .#{$namespace}-select__tooltip {
244
+ .#{$namespace}-tag {
245
+ margin: 5px;
246
+ }
247
+ }
@@ -1,7 +1,7 @@
1
1
  @use 'sass:map';
2
2
 
3
- @use '../../Common/styles/mixins/mixins' as *;
4
- @use '../../Common/styles/common/var' as *;
3
+ @use '../mixins/mixins' as *;
4
+ @use '../common/var' as *;
5
5
 
6
6
  @include b(select-group) {
7
7
  $gap: 20px;
@@ -1,7 +1,7 @@
1
1
  @use 'sass:map';
2
2
 
3
- @use '../../Common/styles/mixins/mixins' as *;
4
- @use '../../Common/styles/common/var' as *;
3
+ @use '../mixins/mixins' as *;
4
+ @use '../common/var' as *;
5
5
 
6
6
  $checked-icon: "data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E";
7
7
 
@@ -1,7 +1,7 @@
1
1
  @use 'sass:map';
2
2
 
3
- @use '../../Common/styles/mixins/mixins' as *;
4
- @use '../../Common/styles/common/var' as *;
3
+ @use '../mixins/mixins' as *;
4
+ @use '../common/var' as *;
5
5
 
6
6
  @include b(select-dropdown) {
7
7
  z-index: calc(#{getCssVar('index-top')} + 1);
@@ -1,203 +1,181 @@
1
- @use 'sass:map';
2
- @use './mixins/config' as *;
3
-
4
- @function joinVarName($list) {
5
- $name: '';
6
- @each $item in $list {
7
- @if $item != '' {
8
- $name: $name + '-' + $item;
9
- }
10
- }
11
- @return $name;
12
- }
13
-
14
- $tag-border-width: 1px;
15
-
16
- $tag-height: () !default;
17
- $tag-height: map.merge(
18
- (
19
- 'large': 32px,
20
- 'default': 24px,
21
- 'small': 20px,
22
- ),
23
- $tag-height
24
- );
25
-
26
- $tag-padding: () !default;
27
- $tag-padding: map.merge(
28
- (
29
- 'large': 12px,
30
- 'default': 10px,
31
- 'small': 8px,
32
- ),
33
- $tag-padding
34
- );
35
-
36
- $tag-icon-size: () !default;
37
- $tag-icon-size: map.merge(
38
- (
39
- 'large': 16px,
40
- 'default': 14px,
41
- 'small': 12px,
42
- ),
43
- $tag-icon-size
44
- );
45
-
46
- $tag-icon-span-gap: () !default;
47
- $tag-icon-span-gap: map.merge(
48
- (
49
- 'large': 8px,
50
- 'default': 6px,
51
- 'small': 4px,
52
- ),
53
- $tag-icon-span-gap
54
- );
55
-
56
- @mixin genTheme($backgroundColorWeight, $borderColorWeight, $hoverColorWeight) {
57
- --#{$namespace}-tag-bg-color: var(--#{$namespace}-color-primary#{joinVarName($backgroundColorWeight)});
58
- --#{$namespace}-tag-border-color: var(--#{$namespace}-color-primary#{joinVarName($borderColorWeight)});
59
- --#{$namespace}-tag-hover-color: var(--#{$namespace}-color-primary#{joinVarName($hoverColorWeight)});
60
-
61
- @each $type in success, warning, error, danger, info {
62
- &.#{$namespace}-tag--#{$type} {
63
- --#{$namespace}-tag-bg-color: var(--#{$namespace}-color#{joinVarName(($type, $backgroundColorWeight))});
64
- --#{$namespace}-tag-border-color: var(--#{$namespace}-color#{joinVarName(($type, $borderColorWeight))});
65
- --#{$namespace}-tag-hover-color: var(--#{$namespace}-color#{joinVarName(($type, $hoverColorWeight))});
66
- }
67
- }
68
- }
69
-
70
- .#{$namespace}-tag {
71
- --#{$namespace}-tag-font-size: 12px;
72
- --#{$namespace}-tag-border-radius: 4px;
73
- --#{$namespace}-tag-border-radius-rounded: 9999px;
74
- }
75
-
76
- .#{$namespace}-tag {
77
- @include genTheme('light-9', 'light-8', '');
78
- --#{$namespace}-tag-text-color: var(--#{$namespace}-color-primary);
79
- @each $type in success, warning, error, danger, info {
80
- &.#{$namespace}-tag--#{$type} {
81
- --#{$namespace}-tag-text-color: var(--#{$namespace}-color-#{$type});
82
- }
83
- }
84
-
85
- &.is-hit {
86
- border-color: var(--#{$namespace}-color-primary);
87
- }
88
-
89
- &.is-round {
90
- border-radius: var(--#{$namespace}-tag-border-radius-rounded);
91
- }
92
-
93
- .#{$namespace}-tag__close {
94
- color: var(--#{$namespace}-tag-text-color);
95
- &:hover {
96
- color: var(--#{$namespace}-color-white);
97
- background-color: var(--#{$namespace}-tag-hover-color);
98
- }
99
- }
100
-
101
- background-color: var(--#{$namespace}-tag-bg-color);
102
- border-color: var(--#{$namespace}-tag-border-color);
103
- color: var(--#{$namespace}-tag-text-color);
104
-
105
- display: inline-flex;
106
- justify-content: center;
107
- align-items: center;
108
-
109
- height: map.get($tag-height, 'default');
110
- padding: 0 map.get($tag-padding, 'default') - 1px;
111
- font-size: 12px;
112
- line-height: 1;
113
- border-width: $tag-border-width;
114
- border-style: solid;
115
- border-radius: var(--#{$namespace}-tag-border-radius);
116
- box-sizing: border-box;
117
- white-space: nowrap;
118
- --#{$namespace}-icon-size: 14px;
119
-
120
- $svg-margin-size: 1px;
121
- .#{$namespace}-icon {
122
- border-radius: 50%;
123
- cursor: pointer;
124
-
125
- font-size: calc(#{var(--#{$namespace}-icon-size)} - #{$svg-margin-size * 2});
126
- height: var(--#{$namespace}-icon-size);
127
- width: var(--#{$namespace}-icon-size);
128
-
129
- text-align: center;
130
- position: relative;
131
- line-height: var(--#{$namespace}-icon-size);
132
- vertical-align: middle;
133
- right: -5px;
134
-
135
- svg {
136
- margin: 1px;
137
- }
138
- }
139
-
140
- .#{$namespace}-tag__close {
141
- margin-left: map.get($tag-icon-span-gap, 'default');
142
- }
143
-
144
- &.is-closable {
145
- padding-right: map.get($tag-icon-span-gap, 'default') - 1px;
146
- }
147
-
148
- @each $type in success, warning, error, danger, info {
149
- &.#{$namespace}-tag--#{$type} {
150
- &.is-hit {
151
- border-color: var(--#{$namespace}-color-#{$type});
152
- }
153
- }
154
- }
155
- }
156
-
157
- .#{$namespace}-tag--dark {
158
- @include genTheme('', '', 'light-3');
159
- --#{$namespace}-tag-text-color: var(--#{$namespace}-color-white);
160
-
161
- @each $type in success, warning, error, danger, info {
162
- &.#{$namespace}-tag--#{$type} {
163
- --#{$namespace}-tag-text-color: var(--#{$namespace}-color-white);
164
- }
165
- }
166
- }
167
-
168
- .#{$namespace}-tag--plain {
169
- --#{$namespace}-tag-bg-color: var(--#{$namespace}-fill-color-blank);
170
- --#{$namespace}-tag-border-color: var(--#{$namespace}-color-primary-light-5);
171
- --#{$namespace}-tag-hover-color: var(--#{$namespace}-color-primary);
172
-
173
- @each $type in success, warning, error, danger, info {
174
- &.#{$namespace}-tag--#{$type} {
175
- --#{$namespace}-tag-bg-color: var(--#{$namespace}-fill-color-blank);
176
- --#{$namespace}-tag-border-color: var(--#{$namespace}-color#{joinVarName(($type, 'light-5'))});
177
- --#{$namespace}-tag-hover-color: var(--#{$namespace}-color#{joinVarName(($type, 'light-5'))});
178
- }
179
- }
180
- }
181
-
182
- @each $size in (large, default, small) {
183
- .#{$namespace}-tag--#{$size} {
184
- padding: 0 map.get($tag-padding, $size) - $tag-border-width;
185
- height: map.get($tag-height, $size);
186
-
187
- --#{$namespace}-icon-size: #{map.get($tag-icon-size, $size)};
188
-
189
- .#{$namespace}-tag__close {
190
- margin-left: map.get($tag-icon-span-gap, $size);
191
- }
192
-
193
- &.is-closable {
194
- padding-right: map.get($tag-icon-span-gap, $size) - 1px;
195
- }
196
- }
197
- }
198
-
199
- .#{$namespace}-tag--small {
200
- .#{$namespace}-icon-close {
201
- transform: scale(0.8);
202
- }
203
- }
1
+ @use 'sass:map';
2
+
3
+ @use 'mixins/mixins' as *;
4
+ @use 'mixins/var' as *;
5
+ @use 'common/var' as *;
6
+
7
+ @include b(tag) {
8
+ @include set-component-css-var('tag', $tag);
9
+ }
10
+
11
+ $tag-border-width: 1px;
12
+
13
+ $tag-icon-span-gap: () !default;
14
+ $tag-icon-span-gap: map.merge(
15
+ (
16
+ 'large': 8px,
17
+ 'default': 6px,
18
+ 'small': 4px,
19
+ ),
20
+ $tag-icon-span-gap
21
+ );
22
+
23
+ @function returnVarList($var, $type: 'primary') {
24
+ $list: ('fill-color', 'blank');
25
+
26
+ @if $var !=false {
27
+ $list: ('color', $type, $var);
28
+ }
29
+
30
+ @return $list;
31
+ }
32
+
33
+ // false mean --el-color-white
34
+ @mixin genTheme($backgroundColorWeight, $borderColorWeight, $hoverColorWeight) {
35
+ @include css-var-from-global(
36
+ ('tag', 'bg-color'),
37
+ returnVarList($backgroundColorWeight)
38
+ );
39
+ @include css-var-from-global(
40
+ ('tag', 'border-color'),
41
+ returnVarList($borderColorWeight)
42
+ );
43
+ @include css-var-from-global(
44
+ ('tag', 'hover-color'),
45
+ returnVarList($hoverColorWeight)
46
+ );
47
+
48
+ @each $type in $types {
49
+ &.#{bem('tag', '', $type)} {
50
+ @include css-var-from-global(
51
+ ('tag', 'bg-color'),
52
+ returnVarList($backgroundColorWeight, $type)
53
+ );
54
+ @include css-var-from-global(
55
+ ('tag', 'border-color'),
56
+ returnVarList($borderColorWeight, $type)
57
+ );
58
+ @include css-var-from-global(
59
+ ('tag', 'hover-color'),
60
+ returnVarList($hoverColorWeight, $type)
61
+ );
62
+ }
63
+ }
64
+ }
65
+
66
+ @include b(tag) {
67
+ background-color: getCssVar('tag-bg-color');
68
+ border-color: getCssVar('tag-border-color');
69
+ color: getCssVar('tag-text-color');
70
+
71
+ display: inline-flex;
72
+ justify-content: center;
73
+ align-items: center;
74
+ vertical-align: middle;
75
+ height: map.get($tag-height, 'default');
76
+ padding: 0 map.get($tag-padding, 'default') - $border-width;
77
+
78
+ font-size: getCssVar('tag-font-size');
79
+ line-height: 1;
80
+ border-width: $tag-border-width;
81
+ border-style: solid;
82
+ border-radius: getCssVar('tag-border-radius');
83
+ box-sizing: border-box;
84
+ white-space: nowrap;
85
+
86
+ @include set-css-var-value('icon-size', 14px);
87
+ @include genTheme('light-9', 'light-8', '');
88
+
89
+ @include when(hit) {
90
+ border-color: getCssVar('color', 'primary');
91
+ }
92
+
93
+ @include when(round) {
94
+ border-radius: getCssVar('tag', 'border-radius-rounded');
95
+ }
96
+
97
+ .#{$namespace}-tag__close {
98
+ flex-shrink: 0;
99
+ color: getCssVar('tag', 'text-color');
100
+
101
+ &:hover {
102
+ color: getCssVar('color-white');
103
+ background-color: getCssVar('tag-hover-color');
104
+ }
105
+ }
106
+
107
+ @each $type in $types {
108
+ &.#{bem('tag', '', $type)} {
109
+ @include css-var-from-global(('tag', 'text-color'), ('color', $type));
110
+ }
111
+ }
112
+
113
+ $svg-margin-size: 1px;
114
+
115
+ .#{$namespace}-icon {
116
+ border-radius: 50%;
117
+ cursor: pointer;
118
+
119
+ font-size: calc(#{getCssVar('icon-size')} - #{$svg-margin-size * 2});
120
+ height: getCssVar('icon-size');
121
+ width: getCssVar('icon-size');
122
+ }
123
+
124
+ .#{$namespace}-tag__close {
125
+ margin-left: map.get($tag-icon-span-gap, 'default');
126
+ }
127
+
128
+ @include m(dark) {
129
+ @include css-var-from-global(('tag', 'text-color'), ('color', 'white'));
130
+ @include genTheme('', '', 'light-3');
131
+
132
+ @each $type in $types {
133
+ &.#{bem('tag', '', $type)} {
134
+ @include css-var-from-global(('tag', 'text-color'), ('color', 'white'));
135
+ }
136
+ }
137
+ }
138
+
139
+ @include m(plain) {
140
+ @include css-var-from-global(('tag', 'bg-color'), ('fill-color', 'blank'));
141
+ @include genTheme(false, 'light-5', '');
142
+ }
143
+
144
+ &.is-closable {
145
+ padding-right: map.get($tag-icon-span-gap, 'default') - $border-width;
146
+ }
147
+
148
+ @each $size in (large, small) {
149
+ @include m($size) {
150
+ padding: 0 map.get($tag-padding, $size) - $tag-border-width;
151
+ height: map.get($tag-height, $size);
152
+
153
+ @include set-css-var-value(
154
+ 'icon-size',
155
+ #{map.get($tag-icon-size, $size)}
156
+ );
157
+
158
+ .#{$namespace}-tag__close {
159
+ margin-left: map.get($tag-icon-span-gap, $size);
160
+ }
161
+
162
+ &.is-closable {
163
+ padding-right: map.get($tag-icon-span-gap, $size) - $border-width;
164
+ }
165
+ }
166
+ }
167
+
168
+ @include m(small) {
169
+ .#{$namespace}-icon-close {
170
+ transform: scale(0.8);
171
+ }
172
+ }
173
+
174
+ @each $type in $types {
175
+ &.#{bem('tag', '', $type)} {
176
+ @include when(hit) {
177
+ border-color: getCssVar('color', $type);
178
+ }
179
+ }
180
+ }
181
+ }