@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/esm/index.js CHANGED
@@ -32567,14 +32567,19 @@ var typeIcons = {
32567
32567
  document: SvgDocumentText,
32568
32568
  };
32569
32569
  function Citation(_a) {
32570
- 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;
32570
+ 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;
32571
+ if (action && href) {
32572
+ throw new Error("Citation cannot have both action and href");
32573
+ }
32571
32574
  return (React__default.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]" : "") },
32572
32575
  React__default.createElement("div", { className: "s-flex s-items-center s-gap-2" },
32576
+ avatarUrl && React__default.createElement(Avatar, { visual: avatarUrl, size: "xs" }),
32573
32577
  index && (React__default.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)),
32574
- React__default.createElement(Icon, { visual: typeIcons[type], size: "sm" }),
32578
+ React__default.createElement(Icon, { visual: typeIcons[type], size: "sm", className: "s-text-element-700" }),
32575
32579
  React__default.createElement("div", { className: "s-flex-grow s-text-xs" }),
32576
32580
  href && (React__default.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: href },
32577
- React__default.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "primary" })))),
32581
+ React__default.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "secondary" }))),
32582
+ action && action),
32578
32583
  React__default.createElement(Tooltip, { label: title, position: "above" },
32579
32584
  React__default.createElement("div", { className: "s-line-clamp-1 s-text-sm s-font-bold s-text-element-900" }, title)),
32580
32585
  description && (React__default.createElement("div", { className: "s-line-clamp-2 s-text-xs s-font-normal s-text-element-700" }, description))));
@@ -33269,7 +33274,7 @@ function RadioButton(_a) {
33269
33274
 
33270
33275
  function Popup(_a) {
33271
33276
  var show = _a.show, chipLabel = _a.chipLabel, description = _a.description, buttonLabel = _a.buttonLabel, buttonClick = _a.buttonClick, className = _a.className, onClose = _a.onClose;
33272
- return (React__default.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 || "") },
33277
+ return (React__default.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 || "") },
33273
33278
  React__default.createElement("div", { className: "s-flex" },
33274
33279
  React__default.createElement(Chip, { color: "pink" }, chipLabel),
33275
33280
  onClose && (React__default.createElement("div", { className: "-s-mr-1 -s-mt-1 s-flex s-grow s-items-start s-justify-end" },