@wealthx/shadcn 1.5.39 → 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.
- package/.turbo/turbo-build.log +118 -118
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-MGIDYXOP.mjs → chunk-DWNLBUDC.mjs} +459 -67
- package/dist/{chunk-EFHPSKVF.mjs → chunk-EGM4DARZ.mjs} +110 -1
- package/dist/{chunk-R7M657QL.mjs → chunk-GIQGZFP6.mjs} +138 -46
- package/dist/{chunk-B5PSUONN.mjs → chunk-TF5TOVIM.mjs} +1 -1
- package/dist/{chunk-RRROLESJ.mjs → chunk-XHZONBL4.mjs} +1 -1
- package/dist/components/ui/ai-assistant-drawer.js +101 -0
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
- package/dist/components/ui/ai-conversations/index.js +101 -0
- package/dist/components/ui/ai-conversations/index.mjs +2 -2
- package/dist/components/ui/chat-input-area.js +101 -0
- package/dist/components/ui/chat-input-area.mjs +1 -1
- package/dist/components/ui/policy-ai/index.js +818 -261
- package/dist/components/ui/policy-ai/index.mjs +11 -2
- package/dist/components/ui/support-agent/index.js +233 -45
- package/dist/components/ui/support-agent/index.mjs +2 -2
- package/dist/index.js +3521 -3330
- package/dist/index.mjs +5 -5
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/ui/chat-input-area.tsx +181 -2
- package/src/components/ui/policy-ai/index.tsx +12 -0
- package/src/components/ui/policy-ai/policy-ai-context-sidebar.tsx +231 -0
- package/src/components/ui/policy-ai/policy-ai-history-panel.tsx +175 -0
- package/src/components/ui/policy-ai/policy-ai-page.tsx +243 -0
- package/src/components/ui/policy-ai/policy-ai-panel.tsx +64 -57
- package/src/components/ui/policy-ai/policy-ai-responses.tsx +8 -12
- package/src/components/ui/support-agent/support-agent-panel.tsx +170 -48
- package/src/styles/styles-css.ts +1 -1
|
@@ -1196,6 +1196,7 @@ function Separator(_a2) {
|
|
|
1196
1196
|
|
|
1197
1197
|
// src/components/ui/chat-input-area.tsx
|
|
1198
1198
|
var React5 = __toESM(require("react"));
|
|
1199
|
+
var import_react_dom = require("react-dom");
|
|
1199
1200
|
var import_lucide_react5 = require("lucide-react");
|
|
1200
1201
|
|
|
1201
1202
|
// src/components/ui/textarea.tsx
|
|
@@ -1218,6 +1219,97 @@ function Textarea(_a2) {
|
|
|
1218
1219
|
// src/components/ui/chat-input-area.tsx
|
|
1219
1220
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1220
1221
|
var DEFAULT_HINT = "Enter to send \xB7 Shift+Enter for new line";
|
|
1222
|
+
var TOOLBAR_ITEMS = [
|
|
1223
|
+
{
|
|
1224
|
+
type: "button",
|
|
1225
|
+
icon: import_lucide_react5.Bold,
|
|
1226
|
+
label: "Bold",
|
|
1227
|
+
title: "Bold (Ctrl+B)",
|
|
1228
|
+
before: "**",
|
|
1229
|
+
after: "**",
|
|
1230
|
+
placeholder: "bold text"
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
type: "button",
|
|
1234
|
+
icon: import_lucide_react5.Italic,
|
|
1235
|
+
label: "Italic",
|
|
1236
|
+
title: "Italic (Ctrl+I)",
|
|
1237
|
+
before: "*",
|
|
1238
|
+
after: "*",
|
|
1239
|
+
placeholder: "italic text"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
type: "button",
|
|
1243
|
+
icon: import_lucide_react5.Code,
|
|
1244
|
+
label: "Inline code",
|
|
1245
|
+
title: "Inline code",
|
|
1246
|
+
before: "`",
|
|
1247
|
+
after: "`",
|
|
1248
|
+
placeholder: "code"
|
|
1249
|
+
},
|
|
1250
|
+
{ type: "divider" },
|
|
1251
|
+
{
|
|
1252
|
+
type: "button",
|
|
1253
|
+
icon: import_lucide_react5.Code2,
|
|
1254
|
+
label: "Code block",
|
|
1255
|
+
title: "Code block",
|
|
1256
|
+
before: "```\n",
|
|
1257
|
+
after: "\n```",
|
|
1258
|
+
placeholder: "code block"
|
|
1259
|
+
}
|
|
1260
|
+
];
|
|
1261
|
+
function applyMarkdown(textarea, before, after, placeholder, onChange) {
|
|
1262
|
+
const start = textarea.selectionStart;
|
|
1263
|
+
const end = textarea.selectionEnd;
|
|
1264
|
+
const selected = textarea.value.slice(start, end);
|
|
1265
|
+
const insertion = selected || placeholder;
|
|
1266
|
+
const next = textarea.value.slice(0, start) + before + insertion + after + textarea.value.slice(end);
|
|
1267
|
+
const newStart = start + before.length;
|
|
1268
|
+
const newEnd = newStart + insertion.length;
|
|
1269
|
+
(0, import_react_dom.flushSync)(() => onChange(next));
|
|
1270
|
+
textarea.focus();
|
|
1271
|
+
textarea.setSelectionRange(newStart, newEnd);
|
|
1272
|
+
}
|
|
1273
|
+
var MarkdownToolbar = React5.memo(function MarkdownToolbar2({
|
|
1274
|
+
textareaRef,
|
|
1275
|
+
onChange,
|
|
1276
|
+
disabled
|
|
1277
|
+
}) {
|
|
1278
|
+
const handleFormat = React5.useCallback(
|
|
1279
|
+
(e) => {
|
|
1280
|
+
if (!textareaRef.current) return;
|
|
1281
|
+
const { before, after, placeholder } = e.currentTarget.dataset;
|
|
1282
|
+
applyMarkdown(textareaRef.current, before, after, placeholder, onChange);
|
|
1283
|
+
},
|
|
1284
|
+
[textareaRef, onChange]
|
|
1285
|
+
);
|
|
1286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex items-center gap-0.5 border-b border-border px-2 py-1", children: TOOLBAR_ITEMS.map(
|
|
1287
|
+
(item, i) => item.type === "divider" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1288
|
+
"span",
|
|
1289
|
+
{
|
|
1290
|
+
className: "mx-0.5 h-3.5 w-px bg-border",
|
|
1291
|
+
"aria-hidden": "true"
|
|
1292
|
+
},
|
|
1293
|
+
i
|
|
1294
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1295
|
+
Button,
|
|
1296
|
+
{
|
|
1297
|
+
variant: "ghost",
|
|
1298
|
+
size: "icon-sm",
|
|
1299
|
+
type: "button",
|
|
1300
|
+
title: item.title,
|
|
1301
|
+
"aria-label": item.label,
|
|
1302
|
+
disabled,
|
|
1303
|
+
"data-before": item.before,
|
|
1304
|
+
"data-after": item.after,
|
|
1305
|
+
"data-placeholder": item.placeholder,
|
|
1306
|
+
onClick: handleFormat,
|
|
1307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(item.icon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1308
|
+
},
|
|
1309
|
+
item.label
|
|
1310
|
+
)
|
|
1311
|
+
) });
|
|
1312
|
+
});
|
|
1221
1313
|
function ChatInputArea({
|
|
1222
1314
|
value,
|
|
1223
1315
|
onChange,
|
|
@@ -1229,6 +1321,7 @@ function ChatInputArea({
|
|
|
1229
1321
|
hint = DEFAULT_HINT,
|
|
1230
1322
|
maxHeight = 160,
|
|
1231
1323
|
autoFocus = false,
|
|
1324
|
+
showMarkdownToolbar = false,
|
|
1232
1325
|
className
|
|
1233
1326
|
}) {
|
|
1234
1327
|
const textareaRef = React5.useRef(null);
|
|
@@ -1297,6 +1390,14 @@ function ChatInputArea({
|
|
|
1297
1390
|
className: cn("flex flex-col gap-1.5", className),
|
|
1298
1391
|
children: [
|
|
1299
1392
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "border border-border bg-background flex flex-col focus-within:ring-1 focus-within:ring-ring", children: [
|
|
1393
|
+
showMarkdownToolbar && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1394
|
+
MarkdownToolbar,
|
|
1395
|
+
{
|
|
1396
|
+
textareaRef,
|
|
1397
|
+
onChange,
|
|
1398
|
+
disabled
|
|
1399
|
+
}
|
|
1400
|
+
),
|
|
1300
1401
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1301
1402
|
Textarea,
|
|
1302
1403
|
{
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
ConversationStatusChip,
|
|
10
10
|
ConversationsPage,
|
|
11
11
|
LeadInfoPanel
|
|
12
|
-
} from "../../../chunk-
|
|
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-
|
|
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
|
{
|