@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.
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  export interface DropzoneOverlayProps {
3
- description?: string;
3
+ description: string;
4
4
  isDragActive: boolean;
5
- title?: string;
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 _b = _a.description, description = _b === void 0 ? "Drag and drop your files here" : _b, isDragActive = _a.isDragActive, _c = _a.title, title = _c === void 0 ? "Drag and drop" : _c, _d = _a.visual, visual = _d === void 0 ? (React.createElement(Icon, { visual: SvgArrowUpOnSquare$1, size: "lg", className: "s-text-white" })) : _d;
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 _e = __read(React.useState(false), 2), isActiveDelayed = _e[0], setIsActiveDelayed = _e[1];
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
- }, 1000);
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.play();
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);