@dust-tt/sparkle 0.2.41 → 0.2.42

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.
@@ -6,6 +6,8 @@ interface CitationProps {
6
6
  index?: ReactNode;
7
7
  isBlinking?: boolean;
8
8
  href?: string;
9
+ onClose?: () => void;
10
+ avatarUrl?: string;
9
11
  }
10
- export declare function Citation({ title, index, type, description, href, isBlinking, }: CitationProps): React.JSX.Element;
12
+ export declare function Citation({ title, index, type, description, href, onClose, isBlinking, avatarUrl, }: CitationProps): React.JSX.Element;
11
13
  export {};
package/dist/cjs/index.js CHANGED
@@ -32540,14 +32540,16 @@ var typeIcons = {
32540
32540
  document: SvgDocumentText,
32541
32541
  };
32542
32542
  function Citation(_a) {
32543
- var title = _a.title, index = _a.index, _b = _a.type, type = _b === void 0 ? "document" : _b, description = _a.description, href = _a.href, _c = _a.isBlinking, isBlinking = _c === void 0 ? false : _c;
32543
+ var title = _a.title, index = _a.index, _b = _a.type, type = _b === void 0 ? "document" : _b, description = _a.description, href = _a.href, onClose = _a.onClose, _c = _a.isBlinking, isBlinking = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl;
32544
32544
  return (React.createElement("div", { className: classNames("s-flex s-w-48 s-flex-none s-flex-col s-gap-1 s-rounded-xl s-border s-border-structure-100 s-bg-white s-p-3 s-shadow-sm sm:s-w-64", isBlinking ? "s-animate-[bgblink_500ms_3]" : "") },
32545
32545
  React.createElement("div", { className: "s-flex s-items-center s-gap-2" },
32546
+ avatarUrl && React.createElement(Avatar, { visual: avatarUrl, size: "xs" }),
32546
32547
  index && (React.createElement("div", { className: "s-flex s-h-5 s-w-5 s-items-center s-justify-center s-rounded-full s-border s-border-violet-200 s-bg-violet-100 s-text-xs s-font-semibold s-text-element-800" }, index)),
32547
- React.createElement(Icon, { visual: typeIcons[type], size: "sm" }),
32548
+ React.createElement(Icon, { visual: typeIcons[type], size: "sm", className: "s-text-element-700" }),
32548
32549
  React.createElement("div", { className: "s-flex-grow s-text-xs" }),
32549
32550
  href && (React.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: href },
32550
- React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "secondary" })))),
32551
+ React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "secondary" }))),
32552
+ onClose && (React.createElement(IconButton, { icon: SvgXCircle$1, size: "sm", variant: "tertiary", onClick: onClose }))),
32551
32553
  React.createElement(Tooltip, { label: title, position: "above" },
32552
32554
  React.createElement("div", { className: "s-line-clamp-1 s-text-sm s-font-bold s-text-element-900" }, title)),
32553
32555
  description && (React.createElement("div", { className: "s-line-clamp-2 s-text-xs s-font-normal s-text-element-700" }, description))));