@dust-tt/sparkle 0.2.173-pr → 0.2.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -40467,11 +40467,9 @@ function Icon(_a) {
40467
40467
 
40468
40468
  function Tooltip(_a) {
40469
40469
  var children = _a.children, label = _a.label, _b = _a.position, position = _b === void 0 ? "above" : _b, contentChildren = _a.contentChildren;
40470
- // used to disable the tooltip when copying
40471
- var _c = __read(React.useState(false), 2), isCopying = _c[0], setIsCopying = _c[1];
40472
- var _d = __read(React.useState(false), 2), isHovered = _d[0], setIsHovered = _d[1];
40473
- var _e = __read(React.useState(null), 2), timerId = _e[0], setTimerId = _e[1];
40474
- var _f = __read(React.useState(false), 2), isTouchDevice = _f[0], setIsTouchDevice = _f[1];
40470
+ var _c = __read(React.useState(false), 2), isHovered = _c[0], setIsHovered = _c[1];
40471
+ var _d = __read(React.useState(null), 2), timerId = _d[0], setTimerId = _d[1];
40472
+ var _e = __read(React.useState(false), 2), isTouchDevice = _e[0], setIsTouchDevice = _e[1];
40475
40473
  var handleMouseOver = function () {
40476
40474
  var id = window.setTimeout(function () {
40477
40475
  setIsHovered(true);
@@ -40504,15 +40502,7 @@ function Tooltip(_a) {
40504
40502
  // if tooltip text is too long we need to wrap it
40505
40503
  var labelLength = (label === null || label === void 0 ? void 0 : label.length) || 0;
40506
40504
  var labelClasses = labelLength > 80 ? "s-w-[38em]" : "s-whitespace-nowrap";
40507
- // do not show the tooltip while we're copying the content
40508
- // otherwise the tooltip text is copied also
40509
- if (isCopying) {
40510
- return React.createElement(React.Fragment, null, children);
40511
- }
40512
- return (React.createElement("div", { onMouseEnter: handleMouseOver, onMouseLeave: handleMouseLeave, className: "s-relative s-inline-block", onCopyCapture: function () {
40513
- setIsCopying(true);
40514
- setTimeout(function () { return setIsCopying(false); }, 200);
40515
- } },
40505
+ return (React.createElement("div", { onMouseEnter: handleMouseOver, onMouseLeave: handleMouseLeave, className: "s-relative s-inline-block" },
40516
40506
  children,
40517
40507
  React.createElement("div", { className: classNames("".concat(isHovered ? visibleClasses : hiddenClasses), baseClasses, hiddenOnMobileClasses, tooltipPositionClasses, tooltipCenterClasses, contentChildren ? "" : labelClasses), onAnimationEnd: function () { return setIsHovered(false); } }, contentChildren || label)));
40518
40508
  }
@@ -77911,7 +77901,7 @@ function PaginatedCitationsGrid(_a) {
77911
77901
  var items = _a.items, _b = _a.maxItemsPerPage, maxItemsPerPage = _b === void 0 ? 9 : _b;
77912
77902
  var _c = __read(React.useState(1), 2), currentPage = _c[0], setCurrentPage = _c[1];
77913
77903
  var cols = 3;
77914
- var rows = Math.ceil(maxItemsPerPage / cols);
77904
+ var rows = Math.ceil(Math.min(maxItemsPerPage, items.length) / cols);
77915
77905
  if (items.length === 0) {
77916
77906
  return null;
77917
77907
  }