@dust-tt/sparkle 0.2.124 → 0.2.125-rc

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.
@@ -10,6 +10,8 @@ interface CardButtonProps {
10
10
  href?: string;
11
11
  target?: string;
12
12
  rel?: string;
13
+ replace?: boolean;
14
+ shallow?: boolean;
13
15
  }
14
- export declare function CardButton({ children, variant, size, className, onClick, onMouseEnter, onMouseLeave, href, target, rel, }: CardButtonProps): React.JSX.Element;
16
+ export declare function CardButton({ children, variant, size, className, onClick, onMouseEnter, onMouseLeave, href, target, rel, replace, shallow, }: CardButtonProps): React.JSX.Element;
15
17
  export {};
@@ -1,13 +1,13 @@
1
1
  import React from "react";
2
2
  interface TemplateItemProps {
3
3
  description: string;
4
+ href: string;
4
5
  id: string;
5
6
  name: string;
6
- onClick: (id: string) => void;
7
7
  visual: {
8
8
  backgroundColor: string;
9
9
  emoji: string;
10
10
  };
11
11
  }
12
- export declare function TemplateItem({ description, id, name, onClick, visual, }: TemplateItemProps): React.JSX.Element;
12
+ export declare function TemplateItem({ description, href, name, visual, }: TemplateItemProps): React.JSX.Element;
13
13
  export {};
@@ -6,6 +6,8 @@ export type SparkleContextLinkType = ComponentType<{
6
6
  ariaLabel?: string;
7
7
  ariaCurrent?: boolean | "time" | "false" | "true" | "page" | "step" | "location" | "date";
8
8
  onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
9
+ replace?: boolean;
10
+ shallow?: boolean;
9
11
  }>;
10
12
  export type SparkleContextType = {
11
13
  components: {
package/dist/cjs/index.js CHANGED
@@ -936,7 +936,7 @@ var sizeClasses$4 = {
936
936
  lg: "s-p-5 s-rounded-3xl",
937
937
  };
938
938
  function CardButton(_a) {
939
- var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.className, className = _d === void 0 ? "" : _d, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, href = _a.href, _e = _a.target, target = _e === void 0 ? "_blank" : _e, _f = _a.rel, rel = _f === void 0 ? "" : _f;
939
+ var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.className, className = _d === void 0 ? "" : _d, onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, href = _a.href, _e = _a.target, target = _e === void 0 ? "_blank" : _e, _f = _a.rel, rel = _f === void 0 ? "" : _f, replace = _a.replace, shallow = _a.shallow;
940
940
  var components = React.useContext(SparkleContext).components;
941
941
  var Link = href ? components.link : noHrefLink;
942
942
  var commonClasses = classNames("s-flex s-cursor-pointer s-transition s-duration-200", variantClasses$1[variant], sizeClasses$4[size], className);
@@ -944,7 +944,7 @@ function CardButton(_a) {
944
944
  if (target) {
945
945
  return (React.createElement("a", { href: href, target: target, rel: rel, className: commonClasses }, children));
946
946
  }
947
- return (React.createElement(Link, { href: href, className: commonClasses }, children));
947
+ return (React.createElement(Link, { href: href, className: commonClasses, replace: replace, shallow: shallow }, children));
948
948
  }
949
949
  else {
950
950
  return (React.createElement("div", { className: commonClasses, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, children));
@@ -55242,9 +55242,9 @@ function Popup(_a) {
55242
55242
  }
55243
55243
 
55244
55244
  function TemplateItem(_a) {
55245
- var description = _a.description, id = _a.id, name = _a.name, onClick = _a.onClick, visual = _a.visual;
55245
+ var description = _a.description, href = _a.href, name = _a.name, visual = _a.visual;
55246
55246
  var backgroundColor = visual.backgroundColor, emoji = visual.emoji;
55247
- return (React.createElement(CardButton, { className: "s-flex s-max-h-32 s-max-w-lg s-flex-row s-gap-5 s-p-4", onClick: function () { return onClick(id); }, variant: "tertiary" },
55247
+ return (React.createElement(CardButton, { className: "s-flex s-max-h-32 s-max-w-lg s-flex-row s-gap-5 s-p-4", href: href, variant: "tertiary", replace: true, shallow: true },
55248
55248
  React.createElement(Avatar, { emoji: emoji, size: "lg", isRounded: true, backgroundColor: backgroundColor }),
55249
55249
  React.createElement("div", { className: "s-flex s-flex-col s-gap-2" },
55250
55250
  React.createElement("span", { className: "s-text-bold s-text-lg s-font-medium s-text-element-900" }, name),