@gedatou/cadenza-ai 0.8.0 → 0.9.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +224 -163
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -19,8 +19,8 @@ import { defaultByokStorage, defaultByokStorage as defaultByokStorage$1, defineB
19
19
  import { EventType, EventType as EventType$1, fromSpecTokenUsage, fromSpecTokenUsage as fromSpecTokenUsage$1, generateMessageId, parsePartialJSON, parsePartialJSON as parsePartialJSON$1, toolDefinition } from "@tanstack/ai/client";
20
20
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
21
  import { Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentGroup, AttachmentMedia, AttachmentTitle, Bubble, BubbleContent, Button, Collapsible, CollapsiblePanel, CollapsibleTrigger, Combobox, ComboboxCollection, ComboboxEmpty, ComboboxGroup, ComboboxGroupLabel, ComboboxInput, ComboboxItem, ComboboxList, ComboboxPopup, ComboboxTrigger, ComboboxValue, Dialog, DialogBody, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogTitle, Empty, Field, FieldError, FieldLabel, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupTextarea, Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle, Marker, MarkerContent, Message, MessageContent, MessageFooter, MessageScroller, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Progress, ScrollArea, Select, SelectItem, SelectPopup, SelectTrigger, SelectValue, Spinner, Toggle, Tooltip, TooltipPopup, TooltipTrigger, cn, createChangeEventDetails, createGenericEventDetails, dataAttr } from "@gedatou/cadenza-ui";
22
+ import { AnimateIcon, ArchiveIcon, ArrowUpIcon, BrainIcon, CheckIcon, ClockIcon, FileTextIcon, GlobeIcon, ImageIcon, KeyIcon, MicIcon, PaperclipIcon, PencilIcon, ServerIcon, StopIcon, TrashIcon, XIcon } from "@gedatou/cadenza-icons";
22
23
  import { useControllableState } from "@gedatou/cadenza-utils";
23
- import { IconArchive, IconArrowUp, IconBrain, IconCheck, IconClock, IconFileText, IconKey, IconMicrophone, IconPaperclip, IconPencil, IconPhoto, IconPlayerStop, IconServer, IconTrash, IconWorld, IconX } from "@tabler/icons-react";
24
24
  import { useAudioRecorder, useByok } from "@tanstack/ai-react";
25
25
  import { cjk } from "@streamdown/cjk";
26
26
  import { code } from "@streamdown/code";
@@ -1183,7 +1183,8 @@ function ByokKeyDialogProvider({ provider: id, children, className }) {
1183
1183
  children: [
1184
1184
  /* @__PURE__ */ jsxs(FieldLabel, {
1185
1185
  htmlFor: inputId,
1186
- children: [provider.label, serverKey && /* @__PURE__ */ jsx(IconServer, {
1186
+ children: [provider.label, serverKey && /* @__PURE__ */ jsx(ServerIcon, {
1187
+ animate: true,
1187
1188
  "aria-label": labels.serverKey,
1188
1189
  className: "text-muted-foreground block-4 inline-4"
1189
1190
  })]
@@ -1207,21 +1208,29 @@ function ByokKeyDialogProvider({ provider: id, children, className }) {
1207
1208
  status.state === "error" && /* @__PURE__ */ jsx(FieldError, { children: status.message })
1208
1209
  ]
1209
1210
  }),
1210
- /* @__PURE__ */ jsx(Button, {
1211
- variant: "outline",
1212
- size: "icon-sm",
1213
- "aria-label": labels.save,
1214
- disabled: key === "",
1215
- onClick: () => void byok.update(id, key).then(() => setDraft(""), () => {}),
1216
- children: /* @__PURE__ */ jsx(IconCheck, {})
1211
+ /* @__PURE__ */ jsx(AnimateIcon, {
1212
+ animateOnHover: true,
1213
+ asChild: true,
1214
+ children: /* @__PURE__ */ jsx(Button, {
1215
+ variant: "outline",
1216
+ size: "icon-sm",
1217
+ "aria-label": labels.save,
1218
+ disabled: key === "",
1219
+ onClick: () => void byok.update(id, key).then(() => setDraft(""), () => {}),
1220
+ children: /* @__PURE__ */ jsx(CheckIcon, {})
1221
+ })
1217
1222
  }),
1218
- /* @__PURE__ */ jsx(Button, {
1219
- variant: "ghost",
1220
- size: "icon-sm",
1221
- "aria-label": labels.clear,
1222
- disabled: status.state === "empty",
1223
- onClick: () => void byok.clear(id).catch(() => {}),
1224
- children: /* @__PURE__ */ jsx(IconX, {})
1223
+ /* @__PURE__ */ jsx(AnimateIcon, {
1224
+ animateOnHover: true,
1225
+ asChild: true,
1226
+ children: /* @__PURE__ */ jsx(Button, {
1227
+ variant: "ghost",
1228
+ size: "icon-sm",
1229
+ "aria-label": labels.clear,
1230
+ disabled: status.state === "empty",
1231
+ onClick: () => void byok.clear(id).catch(() => {}),
1232
+ children: /* @__PURE__ */ jsx(XIcon, {})
1233
+ })
1225
1234
  }),
1226
1235
  children
1227
1236
  ]
@@ -1390,26 +1399,34 @@ function ComposerToolbar(props) {
1390
1399
  /** Send while idle, stop while busy. Disabled on an empty draft. */
1391
1400
  function ComposerSubmit({ children, ...props }) {
1392
1401
  const { committable, status, disabled, stop } = useComposer();
1393
- if (isBusy(status)) return /* @__PURE__ */ jsx(Button, {
1394
- "aria-label": "Stop",
1395
- "data-slot": "composer-submit",
1396
- size: "icon-sm",
1397
- type: "button",
1398
- ...props,
1399
- onClick: (event) => {
1400
- props.onClick?.(event);
1401
- if (!event.defaultPrevented) stop(createGenericEventDetails("none", event.nativeEvent));
1402
- },
1403
- children: children ?? /* @__PURE__ */ jsx(IconPlayerStop, {})
1402
+ if (isBusy(status)) return /* @__PURE__ */ jsx(AnimateIcon, {
1403
+ animateOnHover: true,
1404
+ asChild: true,
1405
+ children: /* @__PURE__ */ jsx(Button, {
1406
+ "aria-label": "Stop",
1407
+ "data-slot": "composer-submit",
1408
+ size: "icon-sm",
1409
+ type: "button",
1410
+ ...props,
1411
+ onClick: (event) => {
1412
+ props.onClick?.(event);
1413
+ if (!event.defaultPrevented) stop(createGenericEventDetails("none", event.nativeEvent));
1414
+ },
1415
+ children: children ?? /* @__PURE__ */ jsx(StopIcon, {})
1416
+ })
1404
1417
  });
1405
- return /* @__PURE__ */ jsx(Button, {
1406
- "aria-label": "Send",
1407
- "data-slot": "composer-submit",
1408
- disabled: disabled || !committable,
1409
- size: "icon-sm",
1410
- type: "submit",
1411
- ...props,
1412
- children: children ?? /* @__PURE__ */ jsx(IconArrowUp, {})
1418
+ return /* @__PURE__ */ jsx(AnimateIcon, {
1419
+ animateOnHover: true,
1420
+ asChild: true,
1421
+ children: /* @__PURE__ */ jsx(Button, {
1422
+ "aria-label": "Send",
1423
+ "data-slot": "composer-submit",
1424
+ disabled: disabled || !committable,
1425
+ size: "icon-sm",
1426
+ type: "submit",
1427
+ ...props,
1428
+ children: children ?? /* @__PURE__ */ jsx(ArrowUpIcon, {})
1429
+ })
1413
1430
  });
1414
1431
  }
1415
1432
  /** The pending-attachments strip; `state` maps straight onto `Attachment`'s. Renders nothing while empty. */
@@ -1424,16 +1441,20 @@ function ComposerAttachments({ items, onRemove, className }) {
1424
1441
  children: [
1425
1442
  /* @__PURE__ */ jsx(AttachmentMedia, {
1426
1443
  variant: item.previewUrl === void 0 ? "icon" : "image",
1427
- children: item.previewUrl === void 0 ? /* @__PURE__ */ jsx(IconPaperclip, {}) : /* @__PURE__ */ jsx("img", {
1444
+ children: item.previewUrl === void 0 ? /* @__PURE__ */ jsx(PaperclipIcon, { animate: true }) : /* @__PURE__ */ jsx("img", {
1428
1445
  alt: "",
1429
1446
  src: item.previewUrl
1430
1447
  })
1431
1448
  }),
1432
1449
  /* @__PURE__ */ jsx(AttachmentContent, { children: /* @__PURE__ */ jsx(AttachmentTitle, { children: item.name }) }),
1433
- /* @__PURE__ */ jsx(AttachmentActions, { children: /* @__PURE__ */ jsx(AttachmentAction, {
1434
- "aria-label": "Remove",
1435
- onClick: (event) => onRemove(item.id, createGenericEventDetails("none", event.nativeEvent)),
1436
- children: /* @__PURE__ */ jsx(IconX, {})
1450
+ /* @__PURE__ */ jsx(AttachmentActions, { children: /* @__PURE__ */ jsx(AnimateIcon, {
1451
+ animateOnHover: true,
1452
+ asChild: true,
1453
+ children: /* @__PURE__ */ jsx(AttachmentAction, {
1454
+ "aria-label": "Remove",
1455
+ onClick: (event) => onRemove(item.id, createGenericEventDetails("none", event.nativeEvent)),
1456
+ children: /* @__PURE__ */ jsx(XIcon, {})
1457
+ })
1437
1458
  }) })
1438
1459
  ]
1439
1460
  }, item.id))
@@ -1455,17 +1476,21 @@ function ComposerAttach({ accept, children, multiple = true, onClick, onFiles, .
1455
1476
  event.target.value = "";
1456
1477
  if (files.length > 0) onFiles(files, createGenericEventDetails("input-change", event.nativeEvent));
1457
1478
  }
1458
- }), /* @__PURE__ */ jsx(InputGroupButton, {
1459
- "aria-label": "Attach",
1460
- "data-slot": "composer-attach",
1461
- disabled,
1462
- size: "icon-xs",
1463
- ...props,
1464
- onClick: (event) => {
1465
- onClick?.(event);
1466
- if (!event.defaultPrevented) inputRef.current?.click();
1467
- },
1468
- children: children ?? /* @__PURE__ */ jsx(IconPaperclip, {})
1479
+ }), /* @__PURE__ */ jsx(AnimateIcon, {
1480
+ animateOnHover: true,
1481
+ asChild: true,
1482
+ children: /* @__PURE__ */ jsx(InputGroupButton, {
1483
+ "aria-label": "Attach",
1484
+ "data-slot": "composer-attach",
1485
+ disabled,
1486
+ size: "icon-xs",
1487
+ ...props,
1488
+ onClick: (event) => {
1489
+ onClick?.(event);
1490
+ if (!event.defaultPrevented) inputRef.current?.click();
1491
+ },
1492
+ children: children ?? /* @__PURE__ */ jsx(PaperclipIcon, {})
1493
+ })
1469
1494
  })] });
1470
1495
  }
1471
1496
  const noSubscribe = () => () => {};
@@ -1474,21 +1499,25 @@ function ComposerDictate({ children, onClick, onRecording, ...props }) {
1474
1499
  const { disabled } = useComposer();
1475
1500
  const recorder = useAudioRecorder();
1476
1501
  const supported = useSyncExternalStore(noSubscribe, () => recorder.isSupported, () => false);
1477
- return /* @__PURE__ */ jsx(InputGroupButton, {
1478
- "aria-label": "Dictate",
1479
- "aria-pressed": recorder.isRecording,
1480
- "data-recording": dataAttr(recorder.isRecording),
1481
- "data-slot": "composer-dictate",
1482
- disabled: disabled || !supported,
1483
- size: "icon-xs",
1484
- ...props,
1485
- onClick: (event) => {
1486
- onClick?.(event);
1487
- if (event.defaultPrevented) return;
1488
- if (recorder.isRecording) recorder.stop().then((recording) => onRecording(recording.part, createGenericEventDetails("imperative-action", event.nativeEvent)), () => {});
1489
- else recorder.start().catch(() => {});
1490
- },
1491
- children: children ?? /* @__PURE__ */ jsx(IconMicrophone, {})
1502
+ return /* @__PURE__ */ jsx(AnimateIcon, {
1503
+ animateOnHover: true,
1504
+ asChild: true,
1505
+ children: /* @__PURE__ */ jsx(InputGroupButton, {
1506
+ "aria-label": "Dictate",
1507
+ "aria-pressed": recorder.isRecording,
1508
+ "data-recording": dataAttr(recorder.isRecording),
1509
+ "data-slot": "composer-dictate",
1510
+ disabled: disabled || !supported,
1511
+ size: "icon-xs",
1512
+ ...props,
1513
+ onClick: (event) => {
1514
+ onClick?.(event);
1515
+ if (event.defaultPrevented) return;
1516
+ if (recorder.isRecording) recorder.stop().then((recording) => onRecording(recording.part, createGenericEventDetails("imperative-action", event.nativeEvent)), () => {});
1517
+ else recorder.start().catch(() => {});
1518
+ },
1519
+ children: children ?? /* @__PURE__ */ jsx(MicIcon, {})
1520
+ })
1492
1521
  });
1493
1522
  }
1494
1523
  //#endregion
@@ -1703,7 +1732,7 @@ function MediaPart({ part, className }) {
1703
1732
  "data-type": "document",
1704
1733
  size: "sm",
1705
1734
  className,
1706
- children: [/* @__PURE__ */ jsx(AttachmentMedia, { children: /* @__PURE__ */ jsx(IconFileText, {}) }), /* @__PURE__ */ jsx(AttachmentContent, { children: /* @__PURE__ */ jsx(AttachmentTitle, { children: name ?? source.mimeType?.split("/")[1] ?? source.value }) })]
1735
+ children: [/* @__PURE__ */ jsx(AttachmentMedia, { children: /* @__PURE__ */ jsx(FileTextIcon, { animate: true }) }), /* @__PURE__ */ jsx(AttachmentContent, { children: /* @__PURE__ */ jsx(AttachmentTitle, { children: name ?? source.mimeType?.split("/")[1] ?? source.value }) })]
1707
1736
  });
1708
1737
  }
1709
1738
  }
@@ -1755,34 +1784,39 @@ function ModelPicker({ byok, catalog, className, defaultValue, disabledProviders
1755
1784
  children: [/* @__PURE__ */ jsxs(ComboboxGroupLabel, {
1756
1785
  className: "flex items-center gap-1",
1757
1786
  "data-key-missing": dataAttr(keyMissing),
1758
- children: [provider?.label ?? group.value, keyMissing && /* @__PURE__ */ jsx(IconKey, {
1787
+ children: [provider?.label ?? group.value, keyMissing && /* @__PURE__ */ jsx(KeyIcon, {
1788
+ animate: true,
1759
1789
  "aria-label": "Key missing",
1760
1790
  className: "block-3.5 inline-3.5"
1761
1791
  })]
1762
1792
  }), /* @__PURE__ */ jsx(ComboboxCollection, { children: (ref) => {
1763
1793
  const model = catalog.getModel(ref);
1764
- return /* @__PURE__ */ jsxs(ComboboxItem, {
1765
- disabled: disabledProviders?.includes(group.value),
1766
- value: ref,
1767
- children: [
1768
- /* @__PURE__ */ jsx("span", {
1769
- className: "flex-1 truncate",
1770
- children: model?.name ?? ref
1771
- }),
1772
- model?.reasoning === true && /* @__PURE__ */ jsx(IconBrain, {
1773
- "aria-label": "Reasoning",
1774
- className: "text-muted-foreground"
1775
- }),
1776
- model?.input.includes("image") === true && /* @__PURE__ */ jsx(IconPhoto, {
1777
- "aria-label": "Vision",
1778
- className: "text-muted-foreground"
1779
- }),
1780
- model?.contextWindow !== void 0 && /* @__PURE__ */ jsx("span", {
1781
- className: "\n text-xs text-muted-foreground tabular-nums\n ",
1782
- children: formatContext(model.contextWindow)
1783
- })
1784
- ]
1785
- }, ref);
1794
+ return /* @__PURE__ */ jsx(AnimateIcon, {
1795
+ animateOnHover: true,
1796
+ asChild: true,
1797
+ children: /* @__PURE__ */ jsxs(ComboboxItem, {
1798
+ disabled: disabledProviders?.includes(group.value),
1799
+ value: ref,
1800
+ children: [
1801
+ /* @__PURE__ */ jsx("span", {
1802
+ className: "flex-1 truncate",
1803
+ children: model?.name ?? ref
1804
+ }),
1805
+ model?.reasoning === true && /* @__PURE__ */ jsx(BrainIcon, {
1806
+ "aria-label": "Reasoning",
1807
+ className: "text-muted-foreground"
1808
+ }),
1809
+ model?.input.includes("image") === true && /* @__PURE__ */ jsx(ImageIcon, {
1810
+ "aria-label": "Vision",
1811
+ className: "text-muted-foreground"
1812
+ }),
1813
+ model?.contextWindow !== void 0 && /* @__PURE__ */ jsx("span", {
1814
+ className: "\n text-xs text-muted-foreground tabular-nums\n ",
1815
+ children: formatContext(model.contextWindow)
1816
+ })
1817
+ ]
1818
+ }, ref)
1819
+ });
1786
1820
  } })]
1787
1821
  }, group.value);
1788
1822
  } })
@@ -1829,26 +1863,30 @@ function ThinkingToggle({ children, className, defaultValue, model, onLevel = "h
1829
1863
  if (levels.length <= 1) return null;
1830
1864
  const canOff = levels.includes("off");
1831
1865
  const on = level !== "off";
1832
- return /* @__PURE__ */ jsxs(Toggle, {
1833
- "data-slot": "thinking-toggle",
1834
- "data-thinking": dataAttr(on),
1835
- pressed: on,
1836
- disabled: !canOff,
1837
- size: "sm",
1838
- variant: "outline",
1839
- className: cn(`
1840
- gap-1.5 rounded-full
1841
- data-pressed:border-primary/40 data-pressed:bg-primary/10
1842
- data-pressed:text-primary
1843
- data-pressed:hover:bg-primary/15
1844
- `, className),
1845
- onPressedChange: (pressed, details) => {
1846
- const clamped = clampThinkingLevel(model, onLevel);
1847
- const next = pressed ? clamped === "off" ? levels[levels.length - 1] : clamped : "off";
1848
- setLevel(next);
1849
- onValueChange(next, details);
1850
- },
1851
- children: [/* @__PURE__ */ jsx(IconBrain, { "aria-hidden": true }), children]
1866
+ return /* @__PURE__ */ jsx(AnimateIcon, {
1867
+ animateOnHover: true,
1868
+ asChild: true,
1869
+ children: /* @__PURE__ */ jsxs(Toggle, {
1870
+ "data-slot": "thinking-toggle",
1871
+ "data-thinking": dataAttr(on),
1872
+ pressed: on,
1873
+ disabled: !canOff,
1874
+ size: "sm",
1875
+ variant: "outline",
1876
+ className: cn(`
1877
+ gap-1.5 rounded-full
1878
+ data-pressed:border-primary/40 data-pressed:bg-primary/10
1879
+ data-pressed:text-primary
1880
+ data-pressed:hover:bg-primary/15
1881
+ `, className),
1882
+ onPressedChange: (pressed, details) => {
1883
+ const clamped = clampThinkingLevel(model, onLevel);
1884
+ const next = pressed ? clamped === "off" ? levels[levels.length - 1] : clamped : "off";
1885
+ setLevel(next);
1886
+ onValueChange(next, details);
1887
+ },
1888
+ children: [/* @__PURE__ */ jsx(BrainIcon, { "aria-hidden": true }), children]
1889
+ })
1852
1890
  });
1853
1891
  }
1854
1892
  /**
@@ -1867,23 +1905,27 @@ function SearchToggle({ children, className, defaultValue, model, onValueChange,
1867
1905
  fallback: false
1868
1906
  });
1869
1907
  if (model?.search !== true) return null;
1870
- return /* @__PURE__ */ jsxs(Toggle, {
1871
- "data-slot": "search-toggle",
1872
- "data-search": dataAttr(on),
1873
- pressed: on,
1874
- size: "sm",
1875
- variant: "outline",
1876
- className: cn(`
1877
- gap-1.5 rounded-full
1878
- data-pressed:border-primary/40 data-pressed:bg-primary/10
1879
- data-pressed:text-primary
1880
- data-pressed:hover:bg-primary/15
1881
- `, className),
1882
- onPressedChange: (next, details) => {
1883
- setOn(next);
1884
- onValueChange(next, details);
1885
- },
1886
- children: [/* @__PURE__ */ jsx(IconWorld, { "aria-hidden": true }), children]
1908
+ return /* @__PURE__ */ jsx(AnimateIcon, {
1909
+ animateOnHover: true,
1910
+ asChild: true,
1911
+ children: /* @__PURE__ */ jsxs(Toggle, {
1912
+ "data-slot": "search-toggle",
1913
+ "data-search": dataAttr(on),
1914
+ pressed: on,
1915
+ size: "sm",
1916
+ variant: "outline",
1917
+ className: cn(`
1918
+ gap-1.5 rounded-full
1919
+ data-pressed:border-primary/40 data-pressed:bg-primary/10
1920
+ data-pressed:text-primary
1921
+ data-pressed:hover:bg-primary/15
1922
+ `, className),
1923
+ onPressedChange: (next, details) => {
1924
+ setOn(next);
1925
+ onValueChange(next, details);
1926
+ },
1927
+ children: [/* @__PURE__ */ jsx(GlobeIcon, { "aria-hidden": true }), children]
1928
+ })
1887
1929
  });
1888
1930
  }
1889
1931
  //#endregion
@@ -1902,12 +1944,16 @@ function QueueList({ children, className, onCancel, queue }) {
1902
1944
  children: [queue.map((message) => /* @__PURE__ */ jsxs(Item, {
1903
1945
  "data-slot": "queue-list-item",
1904
1946
  size: "xs",
1905
- children: [/* @__PURE__ */ jsx(ItemContent, { children: /* @__PURE__ */ jsx(ItemTitle, { children: queuedText(message) }) }), /* @__PURE__ */ jsx(ItemActions, { children: /* @__PURE__ */ jsx(Button, {
1906
- "aria-label": "Cancel",
1907
- size: "icon-xs",
1908
- variant: "ghost",
1909
- onClick: (event) => onCancel(message.id, createGenericEventDetails("none", event.nativeEvent)),
1910
- children: /* @__PURE__ */ jsx(IconX, {})
1947
+ children: [/* @__PURE__ */ jsx(ItemContent, { children: /* @__PURE__ */ jsx(ItemTitle, { children: queuedText(message) }) }), /* @__PURE__ */ jsx(ItemActions, { children: /* @__PURE__ */ jsx(AnimateIcon, {
1948
+ animateOnHover: true,
1949
+ asChild: true,
1950
+ children: /* @__PURE__ */ jsx(Button, {
1951
+ "aria-label": "Cancel",
1952
+ size: "icon-xs",
1953
+ variant: "ghost",
1954
+ onClick: (event) => onCancel(message.id, createGenericEventDetails("none", event.nativeEvent)),
1955
+ children: /* @__PURE__ */ jsx(XIcon, {})
1956
+ })
1911
1957
  }) })]
1912
1958
  }, message.id)), children]
1913
1959
  });
@@ -2229,45 +2275,57 @@ function handled(onClick, event) {
2229
2275
  /** Switches the row to its inline rename input. */
2230
2276
  function ThreadListRename({ children, onClick, ...props }) {
2231
2277
  const { setRenaming } = useThreadListItemContext();
2232
- return /* @__PURE__ */ jsx(Button, {
2233
- "data-slot": "thread-list-rename",
2234
- variant: "ghost",
2235
- size: "icon-xs",
2236
- ...props,
2237
- onClick: (event) => {
2238
- if (!handled(onClick, event)) setRenaming(true);
2239
- },
2240
- children: children ?? /* @__PURE__ */ jsx(IconPencil, {})
2278
+ return /* @__PURE__ */ jsx(AnimateIcon, {
2279
+ animateOnHover: true,
2280
+ asChild: true,
2281
+ children: /* @__PURE__ */ jsx(Button, {
2282
+ "data-slot": "thread-list-rename",
2283
+ variant: "ghost",
2284
+ size: "icon-xs",
2285
+ ...props,
2286
+ onClick: (event) => {
2287
+ if (!handled(onClick, event)) setRenaming(true);
2288
+ },
2289
+ children: children ?? /* @__PURE__ */ jsx(PencilIcon, {})
2290
+ })
2241
2291
  });
2242
2292
  }
2243
2293
  /** Toggles `archived` through the index. */
2244
2294
  function ThreadListArchive({ children, onClick, ...props }) {
2245
2295
  const { index } = useThreadList();
2246
2296
  const { thread } = useThreadListItemContext();
2247
- return /* @__PURE__ */ jsx(Button, {
2248
- "data-slot": "thread-list-archive",
2249
- variant: "ghost",
2250
- size: "icon-xs",
2251
- ...props,
2252
- onClick: (event) => {
2253
- if (!handled(onClick, event)) index.archive(thread.id, !thread.archived);
2254
- },
2255
- children: children ?? /* @__PURE__ */ jsx(IconArchive, {})
2297
+ return /* @__PURE__ */ jsx(AnimateIcon, {
2298
+ animateOnHover: true,
2299
+ asChild: true,
2300
+ children: /* @__PURE__ */ jsx(Button, {
2301
+ "data-slot": "thread-list-archive",
2302
+ variant: "ghost",
2303
+ size: "icon-xs",
2304
+ ...props,
2305
+ onClick: (event) => {
2306
+ if (!handled(onClick, event)) index.archive(thread.id, !thread.archived);
2307
+ },
2308
+ children: children ?? /* @__PURE__ */ jsx(ArchiveIcon, {})
2309
+ })
2256
2310
  });
2257
2311
  }
2258
2312
  /** Removes the thread from the index. Confirmation is the caller's — wrap it in an `AlertDialog`. */
2259
2313
  function ThreadListDelete({ children, onClick, ...props }) {
2260
2314
  const { index } = useThreadList();
2261
2315
  const { thread } = useThreadListItemContext();
2262
- return /* @__PURE__ */ jsx(Button, {
2263
- "data-slot": "thread-list-delete",
2264
- variant: "ghost",
2265
- size: "icon-xs",
2266
- ...props,
2267
- onClick: (event) => {
2268
- if (!handled(onClick, event)) index.remove(thread.id);
2269
- },
2270
- children: children ?? /* @__PURE__ */ jsx(IconTrash, {})
2316
+ return /* @__PURE__ */ jsx(AnimateIcon, {
2317
+ animateOnHover: true,
2318
+ asChild: true,
2319
+ children: /* @__PURE__ */ jsx(Button, {
2320
+ "data-slot": "thread-list-delete",
2321
+ variant: "ghost",
2322
+ size: "icon-xs",
2323
+ ...props,
2324
+ onClick: (event) => {
2325
+ if (!handled(onClick, event)) index.remove(thread.id);
2326
+ },
2327
+ children: children ?? /* @__PURE__ */ jsx(TrashIcon, {})
2328
+ })
2271
2329
  });
2272
2330
  }
2273
2331
  /** Creates an empty thread and selects it (`reason: 'item-press'`). */
@@ -2365,15 +2423,18 @@ function ToolCallCard({ part, result, interrupt: _interrupt, streaming = false,
2365
2423
  "aria-hidden": true,
2366
2424
  className: "block-[1em] inline-[1em]"
2367
2425
  }),
2368
- state.approvalRequested && /* @__PURE__ */ jsx(IconClock, {
2426
+ state.approvalRequested && /* @__PURE__ */ jsx(ClockIcon, {
2427
+ animate: true,
2369
2428
  "aria-hidden": true,
2370
2429
  className: "block-[1em] inline-[1em]"
2371
2430
  }),
2372
- state.complete && /* @__PURE__ */ jsx(IconCheck, {
2431
+ state.complete && /* @__PURE__ */ jsx(CheckIcon, {
2432
+ animate: true,
2373
2433
  "aria-hidden": true,
2374
2434
  className: "block-[1em] inline-[1em]"
2375
2435
  }),
2376
- state.error && /* @__PURE__ */ jsx(IconX, {
2436
+ state.error && /* @__PURE__ */ jsx(XIcon, {
2437
+ animate: true,
2377
2438
  "aria-hidden": true,
2378
2439
  className: "text-destructive block-[1em] inline-[1em]"
2379
2440
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gedatou/cadenza-ai",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.9.1",
5
5
  "description": "Thin TanStack AI facade — provider-agnostic chat runtime, conventions and conversation views built on cadenza-ui",
6
6
  "license": "MIT",
7
7
  "homepage": "https://cadenza-ui-docs.vercel.app",
@@ -53,7 +53,7 @@
53
53
  "react": ">=19",
54
54
  "react-dom": ">=19",
55
55
  "tailwindcss": ">=4",
56
- "@gedatou/cadenza-ui": "^0.8.0"
56
+ "@gedatou/cadenza-ui": "^0.9.1"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@tanstack/ai-anthropic": {
@@ -100,13 +100,13 @@
100
100
  "@streamdown/cjk": "^1.0.3",
101
101
  "@streamdown/code": "^1.1.1",
102
102
  "@streamdown/math": "^1.0.2",
103
- "@tabler/icons-react": "^3.46.0",
104
103
  "@tanstack/ai": "^0.51.0",
105
104
  "@tanstack/ai-client": "^0.29.1",
106
105
  "@tanstack/ai-react": "^0.22.3",
107
106
  "katex": "^0.18.4",
108
107
  "streamdown": "^2.6.0",
109
- "@gedatou/cadenza-utils": "0.8.0"
108
+ "@gedatou/cadenza-icons": "0.9.1",
109
+ "@gedatou/cadenza-utils": "0.9.1"
110
110
  },
111
111
  "devDependencies": {
112
112
  "@tanstack/ai-anthropic": "^0.18.2",
@@ -129,7 +129,7 @@
129
129
  "react-dom": "^19.2.8",
130
130
  "tsdown": "^0.22.14",
131
131
  "typescript": "^6.0.3",
132
- "@gedatou/cadenza-ui": "0.8.0"
132
+ "@gedatou/cadenza-ui": "0.9.1"
133
133
  },
134
134
  "scripts": {
135
135
  "build": "tsdown",