@helpdice/ui 2.6.0-beta.4 → 2.6.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/dist/auto-complete/index.js +69 -687
- package/dist/expandable/expand.d.ts +7 -0
- package/dist/expandable/index.d.ts +2 -0
- package/dist/expandable/index.js +1612 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +946 -899
- package/dist/input/index.js +8 -678
- package/dist/placeholder/index.js +8 -714
- package/dist/radio/index.js +8 -8
- package/dist/select/index.js +16 -686
- package/dist/table/index.js +1146 -1171
- package/dist/text/index.js +8 -714
- package/dist/text/text.d.ts +0 -1
- package/dist/textarea/index.js +9 -682
- package/esm/expandable/expand.d.ts +7 -0
- package/esm/expandable/expand.js +67 -0
- package/esm/expandable/index.d.ts +2 -0
- package/esm/expandable/index.js +2 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/radio/radio.js +8 -8
- package/esm/table/table-body.js +1 -1
- package/esm/text/text.d.ts +0 -1
- package/esm/text/text.js +3 -25
- package/package.json +11 -1
package/dist/index.js
CHANGED
|
@@ -1331,652 +1331,7 @@ var TextChild = function TextChild(_ref) {
|
|
|
1331
1331
|
};
|
|
1332
1332
|
TextChild.displayName = 'TextChild';
|
|
1333
1333
|
|
|
1334
|
-
var
|
|
1335
|
-
var _ref$x = _ref.x,
|
|
1336
|
-
x = _ref$x === void 0 ? 0 : _ref$x,
|
|
1337
|
-
_ref$y = _ref.y,
|
|
1338
|
-
y = _ref$y === void 0 ? 0 : _ref$y,
|
|
1339
|
-
color = _ref.color,
|
|
1340
|
-
onCompleted = _ref.onCompleted;
|
|
1341
|
-
var dripRef = React.useRef(null);
|
|
1342
|
-
/* istanbul ignore next */
|
|
1343
|
-
var top = Number.isNaN(+y) ? 0 : y - 10;
|
|
1344
|
-
/* istanbul ignore next */
|
|
1345
|
-
var left = Number.isNaN(+x) ? 0 : x - 10;
|
|
1346
|
-
React.useEffect(function () {
|
|
1347
|
-
/* istanbul ignore next */
|
|
1348
|
-
if (!dripRef.current) return;
|
|
1349
|
-
dripRef.current.addEventListener('animationend', onCompleted);
|
|
1350
|
-
return function () {
|
|
1351
|
-
/* istanbul ignore next */
|
|
1352
|
-
if (!dripRef.current) return;
|
|
1353
|
-
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
1354
|
-
};
|
|
1355
|
-
});
|
|
1356
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1357
|
-
ref: dripRef,
|
|
1358
|
-
className: "jsx-3424889537" + " " + "drip",
|
|
1359
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
1360
|
-
width: "20",
|
|
1361
|
-
height: "20",
|
|
1362
|
-
viewBox: "0 0 20 20",
|
|
1363
|
-
style: {
|
|
1364
|
-
top: top,
|
|
1365
|
-
left: left
|
|
1366
|
-
},
|
|
1367
|
-
className: "jsx-3424889537",
|
|
1368
|
-
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
1369
|
-
stroke: "none",
|
|
1370
|
-
strokeWidth: "1",
|
|
1371
|
-
fill: "none",
|
|
1372
|
-
fillRule: "evenodd",
|
|
1373
|
-
className: "jsx-3424889537",
|
|
1374
|
-
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
1375
|
-
fill: color,
|
|
1376
|
-
className: "jsx-3424889537",
|
|
1377
|
-
children: /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
1378
|
-
width: "100%",
|
|
1379
|
-
height: "100%",
|
|
1380
|
-
rx: "10",
|
|
1381
|
-
className: "jsx-3424889537"
|
|
1382
|
-
})
|
|
1383
|
-
})
|
|
1384
|
-
})
|
|
1385
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1386
|
-
id: "3424889537",
|
|
1387
|
-
children: ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"
|
|
1388
|
-
})]
|
|
1389
|
-
});
|
|
1390
|
-
};
|
|
1391
|
-
ButtonDrip.displayName = 'ButtonDrip';
|
|
1392
|
-
|
|
1393
|
-
var _excluded$1m = ["children", "type", "color", "className", "spaceRatio"];
|
|
1394
|
-
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
1395
|
-
var colors = {
|
|
1396
|
-
"default": palette.accents_6,
|
|
1397
|
-
secondary: palette.secondary,
|
|
1398
|
-
success: palette.success,
|
|
1399
|
-
warning: palette.warning,
|
|
1400
|
-
error: palette.error
|
|
1401
|
-
};
|
|
1402
|
-
return color ? color : colors[type];
|
|
1403
|
-
};
|
|
1404
|
-
var LoadingComponent = function LoadingComponent(_ref) {
|
|
1405
|
-
var children = _ref.children,
|
|
1406
|
-
_ref$type = _ref.type,
|
|
1407
|
-
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
1408
|
-
color = _ref.color,
|
|
1409
|
-
_ref$className = _ref.className,
|
|
1410
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1411
|
-
_ref$spaceRatio = _ref.spaceRatio,
|
|
1412
|
-
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
1413
|
-
props = _objectWithoutProperties(_ref, _excluded$1m);
|
|
1414
|
-
var theme$1 = theme.useTheme();
|
|
1415
|
-
var _useScale = useScale(),
|
|
1416
|
-
SCALES = _useScale.SCALES;
|
|
1417
|
-
var classes = theme.useClasses('loading-container', className);
|
|
1418
|
-
var bgColor = React.useMemo(function () {
|
|
1419
|
-
return getIconBgColor(type, theme$1.palette, color);
|
|
1420
|
-
}, [type, theme$1.palette, color]);
|
|
1421
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1422
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
1423
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1424
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading",
|
|
1425
|
-
children: [children && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
1426
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]),
|
|
1427
|
-
children: children
|
|
1428
|
-
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1429
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1430
|
-
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1431
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1432
|
-
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
1433
|
-
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
1434
|
-
})]
|
|
1435
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1436
|
-
id: "2201634259",
|
|
1437
|
-
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio],
|
|
1438
|
-
children: ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme$1.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")
|
|
1439
|
-
})]
|
|
1440
|
-
}));
|
|
1441
|
-
};
|
|
1442
|
-
LoadingComponent.displayName = 'Loading';
|
|
1443
|
-
var Loading = withScale(LoadingComponent);
|
|
1444
|
-
|
|
1445
|
-
var ButtonLoading = function ButtonLoading(_ref) {
|
|
1446
|
-
var color = _ref.color;
|
|
1447
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1448
|
-
className: "jsx-212623367" + " " + "btn-loading",
|
|
1449
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
1450
|
-
color: color
|
|
1451
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1452
|
-
id: "212623367",
|
|
1453
|
-
children: ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"
|
|
1454
|
-
})]
|
|
1455
|
-
});
|
|
1456
|
-
};
|
|
1457
|
-
ButtonLoading.displayName = 'ButtonLoading';
|
|
1458
|
-
|
|
1459
|
-
var _excluded$1l = ["isRight", "isSingle", "children", "className"];
|
|
1460
|
-
var ButtonIcon = function ButtonIcon(_ref) {
|
|
1461
|
-
var _ref$isRight = _ref.isRight,
|
|
1462
|
-
isRight = _ref$isRight === void 0 ? false : _ref$isRight,
|
|
1463
|
-
isSingle = _ref.isSingle,
|
|
1464
|
-
children = _ref.children,
|
|
1465
|
-
_ref$className = _ref.className,
|
|
1466
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1467
|
-
props = _objectWithoutProperties(_ref, _excluded$1l);
|
|
1468
|
-
var classes = theme.useClasses('icon', {
|
|
1469
|
-
right: isRight,
|
|
1470
|
-
single: isSingle
|
|
1471
|
-
}, className);
|
|
1472
|
-
return /*#__PURE__*/jsxRuntime.jsxs("span", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1473
|
-
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || ""),
|
|
1474
|
-
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1475
|
-
id: "2467502931",
|
|
1476
|
-
children: ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"
|
|
1477
|
-
})]
|
|
1478
|
-
}));
|
|
1479
|
-
};
|
|
1480
|
-
ButtonIcon.displayName = 'ButtonIcon';
|
|
1481
|
-
|
|
1482
|
-
var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
|
|
1483
|
-
var icon = icons.icon,
|
|
1484
|
-
iconRight = icons.iconRight;
|
|
1485
|
-
var hasIcon = icon || iconRight;
|
|
1486
|
-
var isRight = Boolean(iconRight);
|
|
1487
|
-
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
1488
|
-
var classes = theme.useClasses('text', isRight ? 'right' : 'left');
|
|
1489
|
-
if (!hasIcon) return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1490
|
-
className: "text",
|
|
1491
|
-
children: children
|
|
1492
|
-
});
|
|
1493
|
-
if (React.Children.count(children) === 0) {
|
|
1494
|
-
return /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
1495
|
-
isRight: isRight,
|
|
1496
|
-
isSingle: true,
|
|
1497
|
-
children: hasIcon
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1501
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
1502
|
-
isRight: isRight,
|
|
1503
|
-
children: hasIcon
|
|
1504
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1505
|
-
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || ""),
|
|
1506
|
-
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1507
|
-
id: "3568181479",
|
|
1508
|
-
dynamic: [paddingForAutoMode, paddingForAutoMode],
|
|
1509
|
-
children: ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}")
|
|
1510
|
-
})]
|
|
1511
|
-
})]
|
|
1512
|
-
});
|
|
1513
|
-
};
|
|
1514
|
-
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
1515
|
-
if (!config.isButtonGroup) return props;
|
|
1516
|
-
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1517
|
-
auto: true,
|
|
1518
|
-
shadow: false,
|
|
1519
|
-
ghost: config.ghost || props.ghost,
|
|
1520
|
-
type: config.type || props.type,
|
|
1521
|
-
disabled: config.disabled || props.disabled
|
|
1522
|
-
});
|
|
1523
|
-
};
|
|
1524
|
-
|
|
1525
|
-
/* "use client" */
|
|
1526
|
-
|
|
1527
|
-
var defaultContext$d = {
|
|
1528
|
-
isButtonGroup: false,
|
|
1529
|
-
disabled: false
|
|
1530
|
-
};
|
|
1531
|
-
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$d);
|
|
1532
|
-
var useButtonGroupContext = function useButtonGroupContext() {
|
|
1533
|
-
return React.useContext(ButtonGroupContext);
|
|
1534
|
-
};
|
|
1535
|
-
|
|
1536
|
-
var hexToRgb = function hexToRgb(color) {
|
|
1537
|
-
var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
1538
|
-
var full = color.replace(fullReg, function (_, r, g, b) {
|
|
1539
|
-
return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
|
|
1540
|
-
});
|
|
1541
|
-
var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
1542
|
-
if (!values) {
|
|
1543
|
-
throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
|
|
1544
|
-
}
|
|
1545
|
-
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
1546
|
-
};
|
|
1547
|
-
var colorToRgbValues = function colorToRgbValues(color) {
|
|
1548
|
-
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
1549
|
-
var safeColor = color.replace(/ /g, '');
|
|
1550
|
-
var colorType = color.substr(0, 4);
|
|
1551
|
-
var regArray = safeColor.match(/\((.+)\)/);
|
|
1552
|
-
if (!colorType.startsWith('rgb') || !regArray) {
|
|
1553
|
-
console.log(color);
|
|
1554
|
-
throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
|
|
1555
|
-
}
|
|
1556
|
-
return regArray[1].split(',').map(function (str) {
|
|
1557
|
-
return Number.parseFloat(str);
|
|
1558
|
-
});
|
|
1559
|
-
};
|
|
1560
|
-
var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
1561
|
-
if (!/^#|rgb|RGB/.test(color)) return color;
|
|
1562
|
-
var _colorToRgbValues = colorToRgbValues(color),
|
|
1563
|
-
_colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
|
|
1564
|
-
r = _colorToRgbValues2[0],
|
|
1565
|
-
g = _colorToRgbValues2[1],
|
|
1566
|
-
b = _colorToRgbValues2[2];
|
|
1567
|
-
var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
|
|
1568
|
-
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
1569
|
-
};
|
|
1570
|
-
|
|
1571
|
-
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
1572
|
-
var colors = {
|
|
1573
|
-
secondary: {
|
|
1574
|
-
bg: palette.background,
|
|
1575
|
-
border: palette.foreground,
|
|
1576
|
-
color: palette.foreground,
|
|
1577
|
-
ripple: ''
|
|
1578
|
-
},
|
|
1579
|
-
success: {
|
|
1580
|
-
bg: palette.background,
|
|
1581
|
-
border: palette.success,
|
|
1582
|
-
color: palette.success,
|
|
1583
|
-
ripple: ''
|
|
1584
|
-
},
|
|
1585
|
-
warning: {
|
|
1586
|
-
bg: palette.background,
|
|
1587
|
-
border: palette.warning,
|
|
1588
|
-
color: palette.warning,
|
|
1589
|
-
ripple: ''
|
|
1590
|
-
},
|
|
1591
|
-
error: {
|
|
1592
|
-
bg: palette.background,
|
|
1593
|
-
border: palette.error,
|
|
1594
|
-
color: palette.error,
|
|
1595
|
-
ripple: ''
|
|
1596
|
-
}
|
|
1597
|
-
};
|
|
1598
|
-
return colors[_color] || null;
|
|
1599
|
-
};
|
|
1600
|
-
var getButtonColors = function getButtonColors(palette, props) {
|
|
1601
|
-
var color = props.color,
|
|
1602
|
-
disabled = props.disabled,
|
|
1603
|
-
ghost = props.ghost;
|
|
1604
|
-
var colors = {
|
|
1605
|
-
"default": {
|
|
1606
|
-
bg: palette.background,
|
|
1607
|
-
border: palette.border,
|
|
1608
|
-
color: palette.accents_5,
|
|
1609
|
-
ripple: palette.accents_1
|
|
1610
|
-
},
|
|
1611
|
-
secondary: {
|
|
1612
|
-
bg: palette.foreground,
|
|
1613
|
-
border: palette.foreground,
|
|
1614
|
-
color: palette.background,
|
|
1615
|
-
ripple: palette.accents_1
|
|
1616
|
-
},
|
|
1617
|
-
success: {
|
|
1618
|
-
bg: palette.success,
|
|
1619
|
-
border: palette.success,
|
|
1620
|
-
color: '#fff',
|
|
1621
|
-
ripple: '#1f93ffff'
|
|
1622
|
-
},
|
|
1623
|
-
warning: {
|
|
1624
|
-
bg: palette.warning,
|
|
1625
|
-
border: palette.warning,
|
|
1626
|
-
color: '#fff',
|
|
1627
|
-
ripple: '#ffca29ff'
|
|
1628
|
-
},
|
|
1629
|
-
error: {
|
|
1630
|
-
bg: palette.error,
|
|
1631
|
-
border: palette.error,
|
|
1632
|
-
color: '#fff',
|
|
1633
|
-
ripple: '#ff5a55ff'
|
|
1634
|
-
},
|
|
1635
|
-
abort: {
|
|
1636
|
-
bg: 'transparent',
|
|
1637
|
-
border: 'transparent',
|
|
1638
|
-
color: palette.accents_5,
|
|
1639
|
-
ripple: palette.accents_1
|
|
1640
|
-
}
|
|
1641
|
-
};
|
|
1642
|
-
if (disabled) return {
|
|
1643
|
-
bg: palette.accents_1,
|
|
1644
|
-
border: palette.accents_2,
|
|
1645
|
-
color: '#ccc',
|
|
1646
|
-
ripple: ''
|
|
1647
|
-
};
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
* The '-light' type is the same color as the common type,
|
|
1651
|
-
* only hover's color is different.
|
|
1652
|
-
* e.g.
|
|
1653
|
-
* Color['success'] === Color['success-light']
|
|
1654
|
-
* Color['warning'] === Color['warning-light']
|
|
1655
|
-
*/
|
|
1656
|
-
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
1657
|
-
var defaultColor = colors["default"];
|
|
1658
|
-
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
1659
|
-
return colors[withoutLightType] || defaultColor;
|
|
1660
|
-
};
|
|
1661
|
-
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
1662
|
-
var colors = {
|
|
1663
|
-
secondary: {
|
|
1664
|
-
bg: palette.foreground,
|
|
1665
|
-
border: palette.background,
|
|
1666
|
-
color: palette.background
|
|
1667
|
-
},
|
|
1668
|
-
success: {
|
|
1669
|
-
bg: palette.success,
|
|
1670
|
-
border: palette.background,
|
|
1671
|
-
color: 'white'
|
|
1672
|
-
},
|
|
1673
|
-
warning: {
|
|
1674
|
-
bg: palette.warning,
|
|
1675
|
-
border: palette.background,
|
|
1676
|
-
color: 'white'
|
|
1677
|
-
},
|
|
1678
|
-
error: {
|
|
1679
|
-
bg: palette.error,
|
|
1680
|
-
border: palette.background,
|
|
1681
|
-
color: 'white'
|
|
1682
|
-
}
|
|
1683
|
-
};
|
|
1684
|
-
var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
|
|
1685
|
-
return colors[withoutLightType] || null;
|
|
1686
|
-
};
|
|
1687
|
-
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
1688
|
-
var color = props.color,
|
|
1689
|
-
disabled = props.disabled,
|
|
1690
|
-
loading = props.loading,
|
|
1691
|
-
shadow = props.shadow,
|
|
1692
|
-
ghost = props.ghost;
|
|
1693
|
-
var defaultColor = getButtonColors(palette, props);
|
|
1694
|
-
var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
|
|
1695
|
-
var colors = {
|
|
1696
|
-
"default": {
|
|
1697
|
-
bg: palette.background,
|
|
1698
|
-
border: palette.foreground
|
|
1699
|
-
},
|
|
1700
|
-
secondary: {
|
|
1701
|
-
bg: palette.background,
|
|
1702
|
-
border: palette.foreground
|
|
1703
|
-
},
|
|
1704
|
-
success: {
|
|
1705
|
-
bg: palette.background,
|
|
1706
|
-
border: palette.success
|
|
1707
|
-
},
|
|
1708
|
-
warning: {
|
|
1709
|
-
bg: palette.background,
|
|
1710
|
-
border: palette.warning
|
|
1711
|
-
},
|
|
1712
|
-
error: {
|
|
1713
|
-
bg: palette.background,
|
|
1714
|
-
border: palette.error
|
|
1715
|
-
},
|
|
1716
|
-
abort: {
|
|
1717
|
-
bg: 'transparent',
|
|
1718
|
-
border: 'transparent',
|
|
1719
|
-
color: palette.accents_5
|
|
1720
|
-
},
|
|
1721
|
-
'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1722
|
-
bg: alphaBackground
|
|
1723
|
-
}),
|
|
1724
|
-
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1725
|
-
bg: alphaBackground
|
|
1726
|
-
}),
|
|
1727
|
-
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1728
|
-
bg: alphaBackground
|
|
1729
|
-
}),
|
|
1730
|
-
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1731
|
-
bg: alphaBackground
|
|
1732
|
-
})
|
|
1733
|
-
};
|
|
1734
|
-
if (disabled) return {
|
|
1735
|
-
bg: palette.accents_1,
|
|
1736
|
-
border: palette.accents_2,
|
|
1737
|
-
color: '#ccc'
|
|
1738
|
-
};
|
|
1739
|
-
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
1740
|
-
color: 'transparent'
|
|
1741
|
-
});
|
|
1742
|
-
if (shadow) return defaultColor;
|
|
1743
|
-
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
1744
|
-
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
1745
|
-
color: hoverColor.color || hoverColor.border
|
|
1746
|
-
});
|
|
1747
|
-
};
|
|
1748
|
-
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
1749
|
-
if (disabled) return {
|
|
1750
|
-
cursor: 'not-allowed',
|
|
1751
|
-
events: 'auto'
|
|
1752
|
-
};
|
|
1753
|
-
if (loading) return {
|
|
1754
|
-
cursor: 'default',
|
|
1755
|
-
events: 'none'
|
|
1756
|
-
};
|
|
1757
|
-
return {
|
|
1758
|
-
cursor: 'pointer',
|
|
1759
|
-
events: 'auto'
|
|
1760
|
-
};
|
|
1761
|
-
};
|
|
1762
|
-
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
1763
|
-
var type = props.type;
|
|
1764
|
-
var isLightHover = type ? type.endsWith('light') : false;
|
|
1765
|
-
var hoverColors = getButtonHoverColors(palette, props);
|
|
1766
|
-
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
1767
|
-
};
|
|
1768
|
-
|
|
1769
|
-
var _excluded$1k = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "relative", "replace", "a", "to", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
1770
|
-
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
1771
|
-
var theme$1 = theme.useTheme();
|
|
1772
|
-
// const navigate = useNavigate();
|
|
1773
|
-
var _useScale = useScale(),
|
|
1774
|
-
SCALES = _useScale.SCALES;
|
|
1775
|
-
var buttonRef = React.useRef(null);
|
|
1776
|
-
React.useImperativeHandle(ref, function () {
|
|
1777
|
-
return buttonRef.current;
|
|
1778
|
-
}); // Changed with !
|
|
1779
|
-
|
|
1780
|
-
var _useState = React.useState(false),
|
|
1781
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1782
|
-
dripShow = _useState2[0],
|
|
1783
|
-
setDripShow = _useState2[1];
|
|
1784
|
-
var _useState3 = React.useState(0),
|
|
1785
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
1786
|
-
dripX = _useState4[0],
|
|
1787
|
-
setDripX = _useState4[1];
|
|
1788
|
-
var _useState5 = React.useState(0),
|
|
1789
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
1790
|
-
dripY = _useState6[0],
|
|
1791
|
-
setDripY = _useState6[1];
|
|
1792
|
-
var groupConfig = useButtonGroupContext();
|
|
1793
|
-
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
1794
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1795
|
-
var children = filteredProps.children,
|
|
1796
|
-
_filteredProps$disabl = filteredProps.disabled,
|
|
1797
|
-
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
1798
|
-
filteredProps.color;
|
|
1799
|
-
var _filteredProps$loadin = filteredProps.loading,
|
|
1800
|
-
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
1801
|
-
_filteredProps$shadow = filteredProps.shadow,
|
|
1802
|
-
shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
|
|
1803
|
-
_filteredProps$ghost = filteredProps.ghost,
|
|
1804
|
-
ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
|
|
1805
|
-
_filteredProps$effect = filteredProps.effect,
|
|
1806
|
-
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
1807
|
-
_filteredProps$round = filteredProps.round,
|
|
1808
|
-
round = _filteredProps$round === void 0 ? false : _filteredProps$round;
|
|
1809
|
-
filteredProps.relative;
|
|
1810
|
-
filteredProps.replace;
|
|
1811
|
-
filteredProps.a;
|
|
1812
|
-
var to = filteredProps.to,
|
|
1813
|
-
onClick = filteredProps.onClick,
|
|
1814
|
-
_filteredProps$auto = filteredProps.auto,
|
|
1815
|
-
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
1816
|
-
icon = filteredProps.icon,
|
|
1817
|
-
_filteredProps$type = filteredProps.type,
|
|
1818
|
-
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
1819
|
-
iconRight = filteredProps.iconRight,
|
|
1820
|
-
_filteredProps$classN = filteredProps.className,
|
|
1821
|
-
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
1822
|
-
filteredProps.crossOrigin;
|
|
1823
|
-
var props = _objectWithoutProperties(filteredProps, _excluded$1k);
|
|
1824
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1825
|
-
|
|
1826
|
-
var _useMemo = React.useMemo(function () {
|
|
1827
|
-
return getButtonColors(theme$1.palette, filteredProps);
|
|
1828
|
-
}, [theme$1.palette, filteredProps]),
|
|
1829
|
-
bg = _useMemo.bg,
|
|
1830
|
-
border = _useMemo.border,
|
|
1831
|
-
color = _useMemo.color,
|
|
1832
|
-
rippleColor = _useMemo.ripple;
|
|
1833
|
-
var hover = React.useMemo(function () {
|
|
1834
|
-
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
1835
|
-
}, [theme$1.palette, filteredProps]);
|
|
1836
|
-
var _useMemo2 = React.useMemo(function () {
|
|
1837
|
-
return getButtonCursor(disabled, loading);
|
|
1838
|
-
}, [disabled, loading]),
|
|
1839
|
-
cursor = _useMemo2.cursor,
|
|
1840
|
-
events = _useMemo2.events;
|
|
1841
|
-
var dripColor = React.useMemo(function () {
|
|
1842
|
-
return getButtonDripColor(theme$1.palette, filteredProps);
|
|
1843
|
-
}, [theme$1.palette, filteredProps]);
|
|
1844
|
-
|
|
1845
|
-
/* istanbul ignore next */
|
|
1846
|
-
var dripCompletedHandle = function dripCompletedHandle() {
|
|
1847
|
-
setDripShow(false);
|
|
1848
|
-
setDripX(0);
|
|
1849
|
-
setDripY(0);
|
|
1850
|
-
};
|
|
1851
|
-
var createRipple = function createRipple(event) {
|
|
1852
|
-
var button = buttonRef.current;
|
|
1853
|
-
if (!button) return;
|
|
1854
|
-
var rect = button.getBoundingClientRect();
|
|
1855
|
-
var size = Math.max(rect.width, rect.height);
|
|
1856
|
-
var x = event.clientX - rect.left - size / 2;
|
|
1857
|
-
var y = event.clientY - rect.top - size / 2;
|
|
1858
|
-
var rippleCount = 1; // number of rings
|
|
1859
|
-
var rippleDelay = 500; // ms between each ripple
|
|
1860
|
-
var _loop = function _loop() {
|
|
1861
|
-
var ripple = document.createElement('span');
|
|
1862
|
-
Object.assign(ripple.style, {
|
|
1863
|
-
position: 'absolute',
|
|
1864
|
-
borderRadius: '50%',
|
|
1865
|
-
backgroundColor: rippleColor,
|
|
1866
|
-
width: "".concat(size, "px"),
|
|
1867
|
-
height: "".concat(size, "px"),
|
|
1868
|
-
left: "".concat(x, "px"),
|
|
1869
|
-
top: "".concat(y, "px"),
|
|
1870
|
-
pointerEvents: 'none',
|
|
1871
|
-
transform: 'scale(0)',
|
|
1872
|
-
opacity: '1',
|
|
1873
|
-
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
1874
|
-
zIndex: 1
|
|
1875
|
-
});
|
|
1876
|
-
button.appendChild(ripple);
|
|
1877
|
-
|
|
1878
|
-
// Force reflow to start transition
|
|
1879
|
-
window.getComputedStyle(ripple).opacity;
|
|
1880
|
-
ripple.style.transform = 'scale(2.5)';
|
|
1881
|
-
ripple.style.opacity = '0';
|
|
1882
|
-
ripple.addEventListener('transitionend', function () {
|
|
1883
|
-
ripple.remove();
|
|
1884
|
-
});
|
|
1885
|
-
};
|
|
1886
|
-
for (var i = 0; i < rippleCount; i++) {
|
|
1887
|
-
_loop();
|
|
1888
|
-
}
|
|
1889
|
-
};
|
|
1890
|
-
var clickHandler = function clickHandler(event) {
|
|
1891
|
-
if (disabled || loading) return;
|
|
1892
|
-
var showDrip = !shadow && !ghost && effect;
|
|
1893
|
-
/* istanbul ignore next */
|
|
1894
|
-
if (showDrip && buttonRef.current) {
|
|
1895
|
-
var rect = buttonRef.current.getBoundingClientRect();
|
|
1896
|
-
setDripShow(true);
|
|
1897
|
-
setDripX(event.clientX - rect.left);
|
|
1898
|
-
setDripY(event.clientY - rect.top);
|
|
1899
|
-
}
|
|
1900
|
-
if (shadow) {
|
|
1901
|
-
createRipple(event);
|
|
1902
|
-
}
|
|
1903
|
-
onClick && onClick(event);
|
|
1904
|
-
};
|
|
1905
|
-
var childrenWithIcon = React.useMemo(function () {
|
|
1906
|
-
return getButtonChildrenWithIcon(auto, children, {
|
|
1907
|
-
icon: icon,
|
|
1908
|
-
iconRight: iconRight
|
|
1909
|
-
});
|
|
1910
|
-
}, [auto, children, icon, iconRight]);
|
|
1911
|
-
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
1912
|
-
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
1913
|
-
|
|
1914
|
-
// If shadow provided is string then value other default
|
|
1915
|
-
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
1916
|
-
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1917
|
-
children: [to ? /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
|
|
1918
|
-
href: to
|
|
1919
|
-
}, props), {}, {
|
|
1920
|
-
className: _JSXStyle.dynamic([["612376042", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', 'btn-link', className) || ""),
|
|
1921
|
-
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
1922
|
-
color: color
|
|
1923
|
-
}), childrenWithIcon]
|
|
1924
|
-
})) : /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread2(_objectSpread2({
|
|
1925
|
-
ref: buttonRef,
|
|
1926
|
-
type: type,
|
|
1927
|
-
disabled: disabled,
|
|
1928
|
-
onClick: clickHandler
|
|
1929
|
-
}, props), {}, {
|
|
1930
|
-
className: _JSXStyle.dynamic([["612376042", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', className) || ""),
|
|
1931
|
-
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
1932
|
-
color: color
|
|
1933
|
-
}), childrenWithIcon, dripShow && /*#__PURE__*/jsxRuntime.jsx(ButtonDrip, {
|
|
1934
|
-
x: dripX,
|
|
1935
|
-
y: dripY,
|
|
1936
|
-
color: dripColor,
|
|
1937
|
-
onCompleted: dripCompletedHandle
|
|
1938
|
-
})]
|
|
1939
|
-
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
1940
|
-
id: "612376042",
|
|
1941
|
-
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px'],
|
|
1942
|
-
children: ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor !== null && cursor !== void 0 ? cursor : 'pointer', ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? btnShadow : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(btnShadow, ";}.btn-link.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}.ripple.__jsx-style-dynamic-selector{position:absolute;border-radius:50%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;background-color:rgba(0,0,0,0.3);pointer-events:none;z-index:1;}@-webkit-keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}@keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}")
|
|
1943
|
-
})]
|
|
1944
|
-
});
|
|
1945
|
-
});
|
|
1946
|
-
ButtonComponent.displayName = 'Button';
|
|
1947
|
-
var Button = withScale(ButtonComponent);
|
|
1948
|
-
|
|
1949
|
-
var CompactButton = function CompactButton(props) {
|
|
1950
|
-
// const theme = useTheme();
|
|
1951
|
-
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
1952
|
-
scale: 2 / 3,
|
|
1953
|
-
px: 0.6
|
|
1954
|
-
}, _objectSpread2({
|
|
1955
|
-
auto: true
|
|
1956
|
-
}, props)), {}, {
|
|
1957
|
-
children: props.children
|
|
1958
|
-
}));
|
|
1959
|
-
};
|
|
1960
|
-
var IconButton = /*#__PURE__*/React.memo(CompactButton);
|
|
1961
|
-
|
|
1962
|
-
var SmallButton = function SmallButton(props) {
|
|
1963
|
-
// const theme = useTheme();
|
|
1964
|
-
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
1965
|
-
auto: true,
|
|
1966
|
-
scale: 2 / 3,
|
|
1967
|
-
px: 0.6
|
|
1968
|
-
}, props), {}, {
|
|
1969
|
-
children: props.children
|
|
1970
|
-
}));
|
|
1971
|
-
};
|
|
1972
|
-
var SmallButton$1 = /*#__PURE__*/React.memo(SmallButton);
|
|
1973
|
-
|
|
1974
|
-
/* "use client" */
|
|
1975
|
-
|
|
1976
|
-
Button.Icon = IconButton;
|
|
1977
|
-
Button.Small = SmallButton$1;
|
|
1978
|
-
|
|
1979
|
-
var _excluded$1j = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "collapse", "children", "className", "display", "alignItems", "justify"];
|
|
1334
|
+
var _excluded$1m = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "children", "className", "display", "alignItems", "justify"];
|
|
1980
1335
|
var _getModifierChild = function getModifierChild(tags, children) {
|
|
1981
1336
|
if (!tags.length) return children;
|
|
1982
1337
|
var nextTag = tags.slice(1, tags.length);
|
|
@@ -2016,8 +1371,6 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
2016
1371
|
blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
|
|
2017
1372
|
_ref$noWrap = _ref.noWrap,
|
|
2018
1373
|
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
2019
|
-
_ref$collapse = _ref.collapse,
|
|
2020
|
-
collapse = _ref$collapse === void 0 ? 0 : _ref$collapse,
|
|
2021
1374
|
children = _ref.children,
|
|
2022
1375
|
_ref$className = _ref.className,
|
|
2023
1376
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
@@ -2025,7 +1378,7 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
2025
1378
|
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
2026
1379
|
alignItems = _ref.alignItems,
|
|
2027
1380
|
justify = _ref.justify,
|
|
2028
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1381
|
+
props = _objectWithoutProperties(_ref, _excluded$1m);
|
|
2029
1382
|
var elements = {
|
|
2030
1383
|
h1: h1,
|
|
2031
1384
|
h2: h2,
|
|
@@ -2061,10 +1414,6 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
2061
1414
|
*
|
|
2062
1415
|
*/
|
|
2063
1416
|
|
|
2064
|
-
var _useState = React.useState(false),
|
|
2065
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
2066
|
-
expand = _useState2[0],
|
|
2067
|
-
setExpand = _useState2[1];
|
|
2068
1417
|
var tag = React.useMemo(function () {
|
|
2069
1418
|
if (names[0]) return names[0];
|
|
2070
1419
|
if (inlineNames[0]) return inlineNames[0];
|
|
@@ -2087,26 +1436,7 @@ var TextComponent = function TextComponent(_ref) {
|
|
|
2087
1436
|
className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
|
|
2088
1437
|
tag: tag
|
|
2089
1438
|
}, props), {}, {
|
|
2090
|
-
children:
|
|
2091
|
-
children: [expand ? modifers : (modifers === null || modifers === void 0 ? void 0 : modifers.toString().substring(0, collapse)) + '...', /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
2092
|
-
margin: 0,
|
|
2093
|
-
onClick: function onClick() {
|
|
2094
|
-
return setExpand(!expand);
|
|
2095
|
-
},
|
|
2096
|
-
style: {
|
|
2097
|
-
textTransform: 'lowercase'
|
|
2098
|
-
},
|
|
2099
|
-
effect: false,
|
|
2100
|
-
color: "abort",
|
|
2101
|
-
scale: 2 / 3,
|
|
2102
|
-
px: 0.2,
|
|
2103
|
-
py: 0,
|
|
2104
|
-
auto: true,
|
|
2105
|
-
children: /*#__PURE__*/jsxRuntime.jsx("b", {
|
|
2106
|
-
children: expand ? 'less' : 'more'
|
|
2107
|
-
})
|
|
2108
|
-
})]
|
|
2109
|
-
}) : modifers
|
|
1439
|
+
children: modifers
|
|
2110
1440
|
}));
|
|
2111
1441
|
};
|
|
2112
1442
|
TextComponent.displayName = 'Text';
|
|
@@ -2243,7 +1573,7 @@ var getColors$7 = function getColors(palette, status) {
|
|
|
2243
1573
|
return colors[status];
|
|
2244
1574
|
};
|
|
2245
1575
|
|
|
2246
|
-
var _excluded$
|
|
1576
|
+
var _excluded$1l = ["label", "labelRight", "error", "color", "helperText", "type", "icon", "variant", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "onEnter", "autoComplete", "placeholder", "children", "disabled", "fullWidth", "required"];
|
|
2247
1577
|
var simulateChangeEvent = function simulateChangeEvent(el, event) {
|
|
2248
1578
|
return _objectSpread2(_objectSpread2({}, event), {}, {
|
|
2249
1579
|
target: el,
|
|
@@ -2290,7 +1620,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2290
1620
|
_ref$fullWidth = _ref.fullWidth,
|
|
2291
1621
|
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
2292
1622
|
required = _ref.required,
|
|
2293
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1623
|
+
props = _objectWithoutProperties(_ref, _excluded$1l);
|
|
2294
1624
|
var theme$1 = theme.useTheme();
|
|
2295
1625
|
var _useScale = useScale(),
|
|
2296
1626
|
SCALES = _useScale.SCALES;
|
|
@@ -2450,7 +1780,7 @@ tuple('hover', 'click');
|
|
|
2450
1780
|
tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
|
|
2451
1781
|
tuple('start', 'center', 'end', 'left', 'right');
|
|
2452
1782
|
|
|
2453
|
-
var _excluded$
|
|
1783
|
+
var _excluded$1k = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "helperText", "error", "label", "required", "resize"];
|
|
2454
1784
|
tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
|
|
2455
1785
|
var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2456
1786
|
var _ref$type = _ref.type,
|
|
@@ -2474,7 +1804,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
2474
1804
|
required = _ref.required,
|
|
2475
1805
|
_ref$resize = _ref.resize,
|
|
2476
1806
|
resize = _ref$resize === void 0 ? 'none' : _ref$resize,
|
|
2477
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1807
|
+
props = _objectWithoutProperties(_ref, _excluded$1k);
|
|
2478
1808
|
var theme$1 = theme.useTheme();
|
|
2479
1809
|
var _useScale = useScale(),
|
|
2480
1810
|
SCALES = _useScale.SCALES;
|
|
@@ -2598,11 +1928,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
|
|
|
2598
1928
|
};
|
|
2599
1929
|
var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
|
|
2600
1930
|
|
|
2601
|
-
var _excluded$
|
|
1931
|
+
var _excluded$1j = ["hideToggle", "children"];
|
|
2602
1932
|
var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
2603
1933
|
var hideToggle = _ref.hideToggle,
|
|
2604
1934
|
children = _ref.children,
|
|
2605
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1935
|
+
props = _objectWithoutProperties(_ref, _excluded$1j);
|
|
2606
1936
|
var _useScale = useScale(),
|
|
2607
1937
|
getAllScaleProps = _useScale.getAllScaleProps;
|
|
2608
1938
|
var inputRef = React.useRef(null);
|
|
@@ -4210,7 +3540,7 @@ var repositionCursor = function repositionCursor(_ref) {
|
|
|
4210
3540
|
};
|
|
4211
3541
|
};
|
|
4212
3542
|
|
|
4213
|
-
var _excluded$
|
|
3543
|
+
var _excluded$1i = ["allowDecimals", "allowNegativeValue", "id", "name", "className", "customInput", "decimalsLimit", "defaultValue", "disabled", "maxLength", "value", "onValueChange", "fixedDecimalLength", "placeholder", "decimalScale", "prefix", "suffix", "intlConfig", "fullWidth", "step", "min", "max", "disableGroupSeparators", "disableAbbreviations", "decimalSeparator", "groupSeparator", "onChange", "onFocus", "onBlur", "onKeyDown", "onKeyUp", "transformRawValue", "formatValueOnBlur", "children"];
|
|
4214
3544
|
var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
4215
3545
|
var _ref$allowDecimals = _ref.allowDecimals,
|
|
4216
3546
|
allowDecimals = _ref$allowDecimals === void 0 ? true : _ref$allowDecimals,
|
|
@@ -4252,7 +3582,7 @@ var InputCurrency = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
4252
3582
|
_ref$formatValueOnBlu = _ref.formatValueOnBlur,
|
|
4253
3583
|
formatValueOnBlur = _ref$formatValueOnBlu === void 0 ? true : _ref$formatValueOnBlu,
|
|
4254
3584
|
children = _ref.children,
|
|
4255
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
3585
|
+
props = _objectWithoutProperties(_ref, _excluded$1i);
|
|
4256
3586
|
var _useScale = useScale(),
|
|
4257
3587
|
SCALES = _useScale.SCALES;
|
|
4258
3588
|
var theme$1 = theme.useTheme();
|
|
@@ -4562,10 +3892,10 @@ Input.Currency = CurrencyInput;
|
|
|
4562
3892
|
|
|
4563
3893
|
/* "use client" */
|
|
4564
3894
|
|
|
4565
|
-
var defaultContext$
|
|
3895
|
+
var defaultContext$d = {
|
|
4566
3896
|
visible: false
|
|
4567
3897
|
};
|
|
4568
|
-
var AutoCompleteContext = /*#__PURE__*/React.createContext(defaultContext$
|
|
3898
|
+
var AutoCompleteContext = /*#__PURE__*/React.createContext(defaultContext$d);
|
|
4569
3899
|
var useAutoCompleteContext = function useAutoCompleteContext() {
|
|
4570
3900
|
return React.useContext(AutoCompleteContext);
|
|
4571
3901
|
};
|
|
@@ -4678,7 +4008,59 @@ var AutoCompleteEmpty = function AutoCompleteEmpty(_ref) {
|
|
|
4678
4008
|
};
|
|
4679
4009
|
AutoCompleteEmpty.displayName = 'AutoCompleteEmpty';
|
|
4680
4010
|
|
|
4681
|
-
var _excluded$
|
|
4011
|
+
var _excluded$1h = ["children", "type", "color", "className", "spaceRatio"];
|
|
4012
|
+
var getIconBgColor = function getIconBgColor(type, palette, color) {
|
|
4013
|
+
var colors = {
|
|
4014
|
+
"default": palette.accents_6,
|
|
4015
|
+
secondary: palette.secondary,
|
|
4016
|
+
success: palette.success,
|
|
4017
|
+
warning: palette.warning,
|
|
4018
|
+
error: palette.error
|
|
4019
|
+
};
|
|
4020
|
+
return color ? color : colors[type];
|
|
4021
|
+
};
|
|
4022
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
|
4023
|
+
var children = _ref.children,
|
|
4024
|
+
_ref$type = _ref.type,
|
|
4025
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
4026
|
+
color = _ref.color,
|
|
4027
|
+
_ref$className = _ref.className,
|
|
4028
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
4029
|
+
_ref$spaceRatio = _ref.spaceRatio,
|
|
4030
|
+
spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
|
|
4031
|
+
props = _objectWithoutProperties(_ref, _excluded$1h);
|
|
4032
|
+
var theme$1 = theme.useTheme();
|
|
4033
|
+
var _useScale = useScale(),
|
|
4034
|
+
SCALES = _useScale.SCALES;
|
|
4035
|
+
var classes = theme.useClasses('loading-container', className);
|
|
4036
|
+
var bgColor = React.useMemo(function () {
|
|
4037
|
+
return getIconBgColor(type, theme$1.palette, color);
|
|
4038
|
+
}, [type, theme$1.palette, color]);
|
|
4039
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4040
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
4041
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
4042
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading",
|
|
4043
|
+
children: [children && /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
4044
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]]),
|
|
4045
|
+
children: children
|
|
4046
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
4047
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
4048
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
4049
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
4050
|
+
}), /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
4051
|
+
className: _JSXStyle.dynamic([["2201634259", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio]]])
|
|
4052
|
+
})]
|
|
4053
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4054
|
+
id: "2201634259",
|
|
4055
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme$1.palette.accents_5, bgColor, spaceRatio],
|
|
4056
|
+
children: ".loading-container.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";min-height:1em;padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{margin-right:0.5em;color:").concat(theme$1.palette.accents_5, ";line-height:1;}label.__jsx-style-dynamic-selector *{margin:0;}.loading.__jsx-style-dynamic-selector{position:absolute;top:50%;left:50%;width:100%;height:100%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:transparent;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}i.__jsx-style-dynamic-selector{width:0.25em;height:0.25em;border-radius:50%;background-color:").concat(bgColor, ";margin:0 calc(0.25em / 2 * ").concat(spaceRatio, ");display:inline-block;-webkit-animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;animation:loading-blink-__jsx-style-dynamic-selector 1.4s infinite both;}i.__jsx-style-dynamic-selector:nth-child(2){-webkit-animation-delay:0.2s;animation-delay:0.2s;}i.__jsx-style-dynamic-selector:nth-child(3){-webkit-animation-delay:0.4s;animation-delay:0.4s;}@-webkit-keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}@keyframes loading-blink-__jsx-style-dynamic-selector{0%{opacity:0.2;}20%{opacity:1;}100%{opacity:0.2;}}")
|
|
4057
|
+
})]
|
|
4058
|
+
}));
|
|
4059
|
+
};
|
|
4060
|
+
LoadingComponent.displayName = 'Loading';
|
|
4061
|
+
var Loading = withScale(LoadingComponent);
|
|
4062
|
+
|
|
4063
|
+
var _excluded$1g = ["options", "initialValue", "onSelect", "onSearch", "onChange", "searching", "children", "type", "color", "value", "clearable", "disabled", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "disableFreeSolo", "getPopupContainer"];
|
|
4682
4064
|
var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
4683
4065
|
return options.map(function (item, index) {
|
|
4684
4066
|
var key = "auto-complete-item-".concat(index);
|
|
@@ -4727,7 +4109,7 @@ var AutoCompleteComponent = /*#__PURE__*/React.forwardRef(function (_ref, userRe
|
|
|
4727
4109
|
_ref$disableFreeSolo = _ref.disableFreeSolo,
|
|
4728
4110
|
disableFreeSolo = _ref$disableFreeSolo === void 0 ? false : _ref$disableFreeSolo,
|
|
4729
4111
|
getPopupContainer = _ref.getPopupContainer,
|
|
4730
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4112
|
+
props = _objectWithoutProperties(_ref, _excluded$1g);
|
|
4731
4113
|
var resetTimer = React.useRef(0); // DEFAULT Value 0
|
|
4732
4114
|
var _useScale = useScale(),
|
|
4733
4115
|
SCALES = _useScale.SCALES,
|
|
@@ -4880,7 +4262,7 @@ AutoComplete.Option = AutoCompleteItemComponent;
|
|
|
4880
4262
|
AutoComplete.Searching = AutoCompleteSearch;
|
|
4881
4263
|
AutoComplete.Empty = AutoCompleteEmpty;
|
|
4882
4264
|
|
|
4883
|
-
var _excluded$
|
|
4265
|
+
var _excluded$1f = ["src", "errorSrc", "stacked", "text", "isSquare", "className", "children"];
|
|
4884
4266
|
var safeText = function safeText(text) {
|
|
4885
4267
|
if (text.length <= 4) return text;
|
|
4886
4268
|
return text.slice(0, 3);
|
|
@@ -4899,7 +4281,7 @@ var AvatarComponent = function AvatarComponent(_ref) {
|
|
|
4899
4281
|
_ref$className = _ref.className,
|
|
4900
4282
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
4901
4283
|
children = _ref.children,
|
|
4902
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4284
|
+
props = _objectWithoutProperties(_ref, _excluded$1f);
|
|
4903
4285
|
var theme$1 = theme.useTheme();
|
|
4904
4286
|
var fallbackSrc = theme$1.type === 'dark' ? errorImgDark : errorImgLight;
|
|
4905
4287
|
var _useScale = useScale(),
|
|
@@ -4960,7 +4342,7 @@ var AvatarGroup = withScale(AvatarGroupComponent);
|
|
|
4960
4342
|
|
|
4961
4343
|
Avatar.Group = AvatarGroup;
|
|
4962
4344
|
|
|
4963
|
-
var _excluded$
|
|
4345
|
+
var _excluded$1e = ["color", "className", "children", "dot"];
|
|
4964
4346
|
var getBgColor = function getBgColor(type, palette) {
|
|
4965
4347
|
var colors = {
|
|
4966
4348
|
"default": palette.foreground,
|
|
@@ -4979,7 +4361,7 @@ var BadgeComponent = function BadgeComponent(_ref) {
|
|
|
4979
4361
|
children = _ref.children,
|
|
4980
4362
|
_ref$dot = _ref.dot,
|
|
4981
4363
|
dot = _ref$dot === void 0 ? false : _ref$dot,
|
|
4982
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4364
|
+
props = _objectWithoutProperties(_ref, _excluded$1e);
|
|
4983
4365
|
var theme$1 = theme.useTheme();
|
|
4984
4366
|
var _useScale = useScale(),
|
|
4985
4367
|
SCALES = _useScale.SCALES;
|
|
@@ -5020,230 +4402,823 @@ var getTransform = function getTransform(placement) {
|
|
|
5020
4402
|
value: 'translate(50%, -50%)',
|
|
5021
4403
|
origin: '100% 0%'
|
|
5022
4404
|
},
|
|
5023
|
-
bottomLeft: {
|
|
5024
|
-
left: '0',
|
|
5025
|
-
bottom: '0',
|
|
5026
|
-
value: 'translate(-50%, 50%)',
|
|
5027
|
-
origin: '0% 100%'
|
|
4405
|
+
bottomLeft: {
|
|
4406
|
+
left: '0',
|
|
4407
|
+
bottom: '0',
|
|
4408
|
+
value: 'translate(-50%, 50%)',
|
|
4409
|
+
origin: '0% 100%'
|
|
4410
|
+
},
|
|
4411
|
+
bottomRight: {
|
|
4412
|
+
right: '0',
|
|
4413
|
+
bottom: '0',
|
|
4414
|
+
value: 'translate(50%, 50%)',
|
|
4415
|
+
origin: '100% 100%'
|
|
4416
|
+
}
|
|
4417
|
+
};
|
|
4418
|
+
return styles[placement];
|
|
4419
|
+
};
|
|
4420
|
+
var BadgeAnchor = function BadgeAnchor(_ref) {
|
|
4421
|
+
var children = _ref.children,
|
|
4422
|
+
_ref$placement = _ref.placement,
|
|
4423
|
+
placement = _ref$placement === void 0 ? 'topRight' : _ref$placement;
|
|
4424
|
+
var _pickChild = pickChild(children, Badge),
|
|
4425
|
+
_pickChild2 = _slicedToArray(_pickChild, 2),
|
|
4426
|
+
withoutBadgeChildren = _pickChild2[0],
|
|
4427
|
+
badgeChldren = _pickChild2[1];
|
|
4428
|
+
var _useMemo = React.useMemo(function () {
|
|
4429
|
+
return getTransform(placement);
|
|
4430
|
+
}, [placement]),
|
|
4431
|
+
top = _useMemo.top,
|
|
4432
|
+
bottom = _useMemo.bottom,
|
|
4433
|
+
left = _useMemo.left,
|
|
4434
|
+
right = _useMemo.right,
|
|
4435
|
+
value = _useMemo.value,
|
|
4436
|
+
origin = _useMemo.origin;
|
|
4437
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4438
|
+
className: _JSXStyle.dynamic([["1121745930", [top || 'auto', left || 'auto', right || 'auto', bottom || 'auto', value, origin]]]) + " " + "anchor",
|
|
4439
|
+
children: [withoutBadgeChildren, /*#__PURE__*/jsxRuntime.jsx("sup", {
|
|
4440
|
+
className: _JSXStyle.dynamic([["1121745930", [top || 'auto', left || 'auto', right || 'auto', bottom || 'auto', value, origin]]]),
|
|
4441
|
+
children: badgeChldren
|
|
4442
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4443
|
+
id: "1121745930",
|
|
4444
|
+
dynamic: [top || 'auto', left || 'auto', right || 'auto', bottom || 'auto', value, origin],
|
|
4445
|
+
children: ".anchor.__jsx-style-dynamic-selector{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;box-sizing:border-box;}sup.__jsx-style-dynamic-selector{position:absolute;top:".concat(top || 'auto', ";left:").concat(left || 'auto', ";right:").concat(right || 'auto', ";bottom:").concat(bottom || 'auto', ";-webkit-transform:").concat(value, ";-ms-transform:").concat(value, ";transform:").concat(value, ";-webkit-transform-origin:").concat(origin, ";-ms-transform-origin:").concat(origin, ";transform-origin:").concat(origin, ";z-index:1;}")
|
|
4446
|
+
})]
|
|
4447
|
+
});
|
|
4448
|
+
};
|
|
4449
|
+
BadgeAnchor.displayName = 'BadgeAnchor';
|
|
4450
|
+
|
|
4451
|
+
/* "use client" */
|
|
4452
|
+
|
|
4453
|
+
Badge.Anchor = BadgeAnchor;
|
|
4454
|
+
|
|
4455
|
+
var Separator = function Separator(_ref) {
|
|
4456
|
+
var children = _ref.children,
|
|
4457
|
+
_ref$className = _ref.className,
|
|
4458
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
4459
|
+
var _useScale = useScale(),
|
|
4460
|
+
SCALES = _useScale.SCALES;
|
|
4461
|
+
var classes = theme.useClasses('separator', className);
|
|
4462
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4463
|
+
className: _JSXStyle.dynamic([["1571781185", [SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0.5), SCALES.mb(0), SCALES.ml(0.5)]]]) + " " + (classes || ""),
|
|
4464
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4465
|
+
id: "1571781185",
|
|
4466
|
+
dynamic: [SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0.5), SCALES.mb(0), SCALES.ml(0.5)],
|
|
4467
|
+
children: ".separator.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:".concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0.5), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0.5), ";}")
|
|
4468
|
+
})]
|
|
4469
|
+
});
|
|
4470
|
+
};
|
|
4471
|
+
Separator.displayName = 'BreadcrumbsSeparator';
|
|
4472
|
+
var BreadcrumbsSeparator = withScale(Separator);
|
|
4473
|
+
|
|
4474
|
+
var hexToRgb = function hexToRgb(color) {
|
|
4475
|
+
var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
4476
|
+
var full = color.replace(fullReg, function (_, r, g, b) {
|
|
4477
|
+
return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
|
|
4478
|
+
});
|
|
4479
|
+
var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
|
|
4480
|
+
if (!values) {
|
|
4481
|
+
throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
|
|
4482
|
+
}
|
|
4483
|
+
return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
|
|
4484
|
+
};
|
|
4485
|
+
var colorToRgbValues = function colorToRgbValues(color) {
|
|
4486
|
+
if (color.charAt(0) === '#') return hexToRgb(color);
|
|
4487
|
+
var safeColor = color.replace(/ /g, '');
|
|
4488
|
+
var colorType = color.substr(0, 4);
|
|
4489
|
+
var regArray = safeColor.match(/\((.+)\)/);
|
|
4490
|
+
if (!colorType.startsWith('rgb') || !regArray) {
|
|
4491
|
+
console.log(color);
|
|
4492
|
+
throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
|
|
4493
|
+
}
|
|
4494
|
+
return regArray[1].split(',').map(function (str) {
|
|
4495
|
+
return Number.parseFloat(str);
|
|
4496
|
+
});
|
|
4497
|
+
};
|
|
4498
|
+
var addColorAlpha = function addColorAlpha(color, alpha) {
|
|
4499
|
+
if (!/^#|rgb|RGB/.test(color)) return color;
|
|
4500
|
+
var _colorToRgbValues = colorToRgbValues(color),
|
|
4501
|
+
_colorToRgbValues2 = _slicedToArray(_colorToRgbValues, 3),
|
|
4502
|
+
r = _colorToRgbValues2[0],
|
|
4503
|
+
g = _colorToRgbValues2[1],
|
|
4504
|
+
b = _colorToRgbValues2[2];
|
|
4505
|
+
var safeAlpha = alpha > 1 ? 1 : alpha < 0 ? 0 : alpha;
|
|
4506
|
+
return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
|
|
4507
|
+
};
|
|
4508
|
+
|
|
4509
|
+
var BreadcrumbsComponent = function BreadcrumbsComponent(_ref) {
|
|
4510
|
+
var _ref$separator = _ref.separator,
|
|
4511
|
+
separator = _ref$separator === void 0 ? '/' : _ref$separator,
|
|
4512
|
+
children = _ref.children,
|
|
4513
|
+
_ref$className = _ref.className,
|
|
4514
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
4515
|
+
var theme$1 = theme.useTheme();
|
|
4516
|
+
var _useScale = useScale(),
|
|
4517
|
+
SCALES = _useScale.SCALES;
|
|
4518
|
+
var hoverColor = React.useMemo(function () {
|
|
4519
|
+
return addColorAlpha(theme$1.palette.link, 0.85);
|
|
4520
|
+
}, [theme$1.palette.link]);
|
|
4521
|
+
var childrenArray = React.Children.toArray(children);
|
|
4522
|
+
var withSeparatorChildren = childrenArray.map(function (item, index) {
|
|
4523
|
+
if (! /*#__PURE__*/React.isValidElement(item)) return item;
|
|
4524
|
+
var last = childrenArray[index - 1];
|
|
4525
|
+
var lastIsSeparator = /*#__PURE__*/React.isValidElement(last) && last.type === BreadcrumbsSeparator;
|
|
4526
|
+
var currentIsSeparator = item.type === BreadcrumbsSeparator;
|
|
4527
|
+
if (!lastIsSeparator && !currentIsSeparator && index > 0) {
|
|
4528
|
+
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
4529
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(BreadcrumbsSeparator, {
|
|
4530
|
+
children: separator
|
|
4531
|
+
}), item]
|
|
4532
|
+
}, index);
|
|
4533
|
+
}
|
|
4534
|
+
return item;
|
|
4535
|
+
});
|
|
4536
|
+
return /*#__PURE__*/jsxRuntime.jsxs("nav", {
|
|
4537
|
+
className: _JSXStyle.dynamic([["524763277", [theme$1.palette.accents_4, SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverColor, theme$1.palette.accents_6]]]) + " " + (className || ""),
|
|
4538
|
+
children: [withSeparatorChildren, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4539
|
+
id: "524763277",
|
|
4540
|
+
dynamic: [theme$1.palette.accents_4, SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverColor, theme$1.palette.accents_6],
|
|
4541
|
+
children: "nav.__jsx-style-dynamic-selector{line-height:inherit;color:".concat(theme$1.palette.accents_4, ";box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:").concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}nav.__jsx-style-dynamic-selector .link:hover{color:").concat(hoverColor, ";}nav.__jsx-style-dynamic-selector>span:last-of-type{color:").concat(theme$1.palette.accents_6, ";}nav.__jsx-style-dynamic-selector>.separator:last-child{display:none;}nav.__jsx-style-dynamic-selector svg{width:1em;height:1em;margin:0 4px;}nav.__jsx-style-dynamic-selector .breadcrumbs-item{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}")
|
|
4542
|
+
})]
|
|
4543
|
+
});
|
|
4544
|
+
};
|
|
4545
|
+
BreadcrumbsComponent.displayName = 'Breadcrumbs';
|
|
4546
|
+
var Breadcrumbs = withScale(BreadcrumbsComponent);
|
|
4547
|
+
|
|
4548
|
+
var LinkIconComponent = function LinkIconComponent() {
|
|
4549
|
+
return /*#__PURE__*/jsxRuntime.jsxs("svg", {
|
|
4550
|
+
viewBox: "0 0 24 24",
|
|
4551
|
+
width: "0.9375em",
|
|
4552
|
+
height: "0.9375em",
|
|
4553
|
+
stroke: "currentColor",
|
|
4554
|
+
strokeWidth: "1.5",
|
|
4555
|
+
strokeLinecap: "round",
|
|
4556
|
+
strokeLinejoin: "round",
|
|
4557
|
+
fill: "none",
|
|
4558
|
+
shapeRendering: "geometricPrecision",
|
|
4559
|
+
className: "jsx-3409194595" + " " + "icon",
|
|
4560
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
4561
|
+
d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6",
|
|
4562
|
+
className: "jsx-3409194595"
|
|
4563
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
4564
|
+
d: "M15 3h6v6",
|
|
4565
|
+
className: "jsx-3409194595"
|
|
4566
|
+
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
4567
|
+
d: "M10 14L21 3",
|
|
4568
|
+
className: "jsx-3409194595"
|
|
4569
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4570
|
+
id: "3409194595",
|
|
4571
|
+
children: ".icon.jsx-3409194595{margin:0 0 -1px 0.1875em;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;color:currentColor;}"
|
|
4572
|
+
})]
|
|
4573
|
+
});
|
|
4574
|
+
};
|
|
4575
|
+
LinkIconComponent.displayName = 'LinkIcon';
|
|
4576
|
+
var LinkIcon = /*#__PURE__*/React.memo(LinkIconComponent);
|
|
4577
|
+
|
|
4578
|
+
var _excluded$1d = ["href", "showColor", "underline", "children", "className", "block", "arrow", "icon"];
|
|
4579
|
+
var LinkComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
4580
|
+
var _ref$href = _ref.href,
|
|
4581
|
+
href = _ref$href === void 0 ? '' : _ref$href,
|
|
4582
|
+
_ref$showColor = _ref.showColor,
|
|
4583
|
+
showColor = _ref$showColor === void 0 ? false : _ref$showColor,
|
|
4584
|
+
_ref$underline = _ref.underline,
|
|
4585
|
+
underline = _ref$underline === void 0 ? false : _ref$underline,
|
|
4586
|
+
children = _ref.children,
|
|
4587
|
+
_ref$className = _ref.className,
|
|
4588
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
4589
|
+
_ref$block = _ref.block,
|
|
4590
|
+
block = _ref$block === void 0 ? false : _ref$block,
|
|
4591
|
+
_ref$arrow = _ref.arrow,
|
|
4592
|
+
arrow = _ref$arrow === void 0 ? false : _ref$arrow,
|
|
4593
|
+
icon = _ref.icon,
|
|
4594
|
+
props = _objectWithoutProperties(_ref, _excluded$1d);
|
|
4595
|
+
var theme$1 = theme.useTheme();
|
|
4596
|
+
var _useScale = useScale(),
|
|
4597
|
+
SCALES = _useScale.SCALES;
|
|
4598
|
+
var linkColor = showColor || block ? theme$1.palette.link : 'inherit';
|
|
4599
|
+
var hoverColor = showColor || block ? theme$1.palette.successLight : 'inherit';
|
|
4600
|
+
var decoration = underline ? 'underline' : 'none';
|
|
4601
|
+
var classes = theme.useClasses('link', {
|
|
4602
|
+
block: block
|
|
4603
|
+
}, className);
|
|
4604
|
+
return /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
|
|
4605
|
+
href: href
|
|
4606
|
+
}, props), {}, {
|
|
4607
|
+
ref: ref,
|
|
4608
|
+
className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
4609
|
+
children: [icon && icon, /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
4610
|
+
className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra",
|
|
4611
|
+
children: [children, arrow && /*#__PURE__*/jsxRuntime.jsx(LinkIcon, {})]
|
|
4612
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4613
|
+
id: "1962988967",
|
|
4614
|
+
dynamic: [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor],
|
|
4615
|
+
children: ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme$1.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")
|
|
4616
|
+
})]
|
|
4617
|
+
}));
|
|
4618
|
+
});
|
|
4619
|
+
LinkComponent.displayName = 'Link';
|
|
4620
|
+
var Link = withScale(LinkComponent);
|
|
4621
|
+
|
|
4622
|
+
var _excluded$1c = ["href", "nextLink", "onClick", "children", "className"];
|
|
4623
|
+
var BreadcrumbsItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
4624
|
+
var href = _ref.href,
|
|
4625
|
+
_ref$nextLink = _ref.nextLink,
|
|
4626
|
+
nextLink = _ref$nextLink === void 0 ? false : _ref$nextLink,
|
|
4627
|
+
onClick = _ref.onClick,
|
|
4628
|
+
children = _ref.children,
|
|
4629
|
+
_ref$className = _ref.className,
|
|
4630
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
4631
|
+
props = _objectWithoutProperties(_ref, _excluded$1c);
|
|
4632
|
+
var isLink = React.useMemo(function () {
|
|
4633
|
+
return href !== undefined || nextLink;
|
|
4634
|
+
}, [href, nextLink]);
|
|
4635
|
+
var _pickChild = pickChild(children, BreadcrumbsSeparator),
|
|
4636
|
+
_pickChild2 = _slicedToArray(_pickChild, 1),
|
|
4637
|
+
withoutSepChildren = _pickChild2[0];
|
|
4638
|
+
var classes = theme.useClasses('breadcrumbs-item', className);
|
|
4639
|
+
var clickHandler = function clickHandler(event) {
|
|
4640
|
+
onClick && onClick(event);
|
|
4641
|
+
};
|
|
4642
|
+
if (!isLink) {
|
|
4643
|
+
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4644
|
+
className: classes,
|
|
4645
|
+
onClick: clickHandler,
|
|
4646
|
+
children: withoutSepChildren
|
|
4647
|
+
});
|
|
4648
|
+
}
|
|
4649
|
+
return /*#__PURE__*/jsxRuntime.jsx(Link, _objectSpread2(_objectSpread2({
|
|
4650
|
+
className: classes,
|
|
4651
|
+
href: href,
|
|
4652
|
+
onClick: clickHandler,
|
|
4653
|
+
ref: ref
|
|
4654
|
+
}, props), {}, {
|
|
4655
|
+
children: withoutSepChildren
|
|
4656
|
+
}));
|
|
4657
|
+
});
|
|
4658
|
+
BreadcrumbsItem.displayName = 'BreadcrumbsItem';
|
|
4659
|
+
|
|
4660
|
+
/* "use client" */
|
|
4661
|
+
|
|
4662
|
+
Breadcrumbs.Item = BreadcrumbsItem;
|
|
4663
|
+
Breadcrumbs.Separator = BreadcrumbsSeparator;
|
|
4664
|
+
|
|
4665
|
+
var ButtonDrip = function ButtonDrip(_ref) {
|
|
4666
|
+
var _ref$x = _ref.x,
|
|
4667
|
+
x = _ref$x === void 0 ? 0 : _ref$x,
|
|
4668
|
+
_ref$y = _ref.y,
|
|
4669
|
+
y = _ref$y === void 0 ? 0 : _ref$y,
|
|
4670
|
+
color = _ref.color,
|
|
4671
|
+
onCompleted = _ref.onCompleted;
|
|
4672
|
+
var dripRef = React.useRef(null);
|
|
4673
|
+
/* istanbul ignore next */
|
|
4674
|
+
var top = Number.isNaN(+y) ? 0 : y - 10;
|
|
4675
|
+
/* istanbul ignore next */
|
|
4676
|
+
var left = Number.isNaN(+x) ? 0 : x - 10;
|
|
4677
|
+
React.useEffect(function () {
|
|
4678
|
+
/* istanbul ignore next */
|
|
4679
|
+
if (!dripRef.current) return;
|
|
4680
|
+
dripRef.current.addEventListener('animationend', onCompleted);
|
|
4681
|
+
return function () {
|
|
4682
|
+
/* istanbul ignore next */
|
|
4683
|
+
if (!dripRef.current) return;
|
|
4684
|
+
dripRef.current.removeEventListener('animationend', onCompleted);
|
|
4685
|
+
};
|
|
4686
|
+
});
|
|
4687
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4688
|
+
ref: dripRef,
|
|
4689
|
+
className: "jsx-3424889537" + " " + "drip",
|
|
4690
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
4691
|
+
width: "20",
|
|
4692
|
+
height: "20",
|
|
4693
|
+
viewBox: "0 0 20 20",
|
|
4694
|
+
style: {
|
|
4695
|
+
top: top,
|
|
4696
|
+
left: left
|
|
4697
|
+
},
|
|
4698
|
+
className: "jsx-3424889537",
|
|
4699
|
+
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
4700
|
+
stroke: "none",
|
|
4701
|
+
strokeWidth: "1",
|
|
4702
|
+
fill: "none",
|
|
4703
|
+
fillRule: "evenodd",
|
|
4704
|
+
className: "jsx-3424889537",
|
|
4705
|
+
children: /*#__PURE__*/jsxRuntime.jsx("g", {
|
|
4706
|
+
fill: color,
|
|
4707
|
+
className: "jsx-3424889537",
|
|
4708
|
+
children: /*#__PURE__*/jsxRuntime.jsx("rect", {
|
|
4709
|
+
width: "100%",
|
|
4710
|
+
height: "100%",
|
|
4711
|
+
rx: "10",
|
|
4712
|
+
className: "jsx-3424889537"
|
|
4713
|
+
})
|
|
4714
|
+
})
|
|
4715
|
+
})
|
|
4716
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4717
|
+
id: "3424889537",
|
|
4718
|
+
children: ".drip.jsx-3424889537{position:absolute;left:0;right:0;top:0;bottom:0;}svg.jsx-3424889537{position:absolute;-webkit-animation:350ms ease-in expand-jsx-3424889537;animation:350ms ease-in expand-jsx-3424889537;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;width:1rem;height:1rem;}@-webkit-keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}@keyframes expand-jsx-3424889537{0%{opacity:0;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1);}30%{opacity:1;}80%{opacity:0.5;}100%{-webkit-transform:scale(28);-ms-transform:scale(28);transform:scale(28);opacity:0;}}"
|
|
4719
|
+
})]
|
|
4720
|
+
});
|
|
4721
|
+
};
|
|
4722
|
+
ButtonDrip.displayName = 'ButtonDrip';
|
|
4723
|
+
|
|
4724
|
+
var ButtonLoading = function ButtonLoading(_ref) {
|
|
4725
|
+
var color = _ref.color;
|
|
4726
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4727
|
+
className: "jsx-212623367" + " " + "btn-loading",
|
|
4728
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Loading, {
|
|
4729
|
+
color: color
|
|
4730
|
+
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4731
|
+
id: "212623367",
|
|
4732
|
+
children: ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"
|
|
4733
|
+
})]
|
|
4734
|
+
});
|
|
4735
|
+
};
|
|
4736
|
+
ButtonLoading.displayName = 'ButtonLoading';
|
|
4737
|
+
|
|
4738
|
+
var _excluded$1b = ["isRight", "isSingle", "children", "className"];
|
|
4739
|
+
var ButtonIcon = function ButtonIcon(_ref) {
|
|
4740
|
+
var _ref$isRight = _ref.isRight,
|
|
4741
|
+
isRight = _ref$isRight === void 0 ? false : _ref$isRight,
|
|
4742
|
+
isSingle = _ref.isSingle,
|
|
4743
|
+
children = _ref.children,
|
|
4744
|
+
_ref$className = _ref.className,
|
|
4745
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
4746
|
+
props = _objectWithoutProperties(_ref, _excluded$1b);
|
|
4747
|
+
var classes = theme.useClasses('icon', {
|
|
4748
|
+
right: isRight,
|
|
4749
|
+
single: isSingle
|
|
4750
|
+
}, className);
|
|
4751
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4752
|
+
className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || ""),
|
|
4753
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4754
|
+
id: "2467502931",
|
|
4755
|
+
children: ".icon.jsx-2467502931{position:absolute;left:var(--helpdice-ui-button-icon-padding);right:auto;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--helpdice-ui-button-color);z-index:1;}.right.jsx-2467502931{right:var(--helpdice-ui-button-icon-padding);left:auto;}.icon.jsx-2467502931 svg{background:transparent;height:calc(var(--helpdice-ui-button-height) / 2.35);width:calc(var(--helpdice-ui-button-height) / 2.35);}.single.jsx-2467502931{position:static;-webkit-transform:none;-ms-transform:none;transform:none;}"
|
|
4756
|
+
})]
|
|
4757
|
+
}));
|
|
4758
|
+
};
|
|
4759
|
+
ButtonIcon.displayName = 'ButtonIcon';
|
|
4760
|
+
|
|
4761
|
+
var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
|
|
4762
|
+
var icon = icons.icon,
|
|
4763
|
+
iconRight = icons.iconRight;
|
|
4764
|
+
var hasIcon = icon || iconRight;
|
|
4765
|
+
var isRight = Boolean(iconRight);
|
|
4766
|
+
var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
|
|
4767
|
+
var classes = theme.useClasses('text', isRight ? 'right' : 'left');
|
|
4768
|
+
if (!hasIcon) return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4769
|
+
className: "text",
|
|
4770
|
+
children: children
|
|
4771
|
+
});
|
|
4772
|
+
if (React.Children.count(children) === 0) {
|
|
4773
|
+
return /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
4774
|
+
isRight: isRight,
|
|
4775
|
+
isSingle: true,
|
|
4776
|
+
children: hasIcon
|
|
4777
|
+
});
|
|
4778
|
+
}
|
|
4779
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4780
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(ButtonIcon, {
|
|
4781
|
+
isRight: isRight,
|
|
4782
|
+
children: hasIcon
|
|
4783
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4784
|
+
className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || ""),
|
|
4785
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
4786
|
+
id: "3568181479",
|
|
4787
|
+
dynamic: [paddingForAutoMode, paddingForAutoMode],
|
|
4788
|
+
children: ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}")
|
|
4789
|
+
})]
|
|
4790
|
+
})]
|
|
4791
|
+
});
|
|
4792
|
+
};
|
|
4793
|
+
var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
|
|
4794
|
+
if (!config.isButtonGroup) return props;
|
|
4795
|
+
return _objectSpread2(_objectSpread2({}, props), {}, {
|
|
4796
|
+
auto: true,
|
|
4797
|
+
shadow: false,
|
|
4798
|
+
ghost: config.ghost || props.ghost,
|
|
4799
|
+
type: config.type || props.type,
|
|
4800
|
+
disabled: config.disabled || props.disabled
|
|
4801
|
+
});
|
|
4802
|
+
};
|
|
4803
|
+
|
|
4804
|
+
/* "use client" */
|
|
4805
|
+
|
|
4806
|
+
var defaultContext$c = {
|
|
4807
|
+
isButtonGroup: false,
|
|
4808
|
+
disabled: false
|
|
4809
|
+
};
|
|
4810
|
+
var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$c);
|
|
4811
|
+
var useButtonGroupContext = function useButtonGroupContext() {
|
|
4812
|
+
return React.useContext(ButtonGroupContext);
|
|
4813
|
+
};
|
|
4814
|
+
|
|
4815
|
+
var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
|
|
4816
|
+
var colors = {
|
|
4817
|
+
secondary: {
|
|
4818
|
+
bg: palette.background,
|
|
4819
|
+
border: palette.foreground,
|
|
4820
|
+
color: palette.foreground,
|
|
4821
|
+
ripple: ''
|
|
4822
|
+
},
|
|
4823
|
+
success: {
|
|
4824
|
+
bg: palette.background,
|
|
4825
|
+
border: palette.success,
|
|
4826
|
+
color: palette.success,
|
|
4827
|
+
ripple: ''
|
|
4828
|
+
},
|
|
4829
|
+
warning: {
|
|
4830
|
+
bg: palette.background,
|
|
4831
|
+
border: palette.warning,
|
|
4832
|
+
color: palette.warning,
|
|
4833
|
+
ripple: ''
|
|
4834
|
+
},
|
|
4835
|
+
error: {
|
|
4836
|
+
bg: palette.background,
|
|
4837
|
+
border: palette.error,
|
|
4838
|
+
color: palette.error,
|
|
4839
|
+
ripple: ''
|
|
4840
|
+
}
|
|
4841
|
+
};
|
|
4842
|
+
return colors[_color] || null;
|
|
4843
|
+
};
|
|
4844
|
+
var getButtonColors = function getButtonColors(palette, props) {
|
|
4845
|
+
var color = props.color,
|
|
4846
|
+
disabled = props.disabled,
|
|
4847
|
+
ghost = props.ghost;
|
|
4848
|
+
var colors = {
|
|
4849
|
+
"default": {
|
|
4850
|
+
bg: palette.background,
|
|
4851
|
+
border: palette.border,
|
|
4852
|
+
color: palette.accents_5,
|
|
4853
|
+
ripple: palette.accents_1
|
|
4854
|
+
},
|
|
4855
|
+
secondary: {
|
|
4856
|
+
bg: palette.foreground,
|
|
4857
|
+
border: palette.foreground,
|
|
4858
|
+
color: palette.background,
|
|
4859
|
+
ripple: palette.accents_1
|
|
4860
|
+
},
|
|
4861
|
+
success: {
|
|
4862
|
+
bg: palette.success,
|
|
4863
|
+
border: palette.success,
|
|
4864
|
+
color: '#fff',
|
|
4865
|
+
ripple: '#1f93ffff'
|
|
4866
|
+
},
|
|
4867
|
+
warning: {
|
|
4868
|
+
bg: palette.warning,
|
|
4869
|
+
border: palette.warning,
|
|
4870
|
+
color: '#fff',
|
|
4871
|
+
ripple: '#ffca29ff'
|
|
4872
|
+
},
|
|
4873
|
+
error: {
|
|
4874
|
+
bg: palette.error,
|
|
4875
|
+
border: palette.error,
|
|
4876
|
+
color: '#fff',
|
|
4877
|
+
ripple: '#ff5a55ff'
|
|
4878
|
+
},
|
|
4879
|
+
abort: {
|
|
4880
|
+
bg: 'transparent',
|
|
4881
|
+
border: 'transparent',
|
|
4882
|
+
color: palette.accents_5,
|
|
4883
|
+
ripple: palette.accents_1
|
|
4884
|
+
}
|
|
4885
|
+
};
|
|
4886
|
+
if (disabled) return {
|
|
4887
|
+
bg: palette.accents_1,
|
|
4888
|
+
border: palette.accents_2,
|
|
4889
|
+
color: '#ccc',
|
|
4890
|
+
ripple: ''
|
|
4891
|
+
};
|
|
4892
|
+
|
|
4893
|
+
/**
|
|
4894
|
+
* The '-light' type is the same color as the common type,
|
|
4895
|
+
* only hover's color is different.
|
|
4896
|
+
* e.g.
|
|
4897
|
+
* Color['success'] === Color['success-light']
|
|
4898
|
+
* Color['warning'] === Color['warning-light']
|
|
4899
|
+
*/
|
|
4900
|
+
var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
|
|
4901
|
+
var defaultColor = colors["default"];
|
|
4902
|
+
if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
|
|
4903
|
+
return colors[withoutLightType] || defaultColor;
|
|
4904
|
+
};
|
|
4905
|
+
var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
|
|
4906
|
+
var colors = {
|
|
4907
|
+
secondary: {
|
|
4908
|
+
bg: palette.foreground,
|
|
4909
|
+
border: palette.background,
|
|
4910
|
+
color: palette.background
|
|
4911
|
+
},
|
|
4912
|
+
success: {
|
|
4913
|
+
bg: palette.success,
|
|
4914
|
+
border: palette.background,
|
|
4915
|
+
color: 'white'
|
|
4916
|
+
},
|
|
4917
|
+
warning: {
|
|
4918
|
+
bg: palette.warning,
|
|
4919
|
+
border: palette.background,
|
|
4920
|
+
color: 'white'
|
|
5028
4921
|
},
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
origin: '100% 100%'
|
|
4922
|
+
error: {
|
|
4923
|
+
bg: palette.error,
|
|
4924
|
+
border: palette.background,
|
|
4925
|
+
color: 'white'
|
|
5034
4926
|
}
|
|
5035
4927
|
};
|
|
5036
|
-
|
|
4928
|
+
var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
|
|
4929
|
+
return colors[withoutLightType] || null;
|
|
5037
4930
|
};
|
|
5038
|
-
var
|
|
5039
|
-
var
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
var
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
4931
|
+
var getButtonHoverColors = function getButtonHoverColors(palette, props) {
|
|
4932
|
+
var color = props.color,
|
|
4933
|
+
disabled = props.disabled,
|
|
4934
|
+
loading = props.loading,
|
|
4935
|
+
shadow = props.shadow,
|
|
4936
|
+
ghost = props.ghost;
|
|
4937
|
+
var defaultColor = getButtonColors(palette, props);
|
|
4938
|
+
var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
|
|
4939
|
+
var colors = {
|
|
4940
|
+
"default": {
|
|
4941
|
+
bg: palette.background,
|
|
4942
|
+
border: palette.foreground
|
|
4943
|
+
},
|
|
4944
|
+
secondary: {
|
|
4945
|
+
bg: palette.background,
|
|
4946
|
+
border: palette.foreground
|
|
4947
|
+
},
|
|
4948
|
+
success: {
|
|
4949
|
+
bg: palette.background,
|
|
4950
|
+
border: palette.success
|
|
4951
|
+
},
|
|
4952
|
+
warning: {
|
|
4953
|
+
bg: palette.background,
|
|
4954
|
+
border: palette.warning
|
|
4955
|
+
},
|
|
4956
|
+
error: {
|
|
4957
|
+
bg: palette.background,
|
|
4958
|
+
border: palette.error
|
|
4959
|
+
},
|
|
4960
|
+
abort: {
|
|
4961
|
+
bg: 'transparent',
|
|
4962
|
+
border: 'transparent',
|
|
4963
|
+
color: palette.accents_5
|
|
4964
|
+
},
|
|
4965
|
+
'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
4966
|
+
bg: alphaBackground
|
|
4967
|
+
}),
|
|
4968
|
+
'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
4969
|
+
bg: alphaBackground
|
|
4970
|
+
}),
|
|
4971
|
+
'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
4972
|
+
bg: alphaBackground
|
|
4973
|
+
}),
|
|
4974
|
+
'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
4975
|
+
bg: alphaBackground
|
|
4976
|
+
})
|
|
4977
|
+
};
|
|
4978
|
+
if (disabled) return {
|
|
4979
|
+
bg: palette.accents_1,
|
|
4980
|
+
border: palette.accents_2,
|
|
4981
|
+
color: '#ccc'
|
|
4982
|
+
};
|
|
4983
|
+
if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
|
|
4984
|
+
color: 'transparent'
|
|
5065
4985
|
});
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
Badge.Anchor = BadgeAnchor;
|
|
5072
|
-
|
|
5073
|
-
var Separator = function Separator(_ref) {
|
|
5074
|
-
var children = _ref.children,
|
|
5075
|
-
_ref$className = _ref.className,
|
|
5076
|
-
className = _ref$className === void 0 ? '' : _ref$className;
|
|
5077
|
-
var _useScale = useScale(),
|
|
5078
|
-
SCALES = _useScale.SCALES;
|
|
5079
|
-
var classes = theme.useClasses('separator', className);
|
|
5080
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
5081
|
-
className: _JSXStyle.dynamic([["1571781185", [SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0.5), SCALES.mb(0), SCALES.ml(0.5)]]]) + " " + (classes || ""),
|
|
5082
|
-
children: [children, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
5083
|
-
id: "1571781185",
|
|
5084
|
-
dynamic: [SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0.5), SCALES.mb(0), SCALES.ml(0.5)],
|
|
5085
|
-
children: ".separator.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:".concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0.5), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0.5), ";}")
|
|
5086
|
-
})]
|
|
4986
|
+
if (shadow) return defaultColor;
|
|
4987
|
+
var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
|
|
4988
|
+
return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
|
|
4989
|
+
color: hoverColor.color || hoverColor.border
|
|
5087
4990
|
});
|
|
5088
4991
|
};
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
return addColorAlpha(theme$1.palette.link, 0.85);
|
|
5103
|
-
}, [theme$1.palette.link]);
|
|
5104
|
-
var childrenArray = React.Children.toArray(children);
|
|
5105
|
-
var withSeparatorChildren = childrenArray.map(function (item, index) {
|
|
5106
|
-
if (! /*#__PURE__*/React.isValidElement(item)) return item;
|
|
5107
|
-
var last = childrenArray[index - 1];
|
|
5108
|
-
var lastIsSeparator = /*#__PURE__*/React.isValidElement(last) && last.type === BreadcrumbsSeparator;
|
|
5109
|
-
var currentIsSeparator = item.type === BreadcrumbsSeparator;
|
|
5110
|
-
if (!lastIsSeparator && !currentIsSeparator && index > 0) {
|
|
5111
|
-
return /*#__PURE__*/jsxRuntime.jsxs(React.Fragment, {
|
|
5112
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(BreadcrumbsSeparator, {
|
|
5113
|
-
children: separator
|
|
5114
|
-
}), item]
|
|
5115
|
-
}, index);
|
|
5116
|
-
}
|
|
5117
|
-
return item;
|
|
5118
|
-
});
|
|
5119
|
-
return /*#__PURE__*/jsxRuntime.jsxs("nav", {
|
|
5120
|
-
className: _JSXStyle.dynamic([["524763277", [theme$1.palette.accents_4, SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverColor, theme$1.palette.accents_6]]]) + " " + (className || ""),
|
|
5121
|
-
children: [withSeparatorChildren, /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
5122
|
-
id: "524763277",
|
|
5123
|
-
dynamic: [theme$1.palette.accents_4, SCALES.font(1), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverColor, theme$1.palette.accents_6],
|
|
5124
|
-
children: "nav.__jsx-style-dynamic-selector{line-height:inherit;color:".concat(theme$1.palette.accents_4, ";box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:").concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}nav.__jsx-style-dynamic-selector .link:hover{color:").concat(hoverColor, ";}nav.__jsx-style-dynamic-selector>span:last-of-type{color:").concat(theme$1.palette.accents_6, ";}nav.__jsx-style-dynamic-selector>.separator:last-child{display:none;}nav.__jsx-style-dynamic-selector svg{width:1em;height:1em;margin:0 4px;}nav.__jsx-style-dynamic-selector .breadcrumbs-item{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}")
|
|
5125
|
-
})]
|
|
5126
|
-
});
|
|
4992
|
+
var getButtonCursor = function getButtonCursor(disabled, loading) {
|
|
4993
|
+
if (disabled) return {
|
|
4994
|
+
cursor: 'not-allowed',
|
|
4995
|
+
events: 'auto'
|
|
4996
|
+
};
|
|
4997
|
+
if (loading) return {
|
|
4998
|
+
cursor: 'default',
|
|
4999
|
+
events: 'none'
|
|
5000
|
+
};
|
|
5001
|
+
return {
|
|
5002
|
+
cursor: 'pointer',
|
|
5003
|
+
events: 'auto'
|
|
5004
|
+
};
|
|
5127
5005
|
};
|
|
5128
|
-
|
|
5129
|
-
var
|
|
5130
|
-
|
|
5131
|
-
var
|
|
5132
|
-
return
|
|
5133
|
-
viewBox: "0 0 24 24",
|
|
5134
|
-
width: "0.9375em",
|
|
5135
|
-
height: "0.9375em",
|
|
5136
|
-
stroke: "currentColor",
|
|
5137
|
-
strokeWidth: "1.5",
|
|
5138
|
-
strokeLinecap: "round",
|
|
5139
|
-
strokeLinejoin: "round",
|
|
5140
|
-
fill: "none",
|
|
5141
|
-
shapeRendering: "geometricPrecision",
|
|
5142
|
-
className: "jsx-3409194595" + " " + "icon",
|
|
5143
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("path", {
|
|
5144
|
-
d: "M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6",
|
|
5145
|
-
className: "jsx-3409194595"
|
|
5146
|
-
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
5147
|
-
d: "M15 3h6v6",
|
|
5148
|
-
className: "jsx-3409194595"
|
|
5149
|
-
}), /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
5150
|
-
d: "M10 14L21 3",
|
|
5151
|
-
className: "jsx-3409194595"
|
|
5152
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
5153
|
-
id: "3409194595",
|
|
5154
|
-
children: ".icon.jsx-3409194595{margin:0 0 -1px 0.1875em;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;color:currentColor;}"
|
|
5155
|
-
})]
|
|
5156
|
-
});
|
|
5006
|
+
var getButtonDripColor = function getButtonDripColor(palette, props) {
|
|
5007
|
+
var type = props.type;
|
|
5008
|
+
var isLightHover = type ? type.endsWith('light') : false;
|
|
5009
|
+
var hoverColors = getButtonHoverColors(palette, props);
|
|
5010
|
+
return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
|
|
5157
5011
|
};
|
|
5158
|
-
LinkIconComponent.displayName = 'LinkIcon';
|
|
5159
|
-
var LinkIcon = /*#__PURE__*/React.memo(LinkIconComponent);
|
|
5160
5012
|
|
|
5161
|
-
var _excluded$
|
|
5162
|
-
var
|
|
5163
|
-
var _ref$href = _ref.href,
|
|
5164
|
-
href = _ref$href === void 0 ? '' : _ref$href,
|
|
5165
|
-
_ref$showColor = _ref.showColor,
|
|
5166
|
-
showColor = _ref$showColor === void 0 ? false : _ref$showColor,
|
|
5167
|
-
_ref$underline = _ref.underline,
|
|
5168
|
-
underline = _ref$underline === void 0 ? false : _ref$underline,
|
|
5169
|
-
children = _ref.children,
|
|
5170
|
-
_ref$className = _ref.className,
|
|
5171
|
-
className = _ref$className === void 0 ? '' : _ref$className,
|
|
5172
|
-
_ref$block = _ref.block,
|
|
5173
|
-
block = _ref$block === void 0 ? false : _ref$block,
|
|
5174
|
-
_ref$arrow = _ref.arrow,
|
|
5175
|
-
arrow = _ref$arrow === void 0 ? false : _ref$arrow,
|
|
5176
|
-
icon = _ref.icon,
|
|
5177
|
-
props = _objectWithoutProperties(_ref, _excluded$1b);
|
|
5013
|
+
var _excluded$1a = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "relative", "replace", "a", "to", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
|
|
5014
|
+
var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
|
|
5178
5015
|
var theme$1 = theme.useTheme();
|
|
5016
|
+
// const navigate = useNavigate();
|
|
5179
5017
|
var _useScale = useScale(),
|
|
5180
5018
|
SCALES = _useScale.SCALES;
|
|
5181
|
-
var
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
block: block
|
|
5186
|
-
}, className);
|
|
5187
|
-
return /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
|
|
5188
|
-
href: href
|
|
5189
|
-
}, props), {}, {
|
|
5190
|
-
ref: ref,
|
|
5191
|
-
className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + (props && props.className != null && props.className || classes || ""),
|
|
5192
|
-
children: [icon && icon, /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
5193
|
-
className: _JSXStyle.dynamic([["1962988967", [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor]]]) + " " + "link-extra",
|
|
5194
|
-
children: [children, arrow && /*#__PURE__*/jsxRuntime.jsx(LinkIcon, {})]
|
|
5195
|
-
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
5196
|
-
id: "1962988967",
|
|
5197
|
-
dynamic: [linkColor, block ? theme$1.layout.radius : 0, SCALES.font(1, 'inherit'), SCALES.width(1, 'fit-content'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.pt(0.125), SCALES.pr(0.25), SCALES.pb(0.125), SCALES.pl(0.25), SCALES.mt(0), SCALES.mr(-0.125), SCALES.mb(0), SCALES.ml(-0.125), decoration, block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', hoverColor],
|
|
5198
|
-
children: ".link.__jsx-style-dynamic-selector,.link-extra.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:inherit;gap:5px;color:".concat(linkColor, ";-webkit-text-decoration:none;text-decoration:none;border-radius:").concat(block ? theme$1.layout.radius : 0, ";-webkit-transition:color 200ms ease 0ms;transition:color 200ms ease 0ms;font-size:").concat(SCALES.font(1, 'inherit'), ";width:").concat(SCALES.width(1, 'fit-content'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.block.__jsx-style-dynamic-selector{padding:").concat(SCALES.pt(0.125), " ").concat(SCALES.pr(0.25), " ").concat(SCALES.pb(0.125), " ").concat(SCALES.pl(0.25), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(-0.125), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(-0.125), ";}.link.__jsx-style-dynamic-selector:hover,.link.__jsx-style-dynamic-selector:active,.link.__jsx-style-dynamic-selector:focus{-webkit-text-decoration:").concat(decoration, ";text-decoration:").concat(decoration, ";}.link.__jsx-style-dynamic-selector:hover{background-color:").concat(block ? addColorAlpha(theme$1.palette.link, 0.1) : 'unset', ";color:").concat(hoverColor, ";}")
|
|
5199
|
-
})]
|
|
5200
|
-
}));
|
|
5201
|
-
});
|
|
5202
|
-
LinkComponent.displayName = 'Link';
|
|
5203
|
-
var Link = withScale(LinkComponent);
|
|
5019
|
+
var buttonRef = React.useRef(null);
|
|
5020
|
+
React.useImperativeHandle(ref, function () {
|
|
5021
|
+
return buttonRef.current;
|
|
5022
|
+
}); // Changed with !
|
|
5204
5023
|
|
|
5205
|
-
var
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
var
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5024
|
+
var _useState = React.useState(false),
|
|
5025
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5026
|
+
dripShow = _useState2[0],
|
|
5027
|
+
setDripShow = _useState2[1];
|
|
5028
|
+
var _useState3 = React.useState(0),
|
|
5029
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5030
|
+
dripX = _useState4[0],
|
|
5031
|
+
setDripX = _useState4[1];
|
|
5032
|
+
var _useState5 = React.useState(0),
|
|
5033
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5034
|
+
dripY = _useState6[0],
|
|
5035
|
+
setDripY = _useState6[1];
|
|
5036
|
+
var groupConfig = useButtonGroupContext();
|
|
5037
|
+
var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
|
|
5038
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5039
|
+
var children = filteredProps.children,
|
|
5040
|
+
_filteredProps$disabl = filteredProps.disabled,
|
|
5041
|
+
disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
|
|
5042
|
+
filteredProps.color;
|
|
5043
|
+
var _filteredProps$loadin = filteredProps.loading,
|
|
5044
|
+
loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
|
|
5045
|
+
_filteredProps$shadow = filteredProps.shadow,
|
|
5046
|
+
shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
|
|
5047
|
+
_filteredProps$ghost = filteredProps.ghost,
|
|
5048
|
+
ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
|
|
5049
|
+
_filteredProps$effect = filteredProps.effect,
|
|
5050
|
+
effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
|
|
5051
|
+
_filteredProps$round = filteredProps.round,
|
|
5052
|
+
round = _filteredProps$round === void 0 ? false : _filteredProps$round;
|
|
5053
|
+
filteredProps.relative;
|
|
5054
|
+
filteredProps.replace;
|
|
5055
|
+
filteredProps.a;
|
|
5056
|
+
var to = filteredProps.to,
|
|
5057
|
+
onClick = filteredProps.onClick,
|
|
5058
|
+
_filteredProps$auto = filteredProps.auto,
|
|
5059
|
+
auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
|
|
5060
|
+
icon = filteredProps.icon,
|
|
5061
|
+
_filteredProps$type = filteredProps.type,
|
|
5062
|
+
type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
|
|
5063
|
+
iconRight = filteredProps.iconRight,
|
|
5064
|
+
_filteredProps$classN = filteredProps.className,
|
|
5065
|
+
className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
|
|
5066
|
+
filteredProps.crossOrigin;
|
|
5067
|
+
var props = _objectWithoutProperties(filteredProps, _excluded$1a);
|
|
5068
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
5069
|
+
|
|
5070
|
+
var _useMemo = React.useMemo(function () {
|
|
5071
|
+
return getButtonColors(theme$1.palette, filteredProps);
|
|
5072
|
+
}, [theme$1.palette, filteredProps]),
|
|
5073
|
+
bg = _useMemo.bg,
|
|
5074
|
+
border = _useMemo.border,
|
|
5075
|
+
color = _useMemo.color,
|
|
5076
|
+
rippleColor = _useMemo.ripple;
|
|
5077
|
+
var hover = React.useMemo(function () {
|
|
5078
|
+
return getButtonHoverColors(theme$1.palette, filteredProps);
|
|
5079
|
+
}, [theme$1.palette, filteredProps]);
|
|
5080
|
+
var _useMemo2 = React.useMemo(function () {
|
|
5081
|
+
return getButtonCursor(disabled, loading);
|
|
5082
|
+
}, [disabled, loading]),
|
|
5083
|
+
cursor = _useMemo2.cursor,
|
|
5084
|
+
events = _useMemo2.events;
|
|
5085
|
+
var dripColor = React.useMemo(function () {
|
|
5086
|
+
return getButtonDripColor(theme$1.palette, filteredProps);
|
|
5087
|
+
}, [theme$1.palette, filteredProps]);
|
|
5088
|
+
|
|
5089
|
+
/* istanbul ignore next */
|
|
5090
|
+
var dripCompletedHandle = function dripCompletedHandle() {
|
|
5091
|
+
setDripShow(false);
|
|
5092
|
+
setDripX(0);
|
|
5093
|
+
setDripY(0);
|
|
5094
|
+
};
|
|
5095
|
+
var createRipple = function createRipple(event) {
|
|
5096
|
+
var button = buttonRef.current;
|
|
5097
|
+
if (!button) return;
|
|
5098
|
+
var rect = button.getBoundingClientRect();
|
|
5099
|
+
var size = Math.max(rect.width, rect.height);
|
|
5100
|
+
var x = event.clientX - rect.left - size / 2;
|
|
5101
|
+
var y = event.clientY - rect.top - size / 2;
|
|
5102
|
+
var rippleCount = 1; // number of rings
|
|
5103
|
+
var rippleDelay = 500; // ms between each ripple
|
|
5104
|
+
var _loop = function _loop() {
|
|
5105
|
+
var ripple = document.createElement('span');
|
|
5106
|
+
Object.assign(ripple.style, {
|
|
5107
|
+
position: 'absolute',
|
|
5108
|
+
borderRadius: '50%',
|
|
5109
|
+
backgroundColor: rippleColor,
|
|
5110
|
+
width: "".concat(size, "px"),
|
|
5111
|
+
height: "".concat(size, "px"),
|
|
5112
|
+
left: "".concat(x, "px"),
|
|
5113
|
+
top: "".concat(y, "px"),
|
|
5114
|
+
pointerEvents: 'none',
|
|
5115
|
+
transform: 'scale(0)',
|
|
5116
|
+
opacity: '1',
|
|
5117
|
+
transition: "transform 600ms ease-out ".concat(i * rippleDelay, "ms, opacity 600ms ease-out ").concat(i * rippleDelay, "ms"),
|
|
5118
|
+
zIndex: 1
|
|
5119
|
+
});
|
|
5120
|
+
button.appendChild(ripple);
|
|
5121
|
+
|
|
5122
|
+
// Force reflow to start transition
|
|
5123
|
+
window.getComputedStyle(ripple).opacity;
|
|
5124
|
+
ripple.style.transform = 'scale(2.5)';
|
|
5125
|
+
ripple.style.opacity = '0';
|
|
5126
|
+
ripple.addEventListener('transitionend', function () {
|
|
5127
|
+
ripple.remove();
|
|
5128
|
+
});
|
|
5129
|
+
};
|
|
5130
|
+
for (var i = 0; i < rippleCount; i++) {
|
|
5131
|
+
_loop();
|
|
5132
|
+
}
|
|
5133
|
+
};
|
|
5222
5134
|
var clickHandler = function clickHandler(event) {
|
|
5135
|
+
if (disabled || loading) return;
|
|
5136
|
+
var showDrip = !shadow && !ghost && effect;
|
|
5137
|
+
/* istanbul ignore next */
|
|
5138
|
+
if (showDrip && buttonRef.current) {
|
|
5139
|
+
var rect = buttonRef.current.getBoundingClientRect();
|
|
5140
|
+
setDripShow(true);
|
|
5141
|
+
setDripX(event.clientX - rect.left);
|
|
5142
|
+
setDripY(event.clientY - rect.top);
|
|
5143
|
+
}
|
|
5144
|
+
if (shadow) {
|
|
5145
|
+
createRipple(event);
|
|
5146
|
+
}
|
|
5223
5147
|
onClick && onClick(event);
|
|
5224
5148
|
};
|
|
5225
|
-
|
|
5226
|
-
return
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
children: withoutSepChildren
|
|
5149
|
+
var childrenWithIcon = React.useMemo(function () {
|
|
5150
|
+
return getButtonChildrenWithIcon(auto, children, {
|
|
5151
|
+
icon: icon,
|
|
5152
|
+
iconRight: iconRight
|
|
5230
5153
|
});
|
|
5231
|
-
}
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5154
|
+
}, [auto, children, icon, iconRight]);
|
|
5155
|
+
var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
5156
|
+
paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
|
|
5157
|
+
|
|
5158
|
+
// If shadow provided is string then value other default
|
|
5159
|
+
var btnShadow = typeof shadow === 'string' ? shadow : shadow ? theme$1.shadows.level.z2 : 'none';
|
|
5160
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
5161
|
+
children: [to ? /*#__PURE__*/jsxRuntime.jsxs("a", _objectSpread2(_objectSpread2({
|
|
5162
|
+
href: to
|
|
5163
|
+
}, props), {}, {
|
|
5164
|
+
className: _JSXStyle.dynamic([["612376042", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', 'btn-link', className) || ""),
|
|
5165
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
5166
|
+
color: color
|
|
5167
|
+
}), childrenWithIcon]
|
|
5168
|
+
})) : /*#__PURE__*/jsxRuntime.jsxs("button", _objectSpread2(_objectSpread2({
|
|
5169
|
+
ref: buttonRef,
|
|
5170
|
+
type: type,
|
|
5171
|
+
disabled: disabled,
|
|
5172
|
+
onClick: clickHandler
|
|
5173
|
+
}, props), {}, {
|
|
5174
|
+
className: _JSXStyle.dynamic([["612376042", [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || theme.useClasses('btn', className) || ""),
|
|
5175
|
+
children: [loading && /*#__PURE__*/jsxRuntime.jsx(ButtonLoading, {
|
|
5176
|
+
color: color
|
|
5177
|
+
}), childrenWithIcon, dripShow && /*#__PURE__*/jsxRuntime.jsx(ButtonDrip, {
|
|
5178
|
+
x: dripX,
|
|
5179
|
+
y: dripY,
|
|
5180
|
+
color: dripColor,
|
|
5181
|
+
onCompleted: dripCompletedHandle
|
|
5182
|
+
})]
|
|
5183
|
+
})), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
5184
|
+
id: "612376042",
|
|
5185
|
+
dynamic: [SCALES.height(2.5), round ? '50%' : theme$1.layout.radius, SCALES.font(0.875), color, bg, shadow ? 'transparent' : border, cursor !== null && cursor !== void 0 ? cursor : 'pointer', events, shadow ? btnShadow : 'none', SCALES.pl(0.727), SCALES.height(2.5), color, bg, auto ? 'min-content' : SCALES.width(10.5), auto ? 'auto' : 'initial', SCALES.height(2.5), SCALES.pt(0), paddingRight, SCALES.pb(0), paddingLeft, SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hover.color, hover.color, hover.bg, hover.border, cursor, events, btnShadow, shadow ? '-1px' : '0px'],
|
|
5186
|
+
children: ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme$1.layout.radius, ";font-weight:400;font-size:").concat(SCALES.font(0.875), ";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;text-transform:capitalize;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;text-align:center;white-space:nowrap;-webkit-transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;transition:background-color 200ms ease 0ms,box-shadow 200ms ease 0ms, border 200ms ease 0ms,color 200ms ease 0ms;position:relative;overflow:hidden;color:").concat(color, ";background-color:").concat(bg, ";border:1px solid ").concat(shadow ? 'transparent' : border, ";cursor:").concat(cursor !== null && cursor !== void 0 ? cursor : 'pointer', ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? btnShadow : 'none', ";--helpdice-ui-button-icon-padding:").concat(SCALES.pl(0.727), ";--helpdice-ui-button-height:").concat(SCALES.height(2.5), ";--helpdice-ui-button-color:").concat(color, ";--helpdice-ui-button-bg:").concat(bg, ";min-width:").concat(auto ? 'min-content' : SCALES.width(10.5), ";width:").concat(auto ? 'auto' : 'initial', ";height:").concat(SCALES.height(2.5), ";padding:").concat(SCALES.pt(0), " ").concat(paddingRight, " ").concat(SCALES.pb(0), " ").concat(paddingLeft, ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.btn.__jsx-style-dynamic-selector:hover,.btn.__jsx-style-dynamic-selector:focus{color:").concat(hover.color, ";--helpdice-ui-button-color:").concat(hover.color, ";background-color:").concat(hover.bg, ";border-color:").concat(hover.border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(btnShadow, ";}.btn-link.__jsx-style-dynamic-selector{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.btn.__jsx-style-dynamic-selector .text{position:relative;z-index:1;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;text-align:center;line-height:inherit;top:-1px;}.btn.__jsx-style-dynamic-selector .text p,.btn.__jsx-style-dynamic-selector .text pre,.btn.__jsx-style-dynamic-selector .text div{margin:0;}.ripple.__jsx-style-dynamic-selector{position:absolute;border-radius:50%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;animation:ripple-animation-__jsx-style-dynamic-selector 600ms ease-out;background-color:rgba(0,0,0,0.3);pointer-events:none;z-index:1;}@-webkit-keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}@keyframes ripple-animation-__jsx-style-dynamic-selector{to{-webkit-transform:scale(2.5);-ms-transform:scale(2.5);transform:scale(2.5);opacity:0;}}")
|
|
5187
|
+
})]
|
|
5188
|
+
});
|
|
5189
|
+
});
|
|
5190
|
+
ButtonComponent.displayName = 'Button';
|
|
5191
|
+
var Button = withScale(ButtonComponent);
|
|
5192
|
+
|
|
5193
|
+
var CompactButton = function CompactButton(props) {
|
|
5194
|
+
// const theme = useTheme();
|
|
5195
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
5196
|
+
scale: 2 / 3,
|
|
5197
|
+
px: 0.6
|
|
5198
|
+
}, _objectSpread2({
|
|
5199
|
+
auto: true
|
|
5200
|
+
}, props)), {}, {
|
|
5201
|
+
children: props.children
|
|
5202
|
+
}));
|
|
5203
|
+
};
|
|
5204
|
+
var IconButton = /*#__PURE__*/React.memo(CompactButton);
|
|
5205
|
+
|
|
5206
|
+
var SmallButton = function SmallButton(props) {
|
|
5207
|
+
// const theme = useTheme();
|
|
5208
|
+
return /*#__PURE__*/jsxRuntime.jsx(Button, _objectSpread2(_objectSpread2({
|
|
5209
|
+
auto: true,
|
|
5210
|
+
scale: 2 / 3,
|
|
5211
|
+
px: 0.6
|
|
5237
5212
|
}, props), {}, {
|
|
5238
|
-
children:
|
|
5213
|
+
children: props.children
|
|
5239
5214
|
}));
|
|
5240
|
-
}
|
|
5241
|
-
|
|
5215
|
+
};
|
|
5216
|
+
var SmallButton$1 = /*#__PURE__*/React.memo(SmallButton);
|
|
5242
5217
|
|
|
5243
5218
|
/* "use client" */
|
|
5244
5219
|
|
|
5245
|
-
|
|
5246
|
-
|
|
5220
|
+
Button.Icon = IconButton;
|
|
5221
|
+
Button.Small = SmallButton$1;
|
|
5247
5222
|
|
|
5248
5223
|
/* "use client" */
|
|
5249
5224
|
|
|
@@ -16822,28 +16797,28 @@ var RadioComponent = function RadioComponent(_ref) {
|
|
|
16822
16797
|
setSelfChecked(Boolean(checked));
|
|
16823
16798
|
}, [checked]);
|
|
16824
16799
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
16825
|
-
className: _JSXStyle.dynamic([["
|
|
16800
|
+
className: _JSXStyle.dynamic([["3265978383", [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg]]]) + " " + (theme.useClasses('radio', className) || ""),
|
|
16826
16801
|
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
16827
|
-
className: _JSXStyle.dynamic([["
|
|
16802
|
+
className: _JSXStyle.dynamic([["3265978383", [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg]]]),
|
|
16828
16803
|
children: [/*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2(_objectSpread2({
|
|
16829
16804
|
type: "radio",
|
|
16830
16805
|
value: radioValue,
|
|
16831
16806
|
checked: selfChecked,
|
|
16832
16807
|
onChange: changeHandler
|
|
16833
16808
|
}, props), {}, {
|
|
16834
|
-
className: _JSXStyle.dynamic([["
|
|
16809
|
+
className: _JSXStyle.dynamic([["3265978383", [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg]]]) + " " + (props && props.className != null && props.className || "")
|
|
16835
16810
|
})), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
16836
|
-
className: _JSXStyle.dynamic([["
|
|
16811
|
+
className: _JSXStyle.dynamic([["3265978383", [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg]]]) + " " + "name",
|
|
16837
16812
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
16838
|
-
className: _JSXStyle.dynamic([["
|
|
16813
|
+
className: _JSXStyle.dynamic([["3265978383", [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg]]]) + " " + (theme.useClasses('point', {
|
|
16839
16814
|
active: selfChecked
|
|
16840
16815
|
}) || "")
|
|
16841
16816
|
}), withoutDescChildren]
|
|
16842
16817
|
}), DescChildren && DescChildren]
|
|
16843
16818
|
}), /*#__PURE__*/jsxRuntime.jsx(_JSXStyle, {
|
|
16844
|
-
id: "
|
|
16845
|
-
dynamic: [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, isDisabled ? theme$1.palette.accents_4 : bg],
|
|
16846
|
-
children: "input.__jsx-style-dynamic-selector{opacity:0;visibility:hidden;overflow:hidden;width:1px;height:1px;top:-1000px;right:-1000px;position:fixed;font-size:0;}.radio.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;position:relative;--radio-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'initial'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;color:").concat(isDisabled ? theme$1.palette.accents_4 : label, ";cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";}.name.__jsx-style-dynamic-selector{font-size:var(--radio-size)
|
|
16819
|
+
id: "3265978383",
|
|
16820
|
+
dynamic: [SCALES.font(1), SCALES.width(1, 'initial'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), isDisabled ? theme$1.palette.accents_4 : label, isDisabled ? 'not-allowed' : 'pointer', border, SCALES.font(0.92), SCALES.font(0.92), isDisabled ? theme$1.palette.accents_4 : bg],
|
|
16821
|
+
children: "input.__jsx-style-dynamic-selector{opacity:0;visibility:hidden;overflow:hidden;width:1px;height:1px;top:-1000px;right:-1000px;position:fixed;font-size:0;}.radio.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;position:relative;--radio-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, 'initial'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}label.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;color:").concat(isDisabled ? theme$1.palette.accents_4 : label, ";cursor:").concat(isDisabled ? 'not-allowed' : 'pointer', ";}.name.__jsx-style-dynamic-selector{font-size:var(--radio-size);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.point.__jsx-style-dynamic-selector{height:var(--radio-size);width:var(--radio-size);border-radius:50%;border:1px solid ").concat(border, ";-webkit-transition:all 0.2s ease 0s;transition:all 0.2s ease 0s;position:relative;display:inline-block;-webkit-transform:scale(0.875);-ms-transform:scale(0.875);transform:scale(0.875);margin-right:calc(var(--radio-size) * 0.375);}.point.__jsx-style-dynamic-selector:before{content:'';position:absolute;left:-1px;top:-1px;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:").concat(SCALES.font(0.92), ";height:").concat(SCALES.font(0.92), ";border-radius:50%;background-color:").concat(isDisabled ? theme$1.palette.accents_4 : bg, ";margin:1px;}.active.__jsx-style-dynamic-selector:before{-webkit-transform:scale(0.875);-ms-transform:scale(0.875);transform:scale(0.875);-webkit-transition:all 0.2s ease 0s;transition:all 0.2s ease 0s;}")
|
|
16847
16822
|
})]
|
|
16848
16823
|
});
|
|
16849
16824
|
};
|
|
@@ -35678,7 +35653,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
35678
35653
|
// <tr>
|
|
35679
35654
|
// <td colSpan={columns?.length}>
|
|
35680
35655
|
// <div>
|
|
35681
|
-
//
|
|
35656
|
+
// <Placeholder empty textOnly={textPlaceholder} msg="No Entries Found" />
|
|
35682
35657
|
// </div>
|
|
35683
35658
|
// </td>
|
|
35684
35659
|
// </tr>
|
|
@@ -42510,6 +42485,77 @@ function Clipboard(props) {
|
|
|
42510
42485
|
}), _objectSpread2({}, props));
|
|
42511
42486
|
}
|
|
42512
42487
|
|
|
42488
|
+
var Expandable = function Expandable(_ref) {
|
|
42489
|
+
var children = _ref.children,
|
|
42490
|
+
collapsedHeight = _ref.collapsedHeight;
|
|
42491
|
+
var contentRef = React.useRef(null);
|
|
42492
|
+
var _useState = React.useState(false),
|
|
42493
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42494
|
+
expanded = _useState2[0],
|
|
42495
|
+
setExpanded = _useState2[1];
|
|
42496
|
+
var _useState3 = React.useState(0),
|
|
42497
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
42498
|
+
fullHeight = _useState4[0],
|
|
42499
|
+
setFullHeight = _useState4[1];
|
|
42500
|
+
var _useState5 = React.useState(false),
|
|
42501
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42502
|
+
isOverflowing = _useState6[0],
|
|
42503
|
+
setIsOverflowing = _useState6[1];
|
|
42504
|
+
React.useEffect(function () {
|
|
42505
|
+
var el = contentRef.current;
|
|
42506
|
+
if (!el) return;
|
|
42507
|
+
var updateHeight = function updateHeight() {
|
|
42508
|
+
var scrollHeight = el.scrollHeight;
|
|
42509
|
+
setFullHeight(scrollHeight);
|
|
42510
|
+
setIsOverflowing(scrollHeight > collapsedHeight);
|
|
42511
|
+
};
|
|
42512
|
+
updateHeight();
|
|
42513
|
+
var observer = new ResizeObserver(updateHeight);
|
|
42514
|
+
observer.observe(el);
|
|
42515
|
+
return function () {
|
|
42516
|
+
return observer.disconnect();
|
|
42517
|
+
};
|
|
42518
|
+
}, [children, collapsedHeight]);
|
|
42519
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
42520
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
42521
|
+
style: {
|
|
42522
|
+
height: expanded ? fullHeight : collapsedHeight,
|
|
42523
|
+
overflow: "hidden",
|
|
42524
|
+
transition: "height 0.3s ease",
|
|
42525
|
+
position: "relative"
|
|
42526
|
+
},
|
|
42527
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
42528
|
+
ref: contentRef,
|
|
42529
|
+
children: children
|
|
42530
|
+
}), !expanded && isOverflowing && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
42531
|
+
style: {
|
|
42532
|
+
position: "absolute",
|
|
42533
|
+
bottom: 0,
|
|
42534
|
+
left: 0,
|
|
42535
|
+
right: 0,
|
|
42536
|
+
height: 40,
|
|
42537
|
+
background: "linear-gradient(to bottom, rgba(255,255,255,0), white)"
|
|
42538
|
+
}
|
|
42539
|
+
})]
|
|
42540
|
+
}), isOverflowing && /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
42541
|
+
margin: 0,
|
|
42542
|
+
padding: 0,
|
|
42543
|
+
onClick: function onClick() {
|
|
42544
|
+
return setExpanded(function (prev) {
|
|
42545
|
+
return !prev;
|
|
42546
|
+
});
|
|
42547
|
+
},
|
|
42548
|
+
effect: false,
|
|
42549
|
+
color: "abort",
|
|
42550
|
+
scale: 2 / 3,
|
|
42551
|
+
auto: true,
|
|
42552
|
+
children: /*#__PURE__*/jsxRuntime.jsx("b", {
|
|
42553
|
+
children: expanded ? 'Show less' : 'Show more'
|
|
42554
|
+
})
|
|
42555
|
+
})]
|
|
42556
|
+
});
|
|
42557
|
+
};
|
|
42558
|
+
|
|
42513
42559
|
exports.AutoComplete = AutoComplete;
|
|
42514
42560
|
exports.Avatar = Avatar;
|
|
42515
42561
|
exports.Badge = Badge;
|
|
@@ -42533,6 +42579,7 @@ exports.Divider = Divider;
|
|
|
42533
42579
|
exports.Dot = Dot;
|
|
42534
42580
|
exports.Drawer = DrawerComponent;
|
|
42535
42581
|
exports.ErrorMessage = ErrorMessage;
|
|
42582
|
+
exports.Expandable = Expandable;
|
|
42536
42583
|
exports.Fieldset = Fieldset;
|
|
42537
42584
|
exports.FormWrapper = FormWrapper;
|
|
42538
42585
|
exports.FormikConsumer = FormikConsumer;
|