@wealthx/shadcn 1.5.40 → 1.5.41

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 +84 -84
  2. package/CHANGELOG.md +6 -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-STN5QIWN.mjs → chunk-GIQGZFP6.mjs} +102 -45
  6. package/dist/{chunk-B5PSUONN.mjs → chunk-TF5TOVIM.mjs} +1 -1
  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 +202 -44
  17. package/dist/components/ui/support-agent/index.mjs +2 -2
  18. package/dist/index.js +3490 -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 +124 -46
  30. package/src/styles/styles-css.ts +1 -1
@@ -1,5 +1,8 @@
1
1
  import {
2
+ PolicyAIContextSidebar,
2
3
  PolicyAIFAB,
4
+ PolicyAIHistoryPanel,
5
+ PolicyAIPage,
3
6
  PolicyAIPanel,
4
7
  PolicyCitationPanel,
5
8
  PolicyComparisonTable,
@@ -7,13 +10,16 @@ import {
7
10
  PolicyRankedList,
8
11
  PolicySingleBankAnswer,
9
12
  PolicyVerdictBadge
10
- } from "../../../chunk-MGIDYXOP.mjs";
13
+ } from "../../../chunk-DWNLBUDC.mjs";
14
+ import "../../../chunk-MZI77ZMX.mjs";
11
15
  import "../../../chunk-FL7DEYUA.mjs";
12
16
  import "../../../chunk-FQYFPHDO.mjs";
13
17
  import "../../../chunk-3S6KVFF5.mjs";
18
+ import "../../../chunk-3VDET466.mjs";
14
19
  import "../../../chunk-WE4YKBDE.mjs";
15
20
  import "../../../chunk-H6NQTIF4.mjs";
16
- import "../../../chunk-EFHPSKVF.mjs";
21
+ import "../../../chunk-2GIYVERS.mjs";
22
+ import "../../../chunk-EGM4DARZ.mjs";
17
23
  import "../../../chunk-BS75ICOO.mjs";
18
24
  import "../../../chunk-X6RC5UWB.mjs";
19
25
  import "../../../chunk-F3CU6KEI.mjs";
@@ -25,7 +31,10 @@ import "../../../chunk-R4HCRDU5.mjs";
25
31
  import "../../../chunk-AFML43VJ.mjs";
26
32
  import "../../../chunk-WNQUEZJF.mjs";
27
33
  export {
34
+ PolicyAIContextSidebar,
28
35
  PolicyAIFAB,
36
+ PolicyAIHistoryPanel,
37
+ PolicyAIPage,
29
38
  PolicyAIPanel,
30
39
  PolicyCitationPanel,
31
40
  PolicyComparisonTable,
@@ -607,6 +607,7 @@ function SheetContent(_a) {
607
607
 
608
608
  // src/components/ui/chat-input-area.tsx
609
609
  var React4 = __toESM(require("react"));
610
+ var import_react_dom = require("react-dom");
610
611
  var import_lucide_react5 = require("lucide-react");
611
612
 
612
613
  // src/components/ui/textarea.tsx
@@ -629,6 +630,97 @@ function Textarea(_a) {
629
630
  // src/components/ui/chat-input-area.tsx
630
631
  var import_jsx_runtime8 = require("react/jsx-runtime");
631
632
  var DEFAULT_HINT = "Enter to send \xB7 Shift+Enter for new line";
633
+ var TOOLBAR_ITEMS = [
634
+ {
635
+ type: "button",
636
+ icon: import_lucide_react5.Bold,
637
+ label: "Bold",
638
+ title: "Bold (Ctrl+B)",
639
+ before: "**",
640
+ after: "**",
641
+ placeholder: "bold text"
642
+ },
643
+ {
644
+ type: "button",
645
+ icon: import_lucide_react5.Italic,
646
+ label: "Italic",
647
+ title: "Italic (Ctrl+I)",
648
+ before: "*",
649
+ after: "*",
650
+ placeholder: "italic text"
651
+ },
652
+ {
653
+ type: "button",
654
+ icon: import_lucide_react5.Code,
655
+ label: "Inline code",
656
+ title: "Inline code",
657
+ before: "`",
658
+ after: "`",
659
+ placeholder: "code"
660
+ },
661
+ { type: "divider" },
662
+ {
663
+ type: "button",
664
+ icon: import_lucide_react5.Code2,
665
+ label: "Code block",
666
+ title: "Code block",
667
+ before: "```\n",
668
+ after: "\n```",
669
+ placeholder: "code block"
670
+ }
671
+ ];
672
+ function applyMarkdown(textarea, before, after, placeholder, onChange) {
673
+ const start = textarea.selectionStart;
674
+ const end = textarea.selectionEnd;
675
+ const selected = textarea.value.slice(start, end);
676
+ const insertion = selected || placeholder;
677
+ const next = textarea.value.slice(0, start) + before + insertion + after + textarea.value.slice(end);
678
+ const newStart = start + before.length;
679
+ const newEnd = newStart + insertion.length;
680
+ (0, import_react_dom.flushSync)(() => onChange(next));
681
+ textarea.focus();
682
+ textarea.setSelectionRange(newStart, newEnd);
683
+ }
684
+ var MarkdownToolbar = React4.memo(function MarkdownToolbar2({
685
+ textareaRef,
686
+ onChange,
687
+ disabled
688
+ }) {
689
+ const handleFormat = React4.useCallback(
690
+ (e) => {
691
+ if (!textareaRef.current) return;
692
+ const { before, after, placeholder } = e.currentTarget.dataset;
693
+ applyMarkdown(textareaRef.current, before, after, placeholder, onChange);
694
+ },
695
+ [textareaRef, onChange]
696
+ );
697
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center gap-0.5 border-b border-border px-2 py-1", children: TOOLBAR_ITEMS.map(
698
+ (item, i) => item.type === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
699
+ "span",
700
+ {
701
+ className: "mx-0.5 h-3.5 w-px bg-border",
702
+ "aria-hidden": "true"
703
+ },
704
+ i
705
+ ) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
706
+ Button,
707
+ {
708
+ variant: "ghost",
709
+ size: "icon-sm",
710
+ type: "button",
711
+ title: item.title,
712
+ "aria-label": item.label,
713
+ disabled,
714
+ "data-before": item.before,
715
+ "data-after": item.after,
716
+ "data-placeholder": item.placeholder,
717
+ onClick: handleFormat,
718
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(item.icon, { className: "size-3.5", "aria-hidden": "true" })
719
+ },
720
+ item.label
721
+ )
722
+ ) });
723
+ });
632
724
  function ChatInputArea({
633
725
  value,
634
726
  onChange,
@@ -640,6 +732,7 @@ function ChatInputArea({
640
732
  hint = DEFAULT_HINT,
641
733
  maxHeight = 160,
642
734
  autoFocus = false,
735
+ showMarkdownToolbar = false,
643
736
  className
644
737
  }) {
645
738
  const textareaRef = React4.useRef(null);
@@ -708,6 +801,14 @@ function ChatInputArea({
708
801
  className: cn("flex flex-col gap-1.5", className),
709
802
  children: [
710
803
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "border border-border bg-background flex flex-col focus-within:ring-1 focus-within:ring-ring", children: [
804
+ showMarkdownToolbar && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
805
+ MarkdownToolbar,
806
+ {
807
+ textareaRef,
808
+ onChange,
809
+ disabled
810
+ }
811
+ ),
711
812
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
712
813
  Textarea,
713
814
  {
@@ -935,6 +1036,49 @@ function RichContentRenderer({ richContent }) {
935
1036
  }
936
1037
  return null;
937
1038
  }
1039
+ function CloseButton({ onClick }) {
1040
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1041
+ Button,
1042
+ {
1043
+ variant: "ghost",
1044
+ size: "icon",
1045
+ className: "size-7 shrink-0",
1046
+ onClick,
1047
+ title: "Close",
1048
+ children: [
1049
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.X, { className: "size-3.5" }),
1050
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
1051
+ ]
1052
+ }
1053
+ );
1054
+ }
1055
+ function ConversationRow({
1056
+ conv,
1057
+ onClick,
1058
+ className
1059
+ }) {
1060
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1061
+ "button",
1062
+ {
1063
+ type: "button",
1064
+ onClick,
1065
+ className: cn(
1066
+ "flex w-full items-center justify-between gap-2 text-left text-sm text-foreground hover:bg-muted/50",
1067
+ className
1068
+ ),
1069
+ children: [
1070
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate", children: conv.title }),
1071
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1072
+ import_lucide_react7.ChevronRight,
1073
+ {
1074
+ className: "size-3.5 shrink-0 text-muted-foreground",
1075
+ "aria-hidden": "true"
1076
+ }
1077
+ )
1078
+ ]
1079
+ }
1080
+ );
1081
+ }
938
1082
  function SupportAgentPanel({
939
1083
  open,
940
1084
  onClose,
@@ -956,9 +1100,13 @@ function SupportAgentPanel({
956
1100
  }) {
957
1101
  var _a;
958
1102
  const [inputValue, setInputValue] = React5.useState("");
1103
+ const [showAllConversations, setShowAllConversations] = React5.useState(false);
959
1104
  const messagesEndRef = React5.useRef(null);
960
1105
  const hasMessages = messages.length > 0;
961
1106
  const isChatMode = hasMessages && !!conversationTitle;
1107
+ React5.useEffect(() => {
1108
+ if (!open) setShowAllConversations(false);
1109
+ }, [open]);
962
1110
  React5.useEffect(() => {
963
1111
  if (!messagesEndRef.current) return;
964
1112
  messagesEndRef.current.scrollIntoView({
@@ -980,6 +1128,17 @@ function SupportAgentPanel({
980
1128
  [onSendMessage]
981
1129
  );
982
1130
  const hasRecents = !!(recentConversations == null ? void 0 : recentConversations.length);
1131
+ const recentsPreview = React5.useMemo(
1132
+ () => {
1133
+ var _a2;
1134
+ return (_a2 = recentConversations == null ? void 0 : recentConversations.slice(0, 3)) != null ? _a2 : [];
1135
+ },
1136
+ [recentConversations]
1137
+ );
1138
+ const handleViewAll = React5.useCallback(() => {
1139
+ setShowAllConversations(true);
1140
+ onViewAllConversations == null ? void 0 : onViewAllConversations();
1141
+ }, [onViewAllConversations]);
983
1142
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Sheet, { open, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
984
1143
  SheetContent,
985
1144
  {
@@ -992,38 +1151,45 @@ function SupportAgentPanel({
992
1151
  "data-slot": "support-agent-panel",
993
1152
  children: [
994
1153
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "shrink-0 border-b border-border px-3 py-2.5", children: [
995
- isChatMode ? (
996
- /* Chat mode: [←] Conversation title [✕] */
1154
+ showAllConversations ? (
1155
+ /* All-conversations mode: [←] All conversations [✕] */
997
1156
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
998
- onBack && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1157
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
999
1158
  Button,
1000
1159
  {
1001
1160
  variant: "ghost",
1002
1161
  size: "icon",
1003
1162
  className: "size-7 shrink-0",
1004
- onClick: onBack,
1005
- title: "Back to conversations",
1163
+ onClick: () => setShowAllConversations(false),
1164
+ title: "Back",
1006
1165
  children: [
1007
1166
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.ChevronLeft, { className: "size-3.5" }),
1008
1167
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Back" })
1009
1168
  ]
1010
1169
  }
1011
1170
  ),
1012
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate px-1 text-sm font-medium text-foreground", children: conversationTitle }),
1013
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1171
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate px-1 text-sm font-medium text-foreground", children: "All conversations" }),
1172
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseButton, { onClick: onClose })
1173
+ ] })
1174
+ ) : isChatMode ? (
1175
+ /* Chat mode: [←] Conversation title [✕] */
1176
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-1", children: [
1177
+ onBack && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1014
1178
  Button,
1015
1179
  {
1016
1180
  variant: "ghost",
1017
1181
  size: "icon",
1018
1182
  className: "size-7 shrink-0",
1019
- onClick: onClose,
1020
- title: "Close",
1183
+ onClick: onBack,
1184
+ title: "Back to conversations",
1021
1185
  children: [
1022
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.X, { className: "size-3.5" }),
1023
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
1186
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.ChevronLeft, { className: "size-3.5" }),
1187
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Back" })
1024
1188
  ]
1025
1189
  }
1026
- )
1190
+ ),
1191
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate px-1 text-sm font-medium text-foreground", children: conversationTitle }),
1192
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseButton, { onClick: onClose })
1027
1193
  ] })
1028
1194
  ) : (
1029
1195
  /* Home mode: [Bot icon] Support Assistant [✕] */
@@ -1038,23 +1204,10 @@ function SupportAgentPanel({
1038
1204
  ) }),
1039
1205
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-sm font-semibold text-foreground", children: "Support Assistant" })
1040
1206
  ] }),
1041
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1042
- Button,
1043
- {
1044
- variant: "ghost",
1045
- size: "icon",
1046
- className: "size-7",
1047
- onClick: onClose,
1048
- title: "Close",
1049
- children: [
1050
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.X, { className: "size-3.5" }),
1051
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
1052
- ]
1053
- }
1054
- )
1207
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CloseButton, { onClick: onClose })
1055
1208
  ] })
1056
1209
  ),
1057
- context && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SupportContextChip, { context }) })
1210
+ context && !showAllConversations && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SupportContextChip, { context }) })
1058
1211
  ] }),
1059
1212
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-1 flex-col overflow-y-auto", children: isLoading ? (
1060
1213
  /* Loading state */
@@ -1062,6 +1215,20 @@ function SupportAgentPanel({
1062
1215
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Spinner, { size: "lg", className: "text-muted-foreground" }),
1063
1216
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "text-sm text-muted-foreground", children: "Loading\u2026" })
1064
1217
  ] }) })
1218
+ ) : showAllConversations ? (
1219
+ /* All conversations — full scrollable list (Jira Rovo pattern) */
1220
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col", children: (recentConversations == null ? void 0 : recentConversations.length) ? recentConversations.map((conv) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1221
+ ConversationRow,
1222
+ {
1223
+ conv,
1224
+ onClick: () => {
1225
+ setShowAllConversations(false);
1226
+ onOpenConversation == null ? void 0 : onOpenConversation(conv.id);
1227
+ },
1228
+ className: "border-b border-border px-4 py-3"
1229
+ },
1230
+ conv.id
1231
+ )) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "p-4 text-sm text-muted-foreground", children: "No conversations yet." }) })
1065
1232
  ) : !hasMessages ? (
1066
1233
  /* Home state — Rovo pattern: New Chat CTA + Recents + Suggested */
1067
1234
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-5 p-4", children: [
@@ -1080,31 +1247,21 @@ function SupportAgentPanel({
1080
1247
  ),
1081
1248
  hasRecents && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-1", children: [
1082
1249
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "px-1 text-xs font-medium uppercase tracking-wide text-muted-foreground", children: "Recents" }),
1083
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col", children: recentConversations.map((conv) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1084
- "button",
1250
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col", children: recentsPreview.map((conv) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1251
+ ConversationRow,
1085
1252
  {
1086
- type: "button",
1253
+ conv,
1087
1254
  onClick: () => onOpenConversation == null ? void 0 : onOpenConversation(conv.id),
1088
- className: "flex w-full items-center justify-between gap-2 px-1 py-2.5 text-left text-sm text-foreground hover:bg-muted/50",
1089
- children: [
1090
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate", children: conv.title }),
1091
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1092
- import_lucide_react7.ChevronRight,
1093
- {
1094
- className: "size-3.5 shrink-0 text-muted-foreground",
1095
- "aria-hidden": "true"
1096
- }
1097
- )
1098
- ]
1255
+ className: "px-1 py-2.5"
1099
1256
  },
1100
1257
  conv.id
1101
1258
  )) }),
1102
- onViewAllConversations && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1259
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1103
1260
  Button,
1104
1261
  {
1105
1262
  variant: "ghost",
1106
1263
  size: "sm",
1107
- onClick: onViewAllConversations,
1264
+ onClick: handleViewAll,
1108
1265
  className: "h-auto w-fit gap-0.5 px-1 py-1 text-xs text-muted-foreground hover:bg-transparent hover:text-foreground",
1109
1266
  children: [
1110
1267
  "View all conversations",
@@ -1143,7 +1300,8 @@ function SupportAgentPanel({
1143
1300
  onAttachFile,
1144
1301
  onAttachImage,
1145
1302
  disabled: isLoading || isStreaming,
1146
- placeholder: "Ask anything\u2026"
1303
+ placeholder: "Ask anything\u2026",
1304
+ showMarkdownToolbar: true
1147
1305
  }
1148
1306
  ) })
1149
1307
  ]
@@ -5,9 +5,9 @@ import {
5
5
  SupportContextChip,
6
6
  SupportStepGuideCard,
7
7
  SupportSuggestedQuestion
8
- } from "../../../chunk-STN5QIWN.mjs";
8
+ } from "../../../chunk-GIQGZFP6.mjs";
9
9
  import "../../../chunk-GTAVSBDO.mjs";
10
- import "../../../chunk-EFHPSKVF.mjs";
10
+ import "../../../chunk-EGM4DARZ.mjs";
11
11
  import "../../../chunk-H3PTREG6.mjs";
12
12
  import "../../../chunk-BS75ICOO.mjs";
13
13
  import "../../../chunk-JVMXMFBB.mjs";