@dust-tt/sparkle 0.2.190-rc1 → 0.2.190
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/components/DropzoneOverlay.d.ts +2 -2
- package/dist/cjs/index.js +6 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/DropzoneOverlay.d.ts +2 -2
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/DropzoneOverlay.tsx +6 -5
- package/src/stories/DropzoneOverlay.stories.tsx +5 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface DropzoneOverlayProps {
|
|
3
|
-
description
|
|
3
|
+
description: string;
|
|
4
4
|
isDragActive: boolean;
|
|
5
|
-
title
|
|
5
|
+
title: string;
|
|
6
6
|
visual?: React.ReactNode;
|
|
7
7
|
}
|
|
8
8
|
export default function DropzoneOverlay({ description, isDragActive, title, visual, }: DropzoneOverlayProps): React.JSX.Element | null;
|
package/dist/cjs/index.js
CHANGED
|
@@ -103418,9 +103418,9 @@ var animation$1 = {
|
|
|
103418
103418
|
};
|
|
103419
103419
|
|
|
103420
103420
|
function DropzoneOverlay(_a) {
|
|
103421
|
-
var
|
|
103421
|
+
var description = _a.description, isDragActive = _a.isDragActive, title = _a.title, _b = _a.visual, visual = _b === void 0 ? (React.createElement(Icon, { visual: SvgArrowUpOnSquare$1, size: "lg", className: "s-text-white" })) : _b;
|
|
103422
103422
|
var lottieRef = React.useRef(null);
|
|
103423
|
-
var
|
|
103423
|
+
var _c = __read(React.useState(false), 2), isActiveDelayed = _c[0], setIsActiveDelayed = _c[1];
|
|
103424
103424
|
// This is used to delay the removal of the overlay when the user stops dragging.
|
|
103425
103425
|
React.useEffect(function () {
|
|
103426
103426
|
if (isDragActive) {
|
|
@@ -103429,7 +103429,7 @@ function DropzoneOverlay(_a) {
|
|
|
103429
103429
|
else {
|
|
103430
103430
|
var timeoutId_1 = setTimeout(function () {
|
|
103431
103431
|
setIsActiveDelayed(false);
|
|
103432
|
-
},
|
|
103432
|
+
}, 400);
|
|
103433
103433
|
return function () { return clearTimeout(timeoutId_1); };
|
|
103434
103434
|
}
|
|
103435
103435
|
}, [isDragActive]);
|
|
@@ -103437,9 +103437,10 @@ function DropzoneOverlay(_a) {
|
|
|
103437
103437
|
return null;
|
|
103438
103438
|
}
|
|
103439
103439
|
return (React.createElement("div", { className: "s-absolute s-inset-0 s-z-50 s-flex s-h-full s-w-full s-flex-col s-items-center s-justify-center s-gap-0 s-bg-white/80 s-text-element-800", onMouseLeave: function () {
|
|
103440
|
-
var _a, _b;
|
|
103440
|
+
var _a, _b, _c;
|
|
103441
103441
|
(_a = lottieRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(-1);
|
|
103442
|
-
(_b = lottieRef.current) === null || _b === void 0 ? void 0 : _b.
|
|
103442
|
+
(_b = lottieRef.current) === null || _b === void 0 ? void 0 : _b.setSpeed(2);
|
|
103443
|
+
(_c = lottieRef.current) === null || _c === void 0 ? void 0 : _c.play();
|
|
103443
103444
|
}, onDrop: function () {
|
|
103444
103445
|
var _a, _b;
|
|
103445
103446
|
(_a = lottieRef.current) === null || _a === void 0 ? void 0 : _a.setDirection(-1);
|