@taikai/rocket-kit 3.0.0-beta.3 → 3.0.0-beta.5
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/dist/ions/variables.d.ts +0 -1
- package/dist/rocket-kit.cjs.development.js +38 -100
- package/dist/rocket-kit.cjs.development.js.map +1 -1
- package/dist/rocket-kit.cjs.production.min.js +234 -234
- package/dist/rocket-kit.cjs.production.min.js.map +1 -1
- package/dist/rocket-kit.esm.js +38 -100
- package/dist/rocket-kit.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/ions/variables.d.ts
CHANGED
|
@@ -190,16 +190,15 @@ const typography = {
|
|
|
190
190
|
defaultSize: '16px',
|
|
191
191
|
regular: 400,
|
|
192
192
|
medium: 500,
|
|
193
|
-
bold: 700
|
|
194
|
-
letterSpacing: /*#__PURE__*/polished.rem('1px')
|
|
193
|
+
bold: 700
|
|
195
194
|
};
|
|
196
195
|
const button = {
|
|
197
|
-
height: /*#__PURE__*/polished.rem('
|
|
196
|
+
height: /*#__PURE__*/polished.rem('44px'),
|
|
198
197
|
borderWidth: /*#__PURE__*/polished.rem('1px'),
|
|
199
198
|
borderRadius: /*#__PURE__*/polished.rem('8px'),
|
|
200
|
-
padding: /*#__PURE__*/polished.rem('
|
|
201
|
-
iconSpacing: /*#__PURE__*/polished.rem('
|
|
202
|
-
iconSize: /*#__PURE__*/polished.rem('
|
|
199
|
+
padding: /*#__PURE__*/polished.rem('24px'),
|
|
200
|
+
iconSpacing: /*#__PURE__*/polished.rem('14px'),
|
|
201
|
+
iconSize: /*#__PURE__*/polished.rem('20px')
|
|
203
202
|
};
|
|
204
203
|
const misc = {
|
|
205
204
|
transitionDuration: '0.3s'
|
|
@@ -247,16 +246,14 @@ const useColor = value => {
|
|
|
247
246
|
const c = value.split(/([0-9]+)/).filter(Boolean);
|
|
248
247
|
const tint = c[0];
|
|
249
248
|
const hue = parseFloat(c[1]);
|
|
250
|
-
|
|
251
249
|
const getHoverColor = (tint, hue) => {
|
|
252
250
|
const indexCurrentHue = colorHues.indexOf(hue);
|
|
253
251
|
const indexIsLast = indexCurrentHue === colorHues.length - 1;
|
|
254
|
-
const indexHoverHue = indexIsLast ? indexCurrentHue - 1 : indexCurrentHue + 1;
|
|
255
|
-
|
|
252
|
+
const indexHoverHue = indexIsLast ? indexCurrentHue - 1 : indexCurrentHue + 1;
|
|
253
|
+
// @ts-ignore
|
|
256
254
|
const hoverColor = colors == null ? void 0 : colors[indexCurrentHue > -1 ? tint + colorHues[indexHoverHue] : tint];
|
|
257
255
|
return hoverColor != null ? hoverColor : colors.black;
|
|
258
256
|
};
|
|
259
|
-
|
|
260
257
|
const hover = getHoverColor(tint, hue);
|
|
261
258
|
return {
|
|
262
259
|
color,
|
|
@@ -267,26 +264,23 @@ const useColor = value => {
|
|
|
267
264
|
const ButtonWrapper = /*#__PURE__*/_styled__default.button.withConfig({
|
|
268
265
|
displayName: "styles__ButtonWrapper",
|
|
269
266
|
componentId: "sc-baestp-0"
|
|
270
|
-
})(["--bg:", ";--txt:", ";--hover:", ";margin:0;border-width:", ";border-style:solid;border-color:var(--bg);border-radius:", ";background-color:", ";width:min-content;min-width:", ";height:", ";display:flex;justify-content:center;align-items:center;padding:", ";
|
|
267
|
+
})(["--bg:", ";--txt:", ";--hover:", ";margin:0;border-width:", ";border-style:solid;border-color:var(--bg);border-radius:", ";background-color:", ";width:min-content;min-width:", ";height:", ";display:flex;justify-content:center;align-items:center;padding:", ";white-space:nowrap;text-decoration:none;transition-duration:", ";cursor:pointer;&:hover{border-color:", ";background-color:", ";span{color:", ";}svg{fill:", ";}}&:disabled{cursor:inherit;opacity:0.5;&:hover{background-color:", ";pointer-events:none;}}> *:not(:last-child){margin-left:", ";margin-right:", ";}.spinner{border-top-color:", ";}span{position:relative;font-size:", ";font-weight:", ";line-height:", ";color:", ";pointer-events:none;transition-duration:", ";order:", ";}svg{order:", ";width:", ";height:", ";fill:", ";transition:", ";}"], props => {
|
|
271
268
|
var _props$color;
|
|
272
|
-
|
|
273
269
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
274
270
|
}, props => {
|
|
275
|
-
var _props$txtColor;
|
|
276
|
-
|
|
277
|
-
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
271
|
+
var _props$color2, _props$txtColor;
|
|
272
|
+
return props.variant === 'outline' && !props.txtColor ? useColor((_props$color2 = props.color) != null ? _props$color2 : 'black').color : useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'white').color;
|
|
278
273
|
}, props => {
|
|
279
|
-
var _props$
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, props => props.variant === 'outline' ? button.borderWidth : 0, props => props.variant === 'text' ? 0 : props.rounded ? '999px' : button.borderRadius, props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.value ? polished.rem('80px') : polished.rem('42px'), button.height, props => props.value ? `0 ${button.padding}` : 0, misc.transitionDuration, props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--hover)' : 'transparent', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.iconPosition === 'right' ? button.iconSpacing : 0, props => props.iconPosition === 'left' ? button.iconSpacing : 0, props => props.variant === 'solid' ? '' : 'var(--button)', /*#__PURE__*/polished.rem(typography.defaultSize), typography.medium, typography.letterSpacing, /*#__PURE__*/polished.rem(typography.defaultSize), props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration, props => props.iconPosition === 'left' ? 2 : 1, props => props.iconPosition === 'left' ? 1 : 2, button.iconSize, button.iconSize, props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration);
|
|
274
|
+
var _props$color3;
|
|
275
|
+
return props.color === 'white' ? colors.grey100 : props.color === 'black' ? colors.grey900 : useColor((_props$color3 = props.color) != null ? _props$color3 : 'black').hover;
|
|
276
|
+
}, props => props.variant === 'outline' ? button.borderWidth : 0, props => props.variant === 'text' ? 0 : props.rounded ? '999px' : button.borderRadius, props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.value ? polished.rem('80px') : polished.rem('42px'), button.height, props => props.value ? `0 ${button.padding}` : 0, misc.transitionDuration, props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--hover)' : 'transparent', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.iconPosition === 'right' ? button.iconSpacing : 0, props => props.iconPosition === 'left' ? button.iconSpacing : 0, props => props.variant === 'solid' ? '' : 'var(--button)', /*#__PURE__*/polished.rem(typography.defaultSize), typography.medium, /*#__PURE__*/polished.rem(typography.defaultSize), props => props.variant === 'solid' || props.variant === 'outline' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration, props => props.iconPosition === 'left' ? 2 : 1, props => props.iconPosition === 'left' ? 1 : 2, button.iconSize, button.iconSize, props => props.variant === 'solid' || props.variant === 'outline' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration);
|
|
283
277
|
|
|
284
278
|
const Button = props => {
|
|
285
279
|
const {
|
|
286
280
|
variant = 'solid',
|
|
287
281
|
rounded = false,
|
|
288
282
|
color = 'purple500',
|
|
289
|
-
txtColor
|
|
283
|
+
txtColor,
|
|
290
284
|
type,
|
|
291
285
|
className = 'button',
|
|
292
286
|
style,
|
|
@@ -335,15 +329,12 @@ const ActionsMenuStyle = /*#__PURE__*/_styled__default.div.withConfig({
|
|
|
335
329
|
function useVisible(initialIsVisible) {
|
|
336
330
|
const [isVisible, setIsVisible] = React.useState(initialIsVisible);
|
|
337
331
|
const ref = React.useRef(null);
|
|
338
|
-
|
|
339
332
|
const handleClickOutside = event => {
|
|
340
333
|
if (!ref || !ref.current) return;
|
|
341
|
-
|
|
342
334
|
if (!ref.current.contains(event.target)) {
|
|
343
335
|
setIsVisible(false);
|
|
344
336
|
}
|
|
345
337
|
};
|
|
346
|
-
|
|
347
338
|
React.useEffect(() => {
|
|
348
339
|
document.addEventListener('click', handleClickOutside, false);
|
|
349
340
|
return () => {
|
|
@@ -431,26 +422,23 @@ const ButtonDropdown = props => {
|
|
|
431
422
|
const ButtonLinkStyle = /*#__PURE__*/_styled__default.a.withConfig({
|
|
432
423
|
displayName: "styles__ButtonLinkStyle",
|
|
433
424
|
componentId: "sc-clge7v-0"
|
|
434
|
-
})(["--bg:", ";--txt:", ";--hover:", ";border-width:", ";border-style:solid;border-color:var(--bg);border-radius:", ";background-color:", ";width:min-content;min-width:", ";height:", ";display:flex;justify-content:center;align-items:center;padding:", ";
|
|
425
|
+
})(["--bg:", ";--txt:", ";--hover:", ";border-width:", ";border-style:solid;border-color:var(--bg);border-radius:", ";background-color:", ";width:min-content;min-width:", ";height:", ";display:flex;justify-content:center;align-items:center;padding:", ";white-space:nowrap;text-decoration:none;transition-duration:", ";cursor:pointer;&:hover{border-color:", ";background-color:", ";span{color:", ";}svg{fill:", ";}}> *:not(:last-child){margin-left:", ";margin-right:", ";}span{position:relative;font-size:", ";font-weight:", ";line-height:", ";color:", ";pointer-events:none;transition-duration:", ";order:", ";}svg{order:", ";width:", ";height:", ";fill:", ";transition:", ";}"], props => {
|
|
435
426
|
var _props$color;
|
|
436
|
-
|
|
437
427
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
438
428
|
}, props => {
|
|
439
|
-
var _props$txtColor;
|
|
440
|
-
|
|
441
|
-
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
429
|
+
var _props$color2, _props$txtColor;
|
|
430
|
+
return props.variant === 'outline' && !props.txtColor ? useColor((_props$color2 = props.color) != null ? _props$color2 : 'black').color : useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'white').color;
|
|
442
431
|
}, props => {
|
|
443
|
-
var _props$
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
}, props => props.variant === 'outline' ? button.borderWidth : 0, props => props.variant === 'text' ? 0 : props.rounded ? '999px' : button.borderRadius, props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.value ? polished.rem('80px') : polished.rem('42px'), button.height, props => props.value ? `0 ${button.padding}` : 0, misc.transitionDuration, props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--hover)' : 'transparent', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.iconPosition === 'right' ? button.iconSpacing : 0, props => props.iconPosition === 'left' ? button.iconSpacing : 0, /*#__PURE__*/polished.rem(typography.defaultSize), typography.medium, typography.letterSpacing, /*#__PURE__*/polished.rem(typography.defaultSize), props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration, props => props.iconPosition === 'left' ? 2 : 1, props => props.iconPosition === 'left' ? 1 : 2, button.iconSize, button.iconSize, props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration);
|
|
432
|
+
var _props$color3;
|
|
433
|
+
return props.color === 'white' ? colors.grey100 : props.color === 'black' ? colors.grey900 : useColor((_props$color3 = props.color) != null ? _props$color3 : 'black').hover;
|
|
434
|
+
}, props => props.variant === 'outline' ? button.borderWidth : 0, props => props.variant === 'text' ? 0 : props.rounded ? '999px' : button.borderRadius, props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', props => props.value ? polished.rem('80px') : polished.rem('42px'), button.height, props => props.value ? `0 ${button.padding}` : 0, misc.transitionDuration, props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? 'var(--hover)' : 'transparent', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.variant === 'solid' ? '' : 'var(--hover)', props => props.iconPosition === 'right' ? button.iconSpacing : 0, props => props.iconPosition === 'left' ? button.iconSpacing : 0, /*#__PURE__*/polished.rem(typography.defaultSize), typography.medium, /*#__PURE__*/polished.rem(typography.defaultSize), props => props.variant === 'solid' || props.variant === 'outline' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration, props => props.iconPosition === 'left' ? 2 : 1, props => props.iconPosition === 'left' ? 1 : 2, button.iconSize, button.iconSize, props => props.variant === 'solid' || props.variant === 'outline' ? 'var(--txt)' : 'var(--bg)', misc.transitionDuration);
|
|
447
435
|
|
|
448
436
|
const ButtonLink = props => {
|
|
449
437
|
const {
|
|
450
438
|
variant = 'solid',
|
|
451
439
|
rounded = false,
|
|
452
440
|
color = 'purple500',
|
|
453
|
-
txtColor
|
|
441
|
+
txtColor,
|
|
454
442
|
className = 'button-link',
|
|
455
443
|
style,
|
|
456
444
|
action = () => {},
|
|
@@ -465,12 +453,10 @@ const ButtonLink = props => {
|
|
|
465
453
|
ariaLabel = '',
|
|
466
454
|
ariaHidden = false
|
|
467
455
|
} = props;
|
|
468
|
-
|
|
469
456
|
const getRelationshipAttributes = () => {
|
|
470
457
|
if (rel && rel !== '') return rel;
|
|
471
458
|
return blank ? 'noopener noreferrer' : '';
|
|
472
459
|
};
|
|
473
|
-
|
|
474
460
|
return /*#__PURE__*/React__default.createElement(ButtonLinkStyle, {
|
|
475
461
|
variant: variant,
|
|
476
462
|
rounded: rounded,
|
|
@@ -534,24 +520,21 @@ const Checkbox = ({
|
|
|
534
520
|
}) => {
|
|
535
521
|
const checkedRef = React.useRef(checked);
|
|
536
522
|
const [isChecked, setIsChecked] = React.useState(checked);
|
|
537
|
-
|
|
538
523
|
const handleOnChange = event => {
|
|
539
524
|
setIsChecked(prev => !prev);
|
|
540
525
|
onChange(event);
|
|
541
526
|
};
|
|
542
|
-
|
|
543
527
|
const checkmarkClassName = React.useMemo(() => {
|
|
544
528
|
let isCheckStr = '';
|
|
545
|
-
let isDisabledStr = '';
|
|
529
|
+
let isDisabledStr = '';
|
|
530
|
+
// if they are different
|
|
546
531
|
// use the value coming from the props
|
|
547
532
|
// as it is the source of truth
|
|
548
|
-
|
|
549
533
|
if (checked !== checkedRef.current) {
|
|
550
534
|
setIsChecked(checked);
|
|
551
535
|
checkedRef.current = checked;
|
|
552
536
|
isCheckStr = checked ? 'checked' : 'not-checked';
|
|
553
537
|
} else if (isChecked) isCheckStr = 'checked';else isCheckStr = 'not-checked';
|
|
554
|
-
|
|
555
538
|
if (disabled) isDisabledStr = 'disabled';else isDisabledStr = 'not-disabled';
|
|
556
539
|
return `${isCheckStr} ${isDisabledStr}`;
|
|
557
540
|
}, [checked, isChecked, disabled]);
|
|
@@ -1018,7 +1001,6 @@ const LabelStyle = /*#__PURE__*/_styled__default.label.withConfig({
|
|
|
1018
1001
|
const {
|
|
1019
1002
|
grey: grey$7
|
|
1020
1003
|
} = colors;
|
|
1021
|
-
|
|
1022
1004
|
const Label = props => {
|
|
1023
1005
|
const {
|
|
1024
1006
|
value,
|
|
@@ -1054,7 +1036,6 @@ const Loading = /*#__PURE__*/_styled__default.div.withConfig({
|
|
|
1054
1036
|
const {
|
|
1055
1037
|
grey: grey$8
|
|
1056
1038
|
} = colors;
|
|
1057
|
-
|
|
1058
1039
|
const Spinner = props => {
|
|
1059
1040
|
const {
|
|
1060
1041
|
fill = grey$8,
|
|
@@ -1075,11 +1056,9 @@ const TagWrapper = /*#__PURE__*/_styled__default.span.withConfig({
|
|
|
1075
1056
|
componentId: "sc-1ghratr-0"
|
|
1076
1057
|
})(["--bg:", ";--txt:", ";display:inline-block;border:", " solid var(--bg);border-radius:", ";background-color:", ";padding:", " ", ";font-size:", ";font-weight:", ";text-transform:uppercase;letter-spacing:", ";line-height:1;color:", ";white-space:nowrap;"], props => {
|
|
1077
1058
|
var _props$color;
|
|
1078
|
-
|
|
1079
1059
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
1080
1060
|
}, props => {
|
|
1081
1061
|
var _props$txtColor;
|
|
1082
|
-
|
|
1083
1062
|
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
1084
1063
|
}, /*#__PURE__*/polished.rem('2px'), /*#__PURE__*/polished.rem('4px'), props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', /*#__PURE__*/polished.rem('3px'), /*#__PURE__*/polished.rem('8px'), /*#__PURE__*/polished.rem('12px'), typography.medium, /*#__PURE__*/polished.rem('1px'), props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)');
|
|
1085
1064
|
|
|
@@ -1107,11 +1086,9 @@ const TagWrapper$1 = /*#__PURE__*/_styled__default.div.withConfig({
|
|
|
1107
1086
|
componentId: "sc-db57da-0"
|
|
1108
1087
|
})(["--bg:", ";--valueColor:", ";display:flex;border:", " solid var(--bg);border-radius:", ";line-height:1;max-width:100%;width:max-content;overflow:hidden;span{display:inline-block;padding:", " ", ";font-size:", ";font-weight:", ";letter-spacing:", ";&.label{flex:1;color:var(--bg);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-transform:uppercase;}&.value{background-color:var(--bg);color:var(--valueColor);}}&:not(:first-child){margin-left:", ";}"], props => {
|
|
1109
1088
|
var _props$color;
|
|
1110
|
-
|
|
1111
1089
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
1112
1090
|
}, props => {
|
|
1113
1091
|
var _props$valueColor;
|
|
1114
|
-
|
|
1115
1092
|
return useColor((_props$valueColor = props.valueColor) != null ? _props$valueColor : 'black').color;
|
|
1116
1093
|
}, /*#__PURE__*/polished.rem('2px'), /*#__PURE__*/polished.rem('3px'), /*#__PURE__*/polished.rem('3px'), /*#__PURE__*/polished.rem('8px'), /*#__PURE__*/polished.rem('12px'), typography.medium, /*#__PURE__*/polished.rem('1px'), /*#__PURE__*/polished.rem('5px'));
|
|
1117
1094
|
|
|
@@ -1408,7 +1385,6 @@ const {
|
|
|
1408
1385
|
} = Select$1.components;
|
|
1409
1386
|
const FormatGroupLabel = props => {
|
|
1410
1387
|
var _props$options;
|
|
1411
|
-
|
|
1412
1388
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1413
1389
|
style: {
|
|
1414
1390
|
display: 'flex',
|
|
@@ -1980,7 +1956,6 @@ const Slideshow = props => {
|
|
|
1980
1956
|
title: `Slide ${index + 1} selected`
|
|
1981
1957
|
});
|
|
1982
1958
|
}
|
|
1983
|
-
|
|
1984
1959
|
return /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement("button", {
|
|
1985
1960
|
onClick: onClickHandler,
|
|
1986
1961
|
onKeyDown: onClickHandler,
|
|
@@ -2182,13 +2157,11 @@ const Toggle = ({
|
|
|
2182
2157
|
// tracks the active state so it's easier to test
|
|
2183
2158
|
const [state, setState] = React.useState(checked);
|
|
2184
2159
|
const [id, setId] = React.useState('');
|
|
2185
|
-
|
|
2186
2160
|
const handleClick = value => {
|
|
2187
2161
|
if (disabled) return;
|
|
2188
2162
|
setState(value);
|
|
2189
2163
|
return onClick(value);
|
|
2190
2164
|
};
|
|
2191
|
-
|
|
2192
2165
|
React.useEffect(() => {
|
|
2193
2166
|
// If the ID stays outside the component
|
|
2194
2167
|
// it will be the same if we instantiate
|
|
@@ -2340,15 +2313,13 @@ const FilePicker = props => {
|
|
|
2340
2313
|
disabled = false
|
|
2341
2314
|
} = props;
|
|
2342
2315
|
const [fileName, setFileName] = React.useState(value ? value : placeholder);
|
|
2343
|
-
|
|
2344
2316
|
const getUploadedFileName = e => {
|
|
2345
2317
|
let files = e.target.files,
|
|
2346
|
-
|
|
2347
|
-
|
|
2318
|
+
value = e.target.value,
|
|
2319
|
+
fileName;
|
|
2348
2320
|
if (files && files.length > 1) fileName = `${files.length} ${pluralText}`;else fileName = value.split('\\').pop();
|
|
2349
2321
|
if (fileName) setFileName(fileName);
|
|
2350
2322
|
};
|
|
2351
|
-
|
|
2352
2323
|
return /*#__PURE__*/React__default.createElement(Wrapper$6, {
|
|
2353
2324
|
disabled: disabled,
|
|
2354
2325
|
minimal: minimal,
|
|
@@ -2430,7 +2401,6 @@ const ActionMenuList = props => {
|
|
|
2430
2401
|
}
|
|
2431
2402
|
}, /*#__PURE__*/React__default.createElement("span", null, value)))));
|
|
2432
2403
|
};
|
|
2433
|
-
|
|
2434
2404
|
const ActionsMenu = props => {
|
|
2435
2405
|
const {
|
|
2436
2406
|
ariaLabel = '',
|
|
@@ -2546,19 +2516,16 @@ const EmptyTable = props => {
|
|
|
2546
2516
|
const headCells = tableHead.map((value, index) => /*#__PURE__*/React__default.createElement("div", {
|
|
2547
2517
|
key: index
|
|
2548
2518
|
}, value));
|
|
2549
|
-
|
|
2550
2519
|
for (let i = 0; i < tableHead.length; i++) {
|
|
2551
2520
|
columns.push( /*#__PURE__*/React__default.createElement("div", {
|
|
2552
2521
|
key: i
|
|
2553
2522
|
}, /*#__PURE__*/React__default.createElement(EmptyTableCellText, null)));
|
|
2554
2523
|
}
|
|
2555
|
-
|
|
2556
2524
|
for (let i = 0; i < 3; i++) {
|
|
2557
2525
|
rows.push( /*#__PURE__*/React__default.createElement(EmptyTableRow, {
|
|
2558
2526
|
key: i
|
|
2559
2527
|
}, columns));
|
|
2560
2528
|
}
|
|
2561
|
-
|
|
2562
2529
|
return /*#__PURE__*/React__default.createElement(EmptyTableWrapper, null, /*#__PURE__*/React__default.createElement(EmptyTableOverlay, null, /*#__PURE__*/React__default.createElement("span", null, value)), /*#__PURE__*/React__default.createElement(EmptyTableHead, {
|
|
2563
2530
|
border: border
|
|
2564
2531
|
}, headCells), /*#__PURE__*/React__default.createElement(EmptyTableBody, {
|
|
@@ -2586,7 +2553,7 @@ const ModalFooter = props => {
|
|
|
2586
2553
|
style: style
|
|
2587
2554
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
2588
2555
|
variant: "outline",
|
|
2589
|
-
color: "
|
|
2556
|
+
color: "grey300",
|
|
2590
2557
|
action: closeAction,
|
|
2591
2558
|
value: closeValue
|
|
2592
2559
|
}), children);
|
|
@@ -2753,7 +2720,6 @@ const Table$1 = props => {
|
|
|
2753
2720
|
const headSkeleton = /*#__PURE__*/React__default.createElement("th", null, /*#__PURE__*/React__default.createElement(SkeletonCell, null));
|
|
2754
2721
|
const cellSkeleton = /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(SkeletonCell, null));
|
|
2755
2722
|
const columnsSkeleton = columns.length > 0 ? columns.length : loadingColumns;
|
|
2756
|
-
|
|
2757
2723
|
if (showEmpty && !hasValues) {
|
|
2758
2724
|
const columnHeaders = columns.map(column => column.value);
|
|
2759
2725
|
return /*#__PURE__*/React__default.createElement(EmptyTable, {
|
|
@@ -2762,7 +2728,6 @@ const Table$1 = props => {
|
|
|
2762
2728
|
value: emptyValue
|
|
2763
2729
|
});
|
|
2764
2730
|
}
|
|
2765
|
-
|
|
2766
2731
|
return /*#__PURE__*/React__default.createElement(TableWrapper, null, /*#__PURE__*/React__default.createElement(OverflowWrapper, null, /*#__PURE__*/React__default.createElement(Table, {
|
|
2767
2732
|
border: border,
|
|
2768
2733
|
"data-testid": dataTestId,
|
|
@@ -2849,7 +2814,6 @@ const TableRow = /*#__PURE__*/_styled__default.tr.withConfig({
|
|
|
2849
2814
|
const {
|
|
2850
2815
|
light: light$d
|
|
2851
2816
|
} = colors;
|
|
2852
|
-
|
|
2853
2817
|
const TableDnD = props => {
|
|
2854
2818
|
const {
|
|
2855
2819
|
border = false,
|
|
@@ -2880,7 +2844,6 @@ const TableDnD = props => {
|
|
|
2880
2844
|
const hasActionMenu = actions.length > 0;
|
|
2881
2845
|
const validValues = values.filter(hasValue);
|
|
2882
2846
|
const hasValues = Array.isArray(values) && values.length > 0;
|
|
2883
|
-
|
|
2884
2847
|
if (showEmpty && !hasValues) {
|
|
2885
2848
|
const columnHeaders = columns.map(column => column.value);
|
|
2886
2849
|
return /*#__PURE__*/React__default.createElement(EmptyTable, {
|
|
@@ -2889,7 +2852,6 @@ const TableDnD = props => {
|
|
|
2889
2852
|
value: emptyValue
|
|
2890
2853
|
});
|
|
2891
2854
|
}
|
|
2892
|
-
|
|
2893
2855
|
const reorder = (list, startIndex, endIndex) => {
|
|
2894
2856
|
const result = Array.from(list);
|
|
2895
2857
|
const [removed] = result.splice(startIndex, 1);
|
|
@@ -2899,17 +2861,14 @@ const TableDnD = props => {
|
|
|
2899
2861
|
return dragItem;
|
|
2900
2862
|
});
|
|
2901
2863
|
};
|
|
2902
|
-
|
|
2903
2864
|
const getItemStyle = (isDragging, draggableStyle) => ({
|
|
2904
2865
|
userSelect: 'none',
|
|
2905
2866
|
background: isDragging ? light$d : 'transparent',
|
|
2906
2867
|
...draggableStyle
|
|
2907
2868
|
});
|
|
2908
|
-
|
|
2909
2869
|
const getListStyle = isDraggingOver => ({
|
|
2910
2870
|
background: isDraggingOver ? light$d : 'transparent'
|
|
2911
2871
|
});
|
|
2912
|
-
|
|
2913
2872
|
return (
|
|
2914
2873
|
/*#__PURE__*/
|
|
2915
2874
|
// @ts-ignore
|
|
@@ -2921,7 +2880,6 @@ const TableDnD = props => {
|
|
|
2921
2880
|
if (!result.destination) {
|
|
2922
2881
|
return;
|
|
2923
2882
|
}
|
|
2924
|
-
|
|
2925
2883
|
const newValues = reorder(values, result.source.index, result.destination.index);
|
|
2926
2884
|
onChange(newValues);
|
|
2927
2885
|
setDraggableId('');
|
|
@@ -3066,18 +3024,14 @@ const NumberInputSpinner = props => {
|
|
|
3066
3024
|
isFirstRender.current = false;
|
|
3067
3025
|
return;
|
|
3068
3026
|
}
|
|
3069
|
-
|
|
3070
3027
|
setNumber(value);
|
|
3071
3028
|
}, [value]);
|
|
3072
|
-
|
|
3073
3029
|
const updateValue = value => {
|
|
3074
3030
|
if (onChange) {
|
|
3075
3031
|
onChange(value);
|
|
3076
3032
|
}
|
|
3077
|
-
|
|
3078
3033
|
setNumber(value);
|
|
3079
3034
|
};
|
|
3080
|
-
|
|
3081
3035
|
return /*#__PURE__*/React__default.createElement(Wrapper$9, null, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
3082
3036
|
className: "remove-button",
|
|
3083
3037
|
"aria-label": decreaseAriaLabel,
|
|
@@ -3357,9 +3311,7 @@ const PaginationControl = props => {
|
|
|
3357
3311
|
if (window.innerWidth > 700) setPageDisplayed(3);
|
|
3358
3312
|
}
|
|
3359
3313
|
}
|
|
3360
|
-
|
|
3361
3314
|
updateDimensions();
|
|
3362
|
-
|
|
3363
3315
|
if (typeof window !== 'undefined') {
|
|
3364
3316
|
window.addEventListener('resize', updateDimensions);
|
|
3365
3317
|
}
|
|
@@ -5420,20 +5372,16 @@ const DataWarning = props => {
|
|
|
5420
5372
|
type = 'login',
|
|
5421
5373
|
children
|
|
5422
5374
|
} = props;
|
|
5423
|
-
|
|
5424
5375
|
switch (type) {
|
|
5425
5376
|
case 'login':
|
|
5426
5377
|
icon = /*#__PURE__*/React__default.createElement(IconLoginOnly, null);
|
|
5427
5378
|
break;
|
|
5428
|
-
|
|
5429
5379
|
case 'data':
|
|
5430
5380
|
icon = /*#__PURE__*/React__default.createElement(IconEmptyData, null);
|
|
5431
5381
|
break;
|
|
5432
|
-
|
|
5433
5382
|
default:
|
|
5434
5383
|
icon = /*#__PURE__*/React__default.createElement(IconLoginOnly, null);
|
|
5435
5384
|
}
|
|
5436
|
-
|
|
5437
5385
|
return /*#__PURE__*/React__default.createElement(Wrapper$c, {
|
|
5438
5386
|
type: type
|
|
5439
5387
|
}, icon, /*#__PURE__*/React__default.createElement("div", null, children));
|
|
@@ -5653,6 +5601,7 @@ const Field = _styled__default.div`
|
|
|
5653
5601
|
|
|
5654
5602
|
input {
|
|
5655
5603
|
flex: 1;
|
|
5604
|
+
margin-right: 0;
|
|
5656
5605
|
border-radius: ${/*#__PURE__*/polished.rem('6px')} 0 0 ${/*#__PURE__*/polished.rem('6px')};
|
|
5657
5606
|
|
|
5658
5607
|
&:focus {
|
|
@@ -5679,7 +5628,6 @@ const Field = _styled__default.div`
|
|
|
5679
5628
|
justify-content: center;
|
|
5680
5629
|
align-items: center;
|
|
5681
5630
|
padding: 0 ${/*#__PURE__*/polished.rem('20px')};
|
|
5682
|
-
text-transform: uppercase;
|
|
5683
5631
|
white-space: nowrap;
|
|
5684
5632
|
transition-duration: 0.3s;
|
|
5685
5633
|
cursor: pointer;
|
|
@@ -5784,37 +5732,29 @@ const HorizontalNav = props => {
|
|
|
5784
5732
|
if (!ref || !ref.current) return;
|
|
5785
5733
|
const visible = document.querySelector('ul.menu').getElementsByTagName('li');
|
|
5786
5734
|
const more = document.querySelector('.more').getElementsByTagName('li');
|
|
5787
|
-
|
|
5788
5735
|
const moreVisibility = () => more.length > 0 ? setShowMore(true) : setShowMore(false);
|
|
5789
|
-
|
|
5790
5736
|
const removeItem = () => {
|
|
5791
5737
|
if (visible.length === 1) return;
|
|
5792
5738
|
let last = visible[visible.length - 1];
|
|
5793
5739
|
document.querySelector('ul.more').prepend(last);
|
|
5794
5740
|
};
|
|
5795
|
-
|
|
5796
5741
|
const addItem = () => {
|
|
5797
5742
|
if (more.length === 0) return;
|
|
5798
5743
|
let first = more[0];
|
|
5799
5744
|
document.querySelector('ul.menu').append(first);
|
|
5800
5745
|
};
|
|
5801
|
-
|
|
5802
5746
|
const checkOverflow = () => {
|
|
5803
5747
|
moreVisibility();
|
|
5804
|
-
|
|
5805
5748
|
for (let i = 0; i < visible.length + 20; i++) {
|
|
5806
5749
|
visibleMenuRef.current.scrollWidth + 50 > ref.current.offsetWidth ? removeItem() : addItem();
|
|
5807
5750
|
}
|
|
5808
5751
|
};
|
|
5809
|
-
|
|
5810
5752
|
checkOverflow();
|
|
5811
|
-
|
|
5812
5753
|
if (typeof window !== 'undefined') {
|
|
5813
5754
|
moreVisibility();
|
|
5814
5755
|
window.addEventListener('resize', checkOverflow);
|
|
5815
5756
|
return () => window.removeEventListener('resize', checkOverflow);
|
|
5816
5757
|
}
|
|
5817
|
-
|
|
5818
5758
|
return;
|
|
5819
5759
|
}, [ref]);
|
|
5820
5760
|
return /*#__PURE__*/React__default.createElement(Wrapper$g, {
|
|
@@ -5900,7 +5840,7 @@ const Modal = props => {
|
|
|
5900
5840
|
className: "modal"
|
|
5901
5841
|
}, /*#__PURE__*/React__default.createElement(ModalHeader, null, title && /*#__PURE__*/React__default.createElement("h2", null, title), /*#__PURE__*/React__default.createElement(Button, {
|
|
5902
5842
|
color: "white",
|
|
5903
|
-
txtColor: "
|
|
5843
|
+
txtColor: "grey300",
|
|
5904
5844
|
icon: "cross",
|
|
5905
5845
|
ariaLabel: "Close",
|
|
5906
5846
|
action: hide,
|
|
@@ -5958,21 +5898,28 @@ const ModalDrawer = props => {
|
|
|
5958
5898
|
footerHidden = false,
|
|
5959
5899
|
zIndex = 10
|
|
5960
5900
|
} = props;
|
|
5901
|
+
React.useEffect(() => {
|
|
5902
|
+
if (isShowing && typeof window !== 'undefined') {
|
|
5903
|
+
document.documentElement.style.overflow = 'hidden';
|
|
5904
|
+
} else {
|
|
5905
|
+
document.documentElement.style.overflow = '';
|
|
5906
|
+
}
|
|
5907
|
+
return () => {
|
|
5908
|
+
document.documentElement.style.overflow = '';
|
|
5909
|
+
};
|
|
5910
|
+
}, [isShowing]);
|
|
5961
5911
|
React.useEffect(() => {
|
|
5962
5912
|
const fixViewport = () => {
|
|
5963
5913
|
let vh = window.innerHeight * 0.01;
|
|
5964
5914
|
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
|
5965
5915
|
};
|
|
5966
|
-
|
|
5967
5916
|
fixViewport();
|
|
5968
|
-
|
|
5969
5917
|
if (typeof window !== 'undefined') {
|
|
5970
5918
|
let vh = window.innerHeight * 0.01;
|
|
5971
5919
|
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
|
5972
5920
|
window.addEventListener('resize', fixViewport);
|
|
5973
5921
|
return () => window.removeEventListener('resize', fixViewport);
|
|
5974
5922
|
}
|
|
5975
|
-
|
|
5976
5923
|
return;
|
|
5977
5924
|
}, []);
|
|
5978
5925
|
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ModalOverlay$1, {
|
|
@@ -6106,14 +6053,12 @@ const LoadingState = props => {
|
|
|
6106
6053
|
let paragraphs = [];
|
|
6107
6054
|
let cards = [];
|
|
6108
6055
|
let loadingType;
|
|
6109
|
-
|
|
6110
6056
|
for (let i = 0; i < lines; i++) {
|
|
6111
6057
|
paragraphs.push( /*#__PURE__*/React__default.createElement("div", {
|
|
6112
6058
|
key: i,
|
|
6113
6059
|
className: "paragraph"
|
|
6114
6060
|
}));
|
|
6115
6061
|
}
|
|
6116
|
-
|
|
6117
6062
|
for (let i = 0; i < cardsNumber; i++) {
|
|
6118
6063
|
cards.push( /*#__PURE__*/React__default.createElement("div", {
|
|
6119
6064
|
key: i,
|
|
@@ -6134,7 +6079,6 @@ const LoadingState = props => {
|
|
|
6134
6079
|
className: "paragraph"
|
|
6135
6080
|
})));
|
|
6136
6081
|
}
|
|
6137
|
-
|
|
6138
6082
|
switch (type) {
|
|
6139
6083
|
case 'text':
|
|
6140
6084
|
loadingType = /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -6143,19 +6087,16 @@ const LoadingState = props => {
|
|
|
6143
6087
|
className: "subtitle"
|
|
6144
6088
|
}), paragraphs));
|
|
6145
6089
|
break;
|
|
6146
|
-
|
|
6147
6090
|
case 'card':
|
|
6148
6091
|
loadingType = /*#__PURE__*/React__default.createElement(Grid, {
|
|
6149
6092
|
center: center
|
|
6150
6093
|
}, cards);
|
|
6151
6094
|
break;
|
|
6152
|
-
|
|
6153
6095
|
case 'value':
|
|
6154
6096
|
loadingType = /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
6155
6097
|
className: "value"
|
|
6156
6098
|
})));
|
|
6157
6099
|
break;
|
|
6158
|
-
|
|
6159
6100
|
default:
|
|
6160
6101
|
loadingType = /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("div", {
|
|
6161
6102
|
className: "title"
|
|
@@ -6163,7 +6104,6 @@ const LoadingState = props => {
|
|
|
6163
6104
|
className: "subtitle"
|
|
6164
6105
|
}), paragraphs));
|
|
6165
6106
|
}
|
|
6166
|
-
|
|
6167
6107
|
return /*#__PURE__*/React__default.createElement(Wrapper$h, {
|
|
6168
6108
|
type: type
|
|
6169
6109
|
}, loadingType);
|
|
@@ -6343,7 +6283,6 @@ const TabsPanel = props => {
|
|
|
6343
6283
|
onChange,
|
|
6344
6284
|
tabs
|
|
6345
6285
|
} = props;
|
|
6346
|
-
|
|
6347
6286
|
const getTabs = () => {
|
|
6348
6287
|
return tabs.map((tab, index) => ({
|
|
6349
6288
|
key: index,
|
|
@@ -6353,7 +6292,6 @@ const TabsPanel = props => {
|
|
|
6353
6292
|
getContent: () => tab.renderer
|
|
6354
6293
|
}));
|
|
6355
6294
|
};
|
|
6356
|
-
|
|
6357
6295
|
return /*#__PURE__*/React__default.createElement(Wrapper$i, null, /*#__PURE__*/React__default.createElement(Tabs, {
|
|
6358
6296
|
transform: false,
|
|
6359
6297
|
unmountOnExit: unmountOnExit,
|