@dust-tt/sparkle 0.2.187 → 0.2.189

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.187",
3
+ "version": "0.2.189",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
@@ -50,8 +50,8 @@ const titleClassNames = {
50
50
  getWindowWidth() <= breakpoints.sm
51
51
  ? "s-text-sm"
52
52
  : getWindowWidth() <= breakpoints.md
53
- ? "s-text-base"
54
- : ""
53
+ ? "s-text-base"
54
+ : ""
55
55
  }`,
56
56
  };
57
57
 
@@ -62,8 +62,8 @@ const subtitleClassNames = {
62
62
  getWindowWidth() <= breakpoints.sm
63
63
  ? "s-text-xs"
64
64
  : getWindowWidth() <= breakpoints.md
65
- ? "s-text-xs"
66
- : "s-text-sm"
65
+ ? "s-text-xs"
66
+ : "s-text-sm"
67
67
  }`,
68
68
  };
69
69
 
@@ -161,7 +161,10 @@ const MinimalVariantContent = ({
161
161
  <div
162
162
  id="assistant-container"
163
163
  className="s-flex s-grow s-flex-col s-justify-start s-gap-2 s-overflow-hidden s-py-1"
164
- onClick={onClick}
164
+ onClick={(e) => {
165
+ e.stopPropagation();
166
+ onClick?.();
167
+ }}
165
168
  >
166
169
  <div className="s-flex s-flex-row s-justify-between s-gap-2 s-overflow-hidden">
167
170
  <div
@@ -126,16 +126,15 @@ export function Citation({
126
126
  </div>
127
127
  )}
128
128
  </div>
129
- <Tooltip label={title} position="above">
130
- <div
131
- className={classNames(
132
- "s-line-clamp-1 s-text-sm s-text-element-800",
133
- size === "sm" ? "s-font-bold" : "s-font-semibold"
134
- )}
135
- >
136
- {title}
137
- </div>
138
- </Tooltip>
129
+ <div
130
+ className={classNames(
131
+ "s-line-clamp-1 s-text-sm s-text-element-800",
132
+ size === "sm" ? "s-font-bold" : "s-font-semibold"
133
+ )}
134
+ >
135
+ {title}
136
+ </div>
137
+
139
138
  {description && (
140
139
  <div className="s-line-clamp-2 s-text-xs s-font-normal s-text-element-700">
141
140
  {description}
@@ -145,24 +144,26 @@ export function Citation({
145
144
  );
146
145
 
147
146
  return (
148
- <CardButton
149
- variant="secondary"
150
- size="sm"
151
- className={classNames(
152
- "s-relative s-flex s-w-48 s-flex-none s-flex-col s-gap-1",
153
- sizing === "fluid" ? typeSizing[sizing] : typeSizing[sizing][size],
154
- size === "sm" ? "sm:s-w-64" : "",
155
- isBlinking ? "s-animate-[bgblink_500ms_3]" : "",
156
- type === "image" ? "s-min-h-20" : ""
157
- )}
158
- {...(href && { href, target: "_blank", rel: "noopener noreferrer" })}
159
- >
160
- {isLoading && (
161
- <div className="s-absolute s-inset-0 s-flex s-items-center s-justify-center">
162
- <Spinner size="xs" variant="color" />
163
- </div>
164
- )}
165
- <div className={isLoading ? "s-opacity-50" : ""}>{cardContent}</div>
166
- </CardButton>
147
+ <Tooltip label={title} position="above">
148
+ <CardButton
149
+ variant="secondary"
150
+ size="sm"
151
+ className={classNames(
152
+ "s-relative s-flex s-w-48 s-flex-none s-flex-col s-gap-1",
153
+ sizing === "fluid" ? typeSizing[sizing] : typeSizing[sizing][size],
154
+ size === "sm" ? "sm:s-w-64" : "",
155
+ isBlinking ? "s-animate-[bgblink_500ms_3]" : "",
156
+ type === "image" ? "s-min-h-20" : ""
157
+ )}
158
+ {...(href && { href, target: "_blank", rel: "noopener noreferrer" })}
159
+ >
160
+ {isLoading && (
161
+ <div className="s-absolute s-inset-0 s-flex s-items-center s-justify-center">
162
+ <Spinner size="xs" variant="color" />
163
+ </div>
164
+ )}
165
+ <div className={isLoading ? "s-opacity-50" : ""}>{cardContent}</div>
166
+ </CardButton>
167
+ </Tooltip>
167
168
  );
168
169
  }