@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 +5 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stories/PaginatedCitationsGrid.stories.d.ts +1 -0
- package/dist/esm/index.js +5 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stories/PaginatedCitationsGrid.stories.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -40447,11 +40447,9 @@ function Icon(_a) {
|
|
|
40447
40447
|
|
|
40448
40448
|
function Tooltip(_a) {
|
|
40449
40449
|
var children = _a.children, label = _a.label, _b = _a.position, position = _b === void 0 ? "above" : _b, contentChildren = _a.contentChildren;
|
|
40450
|
-
|
|
40451
|
-
var
|
|
40452
|
-
var
|
|
40453
|
-
var _e = __read(useState(null), 2), timerId = _e[0], setTimerId = _e[1];
|
|
40454
|
-
var _f = __read(useState(false), 2), isTouchDevice = _f[0], setIsTouchDevice = _f[1];
|
|
40450
|
+
var _c = __read(useState(false), 2), isHovered = _c[0], setIsHovered = _c[1];
|
|
40451
|
+
var _d = __read(useState(null), 2), timerId = _d[0], setTimerId = _d[1];
|
|
40452
|
+
var _e = __read(useState(false), 2), isTouchDevice = _e[0], setIsTouchDevice = _e[1];
|
|
40455
40453
|
var handleMouseOver = function () {
|
|
40456
40454
|
var id = window.setTimeout(function () {
|
|
40457
40455
|
setIsHovered(true);
|
|
@@ -40484,15 +40482,7 @@ function Tooltip(_a) {
|
|
|
40484
40482
|
// if tooltip text is too long we need to wrap it
|
|
40485
40483
|
var labelLength = (label === null || label === void 0 ? void 0 : label.length) || 0;
|
|
40486
40484
|
var labelClasses = labelLength > 80 ? "s-w-[38em]" : "s-whitespace-nowrap";
|
|
40487
|
-
|
|
40488
|
-
// otherwise the tooltip text is copied also
|
|
40489
|
-
if (isCopying) {
|
|
40490
|
-
return React__default.createElement(React__default.Fragment, null, children);
|
|
40491
|
-
}
|
|
40492
|
-
return (React__default.createElement("div", { onMouseEnter: handleMouseOver, onMouseLeave: handleMouseLeave, className: "s-relative s-inline-block", onCopyCapture: function () {
|
|
40493
|
-
setIsCopying(true);
|
|
40494
|
-
setTimeout(function () { return setIsCopying(false); }, 200);
|
|
40495
|
-
} },
|
|
40485
|
+
return (React__default.createElement("div", { onMouseEnter: handleMouseOver, onMouseLeave: handleMouseLeave, className: "s-relative s-inline-block" },
|
|
40496
40486
|
children,
|
|
40497
40487
|
React__default.createElement("div", { className: classNames("".concat(isHovered ? visibleClasses : hiddenClasses), baseClasses, hiddenOnMobileClasses, tooltipPositionClasses, tooltipCenterClasses, contentChildren ? "" : labelClasses), onAnimationEnd: function () { return setIsHovered(false); } }, contentChildren || label)));
|
|
40498
40488
|
}
|
|
@@ -77891,7 +77881,7 @@ function PaginatedCitationsGrid(_a) {
|
|
|
77891
77881
|
var items = _a.items, _b = _a.maxItemsPerPage, maxItemsPerPage = _b === void 0 ? 9 : _b;
|
|
77892
77882
|
var _c = __read(useState(1), 2), currentPage = _c[0], setCurrentPage = _c[1];
|
|
77893
77883
|
var cols = 3;
|
|
77894
|
-
var rows = Math.ceil(maxItemsPerPage / cols);
|
|
77884
|
+
var rows = Math.ceil(Math.min(maxItemsPerPage, items.length) / cols);
|
|
77895
77885
|
if (items.length === 0) {
|
|
77896
77886
|
return null;
|
|
77897
77887
|
}
|