@wealthx/shadcn 1.5.40 → 1.5.42

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.
Files changed (30) hide show
  1. package/.turbo/turbo-build.log +103 -103
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-MGIDYXOP.mjs → chunk-DWNLBUDC.mjs} +459 -67
  4. package/dist/{chunk-EFHPSKVF.mjs → chunk-EGM4DARZ.mjs} +110 -1
  5. package/dist/{chunk-B5PSUONN.mjs → chunk-TF5TOVIM.mjs} +1 -1
  6. package/dist/{chunk-STN5QIWN.mjs → chunk-THOHFAW2.mjs} +119 -46
  7. package/dist/{chunk-RRROLESJ.mjs → chunk-XHZONBL4.mjs} +1 -1
  8. package/dist/components/ui/ai-assistant-drawer.js +101 -0
  9. package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
  10. package/dist/components/ui/ai-conversations/index.js +101 -0
  11. package/dist/components/ui/ai-conversations/index.mjs +2 -2
  12. package/dist/components/ui/chat-input-area.js +101 -0
  13. package/dist/components/ui/chat-input-area.mjs +1 -1
  14. package/dist/components/ui/policy-ai/index.js +818 -261
  15. package/dist/components/ui/policy-ai/index.mjs +11 -2
  16. package/dist/components/ui/support-agent/index.js +218 -44
  17. package/dist/components/ui/support-agent/index.mjs +2 -2
  18. package/dist/index.js +3506 -3329
  19. package/dist/index.mjs +5 -5
  20. package/dist/styles.css +1 -1
  21. package/package.json +1 -1
  22. package/src/components/ui/chat-input-area.tsx +181 -2
  23. package/src/components/ui/policy-ai/index.tsx +12 -0
  24. package/src/components/ui/policy-ai/policy-ai-context-sidebar.tsx +231 -0
  25. package/src/components/ui/policy-ai/policy-ai-history-panel.tsx +175 -0
  26. package/src/components/ui/policy-ai/policy-ai-page.tsx +243 -0
  27. package/src/components/ui/policy-ai/policy-ai-panel.tsx +64 -57
  28. package/src/components/ui/policy-ai/policy-ai-responses.tsx +8 -12
  29. package/src/components/ui/support-agent/support-agent-panel.tsx +153 -46
  30. package/src/styles/styles-css.ts +1 -1
@@ -9,14 +9,14 @@ import {
9
9
  ConversationStatusChip,
10
10
  ConversationsPage,
11
11
  LeadInfoPanel
12
- } from "../../../chunk-RRROLESJ.mjs";
12
+ } from "../../../chunk-XHZONBL4.mjs";
13
13
  import "../../../chunk-3S6KVFF5.mjs";
14
14
  import "../../../chunk-WE4YKBDE.mjs";
15
15
  import "../../../chunk-T5FRVEJQ.mjs";
16
16
  import "../../../chunk-H5DTKPJ2.mjs";
17
17
  import "../../../chunk-H6NQTIF4.mjs";
18
18
  import "../../../chunk-2GIYVERS.mjs";
19
- import "../../../chunk-EFHPSKVF.mjs";
19
+ import "../../../chunk-EGM4DARZ.mjs";
20
20
  import "../../../chunk-BS75ICOO.mjs";
21
21
  import "../../../chunk-X6RC5UWB.mjs";
22
22
  import "../../../chunk-F3CU6KEI.mjs";
@@ -63,6 +63,7 @@ __export(chat_input_area_exports, {
63
63
  });
64
64
  module.exports = __toCommonJS(chat_input_area_exports);
65
65
  var React2 = __toESM(require("react"));
66
+ var import_react_dom = require("react-dom");
66
67
  var import_lucide_react2 = require("lucide-react");
67
68
 
68
69
  // src/lib/utils.ts
@@ -250,6 +251,97 @@ function Textarea(_a) {
250
251
  // src/components/ui/chat-input-area.tsx
251
252
  var import_jsx_runtime3 = require("react/jsx-runtime");
252
253
  var DEFAULT_HINT = "Enter to send \xB7 Shift+Enter for new line";
254
+ var TOOLBAR_ITEMS = [
255
+ {
256
+ type: "button",
257
+ icon: import_lucide_react2.Bold,
258
+ label: "Bold",
259
+ title: "Bold (Ctrl+B)",
260
+ before: "**",
261
+ after: "**",
262
+ placeholder: "bold text"
263
+ },
264
+ {
265
+ type: "button",
266
+ icon: import_lucide_react2.Italic,
267
+ label: "Italic",
268
+ title: "Italic (Ctrl+I)",
269
+ before: "*",
270
+ after: "*",
271
+ placeholder: "italic text"
272
+ },
273
+ {
274
+ type: "button",
275
+ icon: import_lucide_react2.Code,
276
+ label: "Inline code",
277
+ title: "Inline code",
278
+ before: "`",
279
+ after: "`",
280
+ placeholder: "code"
281
+ },
282
+ { type: "divider" },
283
+ {
284
+ type: "button",
285
+ icon: import_lucide_react2.Code2,
286
+ label: "Code block",
287
+ title: "Code block",
288
+ before: "```\n",
289
+ after: "\n```",
290
+ placeholder: "code block"
291
+ }
292
+ ];
293
+ function applyMarkdown(textarea, before, after, placeholder, onChange) {
294
+ const start = textarea.selectionStart;
295
+ const end = textarea.selectionEnd;
296
+ const selected = textarea.value.slice(start, end);
297
+ const insertion = selected || placeholder;
298
+ const next = textarea.value.slice(0, start) + before + insertion + after + textarea.value.slice(end);
299
+ const newStart = start + before.length;
300
+ const newEnd = newStart + insertion.length;
301
+ (0, import_react_dom.flushSync)(() => onChange(next));
302
+ textarea.focus();
303
+ textarea.setSelectionRange(newStart, newEnd);
304
+ }
305
+ var MarkdownToolbar = React2.memo(function MarkdownToolbar2({
306
+ textareaRef,
307
+ onChange,
308
+ disabled
309
+ }) {
310
+ const handleFormat = React2.useCallback(
311
+ (e) => {
312
+ if (!textareaRef.current) return;
313
+ const { before, after, placeholder } = e.currentTarget.dataset;
314
+ applyMarkdown(textareaRef.current, before, after, placeholder, onChange);
315
+ },
316
+ [textareaRef, onChange]
317
+ );
318
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex items-center gap-0.5 border-b border-border px-2 py-1", children: TOOLBAR_ITEMS.map(
319
+ (item, i) => item.type === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
320
+ "span",
321
+ {
322
+ className: "mx-0.5 h-3.5 w-px bg-border",
323
+ "aria-hidden": "true"
324
+ },
325
+ i
326
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
327
+ Button,
328
+ {
329
+ variant: "ghost",
330
+ size: "icon-sm",
331
+ type: "button",
332
+ title: item.title,
333
+ "aria-label": item.label,
334
+ disabled,
335
+ "data-before": item.before,
336
+ "data-after": item.after,
337
+ "data-placeholder": item.placeholder,
338
+ onClick: handleFormat,
339
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(item.icon, { className: "size-3.5", "aria-hidden": "true" })
340
+ },
341
+ item.label
342
+ )
343
+ ) });
344
+ });
253
345
  function ChatInputArea({
254
346
  value,
255
347
  onChange,
@@ -261,6 +353,7 @@ function ChatInputArea({
261
353
  hint = DEFAULT_HINT,
262
354
  maxHeight = 160,
263
355
  autoFocus = false,
356
+ showMarkdownToolbar = false,
264
357
  className
265
358
  }) {
266
359
  const textareaRef = React2.useRef(null);
@@ -329,6 +422,14 @@ function ChatInputArea({
329
422
  className: cn("flex flex-col gap-1.5", className),
330
423
  children: [
331
424
  /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "border border-border bg-background flex flex-col focus-within:ring-1 focus-within:ring-ring", children: [
425
+ showMarkdownToolbar && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
426
+ MarkdownToolbar,
427
+ {
428
+ textareaRef,
429
+ onChange,
430
+ disabled
431
+ }
432
+ ),
332
433
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
333
434
  Textarea,
334
435
  {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ChatInputArea
3
- } from "../../chunk-EFHPSKVF.mjs";
3
+ } from "../../chunk-EGM4DARZ.mjs";
4
4
  import "../../chunk-BS75ICOO.mjs";
5
5
  import "../../chunk-NOOEKOWY.mjs";
6
6
  import "../../chunk-R4HCRDU5.mjs";