@wealthx/shadcn 1.5.37 → 1.5.38
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 +99 -93
- package/CHANGELOG.md +6 -0
- package/dist/{chunk-734FOOJC.mjs → chunk-B5PSUONN.mjs} +25 -58
- package/dist/chunk-EFHPSKVF.mjs +192 -0
- package/dist/{chunk-NB3ZL36B.mjs → chunk-MZI77ZMX.mjs} +17 -2
- package/dist/chunk-R7M657QL.mjs +587 -0
- package/dist/{chunk-DIH2NZZ3.mjs → chunk-RRROLESJ.mjs} +33 -23
- package/dist/components/ui/ai-assistant-drawer.js +269 -121
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -1
- package/dist/components/ui/ai-conversations/index.js +474 -286
- package/dist/components/ui/ai-conversations/index.mjs +2 -1
- package/dist/components/ui/chat-input-area.js +429 -0
- package/dist/components/ui/chat-input-area.mjs +11 -0
- package/dist/components/ui/page-top-bar.js +182 -5
- package/dist/components/ui/page-top-bar.mjs +3 -1
- package/dist/components/ui/support-agent/index.js +1131 -0
- package/dist/components/ui/support-agent/index.mjs +27 -0
- package/dist/index.js +4760 -4027
- package/dist/index.mjs +54 -36
- package/dist/styles.css +1 -1
- package/package.json +11 -1
- package/src/components/index.tsx +24 -0
- package/src/components/ui/ai-assistant-drawer.tsx +24 -51
- package/src/components/ui/ai-conversations/index.tsx +16 -8
- package/src/components/ui/ai-conversations/thread.tsx +38 -27
- package/src/components/ui/chat-input-area.tsx +244 -0
- package/src/components/ui/page-top-bar.tsx +31 -5
- package/src/components/ui/support-agent/index.tsx +25 -0
- package/src/components/ui/support-agent/support-agent-fab.tsx +116 -0
- package/src/components/ui/support-agent/support-agent-panel.tsx +498 -0
- package/src/components/ui/support-agent/support-agent-primitives.tsx +354 -0
- package/src/styles/globals.css +1 -0
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +2 -0
|
@@ -9,13 +9,14 @@ import {
|
|
|
9
9
|
ConversationStatusChip,
|
|
10
10
|
ConversationsPage,
|
|
11
11
|
LeadInfoPanel
|
|
12
|
-
} from "../../../chunk-
|
|
12
|
+
} from "../../../chunk-RRROLESJ.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
20
|
import "../../../chunk-BS75ICOO.mjs";
|
|
20
21
|
import "../../../chunk-X6RC5UWB.mjs";
|
|
21
22
|
import "../../../chunk-F3CU6KEI.mjs";
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/components/ui/chat-input-area.tsx
|
|
60
|
+
var chat_input_area_exports = {};
|
|
61
|
+
__export(chat_input_area_exports, {
|
|
62
|
+
ChatInputArea: () => ChatInputArea
|
|
63
|
+
});
|
|
64
|
+
module.exports = __toCommonJS(chat_input_area_exports);
|
|
65
|
+
var React2 = __toESM(require("react"));
|
|
66
|
+
var import_lucide_react2 = require("lucide-react");
|
|
67
|
+
|
|
68
|
+
// src/lib/utils.ts
|
|
69
|
+
var import_clsx = require("clsx");
|
|
70
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
71
|
+
var twMerge = (0, import_tailwind_merge.extendTailwindMerge)({
|
|
72
|
+
extend: {
|
|
73
|
+
classGroups: {
|
|
74
|
+
"font-size": [
|
|
75
|
+
{
|
|
76
|
+
text: [
|
|
77
|
+
"display-large",
|
|
78
|
+
"display-medium",
|
|
79
|
+
"display-small",
|
|
80
|
+
"h1",
|
|
81
|
+
"h2",
|
|
82
|
+
"h3",
|
|
83
|
+
"h4",
|
|
84
|
+
"h5",
|
|
85
|
+
"h6",
|
|
86
|
+
"body-large",
|
|
87
|
+
"body-medium",
|
|
88
|
+
"body-small",
|
|
89
|
+
"label-large",
|
|
90
|
+
"label-medium",
|
|
91
|
+
"label-small",
|
|
92
|
+
"button",
|
|
93
|
+
"button-xs",
|
|
94
|
+
"caption",
|
|
95
|
+
"overline",
|
|
96
|
+
"code"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
function cn(...inputs) {
|
|
104
|
+
return twMerge((0, import_clsx.clsx)(inputs));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/components/ui/button.tsx
|
|
108
|
+
var import_react = require("react");
|
|
109
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
110
|
+
var import_lucide_react = require("lucide-react");
|
|
111
|
+
|
|
112
|
+
// src/lib/slot.tsx
|
|
113
|
+
var React = __toESM(require("react"));
|
|
114
|
+
function mergeRefs(...refs) {
|
|
115
|
+
return (value) => {
|
|
116
|
+
for (const ref of refs) {
|
|
117
|
+
if (typeof ref === "function") ref(value);
|
|
118
|
+
else if (ref !== null)
|
|
119
|
+
ref.current = value;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var Slot = React.forwardRef(
|
|
124
|
+
(_a, forwardedRef) => {
|
|
125
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
126
|
+
const child = React.Children.only(children);
|
|
127
|
+
if (!React.isValidElement(child)) return null;
|
|
128
|
+
const childProps = child.props;
|
|
129
|
+
const merged = __spreadValues({}, props);
|
|
130
|
+
for (const key of Object.keys(childProps)) {
|
|
131
|
+
if (key === "className") {
|
|
132
|
+
merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
|
|
133
|
+
} else if (key === "style") {
|
|
134
|
+
merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
|
|
135
|
+
} else if (key.startsWith("on") && typeof childProps[key] === "function") {
|
|
136
|
+
const parentHandler = props[key];
|
|
137
|
+
if (typeof parentHandler === "function") {
|
|
138
|
+
merged[key] = (...args) => {
|
|
139
|
+
childProps[key](...args);
|
|
140
|
+
parentHandler(...args);
|
|
141
|
+
};
|
|
142
|
+
} else {
|
|
143
|
+
merged[key] = childProps[key];
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
merged[key] = childProps[key];
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const childRef = child.ref;
|
|
150
|
+
merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
|
|
151
|
+
return React.cloneElement(
|
|
152
|
+
child,
|
|
153
|
+
merged
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
Slot.displayName = "Slot";
|
|
158
|
+
|
|
159
|
+
// src/components/ui/button.tsx
|
|
160
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
161
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
162
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
163
|
+
{
|
|
164
|
+
variants: {
|
|
165
|
+
variant: {
|
|
166
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
167
|
+
secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
|
|
168
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
169
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground focus-visible:border-border focus-visible:ring-border/50 dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
170
|
+
"outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
|
|
171
|
+
"outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:border-brand-secondary focus-visible:ring-brand-secondary/30",
|
|
172
|
+
ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs focus-visible:ring-border/50 dark:hover:bg-accent/50",
|
|
173
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
174
|
+
},
|
|
175
|
+
size: {
|
|
176
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
177
|
+
xs: "h-6 gap-1 px-2 text-button-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
178
|
+
sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
179
|
+
lg: "h-10 px-6 has-[>svg]:px-4",
|
|
180
|
+
icon: "size-9",
|
|
181
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
182
|
+
"icon-sm": "size-8",
|
|
183
|
+
"icon-lg": "size-10"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
defaultVariants: {
|
|
187
|
+
variant: "default",
|
|
188
|
+
size: "default"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
193
|
+
var _b = _a, {
|
|
194
|
+
className,
|
|
195
|
+
variant,
|
|
196
|
+
size,
|
|
197
|
+
asChild = false,
|
|
198
|
+
loading = false,
|
|
199
|
+
disabled,
|
|
200
|
+
type = "button",
|
|
201
|
+
children
|
|
202
|
+
} = _b, props = __objRest(_b, [
|
|
203
|
+
"className",
|
|
204
|
+
"variant",
|
|
205
|
+
"size",
|
|
206
|
+
"asChild",
|
|
207
|
+
"loading",
|
|
208
|
+
"disabled",
|
|
209
|
+
"type",
|
|
210
|
+
"children"
|
|
211
|
+
]);
|
|
212
|
+
const Comp = asChild ? Slot : "button";
|
|
213
|
+
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
215
|
+
Comp,
|
|
216
|
+
__spreadProps(__spreadValues({
|
|
217
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
218
|
+
"data-size": size,
|
|
219
|
+
"data-slot": "button",
|
|
220
|
+
"data-variant": variant,
|
|
221
|
+
disabled: loading || disabled,
|
|
222
|
+
ref,
|
|
223
|
+
type
|
|
224
|
+
}, props), {
|
|
225
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
227
|
+
!isIconOnly && children
|
|
228
|
+
] }) : children
|
|
229
|
+
})
|
|
230
|
+
);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// src/components/ui/textarea.tsx
|
|
234
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
235
|
+
function Textarea(_a) {
|
|
236
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
238
|
+
"textarea",
|
|
239
|
+
__spreadValues({
|
|
240
|
+
className: cn(
|
|
241
|
+
// WealthX: removed shadow-xs (flat panels), added font-sans
|
|
242
|
+
"flex field-sizing-content min-h-16 w-full border border-input bg-transparent px-3 py-2 text-body-medium font-sans transition-[color,box-shadow] outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
|
|
243
|
+
className
|
|
244
|
+
),
|
|
245
|
+
"data-slot": "textarea"
|
|
246
|
+
}, props)
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// src/components/ui/chat-input-area.tsx
|
|
251
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
252
|
+
var DEFAULT_HINT = "Enter to send \xB7 Shift+Enter for new line";
|
|
253
|
+
function ChatInputArea({
|
|
254
|
+
value,
|
|
255
|
+
onChange,
|
|
256
|
+
onSend,
|
|
257
|
+
onAttachFile,
|
|
258
|
+
onAttachImage,
|
|
259
|
+
disabled = false,
|
|
260
|
+
placeholder = "Type your message\u2026",
|
|
261
|
+
hint = DEFAULT_HINT,
|
|
262
|
+
maxHeight = 160,
|
|
263
|
+
autoFocus = false,
|
|
264
|
+
className
|
|
265
|
+
}) {
|
|
266
|
+
const textareaRef = React2.useRef(null);
|
|
267
|
+
const fileInputRef = React2.useRef(null);
|
|
268
|
+
const imageInputRef = React2.useRef(null);
|
|
269
|
+
React2.useEffect(() => {
|
|
270
|
+
if (autoFocus) {
|
|
271
|
+
setTimeout(() => {
|
|
272
|
+
var _a;
|
|
273
|
+
return (_a = textareaRef.current) == null ? void 0 : _a.focus();
|
|
274
|
+
}, 50);
|
|
275
|
+
}
|
|
276
|
+
}, [autoFocus]);
|
|
277
|
+
const handleSend = React2.useCallback(() => {
|
|
278
|
+
const text = value.trim();
|
|
279
|
+
if (!text || disabled) return;
|
|
280
|
+
onSend(text);
|
|
281
|
+
if (textareaRef.current) {
|
|
282
|
+
textareaRef.current.style.height = "auto";
|
|
283
|
+
}
|
|
284
|
+
}, [value, disabled, onSend]);
|
|
285
|
+
const handleKeyDown = React2.useCallback(
|
|
286
|
+
(e) => {
|
|
287
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
288
|
+
e.preventDefault();
|
|
289
|
+
handleSend();
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
[handleSend]
|
|
293
|
+
);
|
|
294
|
+
const handleTextareaChange = React2.useCallback(
|
|
295
|
+
(e) => {
|
|
296
|
+
onChange(e.target.value);
|
|
297
|
+
const el = e.target;
|
|
298
|
+
el.style.height = "auto";
|
|
299
|
+
el.style.height = `${Math.min(el.scrollHeight, maxHeight)}px`;
|
|
300
|
+
},
|
|
301
|
+
[onChange, maxHeight]
|
|
302
|
+
);
|
|
303
|
+
const handleFileChange = React2.useCallback(
|
|
304
|
+
(e) => {
|
|
305
|
+
var _a;
|
|
306
|
+
if ((_a = e.target.files) == null ? void 0 : _a.length) {
|
|
307
|
+
onAttachFile == null ? void 0 : onAttachFile(e.target.files);
|
|
308
|
+
e.target.value = "";
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
[onAttachFile]
|
|
312
|
+
);
|
|
313
|
+
const handleImageChange = React2.useCallback(
|
|
314
|
+
(e) => {
|
|
315
|
+
var _a;
|
|
316
|
+
if ((_a = e.target.files) == null ? void 0 : _a.length) {
|
|
317
|
+
onAttachImage == null ? void 0 : onAttachImage(e.target.files);
|
|
318
|
+
e.target.value = "";
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
[onAttachImage]
|
|
322
|
+
);
|
|
323
|
+
const showFileButton = typeof onAttachFile === "function";
|
|
324
|
+
const showImageButton = typeof onAttachImage === "function";
|
|
325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
"data-slot": "chat-input-area",
|
|
329
|
+
className: cn("flex flex-col gap-1.5", className),
|
|
330
|
+
children: [
|
|
331
|
+
/* @__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: [
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
333
|
+
Textarea,
|
|
334
|
+
{
|
|
335
|
+
ref: textareaRef,
|
|
336
|
+
value,
|
|
337
|
+
onChange: handleTextareaChange,
|
|
338
|
+
onKeyDown: handleKeyDown,
|
|
339
|
+
placeholder,
|
|
340
|
+
disabled,
|
|
341
|
+
rows: 3,
|
|
342
|
+
className: "resize-none text-sm border-0 shadow-none focus-visible:ring-0 px-3 pt-3 pb-1 min-h-[72px]",
|
|
343
|
+
"aria-label": placeholder
|
|
344
|
+
}
|
|
345
|
+
),
|
|
346
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between px-2 pb-2", children: [
|
|
347
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-0.5", children: [
|
|
348
|
+
showFileButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
350
|
+
Button,
|
|
351
|
+
{
|
|
352
|
+
variant: "ghost",
|
|
353
|
+
size: "icon-sm",
|
|
354
|
+
type: "button",
|
|
355
|
+
title: "Attach file",
|
|
356
|
+
"aria-label": "Attach file",
|
|
357
|
+
disabled,
|
|
358
|
+
onClick: () => {
|
|
359
|
+
var _a;
|
|
360
|
+
return (_a = fileInputRef.current) == null ? void 0 : _a.click();
|
|
361
|
+
},
|
|
362
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.Paperclip, { className: "size-3.5", "aria-hidden": "true" })
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
366
|
+
"input",
|
|
367
|
+
{
|
|
368
|
+
ref: fileInputRef,
|
|
369
|
+
type: "file",
|
|
370
|
+
multiple: true,
|
|
371
|
+
className: "sr-only",
|
|
372
|
+
tabIndex: -1,
|
|
373
|
+
onChange: handleFileChange
|
|
374
|
+
}
|
|
375
|
+
)
|
|
376
|
+
] }),
|
|
377
|
+
showImageButton && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
379
|
+
Button,
|
|
380
|
+
{
|
|
381
|
+
variant: "ghost",
|
|
382
|
+
size: "icon-sm",
|
|
383
|
+
type: "button",
|
|
384
|
+
title: "Upload image",
|
|
385
|
+
"aria-label": "Upload image",
|
|
386
|
+
disabled,
|
|
387
|
+
onClick: () => {
|
|
388
|
+
var _a;
|
|
389
|
+
return (_a = imageInputRef.current) == null ? void 0 : _a.click();
|
|
390
|
+
},
|
|
391
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ImagePlus, { className: "size-3.5", "aria-hidden": "true" })
|
|
392
|
+
}
|
|
393
|
+
),
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
395
|
+
"input",
|
|
396
|
+
{
|
|
397
|
+
ref: imageInputRef,
|
|
398
|
+
type: "file",
|
|
399
|
+
multiple: true,
|
|
400
|
+
accept: "image/*",
|
|
401
|
+
className: "sr-only",
|
|
402
|
+
tabIndex: -1,
|
|
403
|
+
onChange: handleImageChange
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
] })
|
|
407
|
+
] }),
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
409
|
+
Button,
|
|
410
|
+
{
|
|
411
|
+
size: "icon-sm",
|
|
412
|
+
type: "button",
|
|
413
|
+
"aria-label": "Send message",
|
|
414
|
+
disabled: !value.trim() || disabled,
|
|
415
|
+
onClick: handleSend,
|
|
416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.Send, { className: "size-3.5", "aria-hidden": "true" })
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
] })
|
|
420
|
+
] }),
|
|
421
|
+
hint !== false && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-muted-foreground", children: hint })
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
}
|
|
426
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
427
|
+
0 && (module.exports = {
|
|
428
|
+
ChatInputArea
|
|
429
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChatInputArea
|
|
3
|
+
} from "../../chunk-EFHPSKVF.mjs";
|
|
4
|
+
import "../../chunk-BS75ICOO.mjs";
|
|
5
|
+
import "../../chunk-NOOEKOWY.mjs";
|
|
6
|
+
import "../../chunk-R4HCRDU5.mjs";
|
|
7
|
+
import "../../chunk-AFML43VJ.mjs";
|
|
8
|
+
import "../../chunk-WNQUEZJF.mjs";
|
|
9
|
+
export {
|
|
10
|
+
ChatInputArea
|
|
11
|
+
};
|
|
@@ -1,8 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
3
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
6
37
|
var __export = (target, all) => {
|
|
7
38
|
for (var name in all)
|
|
8
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,6 +46,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
46
|
}
|
|
16
47
|
return to;
|
|
17
48
|
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
18
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
58
|
|
|
20
59
|
// src/components/ui/page-top-bar.tsx
|
|
@@ -23,6 +62,12 @@ __export(page_top_bar_exports, {
|
|
|
23
62
|
PageTopBar: () => PageTopBar
|
|
24
63
|
});
|
|
25
64
|
module.exports = __toCommonJS(page_top_bar_exports);
|
|
65
|
+
var import_lucide_react2 = require("lucide-react");
|
|
66
|
+
|
|
67
|
+
// src/components/ui/button.tsx
|
|
68
|
+
var import_react = require("react");
|
|
69
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
70
|
+
var import_lucide_react = require("lucide-react");
|
|
26
71
|
|
|
27
72
|
// src/lib/utils.ts
|
|
28
73
|
var import_clsx = require("clsx");
|
|
@@ -63,10 +108,136 @@ function cn(...inputs) {
|
|
|
63
108
|
return twMerge((0, import_clsx.clsx)(inputs));
|
|
64
109
|
}
|
|
65
110
|
|
|
66
|
-
// src/
|
|
111
|
+
// src/lib/slot.tsx
|
|
112
|
+
var React = __toESM(require("react"));
|
|
113
|
+
function mergeRefs(...refs) {
|
|
114
|
+
return (value) => {
|
|
115
|
+
for (const ref of refs) {
|
|
116
|
+
if (typeof ref === "function") ref(value);
|
|
117
|
+
else if (ref !== null)
|
|
118
|
+
ref.current = value;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
var Slot = React.forwardRef(
|
|
123
|
+
(_a, forwardedRef) => {
|
|
124
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
125
|
+
const child = React.Children.only(children);
|
|
126
|
+
if (!React.isValidElement(child)) return null;
|
|
127
|
+
const childProps = child.props;
|
|
128
|
+
const merged = __spreadValues({}, props);
|
|
129
|
+
for (const key of Object.keys(childProps)) {
|
|
130
|
+
if (key === "className") {
|
|
131
|
+
merged.className = [props.className, childProps.className].filter(Boolean).join(" ");
|
|
132
|
+
} else if (key === "style") {
|
|
133
|
+
merged.style = __spreadValues(__spreadValues({}, props.style), childProps.style);
|
|
134
|
+
} else if (key.startsWith("on") && typeof childProps[key] === "function") {
|
|
135
|
+
const parentHandler = props[key];
|
|
136
|
+
if (typeof parentHandler === "function") {
|
|
137
|
+
merged[key] = (...args) => {
|
|
138
|
+
childProps[key](...args);
|
|
139
|
+
parentHandler(...args);
|
|
140
|
+
};
|
|
141
|
+
} else {
|
|
142
|
+
merged[key] = childProps[key];
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
merged[key] = childProps[key];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const childRef = child.ref;
|
|
149
|
+
merged.ref = forwardedRef ? mergeRefs(forwardedRef, childRef) : childRef;
|
|
150
|
+
return React.cloneElement(
|
|
151
|
+
child,
|
|
152
|
+
merged
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
Slot.displayName = "Slot";
|
|
157
|
+
|
|
158
|
+
// src/components/ui/button.tsx
|
|
67
159
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
68
|
-
|
|
69
|
-
|
|
160
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
161
|
+
"inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 font-sans text-button whitespace-nowrap transition-all active:scale-[0.98] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
162
|
+
{
|
|
163
|
+
variants: {
|
|
164
|
+
variant: {
|
|
165
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
166
|
+
secondary: "bg-brand-secondary text-brand-secondary-foreground shadow-xs hover:bg-brand-secondary/80 focus-visible:ring-brand-secondary/30",
|
|
167
|
+
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
168
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground focus-visible:border-border focus-visible:ring-border/50 dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
169
|
+
"outline-primary": "border border-primary text-foreground bg-transparent shadow-xs hover:bg-primary/5 focus-visible:ring-primary/50",
|
|
170
|
+
"outline-secondary": "border border-brand-secondary text-brand-secondary bg-transparent shadow-xs hover:bg-brand-secondary/10 focus-visible:border-brand-secondary focus-visible:ring-brand-secondary/30",
|
|
171
|
+
ghost: "hover:bg-accent hover:text-accent-foreground hover:shadow-xs focus-visible:ring-border/50 dark:hover:bg-accent/50",
|
|
172
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
173
|
+
},
|
|
174
|
+
size: {
|
|
175
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
176
|
+
xs: "h-6 gap-1 px-2 text-button-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
177
|
+
sm: "h-8 gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
178
|
+
lg: "h-10 px-6 has-[>svg]:px-4",
|
|
179
|
+
icon: "size-9",
|
|
180
|
+
"icon-xs": "size-6 [&_svg:not([class*='size-'])]:size-3",
|
|
181
|
+
"icon-sm": "size-8",
|
|
182
|
+
"icon-lg": "size-10"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
defaultVariants: {
|
|
186
|
+
variant: "default",
|
|
187
|
+
size: "default"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
var Button = (0, import_react.forwardRef)(function Button2(_a, ref) {
|
|
192
|
+
var _b = _a, {
|
|
193
|
+
className,
|
|
194
|
+
variant,
|
|
195
|
+
size,
|
|
196
|
+
asChild = false,
|
|
197
|
+
loading = false,
|
|
198
|
+
disabled,
|
|
199
|
+
type = "button",
|
|
200
|
+
children
|
|
201
|
+
} = _b, props = __objRest(_b, [
|
|
202
|
+
"className",
|
|
203
|
+
"variant",
|
|
204
|
+
"size",
|
|
205
|
+
"asChild",
|
|
206
|
+
"loading",
|
|
207
|
+
"disabled",
|
|
208
|
+
"type",
|
|
209
|
+
"children"
|
|
210
|
+
]);
|
|
211
|
+
const Comp = asChild ? Slot : "button";
|
|
212
|
+
const isIconOnly = size === "icon" || size === "icon-xs" || size === "icon-sm" || size === "icon-lg";
|
|
213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
214
|
+
Comp,
|
|
215
|
+
__spreadProps(__spreadValues({
|
|
216
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
217
|
+
"data-size": size,
|
|
218
|
+
"data-slot": "button",
|
|
219
|
+
"data-variant": variant,
|
|
220
|
+
disabled: loading || disabled,
|
|
221
|
+
ref,
|
|
222
|
+
type
|
|
223
|
+
}, props), {
|
|
224
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { "aria-hidden": "true", className: "animate-spin" }),
|
|
226
|
+
!isIconOnly && children
|
|
227
|
+
] }) : children
|
|
228
|
+
})
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// src/components/ui/page-top-bar.tsx
|
|
233
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
234
|
+
function PageTopBar({
|
|
235
|
+
title,
|
|
236
|
+
actions,
|
|
237
|
+
onAskSupport,
|
|
238
|
+
className
|
|
239
|
+
}) {
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
70
241
|
"div",
|
|
71
242
|
{
|
|
72
243
|
"data-slot": "page-top-bar",
|
|
@@ -76,8 +247,14 @@ function PageTopBar({ title, actions, className }) {
|
|
|
76
247
|
className
|
|
77
248
|
),
|
|
78
249
|
children: [
|
|
79
|
-
/* @__PURE__ */ (0,
|
|
80
|
-
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", { className: "text-lg font-semibold leading-tight", children: title }),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
252
|
+
actions,
|
|
253
|
+
onAskSupport && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Button, { variant: "outline", size: "sm", onClick: onAskSupport, children: [
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Bot, { className: "size-3.5", "aria-hidden": "true" }),
|
|
255
|
+
"Ask Support"
|
|
256
|
+
] })
|
|
257
|
+
] })
|
|
81
258
|
]
|
|
82
259
|
}
|
|
83
260
|
);
|