@rescui/button 0.25.2 → 0.25.3-update-build-chain-d223c387a.19.sha-d223c387a
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/lib/_virtual/index.css.js +13 -12
- package/lib/_virtual/loading-outline.js +9 -48
- package/lib/button.js +9 -53
- package/lib/button.p.module.css.js +2 -33
- package/lib/index.css +185 -145
- package/lib/index.js +3 -3
- package/lib/public-api.p.css +33 -33
- package/lib/public-api.pcss +33 -33
- package/package.json +8 -9
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
var styles = {
|
|
2
|
-
"icon": "
|
|
3
|
-
"sizeXS": "
|
|
4
|
-
"sizeS": "
|
|
5
|
-
"sizeM": "
|
|
6
|
-
"sizeL": "
|
|
7
|
-
"light": "
|
|
8
|
-
"dark": "
|
|
9
|
-
"allVariants": "
|
|
10
|
-
"variant16": "
|
|
11
|
-
"variant20": "
|
|
12
|
-
"variant24": "
|
|
13
|
-
"variant28": "
|
|
2
|
+
"icon": "_icon_1u970u_4",
|
|
3
|
+
"sizeXS": "_sizeXS_1u970u_14",
|
|
4
|
+
"sizeS": "_sizeS_1u970u_18",
|
|
5
|
+
"sizeM": "_sizeM_1u970u_22",
|
|
6
|
+
"sizeL": "_sizeL_1u970u_26",
|
|
7
|
+
"light": "_light_1u970u_30",
|
|
8
|
+
"dark": "_dark_1u970u_34",
|
|
9
|
+
"allVariants": "_allVariants_1u970u_48",
|
|
10
|
+
"variant16": "_variant16_1u970u_53",
|
|
11
|
+
"variant20": "_variant20_1u970u_54",
|
|
12
|
+
"variant24": "_variant24_1u970u_55",
|
|
13
|
+
"variant28": "_variant28_1u970u_58"
|
|
14
14
|
};
|
|
15
|
+
|
|
15
16
|
export { styles as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
2
1
|
import { c } from 'react-compiler-runtime';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cn from 'classnames';
|
|
6
5
|
import styles from './index.css.js';
|
|
6
|
+
|
|
7
7
|
const sizeStyles = {
|
|
8
8
|
"xs": styles.sizeXS,
|
|
9
9
|
"s": styles.sizeS,
|
|
@@ -19,7 +19,6 @@ const Size = {
|
|
|
19
19
|
const LoadingOutlineIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
20
20
|
const $ = c(4);
|
|
21
21
|
let t0;
|
|
22
|
-
|
|
23
22
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
24
23
|
t0 = /*#__PURE__*/React.createElement("path", {
|
|
25
24
|
d: "M8 3a5 5 0 1 0 4.933 4.177.5.5 0 0 1 .986-.163Q14 7.496 14 8a6 6 0 1 1-5.014-5.92.5.5 0 1 1-.163.987A5 5 0 0 0 8 3",
|
|
@@ -32,11 +31,9 @@ const LoadingOutlineIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
32
31
|
} else {
|
|
33
32
|
t0 = $[0];
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
let t1;
|
|
37
|
-
|
|
38
35
|
if ($[1] !== props || $[2] !== ref) {
|
|
39
|
-
t1 = /*#__PURE__*/React.createElement("svg",
|
|
36
|
+
t1 = /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
40
37
|
viewBox: "0 0 16 16"
|
|
41
38
|
}, props, {
|
|
42
39
|
ref: ref
|
|
@@ -47,14 +44,12 @@ const LoadingOutlineIcon16 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
47
44
|
} else {
|
|
48
45
|
t1 = $[3];
|
|
49
46
|
}
|
|
50
|
-
|
|
51
47
|
return t1;
|
|
52
48
|
});
|
|
53
49
|
LoadingOutlineIcon16.displayName = 'LoadingOutlineIcon16';
|
|
54
50
|
const LoadingOutlineIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
55
51
|
const $ = c(4);
|
|
56
52
|
let t0;
|
|
57
|
-
|
|
58
53
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
59
54
|
t0 = /*#__PURE__*/React.createElement("path", {
|
|
60
55
|
d: "M10 3.75a6.25 6.25 0 1 0 6.166 5.221.75.75 0 0 1 1.48-.244 7.75 7.75 0 1 1-6.372-6.372.75.75 0 0 1-.245 1.48A6.3 6.3 0 0 0 10 3.75",
|
|
@@ -67,11 +62,9 @@ const LoadingOutlineIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
67
62
|
} else {
|
|
68
63
|
t0 = $[0];
|
|
69
64
|
}
|
|
70
|
-
|
|
71
65
|
let t1;
|
|
72
|
-
|
|
73
66
|
if ($[1] !== props || $[2] !== ref) {
|
|
74
|
-
t1 = /*#__PURE__*/React.createElement("svg",
|
|
67
|
+
t1 = /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
75
68
|
viewBox: "0 0 20 20"
|
|
76
69
|
}, props, {
|
|
77
70
|
ref: ref
|
|
@@ -82,14 +75,12 @@ const LoadingOutlineIcon20 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
82
75
|
} else {
|
|
83
76
|
t1 = $[3];
|
|
84
77
|
}
|
|
85
|
-
|
|
86
78
|
return t1;
|
|
87
79
|
});
|
|
88
80
|
LoadingOutlineIcon20.displayName = 'LoadingOutlineIcon20';
|
|
89
81
|
const LoadingOutlineIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
90
82
|
const $ = c(4);
|
|
91
83
|
let t0;
|
|
92
|
-
|
|
93
84
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
85
|
t0 = /*#__PURE__*/React.createElement("path", {
|
|
95
86
|
d: "M12 5a7 7 0 1 0 6.906 5.848 1 1 0 1 1 1.973-.327q.12.724.121 1.479a9 9 0 1 1-7.521-8.879 1 1 0 0 1-.327 1.973A7 7 0 0 0 12 5",
|
|
@@ -102,11 +93,9 @@ const LoadingOutlineIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
102
93
|
} else {
|
|
103
94
|
t0 = $[0];
|
|
104
95
|
}
|
|
105
|
-
|
|
106
96
|
let t1;
|
|
107
|
-
|
|
108
97
|
if ($[1] !== props || $[2] !== ref) {
|
|
109
|
-
t1 = /*#__PURE__*/React.createElement("svg",
|
|
98
|
+
t1 = /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
110
99
|
viewBox: "0 0 24 24"
|
|
111
100
|
}, props, {
|
|
112
101
|
ref: ref
|
|
@@ -117,14 +106,12 @@ const LoadingOutlineIcon24 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
117
106
|
} else {
|
|
118
107
|
t1 = $[3];
|
|
119
108
|
}
|
|
120
|
-
|
|
121
109
|
return t1;
|
|
122
110
|
});
|
|
123
111
|
LoadingOutlineIcon24.displayName = 'LoadingOutlineIcon24';
|
|
124
112
|
const LoadingOutlineIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
125
113
|
const $ = c(4);
|
|
126
114
|
let t0;
|
|
127
|
-
|
|
128
115
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
116
|
t0 = /*#__PURE__*/React.createElement("path", {
|
|
130
117
|
d: "M14 6a8 8 0 1 0 7.892 6.683 1 1 0 1 1 1.974-.326q.133.803.134 1.643c0 5.523-4.477 10-10 10S4 19.523 4 14 8.477 4 14 4q.775.001 1.52.115a1 1 0 1 1-.302 1.977A8 8 0 0 0 14 6",
|
|
@@ -137,11 +124,9 @@ const LoadingOutlineIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
137
124
|
} else {
|
|
138
125
|
t0 = $[0];
|
|
139
126
|
}
|
|
140
|
-
|
|
141
127
|
let t1;
|
|
142
|
-
|
|
143
128
|
if ($[1] !== props || $[2] !== ref) {
|
|
144
|
-
t1 = /*#__PURE__*/React.createElement("svg",
|
|
129
|
+
t1 = /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
145
130
|
viewBox: "0 0 28 28"
|
|
146
131
|
}, props, {
|
|
147
132
|
ref: ref
|
|
@@ -152,7 +137,6 @@ const LoadingOutlineIcon28 = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
152
137
|
} else {
|
|
153
138
|
t1 = $[3];
|
|
154
139
|
}
|
|
155
|
-
|
|
156
140
|
return t1;
|
|
157
141
|
});
|
|
158
142
|
LoadingOutlineIcon28.displayName = 'LoadingOutlineIcon28';
|
|
@@ -164,7 +148,6 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
164
148
|
let t1;
|
|
165
149
|
let t2;
|
|
166
150
|
let theme;
|
|
167
|
-
|
|
168
151
|
if ($[0] !== t0) {
|
|
169
152
|
({
|
|
170
153
|
theme,
|
|
@@ -189,7 +172,6 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
189
172
|
t2 = $[5];
|
|
190
173
|
theme = $[6];
|
|
191
174
|
}
|
|
192
|
-
|
|
193
175
|
const sizeFromProps = t1 === undefined ? "m" : t1;
|
|
194
176
|
const renderAllSizes = t2 === undefined ? false : t2;
|
|
195
177
|
const size = sizeFromProps in Size ? sizeFromProps : "m";
|
|
@@ -197,7 +179,6 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
197
179
|
const t4 = sizeStyles[size];
|
|
198
180
|
const t5 = renderAllSizes && styles.allVariants;
|
|
199
181
|
let t6;
|
|
200
|
-
|
|
201
182
|
if ($[7] !== className || $[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
|
|
202
183
|
t6 = cn(styles.icon, t3, t4, t5, className);
|
|
203
184
|
$[7] = className;
|
|
@@ -208,9 +189,7 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
208
189
|
} else {
|
|
209
190
|
t6 = $[11];
|
|
210
191
|
}
|
|
211
|
-
|
|
212
192
|
let t7;
|
|
213
|
-
|
|
214
193
|
if ($[12] !== renderAllSizes || $[13] !== style) {
|
|
215
194
|
t7 = renderAllSizes ? {
|
|
216
195
|
"--rs-icon-ar-width": 28,
|
|
@@ -223,11 +202,10 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
223
202
|
} else {
|
|
224
203
|
t7 = $[14];
|
|
225
204
|
}
|
|
226
|
-
|
|
227
205
|
let t8;
|
|
228
|
-
|
|
229
206
|
if ($[15] !== props || $[16] !== ref || $[17] !== t6 || $[18] !== t7) {
|
|
230
|
-
t8 = {
|
|
207
|
+
t8 = {
|
|
208
|
+
...props,
|
|
231
209
|
className: t6,
|
|
232
210
|
style: t7,
|
|
233
211
|
ref
|
|
@@ -240,15 +218,12 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
240
218
|
} else {
|
|
241
219
|
t8 = $[19];
|
|
242
220
|
}
|
|
243
|
-
|
|
244
221
|
const mainProps = t8;
|
|
245
|
-
|
|
246
222
|
if (renderAllSizes) {
|
|
247
223
|
let t10;
|
|
248
224
|
let t11;
|
|
249
225
|
let t12;
|
|
250
226
|
let t9;
|
|
251
|
-
|
|
252
227
|
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
253
228
|
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon16, {
|
|
254
229
|
className: styles.variant16
|
|
@@ -272,11 +247,9 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
272
247
|
t12 = $[22];
|
|
273
248
|
t9 = $[23];
|
|
274
249
|
}
|
|
275
|
-
|
|
276
250
|
let t13;
|
|
277
|
-
|
|
278
251
|
if ($[24] !== mainProps) {
|
|
279
|
-
t13 = /*#__PURE__*/React.createElement("svg",
|
|
252
|
+
t13 = /*#__PURE__*/React.createElement("svg", Object.assign({
|
|
280
253
|
viewBox: "0 0 28 28"
|
|
281
254
|
}, mainProps), t9, t10, t11, t12);
|
|
282
255
|
$[24] = mainProps;
|
|
@@ -284,13 +257,10 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
284
257
|
} else {
|
|
285
258
|
t13 = $[25];
|
|
286
259
|
}
|
|
287
|
-
|
|
288
260
|
return t13;
|
|
289
261
|
}
|
|
290
|
-
|
|
291
262
|
if (size === Size.xs) {
|
|
292
263
|
let t9;
|
|
293
|
-
|
|
294
264
|
if ($[26] !== mainProps) {
|
|
295
265
|
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon16, mainProps);
|
|
296
266
|
$[26] = mainProps;
|
|
@@ -298,13 +268,10 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
298
268
|
} else {
|
|
299
269
|
t9 = $[27];
|
|
300
270
|
}
|
|
301
|
-
|
|
302
271
|
return t9;
|
|
303
272
|
}
|
|
304
|
-
|
|
305
273
|
if (size === Size.s) {
|
|
306
274
|
let t9;
|
|
307
|
-
|
|
308
275
|
if ($[28] !== mainProps) {
|
|
309
276
|
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon20, mainProps);
|
|
310
277
|
$[28] = mainProps;
|
|
@@ -312,13 +279,10 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
312
279
|
} else {
|
|
313
280
|
t9 = $[29];
|
|
314
281
|
}
|
|
315
|
-
|
|
316
282
|
return t9;
|
|
317
283
|
}
|
|
318
|
-
|
|
319
284
|
if (size === Size.m) {
|
|
320
285
|
let t9;
|
|
321
|
-
|
|
322
286
|
if ($[30] !== mainProps) {
|
|
323
287
|
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon24, mainProps);
|
|
324
288
|
$[30] = mainProps;
|
|
@@ -326,12 +290,9 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
326
290
|
} else {
|
|
327
291
|
t9 = $[31];
|
|
328
292
|
}
|
|
329
|
-
|
|
330
293
|
return t9;
|
|
331
294
|
}
|
|
332
|
-
|
|
333
295
|
let t9;
|
|
334
|
-
|
|
335
296
|
if ($[32] !== mainProps) {
|
|
336
297
|
t9 = /*#__PURE__*/React.createElement(LoadingOutlineIcon28, mainProps);
|
|
337
298
|
$[32] = mainProps;
|
|
@@ -339,7 +300,6 @@ const LoadingOutlineIcon = /*#__PURE__*/React.forwardRef((t0, ref) => {
|
|
|
339
300
|
} else {
|
|
340
301
|
t9 = $[33];
|
|
341
302
|
}
|
|
342
|
-
|
|
343
303
|
return t9;
|
|
344
304
|
});
|
|
345
305
|
LoadingOutlineIcon.displayName = 'LoadingOutlineIcon';
|
|
@@ -350,4 +310,5 @@ LoadingOutlineIcon.propTypes = {
|
|
|
350
310
|
'data-render-all-sizes': PropTypes.bool,
|
|
351
311
|
style: PropTypes.object
|
|
352
312
|
};
|
|
313
|
+
|
|
353
314
|
export { Size, LoadingOutlineIcon as default };
|
package/lib/button.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import _extends from '@babel/runtime-corejs3/helpers/esm/extends';
|
|
3
|
-
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
4
2
|
import { c } from 'react-compiler-runtime';
|
|
5
3
|
import React, { useState, useRef, cloneElement } from 'react';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
@@ -10,8 +8,7 @@ import { useResizeObserver } from '@rescui/use-resize-observer';
|
|
|
10
8
|
import LoadingOutlineIcon from './_virtual/loading-outline.js';
|
|
11
9
|
import styles from './button.p.module.css.js';
|
|
12
10
|
|
|
13
|
-
const calculateShifted = (shiftedProp, side) => shiftedProp === 'all' || shiftedProp === side || Array.isArray(shiftedProp) &&
|
|
14
|
-
|
|
11
|
+
const calculateShifted = (shiftedProp, side) => shiftedProp === 'all' || shiftedProp === side || Array.isArray(shiftedProp) && shiftedProp.includes(side);
|
|
15
12
|
const MODE_STYLES = {
|
|
16
13
|
classic: styles.modeClassic,
|
|
17
14
|
rock: styles.modeRock,
|
|
@@ -31,7 +28,8 @@ const ICON_POSITION_STYLES = {
|
|
|
31
28
|
right: styles.alignIconRight,
|
|
32
29
|
'right-edge': styles.alignIconRightEdge
|
|
33
30
|
};
|
|
34
|
-
const Button = /*#__PURE__*/React.forwardRef(
|
|
31
|
+
const Button = /*#__PURE__*/React.forwardRef(
|
|
32
|
+
// eslint-disable-next-line complexity
|
|
35
33
|
(t0, forwardedRef) => {
|
|
36
34
|
const $ = c(82);
|
|
37
35
|
let children;
|
|
@@ -52,7 +50,6 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
52
50
|
let t6;
|
|
53
51
|
let t7;
|
|
54
52
|
let themeFromProps;
|
|
55
|
-
|
|
56
53
|
if ($[0] !== t0) {
|
|
57
54
|
({
|
|
58
55
|
className,
|
|
@@ -113,7 +110,6 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
113
110
|
t7 = $[17];
|
|
114
111
|
themeFromProps = $[18];
|
|
115
112
|
}
|
|
116
|
-
|
|
117
113
|
const type = t1 === undefined ? "button" : t1;
|
|
118
114
|
const size = t2 === undefined ? "m" : t2;
|
|
119
115
|
const iconPosition = t3 === undefined ? "left" : t3;
|
|
@@ -125,11 +121,9 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
125
121
|
const contentRef = useRef(null);
|
|
126
122
|
const ref = useRef(null);
|
|
127
123
|
let t8;
|
|
128
|
-
|
|
129
124
|
if ($[19] !== forwardedRef) {
|
|
130
125
|
t8 = el => {
|
|
131
126
|
ref.current = el;
|
|
132
|
-
|
|
133
127
|
if (forwardedRef) {
|
|
134
128
|
if (typeof forwardedRef === "function") {
|
|
135
129
|
forwardedRef(el);
|
|
@@ -138,16 +132,13 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
138
132
|
}
|
|
139
133
|
}
|
|
140
134
|
};
|
|
141
|
-
|
|
142
135
|
$[19] = forwardedRef;
|
|
143
136
|
$[20] = t8;
|
|
144
137
|
} else {
|
|
145
138
|
t8 = $[20];
|
|
146
139
|
}
|
|
147
|
-
|
|
148
140
|
const handleRef = t8;
|
|
149
141
|
let t9;
|
|
150
|
-
|
|
151
142
|
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
143
|
t9 = entry => {
|
|
153
144
|
const target = entry.target;
|
|
@@ -158,12 +149,10 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
158
149
|
const singleLineBlockSize = parseInt(targetStyles.lineHeight, 10);
|
|
159
150
|
setMultiline(height > singleLineBlockSize);
|
|
160
151
|
};
|
|
161
|
-
|
|
162
152
|
$[21] = t9;
|
|
163
153
|
} else {
|
|
164
154
|
t9 = $[21];
|
|
165
155
|
}
|
|
166
|
-
|
|
167
156
|
useResizeObserver(contentRef, t9);
|
|
168
157
|
const theme = useThemeWithUndefined(themeFromProps);
|
|
169
158
|
let iconSlot;
|
|
@@ -173,17 +162,14 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
173
162
|
let t11;
|
|
174
163
|
let t12;
|
|
175
164
|
let t13;
|
|
176
|
-
|
|
177
165
|
if ($[22] !== allowMultiline || $[23] !== busy || $[24] !== children || $[25] !== className || $[26] !== disabled || $[27] !== flat || $[28] !== highlighted || $[29] !== href || $[30] !== icon || $[31] !== iconPosition || $[32] !== mode || $[33] !== multiline || $[34] !== shifted || $[35] !== size || $[36] !== theme) {
|
|
178
166
|
const shiftedLeft = calculateShifted(shifted, "left");
|
|
179
167
|
const shiftedRight = calculateShifted(shifted, "right");
|
|
180
168
|
const shiftedTop = calculateShifted(shifted, "top");
|
|
181
169
|
const shiftedBottom = calculateShifted(shifted, "bottom");
|
|
182
170
|
isWithoutText = children === null || typeof children === "undefined" || children === false || children === true || children === "";
|
|
183
|
-
|
|
184
|
-
if ( /*#__PURE__*/ /*#__PURE__*/React.isValidElement(icon) && busy) {
|
|
171
|
+
if (/*#__PURE__*/React.isValidElement(icon) && busy) {
|
|
185
172
|
let t14;
|
|
186
|
-
|
|
187
173
|
if ($[44] === Symbol.for("react.memo_cache_sentinel")) {
|
|
188
174
|
t14 = /*#__PURE__*/React.createElement(LoadingOutlineIcon, {
|
|
189
175
|
className: styles.icon,
|
|
@@ -193,12 +179,10 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
193
179
|
} else {
|
|
194
180
|
t14 = $[44];
|
|
195
181
|
}
|
|
196
|
-
|
|
197
182
|
iconSlot = t14;
|
|
198
183
|
} else {
|
|
199
|
-
if (
|
|
184
|
+
if (/*#__PURE__*/React.isValidElement(icon)) {
|
|
200
185
|
let t14;
|
|
201
|
-
|
|
202
186
|
if ($[45] !== icon) {
|
|
203
187
|
t14 = /*#__PURE__*/cloneElement(icon, {
|
|
204
188
|
className: cn(icon.props?.className, styles.icon),
|
|
@@ -209,13 +193,10 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
209
193
|
} else {
|
|
210
194
|
t14 = $[46];
|
|
211
195
|
}
|
|
212
|
-
|
|
213
196
|
iconSlot = t14;
|
|
214
197
|
}
|
|
215
198
|
}
|
|
216
|
-
|
|
217
199
|
let t14;
|
|
218
|
-
|
|
219
200
|
if ($[47] !== busy || $[48] !== icon) {
|
|
220
201
|
t14 = ! /*#__PURE__*/React.isValidElement(icon) && busy;
|
|
221
202
|
$[47] = busy;
|
|
@@ -224,7 +205,6 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
224
205
|
} else {
|
|
225
206
|
t14 = $[49];
|
|
226
207
|
}
|
|
227
|
-
|
|
228
208
|
showBusyOverlay = t14;
|
|
229
209
|
t10 = href;
|
|
230
210
|
t11 = disabled || busy;
|
|
@@ -275,9 +255,7 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
275
255
|
t12 = $[42];
|
|
276
256
|
t13 = $[43];
|
|
277
257
|
}
|
|
278
|
-
|
|
279
258
|
let t14;
|
|
280
|
-
|
|
281
259
|
if ($[50] !== t10 || $[51] !== t11 || $[52] !== t12 || $[53] !== t13) {
|
|
282
260
|
t14 = {
|
|
283
261
|
href: t10,
|
|
@@ -293,10 +271,8 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
293
271
|
} else {
|
|
294
272
|
t14 = $[54];
|
|
295
273
|
}
|
|
296
|
-
|
|
297
274
|
const buttonSharedProps = t14;
|
|
298
275
|
let t15;
|
|
299
|
-
|
|
300
276
|
if ($[55] !== children || $[56] !== isWithoutText) {
|
|
301
277
|
t15 = !isWithoutText && /*#__PURE__*/React.createElement("span", {
|
|
302
278
|
className: styles.content,
|
|
@@ -310,10 +286,8 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
310
286
|
} else {
|
|
311
287
|
t15 = $[57];
|
|
312
288
|
}
|
|
313
|
-
|
|
314
289
|
const buttonContent = t15;
|
|
315
290
|
let t16;
|
|
316
|
-
|
|
317
291
|
if ($[58] !== showBusyOverlay || $[59] !== size) {
|
|
318
292
|
t16 = showBusyOverlay && /*#__PURE__*/React.createElement(LoadingOutlineIcon, {
|
|
319
293
|
className: styles.busyIcon,
|
|
@@ -326,9 +300,7 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
326
300
|
} else {
|
|
327
301
|
t16 = $[60];
|
|
328
302
|
}
|
|
329
|
-
|
|
330
303
|
let t17;
|
|
331
|
-
|
|
332
304
|
if ($[61] !== buttonContent || $[62] !== iconSlot || $[63] !== t16) {
|
|
333
305
|
t17 = /*#__PURE__*/React.createElement(React.Fragment, null, iconSlot, t16, buttonContent);
|
|
334
306
|
$[61] = buttonContent;
|
|
@@ -338,18 +310,14 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
338
310
|
} else {
|
|
339
311
|
t17 = $[64];
|
|
340
312
|
}
|
|
341
|
-
|
|
342
313
|
const buttonChildren = t17;
|
|
343
|
-
|
|
344
314
|
if (notFocusable) {
|
|
345
315
|
if (href) {
|
|
346
316
|
console.error("Button with `href` can't be completely not focusable. If you want to remove Button with `href` from focus flow, use `tabIndex=\"-1\"` instead of `notFocusable`");
|
|
347
317
|
}
|
|
348
|
-
|
|
349
318
|
let t18;
|
|
350
|
-
|
|
351
319
|
if ($[65] !== buttonChildren || $[66] !== buttonSharedProps || $[67] !== handleRef || $[68] !== restProps) {
|
|
352
|
-
t18 = /*#__PURE__*/React.createElement("div",
|
|
320
|
+
t18 = /*#__PURE__*/React.createElement("div", Object.assign({
|
|
353
321
|
"data-test": "button"
|
|
354
322
|
}, restProps, {
|
|
355
323
|
ref: handleRef
|
|
@@ -362,14 +330,12 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
362
330
|
} else {
|
|
363
331
|
t18 = $[69];
|
|
364
332
|
}
|
|
365
|
-
|
|
366
333
|
return t18;
|
|
367
334
|
} else {
|
|
368
335
|
if (href) {
|
|
369
336
|
let t18;
|
|
370
|
-
|
|
371
337
|
if ($[70] !== buttonChildren || $[71] !== buttonSharedProps || $[72] !== handleRef || $[73] !== restProps || $[74] !== type) {
|
|
372
|
-
t18 = /*#__PURE__*/React.createElement("a",
|
|
338
|
+
t18 = /*#__PURE__*/React.createElement("a", Object.assign({
|
|
373
339
|
"data-test": "button"
|
|
374
340
|
}, restProps, {
|
|
375
341
|
ref: handleRef,
|
|
@@ -384,13 +350,11 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
384
350
|
} else {
|
|
385
351
|
t18 = $[75];
|
|
386
352
|
}
|
|
387
|
-
|
|
388
353
|
return t18;
|
|
389
354
|
} else {
|
|
390
355
|
let t18;
|
|
391
|
-
|
|
392
356
|
if ($[76] !== buttonChildren || $[77] !== buttonSharedProps || $[78] !== handleRef || $[79] !== restProps || $[80] !== type) {
|
|
393
|
-
t18 = /*#__PURE__*/React.createElement("button",
|
|
357
|
+
t18 = /*#__PURE__*/React.createElement("button", Object.assign({
|
|
394
358
|
"data-test": "button"
|
|
395
359
|
}, restProps, {
|
|
396
360
|
ref: handleRef,
|
|
@@ -405,31 +369,25 @@ const Button = /*#__PURE__*/React.forwardRef( // eslint-disable-next-line comple
|
|
|
405
369
|
} else {
|
|
406
370
|
t18 = $[81];
|
|
407
371
|
}
|
|
408
|
-
|
|
409
372
|
return t18;
|
|
410
373
|
}
|
|
411
374
|
}
|
|
412
375
|
});
|
|
413
376
|
Button.displayName = 'Button';
|
|
414
|
-
|
|
415
377
|
function validateAdditional(propType, callback) {
|
|
416
378
|
return (props, propName) => {
|
|
417
379
|
if (typeof props[propName] !== 'undefined') {
|
|
418
380
|
const cbRes = callback(props, propName);
|
|
419
|
-
|
|
420
381
|
if (cbRes) {
|
|
421
382
|
return cbRes;
|
|
422
383
|
}
|
|
423
|
-
|
|
424
384
|
PropTypes.checkPropTypes({
|
|
425
385
|
[propName]: propType
|
|
426
386
|
}, props, 'prop', 'Button');
|
|
427
387
|
}
|
|
428
|
-
|
|
429
388
|
return null;
|
|
430
389
|
};
|
|
431
390
|
}
|
|
432
|
-
|
|
433
391
|
Button.propTypes = {
|
|
434
392
|
className: PropTypes.string,
|
|
435
393
|
children: PropTypes.node,
|
|
@@ -438,7 +396,6 @@ Button.propTypes = {
|
|
|
438
396
|
if (typeof props.notFocusable !== 'undefined') {
|
|
439
397
|
return new Error(`'href' prop cannot be used with 'notFocusable' prop`);
|
|
440
398
|
}
|
|
441
|
-
|
|
442
399
|
return null;
|
|
443
400
|
}),
|
|
444
401
|
icon: PropTypes.node,
|
|
@@ -448,7 +405,6 @@ Button.propTypes = {
|
|
|
448
405
|
if (typeof props.shifted !== 'undefined' && props.mode !== 'clear') {
|
|
449
406
|
return new Error(`'shifted' prop cannot be used when 'mode' prop is not 'clear'.`);
|
|
450
407
|
}
|
|
451
|
-
|
|
452
408
|
return null;
|
|
453
409
|
}),
|
|
454
410
|
theme: PropTypes.oneOf(['light', 'dark']),
|
|
@@ -458,7 +414,6 @@ Button.propTypes = {
|
|
|
458
414
|
if (typeof props.href !== 'undefined' || typeof props.target !== 'undefined') {
|
|
459
415
|
return new Error(`'notFocusable' prop cannot be used with 'href' and 'target' props`);
|
|
460
416
|
}
|
|
461
|
-
|
|
462
417
|
return null;
|
|
463
418
|
}),
|
|
464
419
|
busy: PropTypes.bool,
|
|
@@ -468,4 +423,5 @@ Button.propTypes = {
|
|
|
468
423
|
defaultMultiline: PropTypes.bool,
|
|
469
424
|
shifted: PropTypes.oneOfType([PropTypes.oneOf(['all', 'left', 'right', 'top', 'bottom']), PropTypes.arrayOf(PropTypes.oneOf(['left', 'right', 'top', 'bottom']))])
|
|
470
425
|
};
|
|
426
|
+
|
|
471
427
|
export { Button, Button as default };
|
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
var styles = {
|
|
2
|
-
|
|
3
|
-
"dark": "_dark_xhkdfz_9",
|
|
4
|
-
"flatRight": "_flatRight_xhkdfz_13",
|
|
5
|
-
"flatLeft": "_flatLeft_xhkdfz_16",
|
|
6
|
-
"sizeXs": "_sizeXs_xhkdfz_20",
|
|
7
|
-
"sizeS": "_sizeS_xhkdfz_23",
|
|
8
|
-
"sizeM": "_sizeM_xhkdfz_26",
|
|
9
|
-
"sizeL": "_sizeL_xhkdfz_29",
|
|
10
|
-
"modeClassic": "_modeClassic_xhkdfz_33",
|
|
11
|
-
"modeRock": "_modeRock_xhkdfz_36",
|
|
12
|
-
"modeTransparent": "_modeTransparent_xhkdfz_39",
|
|
13
|
-
"modeOutline": "_modeOutline_xhkdfz_42",
|
|
14
|
-
"modeClear": "_modeClear_xhkdfz_45",
|
|
15
|
-
"alignIconLeft": "_alignIconLeft_xhkdfz_49",
|
|
16
|
-
"alignIconLeftEdge": "_alignIconLeftEdge_xhkdfz_52",
|
|
17
|
-
"alignIconRight": "_alignIconRight_xhkdfz_55",
|
|
18
|
-
"alignIconRightEdge": "_alignIconRightEdge_xhkdfz_58",
|
|
19
|
-
"main": "_main_xhkdfz_62",
|
|
20
|
-
"disabled": "_disabled_xhkdfz_139",
|
|
21
|
-
"busy": "_busy_xhkdfz_149",
|
|
22
|
-
"busyOverlay": "_busyOverlay_xhkdfz_153",
|
|
23
|
-
"icon": "_icon_xhkdfz_188",
|
|
24
|
-
"allowMultiline": "_allowMultiline_xhkdfz_203",
|
|
25
|
-
"content": "_content_xhkdfz_207",
|
|
26
|
-
"multiline": "_multiline_xhkdfz_213",
|
|
27
|
-
"withoutText": "_withoutText_xhkdfz_217",
|
|
28
|
-
"busyIcon": "_busyIcon_xhkdfz_222",
|
|
29
|
-
"shiftedLeft": "_shiftedLeft_xhkdfz_243",
|
|
30
|
-
"shiftedRight": "_shiftedRight_xhkdfz_246",
|
|
31
|
-
"shiftedTop": "_shiftedTop_xhkdfz_249",
|
|
32
|
-
"shiftedBottom": "_shiftedBottom_xhkdfz_252"
|
|
33
|
-
};
|
|
1
|
+
var styles = {"light":"_light_x8sqm_6","dark":"_dark_x8sqm_9","flatRight":"_flatRight_x8sqm_13","flatLeft":"_flatLeft_x8sqm_16","sizeXs":"_sizeXs_x8sqm_20","sizeS":"_sizeS_x8sqm_23","sizeM":"_sizeM_x8sqm_26","sizeL":"_sizeL_x8sqm_29","modeClassic":"_modeClassic_x8sqm_33","modeRock":"_modeRock_x8sqm_36","modeTransparent":"_modeTransparent_x8sqm_39","modeOutline":"_modeOutline_x8sqm_42","modeClear":"_modeClear_x8sqm_45","alignIconLeft":"_alignIconLeft_x8sqm_49","alignIconLeftEdge":"_alignIconLeftEdge_x8sqm_52","alignIconRight":"_alignIconRight_x8sqm_55","alignIconRightEdge":"_alignIconRightEdge_x8sqm_58","main":"_main_x8sqm_62","disabled":"_disabled_x8sqm_139","busy":"_busy_x8sqm_149","busyOverlay":"_busyOverlay_x8sqm_153","icon":"_icon_x8sqm_188","allowMultiline":"_allowMultiline_x8sqm_203","content":"_content_x8sqm_207","multiline":"_multiline_x8sqm_213","withoutText":"_withoutText_x8sqm_217","busyIcon":"_busyIcon_x8sqm_222","shiftedLeft":"_shiftedLeft_x8sqm_243","shiftedRight":"_shiftedRight_x8sqm_246","shiftedTop":"_shiftedTop_x8sqm_249","shiftedBottom":"_shiftedBottom_x8sqm_252"};
|
|
2
|
+
|
|
34
3
|
export { styles as default };
|