@taikai/rocket-kit 3.0.0-beta.3 → 3.0.0-beta.4
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 +23 -88
- 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 +23 -88
- package/dist/rocket-kit.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/rocket-kit.esm.js
CHANGED
|
@@ -181,16 +181,15 @@ const typography = {
|
|
|
181
181
|
defaultSize: '16px',
|
|
182
182
|
regular: 400,
|
|
183
183
|
medium: 500,
|
|
184
|
-
bold: 700
|
|
185
|
-
letterSpacing: /*#__PURE__*/rem('1px')
|
|
184
|
+
bold: 700
|
|
186
185
|
};
|
|
187
186
|
const button = {
|
|
188
|
-
height: /*#__PURE__*/rem('
|
|
187
|
+
height: /*#__PURE__*/rem('44px'),
|
|
189
188
|
borderWidth: /*#__PURE__*/rem('1px'),
|
|
190
189
|
borderRadius: /*#__PURE__*/rem('8px'),
|
|
191
|
-
padding: /*#__PURE__*/rem('
|
|
192
|
-
iconSpacing: /*#__PURE__*/rem('
|
|
193
|
-
iconSize: /*#__PURE__*/rem('
|
|
190
|
+
padding: /*#__PURE__*/rem('24px'),
|
|
191
|
+
iconSpacing: /*#__PURE__*/rem('14px'),
|
|
192
|
+
iconSize: /*#__PURE__*/rem('20px')
|
|
194
193
|
};
|
|
195
194
|
const misc = {
|
|
196
195
|
transitionDuration: '0.3s'
|
|
@@ -238,16 +237,14 @@ const useColor = value => {
|
|
|
238
237
|
const c = value.split(/([0-9]+)/).filter(Boolean);
|
|
239
238
|
const tint = c[0];
|
|
240
239
|
const hue = parseFloat(c[1]);
|
|
241
|
-
|
|
242
240
|
const getHoverColor = (tint, hue) => {
|
|
243
241
|
const indexCurrentHue = colorHues.indexOf(hue);
|
|
244
242
|
const indexIsLast = indexCurrentHue === colorHues.length - 1;
|
|
245
|
-
const indexHoverHue = indexIsLast ? indexCurrentHue - 1 : indexCurrentHue + 1;
|
|
246
|
-
|
|
243
|
+
const indexHoverHue = indexIsLast ? indexCurrentHue - 1 : indexCurrentHue + 1;
|
|
244
|
+
// @ts-ignore
|
|
247
245
|
const hoverColor = colors == null ? void 0 : colors[indexCurrentHue > -1 ? tint + colorHues[indexHoverHue] : tint];
|
|
248
246
|
return hoverColor != null ? hoverColor : colors.black;
|
|
249
247
|
};
|
|
250
|
-
|
|
251
248
|
const hover = getHoverColor(tint, hue);
|
|
252
249
|
return {
|
|
253
250
|
color,
|
|
@@ -258,19 +255,16 @@ const useColor = value => {
|
|
|
258
255
|
const ButtonWrapper = /*#__PURE__*/_styled.button.withConfig({
|
|
259
256
|
displayName: "styles__ButtonWrapper",
|
|
260
257
|
componentId: "sc-baestp-0"
|
|
261
|
-
})(["--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:", ";
|
|
258
|
+
})(["--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 => {
|
|
262
259
|
var _props$color;
|
|
263
|
-
|
|
264
260
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
265
261
|
}, props => {
|
|
266
262
|
var _props$txtColor;
|
|
267
|
-
|
|
268
263
|
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
269
264
|
}, props => {
|
|
270
265
|
var _props$color2;
|
|
271
|
-
|
|
272
266
|
return props.color === 'white' ? colors.grey100 : props.color === 'black' ? colors.grey900 : useColor((_props$color2 = props.color) != null ? _props$color2 : 'black').hover;
|
|
273
|
-
}, 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 ? rem('80px') : 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__*/rem(typography.defaultSize), typography.medium,
|
|
267
|
+
}, 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 ? rem('80px') : 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__*/rem(typography.defaultSize), typography.medium, /*#__PURE__*/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);
|
|
274
268
|
|
|
275
269
|
const Button = props => {
|
|
276
270
|
const {
|
|
@@ -326,15 +320,12 @@ const ActionsMenuStyle = /*#__PURE__*/_styled.div.withConfig({
|
|
|
326
320
|
function useVisible(initialIsVisible) {
|
|
327
321
|
const [isVisible, setIsVisible] = useState(initialIsVisible);
|
|
328
322
|
const ref = useRef(null);
|
|
329
|
-
|
|
330
323
|
const handleClickOutside = event => {
|
|
331
324
|
if (!ref || !ref.current) return;
|
|
332
|
-
|
|
333
325
|
if (!ref.current.contains(event.target)) {
|
|
334
326
|
setIsVisible(false);
|
|
335
327
|
}
|
|
336
328
|
};
|
|
337
|
-
|
|
338
329
|
useEffect(() => {
|
|
339
330
|
document.addEventListener('click', handleClickOutside, false);
|
|
340
331
|
return () => {
|
|
@@ -422,19 +413,16 @@ const ButtonDropdown = props => {
|
|
|
422
413
|
const ButtonLinkStyle = /*#__PURE__*/_styled.a.withConfig({
|
|
423
414
|
displayName: "styles__ButtonLinkStyle",
|
|
424
415
|
componentId: "sc-clge7v-0"
|
|
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:", ";
|
|
416
|
+
})(["--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 => {
|
|
426
417
|
var _props$color;
|
|
427
|
-
|
|
428
418
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
429
419
|
}, props => {
|
|
430
420
|
var _props$txtColor;
|
|
431
|
-
|
|
432
421
|
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
433
422
|
}, props => {
|
|
434
423
|
var _props$color2;
|
|
435
|
-
|
|
436
424
|
return props.color === 'white' ? colors.grey100 : props.color === 'black' ? colors.grey900 : useColor((_props$color2 = props.color) != null ? _props$color2 : 'black').hover;
|
|
437
|
-
}, 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 ? rem('80px') : 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__*/rem(typography.defaultSize), typography.medium,
|
|
425
|
+
}, 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 ? rem('80px') : 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__*/rem(typography.defaultSize), typography.medium, /*#__PURE__*/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);
|
|
438
426
|
|
|
439
427
|
const ButtonLink = props => {
|
|
440
428
|
const {
|
|
@@ -456,12 +444,10 @@ const ButtonLink = props => {
|
|
|
456
444
|
ariaLabel = '',
|
|
457
445
|
ariaHidden = false
|
|
458
446
|
} = props;
|
|
459
|
-
|
|
460
447
|
const getRelationshipAttributes = () => {
|
|
461
448
|
if (rel && rel !== '') return rel;
|
|
462
449
|
return blank ? 'noopener noreferrer' : '';
|
|
463
450
|
};
|
|
464
|
-
|
|
465
451
|
return /*#__PURE__*/React.createElement(ButtonLinkStyle, {
|
|
466
452
|
variant: variant,
|
|
467
453
|
rounded: rounded,
|
|
@@ -525,24 +511,21 @@ const Checkbox = ({
|
|
|
525
511
|
}) => {
|
|
526
512
|
const checkedRef = useRef(checked);
|
|
527
513
|
const [isChecked, setIsChecked] = useState(checked);
|
|
528
|
-
|
|
529
514
|
const handleOnChange = event => {
|
|
530
515
|
setIsChecked(prev => !prev);
|
|
531
516
|
onChange(event);
|
|
532
517
|
};
|
|
533
|
-
|
|
534
518
|
const checkmarkClassName = useMemo(() => {
|
|
535
519
|
let isCheckStr = '';
|
|
536
|
-
let isDisabledStr = '';
|
|
520
|
+
let isDisabledStr = '';
|
|
521
|
+
// if they are different
|
|
537
522
|
// use the value coming from the props
|
|
538
523
|
// as it is the source of truth
|
|
539
|
-
|
|
540
524
|
if (checked !== checkedRef.current) {
|
|
541
525
|
setIsChecked(checked);
|
|
542
526
|
checkedRef.current = checked;
|
|
543
527
|
isCheckStr = checked ? 'checked' : 'not-checked';
|
|
544
528
|
} else if (isChecked) isCheckStr = 'checked';else isCheckStr = 'not-checked';
|
|
545
|
-
|
|
546
529
|
if (disabled) isDisabledStr = 'disabled';else isDisabledStr = 'not-disabled';
|
|
547
530
|
return `${isCheckStr} ${isDisabledStr}`;
|
|
548
531
|
}, [checked, isChecked, disabled]);
|
|
@@ -1009,7 +992,6 @@ const LabelStyle = /*#__PURE__*/_styled.label.withConfig({
|
|
|
1009
992
|
const {
|
|
1010
993
|
grey: grey$7
|
|
1011
994
|
} = colors;
|
|
1012
|
-
|
|
1013
995
|
const Label = props => {
|
|
1014
996
|
const {
|
|
1015
997
|
value,
|
|
@@ -1045,7 +1027,6 @@ const Loading = /*#__PURE__*/_styled.div.withConfig({
|
|
|
1045
1027
|
const {
|
|
1046
1028
|
grey: grey$8
|
|
1047
1029
|
} = colors;
|
|
1048
|
-
|
|
1049
1030
|
const Spinner = props => {
|
|
1050
1031
|
const {
|
|
1051
1032
|
fill = grey$8,
|
|
@@ -1066,11 +1047,9 @@ const TagWrapper = /*#__PURE__*/_styled.span.withConfig({
|
|
|
1066
1047
|
componentId: "sc-1ghratr-0"
|
|
1067
1048
|
})(["--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 => {
|
|
1068
1049
|
var _props$color;
|
|
1069
|
-
|
|
1070
1050
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
1071
1051
|
}, props => {
|
|
1072
1052
|
var _props$txtColor;
|
|
1073
|
-
|
|
1074
1053
|
return useColor((_props$txtColor = props.txtColor) != null ? _props$txtColor : 'black').color;
|
|
1075
1054
|
}, /*#__PURE__*/rem('2px'), /*#__PURE__*/rem('4px'), props => props.variant === 'solid' ? 'var(--bg)' : 'transparent', /*#__PURE__*/rem('3px'), /*#__PURE__*/rem('8px'), /*#__PURE__*/rem('12px'), typography.medium, /*#__PURE__*/rem('1px'), props => props.variant === 'solid' ? 'var(--txt)' : 'var(--bg)');
|
|
1076
1055
|
|
|
@@ -1098,11 +1077,9 @@ const TagWrapper$1 = /*#__PURE__*/_styled.div.withConfig({
|
|
|
1098
1077
|
componentId: "sc-db57da-0"
|
|
1099
1078
|
})(["--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 => {
|
|
1100
1079
|
var _props$color;
|
|
1101
|
-
|
|
1102
1080
|
return useColor((_props$color = props.color) != null ? _props$color : 'black').color;
|
|
1103
1081
|
}, props => {
|
|
1104
1082
|
var _props$valueColor;
|
|
1105
|
-
|
|
1106
1083
|
return useColor((_props$valueColor = props.valueColor) != null ? _props$valueColor : 'black').color;
|
|
1107
1084
|
}, /*#__PURE__*/rem('2px'), /*#__PURE__*/rem('3px'), /*#__PURE__*/rem('3px'), /*#__PURE__*/rem('8px'), /*#__PURE__*/rem('12px'), typography.medium, /*#__PURE__*/rem('1px'), /*#__PURE__*/rem('5px'));
|
|
1108
1085
|
|
|
@@ -1399,7 +1376,6 @@ const {
|
|
|
1399
1376
|
} = components;
|
|
1400
1377
|
const FormatGroupLabel = props => {
|
|
1401
1378
|
var _props$options;
|
|
1402
|
-
|
|
1403
1379
|
return /*#__PURE__*/React.createElement("div", {
|
|
1404
1380
|
style: {
|
|
1405
1381
|
display: 'flex',
|
|
@@ -1971,7 +1947,6 @@ const Slideshow = props => {
|
|
|
1971
1947
|
title: `Slide ${index + 1} selected`
|
|
1972
1948
|
});
|
|
1973
1949
|
}
|
|
1974
|
-
|
|
1975
1950
|
return /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement("button", {
|
|
1976
1951
|
onClick: onClickHandler,
|
|
1977
1952
|
onKeyDown: onClickHandler,
|
|
@@ -2173,13 +2148,11 @@ const Toggle = ({
|
|
|
2173
2148
|
// tracks the active state so it's easier to test
|
|
2174
2149
|
const [state, setState] = useState(checked);
|
|
2175
2150
|
const [id, setId] = useState('');
|
|
2176
|
-
|
|
2177
2151
|
const handleClick = value => {
|
|
2178
2152
|
if (disabled) return;
|
|
2179
2153
|
setState(value);
|
|
2180
2154
|
return onClick(value);
|
|
2181
2155
|
};
|
|
2182
|
-
|
|
2183
2156
|
useEffect(() => {
|
|
2184
2157
|
// If the ID stays outside the component
|
|
2185
2158
|
// it will be the same if we instantiate
|
|
@@ -2331,15 +2304,13 @@ const FilePicker = props => {
|
|
|
2331
2304
|
disabled = false
|
|
2332
2305
|
} = props;
|
|
2333
2306
|
const [fileName, setFileName] = useState(value ? value : placeholder);
|
|
2334
|
-
|
|
2335
2307
|
const getUploadedFileName = e => {
|
|
2336
2308
|
let files = e.target.files,
|
|
2337
|
-
|
|
2338
|
-
|
|
2309
|
+
value = e.target.value,
|
|
2310
|
+
fileName;
|
|
2339
2311
|
if (files && files.length > 1) fileName = `${files.length} ${pluralText}`;else fileName = value.split('\\').pop();
|
|
2340
2312
|
if (fileName) setFileName(fileName);
|
|
2341
2313
|
};
|
|
2342
|
-
|
|
2343
2314
|
return /*#__PURE__*/React.createElement(Wrapper$6, {
|
|
2344
2315
|
disabled: disabled,
|
|
2345
2316
|
minimal: minimal,
|
|
@@ -2421,7 +2392,6 @@ const ActionMenuList = props => {
|
|
|
2421
2392
|
}
|
|
2422
2393
|
}, /*#__PURE__*/React.createElement("span", null, value)))));
|
|
2423
2394
|
};
|
|
2424
|
-
|
|
2425
2395
|
const ActionsMenu = props => {
|
|
2426
2396
|
const {
|
|
2427
2397
|
ariaLabel = '',
|
|
@@ -2537,19 +2507,16 @@ const EmptyTable = props => {
|
|
|
2537
2507
|
const headCells = tableHead.map((value, index) => /*#__PURE__*/React.createElement("div", {
|
|
2538
2508
|
key: index
|
|
2539
2509
|
}, value));
|
|
2540
|
-
|
|
2541
2510
|
for (let i = 0; i < tableHead.length; i++) {
|
|
2542
2511
|
columns.push( /*#__PURE__*/React.createElement("div", {
|
|
2543
2512
|
key: i
|
|
2544
2513
|
}, /*#__PURE__*/React.createElement(EmptyTableCellText, null)));
|
|
2545
2514
|
}
|
|
2546
|
-
|
|
2547
2515
|
for (let i = 0; i < 3; i++) {
|
|
2548
2516
|
rows.push( /*#__PURE__*/React.createElement(EmptyTableRow, {
|
|
2549
2517
|
key: i
|
|
2550
2518
|
}, columns));
|
|
2551
2519
|
}
|
|
2552
|
-
|
|
2553
2520
|
return /*#__PURE__*/React.createElement(EmptyTableWrapper, null, /*#__PURE__*/React.createElement(EmptyTableOverlay, null, /*#__PURE__*/React.createElement("span", null, value)), /*#__PURE__*/React.createElement(EmptyTableHead, {
|
|
2554
2521
|
border: border
|
|
2555
2522
|
}, headCells), /*#__PURE__*/React.createElement(EmptyTableBody, {
|
|
@@ -2744,7 +2711,6 @@ const Table$1 = props => {
|
|
|
2744
2711
|
const headSkeleton = /*#__PURE__*/React.createElement("th", null, /*#__PURE__*/React.createElement(SkeletonCell, null));
|
|
2745
2712
|
const cellSkeleton = /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement(SkeletonCell, null));
|
|
2746
2713
|
const columnsSkeleton = columns.length > 0 ? columns.length : loadingColumns;
|
|
2747
|
-
|
|
2748
2714
|
if (showEmpty && !hasValues) {
|
|
2749
2715
|
const columnHeaders = columns.map(column => column.value);
|
|
2750
2716
|
return /*#__PURE__*/React.createElement(EmptyTable, {
|
|
@@ -2753,7 +2719,6 @@ const Table$1 = props => {
|
|
|
2753
2719
|
value: emptyValue
|
|
2754
2720
|
});
|
|
2755
2721
|
}
|
|
2756
|
-
|
|
2757
2722
|
return /*#__PURE__*/React.createElement(TableWrapper, null, /*#__PURE__*/React.createElement(OverflowWrapper, null, /*#__PURE__*/React.createElement(Table, {
|
|
2758
2723
|
border: border,
|
|
2759
2724
|
"data-testid": dataTestId,
|
|
@@ -2840,7 +2805,6 @@ const TableRow = /*#__PURE__*/_styled.tr.withConfig({
|
|
|
2840
2805
|
const {
|
|
2841
2806
|
light: light$d
|
|
2842
2807
|
} = colors;
|
|
2843
|
-
|
|
2844
2808
|
const TableDnD = props => {
|
|
2845
2809
|
const {
|
|
2846
2810
|
border = false,
|
|
@@ -2871,7 +2835,6 @@ const TableDnD = props => {
|
|
|
2871
2835
|
const hasActionMenu = actions.length > 0;
|
|
2872
2836
|
const validValues = values.filter(hasValue);
|
|
2873
2837
|
const hasValues = Array.isArray(values) && values.length > 0;
|
|
2874
|
-
|
|
2875
2838
|
if (showEmpty && !hasValues) {
|
|
2876
2839
|
const columnHeaders = columns.map(column => column.value);
|
|
2877
2840
|
return /*#__PURE__*/React.createElement(EmptyTable, {
|
|
@@ -2880,7 +2843,6 @@ const TableDnD = props => {
|
|
|
2880
2843
|
value: emptyValue
|
|
2881
2844
|
});
|
|
2882
2845
|
}
|
|
2883
|
-
|
|
2884
2846
|
const reorder = (list, startIndex, endIndex) => {
|
|
2885
2847
|
const result = Array.from(list);
|
|
2886
2848
|
const [removed] = result.splice(startIndex, 1);
|
|
@@ -2890,17 +2852,14 @@ const TableDnD = props => {
|
|
|
2890
2852
|
return dragItem;
|
|
2891
2853
|
});
|
|
2892
2854
|
};
|
|
2893
|
-
|
|
2894
2855
|
const getItemStyle = (isDragging, draggableStyle) => ({
|
|
2895
2856
|
userSelect: 'none',
|
|
2896
2857
|
background: isDragging ? light$d : 'transparent',
|
|
2897
2858
|
...draggableStyle
|
|
2898
2859
|
});
|
|
2899
|
-
|
|
2900
2860
|
const getListStyle = isDraggingOver => ({
|
|
2901
2861
|
background: isDraggingOver ? light$d : 'transparent'
|
|
2902
2862
|
});
|
|
2903
|
-
|
|
2904
2863
|
return (
|
|
2905
2864
|
/*#__PURE__*/
|
|
2906
2865
|
// @ts-ignore
|
|
@@ -2912,7 +2871,6 @@ const TableDnD = props => {
|
|
|
2912
2871
|
if (!result.destination) {
|
|
2913
2872
|
return;
|
|
2914
2873
|
}
|
|
2915
|
-
|
|
2916
2874
|
const newValues = reorder(values, result.source.index, result.destination.index);
|
|
2917
2875
|
onChange(newValues);
|
|
2918
2876
|
setDraggableId('');
|
|
@@ -3057,18 +3015,14 @@ const NumberInputSpinner = props => {
|
|
|
3057
3015
|
isFirstRender.current = false;
|
|
3058
3016
|
return;
|
|
3059
3017
|
}
|
|
3060
|
-
|
|
3061
3018
|
setNumber(value);
|
|
3062
3019
|
}, [value]);
|
|
3063
|
-
|
|
3064
3020
|
const updateValue = value => {
|
|
3065
3021
|
if (onChange) {
|
|
3066
3022
|
onChange(value);
|
|
3067
3023
|
}
|
|
3068
|
-
|
|
3069
3024
|
setNumber(value);
|
|
3070
3025
|
};
|
|
3071
|
-
|
|
3072
3026
|
return /*#__PURE__*/React.createElement(Wrapper$9, null, /*#__PURE__*/React.createElement(Button$1, {
|
|
3073
3027
|
className: "remove-button",
|
|
3074
3028
|
"aria-label": decreaseAriaLabel,
|
|
@@ -3348,9 +3302,7 @@ const PaginationControl = props => {
|
|
|
3348
3302
|
if (window.innerWidth > 700) setPageDisplayed(3);
|
|
3349
3303
|
}
|
|
3350
3304
|
}
|
|
3351
|
-
|
|
3352
3305
|
updateDimensions();
|
|
3353
|
-
|
|
3354
3306
|
if (typeof window !== 'undefined') {
|
|
3355
3307
|
window.addEventListener('resize', updateDimensions);
|
|
3356
3308
|
}
|
|
@@ -5411,20 +5363,16 @@ const DataWarning = props => {
|
|
|
5411
5363
|
type = 'login',
|
|
5412
5364
|
children
|
|
5413
5365
|
} = props;
|
|
5414
|
-
|
|
5415
5366
|
switch (type) {
|
|
5416
5367
|
case 'login':
|
|
5417
5368
|
icon = /*#__PURE__*/React.createElement(IconLoginOnly, null);
|
|
5418
5369
|
break;
|
|
5419
|
-
|
|
5420
5370
|
case 'data':
|
|
5421
5371
|
icon = /*#__PURE__*/React.createElement(IconEmptyData, null);
|
|
5422
5372
|
break;
|
|
5423
|
-
|
|
5424
5373
|
default:
|
|
5425
5374
|
icon = /*#__PURE__*/React.createElement(IconLoginOnly, null);
|
|
5426
5375
|
}
|
|
5427
|
-
|
|
5428
5376
|
return /*#__PURE__*/React.createElement(Wrapper$c, {
|
|
5429
5377
|
type: type
|
|
5430
5378
|
}, icon, /*#__PURE__*/React.createElement("div", null, children));
|
|
@@ -5644,6 +5592,7 @@ const Field = _styled.div`
|
|
|
5644
5592
|
|
|
5645
5593
|
input {
|
|
5646
5594
|
flex: 1;
|
|
5595
|
+
margin-right: 0;
|
|
5647
5596
|
border-radius: ${/*#__PURE__*/rem('6px')} 0 0 ${/*#__PURE__*/rem('6px')};
|
|
5648
5597
|
|
|
5649
5598
|
&:focus {
|
|
@@ -5670,7 +5619,6 @@ const Field = _styled.div`
|
|
|
5670
5619
|
justify-content: center;
|
|
5671
5620
|
align-items: center;
|
|
5672
5621
|
padding: 0 ${/*#__PURE__*/rem('20px')};
|
|
5673
|
-
text-transform: uppercase;
|
|
5674
5622
|
white-space: nowrap;
|
|
5675
5623
|
transition-duration: 0.3s;
|
|
5676
5624
|
cursor: pointer;
|
|
@@ -5775,37 +5723,29 @@ const HorizontalNav = props => {
|
|
|
5775
5723
|
if (!ref || !ref.current) return;
|
|
5776
5724
|
const visible = document.querySelector('ul.menu').getElementsByTagName('li');
|
|
5777
5725
|
const more = document.querySelector('.more').getElementsByTagName('li');
|
|
5778
|
-
|
|
5779
5726
|
const moreVisibility = () => more.length > 0 ? setShowMore(true) : setShowMore(false);
|
|
5780
|
-
|
|
5781
5727
|
const removeItem = () => {
|
|
5782
5728
|
if (visible.length === 1) return;
|
|
5783
5729
|
let last = visible[visible.length - 1];
|
|
5784
5730
|
document.querySelector('ul.more').prepend(last);
|
|
5785
5731
|
};
|
|
5786
|
-
|
|
5787
5732
|
const addItem = () => {
|
|
5788
5733
|
if (more.length === 0) return;
|
|
5789
5734
|
let first = more[0];
|
|
5790
5735
|
document.querySelector('ul.menu').append(first);
|
|
5791
5736
|
};
|
|
5792
|
-
|
|
5793
5737
|
const checkOverflow = () => {
|
|
5794
5738
|
moreVisibility();
|
|
5795
|
-
|
|
5796
5739
|
for (let i = 0; i < visible.length + 20; i++) {
|
|
5797
5740
|
visibleMenuRef.current.scrollWidth + 50 > ref.current.offsetWidth ? removeItem() : addItem();
|
|
5798
5741
|
}
|
|
5799
5742
|
};
|
|
5800
|
-
|
|
5801
5743
|
checkOverflow();
|
|
5802
|
-
|
|
5803
5744
|
if (typeof window !== 'undefined') {
|
|
5804
5745
|
moreVisibility();
|
|
5805
5746
|
window.addEventListener('resize', checkOverflow);
|
|
5806
5747
|
return () => window.removeEventListener('resize', checkOverflow);
|
|
5807
5748
|
}
|
|
5808
|
-
|
|
5809
5749
|
return;
|
|
5810
5750
|
}, [ref]);
|
|
5811
5751
|
return /*#__PURE__*/React.createElement(Wrapper$g, {
|
|
@@ -5949,21 +5889,25 @@ const ModalDrawer = props => {
|
|
|
5949
5889
|
footerHidden = false,
|
|
5950
5890
|
zIndex = 10
|
|
5951
5891
|
} = props;
|
|
5892
|
+
useEffect(() => {
|
|
5893
|
+
if (isShowing && typeof window !== 'undefined') {
|
|
5894
|
+
document.documentElement.style.overflow = 'hidden';
|
|
5895
|
+
} else {
|
|
5896
|
+
document.documentElement.style.overflow = '';
|
|
5897
|
+
}
|
|
5898
|
+
}, [isShowing]);
|
|
5952
5899
|
useEffect(() => {
|
|
5953
5900
|
const fixViewport = () => {
|
|
5954
5901
|
let vh = window.innerHeight * 0.01;
|
|
5955
5902
|
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
|
5956
5903
|
};
|
|
5957
|
-
|
|
5958
5904
|
fixViewport();
|
|
5959
|
-
|
|
5960
5905
|
if (typeof window !== 'undefined') {
|
|
5961
5906
|
let vh = window.innerHeight * 0.01;
|
|
5962
5907
|
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
|
5963
5908
|
window.addEventListener('resize', fixViewport);
|
|
5964
5909
|
return () => window.removeEventListener('resize', fixViewport);
|
|
5965
5910
|
}
|
|
5966
|
-
|
|
5967
5911
|
return;
|
|
5968
5912
|
}, []);
|
|
5969
5913
|
return isShowing ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ModalOverlay$1, {
|
|
@@ -6097,14 +6041,12 @@ const LoadingState = props => {
|
|
|
6097
6041
|
let paragraphs = [];
|
|
6098
6042
|
let cards = [];
|
|
6099
6043
|
let loadingType;
|
|
6100
|
-
|
|
6101
6044
|
for (let i = 0; i < lines; i++) {
|
|
6102
6045
|
paragraphs.push( /*#__PURE__*/React.createElement("div", {
|
|
6103
6046
|
key: i,
|
|
6104
6047
|
className: "paragraph"
|
|
6105
6048
|
}));
|
|
6106
6049
|
}
|
|
6107
|
-
|
|
6108
6050
|
for (let i = 0; i < cardsNumber; i++) {
|
|
6109
6051
|
cards.push( /*#__PURE__*/React.createElement("div", {
|
|
6110
6052
|
key: i,
|
|
@@ -6125,7 +6067,6 @@ const LoadingState = props => {
|
|
|
6125
6067
|
className: "paragraph"
|
|
6126
6068
|
})));
|
|
6127
6069
|
}
|
|
6128
|
-
|
|
6129
6070
|
switch (type) {
|
|
6130
6071
|
case 'text':
|
|
6131
6072
|
loadingType = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6134,19 +6075,16 @@ const LoadingState = props => {
|
|
|
6134
6075
|
className: "subtitle"
|
|
6135
6076
|
}), paragraphs));
|
|
6136
6077
|
break;
|
|
6137
|
-
|
|
6138
6078
|
case 'card':
|
|
6139
6079
|
loadingType = /*#__PURE__*/React.createElement(Grid, {
|
|
6140
6080
|
center: center
|
|
6141
6081
|
}, cards);
|
|
6142
6082
|
break;
|
|
6143
|
-
|
|
6144
6083
|
case 'value':
|
|
6145
6084
|
loadingType = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
6146
6085
|
className: "value"
|
|
6147
6086
|
})));
|
|
6148
6087
|
break;
|
|
6149
|
-
|
|
6150
6088
|
default:
|
|
6151
6089
|
loadingType = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
6152
6090
|
className: "title"
|
|
@@ -6154,7 +6092,6 @@ const LoadingState = props => {
|
|
|
6154
6092
|
className: "subtitle"
|
|
6155
6093
|
}), paragraphs));
|
|
6156
6094
|
}
|
|
6157
|
-
|
|
6158
6095
|
return /*#__PURE__*/React.createElement(Wrapper$h, {
|
|
6159
6096
|
type: type
|
|
6160
6097
|
}, loadingType);
|
|
@@ -6334,7 +6271,6 @@ const TabsPanel = props => {
|
|
|
6334
6271
|
onChange,
|
|
6335
6272
|
tabs
|
|
6336
6273
|
} = props;
|
|
6337
|
-
|
|
6338
6274
|
const getTabs = () => {
|
|
6339
6275
|
return tabs.map((tab, index) => ({
|
|
6340
6276
|
key: index,
|
|
@@ -6344,7 +6280,6 @@ const TabsPanel = props => {
|
|
|
6344
6280
|
getContent: () => tab.renderer
|
|
6345
6281
|
}));
|
|
6346
6282
|
};
|
|
6347
|
-
|
|
6348
6283
|
return /*#__PURE__*/React.createElement(Wrapper$i, null, /*#__PURE__*/React.createElement(Tabs, {
|
|
6349
6284
|
transform: false,
|
|
6350
6285
|
unmountOnExit: unmountOnExit,
|