@qsxy/element-plus-react 1.0.2 → 1.0.3

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 (216) hide show
  1. package/dist/Alert/Alert.d.ts +7 -0
  2. package/dist/Alert/Alert.js +98 -0
  3. package/dist/Alert/index.d.ts +2 -0
  4. package/dist/Alert/index.js +1 -0
  5. package/dist/Alert/typings.d.ts +45 -0
  6. package/dist/Alert/typings.js +1 -0
  7. package/dist/Card/Card.js +5 -3
  8. package/dist/Cascader/useCascader.d.ts +0 -14
  9. package/dist/Cascader/useCascader.js +33 -32
  10. package/dist/Checkbox/Checkbox.js +3 -2
  11. package/dist/ConfigProvider/ConfigProvider.js +2 -24
  12. package/dist/ConfigProvider/ConfigProviderContext.js +1 -1
  13. package/dist/ConfigProvider/typings.d.ts +1 -1
  14. package/dist/Container/Main.d.ts +1 -1
  15. package/dist/Container/typings.d.ts +1 -1
  16. package/dist/Dialog/Dialog.js +5 -12
  17. package/dist/Input/Input.js +68 -43
  18. package/dist/Input/TextArea.js +1 -1
  19. package/dist/Input/typings.d.ts +42 -1
  20. package/dist/Input/utils.d.ts +1 -0
  21. package/dist/Input/utils.js +5 -1
  22. package/dist/InputNumber/InputNumber.js +351 -141
  23. package/dist/InputNumber/typings.d.ts +15 -1
  24. package/dist/Loading/Loading.js +5 -2
  25. package/dist/Menu/Menu.js +25 -1
  26. package/dist/Menu/MenuItem.js +4 -2
  27. package/dist/Menu/SubMenu.js +2 -2
  28. package/dist/Menu/SubMenuCollapseTransition.js +14 -9
  29. package/dist/Menu/typings.d.ts +2 -1
  30. package/dist/Message/Message.js +51 -23
  31. package/dist/Message/index.js +8 -10
  32. package/dist/Message/typings.d.ts +8 -5
  33. package/dist/MessageBox/MessageBox.js +52 -30
  34. package/dist/MessageBox/index.d.ts +2 -1
  35. package/dist/MessageBox/index.js +4 -2
  36. package/dist/MessageBox/typings.d.ts +3 -0
  37. package/dist/Notification/Notification.js +26 -19
  38. package/dist/Select/SelectContext.d.ts +2 -1
  39. package/dist/Select/SelectContext.js +2 -1
  40. package/dist/Select/SelectCore.js +13 -7
  41. package/dist/Select/SelectDropdown.js +23 -15
  42. package/dist/Select/index.d.ts +1 -1
  43. package/dist/Select/typings.d.ts +13 -9
  44. package/dist/Select/useSelect.d.ts +13 -10
  45. package/dist/Select/useSelect.js +34 -26
  46. package/dist/Space/Space.d.ts +4 -0
  47. package/dist/Space/Space.js +128 -0
  48. package/dist/Space/SpaceItem.d.ts +7 -0
  49. package/dist/Space/SpaceItem.js +14 -0
  50. package/dist/Space/index.d.ts +3 -0
  51. package/dist/Space/index.js +2 -0
  52. package/dist/Space/typings.d.ts +26 -0
  53. package/dist/Space/typings.js +1 -0
  54. package/dist/Space/useSpace.d.ts +7 -0
  55. package/dist/Space/useSpace.js +104 -0
  56. package/dist/Statistic/Statistic.d.ts +4 -0
  57. package/dist/Statistic/Statistic.js +92 -0
  58. package/dist/Statistic/index.d.ts +2 -0
  59. package/dist/Statistic/index.js +1 -0
  60. package/dist/Statistic/typings.d.ts +28 -0
  61. package/dist/Statistic/typings.js +1 -0
  62. package/dist/Switch/Switch.js +2 -2
  63. package/dist/Table/Table.js +3 -0
  64. package/dist/Table/typings.d.ts +2 -0
  65. package/dist/Tag/typings.d.ts +1 -1
  66. package/dist/Text/Text.d.ts +4 -0
  67. package/dist/Text/Text.js +84 -0
  68. package/dist/Text/index.d.ts +2 -0
  69. package/dist/Text/index.js +1 -0
  70. package/dist/Text/typings.d.ts +15 -0
  71. package/dist/Text/typings.js +1 -0
  72. package/dist/Tree/CollapseTransition.d.ts +7 -0
  73. package/dist/Tree/CollapseTransition.js +60 -0
  74. package/dist/Tree/Tree.d.ts +3 -140
  75. package/dist/Tree/Tree.js +350 -77
  76. package/dist/Tree/TreeContext.d.ts +9 -0
  77. package/dist/Tree/TreeContext.js +14 -0
  78. package/dist/Tree/TreeNode.d.ts +5 -3
  79. package/dist/Tree/TreeNode.js +321 -331
  80. package/dist/Tree/TreeNodeContent.d.ts +9 -0
  81. package/dist/Tree/TreeNodeContent.js +22 -0
  82. package/dist/Tree/index.d.ts +3 -8
  83. package/dist/Tree/index.js +1 -4
  84. package/dist/Tree/model/node.d.ts +62 -0
  85. package/dist/Tree/model/node.js +601 -0
  86. package/dist/Tree/model/tree-store.d.ts +52 -0
  87. package/dist/Tree/model/tree-store.js +510 -0
  88. package/dist/Tree/model/useDragNode.d.ts +30 -0
  89. package/dist/Tree/model/useDragNode.js +293 -0
  90. package/dist/Tree/model/useKeydown.d.ts +0 -0
  91. package/dist/Tree/model/useKeydown.js +104 -0
  92. package/dist/Tree/model/useNodeExpandEventBroadcast.d.ts +15 -0
  93. package/dist/Tree/model/useNodeExpandEventBroadcast.js +54 -0
  94. package/dist/Tree/model/util.d.ts +7 -0
  95. package/dist/Tree/model/util.js +24 -0
  96. package/dist/Tree/typings.d.ts +225 -114
  97. package/dist/TreeSelect/TreeSelect.d.ts +2 -10
  98. package/dist/TreeSelect/TreeSelect.js +90 -566
  99. package/dist/TreeSelect/TreeSelectOption.d.ts +6 -0
  100. package/dist/TreeSelect/TreeSelectOption.js +62 -0
  101. package/dist/TreeSelect/cacheOptions.d.ts +9 -0
  102. package/dist/TreeSelect/cacheOptions.js +22 -0
  103. package/dist/TreeSelect/index.d.ts +0 -1
  104. package/dist/TreeSelect/typings.d.ts +11 -63
  105. package/dist/TreeSelect/useSelect.d.ts +125 -0
  106. package/dist/TreeSelect/useSelect.js +104 -0
  107. package/dist/TreeSelect/useTree.d.ts +130 -0
  108. package/dist/TreeSelect/useTree.js +285 -0
  109. package/dist/TreeSelect/utils.d.ts +10 -0
  110. package/dist/TreeSelect/utils.js +38 -0
  111. package/dist/Upload/UploadContent.js +2 -0
  112. package/dist/Upload/ajax.js +3 -0
  113. package/dist/Upload/typings.d.ts +4 -0
  114. package/dist/Util/aria.js +12 -12
  115. package/dist/Util/base.d.ts +5 -0
  116. package/dist/Util/base.js +140 -1
  117. package/dist/config/Constants.d.ts +3 -0
  118. package/dist/config/Constants.js +8 -0
  119. package/dist/hooks/index.d.ts +1 -0
  120. package/dist/hooks/index.js +1 -0
  121. package/dist/hooks/popperPropsUtils.js +1 -1
  122. package/dist/hooks/treePropsUtils.d.ts +3 -3
  123. package/dist/hooks/treePropsUtils.js +2 -2
  124. package/dist/hooks/useConfigProvider.d.ts +27 -0
  125. package/dist/hooks/useConfigProvider.js +78 -0
  126. package/dist/hooks/useResizeObserver.js +6 -6
  127. package/dist/index.css +1 -1
  128. package/dist/index.d.ts +18 -11
  129. package/dist/index.js +11 -5
  130. package/package.json +1 -1
  131. package/theme-chalk/alert.scss +115 -0
  132. package/theme-chalk/aside.scss +8 -8
  133. package/theme-chalk/button-group.scss +80 -80
  134. package/theme-chalk/button.scss +304 -304
  135. package/theme-chalk/calendar/date-table.scss +164 -164
  136. package/theme-chalk/checkbox.scss +34 -0
  137. package/theme-chalk/color/index.scss +20 -20
  138. package/theme-chalk/common/transition.scss +142 -142
  139. package/theme-chalk/container.scss +14 -14
  140. package/theme-chalk/dark/css-vars.scss +39 -39
  141. package/theme-chalk/dark/var.scss +225 -225
  142. package/theme-chalk/date-picker.scss +12 -12
  143. package/theme-chalk/drawer.scss +1 -0
  144. package/theme-chalk/footer.scss +12 -12
  145. package/theme-chalk/header.scss +12 -12
  146. package/theme-chalk/index.scss +4 -0
  147. package/theme-chalk/input/input-range.scss +2 -1
  148. package/theme-chalk/input/input.scss +439 -424
  149. package/theme-chalk/input-number.bak +172 -0
  150. package/theme-chalk/input-number.scss +192 -172
  151. package/theme-chalk/link.scss +87 -87
  152. package/theme-chalk/main.scss +14 -14
  153. package/theme-chalk/menu.scss +353 -353
  154. package/theme-chalk/message.scss +104 -178
  155. package/theme-chalk/mixins/_button.scss +224 -224
  156. package/theme-chalk/mixins/_col.scss +33 -33
  157. package/theme-chalk/mixins/_var.scss +67 -67
  158. package/theme-chalk/mixins/config.scss +5 -5
  159. package/theme-chalk/mixins/function.scss +99 -99
  160. package/theme-chalk/mixins/mixins.scss +240 -240
  161. package/theme-chalk/mixins/utils.scss +39 -39
  162. package/theme-chalk/notification.bak +156 -0
  163. package/theme-chalk/notification.scss +109 -156
  164. package/theme-chalk/popper.scss +104 -104
  165. package/theme-chalk/radio-button.scss +169 -169
  166. package/theme-chalk/select/index.scss +278 -272
  167. package/theme-chalk/space.scss +20 -0
  168. package/theme-chalk/statistic.scss +35 -0
  169. package/theme-chalk/switch.scss +300 -300
  170. package/theme-chalk/tag.scss +181 -181
  171. package/theme-chalk/text.scss +48 -0
  172. package/theme-chalk/transition.scss +34 -4
  173. package/theme-chalk/tree-select.scss +41 -25
  174. package/theme-chalk/tree.scss +136 -0
  175. package/theme-chalk/var.scss +83 -83
  176. package/dist/Input/Input.1.d.ts +0 -16
  177. package/dist/Input/Input.1.js +0 -376
  178. package/dist/Tree/DirectoryTree.d.ts +0 -15
  179. package/dist/Tree/DirectoryTree.js +0 -183
  180. package/dist/Tree/DropIndicator.d.ts +0 -8
  181. package/dist/Tree/DropIndicator.js +0 -34
  182. package/dist/Tree/Indent.d.ts +0 -9
  183. package/dist/Tree/Indent.js +0 -25
  184. package/dist/Tree/MotionTreeNode.d.ts +0 -14
  185. package/dist/Tree/MotionTreeNode.js +0 -125
  186. package/dist/Tree/NodeList.d.ts +0 -50
  187. package/dist/Tree/NodeList.js +0 -301
  188. package/dist/Tree/RCTree.d.ts +0 -248
  189. package/dist/Tree/RCTree.js +0 -1216
  190. package/dist/Tree/contextTypes.d.ts +0 -69
  191. package/dist/Tree/contextTypes.js +0 -9
  192. package/dist/Tree/typings.tsx--bak +0 -245
  193. package/dist/Tree/useUnmount.d.ts +0 -5
  194. package/dist/Tree/useUnmount.js +0 -34
  195. package/dist/Tree/util.d.ts +0 -51
  196. package/dist/Tree/util.js +0 -303
  197. package/dist/Tree/utils/conductUtil.d.ts +0 -17
  198. package/dist/Tree/utils/conductUtil.js +0 -209
  199. package/dist/Tree/utils/dictUtil.d.ts +0 -13
  200. package/dist/Tree/utils/dictUtil.js +0 -75
  201. package/dist/Tree/utils/diffUtil.d.ts +0 -7
  202. package/dist/Tree/utils/diffUtil.js +0 -48
  203. package/dist/Tree/utils/dropIndicator.d.ts +0 -11
  204. package/dist/Tree/utils/dropIndicator.js +0 -36
  205. package/dist/Tree/utils/iconUtil.d.ts +0 -5
  206. package/dist/Tree/utils/iconUtil.js +0 -62
  207. package/dist/Tree/utils/keyUtil.d.ts +0 -2
  208. package/dist/Tree/utils/keyUtil.js +0 -3
  209. package/dist/Tree/utils/motion.d.ts +0 -10
  210. package/dist/Tree/utils/motion.js +0 -54
  211. package/dist/Tree/utils/pickAttrs.d.ts +0 -11
  212. package/dist/Tree/utils/pickAttrs.js +0 -51
  213. package/dist/Tree/utils/treeUtil.d.ts +0 -86
  214. package/dist/Tree/utils/treeUtil.js +0 -364
  215. package/dist/TreeSelect/Utils.d.ts +0 -3
  216. package/dist/TreeSelect/Utils.js +0 -20
@@ -1,304 +1,304 @@
1
- @use 'sass:map';
2
-
3
- @use 'common/var' as *;
4
- @use 'mixins/function' as *;
5
- @use 'mixins/button' as *;
6
- @use 'mixins/mixins' as *;
7
- @use 'mixins/utils' as *;
8
- @use 'mixins/var' as *;
9
-
10
- $button-icon-span-gap: () !default;
11
- $button-icon-span-gap: map.merge(
12
- (
13
- 'large': 8px,
14
- 'default': 6px,
15
- 'small': 4px,
16
- ),
17
- $button-icon-span-gap
18
- );
19
-
20
- @include b(button) {
21
- @include set-component-css-var('button', $button);
22
- }
23
-
24
- @include b(button) {
25
- display: inline-flex;
26
- justify-content: center;
27
- align-items: center;
28
-
29
- line-height: 1;
30
- // min-height will expand when in flex
31
- height: map.get($input-height, 'default');
32
- white-space: nowrap;
33
- cursor: pointer;
34
- color: getCssVar('button', 'text-color');
35
- text-align: center;
36
- box-sizing: border-box;
37
- outline: none;
38
- transition: 0.1s;
39
- font-weight: getCssVar('button', 'font-weight');
40
- user-select: none;
41
- vertical-align: middle;
42
- -webkit-appearance: none;
43
- background-color: getCssVar('button', 'bg-color');
44
- border: 1px getCssVar('button', 'border-style');
45
- border-color: getCssVar('button', 'border-color');
46
-
47
- &:hover {
48
- color: getCssVar('button', 'hover', 'text-color');
49
- border-color: getCssVar('button', 'hover', 'border-color');
50
- background-color: getCssVar('button', 'hover', 'bg-color');
51
- outline: none;
52
- }
53
-
54
- &:active {
55
- color: getCssVar('button', 'active', 'text-color');
56
- border-color: getCssVar('button', 'active', 'border-color');
57
- background-color: getCssVar('button', 'active', 'bg-color');
58
- outline: none;
59
- }
60
-
61
- &:focus-visible {
62
- outline: 2px solid getCssVar('button', 'outline-color');
63
- outline-offset: 1px;
64
- transition: outline-offset 0s, outline 0s;
65
- }
66
-
67
- > span {
68
- display: inline-flex;
69
- align-items: center;
70
- }
71
-
72
- & + & {
73
- margin-left: 12px;
74
- }
75
-
76
- & {
77
- @include button-size(
78
- map.get($button-padding-vertical, 'default') - $button-border-width,
79
- map.get($button-padding-horizontal, 'default') - $button-border-width,
80
- map.get($button-font-size, 'default'),
81
- map.get($button-border-radius, 'default')
82
- );
83
- }
84
-
85
- &::-moz-focus-inner {
86
- border: 0;
87
- }
88
-
89
- & [class*='#{$namespace}-icon'] {
90
- & + span {
91
- margin-left: map.get($button-icon-span-gap, 'default');
92
- }
93
- svg {
94
- vertical-align: bottom;
95
- }
96
- }
97
-
98
- @include when(plain) {
99
- @include css-var-from-global(('button', 'hover', 'text-color'), ('color', 'primary'));
100
- @include css-var-from-global(('button', 'hover', 'bg-color'), ('fill-color', 'blank'));
101
- @include css-var-from-global(('button', 'hover', 'border-color'), ('color', 'primary'));
102
- }
103
-
104
- @include when(dashed) {
105
- $varName: getCssVarName('button', 'border-style');
106
- @include css-var-from-global(('button', 'hover', 'text-color'), ('color', 'primary'));
107
- @include css-var-from-global(('button', 'hover', 'bg-color'), ('fill-color', 'blank'));
108
- @include css-var-from-global(('button', 'hover', 'border-color'), ('color', 'primary'));
109
- #{$varName}: dashed;
110
- @include css-var-from-global(('button', 'active', 'bg-color'), ('fill-color', 'blank'));
111
- @include css-var-from-global(('button', 'active', 'text-color'), ('color', 'primary', 'light-3'));
112
- @include css-var-from-global(('button', 'active', 'border-color'), ('color', 'primary', 'light-3'));
113
- }
114
-
115
- @include when(active) {
116
- color: getCssVar('button', 'active', 'text-color');
117
- border-color: getCssVar('button', 'active', 'border-color');
118
- background-color: getCssVar('button', 'active', 'bg-color');
119
- outline: none;
120
- }
121
-
122
- @include when(disabled) {
123
- &,
124
- &:hover {
125
- color: getCssVar('button', 'disabled', 'text-color');
126
- cursor: not-allowed;
127
- background-image: none;
128
- background-color: getCssVar('button', 'disabled', 'bg-color');
129
- border-color: getCssVar('button', 'disabled', 'border-color');
130
- }
131
- }
132
-
133
- @include when(loading) {
134
- position: relative;
135
- pointer-events: none;
136
-
137
- &:before {
138
- // mask the button
139
- z-index: 1;
140
- pointer-events: none;
141
- content: '';
142
- position: absolute;
143
- left: -1px;
144
- top: -1px;
145
- right: -1px;
146
- bottom: -1px;
147
- border-radius: inherit;
148
- background-color: getCssVar('mask-color', 'extra-light');
149
- }
150
- }
151
- @include when(round) {
152
- border-radius: getCssVar('border-radius', 'round');
153
- }
154
- @include when(circle) {
155
- width: map.get($input-height, 'default');
156
- border-radius: 50%;
157
- padding: map.get($button-padding-vertical, 'default') - $button-border-width;
158
- }
159
-
160
- @include when(text) {
161
- color: getCssVar('button', 'text-color');
162
- border: 0 solid transparent;
163
- background-color: transparent;
164
-
165
- @include when(disabled) {
166
- color: getCssVar('button', 'disabled', 'text-color');
167
- background-color: transparent !important;
168
- }
169
-
170
- &:not(.is-disabled) {
171
- &:hover {
172
- background-color: getCssVar('fill-color', 'light');
173
- }
174
-
175
- &:focus-visible {
176
- outline: 2px solid getCssVar('button', 'outline-color');
177
- outline-offset: 1px;
178
- transition: outline-offset 0s, outline 0s;
179
- }
180
-
181
- &:active {
182
- background-color: getCssVar('fill-color');
183
- }
184
-
185
- @include when(has-bg) {
186
- background-color: getCssVar('fill-color', 'light');
187
-
188
- &:hover {
189
- background-color: getCssVar('fill-color');
190
- }
191
-
192
- &:active {
193
- background-color: getCssVar('fill-color', 'dark');
194
- }
195
- }
196
- }
197
- }
198
-
199
- @include e(text) {
200
- @include m(expand) {
201
- letter-spacing: 0.3em;
202
- margin-right: -0.3em;
203
- }
204
- }
205
-
206
- @include when(link) {
207
- border-color: transparent;
208
- color: getCssVar('button', 'text-color');
209
- background: transparent;
210
- padding: 2px;
211
- height: auto;
212
-
213
- &:hover {
214
- color: getCssVar('button', 'hover', 'link-text-color');
215
- }
216
-
217
- @include when(disabled) {
218
- color: getCssVar('button', 'disabled', 'text-color');
219
- background-color: transparent !important;
220
- border-color: transparent !important;
221
- }
222
-
223
- &:not(.is-disabled) {
224
- &:hover {
225
- border-color: transparent;
226
- background-color: transparent;
227
- }
228
-
229
- &:active {
230
- color: getCssVar('button', 'active-color');
231
- border-color: transparent;
232
- background-color: transparent;
233
- }
234
- }
235
- }
236
-
237
- @include m(text) {
238
- border-color: transparent;
239
- background: transparent;
240
- color: getCssVar('color', 'primary');
241
- padding-left: 0;
242
- padding-right: 0;
243
- @include when(disabled) {
244
- color: getCssVar('button', 'disabled', 'text-color');
245
- background-color: transparent !important;
246
- border-color: transparent !important;
247
- }
248
-
249
- &:not(.is-disabled) {
250
- &:hover {
251
- color: getCssVar('color', 'primary', 'light-3');
252
- border-color: transparent;
253
- background-color: transparent;
254
- }
255
-
256
- &:active {
257
- color: getCssVar('color', 'primary', 'dark-2');
258
- border-color: transparent;
259
- background-color: transparent;
260
- }
261
- }
262
- }
263
-
264
- @include e(link) {
265
- @include m(expand) {
266
- letter-spacing: 0.3em;
267
- margin-right: -0.3em;
268
- }
269
- }
270
-
271
- @each $type in (primary, success, warning, danger, info) {
272
- @include m($type) {
273
- @include button-variant($type);
274
- }
275
- }
276
-
277
- @each $size in (large, small) {
278
- @include m($size) {
279
- @include set-css-var-value(('button', 'size'), map.get($input-height, $size));
280
-
281
- height: getCssVar('button', 'size');
282
-
283
- & [class*='#{$namespace}-icon'] {
284
- & + span {
285
- margin-left: map.get($button-icon-span-gap, $size);
286
- }
287
- }
288
-
289
- & {
290
- @include button-size(
291
- map.get($button-padding-vertical, $size) - $button-border-width,
292
- map.get($button-padding-horizontal, $size) - $button-border-width,
293
- map.get($button-font-size, $size),
294
- map.get($button-border-radius, $size)
295
- );
296
- }
297
-
298
- @include when(circle) {
299
- width: getCssVar('button', 'size');
300
- padding: map.get($button-padding-vertical, $size) - $button-border-width;
301
- }
302
- }
303
- }
304
- }
1
+ @use 'sass:map';
2
+
3
+ @use 'common/var' as *;
4
+ @use 'mixins/function' as *;
5
+ @use 'mixins/button' as *;
6
+ @use 'mixins/mixins' as *;
7
+ @use 'mixins/utils' as *;
8
+ @use 'mixins/var' as *;
9
+
10
+ $button-icon-span-gap: () !default;
11
+ $button-icon-span-gap: map.merge(
12
+ (
13
+ 'large': 8px,
14
+ 'default': 6px,
15
+ 'small': 4px,
16
+ ),
17
+ $button-icon-span-gap
18
+ );
19
+
20
+ @include b(button) {
21
+ @include set-component-css-var('button', $button);
22
+ }
23
+
24
+ @include b(button) {
25
+ display: inline-flex;
26
+ justify-content: center;
27
+ align-items: center;
28
+
29
+ line-height: 1;
30
+ // min-height will expand when in flex
31
+ height: map.get($input-height, 'default');
32
+ white-space: nowrap;
33
+ cursor: pointer;
34
+ color: getCssVar('button', 'text-color');
35
+ text-align: center;
36
+ box-sizing: border-box;
37
+ outline: none;
38
+ transition: 0.1s;
39
+ font-weight: getCssVar('button', 'font-weight');
40
+ user-select: none;
41
+ vertical-align: middle;
42
+ -webkit-appearance: none;
43
+ background-color: getCssVar('button', 'bg-color');
44
+ border: 1px getCssVar('button', 'border-style');
45
+ border-color: getCssVar('button', 'border-color');
46
+
47
+ &:hover {
48
+ color: getCssVar('button', 'hover', 'text-color');
49
+ border-color: getCssVar('button', 'hover', 'border-color');
50
+ background-color: getCssVar('button', 'hover', 'bg-color');
51
+ outline: none;
52
+ }
53
+
54
+ &:active {
55
+ color: getCssVar('button', 'active', 'text-color');
56
+ border-color: getCssVar('button', 'active', 'border-color');
57
+ background-color: getCssVar('button', 'active', 'bg-color');
58
+ outline: none;
59
+ }
60
+
61
+ &:focus-visible {
62
+ outline: 2px solid getCssVar('button', 'outline-color');
63
+ outline-offset: 1px;
64
+ transition: outline-offset 0s, outline 0s;
65
+ }
66
+
67
+ > span {
68
+ display: inline-flex;
69
+ align-items: center;
70
+ }
71
+
72
+ & + & {
73
+ margin-left: 12px;
74
+ }
75
+
76
+ & {
77
+ @include button-size(
78
+ map.get($button-padding-vertical, 'default') - $button-border-width,
79
+ map.get($button-padding-horizontal, 'default') - $button-border-width,
80
+ map.get($button-font-size, 'default'),
81
+ map.get($button-border-radius, 'default')
82
+ );
83
+ }
84
+
85
+ &::-moz-focus-inner {
86
+ border: 0;
87
+ }
88
+
89
+ & [class*='#{$namespace}-icon'] {
90
+ & + span {
91
+ margin-left: map.get($button-icon-span-gap, 'default');
92
+ }
93
+ svg {
94
+ vertical-align: bottom;
95
+ }
96
+ }
97
+
98
+ @include when(plain) {
99
+ @include css-var-from-global(('button', 'hover', 'text-color'), ('color', 'primary'));
100
+ @include css-var-from-global(('button', 'hover', 'bg-color'), ('fill-color', 'blank'));
101
+ @include css-var-from-global(('button', 'hover', 'border-color'), ('color', 'primary'));
102
+ }
103
+
104
+ @include when(dashed) {
105
+ $varName: getCssVarName('button', 'border-style');
106
+ @include css-var-from-global(('button', 'hover', 'text-color'), ('color', 'primary'));
107
+ @include css-var-from-global(('button', 'hover', 'bg-color'), ('fill-color', 'blank'));
108
+ @include css-var-from-global(('button', 'hover', 'border-color'), ('color', 'primary'));
109
+ #{$varName}: dashed;
110
+ @include css-var-from-global(('button', 'active', 'bg-color'), ('fill-color', 'blank'));
111
+ @include css-var-from-global(('button', 'active', 'text-color'), ('color', 'primary', 'light-3'));
112
+ @include css-var-from-global(('button', 'active', 'border-color'), ('color', 'primary', 'light-3'));
113
+ }
114
+
115
+ @include when(active) {
116
+ color: getCssVar('button', 'active', 'text-color');
117
+ border-color: getCssVar('button', 'active', 'border-color');
118
+ background-color: getCssVar('button', 'active', 'bg-color');
119
+ outline: none;
120
+ }
121
+
122
+ @include when(disabled) {
123
+ &,
124
+ &:hover {
125
+ color: getCssVar('button', 'disabled', 'text-color');
126
+ cursor: not-allowed;
127
+ background-image: none;
128
+ background-color: getCssVar('button', 'disabled', 'bg-color');
129
+ border-color: getCssVar('button', 'disabled', 'border-color');
130
+ }
131
+ }
132
+
133
+ @include when(loading) {
134
+ position: relative;
135
+ pointer-events: none;
136
+
137
+ &:before {
138
+ // mask the button
139
+ z-index: 1;
140
+ pointer-events: none;
141
+ content: '';
142
+ position: absolute;
143
+ left: -1px;
144
+ top: -1px;
145
+ right: -1px;
146
+ bottom: -1px;
147
+ border-radius: inherit;
148
+ background-color: getCssVar('mask-color', 'extra-light');
149
+ }
150
+ }
151
+ @include when(round) {
152
+ border-radius: getCssVar('border-radius', 'round');
153
+ }
154
+ @include when(circle) {
155
+ width: map.get($input-height, 'default');
156
+ border-radius: 50%;
157
+ padding: map.get($button-padding-vertical, 'default') - $button-border-width;
158
+ }
159
+
160
+ @include when(text) {
161
+ color: getCssVar('button', 'text-color');
162
+ border: 0 solid transparent;
163
+ background-color: transparent;
164
+
165
+ @include when(disabled) {
166
+ color: getCssVar('button', 'disabled', 'text-color');
167
+ background-color: transparent !important;
168
+ }
169
+
170
+ &:not(.is-disabled) {
171
+ &:hover {
172
+ background-color: getCssVar('fill-color', 'light');
173
+ }
174
+
175
+ &:focus-visible {
176
+ outline: 2px solid getCssVar('button', 'outline-color');
177
+ outline-offset: 1px;
178
+ transition: outline-offset 0s, outline 0s;
179
+ }
180
+
181
+ &:active {
182
+ background-color: getCssVar('fill-color');
183
+ }
184
+
185
+ @include when(has-bg) {
186
+ background-color: getCssVar('fill-color', 'light');
187
+
188
+ &:hover {
189
+ background-color: getCssVar('fill-color');
190
+ }
191
+
192
+ &:active {
193
+ background-color: getCssVar('fill-color', 'dark');
194
+ }
195
+ }
196
+ }
197
+ }
198
+
199
+ @include e(text) {
200
+ @include m(expand) {
201
+ letter-spacing: 0.3em;
202
+ margin-right: -0.3em;
203
+ }
204
+ }
205
+
206
+ @include when(link) {
207
+ border-color: transparent;
208
+ color: getCssVar('button', 'text-color');
209
+ background: transparent;
210
+ padding: 2px;
211
+ height: auto;
212
+
213
+ &:hover {
214
+ color: getCssVar('button', 'hover', 'link-text-color');
215
+ }
216
+
217
+ @include when(disabled) {
218
+ color: getCssVar('button', 'disabled', 'text-color');
219
+ background-color: transparent !important;
220
+ border-color: transparent !important;
221
+ }
222
+
223
+ &:not(.is-disabled) {
224
+ &:hover {
225
+ border-color: transparent;
226
+ background-color: transparent;
227
+ }
228
+
229
+ &:active {
230
+ color: getCssVar('button', 'active-color');
231
+ border-color: transparent;
232
+ background-color: transparent;
233
+ }
234
+ }
235
+ }
236
+
237
+ @include m(text) {
238
+ border-color: transparent;
239
+ background: transparent;
240
+ color: getCssVar('color', 'primary');
241
+ padding-left: 0;
242
+ padding-right: 0;
243
+ @include when(disabled) {
244
+ color: getCssVar('button', 'disabled', 'text-color');
245
+ background-color: transparent !important;
246
+ border-color: transparent !important;
247
+ }
248
+
249
+ &:not(.is-disabled) {
250
+ &:hover {
251
+ color: getCssVar('color', 'primary', 'light-3');
252
+ border-color: transparent;
253
+ background-color: transparent;
254
+ }
255
+
256
+ &:active {
257
+ color: getCssVar('color', 'primary', 'dark-2');
258
+ border-color: transparent;
259
+ background-color: transparent;
260
+ }
261
+ }
262
+ }
263
+
264
+ @include e(link) {
265
+ @include m(expand) {
266
+ letter-spacing: 0.3em;
267
+ margin-right: -0.3em;
268
+ }
269
+ }
270
+
271
+ @each $type in (primary, success, warning, danger, info) {
272
+ @include m($type) {
273
+ @include button-variant($type);
274
+ }
275
+ }
276
+
277
+ @each $size in (large, small) {
278
+ @include m($size) {
279
+ @include set-css-var-value(('button', 'size'), map.get($input-height, $size));
280
+
281
+ height: getCssVar('button', 'size');
282
+
283
+ & [class*='#{$namespace}-icon'] {
284
+ & + span {
285
+ margin-left: map.get($button-icon-span-gap, $size);
286
+ }
287
+ }
288
+
289
+ & {
290
+ @include button-size(
291
+ map.get($button-padding-vertical, $size) - $button-border-width,
292
+ map.get($button-padding-horizontal, $size) - $button-border-width,
293
+ map.get($button-font-size, $size),
294
+ map.get($button-border-radius, $size)
295
+ );
296
+ }
297
+
298
+ @include when(circle) {
299
+ width: getCssVar('button', 'size');
300
+ padding: map.get($button-padding-vertical, $size) - $button-border-width;
301
+ }
302
+ }
303
+ }
304
+ }