@melony/react 0.1.53 → 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/dist/index.cjs CHANGED
@@ -71,10 +71,7 @@ function DialogOverlay({
71
71
  }
72
72
  );
73
73
  }
74
- function DialogContent({
75
- className,
76
- ...props
77
- }) {
74
+ function DialogContent({ className, ...props }) {
78
75
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
79
76
  /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
80
77
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -90,10 +87,7 @@ function DialogContent({
90
87
  )
91
88
  ] });
92
89
  }
93
- function DialogClose({
94
- className,
95
- ...props
96
- }) {
90
+ function DialogClose({ className, ...props }) {
97
91
  return /* @__PURE__ */ jsxRuntime.jsx(
98
92
  dialog.Dialog.Close,
99
93
  {
@@ -106,10 +100,7 @@ function DialogClose({
106
100
  }
107
101
  );
108
102
  }
109
- function DialogHeader({
110
- className,
111
- ...props
112
- }) {
103
+ function DialogHeader({ className, ...props }) {
113
104
  return /* @__PURE__ */ jsxRuntime.jsx(
114
105
  "div",
115
106
  {
@@ -161,7 +152,10 @@ function Card({
161
152
  {
162
153
  "data-slot": "card",
163
154
  "data-size": size,
164
- className: cn("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", className),
155
+ className: cn(
156
+ "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",
157
+ className
158
+ ),
165
159
  ...props
166
160
  }
167
161
  );
@@ -436,7 +430,8 @@ var Box = ({
436
430
  radius = "none",
437
431
  width = "auto",
438
432
  height = "auto",
439
- shadow = "none"
433
+ shadow = "none",
434
+ group = false
440
435
  }) => {
441
436
  return /* @__PURE__ */ jsxRuntime.jsx(
442
437
  "div",
@@ -451,7 +446,8 @@ var Box = ({
451
446
  radiusMap[radius],
452
447
  widthMap[width],
453
448
  height === "full" && "h-full",
454
- shadowMap[shadow]
449
+ shadowMap[shadow],
450
+ group && "group"
455
451
  ),
456
452
  children
457
453
  }
@@ -465,11 +461,15 @@ var Float = ({
465
461
  showOnHover = false
466
462
  }) => {
467
463
  const positionClasses = {
468
- "top-left": "top-0 left-0",
469
- "top-right": "top-0 right-0",
470
- "bottom-left": "bottom-0 left-0",
471
- "bottom-right": "bottom-0 right-0",
472
- "center": "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
464
+ "top-left": "top-1 left-1",
465
+ "top-right": "top-1 right-1",
466
+ "top-center": "top-1 left-1/2 -translate-x-1/2",
467
+ "bottom-left": "bottom-1 left-1",
468
+ "bottom-right": "bottom-1 right-1",
469
+ "bottom-center": "bottom-1 left-1/2 -translate-x-1/2",
470
+ center: "top- 1 / 2 left - 1/2 -tra nslate-x-1/2 -translate-y-1/2",
471
+ "left-center": "top-1/2 left-1 -translate-y-1/2",
472
+ "right-center": "top-1/2 right-1 -translate-y-1/2"
473
473
  };
474
474
  const marginXClass = position.endsWith("left") ? marginMap[offsetX].replace("m-", "ml-") : marginMap[offsetX].replace("m-", "mr-");
475
475
  const marginYClass = position.startsWith("top") ? marginMap[offsetY].replace("m-", "mt-") : marginMap[offsetY].replace("m-", "mb-");
@@ -528,10 +528,7 @@ var Divider = ({
528
528
  Separator,
529
529
  {
530
530
  orientation,
531
- className: cn(
532
- marginMap[margin],
533
- colorBgMap[color]
534
- )
531
+ className: cn(marginMap[margin], colorBgMap[color])
535
532
  }
536
533
  );
537
534
  };
@@ -751,6 +748,7 @@ var Video = ({
751
748
  muted = false,
752
749
  aspectRatio = "16/9",
753
750
  width = "full",
751
+ height = "auto",
754
752
  radius = "lg"
755
753
  }) => {
756
754
  const aspectRatios = {
@@ -768,6 +766,7 @@ var Video = ({
768
766
  widthMap[width],
769
767
  radiusMap[radius]
770
768
  ),
769
+ style: { height },
771
770
  children: /* @__PURE__ */ jsxRuntime.jsx(
772
771
  "video",
773
772
  {
@@ -797,13 +796,16 @@ var Icon = ({
797
796
  lg: 24
798
797
  };
799
798
  const resolvedSize = typeof size === "number" ? size : sizeMap[size] || 20;
800
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("inline-flex items-center justify-center", colorTextMap[color]), children: /* @__PURE__ */ jsxRuntime.jsx(
801
- IconComponent,
799
+ return /* @__PURE__ */ jsxRuntime.jsx(
800
+ "div",
802
801
  {
803
- size: resolvedSize,
804
- strokeWidth: 1.5
802
+ className: cn(
803
+ "inline-flex items-center justify-center",
804
+ colorTextMap[color]
805
+ ),
806
+ children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { size: resolvedSize, strokeWidth: 1.5 })
805
807
  }
806
- ) });
808
+ );
807
809
  };
808
810
  var badgeVariants = classVarianceAuthority.cva(
809
811
  "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",
@@ -960,41 +962,60 @@ var Chart = ({
960
962
  const totalBarSpace = chartWidth - padding.left - padding.right;
961
963
  const barSpacing = data.length > 1 ? totalBarSpace * 0.1 / data.length : 0;
962
964
  const actualBarWidth = (totalBarSpace - barSpacing * (data.length + 1)) / data.length;
963
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`, className: "w-full h-auto overflow-visible", children: [
964
- renderGrid(),
965
- data.map((item, index) => {
966
- const barHeight = item.value / maxValue * chartHeight;
967
- const x = padding.left + barSpacing + index * (actualBarWidth + barSpacing);
968
- const y = padding.top + chartHeight - barHeight;
969
- return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
970
- /* @__PURE__ */ jsxRuntime.jsx(
971
- "rect",
972
- {
973
- x,
974
- y,
975
- width: actualBarWidth,
976
- height: barHeight,
977
- fill: getColor(index, item.color),
978
- rx: 4,
979
- onMouseEnter: () => showTooltips && setTooltip({ visible: true, x: x + actualBarWidth / 2, y: y - 5, label: item.label, value: item.value }),
980
- onMouseLeave: () => setTooltip({ visible: false, x: 0, y: 0, label: "", value: 0 }),
981
- className: "transition-all hover:opacity-80 cursor-pointer"
982
- }
983
- ),
984
- /* @__PURE__ */ jsxRuntime.jsx(
985
- "text",
986
- {
987
- x: x + actualBarWidth / 2,
988
- y: padding.top + chartHeight + 20,
989
- textAnchor: "middle",
990
- className: "fill-muted-foreground text-[10px]",
991
- children: item.label
992
- }
993
- )
994
- ] }, index);
995
- }),
996
- showTooltips && renderTooltip()
997
- ] });
965
+ return /* @__PURE__ */ jsxRuntime.jsxs(
966
+ "svg",
967
+ {
968
+ viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`,
969
+ className: "w-full h-auto overflow-visible",
970
+ children: [
971
+ renderGrid(),
972
+ data.map((item, index) => {
973
+ const barHeight = item.value / maxValue * chartHeight;
974
+ const x = padding.left + barSpacing + index * (actualBarWidth + barSpacing);
975
+ const y = padding.top + chartHeight - barHeight;
976
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
977
+ /* @__PURE__ */ jsxRuntime.jsx(
978
+ "rect",
979
+ {
980
+ x,
981
+ y,
982
+ width: actualBarWidth,
983
+ height: barHeight,
984
+ fill: getColor(index, item.color),
985
+ rx: 4,
986
+ onMouseEnter: () => showTooltips && setTooltip({
987
+ visible: true,
988
+ x: x + actualBarWidth / 2,
989
+ y: y - 5,
990
+ label: item.label,
991
+ value: item.value
992
+ }),
993
+ onMouseLeave: () => setTooltip({
994
+ visible: false,
995
+ x: 0,
996
+ y: 0,
997
+ label: "",
998
+ value: 0
999
+ }),
1000
+ className: "transition-all hover:opacity-80 cursor-pointer"
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ jsxRuntime.jsx(
1004
+ "text",
1005
+ {
1006
+ x: x + actualBarWidth / 2,
1007
+ y: padding.top + chartHeight + 20,
1008
+ textAnchor: "middle",
1009
+ className: "fill-muted-foreground text-[10px]",
1010
+ children: item.label
1011
+ }
1012
+ )
1013
+ ] }, index);
1014
+ }),
1015
+ showTooltips && renderTooltip()
1016
+ ]
1017
+ }
1018
+ );
998
1019
  };
999
1020
  const renderLineChart = () => {
1000
1021
  const points = data.map((item, index) => ({
@@ -1003,37 +1024,59 @@ var Chart = ({
1003
1024
  ...item
1004
1025
  }));
1005
1026
  const pathData = points.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`).join(" ");
1006
- return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`, className: "w-full h-auto overflow-visible", children: [
1007
- renderGrid(),
1008
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: getColor(0), strokeWidth: 3, className: "transition-all" }),
1009
- points.map((point, index) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
1010
- /* @__PURE__ */ jsxRuntime.jsx(
1011
- "circle",
1012
- {
1013
- cx: point.x,
1014
- cy: point.y,
1015
- r: 5,
1016
- fill: getColor(index, point.color),
1017
- stroke: "hsl(var(--background))",
1018
- strokeWidth: 2,
1019
- onMouseEnter: () => showTooltips && setTooltip({ visible: true, x: point.x, y: point.y - 5, label: point.label, value: point.value }),
1020
- onMouseLeave: () => setTooltip({ visible: false, x: 0, y: 0, label: "", value: 0 }),
1021
- className: "hover:r-6 transition-all cursor-pointer"
1022
- }
1023
- ),
1024
- /* @__PURE__ */ jsxRuntime.jsx(
1025
- "text",
1026
- {
1027
- x: point.x,
1028
- y: padding.top + chartHeight + 20,
1029
- textAnchor: "middle",
1030
- className: "fill-muted-foreground text-[10px]",
1031
- children: point.label
1032
- }
1033
- )
1034
- ] }, index)),
1035
- showTooltips && renderTooltip()
1036
- ] });
1027
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1028
+ "svg",
1029
+ {
1030
+ viewBox: `0 0 ${chartWidth} ${chartHeight + padding.bottom}`,
1031
+ className: "w-full h-auto overflow-visible",
1032
+ children: [
1033
+ renderGrid(),
1034
+ /* @__PURE__ */ jsxRuntime.jsx(
1035
+ "path",
1036
+ {
1037
+ d: pathData,
1038
+ fill: "none",
1039
+ stroke: getColor(0),
1040
+ strokeWidth: 3,
1041
+ className: "transition-all"
1042
+ }
1043
+ ),
1044
+ points.map((point, index) => /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
1045
+ /* @__PURE__ */ jsxRuntime.jsx(
1046
+ "circle",
1047
+ {
1048
+ cx: point.x,
1049
+ cy: point.y,
1050
+ r: 5,
1051
+ fill: getColor(index, point.color),
1052
+ stroke: "hsl(var(--background))",
1053
+ strokeWidth: 2,
1054
+ onMouseEnter: () => showTooltips && setTooltip({
1055
+ visible: true,
1056
+ x: point.x,
1057
+ y: point.y - 5,
1058
+ label: point.label,
1059
+ value: point.value
1060
+ }),
1061
+ onMouseLeave: () => setTooltip({ visible: false, x: 0, y: 0, label: "", value: 0 }),
1062
+ className: "hover:r-6 transition-all cursor-pointer"
1063
+ }
1064
+ ),
1065
+ /* @__PURE__ */ jsxRuntime.jsx(
1066
+ "text",
1067
+ {
1068
+ x: point.x,
1069
+ y: padding.top + chartHeight + 20,
1070
+ textAnchor: "middle",
1071
+ className: "fill-muted-foreground text-[10px]",
1072
+ children: point.label
1073
+ }
1074
+ )
1075
+ ] }, index)),
1076
+ showTooltips && renderTooltip()
1077
+ ]
1078
+ }
1079
+ );
1037
1080
  };
1038
1081
  const renderChart = () => {
1039
1082
  switch (chartType) {
@@ -1123,18 +1166,21 @@ function Label({ className, ...props }) {
1123
1166
  }
1124
1167
  );
1125
1168
  }
1126
- var fieldVariants = classVarianceAuthority.cva("data-[invalid=true]:text-destructive gap-3 group/field flex w-full", {
1127
- variants: {
1128
- orientation: {
1129
- vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
1130
- 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",
1131
- 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"
1169
+ var fieldVariants = classVarianceAuthority.cva(
1170
+ "data-[invalid=true]:text-destructive gap-3 group/field flex w-full",
1171
+ {
1172
+ variants: {
1173
+ orientation: {
1174
+ vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
1175
+ 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",
1176
+ 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"
1177
+ }
1178
+ },
1179
+ defaultVariants: {
1180
+ orientation: "vertical"
1132
1181
  }
1133
- },
1134
- defaultVariants: {
1135
- orientation: "vertical"
1136
1182
  }
1137
- });
1183
+ );
1138
1184
  function Field({
1139
1185
  className,
1140
1186
  orientation = "vertical",
@@ -1325,7 +1371,10 @@ function SelectContent({
1325
1371
  select.Select.Popup,
1326
1372
  {
1327
1373
  "data-slot": "select-content",
1328
- className: cn("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", className),
1374
+ className: cn(
1375
+ "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",
1376
+ className
1377
+ ),
1329
1378
  ...props,
1330
1379
  children: [
1331
1380
  /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
@@ -1372,12 +1421,12 @@ function SelectScrollUpButton({
1372
1421
  select.Select.ScrollUpArrow,
1373
1422
  {
1374
1423
  "data-slot": "select-scroll-up-button",
1375
- className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full", className),
1424
+ className: cn(
1425
+ "bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",
1426
+ className
1427
+ ),
1376
1428
  ...props,
1377
- children: /* @__PURE__ */ jsxRuntime.jsx(
1378
- ICONS.IconChevronUp,
1379
- {}
1380
- )
1429
+ children: /* @__PURE__ */ jsxRuntime.jsx(ICONS.IconChevronUp, {})
1381
1430
  }
1382
1431
  );
1383
1432
  }
@@ -1389,12 +1438,12 @@ function SelectScrollDownButton({
1389
1438
  select.Select.ScrollDownArrow,
1390
1439
  {
1391
1440
  "data-slot": "select-scroll-down-button",
1392
- className: cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full", className),
1441
+ className: cn(
1442
+ "bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",
1443
+ className
1444
+ ),
1393
1445
  ...props,
1394
- children: /* @__PURE__ */ jsxRuntime.jsx(
1395
- ICONS.IconChevronDown,
1396
- {}
1397
- )
1446
+ children: /* @__PURE__ */ jsxRuntime.jsx(ICONS.IconChevronDown, {})
1398
1447
  }
1399
1448
  );
1400
1449
  }
@@ -1850,37 +1899,30 @@ var RadioGroup = ({
1850
1899
  children: options.map((option, index) => {
1851
1900
  const radioId = `${name}-${index}`;
1852
1901
  const isDisabled = disabled || option.disabled;
1853
- return /* @__PURE__ */ jsxRuntime.jsxs(
1854
- "div",
1855
- {
1856
- className: "flex items-center gap-2",
1857
- children: [
1858
- /* @__PURE__ */ jsxRuntime.jsx(
1859
- "input",
1860
- {
1861
- type: "radio",
1862
- name,
1863
- id: radioId,
1864
- value: option.value,
1865
- defaultChecked: defaultValue === option.value,
1866
- disabled: isDisabled,
1867
- onChange: handleChange,
1868
- className: "h-4 w-4 border-gray-300 text-primary focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50"
1869
- }
1870
- ),
1871
- /* @__PURE__ */ jsxRuntime.jsx(
1872
- Label2,
1873
- {
1874
- htmlFor: radioId,
1875
- value: option.label,
1876
- size: "sm",
1877
- color: isDisabled ? "muted" : "foreground"
1878
- }
1879
- )
1880
- ]
1881
- },
1882
- index
1883
- );
1902
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1903
+ /* @__PURE__ */ jsxRuntime.jsx(
1904
+ "input",
1905
+ {
1906
+ type: "radio",
1907
+ name,
1908
+ id: radioId,
1909
+ value: option.value,
1910
+ defaultChecked: defaultValue === option.value,
1911
+ disabled: isDisabled,
1912
+ onChange: handleChange,
1913
+ className: "h-4 w-4 border-gray-300 text-primary focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50"
1914
+ }
1915
+ ),
1916
+ /* @__PURE__ */ jsxRuntime.jsx(
1917
+ Label2,
1918
+ {
1919
+ htmlFor: radioId,
1920
+ value: option.label,
1921
+ size: "sm",
1922
+ color: isDisabled ? "muted" : "foreground"
1923
+ }
1924
+ )
1925
+ ] }, index);
1884
1926
  })
1885
1927
  }
1886
1928
  )
@@ -2068,7 +2110,16 @@ var Upload = ({
2068
2110
  }
2069
2111
  ),
2070
2112
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap gap-2 mb-2 items-center", children: [
2071
- showInitialFiles && initialFiles?.map((file, index) => /* @__PURE__ */ jsxRuntime.jsx(Image, { src: file.url, alt: file.name, width: "min", radius: "md" }, index)),
2113
+ showInitialFiles && initialFiles?.map((file, index) => /* @__PURE__ */ jsxRuntime.jsx(
2114
+ Image,
2115
+ {
2116
+ src: file.url,
2117
+ alt: file.name,
2118
+ width: "min",
2119
+ radius: "md"
2120
+ },
2121
+ index
2122
+ )),
2072
2123
  displayEvents.map(
2073
2124
  (event, index) => event.ui ? /* @__PURE__ */ jsxRuntime.jsx(UIRenderer, { node: event.ui }, index) : null
2074
2125
  ),
@@ -2088,11 +2139,7 @@ var Upload = ({
2088
2139
  ] })
2089
2140
  ] });
2090
2141
  };
2091
- var Form = ({
2092
- children,
2093
- onSubmitAction,
2094
- gap = "md"
2095
- }) => {
2142
+ var Form = ({ children, onSubmitAction, gap = "md" }) => {
2096
2143
  const { sendEvent } = useMelony();
2097
2144
  const [isSubmitted, setIsSubmitted] = React3.useState(false);
2098
2145
  const handleSubmit = (e) => {
@@ -2118,24 +2165,17 @@ var Form = ({
2118
2165
  }
2119
2166
  }
2120
2167
  };
2121
- return /* @__PURE__ */ jsxRuntime.jsx(
2122
- "form",
2168
+ return /* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, className: "w-full", children: /* @__PURE__ */ jsxRuntime.jsx("fieldset", { disabled: isSubmitted, className: "m-0 border-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2169
+ "div",
2123
2170
  {
2124
- onSubmit: handleSubmit,
2125
- className: "w-full",
2126
- children: /* @__PURE__ */ jsxRuntime.jsx("fieldset", { disabled: isSubmitted, className: "m-0 border-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
2127
- "div",
2128
- {
2129
- className: cn(
2130
- "flex flex-col transition-opacity",
2131
- gapMap[gap],
2132
- isSubmitted && "opacity-60 pointer-events-none"
2133
- ),
2134
- children
2135
- }
2136
- ) })
2171
+ className: cn(
2172
+ "flex flex-col transition-opacity",
2173
+ gapMap[gap],
2174
+ isSubmitted && "opacity-60 pointer-events-none"
2175
+ ),
2176
+ children
2137
2177
  }
2138
- );
2178
+ ) }) });
2139
2179
  };
2140
2180
  function DropdownMenu({ ...props }) {
2141
2181
  return /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.Root, { "data-slot": "dropdown-menu", ...props });
@@ -2163,7 +2203,10 @@ function DropdownMenuContent({
2163
2203
  menu.Menu.Popup,
2164
2204
  {
2165
2205
  "data-slot": "dropdown-menu-content",
2166
- 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),
2206
+ className: cn(
2207
+ "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",
2208
+ className
2209
+ ),
2167
2210
  ...props
2168
2211
  }
2169
2212
  )
@@ -2183,7 +2226,10 @@ function DropdownMenuLabel({
2183
2226
  {
2184
2227
  "data-slot": "dropdown-menu-label",
2185
2228
  "data-inset": inset,
2186
- className: cn("text-muted-foreground px-3 py-2.5 text-xs data-[inset]:pl-8", className),
2229
+ className: cn(
2230
+ "text-muted-foreground px-3 py-2.5 text-xs data-[inset]:pl-8",
2231
+ className
2232
+ ),
2187
2233
  ...props
2188
2234
  }
2189
2235
  );
@@ -2230,10 +2276,7 @@ function DropdownMenuCheckboxItem({
2230
2276
  {
2231
2277
  className: "pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none",
2232
2278
  "data-slot": "dropdown-menu-checkbox-item-indicator",
2233
- children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(
2234
- ICONS.IconCheck,
2235
- {}
2236
- ) })
2279
+ children: /* @__PURE__ */ jsxRuntime.jsx(menu.Menu.CheckboxItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(ICONS.IconCheck, {}) })
2237
2280
  }
2238
2281
  ),
2239
2282
  children
@@ -2254,10 +2297,7 @@ function DropdownMenuSeparator({
2254
2297
  }
2255
2298
  );
2256
2299
  }
2257
- var Dropdown = ({
2258
- items = [],
2259
- children
2260
- }) => {
2300
+ var Dropdown = ({ items = [], children }) => {
2261
2301
  const { sendEvent } = useMelony();
2262
2302
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
2263
2303
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2266,8 +2306,8 @@ var Dropdown = ({
2266
2306
  render: (props) => /* @__PURE__ */ jsxRuntime.jsx(
2267
2307
  Button,
2268
2308
  {
2269
- variant: "ghost",
2270
- size: "icon-xs",
2309
+ variant: "outline",
2310
+ size: "icon-sm",
2271
2311
  ...props,
2272
2312
  onClick: (e) => {
2273
2313
  e.stopPropagation();
@@ -3384,9 +3424,7 @@ function Composer({
3384
3424
  ] })
3385
3425
  ] }) });
3386
3426
  }
3387
- function StarterPrompts({
3388
- prompts
3389
- }) {
3427
+ function StarterPrompts({ prompts }) {
3390
3428
  if (!prompts || prompts.length === 0) {
3391
3429
  return null;
3392
3430
  }
@@ -3540,57 +3578,46 @@ function Thread({
3540
3578
  });
3541
3579
  };
3542
3580
  const showStarterPrompts = messages.length === 0 && starterPrompts && starterPrompts.length > 0 && !isLoadingEvents;
3543
- return /* @__PURE__ */ jsxRuntime.jsxs(
3544
- "div",
3545
- {
3546
- className: "relative flex flex-col h-full bg-background flex-1 overflow-hidden",
3547
- children: [
3548
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto p-4 pb-36", children: [
3549
- /* @__PURE__ */ jsxRuntime.jsx(
3550
- "div",
3551
- {
3552
- className: cn(
3553
- "max-w-[48rem] mx-auto w-full p-4",
3554
- showStarterPrompts && "min-h-full flex flex-col"
3555
- ),
3556
- children: isLoadingEvents && messages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-20", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingIndicator, { status: { message: "Loading messages..." } }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3557
- showStarterPrompts && /* @__PURE__ */ jsxRuntime.jsx(
3558
- StarterPrompts,
3559
- {
3560
- prompts: starterPrompts
3561
- }
3562
- ),
3563
- /* @__PURE__ */ jsxRuntime.jsx(
3564
- MessageList,
3565
- {
3566
- messages,
3567
- isLoading,
3568
- error,
3569
- loadingStatus
3570
- }
3571
- )
3572
- ] })
3573
- }
3581
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex flex-col h-full bg-background flex-1 overflow-hidden", children: [
3582
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 overflow-y-auto p-4 pb-36", children: [
3583
+ /* @__PURE__ */ jsxRuntime.jsx(
3584
+ "div",
3585
+ {
3586
+ className: cn(
3587
+ "max-w-[48rem] mx-auto w-full p-4",
3588
+ showStarterPrompts && "min-h-full flex flex-col"
3574
3589
  ),
3575
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: messagesEndRef })
3576
- ] }),
3577
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-0 p-4 w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
3578
- Composer,
3579
- {
3580
- value: input,
3581
- onChange: setInput,
3582
- onSubmit: handleSubmit,
3583
- placeholder,
3584
- isLoading,
3585
- options,
3586
- autoFocus,
3587
- defaultSelectedIds: allDefaultSelectedIds,
3588
- fileAttachments
3589
- }
3590
- ) }) })
3591
- ]
3592
- }
3593
- );
3590
+ children: isLoadingEvents && messages.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center py-20", children: /* @__PURE__ */ jsxRuntime.jsx(LoadingIndicator, { status: { message: "Loading messages..." } }) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3591
+ showStarterPrompts && /* @__PURE__ */ jsxRuntime.jsx(StarterPrompts, { prompts: starterPrompts }),
3592
+ /* @__PURE__ */ jsxRuntime.jsx(
3593
+ MessageList,
3594
+ {
3595
+ messages,
3596
+ isLoading,
3597
+ error,
3598
+ loadingStatus
3599
+ }
3600
+ )
3601
+ ] })
3602
+ }
3603
+ ),
3604
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: messagesEndRef })
3605
+ ] }),
3606
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-0 p-4 w-full", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-w-[48rem] mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
3607
+ Composer,
3608
+ {
3609
+ value: input,
3610
+ onChange: setInput,
3611
+ onSubmit: handleSubmit,
3612
+ placeholder,
3613
+ isLoading,
3614
+ options,
3615
+ autoFocus,
3616
+ defaultSelectedIds: allDefaultSelectedIds,
3617
+ fileAttachments
3618
+ }
3619
+ ) }) })
3620
+ ] });
3594
3621
  }
3595
3622
  function ChatHeader({
3596
3623
  leftContent,
@@ -3624,7 +3651,12 @@ function ChatHeader({
3624
3651
  }
3625
3652
  );
3626
3653
  }
3627
- var ThreadList = ({ padding, background, gap, radius = "md" }) => {
3654
+ var ThreadList = ({
3655
+ padding,
3656
+ background,
3657
+ gap,
3658
+ radius = "md"
3659
+ }) => {
3628
3660
  const { threads, activeThreadId } = useThreads();
3629
3661
  const sortedThreads = React3__namespace.useMemo(() => {
3630
3662
  return [...threads].sort((a, b) => {
@@ -3634,8 +3666,8 @@ var ThreadList = ({ padding, background, gap, radius = "md" }) => {
3634
3666
  });
3635
3667
  }, [threads]);
3636
3668
  return /* @__PURE__ */ jsxRuntime.jsx(List, { padding, gap, flex: "1", overflow: "scroll", children: sortedThreads.map((thread) => {
3637
- thread.id === activeThreadId;
3638
- return /* @__PURE__ */ jsxRuntime.jsxs(
3669
+ const isActive = thread.id === activeThreadId;
3670
+ return /* @__PURE__ */ jsxRuntime.jsx(
3639
3671
  ListItem,
3640
3672
  {
3641
3673
  onClickAction: {
@@ -3644,13 +3676,10 @@ var ThreadList = ({ padding, background, gap, radius = "md" }) => {
3644
3676
  url: `?threadId=${thread.id}`
3645
3677
  }
3646
3678
  },
3647
- background,
3648
- radius,
3649
- padding,
3650
- gap,
3651
- children: [
3652
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: thread.title || `Thread ${thread.id.slice(0, 8)}` }) }),
3653
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 flex items-center opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxRuntime.jsx(
3679
+ background: isActive ? "primary" : "transparent",
3680
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { group: true, width: "full", children: [
3681
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0 pr-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium truncate", children: thread.title || `Thread ${thread.id.slice(0, 8)}` }) }),
3682
+ /* @__PURE__ */ jsxRuntime.jsx(Float, { position: "right-center", showOnHover: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3654
3683
  Dropdown,
3655
3684
  {
3656
3685
  items: [
@@ -3668,7 +3697,7 @@ var ThreadList = ({ padding, background, gap, radius = "md" }) => {
3668
3697
  ]
3669
3698
  }
3670
3699
  ) })
3671
- ]
3700
+ ] })
3672
3701
  },
3673
3702
  thread.id
3674
3703
  );
@@ -3880,14 +3909,7 @@ var ThreadPopover = ({}) => {
3880
3909
  }
3881
3910
  );
3882
3911
  return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
3883
- /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3884
- Button,
3885
- {
3886
- variant: "ghost",
3887
- size: "icon",
3888
- children: /* @__PURE__ */ jsxRuntime.jsx(ICONS.IconHistory, { className: "size-4" })
3889
- }
3890
- ) }),
3912
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "icon", children: /* @__PURE__ */ jsxRuntime.jsx(ICONS.IconHistory, { className: "size-4" }) }) }),
3891
3913
  /* @__PURE__ */ jsxRuntime.jsx(
3892
3914
  PopoverContent,
3893
3915
  {