@wealthx/shadcn 1.5.37 → 1.5.39

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 (60) hide show
  1. package/.turbo/turbo-build.log +142 -133
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-LSSIWLYU.mjs → chunk-6XNEHTII.mjs} +1 -1
  4. package/dist/{chunk-ULQ53FRJ.mjs → chunk-7NQKFPXE.mjs} +1 -1
  5. package/dist/{chunk-734FOOJC.mjs → chunk-B5PSUONN.mjs} +25 -58
  6. package/dist/{chunk-DSVKEVX6.mjs → chunk-CZOGJC76.mjs} +1 -1
  7. package/dist/chunk-EFHPSKVF.mjs +192 -0
  8. package/dist/{chunk-JPGL36WQ.mjs → chunk-FL7DEYUA.mjs} +6 -7
  9. package/dist/{chunk-2CHH5QOA.mjs → chunk-FQUT5XD6.mjs} +1 -1
  10. package/dist/chunk-MGIDYXOP.mjs +814 -0
  11. package/dist/{chunk-OG2VM34K.mjs → chunk-MHBQJVHE.mjs} +1 -1
  12. package/dist/{chunk-NB3ZL36B.mjs → chunk-MZI77ZMX.mjs} +17 -2
  13. package/dist/chunk-R7M657QL.mjs +587 -0
  14. package/dist/{chunk-DIH2NZZ3.mjs → chunk-RRROLESJ.mjs} +33 -23
  15. package/dist/components/ui/ai-assistant-drawer.js +269 -121
  16. package/dist/components/ui/ai-assistant-drawer.mjs +2 -1
  17. package/dist/components/ui/ai-conversations/index.js +474 -286
  18. package/dist/components/ui/ai-conversations/index.mjs +2 -1
  19. package/dist/components/ui/chat-input-area.js +429 -0
  20. package/dist/components/ui/chat-input-area.mjs +11 -0
  21. package/dist/components/ui/file-preview-dialog.js +6 -7
  22. package/dist/components/ui/file-preview-dialog.mjs +2 -2
  23. package/dist/components/ui/kanban-column.js +6 -7
  24. package/dist/components/ui/kanban-column.mjs +3 -3
  25. package/dist/components/ui/opportunity-card.js +6 -7
  26. package/dist/components/ui/opportunity-card.mjs +2 -2
  27. package/dist/components/ui/page-top-bar.js +182 -5
  28. package/dist/components/ui/page-top-bar.mjs +3 -1
  29. package/dist/components/ui/pipeline-board.js +6 -7
  30. package/dist/components/ui/pipeline-board.mjs +4 -4
  31. package/dist/components/ui/policy-ai/index.js +1636 -0
  32. package/dist/components/ui/policy-ai/index.mjs +36 -0
  33. package/dist/components/ui/progress.js +6 -7
  34. package/dist/components/ui/progress.mjs +1 -1
  35. package/dist/components/ui/stage-timeline.js +6 -7
  36. package/dist/components/ui/stage-timeline.mjs +2 -2
  37. package/dist/components/ui/support-agent/index.js +1131 -0
  38. package/dist/components/ui/support-agent/index.mjs +27 -0
  39. package/dist/index.js +5609 -4100
  40. package/dist/index.mjs +77 -41
  41. package/dist/styles.css +1 -1
  42. package/package.json +16 -1
  43. package/src/components/index.tsx +54 -0
  44. package/src/components/ui/ai-assistant-drawer.tsx +24 -51
  45. package/src/components/ui/ai-conversations/index.tsx +16 -8
  46. package/src/components/ui/ai-conversations/thread.tsx +38 -27
  47. package/src/components/ui/chat-input-area.tsx +244 -0
  48. package/src/components/ui/page-top-bar.tsx +31 -5
  49. package/src/components/ui/policy-ai/index.tsx +41 -0
  50. package/src/components/ui/policy-ai/policy-ai-panel.tsx +526 -0
  51. package/src/components/ui/policy-ai/policy-ai-primitives.tsx +332 -0
  52. package/src/components/ui/policy-ai/policy-ai-responses.tsx +543 -0
  53. package/src/components/ui/progress.tsx +15 -12
  54. package/src/components/ui/support-agent/index.tsx +25 -0
  55. package/src/components/ui/support-agent/support-agent-fab.tsx +116 -0
  56. package/src/components/ui/support-agent/support-agent-panel.tsx +498 -0
  57. package/src/components/ui/support-agent/support-agent-primitives.tsx +354 -0
  58. package/src/styles/globals.css +1 -0
  59. package/src/styles/styles-css.ts +1 -1
  60. package/tsup.config.ts +3 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @wealthx/shadcn
2
2
 
3
+ ## 1.5.39
4
+
5
+ ### Patch Changes
6
+
7
+ - 42ad9ee: Policy AI
8
+
9
+ ## 1.5.38
10
+
11
+ ### Patch Changes
12
+
13
+ - bb62d05: Add support agent
14
+
3
15
  ## 1.5.37
4
16
 
5
17
  ### Patch Changes
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-L6LE4OIM.mjs";
4
4
  import {
5
5
  Progress
6
- } from "./chunk-JPGL36WQ.mjs";
6
+ } from "./chunk-FL7DEYUA.mjs";
7
7
  import {
8
8
  Spinner
9
9
  } from "./chunk-JVMXMFBB.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Progress
3
- } from "./chunk-JPGL36WQ.mjs";
3
+ } from "./chunk-FL7DEYUA.mjs";
4
4
  import {
5
5
  Skeleton
6
6
  } from "./chunk-GTAVSBDO.mjs";
@@ -1,10 +1,10 @@
1
+ import {
2
+ ChatInputArea
3
+ } from "./chunk-EFHPSKVF.mjs";
1
4
  import {
2
5
  Sheet,
3
6
  SheetContent
4
7
  } from "./chunk-H3PTREG6.mjs";
5
- import {
6
- Textarea
7
- } from "./chunk-BS75ICOO.mjs";
8
8
  import {
9
9
  Spinner
10
10
  } from "./chunk-JVMXMFBB.mjs";
@@ -20,7 +20,7 @@ import {
20
20
 
21
21
  // src/components/ui/ai-assistant-drawer.tsx
22
22
  import * as React from "react";
23
- import { Bot, RotateCcw, Send, X } from "lucide-react";
23
+ import { Bot, RotateCcw, X } from "lucide-react";
24
24
  import { jsx, jsxs } from "react/jsx-runtime";
25
25
  function AiTypingIndicator() {
26
26
  return /* @__PURE__ */ jsx("span", { className: "flex items-center gap-1 py-1", "aria-label": "AI is thinking", children: [0, 150, 300].map((delay) => /* @__PURE__ */ jsx(
@@ -106,16 +106,16 @@ function AiAssistantDrawer({
106
106
  isStreaming = false,
107
107
  isLoading = false,
108
108
  onSendMessage,
109
+ onAttachFile,
110
+ onAttachImage,
109
111
  onReset,
110
112
  className
111
113
  }) {
112
114
  var _a;
113
115
  const [inputValue, setInputValue] = React.useState("");
114
116
  const messagesEndRef = React.useRef(null);
115
- const textareaRef = React.useRef(null);
116
117
  const suggestions = taskSuggestions != null ? taskSuggestions : DEFAULT_SUGGESTIONS;
117
118
  const hasMessages = messages.length > 0;
118
- const canSend = inputValue.trim().length > 0 && !isStreaming && !isLoading;
119
119
  React.useEffect(() => {
120
120
  if (!messagesEndRef.current) return;
121
121
  messagesEndRef.current.scrollIntoView({
@@ -123,28 +123,15 @@ function AiAssistantDrawer({
123
123
  block: "nearest"
124
124
  });
125
125
  }, [messages.length]);
126
- React.useEffect(() => {
127
- const el = textareaRef.current;
128
- if (!el) return;
129
- el.style.height = "auto";
130
- el.style.height = `${Math.min(el.scrollHeight, 120)}px`;
131
- }, [inputValue]);
132
- const handleSend = React.useCallback(() => {
133
- const text = inputValue.trim();
134
- if (!text || !canSend) return;
135
- onSendMessage == null ? void 0 : onSendMessage(text);
136
- setInputValue("");
137
- }, [inputValue, canSend, onSendMessage]);
138
- const handleKeyDown = (e) => {
139
- if (e.key === "Enter" && !e.shiftKey) {
140
- e.preventDefault();
141
- handleSend();
142
- }
143
- };
126
+ const handleSend = React.useCallback(
127
+ (text) => {
128
+ onSendMessage == null ? void 0 : onSendMessage(text);
129
+ setInputValue("");
130
+ },
131
+ [onSendMessage]
132
+ );
144
133
  const handleSuggestionSelect = (text) => {
145
- var _a2;
146
134
  setInputValue(text);
147
- (_a2 = textareaRef.current) == null ? void 0 : _a2.focus();
148
135
  };
149
136
  return /* @__PURE__ */ jsx(Sheet, { open, onOpenChange: (o) => !o && onClose(), children: /* @__PURE__ */ jsxs(
150
137
  SheetContent,
@@ -252,38 +239,18 @@ function AiAssistantDrawer({
252
239
  /* @__PURE__ */ jsx("div", { ref: messagesEndRef })
253
240
  ] })
254
241
  ) }),
255
- /* @__PURE__ */ jsxs("div", { className: "border-t border-border p-3", children: [
256
- /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
257
- /* @__PURE__ */ jsx(
258
- Textarea,
259
- {
260
- ref: textareaRef,
261
- value: inputValue,
262
- onChange: (e) => setInputValue(e.target.value),
263
- onKeyDown: handleKeyDown,
264
- placeholder: "Ask me anything\u2026 (Enter to send, Shift+Enter for new line)",
265
- rows: 1,
266
- disabled: isLoading,
267
- className: "min-h-0 flex-1 resize-none overflow-hidden py-2 text-sm"
268
- }
269
- ),
270
- /* @__PURE__ */ jsxs(
271
- Button,
272
- {
273
- size: "icon",
274
- onClick: handleSend,
275
- disabled: !canSend,
276
- className: "shrink-0",
277
- title: "Send",
278
- children: [
279
- /* @__PURE__ */ jsx(Send, { className: "size-4" }),
280
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Send message" })
281
- ]
282
- }
283
- )
284
- ] }),
285
- /* @__PURE__ */ jsx("p", { className: "mt-1.5 text-[10px] text-muted-foreground", children: "Enter to send \xB7 Shift+Enter for new line" })
286
- ] })
242
+ /* @__PURE__ */ jsx("div", { className: "border-t border-border p-3", children: /* @__PURE__ */ jsx(
243
+ ChatInputArea,
244
+ {
245
+ value: inputValue,
246
+ onChange: setInputValue,
247
+ onSend: handleSend,
248
+ onAttachFile,
249
+ onAttachImage,
250
+ disabled: isLoading || isStreaming,
251
+ placeholder: "Ask me anything\u2026"
252
+ }
253
+ ) })
287
254
  ]
288
255
  }
289
256
  ) });
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-L6LE4OIM.mjs";
4
4
  import {
5
5
  Progress
6
- } from "./chunk-JPGL36WQ.mjs";
6
+ } from "./chunk-FL7DEYUA.mjs";
7
7
  import {
8
8
  DropdownMenu,
9
9
  DropdownMenuContent,
@@ -0,0 +1,192 @@
1
+ import {
2
+ Textarea
3
+ } from "./chunk-BS75ICOO.mjs";
4
+ import {
5
+ Button
6
+ } from "./chunk-NOOEKOWY.mjs";
7
+ import {
8
+ cn
9
+ } from "./chunk-AFML43VJ.mjs";
10
+
11
+ // src/components/ui/chat-input-area.tsx
12
+ import * as React from "react";
13
+ import { ImagePlus, Paperclip, Send } from "lucide-react";
14
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
15
+ var DEFAULT_HINT = "Enter to send \xB7 Shift+Enter for new line";
16
+ function ChatInputArea({
17
+ value,
18
+ onChange,
19
+ onSend,
20
+ onAttachFile,
21
+ onAttachImage,
22
+ disabled = false,
23
+ placeholder = "Type your message\u2026",
24
+ hint = DEFAULT_HINT,
25
+ maxHeight = 160,
26
+ autoFocus = false,
27
+ className
28
+ }) {
29
+ const textareaRef = React.useRef(null);
30
+ const fileInputRef = React.useRef(null);
31
+ const imageInputRef = React.useRef(null);
32
+ React.useEffect(() => {
33
+ if (autoFocus) {
34
+ setTimeout(() => {
35
+ var _a;
36
+ return (_a = textareaRef.current) == null ? void 0 : _a.focus();
37
+ }, 50);
38
+ }
39
+ }, [autoFocus]);
40
+ const handleSend = React.useCallback(() => {
41
+ const text = value.trim();
42
+ if (!text || disabled) return;
43
+ onSend(text);
44
+ if (textareaRef.current) {
45
+ textareaRef.current.style.height = "auto";
46
+ }
47
+ }, [value, disabled, onSend]);
48
+ const handleKeyDown = React.useCallback(
49
+ (e) => {
50
+ if (e.key === "Enter" && !e.shiftKey) {
51
+ e.preventDefault();
52
+ handleSend();
53
+ }
54
+ },
55
+ [handleSend]
56
+ );
57
+ const handleTextareaChange = React.useCallback(
58
+ (e) => {
59
+ onChange(e.target.value);
60
+ const el = e.target;
61
+ el.style.height = "auto";
62
+ el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;
63
+ },
64
+ [onChange, maxHeight]
65
+ );
66
+ const handleFileChange = React.useCallback(
67
+ (e) => {
68
+ var _a;
69
+ if ((_a = e.target.files) == null ? void 0 : _a.length) {
70
+ onAttachFile == null ? void 0 : onAttachFile(e.target.files);
71
+ e.target.value = "";
72
+ }
73
+ },
74
+ [onAttachFile]
75
+ );
76
+ const handleImageChange = React.useCallback(
77
+ (e) => {
78
+ var _a;
79
+ if ((_a = e.target.files) == null ? void 0 : _a.length) {
80
+ onAttachImage == null ? void 0 : onAttachImage(e.target.files);
81
+ e.target.value = "";
82
+ }
83
+ },
84
+ [onAttachImage]
85
+ );
86
+ const showFileButton = typeof onAttachFile === "function";
87
+ const showImageButton = typeof onAttachImage === "function";
88
+ return /* @__PURE__ */ jsxs(
89
+ "div",
90
+ {
91
+ "data-slot": "chat-input-area",
92
+ className: cn("flex flex-col gap-1.5", className),
93
+ children: [
94
+ /* @__PURE__ */ jsxs("div", { className: "border border-border bg-background flex flex-col focus-within:ring-1 focus-within:ring-ring", children: [
95
+ /* @__PURE__ */ jsx(
96
+ Textarea,
97
+ {
98
+ ref: textareaRef,
99
+ value,
100
+ onChange: handleTextareaChange,
101
+ onKeyDown: handleKeyDown,
102
+ placeholder,
103
+ disabled,
104
+ rows: 3,
105
+ className: "resize-none text-sm border-0 shadow-none focus-visible:ring-0 px-3 pt-3 pb-1 min-h-[72px]",
106
+ "aria-label": placeholder
107
+ }
108
+ ),
109
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-2 pb-2", children: [
110
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-0.5", children: [
111
+ showFileButton && /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ /* @__PURE__ */ jsx(
113
+ Button,
114
+ {
115
+ variant: "ghost",
116
+ size: "icon-sm",
117
+ type: "button",
118
+ title: "Attach file",
119
+ "aria-label": "Attach file",
120
+ disabled,
121
+ onClick: () => {
122
+ var _a;
123
+ return (_a = fileInputRef.current) == null ? void 0 : _a.click();
124
+ },
125
+ children: /* @__PURE__ */ jsx(Paperclip, { className: "size-3.5", "aria-hidden": "true" })
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx(
129
+ "input",
130
+ {
131
+ ref: fileInputRef,
132
+ type: "file",
133
+ multiple: true,
134
+ className: "sr-only",
135
+ tabIndex: -1,
136
+ onChange: handleFileChange
137
+ }
138
+ )
139
+ ] }),
140
+ showImageButton && /* @__PURE__ */ jsxs(Fragment, { children: [
141
+ /* @__PURE__ */ jsx(
142
+ Button,
143
+ {
144
+ variant: "ghost",
145
+ size: "icon-sm",
146
+ type: "button",
147
+ title: "Upload image",
148
+ "aria-label": "Upload image",
149
+ disabled,
150
+ onClick: () => {
151
+ var _a;
152
+ return (_a = imageInputRef.current) == null ? void 0 : _a.click();
153
+ },
154
+ children: /* @__PURE__ */ jsx(ImagePlus, { className: "size-3.5", "aria-hidden": "true" })
155
+ }
156
+ ),
157
+ /* @__PURE__ */ jsx(
158
+ "input",
159
+ {
160
+ ref: imageInputRef,
161
+ type: "file",
162
+ multiple: true,
163
+ accept: "image/*",
164
+ className: "sr-only",
165
+ tabIndex: -1,
166
+ onChange: handleImageChange
167
+ }
168
+ )
169
+ ] })
170
+ ] }),
171
+ /* @__PURE__ */ jsx(
172
+ Button,
173
+ {
174
+ size: "icon-sm",
175
+ type: "button",
176
+ "aria-label": "Send message",
177
+ disabled: !value.trim() || disabled,
178
+ onClick: handleSend,
179
+ children: /* @__PURE__ */ jsx(Send, { className: "size-3.5", "aria-hidden": "true" })
180
+ }
181
+ )
182
+ ] })
183
+ ] }),
184
+ hint !== false && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint })
185
+ ]
186
+ }
187
+ );
188
+ }
189
+
190
+ export {
191
+ ChatInputArea
192
+ };
@@ -13,25 +13,24 @@ import { jsx } from "react/jsx-runtime";
13
13
  function Progress(_a) {
14
14
  var _b = _a, {
15
15
  className,
16
- value
16
+ value,
17
+ indicatorClassName
17
18
  } = _b, props = __objRest(_b, [
18
19
  "className",
19
- "value"
20
+ "value",
21
+ "indicatorClassName"
20
22
  ]);
21
23
  return /* @__PURE__ */ jsx(
22
24
  ProgressPrimitive.Root,
23
25
  __spreadProps(__spreadValues({
24
- className: cn(
25
- "relative h-2 w-full overflow-hidden bg-muted",
26
- className
27
- ),
26
+ className: cn("relative h-2 w-full overflow-hidden bg-muted", className),
28
27
  "data-slot": "progress",
29
28
  value
30
29
  }, props), {
31
30
  children: /* @__PURE__ */ jsx(ProgressPrimitive.Track, { className: "h-full", children: /* @__PURE__ */ jsx(
32
31
  ProgressPrimitive.Indicator,
33
32
  {
34
- className: "h-full bg-primary transition-all",
33
+ className: cn("h-full bg-primary transition-all", indicatorClassName),
35
34
  "data-slot": "progress-indicator"
36
35
  }
37
36
  ) })
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  KanbanColumn
3
- } from "./chunk-OG2VM34K.mjs";
3
+ } from "./chunk-MHBQJVHE.mjs";
4
4
  import {
5
5
  ToggleGroup,
6
6
  ToggleGroupItem