@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/esm/index.js CHANGED
@@ -916,7 +916,7 @@ var sizeClasses$4 = {
916
916
  lg: "s-p-5 s-rounded-3xl",
917
917
  };
918
918
  function CardButton(_a) {
919
- 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;
919
+ 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;
920
920
  var components = React__default.useContext(SparkleContext).components;
921
921
  var Link = href ? components.link : noHrefLink;
922
922
  var commonClasses = classNames("s-flex s-cursor-pointer s-transition s-duration-200", variantClasses$1[variant], sizeClasses$4[size], className);
@@ -924,7 +924,7 @@ function CardButton(_a) {
924
924
  if (target) {
925
925
  return (React__default.createElement("a", { href: href, target: target, rel: rel, className: commonClasses }, children));
926
926
  }
927
- return (React__default.createElement(Link, { href: href, className: commonClasses }, children));
927
+ return (React__default.createElement(Link, { href: href, className: commonClasses, replace: replace, shallow: shallow }, children));
928
928
  }
929
929
  else {
930
930
  return (React__default.createElement("div", { className: commonClasses, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, children));
@@ -55222,9 +55222,9 @@ function Popup(_a) {
55222
55222
  }
55223
55223
 
55224
55224
  function TemplateItem(_a) {
55225
- var description = _a.description, id = _a.id, name = _a.name, onClick = _a.onClick, visual = _a.visual;
55225
+ var description = _a.description, href = _a.href, name = _a.name, visual = _a.visual;
55226
55226
  var backgroundColor = visual.backgroundColor, emoji = visual.emoji;
55227
- return (React__default.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" },
55227
+ return (React__default.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 },
55228
55228
  React__default.createElement(Avatar, { emoji: emoji, size: "lg", isRounded: true, backgroundColor: backgroundColor }),
55229
55229
  React__default.createElement("div", { className: "s-flex s-flex-col s-gap-2" },
55230
55230
  React__default.createElement("span", { className: "s-text-bold s-text-lg s-font-medium s-text-element-900" }, name),