@helpdice/ui 1.6.9 → 1.7.0

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.
Files changed (117) hide show
  1. package/dist/Placeholder/index.js +37 -16
  2. package/dist/auto-complete/index.js +37 -15
  3. package/dist/avatar/avatar.d.ts +2 -1
  4. package/dist/avatar/index.js +33 -13
  5. package/dist/badge/index.js +30 -11
  6. package/dist/breadcrumbs/index.js +30 -11
  7. package/dist/button/index.js +32 -12
  8. package/dist/button-dropdown/index.js +30 -11
  9. package/dist/button-group/index.js +30 -11
  10. package/dist/capacity/index.js +30 -11
  11. package/dist/card/index.js +30 -11
  12. package/dist/checkbox/index.js +30 -11
  13. package/dist/code/index.js +30 -11
  14. package/dist/col/index.js +21 -2
  15. package/dist/collapse/index.js +30 -11
  16. package/dist/css-baseline/index.js +24 -5
  17. package/dist/description/index.js +30 -11
  18. package/dist/display/index.js +30 -11
  19. package/dist/divider/index.js +30 -11
  20. package/dist/dot/index.js +30 -11
  21. package/dist/drawer/index.js +30 -11
  22. package/dist/fieldset/index.js +30 -11
  23. package/dist/grid/grid-container.d.ts +3 -3
  24. package/dist/grid/grid.d.ts +3 -3
  25. package/dist/grid/index.js +30 -11
  26. package/dist/image/index.js +30 -11
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +10950 -1486
  29. package/dist/input/index.js +34 -13
  30. package/dist/keyboard/index.js +30 -11
  31. package/dist/link/index.js +30 -11
  32. package/dist/list/index.d.ts +9 -0
  33. package/dist/list/index.js +1287 -0
  34. package/dist/list/list-item.d.ts +53 -0
  35. package/dist/list/list.d.ts +44 -0
  36. package/dist/loading/index.js +30 -11
  37. package/dist/menu/index.d.ts +2 -0
  38. package/dist/menu/index.js +10354 -0
  39. package/dist/menu/menu.d.ts +9 -0
  40. package/dist/modal/index.js +34 -13
  41. package/dist/note/index.js +30 -11
  42. package/dist/page/index.js +30 -11
  43. package/dist/pagination/index.js +30 -11
  44. package/dist/popover/index.js +30 -11
  45. package/dist/progress/index.js +30 -11
  46. package/dist/radio/index.js +30 -11
  47. package/dist/rating/index.js +30 -11
  48. package/dist/row/index.js +21 -2
  49. package/dist/search-bar/index.js +31 -12
  50. package/dist/select/index.js +30 -11
  51. package/dist/slider/index.js +30 -11
  52. package/dist/snippet/index.js +30 -11
  53. package/dist/spacer/index.js +30 -11
  54. package/dist/spinner/index.js +30 -11
  55. package/dist/table/index.d.ts +0 -1
  56. package/dist/table/index.js +1663 -2242
  57. package/dist/tabs/index.js +30 -11
  58. package/dist/tag/index.js +30 -11
  59. package/dist/text/index.js +37 -16
  60. package/dist/text/text.d.ts +1 -0
  61. package/dist/textarea/index.js +30 -11
  62. package/dist/toggle/index.js +30 -11
  63. package/dist/tooltip/index.js +30 -11
  64. package/dist/tree/index.js +21 -2
  65. package/dist/ui-provider/index.js +32 -12
  66. package/dist/use-scale/index.js +9 -9
  67. package/dist/user/index.js +33 -13
  68. package/esm/auto-complete/auto-complete.js +3 -2
  69. package/esm/avatar/avatar.d.ts +2 -1
  70. package/esm/avatar/avatar.js +3 -2
  71. package/esm/button/button.js +2 -1
  72. package/esm/code-block/index.js +17 -12
  73. package/esm/css-baseline/css-baseline.js +3 -3
  74. package/esm/form/FormWrapper.js +4 -4
  75. package/esm/grid/grid-container.d.ts +3 -3
  76. package/esm/grid/grid.d.ts +3 -3
  77. package/esm/index.d.ts +3 -3
  78. package/esm/index.js +3 -3
  79. package/esm/input/input.js +2 -1
  80. package/esm/input/password.js +2 -1
  81. package/esm/link/link.js +2 -2
  82. package/esm/list/index.d.ts +9 -0
  83. package/esm/list/index.js +8 -0
  84. package/esm/list/list-item.d.ts +53 -0
  85. package/esm/list/list-item.js +84 -0
  86. package/esm/list/list.d.ts +44 -0
  87. package/esm/list/list.js +29 -0
  88. package/esm/login-with/LoginSocialApple/index.js +17 -17
  89. package/esm/login-with/LoginSocialGithub/index.js +2 -2
  90. package/esm/login-with/LoginSocialInstagram/index.js +2 -2
  91. package/esm/login-with/LoginSocialLinkedin/index.js +2 -2
  92. package/esm/login-with/LoginSocialMicrosoft/index.js +2 -2
  93. package/esm/login-with/LoginSocialPinterest/index.js +9 -9
  94. package/esm/login-with/LoginSocialTiktok/index.js +2 -2
  95. package/esm/login-with/LoginSocialTwitter/index.js +11 -11
  96. package/esm/menu/index.d.ts +2 -0
  97. package/esm/menu/index.js +2 -0
  98. package/esm/menu/menu.d.ts +9 -0
  99. package/esm/menu/menu.js +92 -0
  100. package/esm/modal/modal-action.js +2 -1
  101. package/esm/table/index.d.ts +0 -1
  102. package/esm/table/index.js +0 -1
  103. package/esm/table/table-body.js +4 -23
  104. package/esm/text/child.js +3 -3
  105. package/esm/text/text.d.ts +1 -0
  106. package/esm/text/text.js +4 -2
  107. package/esm/tooltip/__test__/index.test.js +28 -28
  108. package/package.json +15 -11
  109. package/dist/cart/index.d.ts +0 -72
  110. package/dist/cart/useLocalStorage.d.ts +0 -1
  111. package/dist/table/data-table.d.ts +0 -44
  112. package/esm/cart/index.d.ts +0 -72
  113. package/esm/cart/index.js +0 -265
  114. package/esm/cart/useLocalStorage.d.ts +0 -1
  115. package/esm/cart/useLocalStorage.js +0 -29
  116. package/esm/table/data-table.d.ts +0 -44
  117. package/esm/table/data-table.js +0 -451
@@ -688,11 +688,12 @@ function requireIndex () {
688
688
 
689
689
  // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
690
690
  // https://github.com/reactwg/react-18/discussions/110
691
- var useInsertionEffect = React__default["default"].useInsertionEffect || React__default["default"].useLayoutEffect;
691
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React$1.useLayoutEffect;
692
692
  var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
693
693
  function JSXStyle(props) {
694
694
  var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
695
- // If `registry` does not exist, we do nothing here.
695
+ var insertionEffectCalled = React$1.useRef(false);
696
+ // `registry` might not exist while server-side rendering
696
697
  if (!registry) {
697
698
  return null;
698
699
  }
@@ -701,6 +702,24 @@ function requireIndex () {
701
702
  return null;
702
703
  }
703
704
  useInsertionEffect(function() {
705
+ // ReactDOM removes all DOM during hydration in certain cases
706
+ if (!document.head) {
707
+ return;
708
+ }
709
+ registry.add(props);
710
+ insertionEffectCalled.current = true;
711
+ return function() {
712
+ insertionEffectCalled.current = false;
713
+ registry.remove(props);
714
+ };
715
+ }, [
716
+ props.id,
717
+ String(props.dynamic)
718
+ ]);
719
+ React$1.useLayoutEffect(function() {
720
+ if (!document.head || insertionEffectCalled.current) {
721
+ return;
722
+ }
704
723
  registry.add(props);
705
724
  return function() {
706
725
  registry.remove(props);
@@ -1141,7 +1160,7 @@ var ScalePropKeys = ['width', 'height', 'padding', 'margin', 'w', 'h', 'paddingL
1141
1160
  var defaultDynamicLayoutPipe = function defaultDynamicLayoutPipe(scale1x) {
1142
1161
  return "".concat(scale1x);
1143
1162
  };
1144
- var defaultContext$5 = {
1163
+ var defaultContext$4 = {
1145
1164
  getScaleProps: function getScaleProps() {
1146
1165
  return undefined;
1147
1166
  },
@@ -1167,7 +1186,7 @@ var defaultContext$5 = {
1167
1186
  },
1168
1187
  unit: '16px'
1169
1188
  };
1170
- var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$5);
1189
+ var ScaleContext = /*#__PURE__*/React.createContext(defaultContext$4);
1171
1190
  var useScale = function useScale() {
1172
1191
  return React.useContext(ScaleContext);
1173
1192
  };
@@ -1212,11 +1231,6 @@ var pickChildByProps = function pickChildByProps(children, key, value) {
1212
1231
  var targetChildren = target.length >= 0 ? target : undefined;
1213
1232
  return [withoutPropChildren, targetChildren];
1214
1233
  };
1215
- var getReactNode = function getReactNode(node) {
1216
- if (!node) return null;
1217
- if (typeof node !== 'function') return node;
1218
- return node();
1219
- };
1220
1234
  var isBrowser = function isBrowser() {
1221
1235
  return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
1222
1236
  };
@@ -1270,7 +1284,7 @@ var generateGetAllScaleProps = function generateGetAllScaleProps(props) {
1270
1284
  return getAllScaleProps;
1271
1285
  };
1272
1286
 
1273
- var _excluded$m = ["children"];
1287
+ var _excluded$k = ["children"];
1274
1288
  var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1275
1289
  if (scale === 1) return scale;
1276
1290
  var diff = Math.abs((scale - 1) / 2);
@@ -1278,9 +1292,9 @@ var reduceScaleCoefficient = function reduceScaleCoefficient(scale) {
1278
1292
  };
1279
1293
  var withScale = function withScale(Render) {
1280
1294
  var ScaleFC = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1281
- var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31, _ref32, _ref33;
1295
+ var _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref0, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref23, _ref24, _ref25, _ref26, _ref27, _ref28, _ref29, _ref30, _ref31;
1282
1296
  var children = _ref.children,
1283
- props = _objectWithoutProperties(_ref, _excluded$m);
1297
+ props = _objectWithoutProperties(_ref, _excluded$k);
1284
1298
  var _useTheme = useTheme(),
1285
1299
  layout = _useTheme.layout;
1286
1300
  var paddingLeft = props.paddingLeft,
@@ -1338,14 +1352,14 @@ var withScale = function withScale(Render) {
1338
1352
  pr: makeScaleHandler((_ref4 = (_ref5 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : pr) !== null && _ref5 !== void 0 ? _ref5 : px) !== null && _ref4 !== void 0 ? _ref4 : padding),
1339
1353
  pb: makeScaleHandler((_ref6 = (_ref7 = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : pb) !== null && _ref7 !== void 0 ? _ref7 : py) !== null && _ref6 !== void 0 ? _ref6 : padding),
1340
1354
  pl: makeScaleHandler((_ref8 = (_ref9 = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : pl) !== null && _ref9 !== void 0 ? _ref9 : px) !== null && _ref8 !== void 0 ? _ref8 : padding),
1341
- px: makeScaleHandler((_ref10 = (_ref11 = (_ref12 = (_ref13 = px !== null && px !== void 0 ? px : paddingLeft) !== null && _ref13 !== void 0 ? _ref13 : paddingRight) !== null && _ref12 !== void 0 ? _ref12 : pl) !== null && _ref11 !== void 0 ? _ref11 : pr) !== null && _ref10 !== void 0 ? _ref10 : padding),
1342
- py: makeScaleHandler((_ref14 = (_ref15 = (_ref16 = (_ref17 = py !== null && py !== void 0 ? py : paddingTop) !== null && _ref17 !== void 0 ? _ref17 : paddingBottom) !== null && _ref16 !== void 0 ? _ref16 : pt) !== null && _ref15 !== void 0 ? _ref15 : pb) !== null && _ref14 !== void 0 ? _ref14 : padding),
1343
- mt: makeScaleHandler((_ref18 = (_ref19 = marginTop !== null && marginTop !== void 0 ? marginTop : mt) !== null && _ref19 !== void 0 ? _ref19 : my) !== null && _ref18 !== void 0 ? _ref18 : margin),
1344
- mr: makeScaleHandler((_ref20 = (_ref21 = marginRight !== null && marginRight !== void 0 ? marginRight : mr) !== null && _ref21 !== void 0 ? _ref21 : mx) !== null && _ref20 !== void 0 ? _ref20 : margin),
1345
- mb: makeScaleHandler((_ref22 = (_ref23 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : mb) !== null && _ref23 !== void 0 ? _ref23 : my) !== null && _ref22 !== void 0 ? _ref22 : margin),
1346
- ml: makeScaleHandler((_ref24 = (_ref25 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : ml) !== null && _ref25 !== void 0 ? _ref25 : mx) !== null && _ref24 !== void 0 ? _ref24 : margin),
1347
- mx: makeScaleHandler((_ref26 = (_ref27 = (_ref28 = (_ref29 = mx !== null && mx !== void 0 ? mx : marginLeft) !== null && _ref29 !== void 0 ? _ref29 : marginRight) !== null && _ref28 !== void 0 ? _ref28 : ml) !== null && _ref27 !== void 0 ? _ref27 : mr) !== null && _ref26 !== void 0 ? _ref26 : margin),
1348
- my: makeScaleHandler((_ref30 = (_ref31 = (_ref32 = (_ref33 = my !== null && my !== void 0 ? my : marginTop) !== null && _ref33 !== void 0 ? _ref33 : marginBottom) !== null && _ref32 !== void 0 ? _ref32 : mt) !== null && _ref31 !== void 0 ? _ref31 : mb) !== null && _ref30 !== void 0 ? _ref30 : margin),
1355
+ px: makeScaleHandler((_ref0 = (_ref1 = (_ref10 = (_ref11 = px !== null && px !== void 0 ? px : paddingLeft) !== null && _ref11 !== void 0 ? _ref11 : paddingRight) !== null && _ref10 !== void 0 ? _ref10 : pl) !== null && _ref1 !== void 0 ? _ref1 : pr) !== null && _ref0 !== void 0 ? _ref0 : padding),
1356
+ py: makeScaleHandler((_ref12 = (_ref13 = (_ref14 = (_ref15 = py !== null && py !== void 0 ? py : paddingTop) !== null && _ref15 !== void 0 ? _ref15 : paddingBottom) !== null && _ref14 !== void 0 ? _ref14 : pt) !== null && _ref13 !== void 0 ? _ref13 : pb) !== null && _ref12 !== void 0 ? _ref12 : padding),
1357
+ mt: makeScaleHandler((_ref16 = (_ref17 = marginTop !== null && marginTop !== void 0 ? marginTop : mt) !== null && _ref17 !== void 0 ? _ref17 : my) !== null && _ref16 !== void 0 ? _ref16 : margin),
1358
+ mr: makeScaleHandler((_ref18 = (_ref19 = marginRight !== null && marginRight !== void 0 ? marginRight : mr) !== null && _ref19 !== void 0 ? _ref19 : mx) !== null && _ref18 !== void 0 ? _ref18 : margin),
1359
+ mb: makeScaleHandler((_ref20 = (_ref21 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : mb) !== null && _ref21 !== void 0 ? _ref21 : my) !== null && _ref20 !== void 0 ? _ref20 : margin),
1360
+ ml: makeScaleHandler((_ref22 = (_ref23 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : ml) !== null && _ref23 !== void 0 ? _ref23 : mx) !== null && _ref22 !== void 0 ? _ref22 : margin),
1361
+ mx: makeScaleHandler((_ref24 = (_ref25 = (_ref26 = (_ref27 = mx !== null && mx !== void 0 ? mx : marginLeft) !== null && _ref27 !== void 0 ? _ref27 : marginRight) !== null && _ref26 !== void 0 ? _ref26 : ml) !== null && _ref25 !== void 0 ? _ref25 : mr) !== null && _ref24 !== void 0 ? _ref24 : margin),
1362
+ my: makeScaleHandler((_ref28 = (_ref29 = (_ref30 = (_ref31 = my !== null && my !== void 0 ? my : marginTop) !== null && _ref31 !== void 0 ? _ref31 : marginBottom) !== null && _ref30 !== void 0 ? _ref30 : mt) !== null && _ref29 !== void 0 ? _ref29 : mb) !== null && _ref28 !== void 0 ? _ref28 : margin),
1349
1363
  width: makeScaleHandler(width !== null && width !== void 0 ? width : w),
1350
1364
  height: makeScaleHandler(height !== null && height !== void 0 ? height : h),
1351
1365
  font: makeScaleHandler(font)
@@ -1363,7 +1377,7 @@ var withScale = function withScale(Render) {
1363
1377
  return ScaleFC;
1364
1378
  };
1365
1379
 
1366
- var _excluded$l = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1380
+ var _excluded$j = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1367
1381
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1368
1382
  return _objectSpread2(_objectSpread2({}, event), {}, {
1369
1383
  target: el,
@@ -1403,14 +1417,15 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1403
1417
  children = _ref.children,
1404
1418
  _ref$disabled = _ref.disabled,
1405
1419
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
1406
- props = _objectWithoutProperties(_ref, _excluded$l);
1420
+ props = _objectWithoutProperties(_ref, _excluded$j);
1407
1421
  var theme = useTheme();
1408
1422
  var _useScale = useScale(),
1409
1423
  SCALES = _useScale.SCALES;
1410
1424
  var inputRef = React.useRef(null);
1411
1425
  React.useImperativeHandle(ref, function () {
1412
1426
  return inputRef.current;
1413
- });
1427
+ }); // Changed with !
1428
+
1414
1429
  var _useState = React.useState(initialValue),
1415
1430
  _useState2 = _slicedToArray(_useState, 2),
1416
1431
  selfValue = _useState2[0],
@@ -1545,7 +1560,7 @@ tuple('hover', 'click');
1545
1560
  tuple('top', 'topStart', 'topEnd', 'left', 'leftStart', 'leftEnd', 'bottom', 'bottomStart', 'bottomEnd', 'right', 'rightStart', 'rightEnd');
1546
1561
  tuple('start', 'center', 'end', 'left', 'right');
1547
1562
 
1548
- var _excluded$k = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1563
+ var _excluded$i = ["type", "disabled", "readOnly", "onFocus", "onBlur", "className", "initialValue", "onChange", "value", "placeholder", "resize"];
1549
1564
  tuple('none', 'both', 'horizontal', 'vertical', 'initial', 'inherit');
1550
1565
  var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1551
1566
  var _ref$type = _ref.type,
@@ -1565,7 +1580,7 @@ var TextareaComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1565
1580
  placeholder = _ref.placeholder,
1566
1581
  _ref$resize = _ref.resize,
1567
1582
  resize = _ref$resize === void 0 ? 'none' : _ref$resize,
1568
- props = _objectWithoutProperties(_ref, _excluded$k);
1583
+ props = _objectWithoutProperties(_ref, _excluded$i);
1569
1584
  var theme = useTheme();
1570
1585
  var _useScale = useScale(),
1571
1586
  SCALES = _useScale.SCALES;
@@ -1665,11 +1680,11 @@ var PasswordIcon = function PasswordIcon(_ref) {
1665
1680
  };
1666
1681
  var MemoPasswordIcon = /*#__PURE__*/React.memo(PasswordIcon);
1667
1682
 
1668
- var _excluded$j = ["hideToggle", "children"];
1683
+ var _excluded$h = ["hideToggle", "children"];
1669
1684
  var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1670
1685
  var hideToggle = _ref.hideToggle,
1671
1686
  children = _ref.children,
1672
- props = _objectWithoutProperties(_ref, _excluded$j);
1687
+ props = _objectWithoutProperties(_ref, _excluded$h);
1673
1688
  var _useScale = useScale(),
1674
1689
  getAllScaleProps = _useScale.getAllScaleProps;
1675
1690
  var inputRef = React.useRef(null);
@@ -1679,7 +1694,8 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
1679
1694
  setVisible = _useState2[1];
1680
1695
  React.useImperativeHandle(ref, function () {
1681
1696
  return inputRef.current;
1682
- });
1697
+ }); // Changed with !
1698
+
1683
1699
  var iconClickHandler = function iconClickHandler() {
1684
1700
  setVisible(function (v) {
1685
1701
  return !v;
@@ -1754,11 +1770,11 @@ var SelectIcon = /*#__PURE__*/React.memo(SelectIconComponent);
1754
1770
 
1755
1771
  /* "use client" */
1756
1772
 
1757
- var defaultContext$4 = {
1773
+ var defaultContext$3 = {
1758
1774
  visible: false,
1759
1775
  disableAll: false
1760
1776
  };
1761
- var SelectContext = /*#__PURE__*/React.createContext(defaultContext$4);
1777
+ var SelectContext = /*#__PURE__*/React.createContext(defaultContext$3);
1762
1778
  var useSelectContext = function useSelectContext() {
1763
1779
  return React.useContext(SelectContext);
1764
1780
  };
@@ -1823,7 +1839,7 @@ var useResize = function useResize(callback) {
1823
1839
  }, []);
1824
1840
  };
1825
1841
 
1826
- var _excluded$i = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1842
+ var _excluded$g = ["children", "className", "visible", "enterTime", "leaveTime", "clearTime", "name"];
1827
1843
  var CssTransition = function CssTransition(_ref) {
1828
1844
  var children = _ref.children,
1829
1845
  _ref$className = _ref.className,
@@ -1838,7 +1854,7 @@ var CssTransition = function CssTransition(_ref) {
1838
1854
  clearTime = _ref$clearTime === void 0 ? 60 : _ref$clearTime,
1839
1855
  _ref$name = _ref.name,
1840
1856
  name = _ref$name === void 0 ? 'transition' : _ref$name,
1841
- props = _objectWithoutProperties(_ref, _excluded$i);
1857
+ props = _objectWithoutProperties(_ref, _excluded$g);
1842
1858
  var _useState = React.useState(''),
1843
1859
  _useState2 = _slicedToArray(_useState, 2),
1844
1860
  classes = _useState2[0],
@@ -2094,7 +2110,7 @@ var SelectDropdown = /*#__PURE__*/React.forwardRef(function (_ref, dropdownRef)
2094
2110
  });
2095
2111
  SelectDropdown.displayName = 'SelectDropdown';
2096
2112
 
2097
- var _excluded$h = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
2113
+ var _excluded$f = ["xs", "sm", "md", "lg", "xl", "justify", "direction", "alignItems", "alignContent", "children", "className"];
2098
2114
  var getItemLayout = function getItemLayout(val) {
2099
2115
  var display = val === 0 ? 'display: none;' : 'display: inherit;';
2100
2116
  if (typeof val === 'number') {
@@ -2132,7 +2148,7 @@ var GridBasicItem = function GridBasicItem(_ref) {
2132
2148
  children = _ref.children,
2133
2149
  _ref$className = _ref.className,
2134
2150
  className = _ref$className === void 0 ? '' : _ref$className,
2135
- props = _objectWithoutProperties(_ref, _excluded$h);
2151
+ props = _objectWithoutProperties(_ref, _excluded$f);
2136
2152
  var theme = useTheme();
2137
2153
  var _useScale = useScale(),
2138
2154
  SCALES = _useScale.SCALES;
@@ -2172,12 +2188,12 @@ var GridBasicItem = function GridBasicItem(_ref) {
2172
2188
  };
2173
2189
  GridBasicItem.displayName = 'GridBasicItem';
2174
2190
 
2175
- var _excluded$g = ["children", "className"];
2191
+ var _excluded$e = ["children", "className"];
2176
2192
  var GridComponent = function GridComponent(_ref) {
2177
2193
  var children = _ref.children,
2178
2194
  _ref$className = _ref.className,
2179
2195
  className = _ref$className === void 0 ? '' : _ref$className,
2180
- props = _objectWithoutProperties(_ref, _excluded$g);
2196
+ props = _objectWithoutProperties(_ref, _excluded$e);
2181
2197
  var _useScale = useScale(),
2182
2198
  SCALES = _useScale.SCALES;
2183
2199
  var _styles$className = {
@@ -2197,7 +2213,7 @@ var GridComponent = function GridComponent(_ref) {
2197
2213
  GridComponent.displayName = 'Grid';
2198
2214
  var Grid = withScale(GridComponent);
2199
2215
 
2200
- var _excluded$f = ["gap", "wrap", "children", "className"];
2216
+ var _excluded$d = ["gap", "wrap", "children", "className"];
2201
2217
  var GridContainerComponent = function GridContainerComponent(_ref) {
2202
2218
  var _ref$gap = _ref.gap,
2203
2219
  gap = _ref$gap === void 0 ? 0 : _ref$gap,
@@ -2206,7 +2222,7 @@ var GridContainerComponent = function GridContainerComponent(_ref) {
2206
2222
  children = _ref.children,
2207
2223
  _ref$className = _ref.className,
2208
2224
  className = _ref$className === void 0 ? '' : _ref$className,
2209
- props = _objectWithoutProperties(_ref, _excluded$f);
2225
+ props = _objectWithoutProperties(_ref, _excluded$d);
2210
2226
  var _useScale = useScale(),
2211
2227
  unit = _useScale.unit,
2212
2228
  SCALES = _useScale.SCALES;
@@ -2362,7 +2378,7 @@ var SelectInput = /*#__PURE__*/React.forwardRef(function (_ref, inputRef) {
2362
2378
  });
2363
2379
  SelectInput.displayName = 'SelectInput';
2364
2380
 
2365
- var _excluded$e = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
2381
+ var _excluded$c = ["children", "label", "type", "disabled", "initialValue", "value", "icon", "onChange", "pure", "multiple", "clearable", "placeholder", "className", "dropdownClassName", "dropdownStyle", "disableMatchWidth", "getPopupContainer", "onDropdownVisibleChange"];
2366
2382
  var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2367
2383
  var children = _ref.children,
2368
2384
  label = _ref.label,
@@ -2391,7 +2407,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2391
2407
  getPopupContainer = _ref.getPopupContainer,
2392
2408
  _ref$onDropdownVisibl = _ref.onDropdownVisibleChange,
2393
2409
  onDropdownVisibleChange = _ref$onDropdownVisibl === void 0 ? function () {} : _ref$onDropdownVisibl,
2394
- props = _objectWithoutProperties(_ref, _excluded$e);
2410
+ props = _objectWithoutProperties(_ref, _excluded$c);
2395
2411
  var theme = useTheme();
2396
2412
  var _useScale = useScale(),
2397
2413
  SCALES = _useScale.SCALES;
@@ -2563,7 +2579,7 @@ var SelectComponent = /*#__PURE__*/React.forwardRef(function (_ref, selectRef) {
2563
2579
  SelectComponent.displayName = 'Select';
2564
2580
  var Select = withScale(SelectComponent);
2565
2581
 
2566
- var _excluded$d = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
2582
+ var _excluded$b = ["value", "className", "children", "disabled", "divider", "label", "preventAllEvents"];
2567
2583
  var SelectOptionComponent = function SelectOptionComponent(_ref) {
2568
2584
  var identValue = _ref.value,
2569
2585
  _ref$className = _ref.className,
@@ -2577,7 +2593,7 @@ var SelectOptionComponent = function SelectOptionComponent(_ref) {
2577
2593
  label = _ref$label === void 0 ? false : _ref$label,
2578
2594
  _ref$preventAllEvents = _ref.preventAllEvents,
2579
2595
  preventAllEvents = _ref$preventAllEvents === void 0 ? false : _ref$preventAllEvents,
2580
- props = _objectWithoutProperties(_ref, _excluded$d);
2596
+ props = _objectWithoutProperties(_ref, _excluded$b);
2581
2597
  var theme = useTheme();
2582
2598
  var _useScale = useScale(),
2583
2599
  SCALES = _useScale.SCALES;
@@ -2842,11 +2858,11 @@ var TableCell = function TableCell(_ref) {
2842
2858
 
2843
2859
  /* "use client" */
2844
2860
 
2845
- var defaultContext$3 = {
2861
+ var defaultContext$2 = {
2846
2862
  columns: [],
2847
2863
  updateColumn: function updateColumn() {}
2848
2864
  };
2849
- var TableContext = /*#__PURE__*/React.createContext(defaultContext$3);
2865
+ var TableContext = /*#__PURE__*/React.createContext(defaultContext$2);
2850
2866
  var useTableContext = function useTableContext() {
2851
2867
  return React.useContext(TableContext);
2852
2868
  };
@@ -7159,7 +7175,7 @@ function requireLodash () {
7159
7175
  return symbolToString ? symbolToString.call(value) : '';
7160
7176
  }
7161
7177
  var result = (value + '');
7162
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
7178
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
7163
7179
  }
7164
7180
 
7165
7181
  /**
@@ -9682,7 +9698,7 @@ function requireLodash () {
9682
9698
  return value;
9683
9699
  }
9684
9700
  var result = (value + '');
9685
- return (result == '0' && (1 / value) == -Infinity) ? '-0' : result;
9701
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
9686
9702
  }
9687
9703
 
9688
9704
  /**
@@ -15024,7 +15040,7 @@ function requireLodash () {
15024
15040
  * // => false
15025
15041
  */
15026
15042
  function isSafeInteger(value) {
15027
- return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER;
15043
+ return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
15028
15044
  }
15029
15045
 
15030
15046
  /**
@@ -15291,7 +15307,7 @@ function requireLodash () {
15291
15307
  return value === 0 ? value : 0;
15292
15308
  }
15293
15309
  value = toNumber(value);
15294
- if (value === INFINITY || value === -Infinity) {
15310
+ if (value === INFINITY || value === -INFINITY) {
15295
15311
  var sign = (value < 0 ? -1 : 1);
15296
15312
  return sign * MAX_INTEGER;
15297
15313
  }
@@ -15460,7 +15476,7 @@ function requireLodash () {
15460
15476
  */
15461
15477
  function toSafeInteger(value) {
15462
15478
  return value
15463
- ? baseClamp(toInteger(value), -9007199254740991, MAX_SAFE_INTEGER)
15479
+ ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
15464
15480
  : (value === 0 ? value : 0);
15465
15481
  }
15466
15482
 
@@ -20364,7 +20380,7 @@ function Empty() {
20364
20380
  }));
20365
20381
  }
20366
20382
 
20367
- var _excluded$c = ["children", "tag", "className", "color"];
20383
+ var _excluded$a = ["children", "tag", "className", "color"];
20368
20384
  var getTypeColor = function getTypeColor(type, palette) {
20369
20385
  var colors = {
20370
20386
  "default": 'inherit',
@@ -20382,7 +20398,7 @@ var TextChild = function TextChild(_ref) {
20382
20398
  className = _ref$className === void 0 ? '' : _ref$className,
20383
20399
  _ref$color = _ref.color,
20384
20400
  color = _ref$color === void 0 ? 'default' : _ref$color,
20385
- props = _objectWithoutProperties(_ref, _excluded$c);
20401
+ props = _objectWithoutProperties(_ref, _excluded$a);
20386
20402
  var Component = tag;
20387
20403
  var theme = useTheme();
20388
20404
  var _useScale = useScale(),
@@ -20420,15 +20436,15 @@ var TextChild = function TextChild(_ref) {
20420
20436
  return "".concat(scaleClassNames, " ").concat(className).trim();
20421
20437
  }, [mx, my, px, py, font, className]);
20422
20438
  return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
20423
- className: _JSXStyle.dynamic([["4133320328", [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]]]) + " " + (props && props.className != null && props.className || classNames || "")
20439
+ className: _JSXStyle.dynamic([["2277774325", [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]]]) + " " + (props && props.className != null && props.className || classNames || "")
20424
20440
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
20425
- id: "4133320328",
20441
+ id: "2277774325",
20426
20442
  dynamic: [tag, _color, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1, 'inherit'), SCALES.ml(0, 'revert'), SCALES.mr(0, 'revert'), SCALES.mt(0, 'revert'), SCALES.mb(0, 'revert'), SCALES.pl(0, 'revert'), SCALES.pr(0, 'revert'), SCALES.pt(0, 'revert'), SCALES.pb(0, 'revert')]
20427
- }, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(_color, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.font.__jsx-style-dynamic-selector{font-size:").concat(SCALES.font(1, 'inherit'), ";}.mx.__jsx-style-dynamic-selector{margin-left:").concat(SCALES.ml(0, 'revert'), ";margin-right:").concat(SCALES.mr(0, 'revert'), ";}.my.__jsx-style-dynamic-selector{margin-top:").concat(SCALES.mt(0, 'revert'), ";margin-bottom:").concat(SCALES.mb(0, 'revert'), ";}.px.__jsx-style-dynamic-selector{padding-left:").concat(SCALES.pl(0, 'revert'), ";padding-right:").concat(SCALES.pr(0, 'revert'), ";}.py.__jsx-style-dynamic-selector{padding-top:").concat(SCALES.pt(0, 'revert'), ";padding-bottom:").concat(SCALES.pb(0, 'revert'), ";}")));
20443
+ }, "".concat(tag, ".__jsx-style-dynamic-selector{color:").concat(_color, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.font.__jsx-style-dynamic-selector{font-size:").concat(SCALES.font(1, 'inherit'), ";}.mx.__jsx-style-dynamic-selector{margin-left:").concat(SCALES.ml(0, 'revert'), ";margin-right:").concat(SCALES.mr(0, 'revert'), ";}.my.__jsx-style-dynamic-selector{margin-top:").concat(SCALES.mt(0, 'revert'), ";margin-bottom:").concat(SCALES.mb(0, 'revert'), ";}.px.__jsx-style-dynamic-selector{padding-left:").concat(SCALES.pl(0, 'revert'), ";padding-right:").concat(SCALES.pr(0, 'revert'), ";}.py.__jsx-style-dynamic-selector{padding-top:").concat(SCALES.pt(0, 'revert'), ";padding-bottom:").concat(SCALES.pb(0, 'revert'), ";}.no-wrap.__jsx-style-dynamic-selector{white-space:nowrap;}")));
20428
20444
  };
20429
20445
  TextChild.displayName = 'TextChild';
20430
20446
 
20431
- var _excluded$b = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "children", "className"];
20447
+ var _excluded$9 = ["h1", "h2", "h3", "h4", "h5", "h6", "p", "b", "small", "i", "span", "del", "em", "blockquote", "noWrap", "children", "className"];
20432
20448
  var _getModifierChild = function getModifierChild(tags, children) {
20433
20449
  if (!tags.length) return children;
20434
20450
  var nextTag = tags.slice(1, tags.length);
@@ -20465,10 +20481,12 @@ var TextComponent = function TextComponent(_ref) {
20465
20481
  em = _ref$em === void 0 ? false : _ref$em,
20466
20482
  _ref$blockquote = _ref.blockquote,
20467
20483
  blockquote = _ref$blockquote === void 0 ? false : _ref$blockquote,
20484
+ _ref$noWrap = _ref.noWrap,
20485
+ noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
20468
20486
  children = _ref.children,
20469
20487
  _ref$className = _ref.className,
20470
20488
  className = _ref$className === void 0 ? '' : _ref$className,
20471
- props = _objectWithoutProperties(_ref, _excluded$b);
20489
+ props = _objectWithoutProperties(_ref, _excluded$9);
20472
20490
  var elements = {
20473
20491
  h1: h1,
20474
20492
  h2: h2,
@@ -20520,7 +20538,7 @@ var TextComponent = function TextComponent(_ref) {
20520
20538
  style: {
20521
20539
  textAlign: props.align
20522
20540
  },
20523
- className: className,
20541
+ className: "".concat(className, " ").concat(noWrap ? 'no-wrap' : ''),
20524
20542
  tag: tag
20525
20543
  }, props), modifers);
20526
20544
  };
@@ -20615,218 +20633,463 @@ function Placeholder(_ref) {
20615
20633
  }, msg));
20616
20634
  }
20617
20635
 
20618
- // import { IconContext } from "./context.js";
20619
- const createIcon = (Component) => {
20620
- const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
20621
- // const context = useContext(IconContext);
20622
- return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
20623
- React.createElement("title", null, "Icon"),
20624
- React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
20625
- });
20626
- const MemoIcon = React.memo(IconWrapper);
20627
- return MemoIcon;
20628
- };
20629
-
20630
- const Air = ({ color, strokeWidth, set }) => {
20631
- const Broken = () => (React.createElement("g", null,
20632
- React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20633
- React.createElement("path", { id: "shape_2", d: "M5 9H10M16.5 4C17.8807 4 19 5.11929 19 6.5C19 7.88071 17.8807 9 16.5 9H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20634
- React.createElement("path", { id: "shape_3", d: "M4 15H7M17 19C18.1046 19 19 18.1046 19 17C19 15.8954 18.1046 15 17 15H11", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20635
- const Curved = () => (React.createElement("g", null,
20636
- React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20637
- React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20638
- React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20639
- const Duotone = () => (React.createElement("g", null,
20640
- React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20641
- React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20642
- React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20643
- const Outline = () => (React.createElement("g", null,
20644
- React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20645
- React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20646
- React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20647
- switch (set) {
20648
- case "broken":
20649
- return React.createElement(Broken, null);
20650
- case "curved":
20651
- return React.createElement(Curved, null);
20652
- case "duotone":
20653
- return React.createElement(Duotone, null);
20654
- case "outline":
20655
- return React.createElement(Outline, null);
20656
- default:
20657
- return React.createElement(Outline, null);
20658
- }
20659
- };
20660
- Air.displayName = "Air";
20661
- createIcon(Air);
20636
+ // import { DataTable } from '@helpdice/pro';
20662
20637
 
20663
- const Alarm = ({ color, strokeWidth, set }) => {
20664
- const Broken = () => (React__namespace.createElement("g", null,
20665
- React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20666
- React__namespace.createElement("path", { d: "M20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21C14.3894 21 16.5341 19.9525 18 18.2916", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20667
- React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20668
- React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20669
- const Curved = () => (React__namespace.createElement("g", null,
20670
- React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20671
- React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20672
- React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20673
- React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20674
- const Duotone = () => (React__namespace.createElement("g", null,
20675
- React__namespace.createElement("path", { opacity: "0.15", d: "M20 13C20 17.4183 16.4183 21 12 21C7.58172 21 4 17.4183 4 13C4 8.58172 7.58172 5 12 5C16.4183 5 20 8.58172 20 13Z", fill: color }),
20676
- React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20677
- React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20678
- React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20679
- React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20680
- const Outline = () => (React__namespace.createElement("g", null,
20681
- React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20682
- React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20683
- React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20684
- React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20685
- switch (set) {
20686
- case "broken":
20687
- return React__namespace.createElement(Broken, null);
20688
- case "curved":
20689
- return React__namespace.createElement(Curved, null);
20690
- case "duotone":
20691
- return React__namespace.createElement(Duotone, null);
20692
- case "outline":
20693
- return React__namespace.createElement(Outline, null);
20694
- default:
20695
- return React__namespace.createElement(Outline, null);
20696
- }
20697
- };
20698
- Alarm.displayName = "Alarm";
20699
- createIcon(Alarm);
20638
+ var TableBody = function TableBody(_ref) {
20639
+ var data = _ref.data,
20640
+ emptyText = _ref.emptyText,
20641
+ onRow = _ref.onRow,
20642
+ onCell = _ref.onCell,
20643
+ rowClassName = _ref.rowClassName,
20644
+ textPlaceholder = _ref.textPlaceholder,
20645
+ _ref$rowDraggable = _ref.rowDraggable,
20646
+ rowDraggable = _ref$rowDraggable === void 0 ? false : _ref$rowDraggable,
20647
+ _ref$readOnly = _ref.readOnly,
20648
+ readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
20649
+ onSelected = _ref.onSelected;
20650
+ var theme = useTheme();
20651
+ var _useState = React.useState([]),
20652
+ _useState2 = _slicedToArray(_useState, 2),
20653
+ selected = _useState2[0],
20654
+ setSelected = _useState2[1];
20655
+ var _useTableContext = useTableContext(),
20656
+ columns = _useTableContext.columns;
20657
+ // const rowClickHandler = (row: TableDataItem, index: number) => {
20658
+ // onRow && onRow(row, index)
20659
+ // }
20700
20660
 
20701
- const ArrowCircleDown = ({ color, strokeWidth, set }) => {
20702
- const Broken = () => (React__namespace.createElement("g", null,
20703
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20704
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20705
- React__namespace.createElement("path", { d: "M10 15L8 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20706
- React__namespace.createElement("path", { d: "M12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20707
- const Curved = () => (React__namespace.createElement("g", null,
20708
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20709
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20710
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20711
- const Duotone = () => (React__namespace.createElement("g", null,
20712
- React__namespace.createElement("path", { opacity: "0.15", d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", fill: color }),
20713
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20714
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20715
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20716
- const Outline = () => (React__namespace.createElement("g", null,
20717
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20718
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20719
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20720
- switch (set) {
20721
- case "broken":
20722
- return React__namespace.createElement(Broken, null);
20723
- case "curved":
20724
- return React__namespace.createElement(Curved, null);
20725
- case "duotone":
20726
- return React__namespace.createElement(Duotone, null);
20727
- case "outline":
20728
- return React__namespace.createElement(Outline, null);
20729
- default:
20730
- return React__namespace.createElement(Outline, null);
20661
+ var handleClick = function handleClick(_event, id) {
20662
+ if (readOnly) {
20663
+ return true;
20731
20664
  }
20732
- };
20733
- ArrowCircleDown.displayName = "ArrowCircleDown";
20734
- createIcon(ArrowCircleDown);
20735
-
20736
- const ArrowSmallDown = ({ color, strokeWidth, set }) => {
20737
- const Broken = () => (React__namespace.createElement("g", null,
20738
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20739
- React__namespace.createElement("path", { d: "M10 15L8 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20740
- React__namespace.createElement("path", { d: "M12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20741
- const Curved = () => (React__namespace.createElement("g", null,
20742
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20743
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20744
- const Duotone = () => (React__namespace.createElement("g", null,
20745
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20746
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20747
- const Outline = () => (React__namespace.createElement("g", null,
20748
- React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20749
- React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20750
- switch (set) {
20751
- case "broken":
20752
- return React__namespace.createElement(Broken, null);
20753
- case "curved":
20754
- return React__namespace.createElement(Curved, null);
20755
- case "duotone":
20756
- return React__namespace.createElement(Duotone, null);
20757
- case "outline":
20758
- return React__namespace.createElement(Outline, null);
20759
- default:
20760
- return React__namespace.createElement(Outline, null);
20665
+ var selectedIndex = selected.indexOf(id);
20666
+ var newSelected = [];
20667
+ if (selectedIndex === -1) {
20668
+ newSelected = newSelected.concat(selected, id);
20669
+ } else if (selectedIndex === 0) {
20670
+ newSelected = newSelected.concat(selected.slice(1));
20671
+ } else if (selectedIndex === selected.length - 1) {
20672
+ newSelected = newSelected.concat(selected.slice(0, -1));
20673
+ } else if (selectedIndex > 0) {
20674
+ newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
20761
20675
  }
20762
- };
20763
- ArrowSmallDown.displayName = "ArrowSmallDown";
20764
- createIcon(ArrowSmallDown);
20765
-
20766
- const ArrowDown = ({ color, strokeWidth, set }) => {
20767
- const Broken = () => (React__namespace.createElement("g", null,
20768
- React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20769
- React__namespace.createElement("path", { d: "M9 17L6 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20770
- React__namespace.createElement("path", { d: "M12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20771
- const Curved = () => (React__namespace.createElement("g", null,
20772
- React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20773
- React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20774
- const Duotone = () => (React__namespace.createElement("g", null,
20775
- React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20776
- React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20777
- const Outline = () => (React__namespace.createElement("g", null,
20778
- React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20779
- React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20780
- switch (set) {
20781
- case "broken":
20782
- return React__namespace.createElement(Broken, null);
20783
- case "curved":
20784
- return React__namespace.createElement(Curved, null);
20785
- case "duotone":
20786
- return React__namespace.createElement(Duotone, null);
20787
- case "outline":
20788
- return React__namespace.createElement(Outline, null);
20789
- default:
20790
- return React__namespace.createElement(Outline, null);
20676
+ setSelected(newSelected);
20677
+ if (newSelected.length > 0 && onSelected) {
20678
+ onSelected(newSelected);
20791
20679
  }
20792
- };
20793
- ArrowDown.displayName = "ArrowDown";
20794
- createIcon(ArrowDown);
20680
+ };
20795
20681
 
20796
- const ArrowCircleLeft = ({ color, strokeWidth, set }) => {
20797
- const Broken = () => (React__namespace.createElement("g", null,
20798
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20799
- React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20800
- React__namespace.createElement("path", { d: "M9 10L11 8", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20801
- React__namespace.createElement("path", { d: "M7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20802
- const Curved = () => (React__namespace.createElement("g", null,
20803
- React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20804
- React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20805
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20806
- const Duotone = () => (React__namespace.createElement("g", null,
20807
- React__namespace.createElement("path", { opacity: "0.15", d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", fill: color }),
20808
- React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20809
- React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20810
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20811
- const Outline = () => (React__namespace.createElement("g", null,
20812
- React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20813
- React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20814
- React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20682
+ // const handleSelectAllClick = (event: { target: { checked: any } }) => {
20683
+ // if (event.target.checked) {
20684
+ // const newSelecteds = data.map((n: any) => n._id);
20685
+ // setSelected(newSelecteds as never[]);
20686
+ // return;
20687
+ // }
20688
+ // setSelected([]);
20689
+ // };
20690
+
20691
+ // Push Selected Rows
20692
+ // const SELECTED = useMemo(() => {
20693
+ // if (selected.length > 0 && onSelected) {
20694
+ // return onSelected(selected);
20695
+ // }
20696
+ // return <></>;
20697
+ // }, [selected]);
20698
+
20699
+ function renderRow(cols, row, index) {
20700
+ var _row$style;
20701
+ var urid = _.uniqueId();
20702
+ var className = rowClassName(row, index);
20703
+ var rw = _objectSpread2({}, row);
20704
+ var rowStyle = (_row$style = row === null || row === void 0 ? void 0 : row.style) !== null && _row$style !== void 0 ? _row$style : {};
20705
+ var onDragStart = row === null || row === void 0 ? void 0 : row.onDragStart;
20706
+ delete rw.table;
20707
+ delete rw.style;
20708
+ delete rw.onDragStart;
20709
+ // console.log(row);
20710
+ // const frow = Object.fromEntries(
20711
+ // Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
20712
+ // ) as unknown as TableDataItem
20713
+ // console.log(frow);
20714
+ var isRowSelected = selected.indexOf(row) !== -1;
20715
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
20716
+ draggable: rowDraggable,
20717
+ role: "checkbox",
20718
+ onDragStart: onDragStart,
20719
+ "aria-checked": selected.indexOf(row) !== -1,
20720
+ tabIndex: -1,
20721
+ key: urid,
20722
+ style: _objectSpread2({
20723
+ cursor: 'pointer',
20724
+ backgroundColor: isRowSelected ? '#efefef' : ''
20725
+ }, rowStyle),
20726
+ onClick: function onClick(e) {
20727
+ if (!rowDraggable) {
20728
+ if (onRow) {
20729
+ onRow(row, index);
20730
+ } else {
20731
+ handleClick(e, row);
20732
+ }
20733
+ }
20734
+ },
20735
+ className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
20736
+ }, /*#__PURE__*/React.createElement(TableCell, {
20737
+ columns: cols,
20738
+ row: rw,
20739
+ rowIndex: index,
20740
+ emptyText: emptyText,
20741
+ onCellClick: onCell
20742
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
20743
+ id: "787902152",
20744
+ dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
20745
+ }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
20746
+ }
20747
+ if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
20748
+ return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
20749
+ colSpan: columns === null || columns === void 0 ? void 0 : columns.length
20750
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Placeholder, {
20751
+ empty: true,
20752
+ textOnly: textPlaceholder,
20753
+ msg: "No Entries Found"
20754
+ })))));
20755
+ }
20756
+ return /*#__PURE__*/React.createElement("tbody", {
20757
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20758
+ }, data.map(function (row, index) {
20759
+ // const qid = _.uniqueId();
20760
+ if (row === null || row === undefined) {
20761
+ var uid = _.uniqueId();
20762
+ return /*#__PURE__*/React.createElement("tr", {
20763
+ key: uid,
20764
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20765
+ }, /*#__PURE__*/React.createElement("td", {
20766
+ colSpan: columns.length,
20767
+ className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
20768
+ }, "\u2003"));
20769
+ }
20770
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index));
20771
+
20772
+ // return (
20773
+ // <tr
20774
+ // key={`tbody-row-${index}`}
20775
+ // className={useClasses({ hover }, className)}
20776
+ // onClick={() => rowClickHandler(row, index)}>
20777
+ // <TableCell<TableDataItem>
20778
+ // columns={columns}
20779
+ // row={row}
20780
+ // rowIndex={index}
20781
+ // emptyText={emptyText}
20782
+ // onCellClick={onCell}
20783
+ // />
20784
+ // </tr>
20785
+ // )
20786
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
20787
+ id: "1422656197",
20788
+ dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
20789
+ }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
20790
+ };
20791
+ TableBody.displayName = 'TableBody';
20792
+
20793
+ var getRealShape = function getRealShape(el) {
20794
+ var defaultShape = {
20795
+ width: 0,
20796
+ height: 0
20797
+ };
20798
+ if (!el || typeof window === 'undefined') return defaultShape;
20799
+ var rect = el.getBoundingClientRect();
20800
+ var _window$getComputedSt = window.getComputedStyle(el),
20801
+ width = _window$getComputedSt.width,
20802
+ height = _window$getComputedSt.height;
20803
+ var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
20804
+ if (!str) return 0;
20805
+ var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
20806
+ return Number.isNaN(+strVal) ? 0 : +strVal;
20807
+ };
20808
+ return {
20809
+ width: getCSSStyleVal("".concat(width), rect.width),
20810
+ height: getCSSStyleVal("".concat(height), rect.height)
20811
+ };
20812
+ };
20813
+ var useRealShape = function useRealShape(ref) {
20814
+ var _useState = React.useState({
20815
+ width: 0,
20816
+ height: 0
20817
+ }),
20818
+ _useState2 = _slicedToArray(_useState, 2),
20819
+ state = _useState2[0],
20820
+ setState = _useState2[1];
20821
+ var update = function update() {
20822
+ var _getRealShape = getRealShape(ref.current),
20823
+ width = _getRealShape.width,
20824
+ height = _getRealShape.height;
20825
+ setState({
20826
+ width: width,
20827
+ height: height
20828
+ });
20829
+ };
20830
+ React.useEffect(function () {
20831
+ return update();
20832
+ }, [ref.current]);
20833
+ return [state, update];
20834
+ };
20835
+
20836
+ /* "use client" */
20837
+
20838
+ var TableColumn = function TableColumn(columnProps) {
20839
+ var _ref = columnProps,
20840
+ children = _ref.children,
20841
+ prop = _ref.prop,
20842
+ label = _ref.label,
20843
+ width = _ref.width,
20844
+ filter = _ref.filter,
20845
+ options = _ref.options,
20846
+ noWrap = _ref.noWrap,
20847
+ align = _ref.align,
20848
+ style = _ref.style,
20849
+ color = _ref.color,
20850
+ _ref$fontSize = _ref.fontSize,
20851
+ fontSize = _ref$fontSize === void 0 ? 'smaller' : _ref$fontSize,
20852
+ _ref$className = _ref.className,
20853
+ className = _ref$className === void 0 ? '' : _ref$className,
20854
+ renderHandler = _ref.render;
20855
+ var _useTableContext = useTableContext(),
20856
+ updateColumn = _useTableContext.updateColumn;
20857
+ var safeProp = "".concat(prop.toString()).trim();
20858
+ if (!safeProp) {
20859
+ useWarning('The props "prop" is required.', 'Table.Column');
20860
+ }
20861
+ React.useEffect(function () {
20862
+ updateColumn({
20863
+ label: children || label,
20864
+ filter: filter,
20865
+ noWrap: noWrap,
20866
+ options: options,
20867
+ prop: safeProp,
20868
+ width: width,
20869
+ color: color,
20870
+ align: align,
20871
+ fontSize: fontSize,
20872
+ className: className,
20873
+ style: style,
20874
+ renderHandler: function renderHandler() {}
20875
+ });
20876
+ }, [children, noWrap, color, style, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
20877
+ return null;
20878
+ };
20879
+ TableColumn.displayName = 'TableColumn';
20880
+
20881
+ // import { IconContext } from "./context.js";
20882
+ const createIcon = (Component) => {
20883
+ const IconWrapper = React.forwardRef(({ color = "#001A72", strokeWidth = "1.5", size = "24", set = "outline", style, ...props }, ref) => {
20884
+ // const context = useContext(IconContext);
20885
+ return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, fill: "none", viewBox: "0 0 24 24", style: style, ...props, ref: ref },
20886
+ React.createElement("title", null, "Icon"),
20887
+ React.createElement(Component, { color: color, strokeWidth: strokeWidth, set: set })));
20888
+ });
20889
+ const MemoIcon = React.memo(IconWrapper);
20890
+ return MemoIcon;
20891
+ };
20892
+
20893
+ const Air = ({ color, strokeWidth, set }) => {
20894
+ const Broken = () => (React.createElement("g", null,
20895
+ React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20896
+ React.createElement("path", { id: "shape_2", d: "M5 9H10M16.5 4C17.8807 4 19 5.11929 19 6.5C19 7.88071 17.8807 9 16.5 9H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20897
+ React.createElement("path", { id: "shape_3", d: "M4 15H7M17 19C18.1046 19 19 18.1046 19 17C19 15.8954 18.1046 15 17 15H11", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20898
+ const Curved = () => (React.createElement("g", null,
20899
+ React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20900
+ React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20901
+ React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20902
+ const Duotone = () => (React.createElement("g", null,
20903
+ React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20904
+ React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20905
+ React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20906
+ const Outline = () => (React.createElement("g", null,
20907
+ React.createElement("path", { id: "shape", d: "M8 12H14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20908
+ React.createElement("path", { id: "shape_2", d: "M5 9H16.5C17.8807 9 19 7.88071 19 6.5C19 5.11929 17.8807 4 16.5 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20909
+ React.createElement("path", { id: "shape_3", d: "M4 15H17C18.1046 15 19 15.8954 19 17C19 18.1046 18.1046 19 17 19", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20815
20910
  switch (set) {
20816
20911
  case "broken":
20817
- return React__namespace.createElement(Broken, null);
20912
+ return React.createElement(Broken, null);
20818
20913
  case "curved":
20819
- return React__namespace.createElement(Curved, null);
20914
+ return React.createElement(Curved, null);
20820
20915
  case "duotone":
20821
- return React__namespace.createElement(Duotone, null);
20916
+ return React.createElement(Duotone, null);
20822
20917
  case "outline":
20823
- return React__namespace.createElement(Outline, null);
20918
+ return React.createElement(Outline, null);
20824
20919
  default:
20825
- return React__namespace.createElement(Outline, null);
20920
+ return React.createElement(Outline, null);
20826
20921
  }
20827
20922
  };
20828
- ArrowCircleLeft.displayName = "ArrowCircleLeft";
20829
- createIcon(ArrowCircleLeft);
20923
+ Air.displayName = "Air";
20924
+ createIcon(Air);
20925
+
20926
+ const Alarm = ({ color, strokeWidth, set }) => {
20927
+ const Broken = () => (React__namespace.createElement("g", null,
20928
+ React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20929
+ React__namespace.createElement("path", { d: "M20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21C14.3894 21 16.5341 19.9525 18 18.2916", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20930
+ React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20931
+ React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20932
+ const Curved = () => (React__namespace.createElement("g", null,
20933
+ React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20934
+ React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20935
+ React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20936
+ React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20937
+ const Duotone = () => (React__namespace.createElement("g", null,
20938
+ React__namespace.createElement("path", { opacity: "0.15", d: "M20 13C20 17.4183 16.4183 21 12 21C7.58172 21 4 17.4183 4 13C4 8.58172 7.58172 5 12 5C16.4183 5 20 8.58172 20 13Z", fill: color }),
20939
+ React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20940
+ React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20941
+ React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20942
+ React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20943
+ const Outline = () => (React__namespace.createElement("g", null,
20944
+ React__namespace.createElement("path", { d: "M12 9V13L14 15", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20945
+ React__namespace.createElement("path", { d: "M12 21C16.4183 21 20 17.4183 20 13C20 8.58172 16.4183 5 12 5C7.58172 5 4 8.58172 4 13C4 17.4183 7.58172 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20946
+ React__namespace.createElement("path", { d: "M18 3L21 6", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20947
+ React__namespace.createElement("path", { d: "M3 6L6 3", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20948
+ switch (set) {
20949
+ case "broken":
20950
+ return React__namespace.createElement(Broken, null);
20951
+ case "curved":
20952
+ return React__namespace.createElement(Curved, null);
20953
+ case "duotone":
20954
+ return React__namespace.createElement(Duotone, null);
20955
+ case "outline":
20956
+ return React__namespace.createElement(Outline, null);
20957
+ default:
20958
+ return React__namespace.createElement(Outline, null);
20959
+ }
20960
+ };
20961
+ Alarm.displayName = "Alarm";
20962
+ createIcon(Alarm);
20963
+
20964
+ const ArrowCircleDown = ({ color, strokeWidth, set }) => {
20965
+ const Broken = () => (React__namespace.createElement("g", null,
20966
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20967
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20968
+ React__namespace.createElement("path", { d: "M10 15L8 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20969
+ React__namespace.createElement("path", { d: "M12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20970
+ const Curved = () => (React__namespace.createElement("g", null,
20971
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20972
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20973
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20974
+ const Duotone = () => (React__namespace.createElement("g", null,
20975
+ React__namespace.createElement("path", { opacity: "0.15", d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", fill: color }),
20976
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20977
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20978
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20979
+ const Outline = () => (React__namespace.createElement("g", null,
20980
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20981
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
20982
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
20983
+ switch (set) {
20984
+ case "broken":
20985
+ return React__namespace.createElement(Broken, null);
20986
+ case "curved":
20987
+ return React__namespace.createElement(Curved, null);
20988
+ case "duotone":
20989
+ return React__namespace.createElement(Duotone, null);
20990
+ case "outline":
20991
+ return React__namespace.createElement(Outline, null);
20992
+ default:
20993
+ return React__namespace.createElement(Outline, null);
20994
+ }
20995
+ };
20996
+ ArrowCircleDown.displayName = "ArrowCircleDown";
20997
+ createIcon(ArrowCircleDown);
20998
+
20999
+ const ArrowSmallDown = ({ color, strokeWidth, set }) => {
21000
+ const Broken = () => (React__namespace.createElement("g", null,
21001
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21002
+ React__namespace.createElement("path", { d: "M10 15L8 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21003
+ React__namespace.createElement("path", { d: "M12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21004
+ const Curved = () => (React__namespace.createElement("g", null,
21005
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21006
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21007
+ const Duotone = () => (React__namespace.createElement("g", null,
21008
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21009
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21010
+ const Outline = () => (React__namespace.createElement("g", null,
21011
+ React__namespace.createElement("path", { d: "M12 17L12 7", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21012
+ React__namespace.createElement("path", { d: "M8 13L12 17L16 13", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21013
+ switch (set) {
21014
+ case "broken":
21015
+ return React__namespace.createElement(Broken, null);
21016
+ case "curved":
21017
+ return React__namespace.createElement(Curved, null);
21018
+ case "duotone":
21019
+ return React__namespace.createElement(Duotone, null);
21020
+ case "outline":
21021
+ return React__namespace.createElement(Outline, null);
21022
+ default:
21023
+ return React__namespace.createElement(Outline, null);
21024
+ }
21025
+ };
21026
+ ArrowSmallDown.displayName = "ArrowSmallDown";
21027
+ createIcon(ArrowSmallDown);
21028
+
21029
+ const ArrowDown = ({ color, strokeWidth, set }) => {
21030
+ const Broken = () => (React__namespace.createElement("g", null,
21031
+ React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21032
+ React__namespace.createElement("path", { d: "M9 17L6 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21033
+ React__namespace.createElement("path", { d: "M12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21034
+ const Curved = () => (React__namespace.createElement("g", null,
21035
+ React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21036
+ React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21037
+ const Duotone = () => (React__namespace.createElement("g", null,
21038
+ React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21039
+ React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21040
+ const Outline = () => (React__namespace.createElement("g", null,
21041
+ React__namespace.createElement("path", { d: "M12 20L12 4", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21042
+ React__namespace.createElement("path", { d: "M6 14L12 20L18 14", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21043
+ switch (set) {
21044
+ case "broken":
21045
+ return React__namespace.createElement(Broken, null);
21046
+ case "curved":
21047
+ return React__namespace.createElement(Curved, null);
21048
+ case "duotone":
21049
+ return React__namespace.createElement(Duotone, null);
21050
+ case "outline":
21051
+ return React__namespace.createElement(Outline, null);
21052
+ default:
21053
+ return React__namespace.createElement(Outline, null);
21054
+ }
21055
+ };
21056
+ ArrowDown.displayName = "ArrowDown";
21057
+ createIcon(ArrowDown);
21058
+
21059
+ const ArrowCircleLeft = ({ color, strokeWidth, set }) => {
21060
+ const Broken = () => (React__namespace.createElement("g", null,
21061
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21062
+ React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21063
+ React__namespace.createElement("path", { d: "M9 10L11 8", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21064
+ React__namespace.createElement("path", { d: "M7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21065
+ const Curved = () => (React__namespace.createElement("g", null,
21066
+ React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21067
+ React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21068
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21069
+ const Duotone = () => (React__namespace.createElement("g", null,
21070
+ React__namespace.createElement("path", { opacity: "0.15", d: "M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z", fill: color }),
21071
+ React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21072
+ React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21073
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21074
+ const Outline = () => (React__namespace.createElement("g", null,
21075
+ React__namespace.createElement("path", { d: "M7 12L17 12", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21076
+ React__namespace.createElement("path", { d: "M11 8L7 12L11 16", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
21077
+ React__namespace.createElement("path", { d: "M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z", stroke: color, strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
21078
+ switch (set) {
21079
+ case "broken":
21080
+ return React__namespace.createElement(Broken, null);
21081
+ case "curved":
21082
+ return React__namespace.createElement(Curved, null);
21083
+ case "duotone":
21084
+ return React__namespace.createElement(Duotone, null);
21085
+ case "outline":
21086
+ return React__namespace.createElement(Outline, null);
21087
+ default:
21088
+ return React__namespace.createElement(Outline, null);
21089
+ }
21090
+ };
21091
+ ArrowCircleLeft.displayName = "ArrowCircleLeft";
21092
+ createIcon(ArrowCircleLeft);
20830
21093
 
20831
21094
  const ArrowSmallLeft = ({ color, strokeWidth, set }) => {
20832
21095
  const Broken = () => (React__namespace.createElement("g", null,
@@ -20887,7 +21150,7 @@ const ArrowLeft = ({ color, strokeWidth, set }) => {
20887
21150
  }
20888
21151
  };
20889
21152
  ArrowLeft.displayName = "ArrowLeft";
20890
- var ArrowLeft$1 = createIcon(ArrowLeft);
21153
+ createIcon(ArrowLeft);
20891
21154
 
20892
21155
  const ArrowCircleRight = ({ color, strokeWidth, set }) => {
20893
21156
  const Broken = () => (React__namespace.createElement("g", null,
@@ -23301,7 +23564,7 @@ const Delete = ({ color, strokeWidth, set }) => {
23301
23564
  }
23302
23565
  };
23303
23566
  Delete.displayName = "Delete";
23304
- var Delete$1 = createIcon(Delete);
23567
+ createIcon(Delete);
23305
23568
 
23306
23569
  const Dislike = ({ color, strokeWidth, set }) => {
23307
23570
  const Broken = () => (React__namespace.createElement("g", null,
@@ -23663,7 +23926,7 @@ const Edit1 = ({ color, strokeWidth, set }) => {
23663
23926
  }
23664
23927
  };
23665
23928
  Edit1.displayName = "Edit1";
23666
- var Edit = createIcon(Edit1);
23929
+ createIcon(Edit1);
23667
23930
 
23668
23931
  const Edit2 = ({ color, strokeWidth, set }) => {
23669
23932
  const Broken = () => (React__namespace.createElement("g", null,
@@ -24126,7 +24389,7 @@ const Filters1 = ({ color, strokeWidth, set }) => {
24126
24389
  }
24127
24390
  };
24128
24391
  Filters1.displayName = "Filters1";
24129
- var Filters = createIcon(Filters1);
24392
+ createIcon(Filters1);
24130
24393
 
24131
24394
  const Filters2 = ({ color, strokeWidth, set }) => {
24132
24395
  const Broken = () => (React__namespace.createElement("g", null,
@@ -27430,7 +27693,7 @@ const Refresh = ({ color, strokeWidth, set }) => {
27430
27693
  }
27431
27694
  };
27432
27695
  Refresh.displayName = "Refresh";
27433
- var Refresh$1 = createIcon(Refresh);
27696
+ createIcon(Refresh);
27434
27697
 
27435
27698
  const ResizeCircleHorizontal = ({ color, strokeWidth, set }) => {
27436
27699
  const Broken = () => (React__namespace.createElement("g", null,
@@ -30388,7 +30651,7 @@ const Columns = ({ color, strokeWidth, set }) => {
30388
30651
  }
30389
30652
  };
30390
30653
  Columns.displayName = "Columns";
30391
- var Columns$1 = createIcon(Columns);
30654
+ createIcon(Columns);
30392
30655
 
30393
30656
  const Folder = ({ color, strokeWidth, set }) => {
30394
30657
  const Outline = () => (React.createElement("g", null,
@@ -30491,211 +30754,29 @@ const HelpCircle = ({ color, strokeWidth, set }) => {
30491
30754
  HelpCircle.displayName = "HelpCircle";
30492
30755
  createIcon(HelpCircle);
30493
30756
 
30494
- var ButtonDrip = function ButtonDrip(_ref) {
30495
- var _ref$x = _ref.x,
30496
- x = _ref$x === void 0 ? 0 : _ref$x,
30497
- _ref$y = _ref.y,
30498
- y = _ref$y === void 0 ? 0 : _ref$y,
30499
- color = _ref.color,
30500
- onCompleted = _ref.onCompleted;
30501
- var dripRef = React.useRef(null);
30502
- /* istanbul ignore next */
30503
- var top = Number.isNaN(+y) ? 0 : y - 10;
30504
- /* istanbul ignore next */
30505
- var left = Number.isNaN(+x) ? 0 : x - 10;
30506
- React.useEffect(function () {
30507
- /* istanbul ignore next */
30508
- if (!dripRef.current) return;
30509
- dripRef.current.addEventListener('animationend', onCompleted);
30510
- return function () {
30511
- /* istanbul ignore next */
30512
- if (!dripRef.current) return;
30513
- dripRef.current.removeEventListener('animationend', onCompleted);
30514
- };
30757
+ var hexToRgb = function hexToRgb(color) {
30758
+ var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
30759
+ var full = color.replace(fullReg, function (_, r, g, b) {
30760
+ return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
30515
30761
  });
30516
- return /*#__PURE__*/React.createElement("div", {
30517
- ref: dripRef,
30518
- className: "jsx-3424889537" + " " + "drip"
30519
- }, /*#__PURE__*/React.createElement("svg", {
30520
- width: "20",
30521
- height: "20",
30522
- viewBox: "0 0 20 20",
30523
- style: {
30524
- top: top,
30525
- left: left
30526
- },
30527
- className: "jsx-3424889537"
30528
- }, /*#__PURE__*/React.createElement("g", {
30529
- stroke: "none",
30530
- strokeWidth: "1",
30531
- fill: "none",
30532
- fillRule: "evenodd",
30533
- className: "jsx-3424889537"
30534
- }, /*#__PURE__*/React.createElement("g", {
30535
- fill: color,
30536
- className: "jsx-3424889537"
30537
- }, /*#__PURE__*/React.createElement("rect", {
30538
- width: "100%",
30539
- height: "100%",
30540
- rx: "10",
30541
- className: "jsx-3424889537"
30542
- })))), /*#__PURE__*/React.createElement(_JSXStyle, {
30543
- id: "3424889537"
30544
- }, ".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;}}"));
30762
+ var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
30763
+ if (!values) {
30764
+ throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
30765
+ }
30766
+ return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
30545
30767
  };
30546
- ButtonDrip.displayName = 'ButtonDrip';
30547
-
30548
- var _excluded$a = ["children", "type", "color", "className", "spaceRatio"];
30549
- var getIconBgColor = function getIconBgColor(type, palette, color) {
30550
- var colors = {
30551
- "default": palette.accents_6,
30552
- secondary: palette.secondary,
30553
- success: palette.success,
30554
- warning: palette.warning,
30555
- error: palette.error
30556
- };
30557
- return color ? color : colors[type];
30558
- };
30559
- var LoadingComponent = function LoadingComponent(_ref) {
30560
- var children = _ref.children,
30561
- _ref$type = _ref.type,
30562
- type = _ref$type === void 0 ? 'default' : _ref$type,
30563
- color = _ref.color,
30564
- _ref$className = _ref.className,
30565
- className = _ref$className === void 0 ? '' : _ref$className,
30566
- _ref$spaceRatio = _ref.spaceRatio,
30567
- spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
30568
- props = _objectWithoutProperties(_ref, _excluded$a);
30569
- var theme = useTheme();
30570
- var _useScale = useScale(),
30571
- SCALES = _useScale.SCALES;
30572
- var classes = useClasses('loading-container', className);
30573
- var bgColor = React.useMemo(function () {
30574
- return getIconBgColor(type, theme.palette, color);
30575
- }, [type, theme.palette, color]);
30576
- return /*#__PURE__*/React.createElement("div", _extends({}, props, {
30577
- 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.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
30578
- }), /*#__PURE__*/React.createElement("span", {
30579
- 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.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
30580
- }, children && /*#__PURE__*/React.createElement("label", {
30581
- 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.palette.accents_5, bgColor, spaceRatio]]])
30582
- }, children), /*#__PURE__*/React.createElement("i", {
30583
- 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.palette.accents_5, bgColor, spaceRatio]]])
30584
- }), /*#__PURE__*/React.createElement("i", {
30585
- 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.palette.accents_5, bgColor, spaceRatio]]])
30586
- }), /*#__PURE__*/React.createElement("i", {
30587
- 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.palette.accents_5, bgColor, spaceRatio]]])
30588
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
30589
- id: "2201634259",
30590
- 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.palette.accents_5, bgColor, spaceRatio]
30591
- }, ".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.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;}}")));
30592
- };
30593
- LoadingComponent.displayName = 'Loading';
30594
- var Loading = withScale(LoadingComponent);
30595
-
30596
- var ButtonLoading = function ButtonLoading(_ref) {
30597
- var color = _ref.color;
30598
- return /*#__PURE__*/React.createElement("div", {
30599
- className: "jsx-212623367" + " " + "btn-loading"
30600
- }, /*#__PURE__*/React.createElement(Loading, {
30601
- color: color
30602
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
30603
- id: "212623367"
30604
- }, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
30605
- };
30606
- ButtonLoading.displayName = 'ButtonLoading';
30607
-
30608
- var _excluded$9 = ["isRight", "isSingle", "children", "className"];
30609
- var ButtonIcon = function ButtonIcon(_ref) {
30610
- var _ref$isRight = _ref.isRight,
30611
- isRight = _ref$isRight === void 0 ? false : _ref$isRight,
30612
- isSingle = _ref.isSingle,
30613
- children = _ref.children,
30614
- _ref$className = _ref.className,
30615
- className = _ref$className === void 0 ? '' : _ref$className,
30616
- props = _objectWithoutProperties(_ref, _excluded$9);
30617
- var classes = useClasses('icon', {
30618
- right: isRight,
30619
- single: isSingle
30620
- }, className);
30621
- return /*#__PURE__*/React.createElement("span", _extends({}, props, {
30622
- className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
30623
- }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
30624
- id: "2467502931"
30625
- }, ".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;}"));
30626
- };
30627
- ButtonIcon.displayName = 'ButtonIcon';
30628
-
30629
- var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
30630
- var icon = icons.icon,
30631
- iconRight = icons.iconRight;
30632
- var hasIcon = icon || iconRight;
30633
- var isRight = Boolean(iconRight);
30634
- var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
30635
- var classes = useClasses('text', isRight ? 'right' : 'left');
30636
- if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
30637
- className: "text"
30638
- }, children);
30639
- if (React.Children.count(children) === 0) {
30640
- return /*#__PURE__*/React.createElement(ButtonIcon, {
30641
- isRight: isRight,
30642
- isSingle: true
30643
- }, hasIcon);
30644
- }
30645
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
30646
- isRight: isRight
30647
- }, hasIcon), /*#__PURE__*/React.createElement("div", {
30648
- className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
30649
- }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
30650
- id: "3568181479",
30651
- dynamic: [paddingForAutoMode, paddingForAutoMode]
30652
- }, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
30653
- };
30654
- var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
30655
- if (!config.isButtonGroup) return props;
30656
- return _objectSpread2(_objectSpread2({}, props), {}, {
30657
- auto: true,
30658
- shadow: false,
30659
- ghost: config.ghost || props.ghost,
30660
- type: config.type || props.type,
30661
- disabled: config.disabled || props.disabled
30662
- });
30663
- };
30664
-
30665
- /* "use client" */
30666
-
30667
- var defaultContext$2 = {
30668
- isButtonGroup: false,
30669
- disabled: false
30670
- };
30671
- var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext$2);
30672
- var useButtonGroupContext = function useButtonGroupContext() {
30673
- return React.useContext(ButtonGroupContext);
30674
- };
30675
-
30676
- var hexToRgb = function hexToRgb(color) {
30677
- var fullReg = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
30678
- var full = color.replace(fullReg, function (_, r, g, b) {
30679
- return "".concat(r).concat(r).concat(g).concat(g).concat(b).concat(b);
30680
- });
30681
- var values = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(full);
30682
- if (!values) {
30683
- throw new Error("Helpdice UI: Unsupported ".concat(color, " color."));
30684
- }
30685
- return [Number.parseInt(values[1], 16), Number.parseInt(values[2], 16), Number.parseInt(values[3], 16)];
30686
- };
30687
- var colorToRgbValues = function colorToRgbValues(color) {
30688
- if (color.charAt(0) === '#') return hexToRgb(color);
30689
- var safeColor = color.replace(/ /g, '');
30690
- var colorType = color.substr(0, 4);
30691
- var regArray = safeColor.match(/\((.+)\)/);
30692
- if (!colorType.startsWith('rgb') || !regArray) {
30693
- console.log(color);
30694
- throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
30695
- }
30696
- return regArray[1].split(',').map(function (str) {
30697
- return Number.parseFloat(str);
30698
- });
30768
+ var colorToRgbValues = function colorToRgbValues(color) {
30769
+ if (color.charAt(0) === '#') return hexToRgb(color);
30770
+ var safeColor = color.replace(/ /g, '');
30771
+ var colorType = color.substr(0, 4);
30772
+ var regArray = safeColor.match(/\((.+)\)/);
30773
+ if (!colorType.startsWith('rgb') || !regArray) {
30774
+ console.log(color);
30775
+ throw new Error("Helpdice UI: Only support [\"RGB\", \"RGBA\", \"HEX\"] color.");
30776
+ }
30777
+ return regArray[1].split(',').map(function (str) {
30778
+ return Number.parseFloat(str);
30779
+ });
30699
30780
  };
30700
30781
  var addColorAlpha = function addColorAlpha(color, alpha) {
30701
30782
  if (!/^#|rgb|RGB/.test(color)) return color;
@@ -30708,1867 +30789,1208 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
30708
30789
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
30709
30790
  };
30710
30791
 
30711
- var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
30712
- var colors = {
30713
- secondary: {
30714
- bg: palette.background,
30715
- border: palette.foreground,
30716
- color: palette.foreground
30717
- },
30718
- success: {
30719
- bg: palette.background,
30720
- border: palette.success,
30721
- color: palette.success
30722
- },
30723
- warning: {
30724
- bg: palette.background,
30725
- border: palette.warning,
30726
- color: palette.warning
30727
- },
30728
- error: {
30729
- bg: palette.background,
30730
- border: palette.error,
30731
- color: palette.error
30732
- }
30792
+ var _excluded$8 = ["active", "children", "disabled", "onClick"];
30793
+ var PaginationItem = function PaginationItem(_ref) {
30794
+ var active = _ref.active,
30795
+ children = _ref.children,
30796
+ disabled = _ref.disabled,
30797
+ onClick = _ref.onClick,
30798
+ props = _objectWithoutProperties(_ref, _excluded$8);
30799
+ var theme = useTheme();
30800
+ var _useMemo = React.useMemo(function () {
30801
+ return [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)];
30802
+ }, [theme.palette.success]),
30803
+ _useMemo2 = _slicedToArray(_useMemo, 2),
30804
+ hover = _useMemo2[0],
30805
+ activeHover = _useMemo2[1];
30806
+ var classes = useClasses({
30807
+ active: active,
30808
+ disabled: disabled
30809
+ });
30810
+ var clickHandler = function clickHandler(event) {
30811
+ if (disabled) return;
30812
+ onClick && onClick(event);
30733
30813
  };
30734
- return colors[_color] || null;
30814
+ return /*#__PURE__*/React.createElement("li", {
30815
+ className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]])
30816
+ }, /*#__PURE__*/React.createElement("button", _extends({
30817
+ onClick: clickHandler
30818
+ }, props, {
30819
+ className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || "")
30820
+ }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
30821
+ id: "1657796974",
30822
+ dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
30823
+ }, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border: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;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
30735
30824
  };
30736
- var getButtonColors = function getButtonColors(palette, props) {
30737
- var color = props.color,
30738
- disabled = props.disabled,
30739
- ghost = props.ghost;
30740
- var colors = {
30741
- "default": {
30742
- bg: palette.background,
30743
- border: palette.border,
30744
- color: palette.accents_5
30825
+ PaginationItem.displayName = 'PaginationItem';
30826
+
30827
+ /* "use client" */
30828
+
30829
+ tuple('prev', 'next', 'click');
30830
+ var defaultContext$1 = {};
30831
+ var PaginationContext = /*#__PURE__*/React.createContext(defaultContext$1);
30832
+ var usePaginationContext = function usePaginationContext() {
30833
+ return React.useContext(PaginationContext);
30834
+ };
30835
+
30836
+ var _excluded$7 = ["children"];
30837
+ var PaginationPrevious = function PaginationPrevious(_ref) {
30838
+ var children = _ref.children,
30839
+ props = _objectWithoutProperties(_ref, _excluded$7);
30840
+ var _usePaginationContext = usePaginationContext(),
30841
+ update = _usePaginationContext.update,
30842
+ isFirst = _usePaginationContext.isFirst;
30843
+ return /*#__PURE__*/React.createElement(PaginationItem, _extends({
30844
+ onClick: function onClick() {
30845
+ return update && update('prev');
30745
30846
  },
30746
- secondary: {
30747
- bg: palette.foreground,
30748
- border: palette.foreground,
30749
- color: palette.background
30847
+ disabled: isFirst
30848
+ }, props), children);
30849
+ };
30850
+ PaginationPrevious.displayName = 'PaginationPrevious';
30851
+
30852
+ var _excluded$6 = ["children"];
30853
+ var PaginationNext = function PaginationNext(_ref) {
30854
+ var children = _ref.children,
30855
+ props = _objectWithoutProperties(_ref, _excluded$6);
30856
+ var _usePaginationContext = usePaginationContext(),
30857
+ update = _usePaginationContext.update,
30858
+ isLast = _usePaginationContext.isLast;
30859
+ return /*#__PURE__*/React.createElement(PaginationItem, _extends({
30860
+ onClick: function onClick() {
30861
+ return update && update('next');
30750
30862
  },
30751
- success: {
30752
- bg: palette.success,
30753
- border: palette.success,
30754
- color: '#fff'
30863
+ disabled: isLast
30864
+ }, props), children);
30865
+ };
30866
+ PaginationNext.displayName = 'PaginationNext';
30867
+
30868
+ var PaginationEllipsis = function PaginationEllipsis(_ref) {
30869
+ var isBefore = _ref.isBefore,
30870
+ _onClick = _ref.onClick;
30871
+ var _useState = React.useState(false),
30872
+ _useState2 = _slicedToArray(_useState, 2),
30873
+ showMore = _useState2[0],
30874
+ setShowMore = _useState2[1];
30875
+ return /*#__PURE__*/React.createElement(PaginationItem, {
30876
+ onClick: function onClick(e) {
30877
+ return _onClick && _onClick(e);
30755
30878
  },
30756
- warning: {
30757
- bg: palette.warning,
30758
- border: palette.warning,
30759
- color: '#fff'
30879
+ onMouseEnter: function onMouseEnter() {
30880
+ return setShowMore(true);
30760
30881
  },
30761
- error: {
30762
- bg: palette.error,
30763
- border: palette.error,
30764
- color: '#fff'
30765
- },
30766
- abort: {
30767
- bg: 'transparent',
30768
- border: 'transparent',
30769
- color: palette.accents_5
30770
- }
30771
- };
30772
- if (disabled) return {
30773
- bg: palette.accents_1,
30774
- border: palette.accents_2,
30775
- color: '#ccc'
30776
- };
30777
-
30778
- /**
30779
- * The '-light' type is the same color as the common type,
30780
- * only hover's color is different.
30781
- * e.g.
30782
- * Color['success'] === Color['success-light']
30783
- * Color['warning'] === Color['warning-light']
30784
- */
30785
- var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
30786
- var defaultColor = colors["default"];
30787
- if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
30788
- return colors[withoutLightType] || defaultColor;
30789
- };
30790
- var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
30791
- var colors = {
30792
- secondary: {
30793
- bg: palette.foreground,
30794
- border: palette.background,
30795
- color: palette.background
30796
- },
30797
- success: {
30798
- bg: palette.success,
30799
- border: palette.background,
30800
- color: 'white'
30801
- },
30802
- warning: {
30803
- bg: palette.warning,
30804
- border: palette.background,
30805
- color: 'white'
30806
- },
30807
- error: {
30808
- bg: palette.error,
30809
- border: palette.background,
30810
- color: 'white'
30811
- }
30812
- };
30813
- var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
30814
- return colors[withoutLightType] || null;
30815
- };
30816
- var getButtonHoverColors = function getButtonHoverColors(palette, props) {
30817
- var color = props.color,
30818
- disabled = props.disabled,
30819
- loading = props.loading,
30820
- shadow = props.shadow,
30821
- ghost = props.ghost;
30822
- var defaultColor = getButtonColors(palette, props);
30823
- var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
30824
- var colors = {
30825
- "default": {
30826
- bg: palette.background,
30827
- border: palette.foreground
30828
- },
30829
- secondary: {
30830
- bg: palette.background,
30831
- border: palette.foreground
30832
- },
30833
- success: {
30834
- bg: palette.background,
30835
- border: palette.success
30836
- },
30837
- warning: {
30838
- bg: palette.background,
30839
- border: palette.warning
30840
- },
30841
- error: {
30842
- bg: palette.background,
30843
- border: palette.error
30844
- },
30845
- abort: {
30846
- bg: 'transparent',
30847
- border: 'transparent',
30848
- color: palette.accents_5
30849
- },
30850
- 'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30851
- bg: alphaBackground
30852
- }),
30853
- 'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30854
- bg: alphaBackground
30855
- }),
30856
- 'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30857
- bg: alphaBackground
30858
- }),
30859
- 'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30860
- bg: alphaBackground
30861
- })
30862
- };
30863
- if (disabled) return {
30864
- bg: palette.accents_1,
30865
- border: palette.accents_2,
30866
- color: '#ccc'
30867
- };
30868
- if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
30869
- color: 'transparent'
30870
- });
30871
- if (shadow) return defaultColor;
30872
- var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
30873
- return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
30874
- color: hoverColor.color || hoverColor.border
30875
- });
30876
- };
30877
- var getButtonCursor = function getButtonCursor(disabled, loading) {
30878
- if (disabled) return {
30879
- cursor: 'not-allowed',
30880
- events: 'auto'
30881
- };
30882
- if (loading) return {
30883
- cursor: 'default',
30884
- events: 'none'
30885
- };
30886
- return {
30887
- cursor: 'pointer',
30888
- events: 'auto'
30889
- };
30890
- };
30891
- var getButtonDripColor = function getButtonDripColor(palette, props) {
30892
- var type = props.type;
30893
- var isLightHover = type ? type.endsWith('light') : false;
30894
- var hoverColors = getButtonHoverColors(palette, props);
30895
- return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
30896
- };
30897
-
30898
- var _excluded$8 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
30899
- var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
30900
- var theme = useTheme();
30901
- var _useScale = useScale(),
30902
- SCALES = _useScale.SCALES;
30903
- var buttonRef = React.useRef(null);
30904
- React.useImperativeHandle(ref, function () {
30905
- return buttonRef.current;
30906
- });
30907
- var _useState = React.useState(false),
30908
- _useState2 = _slicedToArray(_useState, 2),
30909
- dripShow = _useState2[0],
30910
- setDripShow = _useState2[1];
30911
- var _useState3 = React.useState(0),
30912
- _useState4 = _slicedToArray(_useState3, 2),
30913
- dripX = _useState4[0],
30914
- setDripX = _useState4[1];
30915
- var _useState5 = React.useState(0),
30916
- _useState6 = _slicedToArray(_useState5, 2),
30917
- dripY = _useState6[0],
30918
- setDripY = _useState6[1];
30919
- var groupConfig = useButtonGroupContext();
30920
- var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
30921
- /* eslint-disable @typescript-eslint/no-unused-vars */
30922
- var children = filteredProps.children,
30923
- _filteredProps$disabl = filteredProps.disabled,
30924
- disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
30925
- filteredProps.color;
30926
- var _filteredProps$loadin = filteredProps.loading,
30927
- loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
30928
- _filteredProps$shadow = filteredProps.shadow,
30929
- shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
30930
- _filteredProps$ghost = filteredProps.ghost,
30931
- ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
30932
- _filteredProps$effect = filteredProps.effect,
30933
- effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
30934
- _filteredProps$round = filteredProps.round,
30935
- round = _filteredProps$round === void 0 ? false : _filteredProps$round,
30936
- onClick = filteredProps.onClick,
30937
- _filteredProps$auto = filteredProps.auto,
30938
- auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
30939
- icon = filteredProps.icon,
30940
- _filteredProps$type = filteredProps.type,
30941
- type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
30942
- iconRight = filteredProps.iconRight,
30943
- _filteredProps$classN = filteredProps.className,
30944
- className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
30945
- filteredProps.crossOrigin;
30946
- var props = _objectWithoutProperties(filteredProps, _excluded$8);
30947
- /* eslint-enable @typescript-eslint/no-unused-vars */
30948
-
30949
- var _useMemo = React.useMemo(function () {
30950
- return getButtonColors(theme.palette, filteredProps);
30951
- }, [theme.palette, filteredProps]),
30952
- bg = _useMemo.bg,
30953
- border = _useMemo.border,
30954
- color = _useMemo.color;
30955
- var hover = React.useMemo(function () {
30956
- return getButtonHoverColors(theme.palette, filteredProps);
30957
- }, [theme.palette, filteredProps]);
30958
- var _useMemo2 = React.useMemo(function () {
30959
- return getButtonCursor(disabled, loading);
30960
- }, [disabled, loading]),
30961
- cursor = _useMemo2.cursor,
30962
- events = _useMemo2.events;
30963
- var dripColor = React.useMemo(function () {
30964
- return getButtonDripColor(theme.palette, filteredProps);
30965
- }, [theme.palette, filteredProps]);
30966
-
30967
- /* istanbul ignore next */
30968
- var dripCompletedHandle = function dripCompletedHandle() {
30969
- setDripShow(false);
30970
- setDripX(0);
30971
- setDripY(0);
30972
- };
30973
- var clickHandler = function clickHandler(event) {
30974
- if (disabled || loading) return;
30975
- var showDrip = !shadow && !ghost && effect;
30976
- /* istanbul ignore next */
30977
- if (showDrip && buttonRef.current) {
30978
- var rect = buttonRef.current.getBoundingClientRect();
30979
- setDripShow(true);
30980
- setDripX(event.clientX - rect.left);
30981
- setDripY(event.clientY - rect.top);
30982
- }
30983
- onClick && onClick(event);
30984
- };
30985
- var childrenWithIcon = React.useMemo(function () {
30986
- return getButtonChildrenWithIcon(auto, children, {
30987
- icon: icon,
30988
- iconRight: iconRight
30989
- });
30990
- }, [auto, children, icon, iconRight]);
30991
- var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
30992
- paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
30993
- return /*#__PURE__*/React.createElement("button", _extends({
30994
- ref: buttonRef,
30995
- type: type,
30996
- disabled: disabled,
30997
- onClick: clickHandler
30998
- }, props, {
30999
- className: _JSXStyle.dynamic([["1558010596", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
31000
- }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
31001
- color: color
31002
- }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
31003
- x: dripX,
31004
- y: dripY,
31005
- color: dripColor,
31006
- onCompleted: dripCompletedHandle
31007
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
31008
- id: "1558010596",
31009
- dynamic: [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
31010
- }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme.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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : '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(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.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;}")));
31011
- });
31012
- ButtonComponent.displayName = 'Button';
31013
- var Button = withScale(ButtonComponent);
31014
-
31015
- var getColors = function getColors(type, palette) {
31016
- var colors = {
31017
- "default": palette.background,
31018
- success: palette.success,
31019
- warning: palette.warning,
31020
- error: palette.error,
31021
- secondary: palette.secondary,
31022
- dark: palette.foreground,
31023
- lite: palette.background
31024
- };
31025
- var color = type === 'lite' || type === 'default' ? palette.foreground : palette.background;
31026
- return {
31027
- color: color,
31028
- bgColor: colors[type]
31029
- };
31030
- };
31031
-
31032
- var defaultTooltipPosition = {
31033
- top: '-1000px',
31034
- left: '-1000px',
31035
- transform: 'none'
31036
- };
31037
- var getPosition = function getPosition(placement, rect, offset) {
31038
- var positions = {
31039
- top: {
31040
- top: "".concat(rect.top - offset, "px"),
31041
- left: "".concat(rect.left + rect.width / 2, "px"),
31042
- transform: 'translate(-50%, -100%)'
31043
- },
31044
- topStart: {
31045
- top: "".concat(rect.top - offset, "px"),
31046
- left: "".concat(rect.left, "px"),
31047
- transform: 'translate(0, -100%)'
31048
- },
31049
- topEnd: {
31050
- top: "".concat(rect.top - offset, "px"),
31051
- left: "".concat(rect.left + rect.width, "px"),
31052
- transform: 'translate(-100%, -100%)'
31053
- },
31054
- bottom: {
31055
- top: "".concat(rect.bottom + offset, "px"),
31056
- left: "".concat(rect.left + rect.width / 2, "px"),
31057
- transform: 'translate(-50%, 0)'
31058
- },
31059
- bottomStart: {
31060
- top: "".concat(rect.bottom + offset, "px"),
31061
- left: "".concat(rect.left, "px"),
31062
- transform: 'translate(0, 0)'
31063
- },
31064
- bottomEnd: {
31065
- top: "".concat(rect.bottom + offset, "px"),
31066
- left: "".concat(rect.left + rect.width, "px"),
31067
- transform: 'translate(-100%, 0)'
31068
- },
31069
- left: {
31070
- top: "".concat(rect.top + rect.height / 2, "px"),
31071
- left: "".concat(rect.left - offset, "px"),
31072
- transform: 'translate(-100%, -50%)'
31073
- },
31074
- leftStart: {
31075
- top: "".concat(rect.top, "px"),
31076
- left: "".concat(rect.left - offset, "px"),
31077
- transform: 'translate(-100%, 0)'
31078
- },
31079
- leftEnd: {
31080
- top: "".concat(rect.top + rect.height, "px"),
31081
- left: "".concat(rect.left - offset, "px"),
31082
- transform: 'translate(-100%, -100%)'
31083
- },
31084
- right: {
31085
- top: "".concat(rect.top + rect.height / 2, "px"),
31086
- left: "".concat(rect.right + offset, "px"),
31087
- transform: 'translate(0, -50%)'
31088
- },
31089
- rightStart: {
31090
- top: "".concat(rect.top, "px"),
31091
- left: "".concat(rect.right + offset, "px"),
31092
- transform: 'translate(0, 0)'
31093
- },
31094
- rightEnd: {
31095
- top: "".concat(rect.top + rect.height, "px"),
31096
- left: "".concat(rect.right + offset, "px"),
31097
- transform: 'translate(0, -100%)'
31098
- }
31099
- };
31100
- return positions[placement] || positions.top;
31101
- };
31102
- var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
31103
- var offsetAbsolute = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '3px';
31104
- var positions = {
31105
- top: {
31106
- top: 'auto',
31107
- right: 'auto',
31108
- left: '50%',
31109
- bottom: "".concat(offsetAbsolute),
31110
- transform: 'translate(-50%, 100%) rotate(-90deg)'
31111
- },
31112
- topStart: {
31113
- top: 'auto',
31114
- right: 'auto',
31115
- left: "".concat(offsetX),
31116
- bottom: "".concat(offsetAbsolute),
31117
- transform: 'translate(0, 100%) rotate(-90deg)'
31118
- },
31119
- topEnd: {
31120
- top: 'auto',
31121
- right: "".concat(offsetX),
31122
- left: 'auto',
31123
- bottom: "".concat(offsetAbsolute),
31124
- transform: 'translate(0, 100%) rotate(-90deg)'
31125
- },
31126
- bottom: {
31127
- top: "".concat(offsetAbsolute),
31128
- right: 'auto',
31129
- left: '50%',
31130
- bottom: 'auto',
31131
- transform: 'translate(-50%, -100%) rotate(90deg)'
31132
- },
31133
- bottomStart: {
31134
- top: "".concat(offsetAbsolute),
31135
- right: 'auto',
31136
- left: "".concat(offsetX),
31137
- bottom: 'auto',
31138
- transform: 'translate(0, -100%) rotate(90deg)'
31139
- },
31140
- bottomEnd: {
31141
- top: "".concat(offsetAbsolute),
31142
- right: "".concat(offsetX),
31143
- left: 'auto',
31144
- bottom: 'auto',
31145
- transform: 'translate(0, -100%) rotate(90deg)'
31146
- },
31147
- left: {
31148
- top: '50%',
31149
- right: '0',
31150
- left: 'auto',
31151
- bottom: 'auto',
31152
- transform: 'translate(100%, -50%) rotate(180deg)'
31153
- },
31154
- leftStart: {
31155
- top: "".concat(offsetY),
31156
- right: '0',
31157
- left: 'auto',
31158
- bottom: 'auto',
31159
- transform: 'translate(100%, -50%) rotate(180deg)'
31160
- },
31161
- leftEnd: {
31162
- top: 'auto',
31163
- right: '0',
31164
- left: 'auto',
31165
- bottom: "".concat(offsetY),
31166
- transform: 'translate(100%, 50%) rotate(180deg)'
31167
- },
31168
- right: {
31169
- top: '50%',
31170
- right: 'auto',
31171
- left: '0',
31172
- bottom: 'auto',
31173
- transform: 'translate(-100%, -50%) rotate(0deg)'
31174
- },
31175
- rightStart: {
31176
- top: "".concat(offsetY),
31177
- right: 'auto',
31178
- left: '0',
31179
- bottom: 'auto',
31180
- transform: 'translate(-100%, -50%) rotate(0deg)'
31181
- },
31182
- rightEnd: {
31183
- top: 'auto',
31184
- right: 'auto',
31185
- left: '0',
31186
- bottom: "".concat(offsetY),
31187
- transform: 'translate(-100%, 50%) rotate(0deg)'
30882
+ onMouseLeave: function onMouseLeave() {
30883
+ return setShowMore(false);
31188
30884
  }
31189
- };
31190
- return positions[placement] || positions.top;
31191
- };
31192
-
31193
- var TooltipIcon = function TooltipIcon(_ref) {
31194
- var placement = _ref.placement,
31195
- shadow = _ref.shadow;
31196
- var theme = useTheme();
31197
- var _useMemo = React.useMemo(function () {
31198
- return getIconPosition(placement, 'var(--tooltip-icon-offset-x)', 'var(--tooltip-icon-offset-y)');
31199
- }, [placement]),
31200
- transform = _useMemo.transform,
31201
- top = _useMemo.top,
31202
- left = _useMemo.left,
31203
- right = _useMemo.right,
31204
- bottom = _useMemo.bottom;
31205
- var bgColorWithDark = React.useMemo(function () {
31206
- if (!shadow || theme.type !== 'dark') return 'var(--tooltip-content-bg)';
31207
- return theme.palette.accents_2;
31208
- }, [theme.type, shadow]);
31209
- return /*#__PURE__*/React.createElement("span", {
31210
- className: _JSXStyle.dynamic([["2440507693", [bgColorWithDark, left, top, right, bottom, transform]]])
31211
- }, /*#__PURE__*/React.createElement(_JSXStyle, {
31212
- id: "2440507693",
31213
- dynamic: [bgColorWithDark, left, top, right, bottom, transform]
31214
- }, "span.__jsx-style-dynamic-selector{width:0;height:0;border-style:solid;border-width:6px 7px 6px 0;border-color:transparent ".concat(bgColorWithDark, " transparent transparent;position:absolute;left:").concat(left, ";top:").concat(top, ";right:").concat(right, ";bottom:").concat(bottom, ";-webkit-transform:").concat(transform, ";-ms-transform:").concat(transform, ";transform:").concat(transform, ";}")));
31215
- };
31216
-
31217
- var defaultRect = {
31218
- top: -1e3,
31219
- left: -1e3,
31220
- right: -1e3,
31221
- bottom: -1e3,
31222
- width: 0,
31223
- height: 0
31224
- };
31225
- var getRect = function getRect(ref) {
31226
- if (!ref || !ref.current) return defaultRect;
31227
- var rect = ref.current.getBoundingClientRect();
31228
- return _objectSpread2(_objectSpread2({}, rect), {}, {
31229
- width: rect.width || rect.right - rect.left,
31230
- height: rect.height || rect.bottom - rect.top,
31231
- top: rect.top + document.documentElement.scrollTop,
31232
- bottom: rect.bottom + document.documentElement.scrollTop,
31233
- left: rect.left + document.documentElement.scrollLeft,
31234
- right: rect.right + document.documentElement.scrollLeft
31235
- });
31236
- };
31237
-
31238
- var TooltipContent = function TooltipContent(_ref) {
31239
- var children = _ref.children,
31240
- parent = _ref.parent,
31241
- visible = _ref.visible,
31242
- offset = _ref.offset,
31243
- iconOffset = _ref.iconOffset,
31244
- placement = _ref.placement,
31245
- type = _ref.type,
31246
- className = _ref.className,
31247
- hideArrow = _ref.hideArrow;
31248
- var theme = useTheme();
31249
- var _useScale = useScale(),
31250
- SCALES = _useScale.SCALES;
31251
- var el = usePortal('tooltip');
31252
- var selfRef = React.useRef(null);
31253
- var _useState = React.useState(defaultTooltipPosition),
31254
- _useState2 = _slicedToArray(_useState, 2),
31255
- rect = _useState2[0],
31256
- setRect = _useState2[1];
31257
- var colors = React.useMemo(function () {
31258
- return getColors(type, theme.palette);
31259
- }, [type, theme.palette]);
31260
- var hasShadow = type === 'default';
31261
- var classes = useClasses('tooltip-content', className);
31262
- if (!parent) return null;
31263
- var updateRect = function updateRect() {
31264
- var position = getPosition(placement, getRect(parent), offset);
31265
- setRect(position);
31266
- };
31267
- useResize(updateRect);
31268
- useClickAnyWhere(function () {
31269
- return updateRect();
31270
- });
31271
- React.useEffect(function () {
31272
- updateRect();
31273
- }, [visible]);
31274
- var preventHandler = function preventHandler(event) {
31275
- event.stopPropagation();
31276
- event.nativeEvent.stopImmediatePropagation();
31277
- };
31278
- if (!el) return null;
31279
- return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
31280
- visible: visible
31281
- }, /*#__PURE__*/React.createElement("div", {
31282
- ref: selfRef,
31283
- onClick: preventHandler,
31284
- className: _JSXStyle.dynamic([["2387841858", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + (classes || "")
31285
- }, /*#__PURE__*/React.createElement("div", {
31286
- className: _JSXStyle.dynamic([["2387841858", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + "inner"
31287
- }, !hideArrow && /*#__PURE__*/React.createElement(TooltipIcon, {
31288
- placement: placement,
31289
- shadow: hasShadow
31290
- }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
31291
- id: "2387841858",
31292
- dynamic: [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]
31293
- }, ".tooltip-content.__jsx-style-dynamic-selector{--tooltip-icon-offset-x:".concat(iconOffset.x, ";--tooltip-icon-offset-y:").concat(iconOffset.y, ";--tooltip-content-bg:").concat(colors.bgColor, ";box-sizing:border-box;position:absolute;top:").concat(rect.top, ";left:").concat(rect.left, ";-webkit-transform:").concat(rect.transform, ";-ms-transform:").concat(rect.transform, ";transform:").concat(rect.transform, ";background-color:var(--tooltip-content-bg);color:").concat(colors.color, ";border-radius:").concat(theme.layout.radius, ";padding:0;z-index:1000;box-shadow:").concat(hasShadow ? theme.expressiveness.shadowMedium : 'none', ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.inner.__jsx-style-dynamic-selector{box-sizing:border-box;position:relative;font-size:").concat(SCALES.font(1), ";padding:").concat(SCALES.pt(0.65), " ").concat(SCALES.pr(0.9), " ").concat(SCALES.pb(0.65), " ").concat(SCALES.pl(0.9), ";height:100%;}")))), el);
30885
+ }, showMore ? /*#__PURE__*/React.createElement("svg", {
30886
+ viewBox: "0 0 24 24",
30887
+ stroke: "currentColor",
30888
+ strokeWidth: "1.5",
30889
+ strokeLinecap: "round",
30890
+ strokeLinejoin: "round",
30891
+ fill: "none",
30892
+ shapeRendering: "geometricPrecision",
30893
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more"
30894
+ }, /*#__PURE__*/React.createElement("path", {
30895
+ d: "M13 17l5-5-5-5",
30896
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30897
+ }), /*#__PURE__*/React.createElement("path", {
30898
+ d: "M6 17l5-5-5-5",
30899
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30900
+ })) : /*#__PURE__*/React.createElement("svg", {
30901
+ viewBox: "0 0 24 24",
30902
+ strokeWidth: "1.5",
30903
+ strokeLinecap: "round",
30904
+ strokeLinejoin: "round",
30905
+ fill: "none",
30906
+ shapeRendering: "geometricPrecision",
30907
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30908
+ }, /*#__PURE__*/React.createElement("circle", {
30909
+ cx: "12",
30910
+ cy: "12",
30911
+ r: "1",
30912
+ fill: "currentColor",
30913
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30914
+ }), /*#__PURE__*/React.createElement("circle", {
30915
+ cx: "19",
30916
+ cy: "12",
30917
+ r: "1",
30918
+ fill: "currentColor",
30919
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30920
+ }), /*#__PURE__*/React.createElement("circle", {
30921
+ cx: "5",
30922
+ cy: "12",
30923
+ r: "1",
30924
+ fill: "currentColor",
30925
+ className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
30926
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
30927
+ id: "2928474255",
30928
+ dynamic: [isBefore ? '180deg' : '0deg']
30929
+ }, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
31294
30930
  };
30931
+ PaginationEllipsis.displayName = 'PaginationEllipsis';
31295
30932
 
31296
- /* "use client" */
31297
-
31298
- var useClickAway = function useClickAway(ref, handler) {
31299
- var handlerRef = React.useRef(handler);
31300
- React.useEffect(function () {
31301
- handlerRef.current = handler;
31302
- }, [handler]);
31303
- React.useEffect(function () {
31304
- var callback = function callback(event) {
31305
- var el = ref.current;
31306
- if (!event || !el || el.contains(event.target)) return;
31307
- handlerRef.current(event);
31308
- };
31309
- document.addEventListener('click', callback);
31310
- return function () {
31311
- return document.removeEventListener('click', callback);
31312
- };
31313
- }, [ref]);
30933
+ var PaginationPages = function PaginationPages(_ref) {
30934
+ var limit = _ref.limit,
30935
+ count = _ref.count,
30936
+ current = _ref.current,
30937
+ setPage = _ref.setPage;
30938
+ var showPages = React.useMemo(function () {
30939
+ var oddLimit = limit % 2 === 0 ? limit - 1 : limit;
30940
+ return oddLimit - 2;
30941
+ }, [limit]);
30942
+ var middleNumber = (showPages + 1) / 2;
30943
+ var _useMemo = React.useMemo(function () {
30944
+ var showEllipsis = count > limit;
30945
+ return [showEllipsis && current > middleNumber + 1, showEllipsis && current < count - middleNumber];
30946
+ }, [current, showPages, middleNumber, count, limit]),
30947
+ _useMemo2 = _slicedToArray(_useMemo, 2),
30948
+ showBeforeEllipsis = _useMemo2[0],
30949
+ showAfterEllipsis = _useMemo2[1];
30950
+ var pagesArray = React.useMemo(function () {
30951
+ return _toConsumableArray(new Array(showPages));
30952
+ }, [showPages]);
30953
+ var renderItem = React.useCallback(function (value, active) {
30954
+ return /*#__PURE__*/React.createElement(PaginationItem, {
30955
+ key: "pagination-item-".concat(value),
30956
+ active: value === active,
30957
+ onClick: function onClick() {
30958
+ return setPage(value);
30959
+ }
30960
+ }, value);
30961
+ }, []);
30962
+ var startPages = pagesArray.map(function (_, index) {
30963
+ var value = index + 2;
30964
+ return renderItem(value, current);
30965
+ });
30966
+ var middlePages = pagesArray.map(function (_, index) {
30967
+ var middleIndexNumber = middleNumber - (index + 1);
30968
+ var value = current - middleIndexNumber;
30969
+ return /*#__PURE__*/React.createElement(PaginationItem, {
30970
+ key: "pagination-middle-".concat(index),
30971
+ active: index + 1 === middleNumber,
30972
+ onClick: function onClick() {
30973
+ return setPage(value);
30974
+ }
30975
+ }, value);
30976
+ });
30977
+ var endPages = pagesArray.map(function (_, index) {
30978
+ var value = count - (showPages - index);
30979
+ return renderItem(value, current);
30980
+ });
30981
+ if (count <= limit) {
30982
+ /* eslint-disable react/jsx-no-useless-fragment */
30983
+ return /*#__PURE__*/React.createElement(React.Fragment, null, _toConsumableArray(new Array(count)).map(function (_, index) {
30984
+ var value = index + 1;
30985
+ return /*#__PURE__*/React.createElement(PaginationItem, {
30986
+ key: "pagination-item-".concat(value),
30987
+ active: value === current,
30988
+ onClick: function onClick() {
30989
+ return setPage(value);
30990
+ }
30991
+ }, value);
30992
+ }));
30993
+ /* eslint-enable */
30994
+ }
30995
+ return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
30996
+ key: "pagination-ellipsis-before",
30997
+ isBefore: true,
30998
+ onClick: function onClick() {
30999
+ return setPage(function (last) {
31000
+ return last - 5 >= 1 ? last - 5 : 1;
31001
+ });
31002
+ }
31003
+ }), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
31004
+ key: "pagination-ellipsis-after",
31005
+ onClick: function onClick() {
31006
+ return setPage(function (last) {
31007
+ return last + 5 <= count ? last + 5 : count;
31008
+ });
31009
+ }
31010
+ }), renderItem(count, current));
31314
31011
  };
31012
+ PaginationPages.displayName = 'PaginationPages';
31315
31013
 
31316
- var _excluded$7 = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
31317
- var TooltipComponent = function TooltipComponent(_ref) {
31318
- var children = _ref.children,
31319
- _ref$initialVisible = _ref.initialVisible,
31320
- initialVisible = _ref$initialVisible === void 0 ? false : _ref$initialVisible,
31321
- text = _ref.text,
31322
- _ref$offset = _ref.offset,
31323
- offset = _ref$offset === void 0 ? 12 : _ref$offset,
31324
- _ref$placement = _ref.placement,
31325
- placement = _ref$placement === void 0 ? 'top' : _ref$placement,
31326
- _ref$portalClassName = _ref.portalClassName,
31327
- portalClassName = _ref$portalClassName === void 0 ? '' : _ref$portalClassName,
31328
- _ref$enterDelay = _ref.enterDelay,
31329
- enterDelay = _ref$enterDelay === void 0 ? 100 : _ref$enterDelay,
31330
- _ref$leaveDelay = _ref.leaveDelay,
31331
- leaveDelay = _ref$leaveDelay === void 0 ? 150 : _ref$leaveDelay,
31332
- _ref$trigger = _ref.trigger,
31333
- trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
31334
- _ref$type = _ref.type,
31335
- type = _ref$type === void 0 ? 'default' : _ref$type,
31014
+ var _excluded$5 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
31015
+ var PaginationComponent = function PaginationComponent(_ref) {
31016
+ var customPage = _ref.page,
31017
+ _ref$initialPage = _ref.initialPage,
31018
+ initialPage = _ref$initialPage === void 0 ? 1 : _ref$initialPage,
31019
+ _ref$count = _ref.count,
31020
+ count = _ref$count === void 0 ? 1 : _ref$count,
31021
+ _ref$limit = _ref.limit,
31022
+ limit = _ref$limit === void 0 ? 7 : _ref$limit,
31023
+ children = _ref.children,
31024
+ onChange = _ref.onChange,
31336
31025
  _ref$className = _ref.className,
31337
31026
  className = _ref$className === void 0 ? '' : _ref$className,
31338
- _ref$onVisibleChange = _ref.onVisibleChange,
31339
- onVisibleChange = _ref$onVisibleChange === void 0 ? function () {} : _ref$onVisibleChange,
31340
- _ref$hideArrow = _ref.hideArrow,
31341
- hideArrow = _ref$hideArrow === void 0 ? false : _ref$hideArrow,
31342
- customVisible = _ref.visible,
31343
- props = _objectWithoutProperties(_ref, _excluded$7);
31344
- var timer = React.useRef();
31345
- var ref = React.useRef(null);
31346
- var _useState = React.useState(initialVisible),
31347
- _useState2 = _slicedToArray(_useState, 2),
31348
- visible = _useState2[0],
31349
- setVisible = _useState2[1];
31350
- var iconOffset = React.useMemo(function () {
31351
- if (!(ref !== null && ref !== void 0 && ref.current)) return {
31352
- x: '0.75em',
31353
- y: '0.75em'
31354
- };
31355
- var rect = getRect(ref);
31356
- return {
31357
- x: "".concat(rect.width ? rect.width / 2 : 0, "px"),
31358
- y: "".concat(rect.height ? rect.height / 2 : 0, "px")
31359
- };
31360
- }, [ref === null || ref === void 0 ? void 0 : ref.current]);
31361
- var contentProps = {
31362
- type: type,
31363
- visible: visible,
31364
- offset: offset,
31365
- placement: placement,
31366
- hideArrow: hideArrow,
31367
- iconOffset: iconOffset,
31368
- parent: ref,
31369
- className: portalClassName
31370
- };
31371
- var changeVisible = function changeVisible(nextState) {
31372
- var clear = function clear() {
31373
- clearTimeout(timer.current);
31374
- timer.current = undefined;
31375
- };
31376
- var handler = function handler(nextState) {
31377
- setVisible(nextState);
31378
- onVisibleChange(nextState);
31379
- clear();
31380
- };
31381
- clear();
31382
- if (nextState) {
31383
- timer.current = window.setTimeout(function () {
31384
- return handler(true);
31385
- }, enterDelay);
31386
- return;
31027
+ props = _objectWithoutProperties(_ref, _excluded$5);
31028
+ var _useScale = useScale(),
31029
+ SCALES = _useScale.SCALES;
31030
+ var _useCurrentState = useCurrentState(initialPage),
31031
+ _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
31032
+ page = _useCurrentState2[0],
31033
+ setPage = _useCurrentState2[1],
31034
+ pageRef = _useCurrentState2[2];
31035
+ var _pickChild = pickChild(children, PaginationPrevious),
31036
+ _pickChild2 = _slicedToArray(_pickChild, 2),
31037
+ prevChildren = _pickChild2[1];
31038
+ var _pickChild3 = pickChild(children, PaginationNext),
31039
+ _pickChild4 = _slicedToArray(_pickChild3, 2),
31040
+ nextChildren = _pickChild4[1];
31041
+ var _useMemo = React.useMemo(function () {
31042
+ var hasChildren = function hasChildren(c) {
31043
+ return React.Children.count(c) > 0;
31044
+ };
31045
+ var prevDefault = /*#__PURE__*/React.createElement(PaginationPrevious, null, "prev");
31046
+ var nextDefault = /*#__PURE__*/React.createElement(PaginationNext, null, "next");
31047
+ return [hasChildren(prevChildren) ? prevChildren : prevDefault, hasChildren(nextChildren) ? nextChildren : nextDefault];
31048
+ }, [prevChildren, nextChildren]),
31049
+ _useMemo2 = _slicedToArray(_useMemo, 2),
31050
+ prevItem = _useMemo2[0],
31051
+ nextItem = _useMemo2[1];
31052
+ var update = function update(type) {
31053
+ if (type === 'prev' && pageRef.current > 1) {
31054
+ setPage(function (last) {
31055
+ return last - 1;
31056
+ });
31057
+ }
31058
+ if (type === 'next' && pageRef.current < count) {
31059
+ setPage(function (last) {
31060
+ return last + 1;
31061
+ });
31387
31062
  }
31388
- var leaveDelayWithoutClick = trigger === 'click' ? 0 : leaveDelay;
31389
- timer.current = window.setTimeout(function () {
31390
- return handler(false);
31391
- }, leaveDelayWithoutClick);
31392
- };
31393
- var mouseEventHandler = function mouseEventHandler(next) {
31394
- return trigger === 'hover' && changeVisible(next);
31395
- };
31396
- var clickEventHandler = function clickEventHandler() {
31397
- return trigger === 'click' && changeVisible(!visible);
31398
31063
  };
31399
- useClickAway(ref, function () {
31400
- return trigger === 'click' && changeVisible(false);
31401
- });
31064
+ var values = React.useMemo(function () {
31065
+ return {
31066
+ isFirst: page <= 1,
31067
+ isLast: page >= count,
31068
+ update: update
31069
+ };
31070
+ }, [page, count]);
31402
31071
  React.useEffect(function () {
31403
- if (customVisible === undefined) return;
31404
- changeVisible(customVisible);
31405
- }, [customVisible]);
31406
- return /*#__PURE__*/React.createElement("div", _extends({
31407
- ref: ref,
31408
- onClick: clickEventHandler,
31409
- onMouseEnter: function onMouseEnter() {
31410
- return mouseEventHandler(true);
31411
- },
31412
- onMouseLeave: function onMouseLeave() {
31413
- return mouseEventHandler(false);
31072
+ onChange && onChange(page);
31073
+ }, [page]);
31074
+ React.useEffect(function () {
31075
+ if (customPage !== undefined) {
31076
+ setPage(customPage);
31414
31077
  }
31415
- }, props, {
31416
- className: "jsx-418573366" + " " + (props && props.className != null && props.className || useClasses('tooltip', className) || "")
31417
- }), children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
31418
- id: "418573366"
31419
- }, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));
31078
+ }, [customPage]);
31079
+ return /*#__PURE__*/React.createElement(PaginationContext.Provider, {
31080
+ value: values
31081
+ }, /*#__PURE__*/React.createElement("nav", _extends({}, props, {
31082
+ className: _JSXStyle.dynamic([["3826701357", [SCALES.font(2), SCALES.font(0.875), 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)]]]) + " " + (props && props.className != null && props.className || className || "")
31083
+ }), prevItem, /*#__PURE__*/React.createElement(PaginationPages, {
31084
+ count: count,
31085
+ current: page,
31086
+ limit: limit,
31087
+ setPage: setPage
31088
+ }), nextItem), /*#__PURE__*/React.createElement(_JSXStyle, {
31089
+ id: "3826701357",
31090
+ dynamic: [SCALES.font(2), SCALES.font(0.875), 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)]
31091
+ }, "nav.__jsx-style-dynamic-selector{font-variant:tabular-nums;font-feature-settings:'tnum';--pagination-size:".concat(SCALES.font(2), ";font-size:").concat(SCALES.font(0.875), ";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 button:last-of-type{margin-right:0;}")));
31420
31092
  };
31421
- TooltipComponent.displayName = 'Tooltip';
31422
- var Tooltip = withScale(TooltipComponent);
31093
+ PaginationComponent.displayName = 'Pagination';
31094
+ var Pagination = withScale(PaginationComponent);
31423
31095
 
31424
- /* "use client" */
31096
+ Pagination.Previous = PaginationPrevious;
31097
+ Pagination.Next = PaginationNext;
31425
31098
 
31426
- var defaultContext$1 = {
31427
- disableItemsAutoClose: false,
31428
- onItemClick: function onItemClick() {}
31429
- };
31430
- var PopoverContext = /*#__PURE__*/React.createContext(defaultContext$1);
31431
- var usePopoverContext = function usePopoverContext() {
31432
- return React.useContext(PopoverContext);
31099
+ var ButtonDrip = function ButtonDrip(_ref) {
31100
+ var _ref$x = _ref.x,
31101
+ x = _ref$x === void 0 ? 0 : _ref$x,
31102
+ _ref$y = _ref.y,
31103
+ y = _ref$y === void 0 ? 0 : _ref$y,
31104
+ color = _ref.color,
31105
+ onCompleted = _ref.onCompleted;
31106
+ var dripRef = React.useRef(null);
31107
+ /* istanbul ignore next */
31108
+ var top = Number.isNaN(+y) ? 0 : y - 10;
31109
+ /* istanbul ignore next */
31110
+ var left = Number.isNaN(+x) ? 0 : x - 10;
31111
+ React.useEffect(function () {
31112
+ /* istanbul ignore next */
31113
+ if (!dripRef.current) return;
31114
+ dripRef.current.addEventListener('animationend', onCompleted);
31115
+ return function () {
31116
+ /* istanbul ignore next */
31117
+ if (!dripRef.current) return;
31118
+ dripRef.current.removeEventListener('animationend', onCompleted);
31119
+ };
31120
+ });
31121
+ return /*#__PURE__*/React.createElement("div", {
31122
+ ref: dripRef,
31123
+ className: "jsx-3424889537" + " " + "drip"
31124
+ }, /*#__PURE__*/React.createElement("svg", {
31125
+ width: "20",
31126
+ height: "20",
31127
+ viewBox: "0 0 20 20",
31128
+ style: {
31129
+ top: top,
31130
+ left: left
31131
+ },
31132
+ className: "jsx-3424889537"
31133
+ }, /*#__PURE__*/React.createElement("g", {
31134
+ stroke: "none",
31135
+ strokeWidth: "1",
31136
+ fill: "none",
31137
+ fillRule: "evenodd",
31138
+ className: "jsx-3424889537"
31139
+ }, /*#__PURE__*/React.createElement("g", {
31140
+ fill: color,
31141
+ className: "jsx-3424889537"
31142
+ }, /*#__PURE__*/React.createElement("rect", {
31143
+ width: "100%",
31144
+ height: "100%",
31145
+ rx: "10",
31146
+ className: "jsx-3424889537"
31147
+ })))), /*#__PURE__*/React.createElement(_JSXStyle, {
31148
+ id: "3424889537"
31149
+ }, ".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;}}"));
31433
31150
  };
31151
+ ButtonDrip.displayName = 'ButtonDrip';
31434
31152
 
31435
- var _excluded$6 = ["child", "children", "enterDelay", "leaveDelay", "offset", "type", "trigger", "placement", "initialVisible", "portalClassName", "disableItemsAutoClose", "onVisibleChange", "visible"];
31436
- var PopoverComponent = function PopoverComponent(_ref) {
31437
- var child = _ref.child,
31438
- children = _ref.children,
31439
- _ref$enterDelay = _ref.enterDelay,
31440
- enterDelay = _ref$enterDelay === void 0 ? 100 : _ref$enterDelay,
31441
- _ref$leaveDelay = _ref.leaveDelay,
31442
- leaveDelay = _ref$leaveDelay === void 0 ? 150 : _ref$leaveDelay,
31443
- _ref$offset = _ref.offset,
31444
- offset = _ref$offset === void 0 ? 12 : _ref$offset,
31445
- _ref$type = _ref.type,
31446
- type = _ref$type === void 0 ? 'default' : _ref$type,
31447
- _ref$trigger = _ref.trigger,
31448
- trigger = _ref$trigger === void 0 ? 'click' : _ref$trigger,
31449
- _ref$placement = _ref.placement,
31450
- placement = _ref$placement === void 0 ? 'bottom' : _ref$placement,
31451
- _ref$initialVisible = _ref.initialVisible,
31452
- initialVisible = _ref$initialVisible === void 0 ? false : _ref$initialVisible,
31453
- _ref$portalClassName = _ref.portalClassName,
31454
- portalClassName = _ref$portalClassName === void 0 ? '' : _ref$portalClassName,
31455
- _ref$disableItemsAuto = _ref.disableItemsAutoClose,
31456
- disableItemsAutoClose = _ref$disableItemsAuto === void 0 ? false : _ref$disableItemsAuto,
31457
- _ref$onVisibleChange = _ref.onVisibleChange,
31458
- onVisibleChange = _ref$onVisibleChange === void 0 ? function () {} : _ref$onVisibleChange,
31459
- customVisible = _ref.visible,
31460
- props = _objectWithoutProperties(_ref, _excluded$6);
31461
- var _useScale = useScale(),
31462
- SCALES = _useScale.SCALES;
31463
- var _useState = React.useState(initialVisible),
31464
- _useState2 = _slicedToArray(_useState, 2),
31465
- visible = _useState2[0],
31466
- setVisible = _useState2[1];
31467
- var textNode = React.useMemo(function () {
31468
- return getReactNode(child);
31469
- }, [child]);
31470
- var onChildClick = function onChildClick() {
31471
- onPopoverVisibleChange(false);
31472
- };
31473
- var value = React.useMemo(function () {
31474
- return {
31475
- onItemClick: onChildClick,
31476
- disableItemsAutoClose: disableItemsAutoClose
31477
- };
31478
- }, [disableItemsAutoClose]);
31479
- var classes = useClasses('popover', portalClassName);
31480
- var onPopoverVisibleChange = function onPopoverVisibleChange(next) {
31481
- setVisible(next);
31482
- onVisibleChange(next);
31153
+ var _excluded$4 = ["children", "type", "color", "className", "spaceRatio"];
31154
+ var getIconBgColor = function getIconBgColor(type, palette, color) {
31155
+ var colors = {
31156
+ "default": palette.accents_6,
31157
+ secondary: palette.secondary,
31158
+ success: palette.success,
31159
+ warning: palette.warning,
31160
+ error: palette.error
31483
31161
  };
31484
- React.useEffect(function () {
31485
- if (customVisible === undefined) return;
31486
- onPopoverVisibleChange(customVisible);
31487
- }, [customVisible]);
31488
- return /*#__PURE__*/React.createElement(PopoverContext.Provider, {
31489
- value: value
31490
- }, /*#__PURE__*/React.createElement(Tooltip, _extends({
31491
- type: type,
31492
- enterDelay: enterDelay,
31493
- leaveDelay: leaveDelay,
31494
- offset: offset,
31495
- text: textNode,
31496
- trigger: trigger,
31497
- placement: placement,
31498
- portalClassName: classes,
31499
- visible: visible,
31500
- onVisibleChange: onPopoverVisibleChange
31501
- }, props), children, /*#__PURE__*/React.createElement(_JSXStyle, {
31502
- id: "622655983",
31503
- dynamic: [SCALES.pt(0.9), SCALES.pr(0), SCALES.pb(0.9), SCALES.pl(0)]
31504
- }, ".tooltip-content.popover > .inner{padding:".concat(SCALES.pt(0.9), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0.9), " ").concat(SCALES.pl(0), ";}"))));
31162
+ return color ? color : colors[type];
31505
31163
  };
31506
- PopoverComponent.displayName = 'Popover';
31507
- var Popover = withScale(PopoverComponent);
31508
-
31509
- var _excluded$5 = ["children", "line", "showTitle", "className", "onClick", "selected", "disableAutoClose"];
31510
- var PopoverItemComponent = function PopoverItemComponent(_ref) {
31164
+ var LoadingComponent = function LoadingComponent(_ref) {
31511
31165
  var children = _ref.children,
31512
- _ref$line = _ref.line,
31513
- line = _ref$line === void 0 ? false : _ref$line,
31514
- _ref$showTitle = _ref.showTitle,
31515
- showTitle = _ref$showTitle === void 0 ? false : _ref$showTitle,
31166
+ _ref$type = _ref.type,
31167
+ type = _ref$type === void 0 ? 'default' : _ref$type,
31168
+ color = _ref.color,
31516
31169
  _ref$className = _ref.className,
31517
31170
  className = _ref$className === void 0 ? '' : _ref$className,
31518
- onClick = _ref.onClick,
31519
- _ref$selected = _ref.selected,
31520
- selected = _ref$selected === void 0 ? false : _ref$selected,
31521
- _ref$disableAutoClose = _ref.disableAutoClose,
31522
- disableAutoClose = _ref$disableAutoClose === void 0 ? false : _ref$disableAutoClose,
31523
- props = _objectWithoutProperties(_ref, _excluded$5);
31171
+ _ref$spaceRatio = _ref.spaceRatio,
31172
+ spaceRatio = _ref$spaceRatio === void 0 ? 1 : _ref$spaceRatio,
31173
+ props = _objectWithoutProperties(_ref, _excluded$4);
31524
31174
  var theme = useTheme();
31525
31175
  var _useScale = useScale(),
31526
31176
  SCALES = _useScale.SCALES;
31527
- var _usePopoverContext = usePopoverContext(),
31528
- disableItemsAutoClose = _usePopoverContext.disableItemsAutoClose,
31529
- onItemClick = _usePopoverContext.onItemClick;
31530
- var hasHandler = Boolean(onClick);
31531
- var dontCloseByClick = disableAutoClose || disableItemsAutoClose || showTitle || line;
31532
- var classes = useClasses('item', {
31533
- line: line,
31534
- showTitle: showTitle
31177
+ var classes = useClasses('loading-container', className);
31178
+ var bgColor = React.useMemo(function () {
31179
+ return getIconBgColor(type, theme.palette, color);
31180
+ }, [type, theme.palette, color]);
31181
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
31182
+ 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.palette.accents_5, bgColor, spaceRatio]]]) + " " + (props && props.className != null && props.className || classes || "")
31183
+ }), /*#__PURE__*/React.createElement("span", {
31184
+ 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.palette.accents_5, bgColor, spaceRatio]]]) + " " + "loading"
31185
+ }, children && /*#__PURE__*/React.createElement("label", {
31186
+ 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.palette.accents_5, bgColor, spaceRatio]]])
31187
+ }, children), /*#__PURE__*/React.createElement("i", {
31188
+ 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.palette.accents_5, bgColor, spaceRatio]]])
31189
+ }), /*#__PURE__*/React.createElement("i", {
31190
+ 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.palette.accents_5, bgColor, spaceRatio]]])
31191
+ }), /*#__PURE__*/React.createElement("i", {
31192
+ 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.palette.accents_5, bgColor, spaceRatio]]])
31193
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
31194
+ id: "2201634259",
31195
+ 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.palette.accents_5, bgColor, spaceRatio]
31196
+ }, ".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.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;}}")));
31197
+ };
31198
+ LoadingComponent.displayName = 'Loading';
31199
+ var Loading = withScale(LoadingComponent);
31200
+
31201
+ var ButtonLoading = function ButtonLoading(_ref) {
31202
+ var color = _ref.color;
31203
+ return /*#__PURE__*/React.createElement("div", {
31204
+ className: "jsx-212623367" + " " + "btn-loading"
31205
+ }, /*#__PURE__*/React.createElement(Loading, {
31206
+ color: color
31207
+ }), /*#__PURE__*/React.createElement(_JSXStyle, {
31208
+ id: "212623367"
31209
+ }, ".btn-loading.jsx-212623367{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;background-color:var(--helpdice-ui-button-bg);}"));
31210
+ };
31211
+ ButtonLoading.displayName = 'ButtonLoading';
31212
+
31213
+ var _excluded$3 = ["isRight", "isSingle", "children", "className"];
31214
+ var ButtonIcon = function ButtonIcon(_ref) {
31215
+ var _ref$isRight = _ref.isRight,
31216
+ isRight = _ref$isRight === void 0 ? false : _ref$isRight,
31217
+ isSingle = _ref.isSingle,
31218
+ children = _ref.children,
31219
+ _ref$className = _ref.className,
31220
+ className = _ref$className === void 0 ? '' : _ref$className,
31221
+ props = _objectWithoutProperties(_ref, _excluded$3);
31222
+ var classes = useClasses('icon', {
31223
+ right: isRight,
31224
+ single: isSingle
31535
31225
  }, className);
31536
- var clickHandler = function clickHandler(event) {
31537
- onClick && onClick(event);
31538
- if (dontCloseByClick) {
31539
- return event.stopPropagation();
31540
- }
31541
- onItemClick(event);
31542
- };
31543
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", _extends({
31544
- style: {
31545
- backgroundColor: selected ? '#efefef' : ''
31546
- },
31547
- onClick: clickHandler
31548
- }, props, {
31549
- className: _JSXStyle.dynamic([["190621384", [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]]]) + " " + (props && props.className != null && props.className || classes || "")
31226
+ return /*#__PURE__*/React.createElement("span", _extends({}, props, {
31227
+ className: "jsx-2467502931" + " " + (props && props.className != null && props.className || classes || "")
31550
31228
  }), children, /*#__PURE__*/React.createElement(_JSXStyle, {
31551
- id: "190621384",
31552
- dynamic: [theme.palette.accents_5, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), SCALES.pt(0.5), SCALES.pr(0.75), SCALES.pb(0.5), SCALES.pl(0.75), hasHandler ? 'pointer' : 'default', theme.palette.foreground, theme.palette.border, SCALES.height(0.0625), SCALES.mt(0.35), SCALES.mr(0), SCALES.mb(0.35), SCALES.ml(0), SCALES.width(1, '100%'), SCALES.font(0.925), theme.palette.foreground]
31553
- }, ".item.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;box-sizing:border-box;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:".concat(theme.palette.accents_5, ";-webkit-transition:color,background-color 150ms linear;transition:color,background-color 150ms linear;line-height:1.25em;font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";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.5), " ").concat(SCALES.pr(0.75), " ").concat(SCALES.pb(0.5), " ").concat(SCALES.pl(0.75), ";cursor:").concat(hasHandler ? 'pointer' : 'default', ";}.item.__jsx-style-dynamic-selector:hover{color:").concat(theme.palette.foreground, ";}.item.line.__jsx-style-dynamic-selector{line-height:0;padding:0;background-color:").concat(theme.palette.border, ";height:").concat(SCALES.height(0.0625), ";margin:").concat(SCALES.mt(0.35), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0.35), " ").concat(SCALES.ml(0), ";width:").concat(SCALES.width(1, '100%'), ";}.item.title.__jsx-style-dynamic-selector{font-weight:500;font-size:").concat(SCALES.font(0.925), ";color:").concat(theme.palette.foreground, ";}"))), showTitle && /*#__PURE__*/React.createElement(PopoverItem, {
31554
- line: true,
31555
- showTitle: false
31556
- }));
31229
+ id: "2467502931"
31230
+ }, ".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;}"));
31231
+ };
31232
+ ButtonIcon.displayName = 'ButtonIcon';
31233
+
31234
+ var getButtonChildrenWithIcon = function getButtonChildrenWithIcon(auto, children, icons) {
31235
+ var icon = icons.icon,
31236
+ iconRight = icons.iconRight;
31237
+ var hasIcon = icon || iconRight;
31238
+ var isRight = Boolean(iconRight);
31239
+ var paddingForAutoMode = auto ? "calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding) * .5)" : 0;
31240
+ var classes = useClasses('text', isRight ? 'right' : 'left');
31241
+ if (!hasIcon) return /*#__PURE__*/React.createElement("div", {
31242
+ className: "text"
31243
+ }, children);
31244
+ if (React.Children.count(children) === 0) {
31245
+ return /*#__PURE__*/React.createElement(ButtonIcon, {
31246
+ isRight: isRight,
31247
+ isSingle: true
31248
+ }, hasIcon);
31249
+ }
31250
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ButtonIcon, {
31251
+ isRight: isRight
31252
+ }, hasIcon), /*#__PURE__*/React.createElement("div", {
31253
+ className: _JSXStyle.dynamic([["3568181479", [paddingForAutoMode, paddingForAutoMode]]]) + " " + (classes || "")
31254
+ }, children, /*#__PURE__*/React.createElement(_JSXStyle, {
31255
+ id: "3568181479",
31256
+ dynamic: [paddingForAutoMode, paddingForAutoMode]
31257
+ }, ".left.__jsx-style-dynamic-selector{padding-left:".concat(paddingForAutoMode, ";}.right.__jsx-style-dynamic-selector{padding-right:").concat(paddingForAutoMode, ";}"))));
31258
+ };
31259
+ var filterPropsWithGroup = function filterPropsWithGroup(props, config) {
31260
+ if (!config.isButtonGroup) return props;
31261
+ return _objectSpread2(_objectSpread2({}, props), {}, {
31262
+ auto: true,
31263
+ shadow: false,
31264
+ ghost: config.ghost || props.ghost,
31265
+ type: config.type || props.type,
31266
+ disabled: config.disabled || props.disabled
31267
+ });
31557
31268
  };
31558
- PopoverItemComponent.displayName = 'PopoverItem';
31559
- var PopoverItem = withScale(PopoverItemComponent);
31560
31269
 
31561
31270
  /* "use client" */
31562
- Popover.Item = PopoverItem;
31563
- Popover.Option = PopoverItem;
31564
-
31565
- // import Input from '../input';
31566
- // import Select from '../select';
31567
-
31568
- function DataTable(_ref) {
31569
- var _ref$cols = _ref.cols,
31570
- cols = _ref$cols === void 0 ? [] : _ref$cols,
31571
- _ref$rows = _ref.rows,
31572
- rows = _ref$rows === void 0 ? [] : _ref$rows,
31573
- _ref$readOnly = _ref.readOnly,
31574
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
31575
- _ref$heading = _ref.heading,
31576
- heading = _ref$heading === void 0 ? [] : _ref$heading,
31577
- _ref$filter = _ref.filter,
31578
- filter = _ref$filter === void 0 ? true : _ref$filter,
31579
- menu = _ref.menu,
31580
- _ref$sideMenu = _ref.sideMenu,
31581
- sideMenu = _ref$sideMenu === void 0 ? false : _ref$sideMenu,
31582
- _ref$style = _ref.style,
31583
- style = _ref$style === void 0 ? {} : _ref$style,
31584
- children = _ref.children,
31585
- _ref$onBack = _ref.onBack,
31586
- onBack = _ref$onBack === void 0 ? function () {
31587
- window.history.back();
31588
- } : _ref$onBack,
31589
- onRefresh = _ref.onRefresh,
31590
- _onFilters = _ref.onFilters,
31591
- onSelectedDelete = _ref.onSelectedDelete,
31592
- onSelectedEdit = _ref.onSelectedEdit,
31593
- onSelected = _ref.onSelected,
31594
- _ref$disableViewColum = _ref.disableViewColumn,
31595
- disableViewColumn = _ref$disableViewColum === void 0 ? false : _ref$disableViewColum,
31596
- _ref$rowDraggable = _ref.rowDraggable,
31597
- rowDraggable = _ref$rowDraggable === void 0 ? false : _ref$rowDraggable,
31598
- onDragOver = _ref.onDragOver,
31599
- onDragEnter = _ref.onDragEnter,
31600
- onDragLeave = _ref.onDragLeave,
31601
- onDrop = _ref.onDrop,
31602
- onRowClick = _ref.onRowClick,
31603
- dataLength = _ref.dataLength,
31604
- viewLength = _ref.viewLength,
31605
- _onPageChange = _ref.onPageChange,
31606
- _ref$disableMenu = _ref.disableMenu,
31607
- disableMenu = _ref$disableMenu === void 0 ? false : _ref$disableMenu,
31608
- _ref$cursorPagination = _ref.cursorPagination,
31609
- cursorPagination = _ref$cursorPagination === void 0 ? false : _ref$cursorPagination,
31610
- previousCursor = _ref.previousCursor,
31611
- nextCursor = _ref.nextCursor,
31612
- _ref$hasMore = _ref.hasMore,
31613
- hasMore = _ref$hasMore === void 0 ? false : _ref$hasMore,
31614
- _ref$stickyHeader = _ref.stickyHeader,
31615
- stickyHeader = _ref$stickyHeader === void 0 ? false : _ref$stickyHeader,
31616
- onNextPage = _ref.onNextPage,
31617
- onPreviousPage = _ref.onPreviousPage;
31618
- var TABLE_ID = _.uniqueId('tbl');
31619
- var _useState = React.useState([]),
31620
- _useState2 = _slicedToArray(_useState, 2),
31621
- hideColumn = _useState2[0],
31622
- setHideColumn = _useState2[1];
31623
- var _useState3 = React.useState(false),
31624
- _useState4 = _slicedToArray(_useState3, 2),
31625
- openFilter = _useState4[0],
31626
- setOpenFilter = _useState4[1];
31627
- // const [anchorEl, setAnchorEl] = useState(null);
31628
- var _useState5 = React.useState([]),
31629
- _useState6 = _slicedToArray(_useState5, 2),
31630
- selected = _useState6[0],
31631
- setSelected = _useState6[1];
31632
-
31633
- // const [table_filters] = useDebounce(filters, 500);
31634
- var COLUMNS = cols.filter(function (col) {
31635
- var _String;
31636
- var dataName = (_String = String(col === null || col === void 0 ? void 0 : col.name)) === null || _String === void 0 ? void 0 : _String.replace(' ', '_').toLowerCase();
31637
- return !hideColumn.includes(dataName);
31638
- });
31639
31271
 
31640
- // State for filter values
31641
- // const [filterValues, setFilterValues] = useState(
31642
- // COLUMNS.reduce((acc, col) => {
31643
- // acc[col.filter] = '';
31644
- // return acc;
31645
- // }, {})
31646
- // );
31272
+ var defaultContext = {
31273
+ isButtonGroup: false,
31274
+ disabled: false
31275
+ };
31276
+ var ButtonGroupContext = /*#__PURE__*/React.createContext(defaultContext);
31277
+ var useButtonGroupContext = function useButtonGroupContext() {
31278
+ return React.useContext(ButtonGroupContext);
31279
+ };
31647
31280
 
31648
- function handleShowFilter() {
31649
- return setOpenFilter(!openFilter);
31650
- }
31651
- React.useEffect(function () {
31652
- cols.forEach(function (col) {
31653
- if (hideColumn.includes(col.name)) {
31654
- document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
31655
- el.style.display = 'none !important';
31656
- });
31657
- } else {
31658
- document.querySelectorAll("[data-column=\"".concat(col.id, "\"]")).forEach(function (el) {
31659
- el.style.display = '';
31660
- });
31661
- }
31662
- });
31663
- }, [hideColumn, cols]);
31664
- function handleHideColumnClick(_event, _id) {
31665
- var _String2;
31666
- var id = (_String2 = String(_id)) === null || _String2 === void 0 ? void 0 : _String2.replace(' ', '_').toLowerCase();
31667
- var selectedIndex = hideColumn.indexOf(id);
31668
- var newSelected = [];
31669
- if (selectedIndex === -1) {
31670
- newSelected = newSelected.concat(hideColumn, id);
31671
- } else if (selectedIndex === 0) {
31672
- newSelected = newSelected.concat(hideColumn.slice(1));
31673
- } else if (selectedIndex === hideColumn.length - 1) {
31674
- newSelected = newSelected.concat(hideColumn.slice(0, -1));
31675
- } else if (selectedIndex > 0) {
31676
- newSelected = newSelected.concat(hideColumn.slice(0, selectedIndex), hideColumn.slice(selectedIndex + 1));
31281
+ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
31282
+ var colors = {
31283
+ secondary: {
31284
+ bg: palette.background,
31285
+ border: palette.foreground,
31286
+ color: palette.foreground
31287
+ },
31288
+ success: {
31289
+ bg: palette.background,
31290
+ border: palette.success,
31291
+ color: palette.success
31292
+ },
31293
+ warning: {
31294
+ bg: palette.background,
31295
+ border: palette.warning,
31296
+ color: palette.warning
31297
+ },
31298
+ error: {
31299
+ bg: palette.background,
31300
+ border: palette.error,
31301
+ color: palette.error
31677
31302
  }
31678
- setHideColumn(newSelected);
31679
- }
31680
-
31681
- // Children change reset selected
31682
- React.useEffect(function () {
31683
- setSelected([]);
31684
- }, [children]);
31685
-
31686
- // const tableHeadStyle = {
31687
- // position: 'sticky',
31688
- // // backgroundColor: '#fafafb',
31689
- // // boxShadow: '0 2px 2px -1px rgba(0, 0, 0, 0.4)',
31690
- // top: 0,
31691
- // zIndex: 9,
31692
- // '& .MuiTableCell-root': {
31693
- // fontSize: '14px !important',
31694
- // py: 0.2
31695
- // }
31696
- // // ...borderStyle
31697
- // };
31698
-
31699
- // const borderStyle = {
31700
- // '& .MuiTableCell-root': {
31701
- // py: 0.2,
31702
- // px: 1
31703
- // // borderLeft: '1px solid #ccc !important',
31704
- // // borderRight: '1px solid #ccc !important'
31705
- // },
31706
- // '& td:first-of-type': {
31707
- // borderLeft: 'none !important'
31708
- // },
31709
- // '& td:last-child': {
31710
- // borderRight: 'none !important'
31711
- // }
31712
- // // '& tr': { borderBottom: '1px solid #ccc !important' }
31713
- // };
31714
-
31715
- // const handleFilterChange = (name: string, value?: any) => {
31716
- // setFilterValues({ ...filterValues, [name]: value });
31717
- // };
31718
-
31719
- // const generateFilterInputs = () => {
31720
- // return COLUMNS.map((col) => {
31721
- // const { name: Header, filter: accessor, options } = col;
31722
- // const filterName = String(col?.name)?.replace(' ', '_').toLowerCase();
31723
- // // const unq_accessor = _.uniqueId(filterName);
31724
- // // if (Header === 'actions') {
31725
- // // return (
31726
- // // <th style={{ margin: '3px' }} data-column={Header} key={unq_accessor}>
31727
- // // <Button onClick={applyFilters} auto px={0.6} scale={2 / 3}>Apply</Button>
31728
- // // </th>
31729
- // // )
31730
- // // }
31731
- // return (
31732
- // <Popover.Item style={{ padding: '3px' }} data-column={Header}>
31733
- // {accessor === 'fixed' && (
31734
- // <Select
31735
- // // key={filterName}
31736
- // name={filterName}
31737
- // value={filterValues[filterName] ?? 'All'}
31738
- // onChange={(newValue) => handleFilterChange(filterName, newValue)}
31739
- // >
31740
- // <Select.Option value="All">All {Header}</Select.Option>
31741
- // {options ? options.map((option: any) => (
31742
- // <Select.Option value={option.value}>{option.name}</Select.Option>
31743
- // )) : null}
31744
- // </Select>
31745
- // )}
31746
- // {accessor === 'date' && (
31747
- // <Input
31748
- // // id={`filter-date-${filterName}`}
31749
- // // key={filterName}
31750
- // type="date"
31751
- // name={filterName}
31752
- // value={filterValues[filterName]}
31753
- // onChange={(e) => handleFilterChange(filterName, e.target.value)}
31754
- // />
31755
- // )}
31756
- // {accessor === 'search' && (
31757
- // <Input
31758
- // // id={`filter-search-${filterName}`}
31759
- // // key={filterName}
31760
- // type="text"
31761
- // autoComplete="off"
31762
- // // ref={filterRefs.current[filterName]} // Dynamically set ref}
31763
- // name={filterName}
31764
- // style={{ height: 30, minWidth: 160 }}
31765
- // value={filterValues[filterName]}
31766
- // onChange={(e) => handleFilterChange(filterName, e.target.value)}
31767
- // placeholder="Search..."
31768
- // fullWidth
31769
- // />
31770
- // )}
31771
- // </Popover.Item>
31772
- // );
31773
- // });
31774
- // };
31775
-
31776
- var content = function content() {
31777
- return /*#__PURE__*/React.createElement(React.Fragment, null, cols.map(function (option, _index) {
31778
- // const colunqid = _.uniqueId(`${option.name}-${index}`);
31779
- var isSelected = !hideColumn.includes(option.id);
31780
- return /*#__PURE__*/React.createElement(Popover.Item, {
31781
- selected: isSelected
31782
- // key={colunqid}
31783
- ,
31784
- onClick: function onClick(e) {
31785
- return handleHideColumnClick(e, option.id);
31786
- }
31787
- }, /*#__PURE__*/React.createElement("span", null, option.name));
31788
- }));
31789
31303
  };
31790
-
31791
- // const filterContent = () => (
31792
- // <>
31793
- // {generateFilterInputs()}
31794
- // <Popover.Item>
31795
- // <Button onClick={() => {
31796
- // if (onFilters) {
31797
- // onFilters(filterValues)
31798
- // }
31799
- // }}>Apply</Button></Popover.Item></>
31800
- // )
31801
-
31802
- var SELECTED = React.useMemo(function () {
31803
- if (onSelected) {
31804
- return onSelected(selected);
31805
- }
31806
- return /*#__PURE__*/React.createElement(React.Fragment, null);
31807
- }, [selected]);
31808
- return /*#__PURE__*/React.createElement(GridContainer, {
31809
- className: "helpdice-ui-data-table-container",
31810
- direction: "column"
31811
- }, /*#__PURE__*/React.createElement(Grid.Container, {
31812
- style: {
31813
- marginBottom: '0.5rem',
31814
- marginTop: '0.5rem'
31815
- }
31816
- }, heading && /*#__PURE__*/React.createElement(Grid, {
31817
- sm: disableMenu ? 24 : 12,
31818
- xs: 24
31819
- }, /*#__PURE__*/React.createElement("div", {
31820
- style: {
31821
- display: 'flex',
31822
- alignItems: 'center',
31823
- gap: '1rem',
31824
- fontSize: 'larger'
31825
- }
31826
- }, children && /*#__PURE__*/React.createElement(Button, {
31827
- type: "button",
31828
- auto: true,
31829
- scale: 2 / 3,
31830
- px: 0.6,
31831
- iconRight: /*#__PURE__*/React.createElement(ArrowLeft$1, null),
31832
- onClick: onBack
31833
- }), heading)), !disableMenu && /*#__PURE__*/React.createElement(Grid, {
31834
- sm: 12,
31835
- xs: 24
31836
- }, /*#__PURE__*/React.createElement(GridContainer, {
31837
- width: "100%",
31838
- style: {
31839
- margin: 0,
31840
- gap: '0.6rem'
31304
+ return colors[_color] || null;
31305
+ };
31306
+ var getButtonColors = function getButtonColors(palette, props) {
31307
+ var color = props.color,
31308
+ disabled = props.disabled,
31309
+ ghost = props.ghost;
31310
+ var colors = {
31311
+ "default": {
31312
+ bg: palette.background,
31313
+ border: palette.border,
31314
+ color: palette.accents_5
31841
31315
  },
31842
- justify: "flex-end",
31843
- alignContent: "center"
31844
- }, menu, !children && !readOnly ? /*#__PURE__*/React.createElement(React.Fragment, null, (selected === null || selected === void 0 ? void 0 : selected.length) > 0 && SELECTED, onSelectedEdit && selected.length === 1 ? /*#__PURE__*/React.createElement(Tooltip, {
31845
- text: "Edit Selected",
31846
- placement: "bottom",
31847
- font: 0.8,
31848
- px: 0.6,
31849
- py: 0.4,
31850
- type: "dark"
31851
- }, /*#__PURE__*/React.createElement(Button, {
31852
- onClick: function onClick() {
31853
- return onSelectedEdit(selected[0]);
31316
+ secondary: {
31317
+ bg: palette.foreground,
31318
+ border: palette.foreground,
31319
+ color: palette.background
31854
31320
  },
31855
- iconRight: /*#__PURE__*/React.createElement(Edit, null),
31856
- auto: true,
31857
- type: "button",
31858
- scale: 2 / 3,
31859
- px: 0.6
31860
- })) : null, onSelectedDelete && selected.length > 1 ? /*#__PURE__*/React.createElement(Tooltip, {
31861
- text: "Delete Selected",
31862
- placement: "bottom",
31863
- font: 0.8,
31864
- px: 0.6,
31865
- py: 0.4,
31866
- type: "dark"
31867
- }, /*#__PURE__*/React.createElement(Button, {
31868
- onClick: function onClick() {
31869
- return onSelectedDelete(selected);
31321
+ success: {
31322
+ bg: palette.success,
31323
+ border: palette.success,
31324
+ color: '#fff'
31870
31325
  },
31871
- auto: true,
31872
- scale: 2 / 3,
31873
- px: 0.6,
31874
- type: "button",
31875
- iconRight: /*#__PURE__*/React.createElement(Delete$1, null)
31876
- })) : null, onRefresh ? /*#__PURE__*/React.createElement(Tooltip, {
31877
- text: "Refresh",
31878
- placement: "bottom",
31879
- font: 0.8,
31880
- px: 0.6,
31881
- py: 0.4,
31882
- type: "dark"
31883
- }, /*#__PURE__*/React.createElement(Button, {
31884
- type: "button",
31885
- onClick: function onClick() {
31886
- return onRefresh();
31326
+ warning: {
31327
+ bg: palette.warning,
31328
+ border: palette.warning,
31329
+ color: '#fff'
31887
31330
  },
31888
- auto: true,
31889
- scale: 2 / 3,
31890
- px: 0.6,
31891
- iconRight: /*#__PURE__*/React.createElement(Refresh$1, null)
31892
- })) : null, _onFilters && filter ? /*#__PURE__*/React.createElement(Tooltip, {
31893
- text: "Columns",
31894
- placement: "bottomEnd",
31895
- font: 0.8,
31896
- px: 0.6,
31897
- py: 0.4,
31898
- type: "dark"
31899
- }, /*#__PURE__*/React.createElement(Button, {
31900
- type: "button",
31901
- onClick: handleShowFilter,
31902
- auto: true,
31903
- scale: 2 / 3,
31904
- px: 0.6,
31905
- iconRight: /*#__PURE__*/React.createElement(Filters, null)
31906
- })) : null, !disableViewColumn && /*#__PURE__*/React.createElement(Tooltip, {
31907
- text: "Columns",
31908
- placement: "bottomEnd",
31909
- font: 0.8,
31910
- px: 0.6,
31911
- py: 0.4,
31912
- type: "dark"
31913
- }, /*#__PURE__*/React.createElement(Popover, {
31914
- disableItemsAutoClose: true,
31915
- placement: "bottomEnd",
31916
- child: content
31917
- }, /*#__PURE__*/React.createElement(Button, {
31918
- type: "button",
31919
- onClick: function onClick() {},
31920
- auto: true,
31921
- scale: 2 / 3,
31922
- px: 0.6,
31923
- iconRight: /*#__PURE__*/React.createElement(Columns$1, null)
31924
- })))) : null))), children ? /*#__PURE__*/React.createElement("div", {
31925
- style: {
31926
- padding: '1rem'
31331
+ error: {
31332
+ bg: palette.error,
31333
+ border: palette.error,
31334
+ color: '#fff'
31335
+ },
31336
+ abort: {
31337
+ bg: 'transparent',
31338
+ border: 'transparent',
31339
+ color: palette.accents_5
31927
31340
  }
31928
- }, children) : /*#__PURE__*/React.createElement("div", {
31929
- style: {
31930
- gap: 5,
31931
- display: 'flex',
31932
- flexDirection: sideMenu ? 'row' : 'column'
31341
+ };
31342
+ if (disabled) return {
31343
+ bg: palette.accents_1,
31344
+ border: palette.accents_2,
31345
+ color: '#ccc'
31346
+ };
31347
+
31348
+ /**
31349
+ * The '-light' type is the same color as the common type,
31350
+ * only hover's color is different.
31351
+ * e.g.
31352
+ * Color['success'] === Color['success-light']
31353
+ * Color['warning'] === Color['warning-light']
31354
+ */
31355
+ var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
31356
+ var defaultColor = colors["default"];
31357
+ if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
31358
+ return colors[withoutLightType] || defaultColor;
31359
+ };
31360
+ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
31361
+ var colors = {
31362
+ secondary: {
31363
+ bg: palette.foreground,
31364
+ border: palette.background,
31365
+ color: palette.background
31366
+ },
31367
+ success: {
31368
+ bg: palette.success,
31369
+ border: palette.background,
31370
+ color: 'white'
31371
+ },
31372
+ warning: {
31373
+ bg: palette.warning,
31374
+ border: palette.background,
31375
+ color: 'white'
31376
+ },
31377
+ error: {
31378
+ bg: palette.error,
31379
+ border: palette.background,
31380
+ color: 'white'
31933
31381
  }
31934
- }, sideMenu ? /*#__PURE__*/React.createElement(GridContainer, {
31935
- direction: "column",
31936
- style: {
31937
- width: '15rem',
31938
- gap: 5,
31939
- padding: '0.5rem 0.7rem',
31940
- border: '1px solid #cfcfcf',
31941
- borderRadius: '5px'
31942
- }
31943
- }, sideMenu) : null, /*#__PURE__*/React.createElement("div", {
31944
- onDragOver: onDragOver,
31945
- onDragEnter: onDragEnter,
31946
- onDragLeave: onDragLeave,
31947
- onDrop: onDrop,
31948
- id: TABLE_ID,
31949
- className: "helpdice-ui-table-container",
31950
- style: _objectSpread2({
31951
- position: 'relative',
31952
- overflowY: 'auto',
31953
- maxWidth: 'calc(100vw - 1.5rem)',
31954
- width: sideMenu ? 'calc(100vw - 17.2rem)' : 'inherit !important'
31955
- }, style)
31956
- }, /*#__PURE__*/React.createElement(Table, {
31957
- stickyHeader: stickyHeader,
31958
- readOnly: readOnly,
31959
- cursorPagination: cursorPagination,
31960
- previousCursor: previousCursor,
31961
- nextCursor: nextCursor,
31962
- hasMore: hasMore,
31963
- onNextPage: onNextPage,
31964
- onPreviousPage: onPreviousPage,
31965
- dataLength: dataLength,
31966
- viewLength: viewLength,
31967
- onPageChange: function onPageChange(page, start, end) {
31968
- if (_onPageChange) {
31969
- _onPageChange(page, start, end);
31970
- }
31382
+ };
31383
+ var withoutLightType = _color === null || _color === void 0 ? void 0 : _color.replace('-light', '');
31384
+ return colors[withoutLightType] || null;
31385
+ };
31386
+ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
31387
+ var color = props.color,
31388
+ disabled = props.disabled,
31389
+ loading = props.loading,
31390
+ shadow = props.shadow,
31391
+ ghost = props.ghost;
31392
+ var defaultColor = getButtonColors(palette, props);
31393
+ var alphaBackground = addColorAlpha(defaultColor.bg, 0.85);
31394
+ var colors = {
31395
+ "default": {
31396
+ bg: palette.background,
31397
+ border: palette.foreground
31971
31398
  },
31972
- onFilters: function onFilters(filters) {
31973
- if (_onFilters) {
31974
- _onFilters(filters);
31975
- }
31399
+ secondary: {
31400
+ bg: palette.background,
31401
+ border: palette.foreground
31976
31402
  },
31977
- onRow: onRowClick,
31978
- rowDraggable: rowDraggable,
31979
- showFilters: openFilter,
31980
- onSelected: function onSelected(selected) {
31981
- return setSelected(selected);
31403
+ success: {
31404
+ bg: palette.background,
31405
+ border: palette.success
31982
31406
  },
31983
- data: rows,
31984
- style: {
31985
- borderCollapse: 'collapse',
31986
- overflow: 'auto'
31987
- }
31988
- }, COLUMNS.map(function (column) {
31989
- return /*#__PURE__*/React.createElement(Table.Column, {
31990
- style: column === null || column === void 0 ? void 0 : column.style,
31991
- options: column === null || column === void 0 ? void 0 : column.options,
31992
- fontSize: column === null || column === void 0 ? void 0 : column.fontSize,
31993
- prop: column.id,
31994
- label: column.name,
31995
- filter: column === null || column === void 0 ? void 0 : column.filter,
31996
- noWrap: column === null || column === void 0 ? void 0 : column.noWrap,
31997
- align: column === null || column === void 0 ? void 0 : column.align
31998
- });
31999
- })))));
32000
- }
32001
- var DataTable$1 = /*#__PURE__*/React.memo(DataTable);
31407
+ warning: {
31408
+ bg: palette.background,
31409
+ border: palette.warning
31410
+ },
31411
+ error: {
31412
+ bg: palette.background,
31413
+ border: palette.error
31414
+ },
31415
+ abort: {
31416
+ bg: 'transparent',
31417
+ border: 'transparent',
31418
+ color: palette.accents_5
31419
+ },
31420
+ 'secondary-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
31421
+ bg: alphaBackground
31422
+ }),
31423
+ 'success-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
31424
+ bg: alphaBackground
31425
+ }),
31426
+ 'warning-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
31427
+ bg: alphaBackground
31428
+ }),
31429
+ 'error-light': _objectSpread2(_objectSpread2({}, defaultColor), {}, {
31430
+ bg: alphaBackground
31431
+ })
31432
+ };
31433
+ if (disabled) return {
31434
+ bg: palette.accents_1,
31435
+ border: palette.accents_2,
31436
+ color: '#ccc'
31437
+ };
31438
+ if (loading) return _objectSpread2(_objectSpread2({}, defaultColor), {}, {
31439
+ color: 'transparent'
31440
+ });
31441
+ if (shadow) return defaultColor;
31442
+ var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
31443
+ return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
31444
+ color: hoverColor.color || hoverColor.border
31445
+ });
31446
+ };
31447
+ var getButtonCursor = function getButtonCursor(disabled, loading) {
31448
+ if (disabled) return {
31449
+ cursor: 'not-allowed',
31450
+ events: 'auto'
31451
+ };
31452
+ if (loading) return {
31453
+ cursor: 'default',
31454
+ events: 'none'
31455
+ };
31456
+ return {
31457
+ cursor: 'pointer',
31458
+ events: 'auto'
31459
+ };
31460
+ };
31461
+ var getButtonDripColor = function getButtonDripColor(palette, props) {
31462
+ var type = props.type;
31463
+ var isLightHover = type ? type.endsWith('light') : false;
31464
+ var hoverColors = getButtonHoverColors(palette, props);
31465
+ return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
31466
+ };
32002
31467
 
32003
- var TableBody = function TableBody(_ref) {
32004
- var data = _ref.data,
32005
- emptyText = _ref.emptyText,
32006
- onRow = _ref.onRow,
32007
- onCell = _ref.onCell,
32008
- rowClassName = _ref.rowClassName,
32009
- textPlaceholder = _ref.textPlaceholder,
32010
- _ref$rowDraggable = _ref.rowDraggable,
32011
- rowDraggable = _ref$rowDraggable === void 0 ? false : _ref$rowDraggable,
32012
- _ref$readOnly = _ref.readOnly,
32013
- readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
32014
- onSelected = _ref.onSelected;
31468
+ var _excluded$2 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
31469
+ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
32015
31470
  var theme = useTheme();
32016
- var _useState = React.useState([]),
32017
- _useState2 = _slicedToArray(_useState, 2),
32018
- selected = _useState2[0],
32019
- setSelected = _useState2[1];
32020
- var _useTableContext = useTableContext(),
32021
- columns = _useTableContext.columns;
32022
- // const rowClickHandler = (row: TableDataItem, index: number) => {
32023
- // onRow && onRow(row, index)
32024
- // }
32025
-
32026
- var handleClick = function handleClick(_event, id) {
32027
- if (readOnly) {
32028
- return true;
32029
- }
32030
- var selectedIndex = selected.indexOf(id);
32031
- var newSelected = [];
32032
- if (selectedIndex === -1) {
32033
- newSelected = newSelected.concat(selected, id);
32034
- } else if (selectedIndex === 0) {
32035
- newSelected = newSelected.concat(selected.slice(1));
32036
- } else if (selectedIndex === selected.length - 1) {
32037
- newSelected = newSelected.concat(selected.slice(0, -1));
32038
- } else if (selectedIndex > 0) {
32039
- newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
32040
- }
32041
- setSelected(newSelected);
32042
- if (newSelected.length > 0 && onSelected) {
32043
- onSelected(newSelected);
32044
- }
32045
- };
31471
+ var _useScale = useScale(),
31472
+ SCALES = _useScale.SCALES;
31473
+ var buttonRef = React.useRef(null);
31474
+ React.useImperativeHandle(ref, function () {
31475
+ return buttonRef.current;
31476
+ }); // Changed with !
32046
31477
 
32047
- // const handleSelectAllClick = (event: { target: { checked: any } }) => {
32048
- // if (event.target.checked) {
32049
- // const newSelecteds = data.map((n: any) => n._id);
32050
- // setSelected(newSelecteds as never[]);
32051
- // return;
32052
- // }
32053
- // setSelected([]);
32054
- // };
31478
+ var _useState = React.useState(false),
31479
+ _useState2 = _slicedToArray(_useState, 2),
31480
+ dripShow = _useState2[0],
31481
+ setDripShow = _useState2[1];
31482
+ var _useState3 = React.useState(0),
31483
+ _useState4 = _slicedToArray(_useState3, 2),
31484
+ dripX = _useState4[0],
31485
+ setDripX = _useState4[1];
31486
+ var _useState5 = React.useState(0),
31487
+ _useState6 = _slicedToArray(_useState5, 2),
31488
+ dripY = _useState6[0],
31489
+ setDripY = _useState6[1];
31490
+ var groupConfig = useButtonGroupContext();
31491
+ var filteredProps = filterPropsWithGroup(btnProps, groupConfig);
31492
+ /* eslint-disable @typescript-eslint/no-unused-vars */
31493
+ var children = filteredProps.children,
31494
+ _filteredProps$disabl = filteredProps.disabled,
31495
+ disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
31496
+ filteredProps.color;
31497
+ var _filteredProps$loadin = filteredProps.loading,
31498
+ loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
31499
+ _filteredProps$shadow = filteredProps.shadow,
31500
+ shadow = _filteredProps$shadow === void 0 ? false : _filteredProps$shadow,
31501
+ _filteredProps$ghost = filteredProps.ghost,
31502
+ ghost = _filteredProps$ghost === void 0 ? false : _filteredProps$ghost,
31503
+ _filteredProps$effect = filteredProps.effect,
31504
+ effect = _filteredProps$effect === void 0 ? true : _filteredProps$effect,
31505
+ _filteredProps$round = filteredProps.round,
31506
+ round = _filteredProps$round === void 0 ? false : _filteredProps$round,
31507
+ onClick = filteredProps.onClick,
31508
+ _filteredProps$auto = filteredProps.auto,
31509
+ auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
31510
+ icon = filteredProps.icon,
31511
+ _filteredProps$type = filteredProps.type,
31512
+ type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
31513
+ iconRight = filteredProps.iconRight,
31514
+ _filteredProps$classN = filteredProps.className,
31515
+ className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
31516
+ filteredProps.crossOrigin;
31517
+ var props = _objectWithoutProperties(filteredProps, _excluded$2);
31518
+ /* eslint-enable @typescript-eslint/no-unused-vars */
32055
31519
 
32056
- // Push Selected Rows
32057
- // const SELECTED = useMemo(() => {
32058
- // if (selected.length > 0 && onSelected) {
32059
- // return onSelected(selected);
32060
- // }
32061
- // return <></>;
32062
- // }, [selected]);
31520
+ var _useMemo = React.useMemo(function () {
31521
+ return getButtonColors(theme.palette, filteredProps);
31522
+ }, [theme.palette, filteredProps]),
31523
+ bg = _useMemo.bg,
31524
+ border = _useMemo.border,
31525
+ color = _useMemo.color;
31526
+ var hover = React.useMemo(function () {
31527
+ return getButtonHoverColors(theme.palette, filteredProps);
31528
+ }, [theme.palette, filteredProps]);
31529
+ var _useMemo2 = React.useMemo(function () {
31530
+ return getButtonCursor(disabled, loading);
31531
+ }, [disabled, loading]),
31532
+ cursor = _useMemo2.cursor,
31533
+ events = _useMemo2.events;
31534
+ var dripColor = React.useMemo(function () {
31535
+ return getButtonDripColor(theme.palette, filteredProps);
31536
+ }, [theme.palette, filteredProps]);
32063
31537
 
32064
- function renderRow(cols, row, index) {
32065
- var _row$style;
32066
- var urid = _.uniqueId();
32067
- var className = rowClassName(row, index);
32068
- var rw = _objectSpread2({}, row);
32069
- var rowStyle = (_row$style = row === null || row === void 0 ? void 0 : row.style) !== null && _row$style !== void 0 ? _row$style : {};
32070
- var onDragStart = row === null || row === void 0 ? void 0 : row.onDragStart;
32071
- delete rw.table;
32072
- delete rw.style;
32073
- delete rw.onDragStart;
32074
- // console.log(row);
32075
- // const frow = Object.fromEntries(
32076
- // Object.entries(row).filter(([ky, _]) => ky !== '_id' && cols.map((col: any) => col.id).includes(ky))
32077
- // ) as unknown as TableDataItem
32078
- // console.log(frow);
32079
- var isRowSelected = selected.indexOf(row) !== -1;
32080
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("tr", {
32081
- draggable: rowDraggable,
32082
- role: "checkbox",
32083
- onDragStart: onDragStart,
32084
- "aria-checked": selected.indexOf(row) !== -1,
32085
- tabIndex: -1,
32086
- key: urid,
32087
- style: _objectSpread2({
32088
- cursor: 'pointer',
32089
- backgroundColor: isRowSelected ? '#efefef' : ''
32090
- }, rowStyle),
32091
- onClick: function onClick(e) {
32092
- if (!rowDraggable) {
32093
- if (onRow) {
32094
- onRow(row, index);
32095
- } else {
32096
- handleClick(e, row);
32097
- }
32098
- }
32099
- },
32100
- className: _JSXStyle.dynamic([["787902152", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]]) + " " + (useClasses("".concat(rowDraggable ? 'draggable' : 'hover', " ").concat(className)) || "")
32101
- }, /*#__PURE__*/React.createElement(TableCell, {
32102
- columns: cols,
32103
- row: rw,
32104
- rowIndex: index,
32105
- emptyText: emptyText,
32106
- onCellClick: onCell
32107
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
32108
- id: "787902152",
32109
- dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
32110
- }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(2.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
32111
- }
32112
- if ((data === null || data === void 0 ? void 0 : data.length) === 0) {
32113
- return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
32114
- colSpan: columns === null || columns === void 0 ? void 0 : columns.length
32115
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Placeholder, {
32116
- empty: true,
32117
- textOnly: textPlaceholder,
32118
- msg: "No Entries Found"
32119
- })))));
32120
- }
32121
- return /*#__PURE__*/React.createElement("tbody", {
32122
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
32123
- }, data.map(function (row, index) {
32124
- var _row$table, _row$table2, _row$table3, _row$table4, _row$table5;
32125
- var qid = _.uniqueId();
32126
- if (row === null || row === undefined) {
32127
- var uid = _.uniqueId();
32128
- return /*#__PURE__*/React.createElement("tr", {
32129
- key: uid,
32130
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
32131
- }, /*#__PURE__*/React.createElement("td", {
32132
- colSpan: columns.length,
32133
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
32134
- }, "\u2003"));
31538
+ /* istanbul ignore next */
31539
+ var dripCompletedHandle = function dripCompletedHandle() {
31540
+ setDripShow(false);
31541
+ setDripX(0);
31542
+ setDripY(0);
31543
+ };
31544
+ var clickHandler = function clickHandler(event) {
31545
+ if (disabled || loading) return;
31546
+ var showDrip = !shadow && !ghost && effect;
31547
+ /* istanbul ignore next */
31548
+ if (showDrip && buttonRef.current) {
31549
+ var rect = buttonRef.current.getBoundingClientRect();
31550
+ setDripShow(true);
31551
+ setDripX(event.clientX - rect.left);
31552
+ setDripY(event.clientY - rect.top);
32135
31553
  }
32136
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderRow(columns, row, index), (row === null || row === void 0 ? void 0 : row.table) && /*#__PURE__*/React.createElement("tr", {
32137
- key: qid,
32138
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
32139
- }, /*#__PURE__*/React.createElement("td", {
32140
- style: {
32141
- padding: '1rem'
32142
- },
32143
- colSpan: columns.length,
32144
- className: _JSXStyle.dynamic([["1422656197", [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]]])
32145
- }, /*#__PURE__*/React.createElement(DataTable$1, {
32146
- readOnly: true,
32147
- stickyHeader: false,
32148
- style: _objectSpread2({
32149
- height: 'auto !important'
32150
- }, row === null || row === void 0 || (_row$table = row.table) === null || _row$table === void 0 ? void 0 : _row$table.style),
32151
- menu: (_row$table2 = row.table) === null || _row$table2 === void 0 ? void 0 : _row$table2.menu,
32152
- rows: (_row$table3 = row.table) === null || _row$table3 === void 0 ? void 0 : _row$table3.rows,
32153
- heading: (_row$table4 = row.table) === null || _row$table4 === void 0 ? void 0 : _row$table4.heading,
32154
- cols: (_row$table5 = row.table) === null || _row$table5 === void 0 ? void 0 : _row$table5.cols
32155
- }))));
32156
-
32157
- // return (
32158
- // <tr
32159
- // key={`tbody-row-${index}`}
32160
- // className={useClasses({ hover }, className)}
32161
- // onClick={() => rowClickHandler(row, index)}>
32162
- // <TableCell<TableDataItem>
32163
- // columns={columns}
32164
- // row={row}
32165
- // rowIndex={index}
32166
- // emptyText={emptyText}
32167
- // onCellClick={onCell}
32168
- // />
32169
- // </tr>
32170
- // )
31554
+ onClick && onClick(event);
31555
+ };
31556
+ var childrenWithIcon = React.useMemo(function () {
31557
+ return getButtonChildrenWithIcon(auto, children, {
31558
+ icon: icon,
31559
+ iconRight: iconRight
31560
+ });
31561
+ }, [auto, children, icon, iconRight]);
31562
+ var paddingLeft = auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
31563
+ paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
31564
+ return /*#__PURE__*/React.createElement("button", _extends({
31565
+ ref: buttonRef,
31566
+ type: type,
31567
+ disabled: disabled,
31568
+ onClick: clickHandler
31569
+ }, props, {
31570
+ className: _JSXStyle.dynamic([["1558010596", [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']]]) + " " + (props && props.className != null && props.className || useClasses('btn', className) || "")
31571
+ }), loading && /*#__PURE__*/React.createElement(ButtonLoading, {
31572
+ color: color
31573
+ }), childrenWithIcon, dripShow && /*#__PURE__*/React.createElement(ButtonDrip, {
31574
+ x: dripX,
31575
+ y: dripY,
31576
+ color: dripColor,
31577
+ onCompleted: dripCompletedHandle
32171
31578
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
32172
- id: "1422656197",
32173
- dynamic: [theme.palette.accents_1, theme.palette.border, theme.palette.accents_6]
32174
- }, "tr.__jsx-style-dynamic-selector{-webkit-transition:background-color 0.25s ease;transition:background-color 0.25s ease;font-size:inherit;}tr.hover.__jsx-style-dynamic-selector:hover{background-color:".concat(theme.palette.accents_1, ";}tr.draggable.__jsx-style-dynamic-selector:hover{border:2px dashed #dfdfdf;margin:3px;}tr.__jsx-style-dynamic-selector td{padding:0 0.5em;border-bottom:1px solid ").concat(theme.palette.border, ";color:").concat(theme.palette.accents_6, ";font-size:calc(0.875 * var(--table-font-size));text-align:left;}tr.__jsx-style-dynamic-selector .cell{min-height:calc(3.125 * var(--table-font-size));display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;}")));
32175
- };
32176
- TableBody.displayName = 'TableBody';
31579
+ id: "1558010596",
31580
+ dynamic: [SCALES.height(2.5), round ? '50%' : theme.layout.radius, SCALES.font(0.875), color, bg, border, cursor, events, shadow ? theme.expressiveness.shadowSmall : '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, shadow ? theme.expressiveness.shadowMedium : 'none', shadow ? '-1px' : '0px']
31581
+ }, ".btn.__jsx-style-dynamic-selector{box-sizing:border-box;display:inline-block;line-height:".concat(SCALES.height(2.5), ";border-radius:").concat(round ? '50%' : theme.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(border, ";cursor:").concat(cursor, ";pointer-events:").concat(events, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : '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(shadow ? theme.expressiveness.shadowMedium : 'none', ";-webkit-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);-ms-transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);transform:translate3d(0px,").concat(shadow ? '-1px' : '0px', ",0px);}.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;}")));
31582
+ });
31583
+ ButtonComponent.displayName = 'Button';
31584
+ var Button = withScale(ButtonComponent);
32177
31585
 
32178
- var getRealShape = function getRealShape(el) {
32179
- var defaultShape = {
32180
- width: 0,
32181
- height: 0
32182
- };
32183
- if (!el || typeof window === 'undefined') return defaultShape;
32184
- var rect = el.getBoundingClientRect();
32185
- var _window$getComputedSt = window.getComputedStyle(el),
32186
- width = _window$getComputedSt.width,
32187
- height = _window$getComputedSt.height;
32188
- var getCSSStyleVal = function getCSSStyleVal(str, parentNum) {
32189
- if (!str) return 0;
32190
- var strVal = str.includes('px') ? +str.split('px')[0] : str.includes('%') ? +str.split('%')[0] * parentNum * 0.01 : str;
32191
- return Number.isNaN(+strVal) ? 0 : +strVal;
31586
+ var getColors = function getColors(type, palette) {
31587
+ var colors = {
31588
+ "default": palette.background,
31589
+ success: palette.success,
31590
+ warning: palette.warning,
31591
+ error: palette.error,
31592
+ secondary: palette.secondary,
31593
+ dark: palette.foreground,
31594
+ lite: palette.background
32192
31595
  };
31596
+ var color = type === 'lite' || type === 'default' ? palette.foreground : palette.background;
32193
31597
  return {
32194
- width: getCSSStyleVal("".concat(width), rect.width),
32195
- height: getCSSStyleVal("".concat(height), rect.height)
31598
+ color: color,
31599
+ bgColor: colors[type]
32196
31600
  };
32197
31601
  };
32198
- var useRealShape = function useRealShape(ref) {
32199
- var _useState = React.useState({
32200
- width: 0,
32201
- height: 0
32202
- }),
32203
- _useState2 = _slicedToArray(_useState, 2),
32204
- state = _useState2[0],
32205
- setState = _useState2[1];
32206
- var update = function update() {
32207
- var _getRealShape = getRealShape(ref.current),
32208
- width = _getRealShape.width,
32209
- height = _getRealShape.height;
32210
- setState({
32211
- width: width,
32212
- height: height
32213
- });
31602
+
31603
+ var defaultTooltipPosition = {
31604
+ top: '-1000px',
31605
+ left: '-1000px',
31606
+ transform: 'none'
31607
+ };
31608
+ var getPosition = function getPosition(placement, rect, offset) {
31609
+ var positions = {
31610
+ top: {
31611
+ top: "".concat(rect.top - offset, "px"),
31612
+ left: "".concat(rect.left + rect.width / 2, "px"),
31613
+ transform: 'translate(-50%, -100%)'
31614
+ },
31615
+ topStart: {
31616
+ top: "".concat(rect.top - offset, "px"),
31617
+ left: "".concat(rect.left, "px"),
31618
+ transform: 'translate(0, -100%)'
31619
+ },
31620
+ topEnd: {
31621
+ top: "".concat(rect.top - offset, "px"),
31622
+ left: "".concat(rect.left + rect.width, "px"),
31623
+ transform: 'translate(-100%, -100%)'
31624
+ },
31625
+ bottom: {
31626
+ top: "".concat(rect.bottom + offset, "px"),
31627
+ left: "".concat(rect.left + rect.width / 2, "px"),
31628
+ transform: 'translate(-50%, 0)'
31629
+ },
31630
+ bottomStart: {
31631
+ top: "".concat(rect.bottom + offset, "px"),
31632
+ left: "".concat(rect.left, "px"),
31633
+ transform: 'translate(0, 0)'
31634
+ },
31635
+ bottomEnd: {
31636
+ top: "".concat(rect.bottom + offset, "px"),
31637
+ left: "".concat(rect.left + rect.width, "px"),
31638
+ transform: 'translate(-100%, 0)'
31639
+ },
31640
+ left: {
31641
+ top: "".concat(rect.top + rect.height / 2, "px"),
31642
+ left: "".concat(rect.left - offset, "px"),
31643
+ transform: 'translate(-100%, -50%)'
31644
+ },
31645
+ leftStart: {
31646
+ top: "".concat(rect.top, "px"),
31647
+ left: "".concat(rect.left - offset, "px"),
31648
+ transform: 'translate(-100%, 0)'
31649
+ },
31650
+ leftEnd: {
31651
+ top: "".concat(rect.top + rect.height, "px"),
31652
+ left: "".concat(rect.left - offset, "px"),
31653
+ transform: 'translate(-100%, -100%)'
31654
+ },
31655
+ right: {
31656
+ top: "".concat(rect.top + rect.height / 2, "px"),
31657
+ left: "".concat(rect.right + offset, "px"),
31658
+ transform: 'translate(0, -50%)'
31659
+ },
31660
+ rightStart: {
31661
+ top: "".concat(rect.top, "px"),
31662
+ left: "".concat(rect.right + offset, "px"),
31663
+ transform: 'translate(0, 0)'
31664
+ },
31665
+ rightEnd: {
31666
+ top: "".concat(rect.top + rect.height, "px"),
31667
+ left: "".concat(rect.right + offset, "px"),
31668
+ transform: 'translate(0, -100%)'
31669
+ }
32214
31670
  };
32215
- React.useEffect(function () {
32216
- return update();
32217
- }, [ref.current]);
32218
- return [state, update];
31671
+ return positions[placement] || positions.top;
32219
31672
  };
32220
-
32221
- /* "use client" */
32222
-
32223
- var TableColumn = function TableColumn(columnProps) {
32224
- var _ref = columnProps,
32225
- children = _ref.children,
32226
- prop = _ref.prop,
32227
- label = _ref.label,
32228
- width = _ref.width,
32229
- filter = _ref.filter,
32230
- options = _ref.options,
32231
- noWrap = _ref.noWrap,
32232
- align = _ref.align,
32233
- style = _ref.style,
32234
- color = _ref.color,
32235
- _ref$fontSize = _ref.fontSize,
32236
- fontSize = _ref$fontSize === void 0 ? 'smaller' : _ref$fontSize,
32237
- _ref$className = _ref.className,
32238
- className = _ref$className === void 0 ? '' : _ref$className,
32239
- renderHandler = _ref.render;
32240
- var _useTableContext = useTableContext(),
32241
- updateColumn = _useTableContext.updateColumn;
32242
- var safeProp = "".concat(prop.toString()).trim();
32243
- if (!safeProp) {
32244
- useWarning('The props "prop" is required.', 'Table.Column');
32245
- }
32246
- React.useEffect(function () {
32247
- updateColumn({
32248
- label: children || label,
32249
- filter: filter,
32250
- noWrap: noWrap,
32251
- options: options,
32252
- prop: safeProp,
32253
- width: width,
32254
- color: color,
32255
- align: align,
32256
- fontSize: fontSize,
32257
- className: className,
32258
- style: style,
32259
- renderHandler: function renderHandler() {}
32260
- });
32261
- }, [children, noWrap, color, style, fontSize, align, filter, options, label, prop, width, className, renderHandler]);
32262
- return null;
31673
+ var getIconPosition = function getIconPosition(placement, offsetX, offsetY) {
31674
+ var offsetAbsolute = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '3px';
31675
+ var positions = {
31676
+ top: {
31677
+ top: 'auto',
31678
+ right: 'auto',
31679
+ left: '50%',
31680
+ bottom: "".concat(offsetAbsolute),
31681
+ transform: 'translate(-50%, 100%) rotate(-90deg)'
31682
+ },
31683
+ topStart: {
31684
+ top: 'auto',
31685
+ right: 'auto',
31686
+ left: "".concat(offsetX),
31687
+ bottom: "".concat(offsetAbsolute),
31688
+ transform: 'translate(0, 100%) rotate(-90deg)'
31689
+ },
31690
+ topEnd: {
31691
+ top: 'auto',
31692
+ right: "".concat(offsetX),
31693
+ left: 'auto',
31694
+ bottom: "".concat(offsetAbsolute),
31695
+ transform: 'translate(0, 100%) rotate(-90deg)'
31696
+ },
31697
+ bottom: {
31698
+ top: "".concat(offsetAbsolute),
31699
+ right: 'auto',
31700
+ left: '50%',
31701
+ bottom: 'auto',
31702
+ transform: 'translate(-50%, -100%) rotate(90deg)'
31703
+ },
31704
+ bottomStart: {
31705
+ top: "".concat(offsetAbsolute),
31706
+ right: 'auto',
31707
+ left: "".concat(offsetX),
31708
+ bottom: 'auto',
31709
+ transform: 'translate(0, -100%) rotate(90deg)'
31710
+ },
31711
+ bottomEnd: {
31712
+ top: "".concat(offsetAbsolute),
31713
+ right: "".concat(offsetX),
31714
+ left: 'auto',
31715
+ bottom: 'auto',
31716
+ transform: 'translate(0, -100%) rotate(90deg)'
31717
+ },
31718
+ left: {
31719
+ top: '50%',
31720
+ right: '0',
31721
+ left: 'auto',
31722
+ bottom: 'auto',
31723
+ transform: 'translate(100%, -50%) rotate(180deg)'
31724
+ },
31725
+ leftStart: {
31726
+ top: "".concat(offsetY),
31727
+ right: '0',
31728
+ left: 'auto',
31729
+ bottom: 'auto',
31730
+ transform: 'translate(100%, -50%) rotate(180deg)'
31731
+ },
31732
+ leftEnd: {
31733
+ top: 'auto',
31734
+ right: '0',
31735
+ left: 'auto',
31736
+ bottom: "".concat(offsetY),
31737
+ transform: 'translate(100%, 50%) rotate(180deg)'
31738
+ },
31739
+ right: {
31740
+ top: '50%',
31741
+ right: 'auto',
31742
+ left: '0',
31743
+ bottom: 'auto',
31744
+ transform: 'translate(-100%, -50%) rotate(0deg)'
31745
+ },
31746
+ rightStart: {
31747
+ top: "".concat(offsetY),
31748
+ right: 'auto',
31749
+ left: '0',
31750
+ bottom: 'auto',
31751
+ transform: 'translate(-100%, -50%) rotate(0deg)'
31752
+ },
31753
+ rightEnd: {
31754
+ top: 'auto',
31755
+ right: 'auto',
31756
+ left: '0',
31757
+ bottom: "".concat(offsetY),
31758
+ transform: 'translate(-100%, 50%) rotate(0deg)'
31759
+ }
31760
+ };
31761
+ return positions[placement] || positions.top;
32263
31762
  };
32264
- TableColumn.displayName = 'TableColumn';
32265
31763
 
32266
- var _excluded$4 = ["active", "children", "disabled", "onClick"];
32267
- var PaginationItem = function PaginationItem(_ref) {
32268
- var active = _ref.active,
32269
- children = _ref.children,
32270
- disabled = _ref.disabled,
32271
- onClick = _ref.onClick,
32272
- props = _objectWithoutProperties(_ref, _excluded$4);
31764
+ var TooltipIcon = function TooltipIcon(_ref) {
31765
+ var placement = _ref.placement,
31766
+ shadow = _ref.shadow;
32273
31767
  var theme = useTheme();
32274
31768
  var _useMemo = React.useMemo(function () {
32275
- return [addColorAlpha(theme.palette.success, 0.1), addColorAlpha(theme.palette.success, 0.8)];
32276
- }, [theme.palette.success]),
32277
- _useMemo2 = _slicedToArray(_useMemo, 2),
32278
- hover = _useMemo2[0],
32279
- activeHover = _useMemo2[1];
32280
- var classes = useClasses({
32281
- active: active,
32282
- disabled: disabled
32283
- });
32284
- var clickHandler = function clickHandler(event) {
32285
- if (disabled) return;
32286
- onClick && onClick(event);
32287
- };
32288
- return /*#__PURE__*/React.createElement("li", {
32289
- className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]])
32290
- }, /*#__PURE__*/React.createElement("button", _extends({
32291
- onClick: clickHandler
32292
- }, props, {
32293
- className: _JSXStyle.dynamic([["1657796974", [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || "")
32294
- }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
32295
- id: "1657796974",
32296
- dynamic: [theme.palette.success, theme.layout.radius, theme.palette.background, hover, theme.palette.success, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
32297
- }, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border: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;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.success, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.success, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
31769
+ return getIconPosition(placement, 'var(--tooltip-icon-offset-x)', 'var(--tooltip-icon-offset-y)');
31770
+ }, [placement]),
31771
+ transform = _useMemo.transform,
31772
+ top = _useMemo.top,
31773
+ left = _useMemo.left,
31774
+ right = _useMemo.right,
31775
+ bottom = _useMemo.bottom;
31776
+ var bgColorWithDark = React.useMemo(function () {
31777
+ if (!shadow || theme.type !== 'dark') return 'var(--tooltip-content-bg)';
31778
+ return theme.palette.accents_2;
31779
+ }, [theme.type, shadow]);
31780
+ return /*#__PURE__*/React.createElement("span", {
31781
+ className: _JSXStyle.dynamic([["2440507693", [bgColorWithDark, left, top, right, bottom, transform]]])
31782
+ }, /*#__PURE__*/React.createElement(_JSXStyle, {
31783
+ id: "2440507693",
31784
+ dynamic: [bgColorWithDark, left, top, right, bottom, transform]
31785
+ }, "span.__jsx-style-dynamic-selector{width:0;height:0;border-style:solid;border-width:6px 7px 6px 0;border-color:transparent ".concat(bgColorWithDark, " transparent transparent;position:absolute;left:").concat(left, ";top:").concat(top, ";right:").concat(right, ";bottom:").concat(bottom, ";-webkit-transform:").concat(transform, ";-ms-transform:").concat(transform, ";transform:").concat(transform, ";}")));
32298
31786
  };
32299
- PaginationItem.displayName = 'PaginationItem';
32300
-
32301
- /* "use client" */
32302
31787
 
32303
- tuple('prev', 'next', 'click');
32304
- var defaultContext = {};
32305
- var PaginationContext = /*#__PURE__*/React.createContext(defaultContext);
32306
- var usePaginationContext = function usePaginationContext() {
32307
- return React.useContext(PaginationContext);
31788
+ var defaultRect = {
31789
+ top: -1e3,
31790
+ left: -1e3,
31791
+ right: -1e3,
31792
+ bottom: -1e3,
31793
+ width: 0,
31794
+ height: 0
32308
31795
  };
32309
-
32310
- var _excluded$3 = ["children"];
32311
- var PaginationPrevious = function PaginationPrevious(_ref) {
32312
- var children = _ref.children,
32313
- props = _objectWithoutProperties(_ref, _excluded$3);
32314
- var _usePaginationContext = usePaginationContext(),
32315
- update = _usePaginationContext.update,
32316
- isFirst = _usePaginationContext.isFirst;
32317
- return /*#__PURE__*/React.createElement(PaginationItem, _extends({
32318
- onClick: function onClick() {
32319
- return update && update('prev');
32320
- },
32321
- disabled: isFirst
32322
- }, props), children);
31796
+ var getRect = function getRect(ref) {
31797
+ if (!ref || !ref.current) return defaultRect;
31798
+ var rect = ref.current.getBoundingClientRect();
31799
+ return _objectSpread2(_objectSpread2({}, rect), {}, {
31800
+ width: rect.width || rect.right - rect.left,
31801
+ height: rect.height || rect.bottom - rect.top,
31802
+ top: rect.top + document.documentElement.scrollTop,
31803
+ bottom: rect.bottom + document.documentElement.scrollTop,
31804
+ left: rect.left + document.documentElement.scrollLeft,
31805
+ right: rect.right + document.documentElement.scrollLeft
31806
+ });
32323
31807
  };
32324
- PaginationPrevious.displayName = 'PaginationPrevious';
32325
31808
 
32326
- var _excluded$2 = ["children"];
32327
- var PaginationNext = function PaginationNext(_ref) {
31809
+ var TooltipContent = function TooltipContent(_ref) {
32328
31810
  var children = _ref.children,
32329
- props = _objectWithoutProperties(_ref, _excluded$2);
32330
- var _usePaginationContext = usePaginationContext(),
32331
- update = _usePaginationContext.update,
32332
- isLast = _usePaginationContext.isLast;
32333
- return /*#__PURE__*/React.createElement(PaginationItem, _extends({
32334
- onClick: function onClick() {
32335
- return update && update('next');
32336
- },
32337
- disabled: isLast
32338
- }, props), children);
32339
- };
32340
- PaginationNext.displayName = 'PaginationNext';
32341
-
32342
- var PaginationEllipsis = function PaginationEllipsis(_ref) {
32343
- var isBefore = _ref.isBefore,
32344
- _onClick = _ref.onClick;
32345
- var _useState = React.useState(false),
31811
+ parent = _ref.parent,
31812
+ visible = _ref.visible,
31813
+ offset = _ref.offset,
31814
+ iconOffset = _ref.iconOffset,
31815
+ placement = _ref.placement,
31816
+ type = _ref.type,
31817
+ className = _ref.className,
31818
+ hideArrow = _ref.hideArrow;
31819
+ var theme = useTheme();
31820
+ var _useScale = useScale(),
31821
+ SCALES = _useScale.SCALES;
31822
+ var el = usePortal('tooltip');
31823
+ var selfRef = React.useRef(null);
31824
+ var _useState = React.useState(defaultTooltipPosition),
32346
31825
  _useState2 = _slicedToArray(_useState, 2),
32347
- showMore = _useState2[0],
32348
- setShowMore = _useState2[1];
32349
- return /*#__PURE__*/React.createElement(PaginationItem, {
32350
- onClick: function onClick(e) {
32351
- return _onClick && _onClick(e);
32352
- },
32353
- onMouseEnter: function onMouseEnter() {
32354
- return setShowMore(true);
32355
- },
32356
- onMouseLeave: function onMouseLeave() {
32357
- return setShowMore(false);
32358
- }
32359
- }, showMore ? /*#__PURE__*/React.createElement("svg", {
32360
- viewBox: "0 0 24 24",
32361
- stroke: "currentColor",
32362
- strokeWidth: "1.5",
32363
- strokeLinecap: "round",
32364
- strokeLinejoin: "round",
32365
- fill: "none",
32366
- shapeRendering: "geometricPrecision",
32367
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more"
32368
- }, /*#__PURE__*/React.createElement("path", {
32369
- d: "M13 17l5-5-5-5",
32370
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32371
- }), /*#__PURE__*/React.createElement("path", {
32372
- d: "M6 17l5-5-5-5",
32373
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32374
- })) : /*#__PURE__*/React.createElement("svg", {
32375
- viewBox: "0 0 24 24",
32376
- strokeWidth: "1.5",
32377
- strokeLinecap: "round",
32378
- strokeLinejoin: "round",
32379
- fill: "none",
32380
- shapeRendering: "geometricPrecision",
32381
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32382
- }, /*#__PURE__*/React.createElement("circle", {
32383
- cx: "12",
32384
- cy: "12",
32385
- r: "1",
32386
- fill: "currentColor",
32387
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32388
- }), /*#__PURE__*/React.createElement("circle", {
32389
- cx: "19",
32390
- cy: "12",
32391
- r: "1",
32392
- fill: "currentColor",
32393
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32394
- }), /*#__PURE__*/React.createElement("circle", {
32395
- cx: "5",
32396
- cy: "12",
32397
- r: "1",
32398
- fill: "currentColor",
32399
- className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
32400
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
32401
- id: "2928474255",
32402
- dynamic: [isBefore ? '180deg' : '0deg']
32403
- }, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
32404
- };
32405
- PaginationEllipsis.displayName = 'PaginationEllipsis';
32406
-
32407
- var PaginationPages = function PaginationPages(_ref) {
32408
- var limit = _ref.limit,
32409
- count = _ref.count,
32410
- current = _ref.current,
32411
- setPage = _ref.setPage;
32412
- var showPages = React.useMemo(function () {
32413
- var oddLimit = limit % 2 === 0 ? limit - 1 : limit;
32414
- return oddLimit - 2;
32415
- }, [limit]);
32416
- var middleNumber = (showPages + 1) / 2;
32417
- var _useMemo = React.useMemo(function () {
32418
- var showEllipsis = count > limit;
32419
- return [showEllipsis && current > middleNumber + 1, showEllipsis && current < count - middleNumber];
32420
- }, [current, showPages, middleNumber, count, limit]),
32421
- _useMemo2 = _slicedToArray(_useMemo, 2),
32422
- showBeforeEllipsis = _useMemo2[0],
32423
- showAfterEllipsis = _useMemo2[1];
32424
- var pagesArray = React.useMemo(function () {
32425
- return _toConsumableArray(new Array(showPages));
32426
- }, [showPages]);
32427
- var renderItem = React.useCallback(function (value, active) {
32428
- return /*#__PURE__*/React.createElement(PaginationItem, {
32429
- key: "pagination-item-".concat(value),
32430
- active: value === active,
32431
- onClick: function onClick() {
32432
- return setPage(value);
32433
- }
32434
- }, value);
32435
- }, []);
32436
- var startPages = pagesArray.map(function (_, index) {
32437
- var value = index + 2;
32438
- return renderItem(value, current);
32439
- });
32440
- var middlePages = pagesArray.map(function (_, index) {
32441
- var middleIndexNumber = middleNumber - (index + 1);
32442
- var value = current - middleIndexNumber;
32443
- return /*#__PURE__*/React.createElement(PaginationItem, {
32444
- key: "pagination-middle-".concat(index),
32445
- active: index + 1 === middleNumber,
32446
- onClick: function onClick() {
32447
- return setPage(value);
32448
- }
32449
- }, value);
32450
- });
32451
- var endPages = pagesArray.map(function (_, index) {
32452
- var value = count - (showPages - index);
32453
- return renderItem(value, current);
31826
+ rect = _useState2[0],
31827
+ setRect = _useState2[1];
31828
+ var colors = React.useMemo(function () {
31829
+ return getColors(type, theme.palette);
31830
+ }, [type, theme.palette]);
31831
+ var hasShadow = type === 'default';
31832
+ var classes = useClasses('tooltip-content', className);
31833
+ if (!parent) return null;
31834
+ var updateRect = function updateRect() {
31835
+ var position = getPosition(placement, getRect(parent), offset);
31836
+ setRect(position);
31837
+ };
31838
+ useResize(updateRect);
31839
+ useClickAnyWhere(function () {
31840
+ return updateRect();
32454
31841
  });
32455
- if (count <= limit) {
32456
- /* eslint-disable react/jsx-no-useless-fragment */
32457
- return /*#__PURE__*/React.createElement(React.Fragment, null, _toConsumableArray(new Array(count)).map(function (_, index) {
32458
- var value = index + 1;
32459
- return /*#__PURE__*/React.createElement(PaginationItem, {
32460
- key: "pagination-item-".concat(value),
32461
- active: value === current,
32462
- onClick: function onClick() {
32463
- return setPage(value);
32464
- }
32465
- }, value);
32466
- }));
32467
- /* eslint-enable */
32468
- }
32469
- return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
32470
- key: "pagination-ellipsis-before",
32471
- isBefore: true,
32472
- onClick: function onClick() {
32473
- return setPage(function (last) {
32474
- return last - 5 >= 1 ? last - 5 : 1;
32475
- });
32476
- }
32477
- }), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
32478
- key: "pagination-ellipsis-after",
32479
- onClick: function onClick() {
32480
- return setPage(function (last) {
32481
- return last + 5 <= count ? last + 5 : count;
32482
- });
32483
- }
32484
- }), renderItem(count, current));
31842
+ React.useEffect(function () {
31843
+ updateRect();
31844
+ }, [visible]);
31845
+ var preventHandler = function preventHandler(event) {
31846
+ event.stopPropagation();
31847
+ event.nativeEvent.stopImmediatePropagation();
31848
+ };
31849
+ if (!el) return null;
31850
+ return /*#__PURE__*/reactDom.createPortal(/*#__PURE__*/React.createElement(CssTransition, {
31851
+ visible: visible
31852
+ }, /*#__PURE__*/React.createElement("div", {
31853
+ ref: selfRef,
31854
+ onClick: preventHandler,
31855
+ className: _JSXStyle.dynamic([["2387841858", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + (classes || "")
31856
+ }, /*#__PURE__*/React.createElement("div", {
31857
+ className: _JSXStyle.dynamic([["2387841858", [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]]]) + " " + "inner"
31858
+ }, !hideArrow && /*#__PURE__*/React.createElement(TooltipIcon, {
31859
+ placement: placement,
31860
+ shadow: hasShadow
31861
+ }), children), /*#__PURE__*/React.createElement(_JSXStyle, {
31862
+ id: "2387841858",
31863
+ dynamic: [iconOffset.x, iconOffset.y, colors.bgColor, rect.top, rect.left, rect.transform, colors.color, theme.layout.radius, hasShadow ? theme.expressiveness.shadowMedium : 'none', SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.font(1), SCALES.pt(0.65), SCALES.pr(0.9), SCALES.pb(0.65), SCALES.pl(0.9)]
31864
+ }, ".tooltip-content.__jsx-style-dynamic-selector{--tooltip-icon-offset-x:".concat(iconOffset.x, ";--tooltip-icon-offset-y:").concat(iconOffset.y, ";--tooltip-content-bg:").concat(colors.bgColor, ";box-sizing:border-box;position:absolute;top:").concat(rect.top, ";left:").concat(rect.left, ";-webkit-transform:").concat(rect.transform, ";-ms-transform:").concat(rect.transform, ";transform:").concat(rect.transform, ";background-color:var(--tooltip-content-bg);color:").concat(colors.color, ";border-radius:").concat(theme.layout.radius, ";padding:0;z-index:1000;box-shadow:").concat(hasShadow ? theme.expressiveness.shadowMedium : 'none', ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";}.inner.__jsx-style-dynamic-selector{box-sizing:border-box;position:relative;font-size:").concat(SCALES.font(1), ";padding:").concat(SCALES.pt(0.65), " ").concat(SCALES.pr(0.9), " ").concat(SCALES.pb(0.65), " ").concat(SCALES.pl(0.9), ";height:100%;}")))), el);
32485
31865
  };
32486
- PaginationPages.displayName = 'PaginationPages';
32487
31866
 
32488
- var _excluded$1 = ["page", "initialPage", "count", "limit", "children", "onChange", "className"];
32489
- var PaginationComponent = function PaginationComponent(_ref) {
32490
- var customPage = _ref.page,
32491
- _ref$initialPage = _ref.initialPage,
32492
- initialPage = _ref$initialPage === void 0 ? 1 : _ref$initialPage,
32493
- _ref$count = _ref.count,
32494
- count = _ref$count === void 0 ? 1 : _ref$count,
32495
- _ref$limit = _ref.limit,
32496
- limit = _ref$limit === void 0 ? 7 : _ref$limit,
32497
- children = _ref.children,
32498
- onChange = _ref.onChange,
31867
+ /* "use client" */
31868
+
31869
+ var useClickAway = function useClickAway(ref, handler) {
31870
+ var handlerRef = React.useRef(handler);
31871
+ React.useEffect(function () {
31872
+ handlerRef.current = handler;
31873
+ }, [handler]);
31874
+ React.useEffect(function () {
31875
+ var callback = function callback(event) {
31876
+ var el = ref.current;
31877
+ if (!event || !el || el.contains(event.target)) return;
31878
+ handlerRef.current(event);
31879
+ };
31880
+ document.addEventListener('click', callback);
31881
+ return function () {
31882
+ return document.removeEventListener('click', callback);
31883
+ };
31884
+ }, [ref]);
31885
+ };
31886
+
31887
+ var _excluded$1 = ["children", "initialVisible", "text", "offset", "placement", "portalClassName", "enterDelay", "leaveDelay", "trigger", "type", "className", "onVisibleChange", "hideArrow", "visible"];
31888
+ var TooltipComponent = function TooltipComponent(_ref) {
31889
+ var children = _ref.children,
31890
+ _ref$initialVisible = _ref.initialVisible,
31891
+ initialVisible = _ref$initialVisible === void 0 ? false : _ref$initialVisible,
31892
+ text = _ref.text,
31893
+ _ref$offset = _ref.offset,
31894
+ offset = _ref$offset === void 0 ? 12 : _ref$offset,
31895
+ _ref$placement = _ref.placement,
31896
+ placement = _ref$placement === void 0 ? 'top' : _ref$placement,
31897
+ _ref$portalClassName = _ref.portalClassName,
31898
+ portalClassName = _ref$portalClassName === void 0 ? '' : _ref$portalClassName,
31899
+ _ref$enterDelay = _ref.enterDelay,
31900
+ enterDelay = _ref$enterDelay === void 0 ? 100 : _ref$enterDelay,
31901
+ _ref$leaveDelay = _ref.leaveDelay,
31902
+ leaveDelay = _ref$leaveDelay === void 0 ? 150 : _ref$leaveDelay,
31903
+ _ref$trigger = _ref.trigger,
31904
+ trigger = _ref$trigger === void 0 ? 'hover' : _ref$trigger,
31905
+ _ref$type = _ref.type,
31906
+ type = _ref$type === void 0 ? 'default' : _ref$type,
32499
31907
  _ref$className = _ref.className,
32500
31908
  className = _ref$className === void 0 ? '' : _ref$className,
31909
+ _ref$onVisibleChange = _ref.onVisibleChange,
31910
+ onVisibleChange = _ref$onVisibleChange === void 0 ? function () {} : _ref$onVisibleChange,
31911
+ _ref$hideArrow = _ref.hideArrow,
31912
+ hideArrow = _ref$hideArrow === void 0 ? false : _ref$hideArrow,
31913
+ customVisible = _ref.visible,
32501
31914
  props = _objectWithoutProperties(_ref, _excluded$1);
32502
- var _useScale = useScale(),
32503
- SCALES = _useScale.SCALES;
32504
- var _useCurrentState = useCurrentState(initialPage),
32505
- _useCurrentState2 = _slicedToArray(_useCurrentState, 3),
32506
- page = _useCurrentState2[0],
32507
- setPage = _useCurrentState2[1],
32508
- pageRef = _useCurrentState2[2];
32509
- var _pickChild = pickChild(children, PaginationPrevious),
32510
- _pickChild2 = _slicedToArray(_pickChild, 2),
32511
- prevChildren = _pickChild2[1];
32512
- var _pickChild3 = pickChild(children, PaginationNext),
32513
- _pickChild4 = _slicedToArray(_pickChild3, 2),
32514
- nextChildren = _pickChild4[1];
32515
- var _useMemo = React.useMemo(function () {
32516
- var hasChildren = function hasChildren(c) {
32517
- return React.Children.count(c) > 0;
32518
- };
32519
- var prevDefault = /*#__PURE__*/React.createElement(PaginationPrevious, null, "prev");
32520
- var nextDefault = /*#__PURE__*/React.createElement(PaginationNext, null, "next");
32521
- return [hasChildren(prevChildren) ? prevChildren : prevDefault, hasChildren(nextChildren) ? nextChildren : nextDefault];
32522
- }, [prevChildren, nextChildren]),
32523
- _useMemo2 = _slicedToArray(_useMemo, 2),
32524
- prevItem = _useMemo2[0],
32525
- nextItem = _useMemo2[1];
32526
- var update = function update(type) {
32527
- if (type === 'prev' && pageRef.current > 1) {
32528
- setPage(function (last) {
32529
- return last - 1;
32530
- });
32531
- }
32532
- if (type === 'next' && pageRef.current < count) {
32533
- setPage(function (last) {
32534
- return last + 1;
32535
- });
32536
- }
32537
- };
32538
- var values = React.useMemo(function () {
31915
+ var timer = React.useRef();
31916
+ var ref = React.useRef(null);
31917
+ var _useState = React.useState(initialVisible),
31918
+ _useState2 = _slicedToArray(_useState, 2),
31919
+ visible = _useState2[0],
31920
+ setVisible = _useState2[1];
31921
+ var iconOffset = React.useMemo(function () {
31922
+ if (!(ref !== null && ref !== void 0 && ref.current)) return {
31923
+ x: '0.75em',
31924
+ y: '0.75em'
31925
+ };
31926
+ var rect = getRect(ref);
32539
31927
  return {
32540
- isFirst: page <= 1,
32541
- isLast: page >= count,
32542
- update: update
31928
+ x: "".concat(rect.width ? rect.width / 2 : 0, "px"),
31929
+ y: "".concat(rect.height ? rect.height / 2 : 0, "px")
32543
31930
  };
32544
- }, [page, count]);
32545
- React.useEffect(function () {
32546
- onChange && onChange(page);
32547
- }, [page]);
31931
+ }, [ref === null || ref === void 0 ? void 0 : ref.current]);
31932
+ var contentProps = {
31933
+ type: type,
31934
+ visible: visible,
31935
+ offset: offset,
31936
+ placement: placement,
31937
+ hideArrow: hideArrow,
31938
+ iconOffset: iconOffset,
31939
+ parent: ref,
31940
+ className: portalClassName
31941
+ };
31942
+ var changeVisible = function changeVisible(nextState) {
31943
+ var clear = function clear() {
31944
+ clearTimeout(timer.current);
31945
+ timer.current = undefined;
31946
+ };
31947
+ var handler = function handler(nextState) {
31948
+ setVisible(nextState);
31949
+ onVisibleChange(nextState);
31950
+ clear();
31951
+ };
31952
+ clear();
31953
+ if (nextState) {
31954
+ timer.current = window.setTimeout(function () {
31955
+ return handler(true);
31956
+ }, enterDelay);
31957
+ return;
31958
+ }
31959
+ var leaveDelayWithoutClick = trigger === 'click' ? 0 : leaveDelay;
31960
+ timer.current = window.setTimeout(function () {
31961
+ return handler(false);
31962
+ }, leaveDelayWithoutClick);
31963
+ };
31964
+ var mouseEventHandler = function mouseEventHandler(next) {
31965
+ return trigger === 'hover' && changeVisible(next);
31966
+ };
31967
+ var clickEventHandler = function clickEventHandler() {
31968
+ return trigger === 'click' && changeVisible(!visible);
31969
+ };
31970
+ useClickAway(ref, function () {
31971
+ return trigger === 'click' && changeVisible(false);
31972
+ });
32548
31973
  React.useEffect(function () {
32549
- if (customPage !== undefined) {
32550
- setPage(customPage);
31974
+ if (customVisible === undefined) return;
31975
+ changeVisible(customVisible);
31976
+ }, [customVisible]);
31977
+ return /*#__PURE__*/React.createElement("div", _extends({
31978
+ ref: ref,
31979
+ onClick: clickEventHandler,
31980
+ onMouseEnter: function onMouseEnter() {
31981
+ return mouseEventHandler(true);
31982
+ },
31983
+ onMouseLeave: function onMouseLeave() {
31984
+ return mouseEventHandler(false);
32551
31985
  }
32552
- }, [customPage]);
32553
- return /*#__PURE__*/React.createElement(PaginationContext.Provider, {
32554
- value: values
32555
- }, /*#__PURE__*/React.createElement("nav", _extends({}, props, {
32556
- className: _JSXStyle.dynamic([["3826701357", [SCALES.font(2), SCALES.font(0.875), 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)]]]) + " " + (props && props.className != null && props.className || className || "")
32557
- }), prevItem, /*#__PURE__*/React.createElement(PaginationPages, {
32558
- count: count,
32559
- current: page,
32560
- limit: limit,
32561
- setPage: setPage
32562
- }), nextItem), /*#__PURE__*/React.createElement(_JSXStyle, {
32563
- id: "3826701357",
32564
- dynamic: [SCALES.font(2), SCALES.font(0.875), 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)]
32565
- }, "nav.__jsx-style-dynamic-selector{font-variant:tabular-nums;font-feature-settings:'tnum';--pagination-size:".concat(SCALES.font(2), ";font-size:").concat(SCALES.font(0.875), ";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 button:last-of-type{margin-right:0;}")));
31986
+ }, props, {
31987
+ className: "jsx-418573366" + " " + (props && props.className != null && props.className || useClasses('tooltip', className) || "")
31988
+ }), children, /*#__PURE__*/React.createElement(TooltipContent, contentProps, text), /*#__PURE__*/React.createElement(_JSXStyle, {
31989
+ id: "418573366"
31990
+ }, ".tooltip.jsx-418573366{width:-webkit-max-content;width:-moz-max-content;width:max-content;display:inline-block;}"));
32566
31991
  };
32567
- PaginationComponent.displayName = 'Pagination';
32568
- var Pagination = withScale(PaginationComponent);
32569
-
32570
- Pagination.Previous = PaginationPrevious;
32571
- Pagination.Next = PaginationNext;
31992
+ TooltipComponent.displayName = 'Tooltip';
31993
+ var Tooltip = withScale(TooltipComponent);
32572
31994
 
32573
31995
  var _excluded = ["children", "data", "initialData", "hover", "emptyText", "rowDraggable", "readOnly", "cursorPagination", "previousCursor", "nextCursor", "hasMore", "onNextPage", "onPreviousPage", "onRow", "onCell", "onChange", "onFilters", "onPageChange", "showFilters", "stickyHeader", "textPlaceholder", "onSelected", "dataLength", "viewLength", "className", "rowClassName"];
32574
31996
  function TableComponent(tableProps) {
@@ -32752,5 +32174,4 @@ TableComponent.Column = TableColumn;
32752
32174
  var Table = withScale(TableComponent);
32753
32175
  Table.Column = TableColumn;
32754
32176
 
32755
- exports.DataTable = DataTable$1;
32756
32177
  exports.default = Table;