@wealthx/shadcn 1.5.39 → 1.5.40

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": "@wealthx/shadcn",
3
- "version": "1.5.39",
3
+ "version": "1.5.40",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./src/index.ts",
@@ -1,4 +1,7 @@
1
1
  import * as React from "react";
2
+ import ReactMarkdown from "react-markdown";
3
+ import rehypeRaw from "rehype-raw";
4
+ import rehypeSanitize, { defaultSchema } from "rehype-sanitize";
2
5
  import { Bot, ChevronLeft, ChevronRight, SquarePen, X } from "lucide-react";
3
6
  import { cn } from "@/lib/utils";
4
7
  import { Sheet, SheetContent } from "@/components/ui/sheet";
@@ -66,6 +69,12 @@ export interface SupportAgentMessage {
66
69
  richContent?: SupportAgentRichContent;
67
70
  /** True while the assistant response is streaming in. */
68
71
  isStreaming?: boolean;
72
+ /**
73
+ * Status text shown beside the animated dots while the response streams
74
+ * (e.g. "Checking the help center"). Rendered only while the bubble is empty
75
+ * and streaming. The trailing "…" animates on its own — do not include dots here.
76
+ */
77
+ streamingLabel?: string;
69
78
  /** True if the message errored. */
70
79
  isErrored?: boolean;
71
80
  }
@@ -153,6 +162,28 @@ function SupportTypingIndicator() {
153
162
  );
154
163
  }
155
164
 
165
+ // ---------------------------------------------------------------------------
166
+ // StreamingStatus — optional status label with an animated "…" ellipsis
167
+ // (e.g. "Checking the help center" + animated dots), shown while streaming.
168
+ // ---------------------------------------------------------------------------
169
+
170
+ function StreamingStatus({ label }: { label?: string }) {
171
+ // No label → the standard DS typing indicator (3 bouncing dots).
172
+ if (!label) return <SupportTypingIndicator />;
173
+
174
+ // With label → status text + the same DS typing dots: "Checking the help center • • •"
175
+ return (
176
+ <span
177
+ className="flex items-center gap-1.5 text-sm text-muted-foreground"
178
+ role="status"
179
+ aria-label={`${label}…`}
180
+ >
181
+ <span>{label}</span>
182
+ <SupportTypingIndicator />
183
+ </span>
184
+ );
185
+ }
186
+
156
187
  // ---------------------------------------------------------------------------
157
188
  // MessageBubble — renders a single message with optional rich content
158
189
  // ---------------------------------------------------------------------------
@@ -185,11 +216,24 @@ function MessageBubble({ message }: MessageBubbleProps) {
185
216
  data-role={message.role}
186
217
  >
187
218
  {isEmpty && message.isStreaming ? (
188
- <SupportTypingIndicator />
189
- ) : (
219
+ <StreamingStatus label={message.streamingLabel} />
220
+ ) : isUser ? (
190
221
  <span className="whitespace-pre-wrap break-words leading-relaxed">
191
222
  {message.content}
192
223
  </span>
224
+ ) : (
225
+ <div className="break-words text-sm leading-relaxed [&_a]:text-primary [&_a]:underline [&_p]:m-0 [&_p:not(:last-child)]:mb-2 [&_ul]:my-1 [&_ul]:list-disc [&_ul]:pl-4 [&_ol]:my-1 [&_ol]:list-decimal [&_ol]:pl-4 [&_li]:mb-0.5">
226
+ <ReactMarkdown
227
+ rehypePlugins={[rehypeRaw, [rehypeSanitize, defaultSchema]]}
228
+ components={{
229
+ a: ({ node, ...props }) => (
230
+ <a {...props} target="_blank" rel="noopener noreferrer" />
231
+ ),
232
+ }}
233
+ >
234
+ {message.content}
235
+ </ReactMarkdown>
236
+ </div>
193
237
  )}
194
238
  {message.isErrored && (
195
239
  <p className="mt-1 text-xs opacity-70">