@melony/react 0.1.52 → 0.1.54
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/README.md +1 -1
- package/dist/index.cjs +428 -396
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -11
- package/dist/index.d.ts +8 -11
- package/dist/index.js +429 -397
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { clsx } from 'clsx';
|
|
|
8
8
|
import { twMerge } from 'tailwind-merge';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import * as ICONS from '@tabler/icons-react';
|
|
11
|
-
import { IconX, IconChevronLeft, IconChevronRight, IconLoader2, IconCheck, IconUpload, IconUser, IconLogout, IconBrandGoogle, IconFileText, IconFile, IconPaperclip, IconChevronDown, IconArrowUp,
|
|
11
|
+
import { IconX, IconChevronLeft, IconChevronRight, IconLoader2, IconCheck, IconUpload, IconDotsVertical, IconUser, IconLogout, IconBrandGoogle, IconFileText, IconFile, IconPaperclip, IconChevronDown, IconArrowUp, IconHistory, IconPlus, IconArrowLeft, IconMessage, IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconLayoutSidebarRightExpand, IconLayoutSidebarRightCollapse, IconDeviceDesktop, IconMoon, IconSun, IconSelector, IconChevronUp } from '@tabler/icons-react';
|
|
12
12
|
export * from '@tabler/icons-react';
|
|
13
13
|
import { Separator as Separator$1 } from '@base-ui/react/separator';
|
|
14
14
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
@@ -51,10 +51,7 @@ function DialogOverlay({
|
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
|
-
function DialogContent({
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}) {
|
|
54
|
+
function DialogContent({ className, ...props }) {
|
|
58
55
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
59
56
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
60
57
|
/* @__PURE__ */ jsx(
|
|
@@ -70,10 +67,7 @@ function DialogContent({
|
|
|
70
67
|
)
|
|
71
68
|
] });
|
|
72
69
|
}
|
|
73
|
-
function DialogClose({
|
|
74
|
-
className,
|
|
75
|
-
...props
|
|
76
|
-
}) {
|
|
70
|
+
function DialogClose({ className, ...props }) {
|
|
77
71
|
return /* @__PURE__ */ jsx(
|
|
78
72
|
Dialog$1.Close,
|
|
79
73
|
{
|
|
@@ -86,10 +80,7 @@ function DialogClose({
|
|
|
86
80
|
}
|
|
87
81
|
);
|
|
88
82
|
}
|
|
89
|
-
function DialogHeader({
|
|
90
|
-
className,
|
|
91
|
-
...props
|
|
92
|
-
}) {
|
|
83
|
+
function DialogHeader({ className, ...props }) {
|
|
93
84
|
return /* @__PURE__ */ jsx(
|
|
94
85
|
"div",
|
|
95
86
|
{
|
|
@@ -141,7 +132,10 @@ function Card({
|
|
|
141
132
|
{
|
|
142
133
|
"data-slot": "card",
|
|
143
134
|
"data-size": size,
|
|
144
|
-
className: cn(
|
|
135
|
+
className: cn(
|
|
136
|
+
"ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-2xl py-6 text-sm ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",
|
|
137
|
+
className
|
|
138
|
+
),
|
|
145
139
|
...props
|
|
146
140
|
}
|
|
147
141
|
);
|
|
@@ -416,7 +410,8 @@ var Box = ({
|
|
|
416
410
|
radius = "none",
|
|
417
411
|
width = "auto",
|
|
418
412
|
height = "auto",
|
|
419
|
-
shadow = "none"
|
|
413
|
+
shadow = "none",
|
|
414
|
+
group = false
|
|
420
415
|
}) => {
|
|
421
416
|
return /* @__PURE__ */ jsx(
|
|
422
417
|
"div",
|
|
@@ -431,7 +426,8 @@ var Box = ({
|
|
|
431
426
|
radiusMap[radius],
|
|
432
427
|
widthMap[width],
|
|
433
428
|
height === "full" && "h-full",
|
|
434
|
-
shadowMap[shadow]
|
|
429
|
+
shadowMap[shadow],
|
|
430
|
+
group && "group"
|
|
435
431
|
),
|
|
436
432
|
children
|
|
437
433
|
}
|
|
@@ -445,11 +441,15 @@ var Float = ({
|
|
|
445
441
|
showOnHover = false
|
|
446
442
|
}) => {
|
|
447
443
|
const positionClasses = {
|
|
448
|
-
"top-left": "top-
|
|
449
|
-
"top-right": "top-
|
|
450
|
-
"
|
|
451
|
-
"bottom-
|
|
452
|
-
"
|
|
444
|
+
"top-left": "top-1 left-1",
|
|
445
|
+
"top-right": "top-1 right-1",
|
|
446
|
+
"top-center": "top-1 left-1/2 -translate-x-1/2",
|
|
447
|
+
"bottom-left": "bottom-1 left-1",
|
|
448
|
+
"bottom-right": "bottom-1 right-1",
|
|
449
|
+
"bottom-center": "bottom-1 left-1/2 -translate-x-1/2",
|
|
450
|
+
center: "top- 1 / 2 left - 1/2 -tra nslate-x-1/2 -translate-y-1/2",
|
|
451
|
+
"left-center": "top-1/2 left-1 -translate-y-1/2",
|
|
452
|
+
"right-center": "top-1/2 right-1 -translate-y-1/2"
|
|
453
453
|
};
|
|
454
454
|
const marginXClass = position.endsWith("left") ? marginMap[offsetX].replace("m-", "ml-") : marginMap[offsetX].replace("m-", "mr-");
|
|
455
455
|
const marginYClass = position.startsWith("top") ? marginMap[offsetY].replace("m-", "mt-") : marginMap[offsetY].replace("m-", "mb-");
|
|
@@ -508,10 +508,7 @@ var Divider = ({
|
|
|
508
508
|
Separator,
|
|
509
509
|
{
|
|
510
510
|
orientation,
|
|
511
|
-
className: cn(
|
|
512
|
-
marginMap[margin],
|
|
513
|
-
colorBgMap[color]
|
|
514
|
-
)
|
|
511
|
+
className: cn(marginMap[margin], colorBgMap[color])
|
|
515
512
|
}
|
|
516
513
|
);
|
|
517
514
|
};
|
|
@@ -731,6 +728,7 @@ var Video = ({
|
|
|
731
728
|
muted = false,
|
|
732
729
|
aspectRatio = "16/9",
|
|
733
730
|
width = "full",
|
|
731
|
+
height = "auto",
|
|
734
732
|
radius = "lg"
|
|
735
733
|
}) => {
|
|
736
734
|
const aspectRatios = {
|
|
@@ -748,6 +746,7 @@ var Video = ({
|
|
|
748
746
|
widthMap[width],
|
|
749
747
|
radiusMap[radius]
|
|
750
748
|
),
|
|
749
|
+
style: { height },
|
|
751
750
|
children: /* @__PURE__ */ jsx(
|
|
752
751
|
"video",
|
|
753
752
|
{
|
|
@@ -777,13 +776,16 @@ var Icon = ({
|
|
|
777
776
|
lg: 24
|
|
778
777
|
};
|
|
779
778
|
const resolvedSize = typeof size === "number" ? size : sizeMap[size] || 20;
|
|
780
|
-
return /* @__PURE__ */ jsx(
|
|
781
|
-
|
|
779
|
+
return /* @__PURE__ */ jsx(
|
|
780
|
+
"div",
|
|
782
781
|
{
|
|
783
|
-
|
|
784
|
-
|
|
782
|
+
className: cn(
|
|
783
|
+
"inline-flex items-center justify-center",
|
|
784
|
+
colorTextMap[color]
|
|
785
|
+
),
|
|
786
|
+
children: /* @__PURE__ */ jsx(IconComponent, { size: resolvedSize, strokeWidth: 1.5 })
|
|
785
787
|
}
|
|
786
|
-
)
|
|
788
|
+
);
|
|
787
789
|
};
|
|
788
790
|
var badgeVariants = cva(
|
|
789
791
|
"h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",
|
|
@@ -940,41 +942,60 @@ var Chart = ({
|
|
|
940
942
|
const totalBarSpace = chartWidth - padding.left - padding.right;
|
|
941
943
|
const barSpacing = data.length > 1 ? totalBarSpace * 0.1 / data.length : 0;
|
|
942
944
|
const actualBarWidth = (totalBarSpace - barSpacing * (data.length + 1)) / data.length;
|
|
943
|
-
return /* @__PURE__ */ jsxs(
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
945
|
+
return /* @__PURE__ */ jsxs(
|
|
946
|
+
"svg",
|
|
947
|
+
{
|
|
948
|
+
viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`,
|
|
949
|
+
className: "w-full h-auto overflow-visible",
|
|
950
|
+
children: [
|
|
951
|
+
renderGrid(),
|
|
952
|
+
data.map((item, index) => {
|
|
953
|
+
const barHeight = item.value / maxValue * chartHeight;
|
|
954
|
+
const x = padding.left + barSpacing + index * (actualBarWidth + barSpacing);
|
|
955
|
+
const y = padding.top + chartHeight - barHeight;
|
|
956
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
957
|
+
/* @__PURE__ */ jsx(
|
|
958
|
+
"rect",
|
|
959
|
+
{
|
|
960
|
+
x,
|
|
961
|
+
y,
|
|
962
|
+
width: actualBarWidth,
|
|
963
|
+
height: barHeight,
|
|
964
|
+
fill: getColor(index, item.color),
|
|
965
|
+
rx: 4,
|
|
966
|
+
onMouseEnter: () => showTooltips && setTooltip({
|
|
967
|
+
visible: true,
|
|
968
|
+
x: x + actualBarWidth / 2,
|
|
969
|
+
y: y - 5,
|
|
970
|
+
label: item.label,
|
|
971
|
+
value: item.value
|
|
972
|
+
}),
|
|
973
|
+
onMouseLeave: () => setTooltip({
|
|
974
|
+
visible: false,
|
|
975
|
+
x: 0,
|
|
976
|
+
y: 0,
|
|
977
|
+
label: "",
|
|
978
|
+
value: 0
|
|
979
|
+
}),
|
|
980
|
+
className: "transition-all hover:opacity-80 cursor-pointer"
|
|
981
|
+
}
|
|
982
|
+
),
|
|
983
|
+
/* @__PURE__ */ jsx(
|
|
984
|
+
"text",
|
|
985
|
+
{
|
|
986
|
+
x: x + actualBarWidth / 2,
|
|
987
|
+
y: padding.top + chartHeight + 20,
|
|
988
|
+
textAnchor: "middle",
|
|
989
|
+
className: "fill-muted-foreground text-[10px]",
|
|
990
|
+
children: item.label
|
|
991
|
+
}
|
|
992
|
+
)
|
|
993
|
+
] }, index);
|
|
994
|
+
}),
|
|
995
|
+
showTooltips && renderTooltip()
|
|
996
|
+
]
|
|
997
|
+
}
|
|
998
|
+
);
|
|
978
999
|
};
|
|
979
1000
|
const renderLineChart = () => {
|
|
980
1001
|
const points = data.map((item, index) => ({
|
|
@@ -983,37 +1004,59 @@ var Chart = ({
|
|
|
983
1004
|
...item
|
|
984
1005
|
}));
|
|
985
1006
|
const pathData = points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
|
|
986
|
-
return /* @__PURE__ */ jsxs(
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1007
|
+
return /* @__PURE__ */ jsxs(
|
|
1008
|
+
"svg",
|
|
1009
|
+
{
|
|
1010
|
+
viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`,
|
|
1011
|
+
className: "w-full h-auto overflow-visible",
|
|
1012
|
+
children: [
|
|
1013
|
+
renderGrid(),
|
|
1014
|
+
/* @__PURE__ */ jsx(
|
|
1015
|
+
"path",
|
|
1016
|
+
{
|
|
1017
|
+
d: pathData,
|
|
1018
|
+
fill: "none",
|
|
1019
|
+
stroke: getColor(0),
|
|
1020
|
+
strokeWidth: 3,
|
|
1021
|
+
className: "transition-all"
|
|
1022
|
+
}
|
|
1023
|
+
),
|
|
1024
|
+
points.map((point, index) => /* @__PURE__ */ jsxs("g", { children: [
|
|
1025
|
+
/* @__PURE__ */ jsx(
|
|
1026
|
+
"circle",
|
|
1027
|
+
{
|
|
1028
|
+
cx: point.x,
|
|
1029
|
+
cy: point.y,
|
|
1030
|
+
r: 5,
|
|
1031
|
+
fill: getColor(index, point.color),
|
|
1032
|
+
stroke: "hsl(var(--background))",
|
|
1033
|
+
strokeWidth: 2,
|
|
1034
|
+
onMouseEnter: () => showTooltips && setTooltip({
|
|
1035
|
+
visible: true,
|
|
1036
|
+
x: point.x,
|
|
1037
|
+
y: point.y - 5,
|
|
1038
|
+
label: point.label,
|
|
1039
|
+
value: point.value
|
|
1040
|
+
}),
|
|
1041
|
+
onMouseLeave: () => setTooltip({ visible: false, x: 0, y: 0, label: "", value: 0 }),
|
|
1042
|
+
className: "hover:r-6 transition-all cursor-pointer"
|
|
1043
|
+
}
|
|
1044
|
+
),
|
|
1045
|
+
/* @__PURE__ */ jsx(
|
|
1046
|
+
"text",
|
|
1047
|
+
{
|
|
1048
|
+
x: point.x,
|
|
1049
|
+
y: padding.top + chartHeight + 20,
|
|
1050
|
+
textAnchor: "middle",
|
|
1051
|
+
className: "fill-muted-foreground text-[10px]",
|
|
1052
|
+
children: point.label
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
] }, index)),
|
|
1056
|
+
showTooltips && renderTooltip()
|
|
1057
|
+
]
|
|
1058
|
+
}
|
|
1059
|
+
);
|
|
1017
1060
|
};
|
|
1018
1061
|
const renderChart = () => {
|
|
1019
1062
|
switch (chartType) {
|
|
@@ -1103,18 +1146,21 @@ function Label({ className, ...props }) {
|
|
|
1103
1146
|
}
|
|
1104
1147
|
);
|
|
1105
1148
|
}
|
|
1106
|
-
var fieldVariants = cva(
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1149
|
+
var fieldVariants = cva(
|
|
1150
|
+
"data-[invalid=true]:text-destructive gap-3 group/field flex w-full",
|
|
1151
|
+
{
|
|
1152
|
+
variants: {
|
|
1153
|
+
orientation: {
|
|
1154
|
+
vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
1155
|
+
horizontal: "flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
|
|
1156
|
+
responsive: "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
defaultVariants: {
|
|
1160
|
+
orientation: "vertical"
|
|
1161
|
+
}
|
|
1116
1162
|
}
|
|
1117
|
-
|
|
1163
|
+
);
|
|
1118
1164
|
function Field({
|
|
1119
1165
|
className,
|
|
1120
1166
|
orientation = "vertical",
|
|
@@ -1305,7 +1351,10 @@ function SelectContent({
|
|
|
1305
1351
|
Select$1.Popup,
|
|
1306
1352
|
{
|
|
1307
1353
|
"data-slot": "select-content",
|
|
1308
|
-
className: cn(
|
|
1354
|
+
className: cn(
|
|
1355
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/5 min-w-36 rounded-2xl shadow-2xl ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",
|
|
1356
|
+
className
|
|
1357
|
+
),
|
|
1309
1358
|
...props,
|
|
1310
1359
|
children: [
|
|
1311
1360
|
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
@@ -1352,12 +1401,12 @@ function SelectScrollUpButton({
|
|
|
1352
1401
|
Select$1.ScrollUpArrow,
|
|
1353
1402
|
{
|
|
1354
1403
|
"data-slot": "select-scroll-up-button",
|
|
1355
|
-
className: cn(
|
|
1404
|
+
className: cn(
|
|
1405
|
+
"bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",
|
|
1406
|
+
className
|
|
1407
|
+
),
|
|
1356
1408
|
...props,
|
|
1357
|
-
children: /* @__PURE__ */ jsx(
|
|
1358
|
-
IconChevronUp,
|
|
1359
|
-
{}
|
|
1360
|
-
)
|
|
1409
|
+
children: /* @__PURE__ */ jsx(IconChevronUp, {})
|
|
1361
1410
|
}
|
|
1362
1411
|
);
|
|
1363
1412
|
}
|
|
@@ -1369,12 +1418,12 @@ function SelectScrollDownButton({
|
|
|
1369
1418
|
Select$1.ScrollDownArrow,
|
|
1370
1419
|
{
|
|
1371
1420
|
"data-slot": "select-scroll-down-button",
|
|
1372
|
-
className: cn(
|
|
1421
|
+
className: cn(
|
|
1422
|
+
"bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",
|
|
1423
|
+
className
|
|
1424
|
+
),
|
|
1373
1425
|
...props,
|
|
1374
|
-
children: /* @__PURE__ */ jsx(
|
|
1375
|
-
IconChevronDown,
|
|
1376
|
-
{}
|
|
1377
|
-
)
|
|
1426
|
+
children: /* @__PURE__ */ jsx(IconChevronDown, {})
|
|
1378
1427
|
}
|
|
1379
1428
|
);
|
|
1380
1429
|
}
|
|
@@ -1830,37 +1879,30 @@ var RadioGroup = ({
|
|
|
1830
1879
|
children: options.map((option, index) => {
|
|
1831
1880
|
const radioId = `${name}-${index}`;
|
|
1832
1881
|
const isDisabled = disabled || option.disabled;
|
|
1833
|
-
return /* @__PURE__ */ jsxs(
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
color: isDisabled ? "muted" : "foreground"
|
|
1858
|
-
}
|
|
1859
|
-
)
|
|
1860
|
-
]
|
|
1861
|
-
},
|
|
1862
|
-
index
|
|
1863
|
-
);
|
|
1882
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1883
|
+
/* @__PURE__ */ jsx(
|
|
1884
|
+
"input",
|
|
1885
|
+
{
|
|
1886
|
+
type: "radio",
|
|
1887
|
+
name,
|
|
1888
|
+
id: radioId,
|
|
1889
|
+
value: option.value,
|
|
1890
|
+
defaultChecked: defaultValue === option.value,
|
|
1891
|
+
disabled: isDisabled,
|
|
1892
|
+
onChange: handleChange,
|
|
1893
|
+
className: "h-4 w-4 border-gray-300 text-primary focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50"
|
|
1894
|
+
}
|
|
1895
|
+
),
|
|
1896
|
+
/* @__PURE__ */ jsx(
|
|
1897
|
+
Label2,
|
|
1898
|
+
{
|
|
1899
|
+
htmlFor: radioId,
|
|
1900
|
+
value: option.label,
|
|
1901
|
+
size: "sm",
|
|
1902
|
+
color: isDisabled ? "muted" : "foreground"
|
|
1903
|
+
}
|
|
1904
|
+
)
|
|
1905
|
+
] }, index);
|
|
1864
1906
|
})
|
|
1865
1907
|
}
|
|
1866
1908
|
)
|
|
@@ -2048,7 +2090,16 @@ var Upload = ({
|
|
|
2048
2090
|
}
|
|
2049
2091
|
),
|
|
2050
2092
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2 mb-2 items-center", children: [
|
|
2051
|
-
showInitialFiles && initialFiles?.map((file, index) => /* @__PURE__ */ jsx(
|
|
2093
|
+
showInitialFiles && initialFiles?.map((file, index) => /* @__PURE__ */ jsx(
|
|
2094
|
+
Image,
|
|
2095
|
+
{
|
|
2096
|
+
src: file.url,
|
|
2097
|
+
alt: file.name,
|
|
2098
|
+
width: "min",
|
|
2099
|
+
radius: "md"
|
|
2100
|
+
},
|
|
2101
|
+
index
|
|
2102
|
+
)),
|
|
2052
2103
|
displayEvents.map(
|
|
2053
2104
|
(event, index) => event.ui ? /* @__PURE__ */ jsx(UIRenderer, { node: event.ui }, index) : null
|
|
2054
2105
|
),
|
|
@@ -2068,11 +2119,7 @@ var Upload = ({
|
|
|
2068
2119
|
] })
|
|
2069
2120
|
] });
|
|
2070
2121
|
};
|
|
2071
|
-
var Form = ({
|
|
2072
|
-
children,
|
|
2073
|
-
onSubmitAction,
|
|
2074
|
-
gap = "md"
|
|
2075
|
-
}) => {
|
|
2122
|
+
var Form = ({ children, onSubmitAction, gap = "md" }) => {
|
|
2076
2123
|
const { sendEvent } = useMelony();
|
|
2077
2124
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
|
2078
2125
|
const handleSubmit = (e) => {
|
|
@@ -2098,24 +2145,176 @@ var Form = ({
|
|
|
2098
2145
|
}
|
|
2099
2146
|
}
|
|
2100
2147
|
};
|
|
2101
|
-
return /* @__PURE__ */ jsx(
|
|
2102
|
-
"
|
|
2148
|
+
return /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: "w-full", children: /* @__PURE__ */ jsx("fieldset", { disabled: isSubmitted, className: "m-0 border-0 p-0", children: /* @__PURE__ */ jsx(
|
|
2149
|
+
"div",
|
|
2103
2150
|
{
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
"
|
|
2151
|
+
className: cn(
|
|
2152
|
+
"flex flex-col transition-opacity",
|
|
2153
|
+
gapMap[gap],
|
|
2154
|
+
isSubmitted && "opacity-60 pointer-events-none"
|
|
2155
|
+
),
|
|
2156
|
+
children
|
|
2157
|
+
}
|
|
2158
|
+
) }) });
|
|
2159
|
+
};
|
|
2160
|
+
function DropdownMenu({ ...props }) {
|
|
2161
|
+
return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
2162
|
+
}
|
|
2163
|
+
function DropdownMenuTrigger({ ...props }) {
|
|
2164
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
2165
|
+
}
|
|
2166
|
+
function DropdownMenuContent({
|
|
2167
|
+
align = "start",
|
|
2168
|
+
alignOffset = 0,
|
|
2169
|
+
side = "bottom",
|
|
2170
|
+
sideOffset = 4,
|
|
2171
|
+
className,
|
|
2172
|
+
...props
|
|
2173
|
+
}) {
|
|
2174
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(
|
|
2175
|
+
Menu.Positioner,
|
|
2176
|
+
{
|
|
2177
|
+
className: "isolate z-50 outline-none",
|
|
2178
|
+
align,
|
|
2179
|
+
alignOffset,
|
|
2180
|
+
side,
|
|
2181
|
+
sideOffset,
|
|
2182
|
+
children: /* @__PURE__ */ jsx(
|
|
2183
|
+
Menu.Popup,
|
|
2108
2184
|
{
|
|
2185
|
+
"data-slot": "dropdown-menu-content",
|
|
2109
2186
|
className: cn(
|
|
2110
|
-
"
|
|
2111
|
-
|
|
2112
|
-
isSubmitted && "opacity-60 pointer-events-none"
|
|
2187
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/5 bg-popover text-popover-foreground min-w-48 rounded-2xl p-1 shadow-2xl ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",
|
|
2188
|
+
className
|
|
2113
2189
|
),
|
|
2114
|
-
|
|
2190
|
+
...props
|
|
2115
2191
|
}
|
|
2116
|
-
)
|
|
2192
|
+
)
|
|
2193
|
+
}
|
|
2194
|
+
) });
|
|
2195
|
+
}
|
|
2196
|
+
function DropdownMenuGroup({ ...props }) {
|
|
2197
|
+
return /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
2198
|
+
}
|
|
2199
|
+
function DropdownMenuLabel({
|
|
2200
|
+
className,
|
|
2201
|
+
inset,
|
|
2202
|
+
...props
|
|
2203
|
+
}) {
|
|
2204
|
+
return /* @__PURE__ */ jsx(
|
|
2205
|
+
Menu.GroupLabel,
|
|
2206
|
+
{
|
|
2207
|
+
"data-slot": "dropdown-menu-label",
|
|
2208
|
+
"data-inset": inset,
|
|
2209
|
+
className: cn(
|
|
2210
|
+
"text-muted-foreground px-3 py-2.5 text-xs data-[inset]:pl-8",
|
|
2211
|
+
className
|
|
2212
|
+
),
|
|
2213
|
+
...props
|
|
2214
|
+
}
|
|
2215
|
+
);
|
|
2216
|
+
}
|
|
2217
|
+
function DropdownMenuItem({
|
|
2218
|
+
className,
|
|
2219
|
+
inset,
|
|
2220
|
+
variant = "default",
|
|
2221
|
+
...props
|
|
2222
|
+
}) {
|
|
2223
|
+
return /* @__PURE__ */ jsx(
|
|
2224
|
+
Menu.Item,
|
|
2225
|
+
{
|
|
2226
|
+
"data-slot": "dropdown-menu-item",
|
|
2227
|
+
"data-inset": inset,
|
|
2228
|
+
"data-variant": variant,
|
|
2229
|
+
className: cn(
|
|
2230
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2.5 rounded-xl px-3 py-2 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2231
|
+
className
|
|
2232
|
+
),
|
|
2233
|
+
...props
|
|
2234
|
+
}
|
|
2235
|
+
);
|
|
2236
|
+
}
|
|
2237
|
+
function DropdownMenuCheckboxItem({
|
|
2238
|
+
className,
|
|
2239
|
+
children,
|
|
2240
|
+
checked,
|
|
2241
|
+
...props
|
|
2242
|
+
}) {
|
|
2243
|
+
return /* @__PURE__ */ jsxs(
|
|
2244
|
+
Menu.CheckboxItem,
|
|
2245
|
+
{
|
|
2246
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
2247
|
+
className: cn(
|
|
2248
|
+
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-xl py-2 pr-8 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2249
|
+
className
|
|
2250
|
+
),
|
|
2251
|
+
checked,
|
|
2252
|
+
...props,
|
|
2253
|
+
children: [
|
|
2254
|
+
/* @__PURE__ */ jsx(
|
|
2255
|
+
"span",
|
|
2256
|
+
{
|
|
2257
|
+
className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
|
|
2258
|
+
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
2259
|
+
children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(IconCheck, {}) })
|
|
2260
|
+
}
|
|
2261
|
+
),
|
|
2262
|
+
children
|
|
2263
|
+
]
|
|
2117
2264
|
}
|
|
2118
2265
|
);
|
|
2266
|
+
}
|
|
2267
|
+
function DropdownMenuSeparator({
|
|
2268
|
+
className,
|
|
2269
|
+
...props
|
|
2270
|
+
}) {
|
|
2271
|
+
return /* @__PURE__ */ jsx(
|
|
2272
|
+
Menu.Separator,
|
|
2273
|
+
{
|
|
2274
|
+
"data-slot": "dropdown-menu-separator",
|
|
2275
|
+
className: cn("bg-border/50 -mx-1 my-1 h-px", className),
|
|
2276
|
+
...props
|
|
2277
|
+
}
|
|
2278
|
+
);
|
|
2279
|
+
}
|
|
2280
|
+
var Dropdown = ({ items = [], children }) => {
|
|
2281
|
+
const { sendEvent } = useMelony();
|
|
2282
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
2283
|
+
/* @__PURE__ */ jsx(
|
|
2284
|
+
DropdownMenuTrigger,
|
|
2285
|
+
{
|
|
2286
|
+
render: (props) => /* @__PURE__ */ jsx(
|
|
2287
|
+
Button,
|
|
2288
|
+
{
|
|
2289
|
+
variant: "outline",
|
|
2290
|
+
size: "icon-sm",
|
|
2291
|
+
...props,
|
|
2292
|
+
onClick: (e) => {
|
|
2293
|
+
e.stopPropagation();
|
|
2294
|
+
props.onClick?.(e);
|
|
2295
|
+
},
|
|
2296
|
+
children: children || /* @__PURE__ */ jsx(IconDotsVertical, { className: "size-3.5" })
|
|
2297
|
+
}
|
|
2298
|
+
)
|
|
2299
|
+
}
|
|
2300
|
+
),
|
|
2301
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: cn("w-32"), children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
2302
|
+
DropdownMenuItem,
|
|
2303
|
+
{
|
|
2304
|
+
onClick: (e) => {
|
|
2305
|
+
e.stopPropagation();
|
|
2306
|
+
if (item.onClickAction) {
|
|
2307
|
+
sendEvent(item.onClickAction);
|
|
2308
|
+
}
|
|
2309
|
+
},
|
|
2310
|
+
children: [
|
|
2311
|
+
item.icon && /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }),
|
|
2312
|
+
/* @__PURE__ */ jsx("span", { className: item.icon ? "ml-2" : "", children: item.label })
|
|
2313
|
+
]
|
|
2314
|
+
},
|
|
2315
|
+
`${item.label}-${i}`
|
|
2316
|
+
)) })
|
|
2317
|
+
] });
|
|
2119
2318
|
};
|
|
2120
2319
|
function UIRenderer({ node }) {
|
|
2121
2320
|
const { type, props, children } = node;
|
|
@@ -2146,7 +2345,8 @@ function UIRenderer({ node }) {
|
|
|
2146
2345
|
form: Form,
|
|
2147
2346
|
chart: Chart,
|
|
2148
2347
|
label: Label2,
|
|
2149
|
-
upload: Upload
|
|
2348
|
+
upload: Upload,
|
|
2349
|
+
dropdown: Dropdown
|
|
2150
2350
|
};
|
|
2151
2351
|
const Component = typeMap[type];
|
|
2152
2352
|
if (!Component) {
|
|
@@ -2329,123 +2529,6 @@ var useAuth = () => {
|
|
|
2329
2529
|
}
|
|
2330
2530
|
return context;
|
|
2331
2531
|
};
|
|
2332
|
-
function DropdownMenu({ ...props }) {
|
|
2333
|
-
return /* @__PURE__ */ jsx(Menu.Root, { "data-slot": "dropdown-menu", ...props });
|
|
2334
|
-
}
|
|
2335
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
2336
|
-
return /* @__PURE__ */ jsx(Menu.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
2337
|
-
}
|
|
2338
|
-
function DropdownMenuContent({
|
|
2339
|
-
align = "start",
|
|
2340
|
-
alignOffset = 0,
|
|
2341
|
-
side = "bottom",
|
|
2342
|
-
sideOffset = 4,
|
|
2343
|
-
className,
|
|
2344
|
-
...props
|
|
2345
|
-
}) {
|
|
2346
|
-
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(
|
|
2347
|
-
Menu.Positioner,
|
|
2348
|
-
{
|
|
2349
|
-
className: "isolate z-50 outline-none",
|
|
2350
|
-
align,
|
|
2351
|
-
alignOffset,
|
|
2352
|
-
side,
|
|
2353
|
-
sideOffset,
|
|
2354
|
-
children: /* @__PURE__ */ jsx(
|
|
2355
|
-
Menu.Popup,
|
|
2356
|
-
{
|
|
2357
|
-
"data-slot": "dropdown-menu-content",
|
|
2358
|
-
className: cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/5 bg-popover text-popover-foreground min-w-48 rounded-2xl p-1 shadow-2xl ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden", className),
|
|
2359
|
-
...props
|
|
2360
|
-
}
|
|
2361
|
-
)
|
|
2362
|
-
}
|
|
2363
|
-
) });
|
|
2364
|
-
}
|
|
2365
|
-
function DropdownMenuGroup({ ...props }) {
|
|
2366
|
-
return /* @__PURE__ */ jsx(Menu.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
2367
|
-
}
|
|
2368
|
-
function DropdownMenuLabel({
|
|
2369
|
-
className,
|
|
2370
|
-
inset,
|
|
2371
|
-
...props
|
|
2372
|
-
}) {
|
|
2373
|
-
return /* @__PURE__ */ jsx(
|
|
2374
|
-
Menu.GroupLabel,
|
|
2375
|
-
{
|
|
2376
|
-
"data-slot": "dropdown-menu-label",
|
|
2377
|
-
"data-inset": inset,
|
|
2378
|
-
className: cn("text-muted-foreground px-3 py-2.5 text-xs data-[inset]:pl-8", className),
|
|
2379
|
-
...props
|
|
2380
|
-
}
|
|
2381
|
-
);
|
|
2382
|
-
}
|
|
2383
|
-
function DropdownMenuItem({
|
|
2384
|
-
className,
|
|
2385
|
-
inset,
|
|
2386
|
-
variant = "default",
|
|
2387
|
-
...props
|
|
2388
|
-
}) {
|
|
2389
|
-
return /* @__PURE__ */ jsx(
|
|
2390
|
-
Menu.Item,
|
|
2391
|
-
{
|
|
2392
|
-
"data-slot": "dropdown-menu-item",
|
|
2393
|
-
"data-inset": inset,
|
|
2394
|
-
"data-variant": variant,
|
|
2395
|
-
className: cn(
|
|
2396
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2.5 rounded-xl px-3 py-2 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2397
|
-
className
|
|
2398
|
-
),
|
|
2399
|
-
...props
|
|
2400
|
-
}
|
|
2401
|
-
);
|
|
2402
|
-
}
|
|
2403
|
-
function DropdownMenuCheckboxItem({
|
|
2404
|
-
className,
|
|
2405
|
-
children,
|
|
2406
|
-
checked,
|
|
2407
|
-
...props
|
|
2408
|
-
}) {
|
|
2409
|
-
return /* @__PURE__ */ jsxs(
|
|
2410
|
-
Menu.CheckboxItem,
|
|
2411
|
-
{
|
|
2412
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
2413
|
-
className: cn(
|
|
2414
|
-
"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-xl py-2 pr-8 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2415
|
-
className
|
|
2416
|
-
),
|
|
2417
|
-
checked,
|
|
2418
|
-
...props,
|
|
2419
|
-
children: [
|
|
2420
|
-
/* @__PURE__ */ jsx(
|
|
2421
|
-
"span",
|
|
2422
|
-
{
|
|
2423
|
-
className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
|
|
2424
|
-
"data-slot": "dropdown-menu-checkbox-item-indicator",
|
|
2425
|
-
children: /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsx(
|
|
2426
|
-
IconCheck,
|
|
2427
|
-
{}
|
|
2428
|
-
) })
|
|
2429
|
-
}
|
|
2430
|
-
),
|
|
2431
|
-
children
|
|
2432
|
-
]
|
|
2433
|
-
}
|
|
2434
|
-
);
|
|
2435
|
-
}
|
|
2436
|
-
function DropdownMenuSeparator({
|
|
2437
|
-
className,
|
|
2438
|
-
...props
|
|
2439
|
-
}) {
|
|
2440
|
-
return /* @__PURE__ */ jsx(
|
|
2441
|
-
Menu.Separator,
|
|
2442
|
-
{
|
|
2443
|
-
"data-slot": "dropdown-menu-separator",
|
|
2444
|
-
className: cn("bg-border/50 -mx-1 my-1 h-px", className),
|
|
2445
|
-
...props
|
|
2446
|
-
}
|
|
2447
|
-
);
|
|
2448
|
-
}
|
|
2449
2532
|
var AccountButton = ({
|
|
2450
2533
|
className,
|
|
2451
2534
|
variant = "outline",
|
|
@@ -3321,9 +3404,7 @@ function Composer({
|
|
|
3321
3404
|
] })
|
|
3322
3405
|
] }) });
|
|
3323
3406
|
}
|
|
3324
|
-
function StarterPrompts({
|
|
3325
|
-
prompts
|
|
3326
|
-
}) {
|
|
3407
|
+
function StarterPrompts({ prompts }) {
|
|
3327
3408
|
if (!prompts || prompts.length === 0) {
|
|
3328
3409
|
return null;
|
|
3329
3410
|
}
|
|
@@ -3477,57 +3558,46 @@ function Thread({
|
|
|
3477
3558
|
});
|
|
3478
3559
|
};
|
|
3479
3560
|
const showStarterPrompts = messages.length === 0 && starterPrompts && starterPrompts.length > 0 && !isLoadingEvents;
|
|
3480
|
-
return /* @__PURE__ */ jsxs(
|
|
3481
|
-
"div",
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
"
|
|
3488
|
-
{
|
|
3489
|
-
className: cn(
|
|
3490
|
-
"max-w-[48rem] mx-auto w-full p-4",
|
|
3491
|
-
showStarterPrompts && "min-h-full flex flex-col"
|
|
3492
|
-
),
|
|
3493
|
-
children: isLoadingEvents && messages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-20", children: /* @__PURE__ */ jsx(LoadingIndicator, { status: { message: "Loading messages..." } }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3494
|
-
showStarterPrompts && /* @__PURE__ */ jsx(
|
|
3495
|
-
StarterPrompts,
|
|
3496
|
-
{
|
|
3497
|
-
prompts: starterPrompts
|
|
3498
|
-
}
|
|
3499
|
-
),
|
|
3500
|
-
/* @__PURE__ */ jsx(
|
|
3501
|
-
MessageList,
|
|
3502
|
-
{
|
|
3503
|
-
messages,
|
|
3504
|
-
isLoading,
|
|
3505
|
-
error,
|
|
3506
|
-
loadingStatus
|
|
3507
|
-
}
|
|
3508
|
-
)
|
|
3509
|
-
] })
|
|
3510
|
-
}
|
|
3561
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col h-full bg-background flex-1 overflow-hidden", children: [
|
|
3562
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto p-4 pb-36", children: [
|
|
3563
|
+
/* @__PURE__ */ jsx(
|
|
3564
|
+
"div",
|
|
3565
|
+
{
|
|
3566
|
+
className: cn(
|
|
3567
|
+
"max-w-[48rem] mx-auto w-full p-4",
|
|
3568
|
+
showStarterPrompts && "min-h-full flex flex-col"
|
|
3511
3569
|
),
|
|
3512
|
-
/* @__PURE__ */ jsx("div", {
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3570
|
+
children: isLoadingEvents && messages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-20", children: /* @__PURE__ */ jsx(LoadingIndicator, { status: { message: "Loading messages..." } }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3571
|
+
showStarterPrompts && /* @__PURE__ */ jsx(StarterPrompts, { prompts: starterPrompts }),
|
|
3572
|
+
/* @__PURE__ */ jsx(
|
|
3573
|
+
MessageList,
|
|
3574
|
+
{
|
|
3575
|
+
messages,
|
|
3576
|
+
isLoading,
|
|
3577
|
+
error,
|
|
3578
|
+
loadingStatus
|
|
3579
|
+
}
|
|
3580
|
+
)
|
|
3581
|
+
] })
|
|
3582
|
+
}
|
|
3583
|
+
),
|
|
3584
|
+
/* @__PURE__ */ jsx("div", { ref: messagesEndRef })
|
|
3585
|
+
] }),
|
|
3586
|
+
/* @__PURE__ */ jsx("div", { className: "absolute bottom-0 p-4 w-full", children: /* @__PURE__ */ jsx("div", { className: "max-w-[48rem] mx-auto", children: /* @__PURE__ */ jsx(
|
|
3587
|
+
Composer,
|
|
3588
|
+
{
|
|
3589
|
+
value: input,
|
|
3590
|
+
onChange: setInput,
|
|
3591
|
+
onSubmit: handleSubmit,
|
|
3592
|
+
placeholder,
|
|
3593
|
+
isLoading,
|
|
3594
|
+
options,
|
|
3595
|
+
autoFocus,
|
|
3596
|
+
defaultSelectedIds: allDefaultSelectedIds,
|
|
3597
|
+
fileAttachments
|
|
3598
|
+
}
|
|
3599
|
+
) }) })
|
|
3600
|
+
] });
|
|
3531
3601
|
}
|
|
3532
3602
|
function ChatHeader({
|
|
3533
3603
|
leftContent,
|
|
@@ -3561,40 +3631,13 @@ function ChatHeader({
|
|
|
3561
3631
|
}
|
|
3562
3632
|
);
|
|
3563
3633
|
}
|
|
3564
|
-
var
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3634
|
+
var ThreadList = ({
|
|
3635
|
+
padding,
|
|
3636
|
+
background,
|
|
3637
|
+
gap,
|
|
3638
|
+
radius = "md"
|
|
3569
3639
|
}) => {
|
|
3570
|
-
|
|
3571
|
-
/* @__PURE__ */ jsx(
|
|
3572
|
-
DropdownMenuTrigger,
|
|
3573
|
-
{
|
|
3574
|
-
className: triggerClassName,
|
|
3575
|
-
render: (props) => /* @__PURE__ */ jsx(
|
|
3576
|
-
Button,
|
|
3577
|
-
{
|
|
3578
|
-
variant: "ghost",
|
|
3579
|
-
size: "icon-xs",
|
|
3580
|
-
...props,
|
|
3581
|
-
onClick: (e) => {
|
|
3582
|
-
e.stopPropagation();
|
|
3583
|
-
props.onClick?.(e);
|
|
3584
|
-
},
|
|
3585
|
-
children: trigger || /* @__PURE__ */ jsx(IconDotsVertical, { className: "size-3.5" })
|
|
3586
|
-
}
|
|
3587
|
-
)
|
|
3588
|
-
}
|
|
3589
|
-
),
|
|
3590
|
-
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: cn("w-32", className), children: items.map((item) => /* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: item.onClick, children: [
|
|
3591
|
-
item.icon,
|
|
3592
|
-
/* @__PURE__ */ jsx("span", { children: item.label })
|
|
3593
|
-
] }, item.label)) })
|
|
3594
|
-
] });
|
|
3595
|
-
};
|
|
3596
|
-
var ThreadList = ({ padding, background, gap, radius = "md" }) => {
|
|
3597
|
-
const { threads, activeThreadId, deleteThread } = useThreads();
|
|
3640
|
+
const { threads, activeThreadId } = useThreads();
|
|
3598
3641
|
const sortedThreads = React3.useMemo(() => {
|
|
3599
3642
|
return [...threads].sort((a, b) => {
|
|
3600
3643
|
const dateA = a.updatedAt ? new Date(a.updatedAt).getTime() : 0;
|
|
@@ -3602,16 +3645,9 @@ var ThreadList = ({ padding, background, gap, radius = "md" }) => {
|
|
|
3602
3645
|
return dateB - dateA;
|
|
3603
3646
|
});
|
|
3604
3647
|
}, [threads]);
|
|
3605
|
-
const handleDelete = async (threadId) => {
|
|
3606
|
-
try {
|
|
3607
|
-
await deleteThread(threadId);
|
|
3608
|
-
} catch (error) {
|
|
3609
|
-
console.error("Failed to delete thread:", error);
|
|
3610
|
-
}
|
|
3611
|
-
};
|
|
3612
3648
|
return /* @__PURE__ */ jsx(List, { padding, gap, flex: "1", overflow: "scroll", children: sortedThreads.map((thread) => {
|
|
3613
|
-
thread.id === activeThreadId;
|
|
3614
|
-
return /* @__PURE__ */
|
|
3649
|
+
const isActive = thread.id === activeThreadId;
|
|
3650
|
+
return /* @__PURE__ */ jsx(
|
|
3615
3651
|
ListItem,
|
|
3616
3652
|
{
|
|
3617
3653
|
onClickAction: {
|
|
@@ -3620,25 +3656,28 @@ var ThreadList = ({ padding, background, gap, radius = "md" }) => {
|
|
|
3620
3656
|
url: `?threadId=${thread.id}`
|
|
3621
3657
|
}
|
|
3622
3658
|
},
|
|
3623
|
-
background,
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
children: [
|
|
3628
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: thread.title || `Thread ${thread.id.slice(0, 8)}` }) }),
|
|
3629
|
-
/* @__PURE__ */ jsx("div", { className: "shrink-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsx(
|
|
3659
|
+
background: isActive ? "primary" : "transparent",
|
|
3660
|
+
children: /* @__PURE__ */ jsxs(Box, { group: true, width: "full", children: [
|
|
3661
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0 pr-4", children: /* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: thread.title || `Thread ${thread.id.slice(0, 8)}` }) }),
|
|
3662
|
+
/* @__PURE__ */ jsx(Float, { position: "right-center", showOnHover: true, children: /* @__PURE__ */ jsx(
|
|
3630
3663
|
Dropdown,
|
|
3631
3664
|
{
|
|
3632
3665
|
items: [
|
|
3633
3666
|
{
|
|
3634
3667
|
label: "Delete",
|
|
3635
|
-
icon:
|
|
3636
|
-
|
|
3668
|
+
icon: "trash",
|
|
3669
|
+
onClickAction: {
|
|
3670
|
+
role: "system",
|
|
3671
|
+
type: "delete-thread",
|
|
3672
|
+
data: {
|
|
3673
|
+
threadId: thread.id
|
|
3674
|
+
}
|
|
3675
|
+
}
|
|
3637
3676
|
}
|
|
3638
3677
|
]
|
|
3639
3678
|
}
|
|
3640
3679
|
) })
|
|
3641
|
-
]
|
|
3680
|
+
] })
|
|
3642
3681
|
},
|
|
3643
3682
|
thread.id
|
|
3644
3683
|
);
|
|
@@ -3850,14 +3889,7 @@ var ThreadPopover = ({}) => {
|
|
|
3850
3889
|
}
|
|
3851
3890
|
);
|
|
3852
3891
|
return /* @__PURE__ */ jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
|
|
3853
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
3854
|
-
Button,
|
|
3855
|
-
{
|
|
3856
|
-
variant: "ghost",
|
|
3857
|
-
size: "icon",
|
|
3858
|
-
children: /* @__PURE__ */ jsx(IconHistory, { className: "size-4" })
|
|
3859
|
-
}
|
|
3860
|
-
) }),
|
|
3892
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsx(IconHistory, { className: "size-4" }) }) }),
|
|
3861
3893
|
/* @__PURE__ */ jsx(
|
|
3862
3894
|
PopoverContent,
|
|
3863
3895
|
{
|