@lukeashford/aurelius 2.15.1 → 2.17.0
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/dist/index.d.mts +137 -21
- package/dist/index.d.ts +137 -21
- package/dist/index.js +718 -572
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +684 -541
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +5 -0
- package/llms.md +55 -7
- package/package.json +8 -4
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AccordionTrigger: () => AccordionTrigger,
|
|
37
37
|
Alert: () => Alert,
|
|
38
38
|
AlertDialog: () => AlertDialog,
|
|
39
|
+
ArtifactCard: () => ArtifactCard,
|
|
39
40
|
ArtifactsPanel: () => ArtifactsPanel,
|
|
40
41
|
ArtifactsPanelToggle: () => ArtifactsPanelToggle,
|
|
41
42
|
AttachmentPreview: () => AttachmentPreview,
|
|
@@ -102,6 +103,7 @@ __export(index_exports, {
|
|
|
102
103
|
NavbarItem: () => NavbarItem,
|
|
103
104
|
NavbarLink: () => NavbarLink,
|
|
104
105
|
Pagination: () => Pagination,
|
|
106
|
+
PdfCard: () => PdfCard,
|
|
105
107
|
PlusIcon: () => PlusIcon,
|
|
106
108
|
Popover: () => Popover,
|
|
107
109
|
Progress: () => Progress,
|
|
@@ -131,6 +133,7 @@ __export(index_exports, {
|
|
|
131
133
|
TableHeader: () => TableHeader,
|
|
132
134
|
TableRow: () => TableRow,
|
|
133
135
|
Tabs: () => Tabs,
|
|
136
|
+
TextCard: () => TextCard,
|
|
134
137
|
Textarea: () => Textarea,
|
|
135
138
|
ThinkingIndicator: () => ThinkingIndicator,
|
|
136
139
|
ToastProvider: () => ToastProvider,
|
|
@@ -248,9 +251,28 @@ var Input = import_react2.default.forwardRef(
|
|
|
248
251
|
Input.displayName = "Input";
|
|
249
252
|
|
|
250
253
|
// src/components/Card.tsx
|
|
251
|
-
var
|
|
252
|
-
var import_react_player = __toESM(require("react-player"));
|
|
254
|
+
var import_react4 = __toESM(require("react"));
|
|
253
255
|
var import_lucide_react = require("lucide-react");
|
|
256
|
+
|
|
257
|
+
// src/components/Skeleton.tsx
|
|
258
|
+
var import_react3 = __toESM(require("react"));
|
|
259
|
+
var Skeleton = import_react3.default.forwardRef(
|
|
260
|
+
({ className, ...rest }, ref) => {
|
|
261
|
+
return /* @__PURE__ */ import_react3.default.createElement(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
ref,
|
|
265
|
+
className: cx("animate-pulse bg-ash", className),
|
|
266
|
+
...rest
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
Skeleton.displayName = "Skeleton";
|
|
272
|
+
|
|
273
|
+
// src/components/Card.tsx
|
|
274
|
+
var CardContext = (0, import_react4.createContext)({ isLoading: false });
|
|
275
|
+
var useCardContext = () => (0, import_react4.useContext)(CardContext);
|
|
254
276
|
var VARIANT_STYLES = {
|
|
255
277
|
default: "bg-charcoal shadow-sm border border-gold/30",
|
|
256
278
|
elevated: "bg-charcoal shadow-lg border-0",
|
|
@@ -258,22 +280,23 @@ var VARIANT_STYLES = {
|
|
|
258
280
|
ghost: "bg-transparent shadow-none border-0",
|
|
259
281
|
featured: "bg-charcoal border border-gold glow-sm"
|
|
260
282
|
};
|
|
261
|
-
var CardBase =
|
|
283
|
+
var CardBase = import_react4.default.forwardRef(
|
|
262
284
|
({
|
|
263
285
|
variant = "default",
|
|
264
286
|
interactive = false,
|
|
265
287
|
selected = false,
|
|
266
288
|
noPadding = false,
|
|
289
|
+
isLoading = false,
|
|
267
290
|
className,
|
|
268
291
|
children,
|
|
269
292
|
...props
|
|
270
293
|
}, ref) => {
|
|
271
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ import_react4.default.createElement(CardContext.Provider, { value: { isLoading } }, /* @__PURE__ */ import_react4.default.createElement(
|
|
272
295
|
"div",
|
|
273
296
|
{
|
|
274
297
|
ref,
|
|
275
298
|
className: cx(
|
|
276
|
-
"rounded-none relative",
|
|
299
|
+
"rounded-none relative transition-opacity duration-500",
|
|
277
300
|
!noPadding && "p-6",
|
|
278
301
|
VARIANT_STYLES[variant],
|
|
279
302
|
interactive && "transition-all duration-200 hover:border-gold hover:shadow-glow cursor-pointer",
|
|
@@ -283,38 +306,47 @@ var CardBase = import_react3.default.forwardRef(
|
|
|
283
306
|
...props
|
|
284
307
|
},
|
|
285
308
|
children,
|
|
286
|
-
selected && /* @__PURE__ */
|
|
309
|
+
selected && /* @__PURE__ */ import_react4.default.createElement(
|
|
287
310
|
"div",
|
|
288
311
|
{
|
|
289
312
|
className: "absolute top-3 right-3 flex items-center justify-center h-6 w-6 rounded-full bg-gold text-obsidian"
|
|
290
313
|
},
|
|
291
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ import_react4.default.createElement(import_lucide_react.Check, { className: "h-4 w-4" })
|
|
292
315
|
)
|
|
293
|
-
);
|
|
316
|
+
));
|
|
294
317
|
}
|
|
295
318
|
);
|
|
296
319
|
CardBase.displayName = "Card";
|
|
297
|
-
var CardHeader =
|
|
320
|
+
var CardHeader = import_react4.default.forwardRef(
|
|
298
321
|
({ title, subtitle, action, className, children, ...props }, ref) => {
|
|
299
|
-
|
|
322
|
+
const { isLoading } = useCardContext();
|
|
323
|
+
const hasContent = title || subtitle || action || children;
|
|
324
|
+
if (!hasContent && !isLoading) {
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
300
328
|
"div",
|
|
301
329
|
{
|
|
302
330
|
ref,
|
|
303
331
|
className: cx("px-6 py-4 border-b border-ash", className),
|
|
304
332
|
...props
|
|
305
333
|
},
|
|
306
|
-
title || subtitle || action ? /* @__PURE__ */
|
|
334
|
+
isLoading && !title && !subtitle ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex flex-col gap-2" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-5 w-3/4" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-1/2" })) : title || subtitle || action ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex items-start justify-between gap-4" }, /* @__PURE__ */ import_react4.default.createElement("div", { className: "flex-1 min-w-0" }, title ? /* @__PURE__ */ import_react4.default.createElement("h3", { className: "text-lg font-semibold text-white m-0" }, title) : isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-5 w-3/4 mb-1" }) : null, subtitle ? /* @__PURE__ */ import_react4.default.createElement("p", { className: "text-sm text-silver mt-1 m-0" }, subtitle) : isLoading ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-1/2 mt-1" }) : null), action && /* @__PURE__ */ import_react4.default.createElement("div", { className: "shrink-0" }, action)) : children
|
|
307
335
|
);
|
|
308
336
|
}
|
|
309
337
|
);
|
|
310
338
|
CardHeader.displayName = "CardHeader";
|
|
311
|
-
var CardBody =
|
|
339
|
+
var CardBody = import_react4.default.forwardRef(
|
|
312
340
|
({ className, children, ...props }, ref) => {
|
|
313
|
-
|
|
341
|
+
const { isLoading } = useCardContext();
|
|
342
|
+
if (!children && !isLoading) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ import_react4.default.createElement("div", { ref, className: cx("px-6 py-4", className), ...props }, isLoading && !children ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-full" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-full" }), /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "h-4 w-3/4" })) : children);
|
|
314
346
|
}
|
|
315
347
|
);
|
|
316
348
|
CardBody.displayName = "CardBody";
|
|
317
|
-
var CardFooter =
|
|
349
|
+
var CardFooter = import_react4.default.forwardRef(
|
|
318
350
|
({ align = "end", className, children, ...props }, ref) => {
|
|
319
351
|
const alignClass = {
|
|
320
352
|
start: "justify-start",
|
|
@@ -322,7 +354,7 @@ var CardFooter = import_react3.default.forwardRef(
|
|
|
322
354
|
end: "justify-end",
|
|
323
355
|
between: "justify-between"
|
|
324
356
|
}[align];
|
|
325
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
326
358
|
"div",
|
|
327
359
|
{
|
|
328
360
|
ref,
|
|
@@ -338,23 +370,24 @@ var CardFooter = import_react3.default.forwardRef(
|
|
|
338
370
|
}
|
|
339
371
|
);
|
|
340
372
|
CardFooter.displayName = "CardFooter";
|
|
341
|
-
var CardMedia =
|
|
373
|
+
var CardMedia = import_react4.default.forwardRef(
|
|
342
374
|
({
|
|
343
|
-
|
|
344
|
-
alt = "",
|
|
345
|
-
aspect = "video",
|
|
375
|
+
aspect,
|
|
346
376
|
position = "top",
|
|
347
|
-
isVideo = false,
|
|
348
377
|
className,
|
|
349
378
|
children,
|
|
350
379
|
...props
|
|
351
380
|
}, ref) => {
|
|
352
|
-
const
|
|
381
|
+
const { isLoading } = useCardContext();
|
|
382
|
+
const aspectClass = aspect && aspect !== "none" ? {
|
|
353
383
|
video: "aspect-video",
|
|
354
384
|
square: "aspect-square",
|
|
355
385
|
wide: "aspect-wide"
|
|
356
|
-
}[aspect];
|
|
357
|
-
|
|
386
|
+
}[aspect] : "";
|
|
387
|
+
if (!children && !isLoading) {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
358
391
|
"div",
|
|
359
392
|
{
|
|
360
393
|
ref,
|
|
@@ -367,16 +400,7 @@ var CardMedia = import_react3.default.forwardRef(
|
|
|
367
400
|
),
|
|
368
401
|
...props
|
|
369
402
|
},
|
|
370
|
-
|
|
371
|
-
import_react_player.default,
|
|
372
|
-
{
|
|
373
|
-
src,
|
|
374
|
-
width: "100%",
|
|
375
|
-
height: "100%",
|
|
376
|
-
className: "absolute top-0 left-0",
|
|
377
|
-
controls: true
|
|
378
|
-
}
|
|
379
|
-
) : /* @__PURE__ */ import_react3.default.createElement("img", { src, alt, className: "w-full h-full object-cover" }) : children
|
|
403
|
+
isLoading && !children ? /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "w-full h-full" }) : children
|
|
380
404
|
);
|
|
381
405
|
}
|
|
382
406
|
);
|
|
@@ -389,7 +413,7 @@ var Card = Object.assign(CardBase, {
|
|
|
389
413
|
});
|
|
390
414
|
|
|
391
415
|
// src/components/Container.tsx
|
|
392
|
-
var
|
|
416
|
+
var import_react5 = __toESM(require("react"));
|
|
393
417
|
var SIZE_CLASSES = {
|
|
394
418
|
sm: "container-sm",
|
|
395
419
|
md: "container-md",
|
|
@@ -398,15 +422,15 @@ var SIZE_CLASSES = {
|
|
|
398
422
|
fluid: "container-fluid",
|
|
399
423
|
responsive: "container"
|
|
400
424
|
};
|
|
401
|
-
var Container =
|
|
425
|
+
var Container = import_react5.default.forwardRef(
|
|
402
426
|
({ size = "responsive", className, children, ...props }, ref) => {
|
|
403
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ import_react5.default.createElement("div", { ref, className: cx(SIZE_CLASSES[size], className), ...props }, children);
|
|
404
428
|
}
|
|
405
429
|
);
|
|
406
430
|
Container.displayName = "Container";
|
|
407
431
|
|
|
408
432
|
// src/components/Row.tsx
|
|
409
|
-
var
|
|
433
|
+
var import_react6 = __toESM(require("react"));
|
|
410
434
|
var JUSTIFY_MAP = {
|
|
411
435
|
start: "justify-start",
|
|
412
436
|
center: "justify-center",
|
|
@@ -458,12 +482,12 @@ var GAP_Y_MAP = {
|
|
|
458
482
|
10: "gap-y-10",
|
|
459
483
|
12: "gap-y-12"
|
|
460
484
|
};
|
|
461
|
-
var Row =
|
|
485
|
+
var Row = import_react6.default.forwardRef(
|
|
462
486
|
({ gutter = 4, gutterX, gutterY, justify, align, className, children, ...props }, ref) => {
|
|
463
487
|
const gapClass = gutterX === void 0 && gutterY === void 0 ? GAP_MAP[gutter] : "";
|
|
464
488
|
const gapXClass = gutterX !== void 0 ? GAP_X_MAP[gutterX] : "";
|
|
465
489
|
const gapYClass = gutterY !== void 0 ? GAP_Y_MAP[gutterY] : "";
|
|
466
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
467
491
|
"div",
|
|
468
492
|
{
|
|
469
493
|
ref,
|
|
@@ -485,7 +509,7 @@ var Row = import_react5.default.forwardRef(
|
|
|
485
509
|
Row.displayName = "Row";
|
|
486
510
|
|
|
487
511
|
// src/components/Col.tsx
|
|
488
|
-
var
|
|
512
|
+
var import_react7 = __toESM(require("react"));
|
|
489
513
|
var SPAN_CLASS_MAP = {
|
|
490
514
|
base: {
|
|
491
515
|
1: "col-span-1",
|
|
@@ -796,14 +820,14 @@ function buildResponsiveClasses(value, classMap) {
|
|
|
796
820
|
}
|
|
797
821
|
return classes;
|
|
798
822
|
}
|
|
799
|
-
var Col =
|
|
823
|
+
var Col = import_react7.default.forwardRef(
|
|
800
824
|
({ span, offset, order, className, children, ...props }, ref) => {
|
|
801
825
|
const spanClasses = buildResponsiveClasses(span, SPAN_CLASS_MAP);
|
|
802
826
|
const offsetClasses = buildResponsiveClasses(offset, OFFSET_CLASS_MAP);
|
|
803
827
|
const orderClasses = buildResponsiveClasses(order, ORDER_CLASS_MAP);
|
|
804
828
|
const hasSpan = span !== void 0;
|
|
805
829
|
const defaultSpan = hasSpan ? "" : "col-span-12";
|
|
806
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ import_react7.default.createElement(
|
|
807
831
|
"div",
|
|
808
832
|
{
|
|
809
833
|
ref,
|
|
@@ -823,7 +847,7 @@ var Col = import_react6.default.forwardRef(
|
|
|
823
847
|
Col.displayName = "Col";
|
|
824
848
|
|
|
825
849
|
// src/components/Stack.tsx
|
|
826
|
-
var
|
|
850
|
+
var import_react8 = __toESM(require("react"));
|
|
827
851
|
var ALIGN_MAP2 = {
|
|
828
852
|
start: "items-start",
|
|
829
853
|
center: "items-center",
|
|
@@ -851,7 +875,7 @@ var GAP_MAP2 = {
|
|
|
851
875
|
10: "gap-10",
|
|
852
876
|
12: "gap-12"
|
|
853
877
|
};
|
|
854
|
-
var Stack =
|
|
878
|
+
var Stack = import_react8.default.forwardRef(
|
|
855
879
|
({
|
|
856
880
|
direction = "vertical",
|
|
857
881
|
align,
|
|
@@ -863,7 +887,7 @@ var Stack = import_react7.default.forwardRef(
|
|
|
863
887
|
children,
|
|
864
888
|
...props
|
|
865
889
|
}, ref) => {
|
|
866
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ import_react8.default.createElement(
|
|
867
891
|
Component,
|
|
868
892
|
{
|
|
869
893
|
ref,
|
|
@@ -885,7 +909,7 @@ var Stack = import_react7.default.forwardRef(
|
|
|
885
909
|
Stack.displayName = "Stack";
|
|
886
910
|
|
|
887
911
|
// src/components/Divider.tsx
|
|
888
|
-
var
|
|
912
|
+
var import_react9 = __toESM(require("react"));
|
|
889
913
|
var COLOR_MAP = {
|
|
890
914
|
default: "border-ash",
|
|
891
915
|
gold: "border-gold/50",
|
|
@@ -896,7 +920,7 @@ var VARIANT_MAP = {
|
|
|
896
920
|
dashed: "border-dashed",
|
|
897
921
|
dotted: "border-dotted"
|
|
898
922
|
};
|
|
899
|
-
var Divider =
|
|
923
|
+
var Divider = import_react9.default.forwardRef(
|
|
900
924
|
({
|
|
901
925
|
orientation = "horizontal",
|
|
902
926
|
variant = "solid",
|
|
@@ -907,14 +931,14 @@ var Divider = import_react8.default.forwardRef(
|
|
|
907
931
|
}, ref) => {
|
|
908
932
|
const isHorizontal = orientation === "horizontal";
|
|
909
933
|
if (label && isHorizontal) {
|
|
910
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
911
935
|
"div",
|
|
912
936
|
{
|
|
913
937
|
className: cx("flex items-center gap-4", className),
|
|
914
938
|
role: "separator",
|
|
915
939
|
"aria-orientation": orientation
|
|
916
940
|
},
|
|
917
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
918
942
|
"div",
|
|
919
943
|
{
|
|
920
944
|
className: cx(
|
|
@@ -924,8 +948,8 @@ var Divider = import_react8.default.forwardRef(
|
|
|
924
948
|
)
|
|
925
949
|
}
|
|
926
950
|
),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ import_react9.default.createElement("span", { className: "text-sm text-silver shrink-0" }, label),
|
|
952
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
929
953
|
"div",
|
|
930
954
|
{
|
|
931
955
|
className: cx(
|
|
@@ -937,7 +961,7 @@ var Divider = import_react8.default.forwardRef(
|
|
|
937
961
|
)
|
|
938
962
|
);
|
|
939
963
|
}
|
|
940
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
941
965
|
"hr",
|
|
942
966
|
{
|
|
943
967
|
ref,
|
|
@@ -959,7 +983,7 @@ var Divider = import_react8.default.forwardRef(
|
|
|
959
983
|
Divider.displayName = "Divider";
|
|
960
984
|
|
|
961
985
|
// src/components/Avatar.tsx
|
|
962
|
-
var
|
|
986
|
+
var import_react10 = __toESM(require("react"));
|
|
963
987
|
var sizeMap = {
|
|
964
988
|
xs: "h-6 w-6 text-[10px]",
|
|
965
989
|
sm: "h-8 w-8 text-[11px]",
|
|
@@ -975,10 +999,10 @@ function initials(name) {
|
|
|
975
999
|
const parts = name.trim().split(/\s+/);
|
|
976
1000
|
return parts.slice(0, 2).map((p) => p[0].toUpperCase()).join("");
|
|
977
1001
|
}
|
|
978
|
-
var Avatar =
|
|
1002
|
+
var Avatar = import_react10.default.forwardRef(
|
|
979
1003
|
({ src, alt = "", name, size = "md", status, className, ...rest }, ref) => {
|
|
980
1004
|
const statusColor = status === "online" ? "bg-success" : status === "busy" ? "bg-warning" : "bg-zinc";
|
|
981
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
982
1006
|
"div",
|
|
983
1007
|
{
|
|
984
1008
|
ref,
|
|
@@ -989,15 +1013,15 @@ var Avatar = import_react9.default.forwardRef(
|
|
|
989
1013
|
),
|
|
990
1014
|
...rest
|
|
991
1015
|
},
|
|
992
|
-
src ? /* @__PURE__ */
|
|
1016
|
+
src ? /* @__PURE__ */ import_react10.default.createElement(
|
|
993
1017
|
"img",
|
|
994
1018
|
{
|
|
995
1019
|
src,
|
|
996
1020
|
alt: alt || name || "Avatar",
|
|
997
1021
|
className: "h-full w-full object-cover"
|
|
998
1022
|
}
|
|
999
|
-
) : /* @__PURE__ */
|
|
1000
|
-
status && /* @__PURE__ */
|
|
1023
|
+
) : /* @__PURE__ */ import_react10.default.createElement("span", { "aria-hidden": true }, initials(name) || "\xB7"),
|
|
1024
|
+
status && /* @__PURE__ */ import_react10.default.createElement(
|
|
1001
1025
|
"span",
|
|
1002
1026
|
{
|
|
1003
1027
|
className: cx(
|
|
@@ -1014,8 +1038,8 @@ var Avatar = import_react9.default.forwardRef(
|
|
|
1014
1038
|
Avatar.displayName = "Avatar";
|
|
1015
1039
|
|
|
1016
1040
|
// src/components/Badge.tsx
|
|
1017
|
-
var
|
|
1018
|
-
var Badge =
|
|
1041
|
+
var import_react11 = __toESM(require("react"));
|
|
1042
|
+
var Badge = import_react11.default.forwardRef(
|
|
1019
1043
|
({ variant = "default", className, ...rest }, ref) => {
|
|
1020
1044
|
const base = "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium border";
|
|
1021
1045
|
const variantClasses = {
|
|
@@ -1027,20 +1051,20 @@ var Badge = import_react10.default.forwardRef(
|
|
|
1027
1051
|
info: "bg-info/20 text-info border-info/30"
|
|
1028
1052
|
};
|
|
1029
1053
|
const variantClass = variantClasses[variant];
|
|
1030
|
-
return /* @__PURE__ */
|
|
1054
|
+
return /* @__PURE__ */ import_react11.default.createElement("span", { ref, className: cx(base, variantClass, className), ...rest });
|
|
1031
1055
|
}
|
|
1032
1056
|
);
|
|
1033
1057
|
Badge.displayName = "Badge";
|
|
1034
1058
|
|
|
1035
1059
|
// src/components/Tooltip.tsx
|
|
1036
|
-
var
|
|
1060
|
+
var import_react12 = __toESM(require("react"));
|
|
1037
1061
|
var Tooltip = ({
|
|
1038
1062
|
content,
|
|
1039
1063
|
children,
|
|
1040
1064
|
open = false,
|
|
1041
1065
|
side = "top"
|
|
1042
1066
|
}) => {
|
|
1043
|
-
return /* @__PURE__ */
|
|
1067
|
+
return /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative inline-block" }, children, /* @__PURE__ */ import_react12.default.createElement(
|
|
1044
1068
|
"span",
|
|
1045
1069
|
{
|
|
1046
1070
|
role: "tooltip",
|
|
@@ -1058,10 +1082,10 @@ var Tooltip = ({
|
|
|
1058
1082
|
};
|
|
1059
1083
|
|
|
1060
1084
|
// src/components/Table.tsx
|
|
1061
|
-
var
|
|
1062
|
-
var Table =
|
|
1085
|
+
var import_react13 = __toESM(require("react"));
|
|
1086
|
+
var Table = import_react13.default.forwardRef(
|
|
1063
1087
|
({ responsive = true, className, children, ...props }, ref) => {
|
|
1064
|
-
const table = /* @__PURE__ */
|
|
1088
|
+
const table = /* @__PURE__ */ import_react13.default.createElement(
|
|
1065
1089
|
"table",
|
|
1066
1090
|
{
|
|
1067
1091
|
ref,
|
|
@@ -1071,14 +1095,14 @@ var Table = import_react12.default.forwardRef(
|
|
|
1071
1095
|
children
|
|
1072
1096
|
);
|
|
1073
1097
|
if (responsive) {
|
|
1074
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", { className: "w-full overflow-x-auto" }, table);
|
|
1075
1099
|
}
|
|
1076
1100
|
return table;
|
|
1077
1101
|
}
|
|
1078
1102
|
);
|
|
1079
1103
|
Table.displayName = "Table";
|
|
1080
|
-
var TableHeader =
|
|
1081
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1104
|
+
var TableHeader = import_react13.default.forwardRef(
|
|
1105
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1082
1106
|
"thead",
|
|
1083
1107
|
{
|
|
1084
1108
|
ref,
|
|
@@ -1089,8 +1113,8 @@ var TableHeader = import_react12.default.forwardRef(
|
|
|
1089
1113
|
)
|
|
1090
1114
|
);
|
|
1091
1115
|
TableHeader.displayName = "TableHeader";
|
|
1092
|
-
var TableBody =
|
|
1093
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1116
|
+
var TableBody = import_react13.default.forwardRef(
|
|
1117
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1094
1118
|
"tbody",
|
|
1095
1119
|
{
|
|
1096
1120
|
ref,
|
|
@@ -1101,8 +1125,8 @@ var TableBody = import_react12.default.forwardRef(
|
|
|
1101
1125
|
)
|
|
1102
1126
|
);
|
|
1103
1127
|
TableBody.displayName = "TableBody";
|
|
1104
|
-
var TableFooter =
|
|
1105
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1128
|
+
var TableFooter = import_react13.default.forwardRef(
|
|
1129
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1106
1130
|
"tfoot",
|
|
1107
1131
|
{
|
|
1108
1132
|
ref,
|
|
@@ -1113,8 +1137,8 @@ var TableFooter = import_react12.default.forwardRef(
|
|
|
1113
1137
|
)
|
|
1114
1138
|
);
|
|
1115
1139
|
TableFooter.displayName = "TableFooter";
|
|
1116
|
-
var TableRow =
|
|
1117
|
-
({ hoverable = true, selected = false, className, children, ...props }, ref) => /* @__PURE__ */
|
|
1140
|
+
var TableRow = import_react13.default.forwardRef(
|
|
1141
|
+
({ hoverable = true, selected = false, className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1118
1142
|
"tr",
|
|
1119
1143
|
{
|
|
1120
1144
|
ref,
|
|
@@ -1130,8 +1154,8 @@ var TableRow = import_react12.default.forwardRef(
|
|
|
1130
1154
|
)
|
|
1131
1155
|
);
|
|
1132
1156
|
TableRow.displayName = "TableRow";
|
|
1133
|
-
var TableHead =
|
|
1134
|
-
({ sortable, sortDirection, className, children, ...props }, ref) => /* @__PURE__ */
|
|
1157
|
+
var TableHead = import_react13.default.forwardRef(
|
|
1158
|
+
({ sortable, sortDirection, className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1135
1159
|
"th",
|
|
1136
1160
|
{
|
|
1137
1161
|
ref,
|
|
@@ -1142,12 +1166,12 @@ var TableHead = import_react12.default.forwardRef(
|
|
|
1142
1166
|
),
|
|
1143
1167
|
...props
|
|
1144
1168
|
},
|
|
1145
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ import_react13.default.createElement("div", { className: "flex items-center gap-2" }, children, sortable && sortDirection && /* @__PURE__ */ import_react13.default.createElement("span", { className: "text-gold" }, sortDirection === "asc" ? "\u2191" : "\u2193"))
|
|
1146
1170
|
)
|
|
1147
1171
|
);
|
|
1148
1172
|
TableHead.displayName = "TableHead";
|
|
1149
|
-
var TableCell =
|
|
1150
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1173
|
+
var TableCell = import_react13.default.forwardRef(
|
|
1174
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1151
1175
|
"td",
|
|
1152
1176
|
{
|
|
1153
1177
|
ref,
|
|
@@ -1158,8 +1182,8 @@ var TableCell = import_react12.default.forwardRef(
|
|
|
1158
1182
|
)
|
|
1159
1183
|
);
|
|
1160
1184
|
TableCell.displayName = "TableCell";
|
|
1161
|
-
var TableCaption =
|
|
1162
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
1185
|
+
var TableCaption = import_react13.default.forwardRef(
|
|
1186
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ import_react13.default.createElement(
|
|
1163
1187
|
"caption",
|
|
1164
1188
|
{
|
|
1165
1189
|
ref,
|
|
@@ -1172,11 +1196,11 @@ var TableCaption = import_react12.default.forwardRef(
|
|
|
1172
1196
|
TableCaption.displayName = "TableCaption";
|
|
1173
1197
|
|
|
1174
1198
|
// src/components/List.tsx
|
|
1175
|
-
var
|
|
1176
|
-
var List =
|
|
1199
|
+
var import_react14 = __toESM(require("react"));
|
|
1200
|
+
var List = import_react14.default.forwardRef(
|
|
1177
1201
|
({ variant = "default", ordered = false, className, children, ...props }, ref) => {
|
|
1178
1202
|
const Component = ordered ? "ol" : "ul";
|
|
1179
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1180
1204
|
Component,
|
|
1181
1205
|
{
|
|
1182
1206
|
ref,
|
|
@@ -1193,7 +1217,7 @@ var List = import_react13.default.forwardRef(
|
|
|
1193
1217
|
}
|
|
1194
1218
|
);
|
|
1195
1219
|
List.displayName = "List";
|
|
1196
|
-
var ListItem =
|
|
1220
|
+
var ListItem = import_react14.default.forwardRef(
|
|
1197
1221
|
({
|
|
1198
1222
|
leading,
|
|
1199
1223
|
trailing,
|
|
@@ -1211,7 +1235,7 @@ var ListItem = import_react13.default.forwardRef(
|
|
|
1211
1235
|
}
|
|
1212
1236
|
onClick?.(e);
|
|
1213
1237
|
};
|
|
1214
|
-
return /* @__PURE__ */
|
|
1238
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1215
1239
|
"li",
|
|
1216
1240
|
{
|
|
1217
1241
|
ref,
|
|
@@ -1226,22 +1250,22 @@ var ListItem = import_react13.default.forwardRef(
|
|
|
1226
1250
|
),
|
|
1227
1251
|
...props
|
|
1228
1252
|
},
|
|
1229
|
-
leading && /* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
trailing && /* @__PURE__ */
|
|
1253
|
+
leading && /* @__PURE__ */ import_react14.default.createElement("div", { className: "shrink-0" }, leading),
|
|
1254
|
+
/* @__PURE__ */ import_react14.default.createElement("div", { className: "flex-1 min-w-0" }, children),
|
|
1255
|
+
trailing && /* @__PURE__ */ import_react14.default.createElement("div", { className: "shrink-0" }, trailing)
|
|
1232
1256
|
);
|
|
1233
1257
|
}
|
|
1234
1258
|
);
|
|
1235
1259
|
ListItem.displayName = "ListItem";
|
|
1236
|
-
var ListItemText =
|
|
1260
|
+
var ListItemText = import_react14.default.forwardRef(
|
|
1237
1261
|
({ primary, secondary, className, ...props }, ref) => {
|
|
1238
|
-
return /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ import_react14.default.createElement("div", { ref, className: cx("flex flex-col", className), ...props }, /* @__PURE__ */ import_react14.default.createElement("span", { className: "text-sm font-medium text-white" }, primary), secondary && /* @__PURE__ */ import_react14.default.createElement("span", { className: "text-xs text-silver mt-0.5" }, secondary));
|
|
1239
1263
|
}
|
|
1240
1264
|
);
|
|
1241
1265
|
ListItemText.displayName = "ListItemText";
|
|
1242
|
-
var ListSubheader =
|
|
1266
|
+
var ListSubheader = import_react14.default.forwardRef(
|
|
1243
1267
|
({ className, children, ...props }, ref) => {
|
|
1244
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
1245
1269
|
"li",
|
|
1246
1270
|
{
|
|
1247
1271
|
ref,
|
|
@@ -1258,7 +1282,7 @@ var ListSubheader = import_react13.default.forwardRef(
|
|
|
1258
1282
|
ListSubheader.displayName = "ListSubheader";
|
|
1259
1283
|
|
|
1260
1284
|
// src/components/FileChip.tsx
|
|
1261
|
-
var
|
|
1285
|
+
var import_react15 = __toESM(require("react"));
|
|
1262
1286
|
var import_lucide_react2 = require("lucide-react");
|
|
1263
1287
|
function formatBytes(bytes) {
|
|
1264
1288
|
if (bytes === 0) {
|
|
@@ -1299,7 +1323,7 @@ var statusStyles = {
|
|
|
1299
1323
|
complete: "border-success/50",
|
|
1300
1324
|
error: "border-error/50"
|
|
1301
1325
|
};
|
|
1302
|
-
var FileChip =
|
|
1326
|
+
var FileChip = import_react15.default.forwardRef(
|
|
1303
1327
|
({
|
|
1304
1328
|
name,
|
|
1305
1329
|
size,
|
|
@@ -1315,7 +1339,7 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1315
1339
|
const Icon = getFileIcon(type);
|
|
1316
1340
|
const isImage = type?.startsWith("image/");
|
|
1317
1341
|
const showPreview = isImage && previewUrl;
|
|
1318
|
-
return /* @__PURE__ */
|
|
1342
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1319
1343
|
"div",
|
|
1320
1344
|
{
|
|
1321
1345
|
ref,
|
|
@@ -1330,21 +1354,21 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1330
1354
|
role: "listitem",
|
|
1331
1355
|
...rest
|
|
1332
1356
|
},
|
|
1333
|
-
showPreview ? /* @__PURE__ */
|
|
1357
|
+
showPreview ? /* @__PURE__ */ import_react15.default.createElement("div", { className: "w-8 h-8 flex-shrink-0 overflow-hidden bg-slate" }, /* @__PURE__ */ import_react15.default.createElement(
|
|
1334
1358
|
"img",
|
|
1335
1359
|
{
|
|
1336
1360
|
src: previewUrl,
|
|
1337
1361
|
alt: "",
|
|
1338
1362
|
className: "w-full h-full object-cover"
|
|
1339
1363
|
}
|
|
1340
|
-
)) : /* @__PURE__ */
|
|
1364
|
+
)) : /* @__PURE__ */ import_react15.default.createElement(Icon, { className: cx(
|
|
1341
1365
|
"w-4 h-4 flex-shrink-0",
|
|
1342
1366
|
status === "error" ? "text-error" : "text-silver"
|
|
1343
1367
|
) }),
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
status === "uploading" && /* @__PURE__ */
|
|
1346
|
-
status === "pending" && /* @__PURE__ */
|
|
1347
|
-
removable && onRemove && /* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ import_react15.default.createElement("div", { className: "flex flex-col min-w-0 flex-1" }, /* @__PURE__ */ import_react15.default.createElement("span", { className: "truncate max-w-40", title: name }, name), size !== void 0 && status !== "error" && /* @__PURE__ */ import_react15.default.createElement("span", { className: "text-xs text-silver/60" }, formatBytes(size)), status === "error" && error && /* @__PURE__ */ import_react15.default.createElement("span", { className: "text-xs text-error truncate", title: error }, error)),
|
|
1369
|
+
status === "uploading" && /* @__PURE__ */ import_react15.default.createElement(import_lucide_react2.Loader2, { className: "w-3.5 h-3.5 text-gold animate-spin flex-shrink-0" }),
|
|
1370
|
+
status === "pending" && /* @__PURE__ */ import_react15.default.createElement("div", { className: "w-2 h-2 rounded-full bg-silver/50 flex-shrink-0" }),
|
|
1371
|
+
removable && onRemove && /* @__PURE__ */ import_react15.default.createElement(
|
|
1348
1372
|
"button",
|
|
1349
1373
|
{
|
|
1350
1374
|
type: "button",
|
|
@@ -1360,7 +1384,7 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1360
1384
|
),
|
|
1361
1385
|
"aria-label": `Remove ${name}`
|
|
1362
1386
|
},
|
|
1363
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ import_react15.default.createElement(import_lucide_react2.X, { className: "w-3.5 h-3.5" })
|
|
1364
1388
|
)
|
|
1365
1389
|
);
|
|
1366
1390
|
}
|
|
@@ -1368,8 +1392,8 @@ var FileChip = import_react14.default.forwardRef(
|
|
|
1368
1392
|
FileChip.displayName = "FileChip";
|
|
1369
1393
|
|
|
1370
1394
|
// src/components/AttachmentPreview.tsx
|
|
1371
|
-
var
|
|
1372
|
-
var AttachmentPreview =
|
|
1395
|
+
var import_react16 = __toESM(require("react"));
|
|
1396
|
+
var AttachmentPreview = import_react16.default.forwardRef(
|
|
1373
1397
|
({
|
|
1374
1398
|
attachments,
|
|
1375
1399
|
onRemove,
|
|
@@ -1383,7 +1407,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1383
1407
|
}
|
|
1384
1408
|
const visibleAttachments = maxVisible && maxVisible > 0 ? attachments.slice(0, maxVisible) : attachments;
|
|
1385
1409
|
const hiddenCount = maxVisible && maxVisible > 0 ? Math.max(0, attachments.length - maxVisible) : 0;
|
|
1386
|
-
return /* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1387
1411
|
"div",
|
|
1388
1412
|
{
|
|
1389
1413
|
ref,
|
|
@@ -1392,7 +1416,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1392
1416
|
"aria-label": "Attached files",
|
|
1393
1417
|
...rest
|
|
1394
1418
|
},
|
|
1395
|
-
visibleAttachments.map((attachment) => /* @__PURE__ */
|
|
1419
|
+
visibleAttachments.map((attachment) => /* @__PURE__ */ import_react16.default.createElement(
|
|
1396
1420
|
FileChip,
|
|
1397
1421
|
{
|
|
1398
1422
|
key: attachment.id,
|
|
@@ -1406,7 +1430,7 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1406
1430
|
onRemove: onRemove ? () => onRemove(attachment.id) : void 0
|
|
1407
1431
|
}
|
|
1408
1432
|
)),
|
|
1409
|
-
hiddenCount > 0 && /* @__PURE__ */
|
|
1433
|
+
hiddenCount > 0 && /* @__PURE__ */ import_react16.default.createElement(
|
|
1410
1434
|
"div",
|
|
1411
1435
|
{
|
|
1412
1436
|
className: "inline-flex items-center px-2 py-1.5 bg-charcoal border border-silver/30 text-sm text-silver"
|
|
@@ -1421,10 +1445,10 @@ var AttachmentPreview = import_react15.default.forwardRef(
|
|
|
1421
1445
|
AttachmentPreview.displayName = "AttachmentPreview";
|
|
1422
1446
|
|
|
1423
1447
|
// src/components/Label.tsx
|
|
1424
|
-
var
|
|
1425
|
-
var Label =
|
|
1448
|
+
var import_react17 = __toESM(require("react"));
|
|
1449
|
+
var Label = import_react17.default.forwardRef(
|
|
1426
1450
|
({ className, required, children, ...rest }, ref) => {
|
|
1427
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ import_react17.default.createElement(
|
|
1428
1452
|
"label",
|
|
1429
1453
|
{
|
|
1430
1454
|
ref,
|
|
@@ -1432,17 +1456,17 @@ var Label = import_react16.default.forwardRef(
|
|
|
1432
1456
|
...rest
|
|
1433
1457
|
},
|
|
1434
1458
|
children,
|
|
1435
|
-
required && /* @__PURE__ */
|
|
1459
|
+
required && /* @__PURE__ */ import_react17.default.createElement("span", { className: "text-error ml-1" }, "*")
|
|
1436
1460
|
);
|
|
1437
1461
|
}
|
|
1438
1462
|
);
|
|
1439
1463
|
Label.displayName = "Label";
|
|
1440
1464
|
|
|
1441
1465
|
// src/components/HelperText.tsx
|
|
1442
|
-
var
|
|
1443
|
-
var HelperText =
|
|
1466
|
+
var import_react18 = __toESM(require("react"));
|
|
1467
|
+
var HelperText = import_react18.default.forwardRef(
|
|
1444
1468
|
({ className, error, children, ...rest }, ref) => {
|
|
1445
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ import_react18.default.createElement(
|
|
1446
1470
|
"p",
|
|
1447
1471
|
{
|
|
1448
1472
|
ref,
|
|
@@ -1456,12 +1480,12 @@ var HelperText = import_react17.default.forwardRef(
|
|
|
1456
1480
|
HelperText.displayName = "HelperText";
|
|
1457
1481
|
|
|
1458
1482
|
// src/components/Textarea.tsx
|
|
1459
|
-
var
|
|
1460
|
-
var Textarea =
|
|
1483
|
+
var import_react19 = __toESM(require("react"));
|
|
1484
|
+
var Textarea = import_react19.default.forwardRef(
|
|
1461
1485
|
({ error = false, className, disabled, ...rest }, ref) => {
|
|
1462
1486
|
const base = "w-full px-3 py-2 bg-graphite border border-ash rounded-none text-white placeholder:text-zinc min-h-[80px] transition-all duration-fast focus:border-gold focus:ring-1 focus:ring-gold focus:outline-none disabled:bg-slate disabled:text-dim disabled:cursor-not-allowed";
|
|
1463
1487
|
const errorCls = error ? "border-error focus:border-error focus:ring-error" : "";
|
|
1464
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ import_react19.default.createElement(
|
|
1465
1489
|
"textarea",
|
|
1466
1490
|
{
|
|
1467
1491
|
ref,
|
|
@@ -1475,11 +1499,11 @@ var Textarea = import_react18.default.forwardRef(
|
|
|
1475
1499
|
Textarea.displayName = "Textarea";
|
|
1476
1500
|
|
|
1477
1501
|
// src/components/Select.tsx
|
|
1478
|
-
var
|
|
1502
|
+
var import_react20 = __toESM(require("react"));
|
|
1479
1503
|
var selectBgImage = `url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23C9A227' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`;
|
|
1480
|
-
var Select =
|
|
1504
|
+
var Select = import_react20.default.forwardRef(
|
|
1481
1505
|
({ error = false, className, disabled, options, children, ...rest }, ref) => {
|
|
1482
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1483
1507
|
"select",
|
|
1484
1508
|
{
|
|
1485
1509
|
ref,
|
|
@@ -1499,19 +1523,19 @@ var Select = import_react19.default.forwardRef(
|
|
|
1499
1523
|
disabled,
|
|
1500
1524
|
...rest
|
|
1501
1525
|
},
|
|
1502
|
-
options ? options.map((opt) => /* @__PURE__ */
|
|
1526
|
+
options ? options.map((opt) => /* @__PURE__ */ import_react20.default.createElement("option", { key: opt.value, value: opt.value }, opt.label)) : children
|
|
1503
1527
|
);
|
|
1504
1528
|
}
|
|
1505
1529
|
);
|
|
1506
1530
|
Select.displayName = "Select";
|
|
1507
1531
|
|
|
1508
1532
|
// src/components/Checkbox.tsx
|
|
1509
|
-
var
|
|
1533
|
+
var import_react21 = __toESM(require("react"));
|
|
1510
1534
|
var checkmarkSvg = `url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%231A1A1A' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")`;
|
|
1511
|
-
var Checkbox =
|
|
1535
|
+
var Checkbox = import_react21.default.forwardRef(
|
|
1512
1536
|
({ className, label, id, ...rest }, ref) => {
|
|
1513
1537
|
const inputId = id || rest.name || Math.random().toString(36).substr(2, 9);
|
|
1514
|
-
const setRef = (0,
|
|
1538
|
+
const setRef = (0, import_react21.useCallback)((node) => {
|
|
1515
1539
|
if (node) {
|
|
1516
1540
|
if (node.checked) {
|
|
1517
1541
|
node.style.backgroundImage = checkmarkSvg;
|
|
@@ -1523,7 +1547,7 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1523
1547
|
ref.current = node;
|
|
1524
1548
|
}
|
|
1525
1549
|
}, [ref]);
|
|
1526
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react21.default.createElement(
|
|
1527
1551
|
"input",
|
|
1528
1552
|
{
|
|
1529
1553
|
type: "checkbox",
|
|
@@ -1553,7 +1577,7 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1553
1577
|
},
|
|
1554
1578
|
...rest
|
|
1555
1579
|
}
|
|
1556
|
-
), label && /* @__PURE__ */
|
|
1580
|
+
), label && /* @__PURE__ */ import_react21.default.createElement(
|
|
1557
1581
|
"label",
|
|
1558
1582
|
{
|
|
1559
1583
|
htmlFor: inputId,
|
|
@@ -1566,12 +1590,12 @@ var Checkbox = import_react20.default.forwardRef(
|
|
|
1566
1590
|
Checkbox.displayName = "Checkbox";
|
|
1567
1591
|
|
|
1568
1592
|
// src/components/Radio.tsx
|
|
1569
|
-
var
|
|
1593
|
+
var import_react22 = __toESM(require("react"));
|
|
1570
1594
|
var radioDotSvg = `url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%231A1A1A' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")`;
|
|
1571
|
-
var Radio =
|
|
1595
|
+
var Radio = import_react22.default.forwardRef(
|
|
1572
1596
|
({ className, label, id, ...rest }, ref) => {
|
|
1573
1597
|
const inputId = id || rest.name || Math.random().toString(36).substr(2, 9);
|
|
1574
|
-
const setRef = (0,
|
|
1598
|
+
const setRef = (0, import_react22.useCallback)((node) => {
|
|
1575
1599
|
if (node) {
|
|
1576
1600
|
if (node.checked) {
|
|
1577
1601
|
node.style.backgroundImage = radioDotSvg;
|
|
@@ -1583,7 +1607,7 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1583
1607
|
ref.current = node;
|
|
1584
1608
|
}
|
|
1585
1609
|
}, [ref]);
|
|
1586
|
-
return /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ import_react22.default.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ import_react22.default.createElement(
|
|
1587
1611
|
"input",
|
|
1588
1612
|
{
|
|
1589
1613
|
type: "radio",
|
|
@@ -1623,7 +1647,7 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1623
1647
|
},
|
|
1624
1648
|
...rest
|
|
1625
1649
|
}
|
|
1626
|
-
), label && /* @__PURE__ */
|
|
1650
|
+
), label && /* @__PURE__ */ import_react22.default.createElement(
|
|
1627
1651
|
"label",
|
|
1628
1652
|
{
|
|
1629
1653
|
htmlFor: inputId,
|
|
@@ -1636,8 +1660,8 @@ var Radio = import_react21.default.forwardRef(
|
|
|
1636
1660
|
Radio.displayName = "Radio";
|
|
1637
1661
|
|
|
1638
1662
|
// src/components/Switch.tsx
|
|
1639
|
-
var
|
|
1640
|
-
var Switch =
|
|
1663
|
+
var import_react23 = __toESM(require("react"));
|
|
1664
|
+
var Switch = import_react23.default.forwardRef(
|
|
1641
1665
|
({
|
|
1642
1666
|
checked: controlledChecked,
|
|
1643
1667
|
defaultChecked = false,
|
|
@@ -1647,11 +1671,11 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1647
1671
|
label,
|
|
1648
1672
|
...rest
|
|
1649
1673
|
}, ref) => {
|
|
1650
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
1674
|
+
const [internalChecked, setInternalChecked] = (0, import_react23.useState)(defaultChecked);
|
|
1651
1675
|
const isControlled = controlledChecked !== void 0;
|
|
1652
1676
|
const checked = isControlled ? controlledChecked : internalChecked;
|
|
1653
|
-
const buttonRef = (0,
|
|
1654
|
-
const setRefs = (0,
|
|
1677
|
+
const buttonRef = (0, import_react23.useRef)(null);
|
|
1678
|
+
const setRefs = (0, import_react23.useCallback)(
|
|
1655
1679
|
(node) => {
|
|
1656
1680
|
buttonRef.current = node;
|
|
1657
1681
|
if (typeof ref === "function") {
|
|
@@ -1673,7 +1697,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1673
1697
|
onCheckedChange?.(newChecked);
|
|
1674
1698
|
rest.onClick?.(e);
|
|
1675
1699
|
};
|
|
1676
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ import_react23.default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ import_react23.default.createElement(
|
|
1677
1701
|
"button",
|
|
1678
1702
|
{
|
|
1679
1703
|
type: "button",
|
|
@@ -1693,7 +1717,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1693
1717
|
),
|
|
1694
1718
|
...rest
|
|
1695
1719
|
},
|
|
1696
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ import_react23.default.createElement(
|
|
1697
1721
|
"span",
|
|
1698
1722
|
{
|
|
1699
1723
|
className: cx(
|
|
@@ -1703,7 +1727,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1703
1727
|
)
|
|
1704
1728
|
}
|
|
1705
1729
|
)
|
|
1706
|
-
), label && /* @__PURE__ */
|
|
1730
|
+
), label && /* @__PURE__ */ import_react23.default.createElement(
|
|
1707
1731
|
"span",
|
|
1708
1732
|
{
|
|
1709
1733
|
className: "text-sm text-silver cursor-pointer",
|
|
@@ -1721,7 +1745,7 @@ var Switch = import_react22.default.forwardRef(
|
|
|
1721
1745
|
Switch.displayName = "Switch";
|
|
1722
1746
|
|
|
1723
1747
|
// src/components/Slider.tsx
|
|
1724
|
-
var
|
|
1748
|
+
var import_react24 = __toESM(require("react"));
|
|
1725
1749
|
var SIZE_TRACK = {
|
|
1726
1750
|
sm: "h-1",
|
|
1727
1751
|
md: "h-2",
|
|
@@ -1732,7 +1756,7 @@ var SIZE_THUMB = {
|
|
|
1732
1756
|
md: "h-4 w-4",
|
|
1733
1757
|
lg: "h-5 w-5"
|
|
1734
1758
|
};
|
|
1735
|
-
var Slider =
|
|
1759
|
+
var Slider = import_react24.default.forwardRef(
|
|
1736
1760
|
({
|
|
1737
1761
|
value: controlledValue,
|
|
1738
1762
|
defaultValue = 0,
|
|
@@ -1748,13 +1772,13 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1748
1772
|
className,
|
|
1749
1773
|
...props
|
|
1750
1774
|
}, ref) => {
|
|
1751
|
-
const [internalValue, setInternalValue] = (0,
|
|
1752
|
-
const [isDragging, setIsDragging] = (0,
|
|
1753
|
-
const trackRef = (0,
|
|
1775
|
+
const [internalValue, setInternalValue] = (0, import_react24.useState)(defaultValue);
|
|
1776
|
+
const [isDragging, setIsDragging] = (0, import_react24.useState)(false);
|
|
1777
|
+
const trackRef = (0, import_react24.useRef)(null);
|
|
1754
1778
|
const isControlled = controlledValue !== void 0;
|
|
1755
1779
|
const value = isControlled ? controlledValue : internalValue;
|
|
1756
1780
|
const percentage = (value - min) / (max - min) * 100;
|
|
1757
|
-
const updateValue = (0,
|
|
1781
|
+
const updateValue = (0, import_react24.useCallback)(
|
|
1758
1782
|
(clientX) => {
|
|
1759
1783
|
if (!trackRef.current || disabled) {
|
|
1760
1784
|
return;
|
|
@@ -1826,14 +1850,14 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1826
1850
|
onChange?.(newValue);
|
|
1827
1851
|
onChangeEnd?.(newValue);
|
|
1828
1852
|
};
|
|
1829
|
-
return /* @__PURE__ */
|
|
1853
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
|
1830
1854
|
"div",
|
|
1831
1855
|
{
|
|
1832
1856
|
ref,
|
|
1833
1857
|
className: cx("relative w-full py-2", disabled && "opacity-50", className),
|
|
1834
1858
|
...props
|
|
1835
1859
|
},
|
|
1836
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1837
1861
|
"div",
|
|
1838
1862
|
{
|
|
1839
1863
|
ref: trackRef,
|
|
@@ -1843,14 +1867,14 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1843
1867
|
),
|
|
1844
1868
|
onMouseDown: handleMouseDown
|
|
1845
1869
|
},
|
|
1846
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1847
1871
|
"div",
|
|
1848
1872
|
{
|
|
1849
1873
|
className: cx("absolute inset-y-0 left-0 bg-gold", SIZE_TRACK[size]),
|
|
1850
1874
|
style: { width: `${percentage}%` }
|
|
1851
1875
|
}
|
|
1852
1876
|
),
|
|
1853
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
|
1854
1878
|
"div",
|
|
1855
1879
|
{
|
|
1856
1880
|
role: "slider",
|
|
@@ -1871,7 +1895,7 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1871
1895
|
),
|
|
1872
1896
|
style: { left: `${percentage}%` }
|
|
1873
1897
|
},
|
|
1874
|
-
showTooltip && isDragging && /* @__PURE__ */
|
|
1898
|
+
showTooltip && isDragging && /* @__PURE__ */ import_react24.default.createElement(
|
|
1875
1899
|
"div",
|
|
1876
1900
|
{
|
|
1877
1901
|
className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2 py-1 bg-graphite border border-ash text-xs text-white whitespace-nowrap"
|
|
@@ -1886,10 +1910,10 @@ var Slider = import_react23.default.forwardRef(
|
|
|
1886
1910
|
Slider.displayName = "Slider";
|
|
1887
1911
|
|
|
1888
1912
|
// src/components/InputGroup.tsx
|
|
1889
|
-
var
|
|
1890
|
-
var InputGroup =
|
|
1913
|
+
var import_react25 = __toESM(require("react"));
|
|
1914
|
+
var InputGroup = import_react25.default.forwardRef(
|
|
1891
1915
|
({ className, children, ...props }, ref) => {
|
|
1892
|
-
return /* @__PURE__ */
|
|
1916
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1893
1917
|
"div",
|
|
1894
1918
|
{
|
|
1895
1919
|
ref,
|
|
@@ -1901,9 +1925,9 @@ var InputGroup = import_react24.default.forwardRef(
|
|
|
1901
1925
|
}
|
|
1902
1926
|
);
|
|
1903
1927
|
InputGroup.displayName = "InputGroup";
|
|
1904
|
-
var InputLeftAddon =
|
|
1928
|
+
var InputLeftAddon = import_react25.default.forwardRef(
|
|
1905
1929
|
({ className, children, ...props }, ref) => {
|
|
1906
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1907
1931
|
"div",
|
|
1908
1932
|
{
|
|
1909
1933
|
ref,
|
|
@@ -1919,9 +1943,9 @@ var InputLeftAddon = import_react24.default.forwardRef(
|
|
|
1919
1943
|
}
|
|
1920
1944
|
);
|
|
1921
1945
|
InputLeftAddon.displayName = "InputLeftAddon";
|
|
1922
|
-
var InputRightAddon =
|
|
1946
|
+
var InputRightAddon = import_react25.default.forwardRef(
|
|
1923
1947
|
({ className, children, ...props }, ref) => {
|
|
1924
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1925
1949
|
"div",
|
|
1926
1950
|
{
|
|
1927
1951
|
ref,
|
|
@@ -1937,9 +1961,9 @@ var InputRightAddon = import_react24.default.forwardRef(
|
|
|
1937
1961
|
}
|
|
1938
1962
|
);
|
|
1939
1963
|
InputRightAddon.displayName = "InputRightAddon";
|
|
1940
|
-
var InputLeftElement =
|
|
1964
|
+
var InputLeftElement = import_react25.default.forwardRef(
|
|
1941
1965
|
({ className, children, ...props }, ref) => {
|
|
1942
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1943
1967
|
"div",
|
|
1944
1968
|
{
|
|
1945
1969
|
ref,
|
|
@@ -1955,9 +1979,9 @@ var InputLeftElement = import_react24.default.forwardRef(
|
|
|
1955
1979
|
}
|
|
1956
1980
|
);
|
|
1957
1981
|
InputLeftElement.displayName = "InputLeftElement";
|
|
1958
|
-
var InputRightElement =
|
|
1982
|
+
var InputRightElement = import_react25.default.forwardRef(
|
|
1959
1983
|
({ className, children, ...props }, ref) => {
|
|
1960
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1961
1985
|
"div",
|
|
1962
1986
|
{
|
|
1963
1987
|
ref,
|
|
@@ -1972,9 +1996,9 @@ var InputRightElement = import_react24.default.forwardRef(
|
|
|
1972
1996
|
}
|
|
1973
1997
|
);
|
|
1974
1998
|
InputRightElement.displayName = "InputRightElement";
|
|
1975
|
-
var InputWrapper =
|
|
1999
|
+
var InputWrapper = import_react25.default.forwardRef(
|
|
1976
2000
|
({ className, children, ...props }, ref) => {
|
|
1977
|
-
return /* @__PURE__ */
|
|
2001
|
+
return /* @__PURE__ */ import_react25.default.createElement(
|
|
1978
2002
|
"div",
|
|
1979
2003
|
{
|
|
1980
2004
|
ref,
|
|
@@ -1988,7 +2012,7 @@ var InputWrapper = import_react24.default.forwardRef(
|
|
|
1988
2012
|
InputWrapper.displayName = "InputWrapper";
|
|
1989
2013
|
|
|
1990
2014
|
// src/components/Alert.tsx
|
|
1991
|
-
var
|
|
2015
|
+
var import_react26 = __toESM(require("react"));
|
|
1992
2016
|
var import_lucide_react3 = require("lucide-react");
|
|
1993
2017
|
var icons = {
|
|
1994
2018
|
info: import_lucide_react3.Info,
|
|
@@ -2002,10 +2026,10 @@ var variantStyles = {
|
|
|
2002
2026
|
warning: "bg-warning/10 border-warning text-warning",
|
|
2003
2027
|
error: "bg-error/10 border-error text-error"
|
|
2004
2028
|
};
|
|
2005
|
-
var Alert =
|
|
2029
|
+
var Alert = import_react26.default.forwardRef(
|
|
2006
2030
|
({ variant = "info", title, children, className, ...rest }, ref) => {
|
|
2007
2031
|
const Icon = icons[variant];
|
|
2008
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ import_react26.default.createElement(
|
|
2009
2033
|
"div",
|
|
2010
2034
|
{
|
|
2011
2035
|
ref,
|
|
@@ -2017,24 +2041,24 @@ var Alert = import_react25.default.forwardRef(
|
|
|
2017
2041
|
),
|
|
2018
2042
|
...rest
|
|
2019
2043
|
},
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ import_react26.default.createElement(Icon, { className: "h-5 w-5 shrink-0" }),
|
|
2045
|
+
/* @__PURE__ */ import_react26.default.createElement("div", { className: "flex-1" }, title && /* @__PURE__ */ import_react26.default.createElement(
|
|
2022
2046
|
"h5",
|
|
2023
2047
|
{
|
|
2024
2048
|
className: "mb-1 font-medium leading-none tracking-tight text-current"
|
|
2025
2049
|
},
|
|
2026
2050
|
title
|
|
2027
|
-
), /* @__PURE__ */
|
|
2051
|
+
), /* @__PURE__ */ import_react26.default.createElement("div", { className: "text-sm opacity-90" }, children))
|
|
2028
2052
|
);
|
|
2029
2053
|
}
|
|
2030
2054
|
);
|
|
2031
2055
|
Alert.displayName = "Alert";
|
|
2032
2056
|
|
|
2033
2057
|
// src/components/Spinner.tsx
|
|
2034
|
-
var
|
|
2058
|
+
var import_react27 = __toESM(require("react"));
|
|
2035
2059
|
var Spinner = ({ className, size = "md", ...rest }) => {
|
|
2036
2060
|
const sizeClass = size === "sm" ? "h-4 w-4" : size === "lg" ? "h-8 w-8" : "h-6 w-6";
|
|
2037
|
-
return /* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ import_react27.default.createElement(
|
|
2038
2062
|
"svg",
|
|
2039
2063
|
{
|
|
2040
2064
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2047,27 +2071,11 @@ var Spinner = ({ className, size = "md", ...rest }) => {
|
|
|
2047
2071
|
className: cx("animate-spin text-gold", sizeClass, className),
|
|
2048
2072
|
...rest
|
|
2049
2073
|
},
|
|
2050
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ import_react27.default.createElement("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2051
2075
|
);
|
|
2052
2076
|
};
|
|
2053
2077
|
Spinner.displayName = "Spinner";
|
|
2054
2078
|
|
|
2055
|
-
// src/components/Skeleton.tsx
|
|
2056
|
-
var import_react27 = __toESM(require("react"));
|
|
2057
|
-
var Skeleton = import_react27.default.forwardRef(
|
|
2058
|
-
({ className, ...rest }, ref) => {
|
|
2059
|
-
return /* @__PURE__ */ import_react27.default.createElement(
|
|
2060
|
-
"div",
|
|
2061
|
-
{
|
|
2062
|
-
ref,
|
|
2063
|
-
className: cx("animate-pulse bg-ash", className),
|
|
2064
|
-
...rest
|
|
2065
|
-
}
|
|
2066
|
-
);
|
|
2067
|
-
}
|
|
2068
|
-
);
|
|
2069
|
-
Skeleton.displayName = "Skeleton";
|
|
2070
|
-
|
|
2071
2079
|
// src/components/Progress.tsx
|
|
2072
2080
|
var import_react28 = __toESM(require("react"));
|
|
2073
2081
|
var SIZE_MAP = {
|
|
@@ -3735,6 +3743,7 @@ var import_react53 = __toESM(require("react"));
|
|
|
3735
3743
|
// src/components/MarkdownContent.tsx
|
|
3736
3744
|
var import_react52 = __toESM(require("react"));
|
|
3737
3745
|
var import_dompurify = __toESM(require("dompurify"));
|
|
3746
|
+
var import_marked = require("marked");
|
|
3738
3747
|
var DEFAULT_SANITIZE_CONFIG = {
|
|
3739
3748
|
ALLOWED_TAGS: [
|
|
3740
3749
|
"h1",
|
|
@@ -3840,14 +3849,25 @@ function injectStreamingCursor(html, cursorClassName) {
|
|
|
3840
3849
|
return container.innerHTML;
|
|
3841
3850
|
}
|
|
3842
3851
|
var MarkdownContent = import_react52.default.forwardRef(
|
|
3843
|
-
({ className, content, sanitizeConfig, isStreaming, cursorClassName, ...rest }, ref) => {
|
|
3852
|
+
({ className, content, isMarkdown = true, sanitizeConfig, isStreaming, cursorClassName, ...rest }, ref) => {
|
|
3844
3853
|
useDOMPurifySetup();
|
|
3845
3854
|
const sanitizedHtml = (0, import_react52.useMemo)(() => {
|
|
3846
3855
|
if (!content && !isStreaming) {
|
|
3847
3856
|
return "";
|
|
3848
3857
|
}
|
|
3849
3858
|
const config = sanitizeConfig ?? DEFAULT_SANITIZE_CONFIG;
|
|
3850
|
-
|
|
3859
|
+
let htmlContent;
|
|
3860
|
+
if (isMarkdown) {
|
|
3861
|
+
try {
|
|
3862
|
+
htmlContent = import_marked.marked.parse(content);
|
|
3863
|
+
} catch (e) {
|
|
3864
|
+
console.error("Error parsing markdown:", e);
|
|
3865
|
+
htmlContent = content;
|
|
3866
|
+
}
|
|
3867
|
+
} else {
|
|
3868
|
+
htmlContent = content;
|
|
3869
|
+
}
|
|
3870
|
+
const sanitized = htmlContent ? import_dompurify.default.sanitize(htmlContent, config) : "";
|
|
3851
3871
|
if (isStreaming) {
|
|
3852
3872
|
return injectStreamingCursor(sanitized, cursorClassName);
|
|
3853
3873
|
}
|
|
@@ -4222,7 +4242,7 @@ var StreamingCursor = import_react54.default.forwardRef(
|
|
|
4222
4242
|
StreamingCursor.displayName = "StreamingCursor";
|
|
4223
4243
|
|
|
4224
4244
|
// src/components/chat/ChatInterface.tsx
|
|
4225
|
-
var
|
|
4245
|
+
var import_react72 = __toESM(require("react"));
|
|
4226
4246
|
|
|
4227
4247
|
// src/components/chat/ChatView.tsx
|
|
4228
4248
|
var import_react58 = __toESM(require("react"));
|
|
@@ -5134,7 +5154,10 @@ var CollapsedSidebarToggle = import_react60.default.forwardRef(({ onExpand, clas
|
|
|
5134
5154
|
CollapsedSidebarToggle.displayName = "CollapsedSidebarToggle";
|
|
5135
5155
|
|
|
5136
5156
|
// src/components/chat/ArtifactsPanel.tsx
|
|
5137
|
-
var
|
|
5157
|
+
var import_react68 = __toESM(require("react"));
|
|
5158
|
+
|
|
5159
|
+
// src/components/ArtifactCard.tsx
|
|
5160
|
+
var import_react67 = __toESM(require("react"));
|
|
5138
5161
|
|
|
5139
5162
|
// src/components/ImageCard.tsx
|
|
5140
5163
|
var import_react61 = __toESM(require("react"));
|
|
@@ -5152,58 +5175,69 @@ function resolveAspectRatio(ratio) {
|
|
|
5152
5175
|
var ImageCard = import_react61.default.forwardRef(
|
|
5153
5176
|
({
|
|
5154
5177
|
src,
|
|
5155
|
-
alt,
|
|
5178
|
+
alt = "",
|
|
5156
5179
|
title,
|
|
5157
5180
|
subtitle,
|
|
5158
|
-
aspectRatio,
|
|
5181
|
+
aspectRatio = "landscape",
|
|
5159
5182
|
objectFit = "cover",
|
|
5160
5183
|
overlay,
|
|
5161
5184
|
mediaClassName,
|
|
5162
5185
|
contentClassName,
|
|
5163
5186
|
className,
|
|
5164
5187
|
children,
|
|
5188
|
+
isLoading,
|
|
5165
5189
|
...props
|
|
5166
5190
|
}, ref) => {
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
return /* @__PURE__ */ import_react61.default.createElement(Card, { ref, className: cx("p-0 overflow-hidden group w-fit", className), ...props }, /* @__PURE__ */ import_react61.default.createElement(
|
|
5170
|
-
"div",
|
|
5191
|
+
return /* @__PURE__ */ import_react61.default.createElement(
|
|
5192
|
+
Card,
|
|
5171
5193
|
{
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
),
|
|
5177
|
-
style: hasAspectRatio ? { aspectRatio: resolveAspectRatio(aspectRatio) } : void 0
|
|
5194
|
+
ref,
|
|
5195
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5196
|
+
isLoading,
|
|
5197
|
+
...props
|
|
5178
5198
|
},
|
|
5179
5199
|
/* @__PURE__ */ import_react61.default.createElement(
|
|
5180
|
-
|
|
5200
|
+
Card.Media,
|
|
5181
5201
|
{
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5202
|
+
className: mediaClassName,
|
|
5203
|
+
style: { aspectRatio: resolveAspectRatio(aspectRatio) }
|
|
5204
|
+
},
|
|
5205
|
+
src && /* @__PURE__ */ import_react61.default.createElement(
|
|
5206
|
+
"img",
|
|
5207
|
+
{
|
|
5208
|
+
src,
|
|
5209
|
+
alt,
|
|
5210
|
+
className: cx(
|
|
5211
|
+
"w-full h-full",
|
|
5212
|
+
objectFit === "cover" ? "object-cover" : "object-contain"
|
|
5213
|
+
)
|
|
5214
|
+
}
|
|
5215
|
+
),
|
|
5216
|
+
overlay && /* @__PURE__ */ import_react61.default.createElement(
|
|
5217
|
+
"div",
|
|
5218
|
+
{
|
|
5219
|
+
className: "absolute inset-0 bg-obsidian/80 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex items-center justify-center"
|
|
5220
|
+
},
|
|
5221
|
+
overlay
|
|
5222
|
+
)
|
|
5191
5223
|
),
|
|
5192
|
-
|
|
5193
|
-
|
|
5224
|
+
/* @__PURE__ */ import_react61.default.createElement(
|
|
5225
|
+
Card.Header,
|
|
5194
5226
|
{
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5227
|
+
title,
|
|
5228
|
+
subtitle,
|
|
5229
|
+
className: contentClassName
|
|
5230
|
+
}
|
|
5231
|
+
),
|
|
5232
|
+
children && /* @__PURE__ */ import_react61.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5233
|
+
);
|
|
5200
5234
|
}
|
|
5201
5235
|
);
|
|
5202
5236
|
ImageCard.displayName = "ImageCard";
|
|
5203
5237
|
|
|
5204
5238
|
// src/components/VideoCard.tsx
|
|
5205
5239
|
var import_react62 = __toESM(require("react"));
|
|
5206
|
-
var
|
|
5240
|
+
var import_react_player = __toESM(require("react-player"));
|
|
5207
5241
|
var ASPECT_RATIO_PRESETS2 = {
|
|
5208
5242
|
video: "16 / 9",
|
|
5209
5243
|
cinema: "21 / 9",
|
|
@@ -5232,48 +5266,57 @@ var VideoCard = import_react62.default.forwardRef(
|
|
|
5232
5266
|
className,
|
|
5233
5267
|
children,
|
|
5234
5268
|
playerProps,
|
|
5269
|
+
isLoading,
|
|
5235
5270
|
...props
|
|
5236
5271
|
}, ref) => {
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
"div",
|
|
5272
|
+
return /* @__PURE__ */ import_react62.default.createElement(
|
|
5273
|
+
Card,
|
|
5240
5274
|
{
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
|
|
5275
|
+
ref,
|
|
5276
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5277
|
+
isLoading,
|
|
5278
|
+
...props
|
|
5246
5279
|
},
|
|
5247
5280
|
/* @__PURE__ */ import_react62.default.createElement(
|
|
5248
|
-
|
|
5281
|
+
Card.Media,
|
|
5249
5282
|
{
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5283
|
+
className: mediaClassName,
|
|
5284
|
+
style: { aspectRatio: resolveAspectRatio2(aspectRatio) }
|
|
5285
|
+
},
|
|
5286
|
+
src && /* @__PURE__ */ import_react62.default.createElement(
|
|
5287
|
+
import_react_player.default,
|
|
5288
|
+
{
|
|
5289
|
+
src,
|
|
5290
|
+
playing,
|
|
5291
|
+
controls,
|
|
5292
|
+
light,
|
|
5293
|
+
volume,
|
|
5294
|
+
muted,
|
|
5295
|
+
loop,
|
|
5296
|
+
width: "100%",
|
|
5297
|
+
height: "100%",
|
|
5298
|
+
className: "absolute top-0 left-0",
|
|
5299
|
+
...playerProps
|
|
5300
|
+
}
|
|
5301
|
+
)
|
|
5302
|
+
),
|
|
5303
|
+
/* @__PURE__ */ import_react62.default.createElement(
|
|
5304
|
+
Card.Header,
|
|
5305
|
+
{
|
|
5306
|
+
title,
|
|
5307
|
+
subtitle,
|
|
5308
|
+
className: contentClassName
|
|
5261
5309
|
}
|
|
5262
|
-
)
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
{
|
|
5266
|
-
className: "text-sm text-silver leading-normal mt-1"
|
|
5267
|
-
},
|
|
5268
|
-
subtitle
|
|
5269
|
-
), children));
|
|
5310
|
+
),
|
|
5311
|
+
children && /* @__PURE__ */ import_react62.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5312
|
+
);
|
|
5270
5313
|
}
|
|
5271
5314
|
);
|
|
5272
5315
|
VideoCard.displayName = "VideoCard";
|
|
5273
5316
|
|
|
5274
5317
|
// src/components/AudioCard.tsx
|
|
5275
5318
|
var import_react63 = __toESM(require("react"));
|
|
5276
|
-
var
|
|
5319
|
+
var import_react_player2 = __toESM(require("react-player"));
|
|
5277
5320
|
var import_lucide_react12 = require("lucide-react");
|
|
5278
5321
|
var AudioCard = import_react63.default.forwardRef(
|
|
5279
5322
|
({
|
|
@@ -5290,19 +5333,23 @@ var AudioCard = import_react63.default.forwardRef(
|
|
|
5290
5333
|
className,
|
|
5291
5334
|
children,
|
|
5292
5335
|
playerProps,
|
|
5336
|
+
height = "40px",
|
|
5337
|
+
isLoading,
|
|
5293
5338
|
...props
|
|
5294
5339
|
}, ref) => {
|
|
5295
|
-
return /* @__PURE__ */ import_react63.default.createElement(
|
|
5296
|
-
|
|
5340
|
+
return /* @__PURE__ */ import_react63.default.createElement(
|
|
5341
|
+
Card,
|
|
5297
5342
|
{
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5343
|
+
ref,
|
|
5344
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5345
|
+
isLoading,
|
|
5346
|
+
...props
|
|
5302
5347
|
},
|
|
5303
|
-
/* @__PURE__ */ import_react63.default.createElement(
|
|
5304
|
-
|
|
5305
|
-
|
|
5348
|
+
/* @__PURE__ */ import_react63.default.createElement(Card.Media, { className: cx(
|
|
5349
|
+
"bg-obsidian py-8 flex flex-col items-center justify-center",
|
|
5350
|
+
mediaClassName
|
|
5351
|
+
) }, /* @__PURE__ */ import_react63.default.createElement("div", { className: "mb-4 text-gold" }, /* @__PURE__ */ import_react63.default.createElement(import_lucide_react12.Music, { size: 48 })), src && /* @__PURE__ */ import_react63.default.createElement("div", { className: "w-full px-4" }, /* @__PURE__ */ import_react63.default.createElement(
|
|
5352
|
+
import_react_player2.default,
|
|
5306
5353
|
{
|
|
5307
5354
|
src,
|
|
5308
5355
|
playing,
|
|
@@ -5311,108 +5358,308 @@ var AudioCard = import_react63.default.forwardRef(
|
|
|
5311
5358
|
muted,
|
|
5312
5359
|
loop,
|
|
5313
5360
|
width: "100%",
|
|
5314
|
-
height
|
|
5361
|
+
height,
|
|
5315
5362
|
style: { backgroundColor: "transparent" },
|
|
5316
5363
|
config: {
|
|
5317
5364
|
file: {
|
|
5318
5365
|
forceAudio: true,
|
|
5319
5366
|
attributes: {
|
|
5320
|
-
style: { width: "100%", height
|
|
5367
|
+
style: { width: "100%", height }
|
|
5321
5368
|
}
|
|
5322
5369
|
}
|
|
5323
5370
|
},
|
|
5324
5371
|
...playerProps
|
|
5325
5372
|
}
|
|
5326
|
-
))
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5373
|
+
))),
|
|
5374
|
+
/* @__PURE__ */ import_react63.default.createElement(
|
|
5375
|
+
Card.Header,
|
|
5376
|
+
{
|
|
5377
|
+
title,
|
|
5378
|
+
subtitle,
|
|
5379
|
+
className: contentClassName
|
|
5380
|
+
}
|
|
5381
|
+
),
|
|
5382
|
+
children && /* @__PURE__ */ import_react63.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5383
|
+
);
|
|
5384
|
+
}
|
|
5385
|
+
);
|
|
5386
|
+
AudioCard.displayName = "AudioCard";
|
|
5387
|
+
|
|
5388
|
+
// src/components/PdfCard.tsx
|
|
5389
|
+
var import_react64 = __toESM(require("react"));
|
|
5390
|
+
var import_lucide_react13 = require("lucide-react");
|
|
5391
|
+
var PdfCard = import_react64.default.forwardRef(
|
|
5392
|
+
({
|
|
5393
|
+
src,
|
|
5394
|
+
title,
|
|
5395
|
+
subtitle,
|
|
5396
|
+
height = "400px",
|
|
5397
|
+
mediaClassName,
|
|
5398
|
+
contentClassName,
|
|
5399
|
+
className,
|
|
5400
|
+
children,
|
|
5401
|
+
isLoading,
|
|
5402
|
+
...props
|
|
5403
|
+
}, ref) => {
|
|
5404
|
+
return /* @__PURE__ */ import_react64.default.createElement(
|
|
5405
|
+
Card,
|
|
5335
5406
|
{
|
|
5336
|
-
|
|
5407
|
+
ref,
|
|
5408
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5409
|
+
isLoading,
|
|
5410
|
+
...props
|
|
5337
5411
|
},
|
|
5338
|
-
|
|
5339
|
-
|
|
5412
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5413
|
+
Card.Media,
|
|
5414
|
+
{
|
|
5415
|
+
className: cx("bg-obsidian", mediaClassName),
|
|
5416
|
+
style: { height }
|
|
5417
|
+
},
|
|
5418
|
+
src && /* @__PURE__ */ import_react64.default.createElement(
|
|
5419
|
+
"iframe",
|
|
5420
|
+
{
|
|
5421
|
+
src: `${src}#view=FitH`,
|
|
5422
|
+
title: typeof title === "string" ? title : "PDF Document",
|
|
5423
|
+
className: "w-full h-full border-0"
|
|
5424
|
+
}
|
|
5425
|
+
)
|
|
5426
|
+
),
|
|
5427
|
+
/* @__PURE__ */ import_react64.default.createElement(
|
|
5428
|
+
Card.Header,
|
|
5429
|
+
{
|
|
5430
|
+
title,
|
|
5431
|
+
subtitle,
|
|
5432
|
+
className: contentClassName,
|
|
5433
|
+
action: /* @__PURE__ */ import_react64.default.createElement("div", { className: "p-2 bg-ash/20 text-gold shrink-0" }, /* @__PURE__ */ import_react64.default.createElement(import_lucide_react13.FileText, { size: 20 }))
|
|
5434
|
+
}
|
|
5435
|
+
),
|
|
5436
|
+
children && /* @__PURE__ */ import_react64.default.createElement(Card.Body, { className: contentClassName }, children)
|
|
5437
|
+
);
|
|
5340
5438
|
}
|
|
5341
5439
|
);
|
|
5342
|
-
|
|
5440
|
+
PdfCard.displayName = "PdfCard";
|
|
5343
5441
|
|
|
5344
5442
|
// src/components/ScriptCard.tsx
|
|
5345
|
-
var
|
|
5443
|
+
var import_react65 = __toESM(require("react"));
|
|
5346
5444
|
function ScriptElementRenderer({ element }) {
|
|
5347
5445
|
switch (element.type) {
|
|
5348
5446
|
case "scene-heading":
|
|
5349
|
-
return /* @__PURE__ */
|
|
5447
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-2 font-bold uppercase text-gold text-xs tracking-wide" }, element.content);
|
|
5350
5448
|
case "action":
|
|
5351
|
-
return /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "my-2 text-silver text-xs leading-relaxed" }, element.content);
|
|
5352
5450
|
case "character":
|
|
5353
|
-
return /* @__PURE__ */
|
|
5451
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-0.5 ml-8 font-bold text-white text-xs uppercase tracking-wide" }, element.content);
|
|
5354
5452
|
case "parenthetical":
|
|
5355
|
-
return /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "ml-6 text-silver/70 text-xs italic" }, "(", element.content, ")");
|
|
5356
5454
|
case "dialogue":
|
|
5357
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "ml-4 mr-8 text-silver text-xs leading-relaxed" }, element.content);
|
|
5358
5456
|
case "transition":
|
|
5359
|
-
return /* @__PURE__ */
|
|
5457
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-4 mb-2 text-right font-bold uppercase text-gold/80 text-xs tracking-wide" }, element.content);
|
|
5360
5458
|
case "title":
|
|
5361
|
-
return /* @__PURE__ */
|
|
5459
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "mt-6 mb-2 text-center font-bold text-gold text-sm" }, element.content);
|
|
5362
5460
|
case "subtitle":
|
|
5363
|
-
return /* @__PURE__ */
|
|
5461
|
+
return /* @__PURE__ */ import_react65.default.createElement("p", { className: "text-center italic text-gold/70 text-xs" }, element.content);
|
|
5364
5462
|
default:
|
|
5365
5463
|
return null;
|
|
5366
5464
|
}
|
|
5367
5465
|
}
|
|
5368
|
-
var ScriptCard =
|
|
5369
|
-
({ title, subtitle, elements, maxHeight = "16rem", className, style, ...rest }, ref) => {
|
|
5370
|
-
return /* @__PURE__ */
|
|
5371
|
-
|
|
5466
|
+
var ScriptCard = import_react65.default.forwardRef(
|
|
5467
|
+
({ title, subtitle, elements, maxHeight = "16rem", className, style, isLoading, ...rest }, ref) => {
|
|
5468
|
+
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5469
|
+
Card,
|
|
5372
5470
|
{
|
|
5373
5471
|
ref,
|
|
5374
|
-
className: cx(
|
|
5375
|
-
|
|
5376
|
-
className
|
|
5377
|
-
),
|
|
5472
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5473
|
+
isLoading,
|
|
5378
5474
|
...rest
|
|
5379
5475
|
},
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5476
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
5477
|
+
Card.Header,
|
|
5478
|
+
{
|
|
5479
|
+
title,
|
|
5480
|
+
subtitle
|
|
5481
|
+
}
|
|
5482
|
+
),
|
|
5483
|
+
/* @__PURE__ */ import_react65.default.createElement(
|
|
5484
|
+
Card.Body,
|
|
5383
5485
|
{
|
|
5384
|
-
className: "
|
|
5486
|
+
className: "font-mono overflow-y-auto",
|
|
5385
5487
|
style: { maxHeight, ...style }
|
|
5386
5488
|
},
|
|
5387
|
-
elements.map((element, index) => /* @__PURE__ */
|
|
5489
|
+
elements.map((element, index) => /* @__PURE__ */ import_react65.default.createElement(ScriptElementRenderer, { key: index, element }))
|
|
5388
5490
|
)
|
|
5389
5491
|
);
|
|
5390
5492
|
}
|
|
5391
5493
|
);
|
|
5392
5494
|
ScriptCard.displayName = "ScriptCard";
|
|
5393
5495
|
|
|
5394
|
-
// src/components/
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5496
|
+
// src/components/TextCard.tsx
|
|
5497
|
+
var import_react66 = __toESM(require("react"));
|
|
5498
|
+
var TextCard = import_react66.default.forwardRef(
|
|
5499
|
+
({
|
|
5500
|
+
content,
|
|
5501
|
+
title,
|
|
5502
|
+
subtitle,
|
|
5503
|
+
isMarkdown = true,
|
|
5504
|
+
maxHeight = "16rem",
|
|
5505
|
+
contentClassName,
|
|
5506
|
+
className,
|
|
5507
|
+
isLoading,
|
|
5508
|
+
...props
|
|
5509
|
+
}, ref) => {
|
|
5510
|
+
return /* @__PURE__ */ import_react66.default.createElement(
|
|
5511
|
+
Card,
|
|
5512
|
+
{
|
|
5513
|
+
ref,
|
|
5514
|
+
className: cx("p-0 overflow-hidden w-full", className),
|
|
5515
|
+
isLoading,
|
|
5516
|
+
...props
|
|
5517
|
+
},
|
|
5518
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5519
|
+
Card.Header,
|
|
5520
|
+
{
|
|
5521
|
+
title,
|
|
5522
|
+
subtitle
|
|
5523
|
+
}
|
|
5524
|
+
),
|
|
5525
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5526
|
+
Card.Body,
|
|
5527
|
+
{
|
|
5528
|
+
className: cx("overflow-y-auto", contentClassName),
|
|
5529
|
+
style: { maxHeight }
|
|
5530
|
+
},
|
|
5531
|
+
/* @__PURE__ */ import_react66.default.createElement(
|
|
5532
|
+
MarkdownContent,
|
|
5533
|
+
{
|
|
5534
|
+
content,
|
|
5535
|
+
isMarkdown,
|
|
5536
|
+
className: "prose-sm prose-invert max-w-none"
|
|
5537
|
+
}
|
|
5538
|
+
)
|
|
5539
|
+
)
|
|
5540
|
+
);
|
|
5405
5541
|
}
|
|
5406
|
-
|
|
5407
|
-
|
|
5542
|
+
);
|
|
5543
|
+
TextCard.displayName = "TextCard";
|
|
5544
|
+
|
|
5545
|
+
// src/components/ArtifactCard.tsx
|
|
5546
|
+
var ArtifactCard = import_react67.default.forwardRef(
|
|
5547
|
+
({ artifact, onExpand, isLoading, className, ...props }, ref) => {
|
|
5548
|
+
const commonProps = {
|
|
5549
|
+
title: artifact.title,
|
|
5550
|
+
subtitle: artifact.subtitle,
|
|
5551
|
+
isLoading: isLoading || artifact.isPending,
|
|
5552
|
+
className: "w-full"
|
|
5553
|
+
};
|
|
5554
|
+
const handleExpand = (e) => {
|
|
5555
|
+
e.stopPropagation();
|
|
5556
|
+
if (onExpand) {
|
|
5557
|
+
onExpand(artifact);
|
|
5558
|
+
}
|
|
5559
|
+
};
|
|
5560
|
+
const renderContent = () => {
|
|
5561
|
+
switch (artifact.type) {
|
|
5562
|
+
case "IMAGE":
|
|
5563
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5564
|
+
ImageCard,
|
|
5565
|
+
{
|
|
5566
|
+
...commonProps,
|
|
5567
|
+
src: artifact.url,
|
|
5568
|
+
alt: artifact.alt,
|
|
5569
|
+
aspectRatio: "landscape"
|
|
5570
|
+
}
|
|
5571
|
+
);
|
|
5572
|
+
case "VIDEO":
|
|
5573
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5574
|
+
VideoCard,
|
|
5575
|
+
{
|
|
5576
|
+
...commonProps,
|
|
5577
|
+
src: artifact.url,
|
|
5578
|
+
aspectRatio: "video",
|
|
5579
|
+
controls: true
|
|
5580
|
+
}
|
|
5581
|
+
);
|
|
5582
|
+
case "AUDIO":
|
|
5583
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5584
|
+
AudioCard,
|
|
5585
|
+
{
|
|
5586
|
+
...commonProps,
|
|
5587
|
+
src: artifact.url,
|
|
5588
|
+
controls: true
|
|
5589
|
+
}
|
|
5590
|
+
);
|
|
5591
|
+
case "PDF":
|
|
5592
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5593
|
+
PdfCard,
|
|
5594
|
+
{
|
|
5595
|
+
...commonProps,
|
|
5596
|
+
src: artifact.url
|
|
5597
|
+
}
|
|
5598
|
+
);
|
|
5599
|
+
case "SCRIPT":
|
|
5600
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5601
|
+
ScriptCard,
|
|
5602
|
+
{
|
|
5603
|
+
...commonProps,
|
|
5604
|
+
elements: artifact.scriptElements || [],
|
|
5605
|
+
maxHeight: "16rem"
|
|
5606
|
+
}
|
|
5607
|
+
);
|
|
5608
|
+
case "TEXT":
|
|
5609
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5610
|
+
TextCard,
|
|
5611
|
+
{
|
|
5612
|
+
...commonProps,
|
|
5613
|
+
content: artifact.inlineContent || "",
|
|
5614
|
+
isMarkdown: artifact.mimeType !== "text/plain",
|
|
5615
|
+
contentClassName: cx(
|
|
5616
|
+
artifact.mimeType === "text/plain" && "whitespace-pre-wrap"
|
|
5617
|
+
)
|
|
5618
|
+
}
|
|
5619
|
+
);
|
|
5620
|
+
default:
|
|
5621
|
+
return null;
|
|
5622
|
+
}
|
|
5623
|
+
};
|
|
5624
|
+
const isCardExpandable = !!onExpand && (artifact.type === "IMAGE" || artifact.type === "PDF" || artifact.type === "SCRIPT" || artifact.type === "TEXT");
|
|
5625
|
+
return /* @__PURE__ */ import_react67.default.createElement(
|
|
5626
|
+
"div",
|
|
5627
|
+
{
|
|
5628
|
+
ref,
|
|
5629
|
+
className: cx(
|
|
5630
|
+
"relative group",
|
|
5631
|
+
isCardExpandable && "cursor-pointer",
|
|
5632
|
+
artifact.fullWidth && "col-span-full",
|
|
5633
|
+
className
|
|
5634
|
+
),
|
|
5635
|
+
onClick: isCardExpandable ? handleExpand : void 0,
|
|
5636
|
+
...props
|
|
5637
|
+
},
|
|
5638
|
+
onExpand && /* @__PURE__ */ import_react67.default.createElement(
|
|
5639
|
+
"button",
|
|
5640
|
+
{
|
|
5641
|
+
onClick: handleExpand,
|
|
5642
|
+
className: cx(
|
|
5643
|
+
"absolute top-2 right-2 z-10 p-1.5",
|
|
5644
|
+
"bg-obsidian/80 text-silver hover:text-white hover:bg-obsidian",
|
|
5645
|
+
"opacity-0 group-hover:opacity-100 transition-opacity"
|
|
5646
|
+
),
|
|
5647
|
+
"aria-label": "Expand artifact"
|
|
5648
|
+
},
|
|
5649
|
+
/* @__PURE__ */ import_react67.default.createElement(ExpandIcon, { className: "w-4 h-4" })
|
|
5650
|
+
),
|
|
5651
|
+
renderContent()
|
|
5652
|
+
);
|
|
5408
5653
|
}
|
|
5409
|
-
|
|
5410
|
-
|
|
5654
|
+
);
|
|
5655
|
+
ArtifactCard.displayName = "ArtifactCard";
|
|
5656
|
+
|
|
5657
|
+
// src/components/chat/ArtifactsPanel.tsx
|
|
5411
5658
|
function ArtifactModal({
|
|
5412
5659
|
artifact,
|
|
5413
5660
|
onClose
|
|
5414
5661
|
}) {
|
|
5415
|
-
(0,
|
|
5662
|
+
(0, import_react68.useEffect)(() => {
|
|
5416
5663
|
const handleKeyDown = (e) => {
|
|
5417
5664
|
if (e.key === "Escape") {
|
|
5418
5665
|
onClose();
|
|
@@ -5421,67 +5668,77 @@ function ArtifactModal({
|
|
|
5421
5668
|
document.addEventListener("keydown", handleKeyDown);
|
|
5422
5669
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
5423
5670
|
}, [onClose]);
|
|
5424
|
-
const handleBackdropClick = (0,
|
|
5671
|
+
const handleBackdropClick = (0, import_react68.useCallback)((e) => {
|
|
5425
5672
|
if (e.target === e.currentTarget) {
|
|
5426
5673
|
onClose();
|
|
5427
5674
|
}
|
|
5428
5675
|
}, [onClose]);
|
|
5429
|
-
return /* @__PURE__ */
|
|
5676
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5430
5677
|
"div",
|
|
5431
5678
|
{
|
|
5432
5679
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-void/90 backdrop-blur-sm animate-fade-in",
|
|
5433
5680
|
onClick: handleBackdropClick
|
|
5434
5681
|
},
|
|
5435
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5436
5683
|
"div",
|
|
5437
5684
|
{
|
|
5438
5685
|
className: "relative w-11/12 h-5/6 max-w-6xl bg-charcoal border border-ash/40 flex flex-col overflow-hidden"
|
|
5439
5686
|
},
|
|
5440
|
-
/* @__PURE__ */
|
|
5687
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5441
5688
|
"div",
|
|
5442
5689
|
{
|
|
5443
5690
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
5444
5691
|
},
|
|
5445
|
-
/* @__PURE__ */
|
|
5446
|
-
/* @__PURE__ */
|
|
5692
|
+
/* @__PURE__ */ import_react68.default.createElement("div", null, artifact.title && /* @__PURE__ */ import_react68.default.createElement("h3", { className: "text-sm font-semibold text-white" }, artifact.title), artifact.subtitle && /* @__PURE__ */ import_react68.default.createElement("p", { className: "text-xs text-silver" }, artifact.subtitle)),
|
|
5693
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5447
5694
|
"button",
|
|
5448
5695
|
{
|
|
5449
5696
|
onClick: onClose,
|
|
5450
5697
|
className: "p-2 text-silver hover:text-white hover:bg-ash/20 transition-colors",
|
|
5451
5698
|
"aria-label": "Close modal"
|
|
5452
5699
|
},
|
|
5453
|
-
/* @__PURE__ */
|
|
5700
|
+
/* @__PURE__ */ import_react68.default.createElement(CloseIcon, { className: "w-5 h-5" })
|
|
5454
5701
|
)
|
|
5455
5702
|
),
|
|
5456
|
-
/* @__PURE__ */
|
|
5703
|
+
/* @__PURE__ */ import_react68.default.createElement("div", { className: "flex-1 overflow-auto p-4" }, artifact.type === "IMAGE" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5457
5704
|
"img",
|
|
5458
5705
|
{
|
|
5459
|
-
src: artifact.
|
|
5706
|
+
src: artifact.url,
|
|
5460
5707
|
alt: artifact.alt || "Artifact image",
|
|
5461
5708
|
className: "max-w-full max-h-full object-contain mx-auto"
|
|
5462
5709
|
}
|
|
5463
|
-
), artifact.type === "
|
|
5710
|
+
), artifact.type === "VIDEO" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5464
5711
|
VideoCard,
|
|
5465
5712
|
{
|
|
5466
|
-
src: artifact.
|
|
5713
|
+
src: artifact.url || "",
|
|
5467
5714
|
aspectRatio: "video",
|
|
5468
5715
|
controls: true,
|
|
5469
5716
|
className: "max-w-full max-h-full mx-auto"
|
|
5470
5717
|
}
|
|
5471
|
-
), artifact.type === "
|
|
5718
|
+
), artifact.type === "AUDIO" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5472
5719
|
AudioCard,
|
|
5473
5720
|
{
|
|
5474
|
-
src: artifact.
|
|
5721
|
+
src: artifact.url || "",
|
|
5475
5722
|
controls: true,
|
|
5476
5723
|
className: "max-w-xl mx-auto"
|
|
5477
5724
|
}
|
|
5478
|
-
), artifact.type === "
|
|
5725
|
+
), artifact.type === "PDF" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5726
|
+
PdfCard,
|
|
5727
|
+
{
|
|
5728
|
+
src: artifact.url || "",
|
|
5729
|
+
className: "h-full border-0"
|
|
5730
|
+
}
|
|
5731
|
+
), artifact.type === "TEXT" && /* @__PURE__ */ import_react68.default.createElement(
|
|
5479
5732
|
MarkdownContent,
|
|
5480
5733
|
{
|
|
5481
|
-
content: artifact.
|
|
5482
|
-
|
|
5734
|
+
content: artifact.inlineContent || "",
|
|
5735
|
+
isMarkdown: artifact.mimeType === "text/markdown",
|
|
5736
|
+
className: cx(
|
|
5737
|
+
"prose prose-invert max-w-none",
|
|
5738
|
+
artifact.mimeType === "text/plain" && "whitespace-pre-wrap"
|
|
5739
|
+
)
|
|
5483
5740
|
}
|
|
5484
|
-
), artifact.type === "
|
|
5741
|
+
), artifact.type === "SCRIPT" && artifact.scriptElements && /* @__PURE__ */ import_react68.default.createElement(
|
|
5485
5742
|
ScriptCard,
|
|
5486
5743
|
{
|
|
5487
5744
|
elements: artifact.scriptElements,
|
|
@@ -5497,130 +5754,16 @@ function ArtifactRenderer({
|
|
|
5497
5754
|
isLoading,
|
|
5498
5755
|
onExpand
|
|
5499
5756
|
}) {
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
(0, import_react65.useEffect)(() => {
|
|
5503
|
-
setImageLoaded(false);
|
|
5504
|
-
setMinDelayPassed(false);
|
|
5505
|
-
const timer = setTimeout(() => {
|
|
5506
|
-
setMinDelayPassed(true);
|
|
5507
|
-
}, 800);
|
|
5508
|
-
return () => clearTimeout(timer);
|
|
5509
|
-
}, [artifact.src, artifact.id]);
|
|
5510
|
-
const fullWidthClass = artifact.fullWidth ? "col-span-full" : "";
|
|
5511
|
-
if (isLoading || artifact.isPending) {
|
|
5512
|
-
return /* @__PURE__ */ import_react65.default.createElement(ArtifactSkeleton, { type: artifact.type, fullWidth: artifact.fullWidth });
|
|
5513
|
-
}
|
|
5514
|
-
const showContent = artifact.type !== "image" || imageLoaded && minDelayPassed;
|
|
5515
|
-
const expandButton = onExpand && /* @__PURE__ */ import_react65.default.createElement(
|
|
5516
|
-
"button",
|
|
5757
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5758
|
+
ArtifactCard,
|
|
5517
5759
|
{
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
className: cx(
|
|
5523
|
-
"absolute top-2 right-2 z-10 p-1.5",
|
|
5524
|
-
"bg-obsidian/80 text-silver hover:text-white hover:bg-obsidian",
|
|
5525
|
-
"opacity-0 group-hover:opacity-100 transition-opacity"
|
|
5526
|
-
),
|
|
5527
|
-
"aria-label": "Expand artifact"
|
|
5528
|
-
},
|
|
5529
|
-
/* @__PURE__ */ import_react65.default.createElement(ExpandIcon, { className: "w-4 h-4" })
|
|
5760
|
+
artifact,
|
|
5761
|
+
isLoading,
|
|
5762
|
+
onExpand
|
|
5763
|
+
}
|
|
5530
5764
|
);
|
|
5531
|
-
switch (artifact.type) {
|
|
5532
|
-
case "image":
|
|
5533
|
-
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5534
|
-
"div",
|
|
5535
|
-
{
|
|
5536
|
-
className: cx("relative group cursor-pointer", fullWidthClass),
|
|
5537
|
-
onClick: onExpand
|
|
5538
|
-
},
|
|
5539
|
-
!showContent && /* @__PURE__ */ import_react65.default.createElement(ArtifactSkeleton, { type: "image" }),
|
|
5540
|
-
expandButton,
|
|
5541
|
-
/* @__PURE__ */ import_react65.default.createElement(
|
|
5542
|
-
ImageCard,
|
|
5543
|
-
{
|
|
5544
|
-
src: artifact.src || "",
|
|
5545
|
-
alt: artifact.alt || "Artifact image",
|
|
5546
|
-
title: artifact.title,
|
|
5547
|
-
subtitle: artifact.subtitle,
|
|
5548
|
-
aspectRatio: "landscape",
|
|
5549
|
-
className: cx(
|
|
5550
|
-
"w-full transition-opacity duration-300",
|
|
5551
|
-
showContent ? "opacity-100" : "opacity-0 absolute inset-0"
|
|
5552
|
-
),
|
|
5553
|
-
onLoad: () => setImageLoaded(true)
|
|
5554
|
-
}
|
|
5555
|
-
)
|
|
5556
|
-
);
|
|
5557
|
-
case "video":
|
|
5558
|
-
return /* @__PURE__ */ import_react65.default.createElement("div", { className: cx("relative group", fullWidthClass) }, expandButton, /* @__PURE__ */ import_react65.default.createElement(
|
|
5559
|
-
VideoCard,
|
|
5560
|
-
{
|
|
5561
|
-
src: artifact.src || "",
|
|
5562
|
-
title: artifact.title,
|
|
5563
|
-
subtitle: artifact.subtitle,
|
|
5564
|
-
aspectRatio: "video",
|
|
5565
|
-
controls: true,
|
|
5566
|
-
className: "w-full"
|
|
5567
|
-
}
|
|
5568
|
-
));
|
|
5569
|
-
case "audio":
|
|
5570
|
-
return /* @__PURE__ */ import_react65.default.createElement("div", { className: cx("relative group", fullWidthClass) }, expandButton, /* @__PURE__ */ import_react65.default.createElement(
|
|
5571
|
-
AudioCard,
|
|
5572
|
-
{
|
|
5573
|
-
src: artifact.src || "",
|
|
5574
|
-
title: artifact.title,
|
|
5575
|
-
subtitle: artifact.subtitle,
|
|
5576
|
-
controls: true,
|
|
5577
|
-
className: "w-full"
|
|
5578
|
-
}
|
|
5579
|
-
));
|
|
5580
|
-
case "html":
|
|
5581
|
-
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5582
|
-
"div",
|
|
5583
|
-
{
|
|
5584
|
-
className: cx("relative group cursor-pointer", fullWidthClass),
|
|
5585
|
-
onClick: onExpand
|
|
5586
|
-
},
|
|
5587
|
-
expandButton,
|
|
5588
|
-
/* @__PURE__ */ import_react65.default.createElement(
|
|
5589
|
-
ScriptCard,
|
|
5590
|
-
{
|
|
5591
|
-
title: artifact.title,
|
|
5592
|
-
subtitle: artifact.subtitle,
|
|
5593
|
-
elements: artifact.scriptElements || [],
|
|
5594
|
-
maxHeight: "16rem",
|
|
5595
|
-
className: "w-full"
|
|
5596
|
-
}
|
|
5597
|
-
)
|
|
5598
|
-
);
|
|
5599
|
-
case "text":
|
|
5600
|
-
return /* @__PURE__ */ import_react65.default.createElement(
|
|
5601
|
-
"div",
|
|
5602
|
-
{
|
|
5603
|
-
className: cx(
|
|
5604
|
-
"relative group cursor-pointer p-4 bg-charcoal border border-ash/40",
|
|
5605
|
-
fullWidthClass
|
|
5606
|
-
),
|
|
5607
|
-
onClick: onExpand
|
|
5608
|
-
},
|
|
5609
|
-
expandButton,
|
|
5610
|
-
artifact.title && /* @__PURE__ */ import_react65.default.createElement("h4", { className: "text-sm font-semibold text-white mb-2" }, artifact.title),
|
|
5611
|
-
/* @__PURE__ */ import_react65.default.createElement(
|
|
5612
|
-
MarkdownContent,
|
|
5613
|
-
{
|
|
5614
|
-
content: artifact.content || "",
|
|
5615
|
-
className: "prose-sm prose-invert max-h-48 overflow-y-auto"
|
|
5616
|
-
}
|
|
5617
|
-
)
|
|
5618
|
-
);
|
|
5619
|
-
default:
|
|
5620
|
-
return null;
|
|
5621
|
-
}
|
|
5622
5765
|
}
|
|
5623
|
-
var ArtifactsPanel =
|
|
5766
|
+
var ArtifactsPanel = import_react68.default.forwardRef(
|
|
5624
5767
|
({
|
|
5625
5768
|
artifacts,
|
|
5626
5769
|
isOpen = false,
|
|
@@ -5632,10 +5775,10 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5632
5775
|
className,
|
|
5633
5776
|
...rest
|
|
5634
5777
|
}, ref) => {
|
|
5635
|
-
const [expandedArtifact, setExpandedArtifact] = (0,
|
|
5778
|
+
const [expandedArtifact, setExpandedArtifact] = (0, import_react68.useState)(null);
|
|
5636
5779
|
const columns = widthPercent && widthPercent > 55 ? 3 : widthPercent && widthPercent > 35 ? 2 : 1;
|
|
5637
5780
|
if (!isOpen) {
|
|
5638
|
-
return /* @__PURE__ */
|
|
5781
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5639
5782
|
"div",
|
|
5640
5783
|
{
|
|
5641
5784
|
ref,
|
|
@@ -5646,7 +5789,7 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5646
5789
|
),
|
|
5647
5790
|
...rest
|
|
5648
5791
|
},
|
|
5649
|
-
/* @__PURE__ */
|
|
5792
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5650
5793
|
"button",
|
|
5651
5794
|
{
|
|
5652
5795
|
onClick: onClose,
|
|
@@ -5658,8 +5801,8 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5658
5801
|
),
|
|
5659
5802
|
"aria-label": "Expand artifacts panel"
|
|
5660
5803
|
},
|
|
5661
|
-
/* @__PURE__ */
|
|
5662
|
-
artifacts.length > 0 && /* @__PURE__ */
|
|
5804
|
+
/* @__PURE__ */ import_react68.default.createElement(LayersIcon, { className: "w-5 h-5" }),
|
|
5805
|
+
artifacts.length > 0 && /* @__PURE__ */ import_react68.default.createElement(
|
|
5663
5806
|
"span",
|
|
5664
5807
|
{
|
|
5665
5808
|
className: "absolute -top-1 -right-1 w-4 h-4 bg-gold text-obsidian text-xs font-medium flex items-center justify-center rounded-full"
|
|
@@ -5669,7 +5812,7 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5669
5812
|
)
|
|
5670
5813
|
);
|
|
5671
5814
|
}
|
|
5672
|
-
return /* @__PURE__ */
|
|
5815
|
+
return /* @__PURE__ */ import_react68.default.createElement(import_react68.default.Fragment, null, /* @__PURE__ */ import_react68.default.createElement(
|
|
5673
5816
|
"div",
|
|
5674
5817
|
{
|
|
5675
5818
|
ref,
|
|
@@ -5683,7 +5826,7 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5683
5826
|
style: width ? { width } : void 0,
|
|
5684
5827
|
...rest
|
|
5685
5828
|
},
|
|
5686
|
-
/* @__PURE__ */
|
|
5829
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5687
5830
|
"div",
|
|
5688
5831
|
{
|
|
5689
5832
|
onMouseDown: onResizeStart,
|
|
@@ -5696,13 +5839,13 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5696
5839
|
)
|
|
5697
5840
|
}
|
|
5698
5841
|
),
|
|
5699
|
-
/* @__PURE__ */
|
|
5842
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5700
5843
|
"div",
|
|
5701
5844
|
{
|
|
5702
5845
|
className: "flex items-center justify-between p-4 border-b border-ash/40 shrink-0"
|
|
5703
5846
|
},
|
|
5704
|
-
/* @__PURE__ */
|
|
5705
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ import_react68.default.createElement("h3", { className: "text-sm font-semibold text-white" }, "Artifacts"),
|
|
5848
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5706
5849
|
"button",
|
|
5707
5850
|
{
|
|
5708
5851
|
onClick: onClose,
|
|
@@ -5713,10 +5856,10 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5713
5856
|
),
|
|
5714
5857
|
"aria-label": "Collapse artifacts panel"
|
|
5715
5858
|
},
|
|
5716
|
-
/* @__PURE__ */
|
|
5859
|
+
/* @__PURE__ */ import_react68.default.createElement(ChevronRightIcon, { className: "w-5 h-5" })
|
|
5717
5860
|
)
|
|
5718
5861
|
),
|
|
5719
|
-
/* @__PURE__ */
|
|
5862
|
+
/* @__PURE__ */ import_react68.default.createElement(
|
|
5720
5863
|
"div",
|
|
5721
5864
|
{
|
|
5722
5865
|
"data-testid": "artifacts-grid",
|
|
@@ -5727,7 +5870,7 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5727
5870
|
columns === 3 && "grid-cols-3"
|
|
5728
5871
|
)
|
|
5729
5872
|
},
|
|
5730
|
-
artifacts.length === 0 && !isLoading ? /* @__PURE__ */
|
|
5873
|
+
artifacts.length === 0 && !isLoading ? /* @__PURE__ */ import_react68.default.createElement("p", { className: "text-xs text-silver/60 text-center py-8" }, "No artifacts to display") : artifacts.map((artifact) => /* @__PURE__ */ import_react68.default.createElement(
|
|
5731
5874
|
ArtifactRenderer,
|
|
5732
5875
|
{
|
|
5733
5876
|
key: artifact.id,
|
|
@@ -5737,7 +5880,7 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5737
5880
|
}
|
|
5738
5881
|
))
|
|
5739
5882
|
)
|
|
5740
|
-
), expandedArtifact && /* @__PURE__ */
|
|
5883
|
+
), expandedArtifact && /* @__PURE__ */ import_react68.default.createElement(
|
|
5741
5884
|
ArtifactModal,
|
|
5742
5885
|
{
|
|
5743
5886
|
artifact: expandedArtifact,
|
|
@@ -5747,8 +5890,8 @@ var ArtifactsPanel = import_react65.default.forwardRef(
|
|
|
5747
5890
|
}
|
|
5748
5891
|
);
|
|
5749
5892
|
ArtifactsPanel.displayName = "ArtifactsPanel";
|
|
5750
|
-
var ArtifactsPanelToggle =
|
|
5751
|
-
return /* @__PURE__ */
|
|
5893
|
+
var ArtifactsPanelToggle = import_react68.default.forwardRef(({ artifactCount = 0, onExpand, className, ...rest }, ref) => {
|
|
5894
|
+
return /* @__PURE__ */ import_react68.default.createElement(
|
|
5752
5895
|
"button",
|
|
5753
5896
|
{
|
|
5754
5897
|
ref,
|
|
@@ -5765,8 +5908,8 @@ var ArtifactsPanelToggle = import_react65.default.forwardRef(({ artifactCount =
|
|
|
5765
5908
|
"aria-label": "Expand artifacts panel",
|
|
5766
5909
|
...rest
|
|
5767
5910
|
},
|
|
5768
|
-
/* @__PURE__ */
|
|
5769
|
-
artifactCount > 0 && /* @__PURE__ */
|
|
5911
|
+
/* @__PURE__ */ import_react68.default.createElement(LayersIcon, { className: "w-5 h-5" }),
|
|
5912
|
+
artifactCount > 0 && /* @__PURE__ */ import_react68.default.createElement(
|
|
5770
5913
|
"span",
|
|
5771
5914
|
{
|
|
5772
5915
|
className: "absolute -top-1 -right-1 w-4 h-4 bg-gold text-obsidian text-xs font-medium flex items-center justify-center rounded-full"
|
|
@@ -5778,20 +5921,20 @@ var ArtifactsPanelToggle = import_react65.default.forwardRef(({ artifactCount =
|
|
|
5778
5921
|
ArtifactsPanelToggle.displayName = "ArtifactsPanelToggle";
|
|
5779
5922
|
|
|
5780
5923
|
// src/components/chat/TodosList.tsx
|
|
5781
|
-
var
|
|
5924
|
+
var import_react69 = __toESM(require("react"));
|
|
5782
5925
|
function TaskIcon({ status }) {
|
|
5783
5926
|
switch (status) {
|
|
5784
5927
|
case "done":
|
|
5785
|
-
return /* @__PURE__ */
|
|
5928
|
+
return /* @__PURE__ */ import_react69.default.createElement(CheckSquareIcon, null);
|
|
5786
5929
|
case "in_progress":
|
|
5787
|
-
return /* @__PURE__ */
|
|
5930
|
+
return /* @__PURE__ */ import_react69.default.createElement(SquareLoaderIcon, null);
|
|
5788
5931
|
case "cancelled":
|
|
5789
|
-
return /* @__PURE__ */
|
|
5932
|
+
return /* @__PURE__ */ import_react69.default.createElement(CrossSquareIcon, { variant: "cancelled" });
|
|
5790
5933
|
case "failed":
|
|
5791
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ import_react69.default.createElement(CrossSquareIcon, { variant: "failed" });
|
|
5792
5935
|
case "pending":
|
|
5793
5936
|
default:
|
|
5794
|
-
return /* @__PURE__ */
|
|
5937
|
+
return /* @__PURE__ */ import_react69.default.createElement(EmptySquareIcon, null);
|
|
5795
5938
|
}
|
|
5796
5939
|
}
|
|
5797
5940
|
function sortTasks(tasks) {
|
|
@@ -5811,7 +5954,7 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5811
5954
|
const isSubtle = task.status === "cancelled" || task.status === "failed";
|
|
5812
5955
|
const showSubtasks = (task.status === "in_progress" || task.status === "done") && task.subtasks && task.subtasks.length > 0;
|
|
5813
5956
|
const sortedSubtasks = showSubtasks ? sortTasks(task.subtasks) : [];
|
|
5814
|
-
return /* @__PURE__ */
|
|
5957
|
+
return /* @__PURE__ */ import_react69.default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ import_react69.default.createElement(
|
|
5815
5958
|
"div",
|
|
5816
5959
|
{
|
|
5817
5960
|
className: cx(
|
|
@@ -5819,8 +5962,8 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5819
5962
|
depth > 0 && "pl-6"
|
|
5820
5963
|
)
|
|
5821
5964
|
},
|
|
5822
|
-
/* @__PURE__ */
|
|
5823
|
-
/* @__PURE__ */
|
|
5965
|
+
/* @__PURE__ */ import_react69.default.createElement(TaskIcon, { status: task.status }),
|
|
5966
|
+
/* @__PURE__ */ import_react69.default.createElement(
|
|
5824
5967
|
"span",
|
|
5825
5968
|
{
|
|
5826
5969
|
className: cx(
|
|
@@ -5832,14 +5975,14 @@ function TaskItem({ task, depth = 0 }) {
|
|
|
5832
5975
|
)
|
|
5833
5976
|
},
|
|
5834
5977
|
task.label,
|
|
5835
|
-
task.status === "cancelled" && /* @__PURE__ */
|
|
5836
|
-
task.status === "failed" && /* @__PURE__ */
|
|
5978
|
+
task.status === "cancelled" && /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-silver/40 ml-1" }, "(cancelled)"),
|
|
5979
|
+
task.status === "failed" && /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-error/60 ml-1" }, "(failed)")
|
|
5837
5980
|
)
|
|
5838
|
-
), showSubtasks && /* @__PURE__ */
|
|
5981
|
+
), showSubtasks && /* @__PURE__ */ import_react69.default.createElement("div", { className: "flex flex-col" }, sortedSubtasks.map((subtask) => /* @__PURE__ */ import_react69.default.createElement(TaskItem, { key: subtask.id, task: subtask, depth: depth + 1 }))));
|
|
5839
5982
|
}
|
|
5840
|
-
var TodosList =
|
|
5983
|
+
var TodosList = import_react69.default.forwardRef(
|
|
5841
5984
|
({ tasks, title = "Tasks", className, ...rest }, ref) => {
|
|
5842
|
-
const sortedTasks = (0,
|
|
5985
|
+
const sortedTasks = (0, import_react69.useMemo)(() => sortTasks(tasks), [tasks]);
|
|
5843
5986
|
const countCompleted = (taskList) => {
|
|
5844
5987
|
let count = 0;
|
|
5845
5988
|
for (const task of taskList) {
|
|
@@ -5858,7 +6001,7 @@ var TodosList = import_react66.default.forwardRef(
|
|
|
5858
6001
|
if (tasks.length === 0) {
|
|
5859
6002
|
return null;
|
|
5860
6003
|
}
|
|
5861
|
-
return /* @__PURE__ */
|
|
6004
|
+
return /* @__PURE__ */ import_react69.default.createElement(
|
|
5862
6005
|
"div",
|
|
5863
6006
|
{
|
|
5864
6007
|
ref,
|
|
@@ -5870,21 +6013,21 @@ var TodosList = import_react66.default.forwardRef(
|
|
|
5870
6013
|
style: { maxHeight: "25vh" },
|
|
5871
6014
|
...rest
|
|
5872
6015
|
},
|
|
5873
|
-
/* @__PURE__ */
|
|
5874
|
-
/* @__PURE__ */
|
|
6016
|
+
/* @__PURE__ */ import_react69.default.createElement("div", { className: "flex items-center justify-between px-4 py-2 border-b border-ash/40 flex-shrink-0" }, /* @__PURE__ */ import_react69.default.createElement("h4", { className: "text-xs font-medium text-white" }, title), /* @__PURE__ */ import_react69.default.createElement("span", { className: "text-xs text-silver/60" }, countCompleted(tasks), "/", countTotal(tasks))),
|
|
6017
|
+
/* @__PURE__ */ import_react69.default.createElement("div", { className: "flex-1 overflow-y-auto px-4 py-2" }, sortedTasks.map((task) => /* @__PURE__ */ import_react69.default.createElement(TaskItem, { key: task.id, task })))
|
|
5875
6018
|
);
|
|
5876
6019
|
}
|
|
5877
6020
|
);
|
|
5878
6021
|
TodosList.displayName = "TodosList";
|
|
5879
6022
|
|
|
5880
6023
|
// src/components/chat/hooks/useArtifacts.ts
|
|
5881
|
-
var
|
|
6024
|
+
var import_react70 = require("react");
|
|
5882
6025
|
function useArtifacts() {
|
|
5883
|
-
const [artifacts, setArtifacts] = (0,
|
|
5884
|
-
const scheduleArtifact = (0,
|
|
6026
|
+
const [artifacts, setArtifacts] = (0, import_react70.useState)([]);
|
|
6027
|
+
const scheduleArtifact = (0, import_react70.useCallback)((artifact) => {
|
|
5885
6028
|
setArtifacts((prev) => [...prev, { ...artifact, isPending: true }]);
|
|
5886
6029
|
}, []);
|
|
5887
|
-
const showArtifact = (0,
|
|
6030
|
+
const showArtifact = (0, import_react70.useCallback)(
|
|
5888
6031
|
(artifactId, updates) => {
|
|
5889
6032
|
setArtifacts((prev) => {
|
|
5890
6033
|
const existingIndex = prev.findIndex((a) => a.id === artifactId);
|
|
@@ -5899,36 +6042,36 @@ function useArtifacts() {
|
|
|
5899
6042
|
},
|
|
5900
6043
|
[]
|
|
5901
6044
|
);
|
|
5902
|
-
const removeArtifact = (0,
|
|
6045
|
+
const removeArtifact = (0, import_react70.useCallback)((artifactId) => {
|
|
5903
6046
|
setArtifacts((prev) => prev.filter((a) => a.id !== artifactId));
|
|
5904
6047
|
}, []);
|
|
5905
|
-
const clearArtifacts = (0,
|
|
6048
|
+
const clearArtifacts = (0, import_react70.useCallback)(() => {
|
|
5906
6049
|
setArtifacts([]);
|
|
5907
6050
|
}, []);
|
|
5908
6051
|
return { artifacts, scheduleArtifact, showArtifact, removeArtifact, clearArtifacts };
|
|
5909
6052
|
}
|
|
5910
6053
|
|
|
5911
6054
|
// src/components/chat/hooks/useResizable.ts
|
|
5912
|
-
var
|
|
6055
|
+
var import_react71 = require("react");
|
|
5913
6056
|
function useResizable({
|
|
5914
6057
|
initialWidthPercent,
|
|
5915
6058
|
minWidthPercent,
|
|
5916
6059
|
maxWidthPercent,
|
|
5917
6060
|
direction
|
|
5918
6061
|
}) {
|
|
5919
|
-
const [widthPercent, setWidthPercent] = (0,
|
|
5920
|
-
const [isResizing, setIsResizing] = (0,
|
|
5921
|
-
const lastX = (0,
|
|
5922
|
-
const startResizing = (0,
|
|
6062
|
+
const [widthPercent, setWidthPercent] = (0, import_react71.useState)(initialWidthPercent);
|
|
6063
|
+
const [isResizing, setIsResizing] = (0, import_react71.useState)(false);
|
|
6064
|
+
const lastX = (0, import_react71.useRef)(null);
|
|
6065
|
+
const startResizing = (0, import_react71.useCallback)((e) => {
|
|
5923
6066
|
e.preventDefault();
|
|
5924
6067
|
setIsResizing(true);
|
|
5925
6068
|
lastX.current = e.clientX;
|
|
5926
6069
|
}, []);
|
|
5927
|
-
const stopResizing = (0,
|
|
6070
|
+
const stopResizing = (0, import_react71.useCallback)(() => {
|
|
5928
6071
|
setIsResizing(false);
|
|
5929
6072
|
lastX.current = null;
|
|
5930
6073
|
}, []);
|
|
5931
|
-
const resize = (0,
|
|
6074
|
+
const resize = (0, import_react71.useCallback)(
|
|
5932
6075
|
(e) => {
|
|
5933
6076
|
if (!isResizing || lastX.current === null) {
|
|
5934
6077
|
return;
|
|
@@ -5944,7 +6087,7 @@ function useResizable({
|
|
|
5944
6087
|
},
|
|
5945
6088
|
[isResizing, direction, minWidthPercent, maxWidthPercent]
|
|
5946
6089
|
);
|
|
5947
|
-
(0,
|
|
6090
|
+
(0, import_react71.useEffect)(() => {
|
|
5948
6091
|
if (isResizing) {
|
|
5949
6092
|
window.addEventListener("mousemove", resize);
|
|
5950
6093
|
window.addEventListener("mouseup", stopResizing);
|
|
@@ -5968,7 +6111,7 @@ function useResizable({
|
|
|
5968
6111
|
}
|
|
5969
6112
|
|
|
5970
6113
|
// src/components/chat/ChatInterface.tsx
|
|
5971
|
-
var ChatInterface =
|
|
6114
|
+
var ChatInterface = import_react72.default.forwardRef(
|
|
5972
6115
|
({
|
|
5973
6116
|
messages = [],
|
|
5974
6117
|
conversationTree,
|
|
@@ -5998,8 +6141,8 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
5998
6141
|
className,
|
|
5999
6142
|
...rest
|
|
6000
6143
|
}, ref) => {
|
|
6001
|
-
const [sidebarCollapsed, setSidebarCollapsed] = (0,
|
|
6002
|
-
const [internalPanelOpen, setInternalPanelOpen] = (0,
|
|
6144
|
+
const [sidebarCollapsed, setSidebarCollapsed] = (0, import_react72.useState)(initialSidebarCollapsed);
|
|
6145
|
+
const [internalPanelOpen, setInternalPanelOpen] = (0, import_react72.useState)(false);
|
|
6003
6146
|
const {
|
|
6004
6147
|
width: sidebarWidth,
|
|
6005
6148
|
startResizing: startResizingSidebar
|
|
@@ -6022,7 +6165,7 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6022
6165
|
const isPanelControlled = isArtifactsPanelOpen !== void 0;
|
|
6023
6166
|
const artifactsPanelOpen = isPanelControlled ? isArtifactsPanelOpen : internalPanelOpen;
|
|
6024
6167
|
const isTreeMode = !!conversationTree;
|
|
6025
|
-
const effectiveMessages = (0,
|
|
6168
|
+
const effectiveMessages = (0, import_react72.useMemo)(() => {
|
|
6026
6169
|
if (isTreeMode && conversationTree) {
|
|
6027
6170
|
const pathNodes = getActivePathMessages(conversationTree);
|
|
6028
6171
|
return pathNodes.map((node) => ({
|
|
@@ -6034,7 +6177,7 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6034
6177
|
}
|
|
6035
6178
|
return messages;
|
|
6036
6179
|
}, [isTreeMode, conversationTree, messages]);
|
|
6037
|
-
const latestUserMessageIndex = (0,
|
|
6180
|
+
const latestUserMessageIndex = (0, import_react72.useMemo)(() => {
|
|
6038
6181
|
for (let i = effectiveMessages.length - 1; i >= 0; i--) {
|
|
6039
6182
|
if (effectiveMessages[i].variant === "user") {
|
|
6040
6183
|
return i;
|
|
@@ -6042,15 +6185,15 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6042
6185
|
}
|
|
6043
6186
|
return -1;
|
|
6044
6187
|
}, [effectiveMessages]);
|
|
6045
|
-
const hasPendingArtifact = (0,
|
|
6188
|
+
const hasPendingArtifact = (0, import_react72.useMemo)(() => {
|
|
6046
6189
|
return artifacts.some((a) => a.isPending);
|
|
6047
6190
|
}, [artifacts]);
|
|
6048
|
-
|
|
6191
|
+
import_react72.default.useEffect(() => {
|
|
6049
6192
|
if (!isPanelControlled && artifacts.length > 0) {
|
|
6050
6193
|
setInternalPanelOpen(true);
|
|
6051
6194
|
}
|
|
6052
6195
|
}, [artifacts.length, isPanelControlled]);
|
|
6053
|
-
const handleBranchSwitch = (0,
|
|
6196
|
+
const handleBranchSwitch = (0, import_react72.useCallback)(
|
|
6054
6197
|
(nodeId, direction) => {
|
|
6055
6198
|
if (!isTreeMode || !conversationTree || !onTreeChange) {
|
|
6056
6199
|
return;
|
|
@@ -6060,7 +6203,7 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6060
6203
|
},
|
|
6061
6204
|
[isTreeMode, conversationTree, onTreeChange]
|
|
6062
6205
|
);
|
|
6063
|
-
const displayMessages = (0,
|
|
6206
|
+
const displayMessages = (0, import_react72.useMemo)(() => {
|
|
6064
6207
|
return effectiveMessages.map((msg) => {
|
|
6065
6208
|
let branchInfo = void 0;
|
|
6066
6209
|
if (isTreeMode && conversationTree) {
|
|
@@ -6094,16 +6237,16 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6094
6237
|
onRetryMessage,
|
|
6095
6238
|
handleBranchSwitch
|
|
6096
6239
|
]);
|
|
6097
|
-
const handleSubmit = (0,
|
|
6240
|
+
const handleSubmit = (0, import_react72.useCallback)(
|
|
6098
6241
|
(message, attachments) => {
|
|
6099
6242
|
onMessageSubmit?.(message, attachments);
|
|
6100
6243
|
},
|
|
6101
6244
|
[onMessageSubmit]
|
|
6102
6245
|
);
|
|
6103
|
-
const toggleSidebar = (0,
|
|
6246
|
+
const toggleSidebar = (0, import_react72.useCallback)(() => {
|
|
6104
6247
|
setSidebarCollapsed((prev) => !prev);
|
|
6105
6248
|
}, []);
|
|
6106
|
-
const toggleArtifactsPanel = (0,
|
|
6249
|
+
const toggleArtifactsPanel = (0, import_react72.useCallback)(() => {
|
|
6107
6250
|
if (isPanelControlled) {
|
|
6108
6251
|
onArtifactsPanelOpenChange?.(!artifactsPanelOpen);
|
|
6109
6252
|
} else {
|
|
@@ -6111,14 +6254,14 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6111
6254
|
}
|
|
6112
6255
|
}, [isPanelControlled, artifactsPanelOpen, onArtifactsPanelOpenChange]);
|
|
6113
6256
|
const isEmpty = effectiveMessages.length === 0;
|
|
6114
|
-
return /* @__PURE__ */
|
|
6257
|
+
return /* @__PURE__ */ import_react72.default.createElement(
|
|
6115
6258
|
"div",
|
|
6116
6259
|
{
|
|
6117
6260
|
ref,
|
|
6118
6261
|
className: cx("flex h-full w-full bg-obsidian overflow-hidden", className),
|
|
6119
6262
|
...rest
|
|
6120
6263
|
},
|
|
6121
|
-
/* @__PURE__ */
|
|
6264
|
+
/* @__PURE__ */ import_react72.default.createElement(
|
|
6122
6265
|
ConversationSidebar,
|
|
6123
6266
|
{
|
|
6124
6267
|
conversations,
|
|
@@ -6130,16 +6273,16 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6130
6273
|
onResizeStart: startResizingSidebar
|
|
6131
6274
|
}
|
|
6132
6275
|
),
|
|
6133
|
-
/* @__PURE__ */
|
|
6276
|
+
/* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 flex flex-col min-w-0 relative" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6134
6277
|
"flex-1 flex flex-col min-h-0 relative",
|
|
6135
6278
|
isEmpty ? "justify-center" : "justify-start"
|
|
6136
|
-
) }, /* @__PURE__ */
|
|
6279
|
+
) }, /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6137
6280
|
"transition-all duration-500 ease-in-out",
|
|
6138
6281
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6139
|
-
) }), /* @__PURE__ */
|
|
6282
|
+
) }), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6140
6283
|
"transition-all duration-500 ease-in-out overflow-hidden flex flex-col",
|
|
6141
6284
|
isEmpty ? "flex-zero opacity-0" : "flex-1 opacity-100"
|
|
6142
|
-
) }, /* @__PURE__ */
|
|
6285
|
+
) }, /* @__PURE__ */ import_react72.default.createElement(
|
|
6143
6286
|
ChatView,
|
|
6144
6287
|
{
|
|
6145
6288
|
messages: displayMessages,
|
|
@@ -6148,10 +6291,10 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6148
6291
|
isThinking,
|
|
6149
6292
|
className: "flex-1"
|
|
6150
6293
|
}
|
|
6151
|
-
)), /* @__PURE__ */
|
|
6294
|
+
)), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6152
6295
|
"transition-all duration-500 ease-in-out z-10 w-full flex flex-col items-center",
|
|
6153
6296
|
isEmpty ? "p-4" : "shrink-0 p-4 border-t border-ash/40 bg-obsidian"
|
|
6154
|
-
) }, isEmpty && /* @__PURE__ */
|
|
6297
|
+
) }, isEmpty && /* @__PURE__ */ import_react72.default.createElement("div", { className: "mb-8 text-center animate-fade-in duration-500" }, emptyState ? emptyState : /* @__PURE__ */ import_react72.default.createElement("h1", { className: "text-4xl md:text-5xl font-heading text-gold mb-2 tracking-tight" }, "Welcome!")), /* @__PURE__ */ import_react72.default.createElement(
|
|
6155
6298
|
ChatInput,
|
|
6156
6299
|
{
|
|
6157
6300
|
position: isEmpty ? "centered" : "bottom",
|
|
@@ -6165,11 +6308,11 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6165
6308
|
attachments: propsAttachments,
|
|
6166
6309
|
onAttachmentsChange
|
|
6167
6310
|
}
|
|
6168
|
-
)), /* @__PURE__ */
|
|
6311
|
+
)), /* @__PURE__ */ import_react72.default.createElement("div", { className: cx(
|
|
6169
6312
|
"transition-all duration-500 ease-in-out",
|
|
6170
6313
|
isEmpty ? "flex-1" : "flex-zero"
|
|
6171
6314
|
) }))),
|
|
6172
|
-
/* @__PURE__ */
|
|
6315
|
+
/* @__PURE__ */ import_react72.default.createElement("div", { className: "h-full flex flex-col shrink-0" }, /* @__PURE__ */ import_react72.default.createElement("div", { className: "flex-1 min-h-0" }, /* @__PURE__ */ import_react72.default.createElement(
|
|
6173
6316
|
ArtifactsPanel,
|
|
6174
6317
|
{
|
|
6175
6318
|
artifacts,
|
|
@@ -6181,7 +6324,7 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6181
6324
|
onResizeStart: startResizingArtifacts,
|
|
6182
6325
|
className: "h-full"
|
|
6183
6326
|
}
|
|
6184
|
-
)), tasks.length > 0 && artifactsPanelOpen && /* @__PURE__ */
|
|
6327
|
+
)), tasks.length > 0 && artifactsPanelOpen && /* @__PURE__ */ import_react72.default.createElement(
|
|
6185
6328
|
TodosList,
|
|
6186
6329
|
{
|
|
6187
6330
|
tasks,
|
|
@@ -6195,9 +6338,9 @@ var ChatInterface = import_react69.default.forwardRef(
|
|
|
6195
6338
|
ChatInterface.displayName = "ChatInterface";
|
|
6196
6339
|
|
|
6197
6340
|
// src/components/chat/MessageActions.tsx
|
|
6198
|
-
var
|
|
6199
|
-
var
|
|
6200
|
-
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */
|
|
6341
|
+
var import_react73 = __toESM(require("react"));
|
|
6342
|
+
var import_lucide_react14 = require("lucide-react");
|
|
6343
|
+
var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @__PURE__ */ import_react73.default.createElement(
|
|
6201
6344
|
"button",
|
|
6202
6345
|
{
|
|
6203
6346
|
type: "button",
|
|
@@ -6213,7 +6356,7 @@ var ActionButton2 = ({ onClick, label, children, className, disabled }) => /* @_
|
|
|
6213
6356
|
},
|
|
6214
6357
|
children
|
|
6215
6358
|
);
|
|
6216
|
-
var MessageActions =
|
|
6359
|
+
var MessageActions = import_react73.default.forwardRef(
|
|
6217
6360
|
({
|
|
6218
6361
|
variant,
|
|
6219
6362
|
content,
|
|
@@ -6225,12 +6368,12 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6225
6368
|
className,
|
|
6226
6369
|
...rest
|
|
6227
6370
|
}, ref) => {
|
|
6228
|
-
const [localIsEditing, setLocalIsEditing] = (0,
|
|
6229
|
-
const [localEditValue, setLocalEditValue] = (0,
|
|
6230
|
-
const [copied, setCopied] = (0,
|
|
6371
|
+
const [localIsEditing, setLocalIsEditing] = (0, import_react73.useState)(false);
|
|
6372
|
+
const [localEditValue, setLocalEditValue] = (0, import_react73.useState)(content);
|
|
6373
|
+
const [copied, setCopied] = (0, import_react73.useState)(false);
|
|
6231
6374
|
const isEditing = controlledIsEditing ?? localIsEditing;
|
|
6232
6375
|
const editValue = controlledEditValue ?? localEditValue;
|
|
6233
|
-
const setIsEditing = (0,
|
|
6376
|
+
const setIsEditing = (0, import_react73.useCallback)(
|
|
6234
6377
|
(value) => {
|
|
6235
6378
|
if (onEditingChange) {
|
|
6236
6379
|
onEditingChange(value);
|
|
@@ -6240,10 +6383,10 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6240
6383
|
},
|
|
6241
6384
|
[onEditingChange]
|
|
6242
6385
|
);
|
|
6243
|
-
const setEditValue = (0,
|
|
6386
|
+
const setEditValue = (0, import_react73.useCallback)((value) => {
|
|
6244
6387
|
setLocalEditValue(value);
|
|
6245
6388
|
}, []);
|
|
6246
|
-
const handleCopy = (0,
|
|
6389
|
+
const handleCopy = (0, import_react73.useCallback)(async () => {
|
|
6247
6390
|
try {
|
|
6248
6391
|
await navigator.clipboard.writeText(content);
|
|
6249
6392
|
setCopied(true);
|
|
@@ -6259,22 +6402,22 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6259
6402
|
setTimeout(() => setCopied(false), 2e3);
|
|
6260
6403
|
}
|
|
6261
6404
|
}, [content]);
|
|
6262
|
-
const handleStartEdit = (0,
|
|
6405
|
+
const handleStartEdit = (0, import_react73.useCallback)(() => {
|
|
6263
6406
|
setLocalEditValue(content);
|
|
6264
6407
|
setIsEditing(true);
|
|
6265
6408
|
}, [content, setIsEditing]);
|
|
6266
|
-
const handleCancelEdit = (0,
|
|
6409
|
+
const handleCancelEdit = (0, import_react73.useCallback)(() => {
|
|
6267
6410
|
setIsEditing(false);
|
|
6268
6411
|
setLocalEditValue(content);
|
|
6269
6412
|
}, [content, setIsEditing]);
|
|
6270
|
-
const handleSubmitEdit = (0,
|
|
6413
|
+
const handleSubmitEdit = (0, import_react73.useCallback)(() => {
|
|
6271
6414
|
const trimmed = editValue.trim();
|
|
6272
6415
|
if (trimmed && trimmed !== content) {
|
|
6273
6416
|
onEdit?.(trimmed);
|
|
6274
6417
|
}
|
|
6275
6418
|
setIsEditing(false);
|
|
6276
6419
|
}, [editValue, content, onEdit, setIsEditing]);
|
|
6277
|
-
const handleEditKeyDown = (0,
|
|
6420
|
+
const handleEditKeyDown = (0, import_react73.useCallback)(
|
|
6278
6421
|
(e) => {
|
|
6279
6422
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
6280
6423
|
e.preventDefault();
|
|
@@ -6287,19 +6430,19 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6287
6430
|
);
|
|
6288
6431
|
const isUser = variant === "user";
|
|
6289
6432
|
if (isUser && isEditing) {
|
|
6290
|
-
return /* @__PURE__ */
|
|
6433
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6291
6434
|
"div",
|
|
6292
6435
|
{
|
|
6293
6436
|
ref,
|
|
6294
6437
|
className: cx("mt-2", className),
|
|
6295
6438
|
...rest
|
|
6296
6439
|
},
|
|
6297
|
-
/* @__PURE__ */
|
|
6440
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6298
6441
|
"div",
|
|
6299
6442
|
{
|
|
6300
6443
|
className: "relative bg-charcoal border border-ash/60 focus-within:border-gold/60 focus-within:ring-1 focus-within:ring-gold/20"
|
|
6301
6444
|
},
|
|
6302
|
-
/* @__PURE__ */
|
|
6445
|
+
/* @__PURE__ */ import_react73.default.createElement(
|
|
6303
6446
|
"textarea",
|
|
6304
6447
|
{
|
|
6305
6448
|
value: editValue,
|
|
@@ -6310,15 +6453,15 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6310
6453
|
rows: 2
|
|
6311
6454
|
}
|
|
6312
6455
|
),
|
|
6313
|
-
/* @__PURE__ */
|
|
6456
|
+
/* @__PURE__ */ import_react73.default.createElement("div", { className: "absolute right-2 bottom-2 flex gap-1" }, /* @__PURE__ */ import_react73.default.createElement(
|
|
6314
6457
|
ActionButton2,
|
|
6315
6458
|
{
|
|
6316
6459
|
onClick: handleCancelEdit,
|
|
6317
6460
|
label: "Cancel edit",
|
|
6318
6461
|
className: "text-silver/60 hover:text-error"
|
|
6319
6462
|
},
|
|
6320
|
-
/* @__PURE__ */
|
|
6321
|
-
), /* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.X, { className: "w-4 h-4" })
|
|
6464
|
+
), /* @__PURE__ */ import_react73.default.createElement(
|
|
6322
6465
|
ActionButton2,
|
|
6323
6466
|
{
|
|
6324
6467
|
onClick: handleSubmitEdit,
|
|
@@ -6326,13 +6469,13 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6326
6469
|
className: "text-silver/60 hover:text-gold",
|
|
6327
6470
|
disabled: !editValue.trim() || editValue.trim() === content
|
|
6328
6471
|
},
|
|
6329
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Send, { className: "w-4 h-4" })
|
|
6330
6473
|
))
|
|
6331
6474
|
),
|
|
6332
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ import_react73.default.createElement("p", { className: "text-xs text-silver/50 mt-1" }, "Press Enter to submit, Esc to cancel. This will create a new branch.")
|
|
6333
6476
|
);
|
|
6334
6477
|
}
|
|
6335
|
-
return /* @__PURE__ */
|
|
6478
|
+
return /* @__PURE__ */ import_react73.default.createElement(
|
|
6336
6479
|
"div",
|
|
6337
6480
|
{
|
|
6338
6481
|
ref,
|
|
@@ -6343,18 +6486,18 @@ var MessageActions = import_react70.default.forwardRef(
|
|
|
6343
6486
|
),
|
|
6344
6487
|
...rest
|
|
6345
6488
|
},
|
|
6346
|
-
/* @__PURE__ */
|
|
6347
|
-
isUser && onEdit && /* @__PURE__ */
|
|
6348
|
-
!isUser && onRetry && /* @__PURE__ */
|
|
6489
|
+
/* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: handleCopy, label: copied ? "Copied!" : "Copy message" }, copied ? /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Check, { className: "w-3.5 h-3.5 text-success" }) : /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Copy, { className: "w-3.5 h-3.5" })),
|
|
6490
|
+
isUser && onEdit && /* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.Pencil, { className: "w-3.5 h-3.5" })),
|
|
6491
|
+
!isUser && onRetry && /* @__PURE__ */ import_react73.default.createElement(ActionButton2, { onClick: onRetry, label: "Regenerate response" }, /* @__PURE__ */ import_react73.default.createElement(import_lucide_react14.RotateCcw, { className: "w-3.5 h-3.5" }))
|
|
6349
6492
|
);
|
|
6350
6493
|
}
|
|
6351
6494
|
);
|
|
6352
6495
|
MessageActions.displayName = "MessageActions";
|
|
6353
6496
|
|
|
6354
6497
|
// src/components/chat/BranchNavigator.tsx
|
|
6355
|
-
var
|
|
6356
|
-
var
|
|
6357
|
-
var BranchNavigator =
|
|
6498
|
+
var import_react74 = __toESM(require("react"));
|
|
6499
|
+
var import_lucide_react15 = require("lucide-react");
|
|
6500
|
+
var BranchNavigator = import_react74.default.forwardRef(
|
|
6358
6501
|
({
|
|
6359
6502
|
current,
|
|
6360
6503
|
total,
|
|
@@ -6373,7 +6516,7 @@ var BranchNavigator = import_react71.default.forwardRef(
|
|
|
6373
6516
|
const buttonSize = size === "sm" ? "p-0.5" : "p-1";
|
|
6374
6517
|
const iconSize = size === "sm" ? "w-3 h-3" : "w-4 h-4";
|
|
6375
6518
|
const textSize = size === "sm" ? "text-xs" : "text-sm";
|
|
6376
|
-
return /* @__PURE__ */
|
|
6519
|
+
return /* @__PURE__ */ import_react74.default.createElement(
|
|
6377
6520
|
"div",
|
|
6378
6521
|
{
|
|
6379
6522
|
ref,
|
|
@@ -6385,8 +6528,8 @@ var BranchNavigator = import_react71.default.forwardRef(
|
|
|
6385
6528
|
"aria-label": "Branch navigation",
|
|
6386
6529
|
...rest
|
|
6387
6530
|
},
|
|
6388
|
-
showIcon && /* @__PURE__ */
|
|
6389
|
-
/* @__PURE__ */
|
|
6531
|
+
showIcon && /* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.GitBranch, { className: cx(iconSize, "mr-0.5 text-silver/50"), "aria-hidden": "true" }),
|
|
6532
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6390
6533
|
"button",
|
|
6391
6534
|
{
|
|
6392
6535
|
type: "button",
|
|
@@ -6399,10 +6542,10 @@ var BranchNavigator = import_react71.default.forwardRef(
|
|
|
6399
6542
|
),
|
|
6400
6543
|
"aria-label": "Previous branch"
|
|
6401
6544
|
},
|
|
6402
|
-
/* @__PURE__ */
|
|
6545
|
+
/* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.ChevronLeft, { className: iconSize })
|
|
6403
6546
|
),
|
|
6404
|
-
/* @__PURE__ */
|
|
6405
|
-
/* @__PURE__ */
|
|
6547
|
+
/* @__PURE__ */ import_react74.default.createElement("span", { className: cx(textSize, "tabular-nums min-w-6 text-center") }, current, "/", total),
|
|
6548
|
+
/* @__PURE__ */ import_react74.default.createElement(
|
|
6406
6549
|
"button",
|
|
6407
6550
|
{
|
|
6408
6551
|
type: "button",
|
|
@@ -6415,7 +6558,7 @@ var BranchNavigator = import_react71.default.forwardRef(
|
|
|
6415
6558
|
),
|
|
6416
6559
|
"aria-label": "Next branch"
|
|
6417
6560
|
},
|
|
6418
|
-
/* @__PURE__ */
|
|
6561
|
+
/* @__PURE__ */ import_react74.default.createElement(import_lucide_react15.ChevronRight, { className: iconSize })
|
|
6419
6562
|
)
|
|
6420
6563
|
);
|
|
6421
6564
|
}
|
|
@@ -6423,16 +6566,16 @@ var BranchNavigator = import_react71.default.forwardRef(
|
|
|
6423
6566
|
BranchNavigator.displayName = "BranchNavigator";
|
|
6424
6567
|
|
|
6425
6568
|
// src/components/BrandIcon.tsx
|
|
6426
|
-
var
|
|
6569
|
+
var import_react75 = __toESM(require("react"));
|
|
6427
6570
|
var sizeMap2 = {
|
|
6428
6571
|
sm: "h-8 w-8 text-sm",
|
|
6429
6572
|
md: "h-12 w-12 text-base",
|
|
6430
6573
|
lg: "h-16 w-16 text-lg"
|
|
6431
6574
|
};
|
|
6432
|
-
var BrandIcon =
|
|
6575
|
+
var BrandIcon = import_react75.default.forwardRef(
|
|
6433
6576
|
({ size = "md", variant = "solid", children, className, ...rest }, ref) => {
|
|
6434
6577
|
const variantClasses = variant === "solid" ? "bg-gold text-obsidian border-2 border-gold" : "bg-transparent text-gold border-2 border-gold";
|
|
6435
|
-
return /* @__PURE__ */
|
|
6578
|
+
return /* @__PURE__ */ import_react75.default.createElement(
|
|
6436
6579
|
"div",
|
|
6437
6580
|
{
|
|
6438
6581
|
ref,
|
|
@@ -6451,17 +6594,17 @@ var BrandIcon = import_react72.default.forwardRef(
|
|
|
6451
6594
|
BrandIcon.displayName = "BrandIcon";
|
|
6452
6595
|
|
|
6453
6596
|
// src/components/ColorSwatch.tsx
|
|
6454
|
-
var
|
|
6455
|
-
var ColorSwatch =
|
|
6597
|
+
var import_react76 = __toESM(require("react"));
|
|
6598
|
+
var ColorSwatch = import_react76.default.forwardRef(
|
|
6456
6599
|
({ color, label, className, ...rest }, ref) => {
|
|
6457
|
-
return /* @__PURE__ */
|
|
6600
|
+
return /* @__PURE__ */ import_react76.default.createElement(
|
|
6458
6601
|
"div",
|
|
6459
6602
|
{
|
|
6460
6603
|
ref,
|
|
6461
6604
|
className: cx("flex flex-col items-center gap-2", className),
|
|
6462
6605
|
...rest
|
|
6463
6606
|
},
|
|
6464
|
-
/* @__PURE__ */
|
|
6607
|
+
/* @__PURE__ */ import_react76.default.createElement(
|
|
6465
6608
|
"div",
|
|
6466
6609
|
{
|
|
6467
6610
|
className: "h-16 w-16 border-2 border-ash rounded-none shadow-sm",
|
|
@@ -6469,22 +6612,22 @@ var ColorSwatch = import_react73.default.forwardRef(
|
|
|
6469
6612
|
"aria-label": label || color
|
|
6470
6613
|
}
|
|
6471
6614
|
),
|
|
6472
|
-
label && /* @__PURE__ */
|
|
6615
|
+
label && /* @__PURE__ */ import_react76.default.createElement("span", { className: "text-xs text-silver font-medium" }, label)
|
|
6473
6616
|
);
|
|
6474
6617
|
}
|
|
6475
6618
|
);
|
|
6476
6619
|
ColorSwatch.displayName = "ColorSwatch";
|
|
6477
6620
|
|
|
6478
6621
|
// src/components/SectionHeading.tsx
|
|
6479
|
-
var
|
|
6622
|
+
var import_react77 = __toESM(require("react"));
|
|
6480
6623
|
var levelStyles = {
|
|
6481
6624
|
h2: "text-2xl mb-4",
|
|
6482
6625
|
h3: "text-xl mb-3"
|
|
6483
6626
|
};
|
|
6484
|
-
var SectionHeading =
|
|
6627
|
+
var SectionHeading = import_react77.default.forwardRef(
|
|
6485
6628
|
({ level = "h2", children, className, ...rest }, ref) => {
|
|
6486
6629
|
const Component = level;
|
|
6487
|
-
return /* @__PURE__ */
|
|
6630
|
+
return /* @__PURE__ */ import_react77.default.createElement(
|
|
6488
6631
|
Component,
|
|
6489
6632
|
{
|
|
6490
6633
|
ref,
|
|
@@ -6511,6 +6654,7 @@ var version = "2.0.0";
|
|
|
6511
6654
|
AccordionTrigger,
|
|
6512
6655
|
Alert,
|
|
6513
6656
|
AlertDialog,
|
|
6657
|
+
ArtifactCard,
|
|
6514
6658
|
ArtifactsPanel,
|
|
6515
6659
|
ArtifactsPanelToggle,
|
|
6516
6660
|
AttachmentPreview,
|
|
@@ -6577,6 +6721,7 @@ var version = "2.0.0";
|
|
|
6577
6721
|
NavbarItem,
|
|
6578
6722
|
NavbarLink,
|
|
6579
6723
|
Pagination,
|
|
6724
|
+
PdfCard,
|
|
6580
6725
|
PlusIcon,
|
|
6581
6726
|
Popover,
|
|
6582
6727
|
Progress,
|
|
@@ -6606,6 +6751,7 @@ var version = "2.0.0";
|
|
|
6606
6751
|
TableHeader,
|
|
6607
6752
|
TableRow,
|
|
6608
6753
|
Tabs,
|
|
6754
|
+
TextCard,
|
|
6609
6755
|
Textarea,
|
|
6610
6756
|
ThinkingIndicator,
|
|
6611
6757
|
ToastProvider,
|