@dust-tt/sparkle 0.2.37 → 0.2.38-rc10

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
+ action?: React.ReactNode;
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, action, isBlinking, avatarUrl, }: CitationProps): React.JSX.Element;
11
13
  export {};
package/dist/cjs/index.js CHANGED
@@ -32587,14 +32587,19 @@ var typeIcons = {
32587
32587
  document: SvgDocumentText,
32588
32588
  };
32589
32589
  function Citation(_a) {
32590
- 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;
32590
+ var title = _a.title, index = _a.index, _b = _a.type, type = _b === void 0 ? "document" : _b, description = _a.description, href = _a.href, action = _a.action, _c = _a.isBlinking, isBlinking = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl;
32591
+ if (action && href) {
32592
+ throw new Error("Citation cannot have both action and href");
32593
+ }
32591
32594
  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]" : "") },
32592
32595
  React.createElement("div", { className: "s-flex s-items-center s-gap-2" },
32596
+ avatarUrl && React.createElement(Avatar, { visual: avatarUrl, size: "xs" }),
32593
32597
  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)),
32594
- React.createElement(Icon, { visual: typeIcons[type], size: "sm" }),
32598
+ React.createElement(Icon, { visual: typeIcons[type], size: "sm", className: "s-text-element-700" }),
32595
32599
  React.createElement("div", { className: "s-flex-grow s-text-xs" }),
32596
32600
  href && (React.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: href },
32597
- React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "primary" })))),
32601
+ React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "secondary" }))),
32602
+ action && action),
32598
32603
  React.createElement(Tooltip, { label: title, position: "above" },
32599
32604
  React.createElement("div", { className: "s-line-clamp-1 s-text-sm s-font-bold s-text-element-900" }, title)),
32600
32605
  description && (React.createElement("div", { className: "s-line-clamp-2 s-text-xs s-font-normal s-text-element-700" }, description))));
@@ -33289,7 +33294,7 @@ function RadioButton(_a) {
33289
33294
 
33290
33295
  function Popup(_a) {
33291
33296
  var show = _a.show, chipLabel = _a.chipLabel, description = _a.description, buttonLabel = _a.buttonLabel, buttonClick = _a.buttonClick, className = _a.className, onClose = _a.onClose;
33292
- return (React.createElement(tt, { show: show, enter: "s-transition-opacity s-duration-300", appear: true, enterFrom: "s-opacity-0", enterTo: "s-opacity-100", leave: "s-transition-opacity s-duration-300", leaveFrom: "s-opacity-100", leaveTo: "s-opacity-0", className: classNames("relative s-z-30 s-flex s-w-64 s-flex-col s-gap-3 s-rounded-xl s-border s-border-pink-100 s-bg-pink-50 s-p-4 s-shadow-xl", className || "") },
33297
+ return (React.createElement(tt, { show: show, enter: "s-transition-opacity s-duration-300", appear: true, enterFrom: "s-opacity-0", enterTo: "s-opacity-100", leave: "s-transition-opacity s-duration-300", leaveFrom: "s-opacity-100", leaveTo: "s-opacity-0", className: classNames("s-z-30 s-flex s-w-64 s-flex-col s-gap-3 s-rounded-xl s-border s-border-pink-100 s-bg-pink-50 s-p-4 s-shadow-xl", className || "") },
33293
33298
  React.createElement("div", { className: "s-flex" },
33294
33299
  React.createElement(Chip, { color: "pink" }, chipLabel),
33295
33300
  onClose && (React.createElement("div", { className: "-s-mr-1 -s-mt-1 s-flex s-grow s-items-start s-justify-end" },