@dust-tt/sparkle 0.2.1 → 0.2.2-aric

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.
@@ -7,8 +7,9 @@ type AvatarProps = {
7
7
  onClick?: () => void;
8
8
  busy?: boolean;
9
9
  isRounded?: boolean;
10
+ backgroundColor?: string;
10
11
  };
11
- export declare function Avatar({ size, name, visual, onClick, clickable, busy, isRounded, }: AvatarProps): React.JSX.Element;
12
+ export declare function Avatar({ size, name, visual, onClick, clickable, busy, isRounded, backgroundColor, }: AvatarProps): React.JSX.Element;
12
13
  export declare namespace Avatar {
13
14
  var Stack: ({ children, nbMoreItems, size, isRounded, hasMagnifier, }: AvatarStackProps) => React.JSX.Element;
14
15
  }
@@ -9,10 +9,11 @@ type ChipProps = {
9
9
  };
10
10
  export declare function Chip({ size, color, label, children, className, isBusy, }: ChipProps): React.JSX.Element;
11
11
  export declare namespace Chip {
12
- var List: ({ children, className }: ListChipProps) => React.JSX.Element;
12
+ var List: ({ children, className, isWrapping }: ListChipProps) => React.JSX.Element;
13
13
  }
14
14
  interface ListChipProps {
15
15
  children: ReactNode;
16
16
  className?: string;
17
+ isWrapping?: boolean;
17
18
  }
18
19
  export {};
@@ -5,7 +5,7 @@ interface CitationProps {
5
5
  description?: string;
6
6
  index?: ReactNode;
7
7
  isBlinking?: boolean;
8
- href: string;
8
+ href?: string;
9
9
  }
10
10
  export declare function Citation({ title, index, type, description, href, isBlinking, }: CitationProps): React.JSX.Element;
11
11
  export {};
package/dist/cjs/index.js CHANGED
@@ -413,7 +413,7 @@ var textSize = {
413
413
  auto: "s-text-xl",
414
414
  };
415
415
  function Avatar(_a) {
416
- var _b = _a.size, size = _b === void 0 ? "md" : _b, name = _a.name, visual = _a.visual, onClick = _a.onClick, _c = _a.clickable, clickable = _c === void 0 ? false : _c, _d = _a.busy, busy = _d === void 0 ? false : _d, _e = _a.isRounded, isRounded = _e === void 0 ? false : _e;
416
+ var _b = _a.size, size = _b === void 0 ? "md" : _b, name = _a.name, visual = _a.visual, onClick = _a.onClick, _c = _a.clickable, clickable = _c === void 0 ? false : _c, _d = _a.busy, busy = _d === void 0 ? false : _d, _e = _a.isRounded, isRounded = _e === void 0 ? false : _e, backgroundColor = _a.backgroundColor;
417
417
  var getColor = function (name) {
418
418
  if (/\+/.test(name)) {
419
419
  //find if there is a plus
@@ -439,7 +439,11 @@ function Avatar(_a) {
439
439
  ? "s-cursor-pointer hover:s-filter hover:s-brightness-110 active:s-brightness-90 s-transition s-duration-200 s-ease-out"
440
440
  : "";
441
441
  var busyStyles = busy ? "s-animate-breathing s-cursor-default" : "";
442
- var avatarClass = classNames(sizeClasses$4[size], isRounded ? "s-rounded-full" : roundedClasses[size], name ? getColor(name) : "s-bg-slate-200", "s-flex s-flex-shrink-0 s-items-center s-justify-center s-overflow-hidden", clickableStyles, busyStyles);
442
+ var avatarClass = classNames(sizeClasses$4[size], isRounded ? "s-rounded-full" : roundedClasses[size], backgroundColor
443
+ ? backgroundColor
444
+ : name
445
+ ? getColor(name)
446
+ : "s-bg-slate-200", "s-flex s-flex-shrink-0 s-items-center s-justify-center s-overflow-hidden", clickableStyles, busyStyles);
443
447
  return (React.createElement("div", { className: avatarClass },
444
448
  size === "auto" && React.createElement("div", { style: { paddingBottom: "100%" } }),
445
449
  typeof visual === "string" ? (React.createElement("img", { src: visual, alt: name, className: classNames(sizeClasses$4[size], "s-h-full s-w-full s-object-cover s-object-center") })) : visual ? (visual) : name ? (React.createElement("span", { className: classNames(getTextVariant(name), textSize[size], "s-select-none s-font-medium") }, /\+/.test(name) ? name : name[0].toUpperCase())) : (React.createElement(SvgUser$1, { className: "s-h-1/2 s-w-1/2 s-opacity-20" }))));
@@ -32111,9 +32115,9 @@ function Chip(_a) {
32111
32115
  children));
32112
32116
  }
32113
32117
  Chip.List = function (_a) {
32114
- var children = _a.children, className = _a.className;
32118
+ var children = _a.children, className = _a.className, isWrapping = _a.isWrapping;
32115
32119
  return (React.createElement("div", { className: classNames(className ? className : "", "s-flex") },
32116
- React.createElement("div", { className: "s-flex s-flex-row s-gap-2" }, children)));
32120
+ React.createElement("div", { className: classNames("s-flex s-flex-row s-gap-2", isWrapping ? "s-flex-wrap" : "") }, children)));
32117
32121
  };
32118
32122
 
32119
32123
  var SvgArrowDownCircle = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
@@ -32455,8 +32459,8 @@ function Citation(_a) {
32455
32459
  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)),
32456
32460
  React.createElement(Icon, { visual: typeIcons[type], size: "sm" }),
32457
32461
  React.createElement("div", { className: "s-flex-grow s-text-xs" }),
32458
- React.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: href },
32459
- React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "primary" }))),
32462
+ href && (React.createElement("a", { target: "_blank", rel: "noopener noreferrer", href: href },
32463
+ React.createElement(IconButton, { icon: SvgExternalLink$1, size: "sm", variant: "primary" })))),
32460
32464
  React.createElement("div", { className: "s-text-sm s-font-bold s-text-element-900" }, title),
32461
32465
  description && (React.createElement("div", { className: "s-text-xs s-font-normal s-text-element-700" }, description))));
32462
32466
  }