@jetbrains/ring-ui 7.0.0-beta.4 → 7.0.0-beta.6
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/components/auth/auth__core.js +4 -1
- package/components/auth/storage.js +1 -2
- package/components/button/button.css +152 -184
- package/components/button/button.js +16 -11
- package/components/button/button__classes.d.ts +1 -1
- package/components/button/button__classes.js +10 -8
- package/components/data-list/data-list.css +1 -0
- package/components/dialog/dialog.css +2 -2
- package/components/global/variables.css +2 -0
- package/components/global/variables_dark.css +2 -0
- package/components/header/header.css +1 -0
- package/components/icon/icon.css +1 -1
- package/components/input/input.css +1 -1
- package/components/message/message.css +2 -2
- package/components/message/message.js +1 -1
- package/components/pager/pager.css +9 -0
- package/components/pager/pager.js +14 -13
- package/components/query-assist/query-assist.js +2 -2
- package/components/select/select.css +14 -4
- package/components/select/select.d.ts +3 -0
- package/components/select/select.js +14 -5
- package/components/storage/storage.d.ts +2 -3
- package/components/storage/storage.js +1 -21
- package/components/tabs/tabs.css +4 -4
- package/components/tag/tag.css +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/user-agreement/service.d.ts +2 -1
- package/package.json +19 -20
- package/components/storage/storage__fallback.d.ts +0 -79
- package/components/storage/storage__fallback.js +0 -181
|
@@ -137,7 +137,10 @@ export default class Auth {
|
|
|
137
137
|
this.addListener(LOGOUT_EVENT, this.config.onLogout);
|
|
138
138
|
}
|
|
139
139
|
if (this.config.reloadOnUserChange) {
|
|
140
|
-
this.addListener(USER_CHANGED_EVENT, () =>
|
|
140
|
+
this.addListener(USER_CHANGED_EVENT, () => {
|
|
141
|
+
// Timeout is needed to ensure all other listeners triggered before stopping current page
|
|
142
|
+
setTimeout(() => this._reloadCurrentPage());
|
|
143
|
+
});
|
|
141
144
|
}
|
|
142
145
|
this.addListener(LOGOUT_POSTPONED_EVENT, () => this._setPostponed(true));
|
|
143
146
|
this.addListener(USER_CHANGE_POSTPONED_EVENT, () => this._setPostponed(true));
|
|
@@ -39,8 +39,7 @@ export default class AuthStorage {
|
|
|
39
39
|
this.stateTTL = config.stateTTL || DEFAULT_STATE_TTL;
|
|
40
40
|
this._lastMessage = null;
|
|
41
41
|
const StorageConstructor = config.storage || Storage;
|
|
42
|
-
this.stateQuota =
|
|
43
|
-
DEFAULT_STATE_QUOTA, StorageConstructor.QUOTA || Infinity);
|
|
42
|
+
this.stateQuota = config.stateQuota || DEFAULT_STATE_QUOTA;
|
|
44
43
|
this._stateStorage = new StorageConstructor({
|
|
45
44
|
cookieName: 'ring-state'
|
|
46
45
|
});
|
|
@@ -5,147 +5,166 @@
|
|
|
5
5
|
|
|
6
6
|
.heightS {
|
|
7
7
|
--ring-button-height: calc(var(--ring-unit) * 3);
|
|
8
|
+
--ring-button-padding-block: calc(var(--ring-unit) * 0.5);
|
|
8
9
|
--ring-button-font-size: var(--ring-font-size-smaller);
|
|
10
|
+
--ring-button-line-height: var(--ring-line-height-lowest);
|
|
11
|
+
--ring-button-icon-line-height: calc(var(--ring-unit) * 1.5);
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
.heightM {
|
|
12
15
|
--ring-button-height: calc(var(--ring-unit) * 3.5);
|
|
16
|
+
--ring-button-padding-block: calc(var(--ring-unit) * 0.5);
|
|
13
17
|
--ring-button-font-size: var(--ring-font-size);
|
|
18
|
+
--ring-button-line-height: var(--ring-line-height);
|
|
19
|
+
--ring-button-icon-line-height: calc(var(--ring-unit) * 2);
|
|
14
20
|
}
|
|
15
21
|
|
|
16
22
|
.heightL {
|
|
17
23
|
--ring-button-height: calc(var(--ring-unit) * 4);
|
|
24
|
+
--ring-button-padding-block: calc(var(--ring-unit) * 0.75);
|
|
18
25
|
--ring-button-font-size: var(--ring-font-size);
|
|
26
|
+
--ring-button-line-height: var(--ring-line-height);
|
|
27
|
+
--ring-button-icon-line-height: calc(var(--ring-unit) * 2);
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
.button {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
display: inline-block;
|
|
31
|
+
--ring-button-focus-border-color: var(--ring-border-hover-color);
|
|
25
32
|
|
|
26
33
|
box-sizing: border-box;
|
|
27
|
-
height: var(--ring-button-height);
|
|
28
34
|
margin: 0;
|
|
29
|
-
padding: 0 calc(var(--ring-unit) * 2);
|
|
30
35
|
|
|
31
36
|
cursor: pointer;
|
|
32
37
|
transition: color var(--ring-ease), background-color var(--ring-ease), box-shadow var(--ring-ease);
|
|
33
38
|
white-space: nowrap;
|
|
34
39
|
text-decoration: none;
|
|
35
40
|
|
|
36
|
-
color: var(--ring-text-color);
|
|
37
|
-
|
|
38
41
|
border: 0;
|
|
39
42
|
border-radius: var(--ring-border-radius);
|
|
40
43
|
outline: 0;
|
|
41
|
-
background-color: var(--ring-content-background-color);
|
|
42
|
-
box-shadow: button-shadow var(--ring-borders-color);
|
|
43
|
-
|
|
44
|
-
font-family: var(--ring-font-family);
|
|
45
|
-
font-size: var(--ring-button-font-size);
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
font-family: var(--ring-font-family), sans-serif;
|
|
48
46
|
|
|
49
|
-
&:hover
|
|
47
|
+
&:hover,
|
|
48
|
+
&:active,
|
|
49
|
+
&:focus-visible {
|
|
50
50
|
transition: none;
|
|
51
|
-
|
|
52
|
-
box-shadow: button-shadow var(--ring-border-hover-color);
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
&::-moz-focus-inner {
|
|
54
|
+
padding: 0;
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
border: 0;
|
|
57
|
+
outline: 0;
|
|
60
58
|
}
|
|
59
|
+
}
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
.block {
|
|
62
|
+
--ring-button-background-color: var(--ring-content-background-color);
|
|
63
|
+
--ring-button-border-color: var(--ring-borders-color);
|
|
64
|
+
--ring-button-padding-inline: calc(var(--ring-unit) * 2);
|
|
64
65
|
|
|
65
|
-
|
|
66
|
-
}
|
|
66
|
+
display: inline-block;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
height: var(--ring-button-height);
|
|
69
|
+
padding: var(--ring-button-padding-block) var(--ring-button-padding-inline);
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
box-shadow: button-shadow var(--ring-main-color);
|
|
73
|
-
}
|
|
71
|
+
color: var(--ring-text-color);
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
73
|
+
background-color: var(--ring-button-background-color);
|
|
74
|
+
box-shadow: button-shadow var(--ring-button-border-color);
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
font-size: var(--ring-button-font-size);
|
|
77
|
+
line-height: var(--ring-button-line-height);
|
|
81
78
|
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
&:hover {
|
|
80
|
+
--ring-button-border-color: var(--ring-border-hover-color);
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
|
|
87
|
-
background-color: var(--ring-
|
|
88
|
-
|
|
83
|
+
&:active {
|
|
84
|
+
--ring-button-background-color: var(--ring-selected-background-color);
|
|
85
|
+
--ring-button-border-color: var(--ring-border-hover-color);
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
&[disabled]:hover {
|
|
94
|
-
color: var(--ring-disabled-color);
|
|
88
|
+
&:focus-visible {
|
|
89
|
+
box-shadow: button-shadow var(--ring-button-focus-border-color), 0 0 0 1px var(--ring-button-focus-border-color);
|
|
95
90
|
}
|
|
91
|
+
}
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
color: var(--ring-icon-disabled-color);
|
|
100
|
-
}
|
|
93
|
+
.inline {
|
|
94
|
+
display: inline;
|
|
101
95
|
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
margin: 0;
|
|
97
|
+
padding: 0;
|
|
104
98
|
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
color: var(--ring-action-link-color);
|
|
100
|
+
background: transparent;
|
|
101
|
+
|
|
102
|
+
font-size: inherit;
|
|
103
|
+
line-height: inherit;
|
|
104
|
+
|
|
105
|
+
&:focus-visible {
|
|
106
|
+
box-shadow: 0 0 0 2px var(--ring-button-focus-border-color);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.
|
|
111
|
-
|
|
110
|
+
.icon {
|
|
111
|
+
margin-right: calc(var(--ring-unit) * 0.5);
|
|
112
|
+
|
|
113
|
+
transition: color var(--ring-ease);
|
|
114
|
+
|
|
115
|
+
color: inherit;
|
|
116
|
+
|
|
117
|
+
line-height: var(--ring-button-icon-line-height);
|
|
112
118
|
}
|
|
113
119
|
|
|
114
|
-
.
|
|
115
|
-
color: var(--ring-
|
|
116
|
-
|
|
117
|
-
box-shadow: none;
|
|
120
|
+
.inline .icon {
|
|
121
|
+
color: var(--ring-main-color);
|
|
122
|
+
}
|
|
118
123
|
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
.withNormalIcon .icon {
|
|
125
|
+
color: var(--ring-icon-color);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.inline {
|
|
129
|
+
&:hover,
|
|
130
|
+
&:active,
|
|
131
|
+
&.active {
|
|
132
|
+
color: var(--ring-link-hover-color);
|
|
121
133
|
|
|
122
|
-
|
|
123
|
-
|
|
134
|
+
& .icon {
|
|
135
|
+
color: inherit;
|
|
136
|
+
}
|
|
124
137
|
}
|
|
138
|
+
}
|
|
125
139
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
.primaryBlock {
|
|
141
|
+
--ring-button-background-color: var(--ring-main-color);
|
|
142
|
+
--ring-button-border-color: transparent;
|
|
143
|
+
|
|
144
|
+
color: var(--ring-white-text-color);
|
|
145
|
+
|
|
146
|
+
&:hover {
|
|
147
|
+
--ring-button-background-color: var(--ring-main-hover-color);
|
|
148
|
+
--ring-button-border-color: transparent;
|
|
130
149
|
}
|
|
131
150
|
|
|
132
151
|
&:focus-visible,
|
|
133
152
|
&:active,
|
|
134
153
|
&.active {
|
|
135
|
-
background-color: var(--ring-button-primary-background-color);
|
|
154
|
+
--ring-button-background-color: var(--ring-button-primary-background-color);
|
|
136
155
|
}
|
|
137
156
|
|
|
138
157
|
&:active,
|
|
139
158
|
&.active {
|
|
140
|
-
|
|
159
|
+
--ring-button-border-color: var(--ring-button-primary-border-color);
|
|
141
160
|
}
|
|
142
161
|
|
|
143
|
-
|
|
144
|
-
background-color: var(--ring-disabled-background-color);
|
|
145
|
-
|
|
162
|
+
&.disabled {
|
|
163
|
+
--ring-button-background-color: var(--ring-disabled-background-color);
|
|
164
|
+
--ring-button-border-color: var(--ring-border-disabled-color);
|
|
146
165
|
}
|
|
147
166
|
|
|
148
|
-
|
|
167
|
+
&.loader {
|
|
149
168
|
color: var(--ring-white-text-color);
|
|
150
169
|
}
|
|
151
170
|
|
|
@@ -170,145 +189,81 @@
|
|
|
170
189
|
}
|
|
171
190
|
|
|
172
191
|
.danger {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
&.withIcon.active,
|
|
177
|
-
&.text,
|
|
178
|
-
&.text:active,
|
|
179
|
-
&.text.active {
|
|
180
|
-
color: var(--ring-error-color);
|
|
181
|
-
}
|
|
192
|
+
--ring-button-focus-border-color: var(--ring-button-danger-hover-color);
|
|
193
|
+
|
|
194
|
+
color: var(--ring-error-color);
|
|
182
195
|
|
|
183
196
|
&:active,
|
|
184
197
|
&.active {
|
|
185
|
-
background-color: var(--ring-button-danger-active-color);
|
|
198
|
+
--ring-button-background-color: var(--ring-button-danger-active-color);
|
|
186
199
|
}
|
|
187
200
|
|
|
188
201
|
&:active,
|
|
189
202
|
&.active,
|
|
190
|
-
&:focus-visible,
|
|
191
203
|
&:hover {
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
&:focus-visible,
|
|
196
|
-
&:hover {
|
|
197
|
-
transition: none;
|
|
204
|
+
--ring-button-border-color: var(--ring-button-danger-hover-color);
|
|
198
205
|
}
|
|
199
206
|
}
|
|
200
207
|
|
|
201
|
-
.
|
|
202
|
-
|
|
203
|
-
background-color: transparent;
|
|
204
|
-
box-shadow: none;
|
|
208
|
+
.disabled {
|
|
209
|
+
cursor: auto;
|
|
205
210
|
|
|
206
|
-
&:hover {
|
|
207
|
-
|
|
208
|
-
|
|
211
|
+
&, &:hover, &:active {
|
|
212
|
+
--ring-button-background-color: var(--ring-disabled-background-color);
|
|
213
|
+
--ring-button-border-color: var(--ring-border-disabled-color);
|
|
209
214
|
|
|
210
|
-
|
|
211
|
-
&.active {
|
|
212
|
-
background-color: transparent;
|
|
213
|
-
box-shadow: none;
|
|
214
|
-
}
|
|
215
|
+
color: var(--ring-disabled-color);
|
|
215
216
|
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
& .icon {
|
|
218
|
+
color: var(--ring-icon-disabled-color);
|
|
219
|
+
}
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
|
221
|
-
.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.text.text:hover {
|
|
228
|
-
background-color: transparent;
|
|
229
|
-
box-shadow: none;
|
|
230
|
-
}
|
|
223
|
+
.active {
|
|
224
|
+
&.block {
|
|
225
|
+
--ring-button-background-color: var(--ring-hover-background-color);
|
|
226
|
+
--ring-button-border-color: var(--ring-main-color);
|
|
231
227
|
|
|
232
|
-
|
|
233
|
-
background-color: transparent;
|
|
234
|
-
box-shadow: none;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.text {
|
|
238
|
-
color: var(--ring-action-link-color);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.inline {
|
|
242
|
-
display: inline-block;
|
|
243
|
-
|
|
244
|
-
margin: 0;
|
|
245
|
-
padding: 0;
|
|
246
|
-
|
|
247
|
-
font-size: var(--ring-font-size);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.withIcon {
|
|
251
|
-
padding: 0 var(--ring-unit);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.text {
|
|
255
|
-
&:active,
|
|
256
|
-
&.active {
|
|
257
|
-
color: var(--ring-link-hover-color);
|
|
228
|
+
transition: none;
|
|
258
229
|
}
|
|
259
|
-
}
|
|
260
230
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
color: var(--ring-action-link-color);
|
|
231
|
+
&.disabled {
|
|
232
|
+
--ring-button-background-color: var(--ring-disabled-selected-background-color);
|
|
233
|
+
--ring-button-border-color: var(--ring-border-selected-disabled-color);
|
|
265
234
|
}
|
|
266
235
|
}
|
|
267
236
|
|
|
268
|
-
.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
.text:hover {
|
|
273
|
-
color: var(--ring-link-hover-color);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.icon {
|
|
277
|
-
color: inherit;
|
|
278
|
-
|
|
279
|
-
line-height: normal;
|
|
280
|
-
|
|
281
|
-
&:not(:last-child) {
|
|
282
|
-
margin-right: calc(var(--ring-unit) * 0.5);
|
|
237
|
+
.iconOnly {
|
|
238
|
+
&.heightS {
|
|
239
|
+
--ring-button-padding-block: calc(var(--ring-unit) * 0.75);
|
|
240
|
+
--ring-button-padding-inline: calc(var(--ring-unit) * 0.75);
|
|
283
241
|
}
|
|
284
|
-
}
|
|
285
242
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
243
|
+
&.heightM {
|
|
244
|
+
--ring-button-padding-block: calc(var(--ring-unit) * 0.75);
|
|
245
|
+
--ring-button-padding-inline: var(--ring-unit);
|
|
246
|
+
}
|
|
291
247
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
248
|
+
&.heightL {
|
|
249
|
+
--ring-button-padding-block: var(--ring-unit);
|
|
250
|
+
--ring-button-padding-inline: var(--ring-unit);
|
|
251
|
+
}
|
|
295
252
|
|
|
296
253
|
& .icon {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
color: inherit;
|
|
254
|
+
margin: 0;
|
|
300
255
|
}
|
|
301
|
-
}
|
|
302
256
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
transition: none;
|
|
257
|
+
&.block {
|
|
258
|
+
vertical-align: -2px;
|
|
306
259
|
|
|
307
|
-
|
|
260
|
+
& .icon {
|
|
261
|
+
vertical-align: 2px;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
308
264
|
}
|
|
309
265
|
|
|
310
|
-
.
|
|
311
|
-
.withDangerIcon:active .icon {
|
|
266
|
+
.danger .icon {
|
|
312
267
|
color: var(--ring-icon-error-color);
|
|
313
268
|
}
|
|
314
269
|
|
|
@@ -316,9 +271,19 @@
|
|
|
316
271
|
position: relative;
|
|
317
272
|
z-index: 0;
|
|
318
273
|
|
|
319
|
-
|
|
274
|
+
cursor: auto;
|
|
320
275
|
|
|
321
276
|
background-color: transparent;
|
|
277
|
+
|
|
278
|
+
&:hover {
|
|
279
|
+
--ring-button-border-color: var(--ring-borders-color);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.loader.inline {
|
|
284
|
+
animation-name: text-loading;
|
|
285
|
+
animation-duration: 1200ms;
|
|
286
|
+
animation-iteration-count: infinite;
|
|
322
287
|
}
|
|
323
288
|
|
|
324
289
|
.loaderBackground {
|
|
@@ -355,29 +320,32 @@
|
|
|
355
320
|
}
|
|
356
321
|
}
|
|
357
322
|
|
|
358
|
-
.delayed
|
|
323
|
+
.delayed::after {
|
|
359
324
|
content: "…";
|
|
360
325
|
}
|
|
361
326
|
|
|
362
327
|
.short {
|
|
328
|
+
--ring-button-padding-inline: 0;
|
|
329
|
+
|
|
363
330
|
width: calc(var(--ring-unit) * 4);
|
|
364
|
-
padding: 0;
|
|
365
331
|
}
|
|
366
332
|
|
|
367
333
|
.dropdownIcon {
|
|
368
|
-
margin-right: calc(var(--ring-unit) * -0.5);
|
|
369
|
-
|
|
370
334
|
margin-left: 2px;
|
|
371
335
|
|
|
372
336
|
transition: color var(--ring-ease);
|
|
373
337
|
|
|
374
|
-
|
|
338
|
+
.block & {
|
|
339
|
+
margin-right: calc(var(--ring-unit) * -0.5);
|
|
340
|
+
|
|
341
|
+
color: var(--ring-icon-secondary-color);
|
|
342
|
+
}
|
|
375
343
|
|
|
376
344
|
.primary & {
|
|
377
345
|
color: unset;
|
|
378
346
|
}
|
|
379
347
|
|
|
380
|
-
line-height:
|
|
348
|
+
line-height: var(--ring-button-icon-line-height);
|
|
381
349
|
}
|
|
382
350
|
|
|
383
351
|
.button:hover .dropdownIcon {
|
|
@@ -2,11 +2,13 @@ import { createRef, PureComponent } from 'react';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import chevronDown from '@jetbrains/icons/chevron-down';
|
|
5
|
+
import deprecate from 'util-deprecate';
|
|
5
6
|
import Icon, { Size } from '../icon/icon';
|
|
6
7
|
import ClickableLink from '../link/clickableLink';
|
|
7
8
|
import { ControlsHeightContext } from '../global/controls-height';
|
|
8
9
|
import styles from './button.css';
|
|
9
10
|
import { getButtonClasses } from './button__classes';
|
|
11
|
+
const warnText = deprecate(() => { }, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
|
10
12
|
/**
|
|
11
13
|
* @name Button
|
|
12
14
|
*/
|
|
@@ -20,24 +22,27 @@ export class Button extends PureComponent {
|
|
|
20
22
|
render() {
|
|
21
23
|
const {
|
|
22
24
|
// Modifiers
|
|
23
|
-
active, danger, delayed, loader, primary, short, text,
|
|
25
|
+
active, danger, delayed, loader, primary, short, text, dropdown, height,
|
|
24
26
|
// Props
|
|
25
|
-
icon, iconSize, iconClassName, iconSuppressSizeWarning, className, children, ...props } = this.props;
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
icon, iconSize, iconClassName, iconSuppressSizeWarning, className, children, inline, ...props } = this.props;
|
|
28
|
+
const isInline = inline ?? text ?? icon != null;
|
|
29
|
+
if (text != null) {
|
|
30
|
+
warnText();
|
|
31
|
+
}
|
|
32
|
+
const classes = getButtonClasses({
|
|
33
|
+
...this.props, inline: isInline, height: height ?? this.context
|
|
34
|
+
});
|
|
35
|
+
const content = (<>
|
|
36
|
+
{icon && (<Icon className={classNames(styles.icon, iconClassName)} glyph={icon} size={iconSize} loading={loader && isInline} suppressSizeWarning={iconSuppressSizeWarning}/>)}
|
|
37
|
+
{children}
|
|
33
38
|
{dropdown && (<Icon glyph={chevronDown} className={styles.dropdownIcon}/>)}
|
|
34
|
-
|
|
39
|
+
</>);
|
|
35
40
|
const commonProps = {
|
|
36
41
|
tabIndex: loader ? -1 : 0,
|
|
37
42
|
...props,
|
|
38
43
|
className: classes,
|
|
39
44
|
children: <>
|
|
40
|
-
{loader && !
|
|
45
|
+
{loader && !isInline && <div className={styles.loaderBackground}/>}
|
|
41
46
|
{content}
|
|
42
47
|
</>
|
|
43
48
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ButtonProps } from './button';
|
|
2
|
-
export declare function getButtonClasses({ className, active, disabled, loader, primary, short,
|
|
2
|
+
export declare function getButtonClasses({ className, active, disabled, loader, primary, short, inline, danger, delayed, icon, height, children }: ButtonProps): string;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import styles from './button.css';
|
|
3
|
-
export function getButtonClasses({ className, active, disabled, loader, primary, short,
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
export function getButtonClasses({ className, active, disabled, loader, primary, short, inline, danger, delayed, icon, height, children }) {
|
|
4
|
+
const iconOnly = icon && !children;
|
|
5
|
+
const primaryBlock = primary && !inline;
|
|
6
|
+
const withNormalIcon = icon && !active && !danger && !primary && !disabled &&
|
|
7
|
+
(!inline || iconOnly);
|
|
8
|
+
return classNames(styles.button, className, styles[`height${height}`], inline ? styles.inline : styles.block, {
|
|
6
9
|
[styles.active]: active,
|
|
7
10
|
[styles.danger]: danger,
|
|
8
11
|
[styles.delayed]: delayed,
|
|
9
|
-
[styles.withIcon]: icon,
|
|
10
12
|
[styles.withNormalIcon]: withNormalIcon,
|
|
11
|
-
[styles.
|
|
12
|
-
[styles.loader]: loader && !icon,
|
|
13
|
+
[styles.loader]: loader,
|
|
13
14
|
[styles.primary]: primary,
|
|
15
|
+
[styles.primaryBlock]: primaryBlock,
|
|
14
16
|
[styles.short]: short,
|
|
15
|
-
[styles.
|
|
16
|
-
[styles.
|
|
17
|
+
[styles.disabled]: disabled,
|
|
18
|
+
[styles.iconOnly]: iconOnly
|
|
17
19
|
});
|
|
18
20
|
}
|
|
@@ -90,6 +90,8 @@
|
|
|
90
90
|
--ring-popup-background-color: rgb(var(--ring-popup-background-components)); /* #FFFFFF */
|
|
91
91
|
--ring-sidebar-background-components: 247, 248, 250;
|
|
92
92
|
--ring-sidebar-background-color: rgb(var(--ring-sidebar-background-components)); /* #F7F8FA */
|
|
93
|
+
--ring-secondary-background-components: 247, 248, 250;
|
|
94
|
+
--ring-secondary-background-color: rgb(var(--ring-secondary-background-components)); /* #F7F8FA */
|
|
93
95
|
--ring-selected-background-components: 212, 226, 255;
|
|
94
96
|
--ring-selected-background-color: rgb(var(--ring-selected-background-components)); /* #D4E2FF */
|
|
95
97
|
--ring-hover-background-components: 237, 243, 255;
|
|
@@ -76,6 +76,8 @@
|
|
|
76
76
|
--ring-popup-background-color: rgb(var(--ring-popup-background-components)); /* #393B40 */
|
|
77
77
|
--ring-sidebar-background-components: 43, 45, 48;
|
|
78
78
|
--ring-sidebar-background-color: rgb(var(--ring-sidebar-background-components)); /* #2B2D30 */
|
|
79
|
+
--ring-secondary-background-components: 43, 45, 48;
|
|
80
|
+
--ring-secondary-background-color: rgb(var(--ring-secondary-background-components)); /* #2B2D30 */
|
|
79
81
|
--ring-selected-background-components: 46, 67, 110;
|
|
80
82
|
--ring-selected-background-color: rgb(var(--ring-selected-background-components)); /* #2E436E */
|
|
81
83
|
--ring-hover-background-components: 37, 50, 77;
|
package/components/icon/icon.css
CHANGED