@slipstream-ui/ai 0.5.0 → 0.6.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 (47) hide show
  1. package/dist/index.d.mts +19 -4
  2. package/dist/index.d.ts +19 -4
  3. package/dist/index.js +12 -7
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +12 -7
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/manifests/attachment.manifest.json +35 -8
  8. package/dist/manifests/branch.manifest.json +1 -1
  9. package/dist/manifests/chain-thought.manifest.json +1 -1
  10. package/dist/manifests/code-block.manifest.json +1 -1
  11. package/dist/manifests/command-palette.manifest.json +22 -1
  12. package/dist/manifests/confirmation.manifest.json +1 -1
  13. package/dist/manifests/conversation.manifest.json +1 -1
  14. package/dist/manifests/inline-citation.manifest.json +1 -1
  15. package/dist/manifests/message-actions.manifest.json +59 -11
  16. package/dist/manifests/message.manifest.json +13 -1
  17. package/dist/manifests/prompt-input.manifest.json +2 -2
  18. package/dist/manifests/reasoning.manifest.json +13 -1
  19. package/dist/manifests/response.manifest.json +1 -1
  20. package/dist/manifests/source.manifest.json +2 -2
  21. package/dist/manifests/streaming-indicator.manifest.json +1 -1
  22. package/dist/manifests/suggestions.manifest.json +2 -2
  23. package/dist/manifests/tool-call.manifest.json +1 -1
  24. package/package.json +10 -10
  25. package/src/components/command-palette/CommandPalette.test.tsx +21 -0
  26. package/src/components/command-palette/CommandPalette.tsx +12 -3
  27. package/src/components/message/Message.test.tsx +15 -0
  28. package/src/components/message/Message.tsx +9 -1
  29. package/src/components/reasoning/Reasoning.test.tsx +15 -0
  30. package/src/components/reasoning/Reasoning.tsx +8 -2
  31. package/src/manifests/attachment.manifest.json +35 -8
  32. package/src/manifests/branch.manifest.json +1 -1
  33. package/src/manifests/chain-thought.manifest.json +1 -1
  34. package/src/manifests/code-block.manifest.json +1 -1
  35. package/src/manifests/command-palette.manifest.json +22 -1
  36. package/src/manifests/confirmation.manifest.json +1 -1
  37. package/src/manifests/conversation.manifest.json +1 -1
  38. package/src/manifests/inline-citation.manifest.json +1 -1
  39. package/src/manifests/message-actions.manifest.json +59 -11
  40. package/src/manifests/message.manifest.json +13 -1
  41. package/src/manifests/prompt-input.manifest.json +2 -2
  42. package/src/manifests/reasoning.manifest.json +13 -1
  43. package/src/manifests/response.manifest.json +1 -1
  44. package/src/manifests/source.manifest.json +2 -2
  45. package/src/manifests/streaming-indicator.manifest.json +1 -1
  46. package/src/manifests/suggestions.manifest.json +2 -2
  47. package/src/manifests/tool-call.manifest.json +1 -1
package/dist/index.mjs CHANGED
@@ -14,6 +14,8 @@ var Message = React.forwardRef(
14
14
  avatarFallback,
15
15
  userLabel = "You",
16
16
  assistantLabel = "Assistant",
17
+ formatTime,
18
+ locale,
17
19
  renderContent,
18
20
  isStreaming = false,
19
21
  error,
@@ -67,7 +69,7 @@ var Message = React.forwardRef(
67
69
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
68
70
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-1", children: [
69
71
  /* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: displayLabel }),
70
- message.timestamp && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: new Date(message.timestamp).toLocaleTimeString() })
72
+ message.timestamp && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: formatTime ? formatTime(new Date(message.timestamp)) : new Date(message.timestamp).toLocaleTimeString(locale) })
71
73
  ] }),
72
74
  error ? /* @__PURE__ */ jsxs("div", { role: "alert", className: "text-sm", children: [
73
75
  /* @__PURE__ */ jsx("div", { className: "text-destructive mb-2", children: error }),
@@ -1291,7 +1293,7 @@ import * as React12 from "react";
1291
1293
  import { cn as cn12 } from "@slipstream-ui/core";
1292
1294
  import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1293
1295
  var Reasoning = React12.forwardRef(
1294
- ({ steps, className, collapsible = true, defaultExpanded = false, duration, isStreaming = false, labels, ...props }, ref) => {
1296
+ ({ steps, className, collapsible = true, defaultExpanded = false, duration, isStreaming = false, labels, formatTime, locale, ...props }, ref) => {
1295
1297
  const [isExpanded, setIsExpanded] = React12.useState(defaultExpanded);
1296
1298
  const contentId = React12.useId();
1297
1299
  if (steps.length === 0) {
@@ -1330,7 +1332,7 @@ var Reasoning = React12.forwardRef(
1330
1332
  /* @__PURE__ */ jsxs10("div", { className: "text-sm flex-1", children: [
1331
1333
  /* @__PURE__ */ jsx12("div", { className: "font-medium text-foreground mb-1", children: labels?.step?.(index + 1) ?? `Step ${index + 1}` }),
1332
1334
  /* @__PURE__ */ jsx12("div", { className: "text-muted-foreground", children: step.content }),
1333
- step.timestamp && /* @__PURE__ */ jsx12("div", { className: "text-xs text-muted-foreground mt-1", children: new Date(step.timestamp).toLocaleTimeString() })
1335
+ step.timestamp && /* @__PURE__ */ jsx12("div", { className: "text-xs text-muted-foreground mt-1", children: formatTime ? formatTime(new Date(step.timestamp)) : new Date(step.timestamp).toLocaleTimeString(locale) })
1334
1336
  ] })
1335
1337
  ] }, step.id)) })
1336
1338
  ] });
@@ -1576,7 +1578,10 @@ function CommandPalette({
1576
1578
  debounceMs = 200,
1577
1579
  renderCommand,
1578
1580
  loadingText = "Searching\u2026",
1579
- placeholder = "Type a command."
1581
+ placeholder = "Type a command.",
1582
+ dialogLabel = "Command palette",
1583
+ listLabel = "Commands",
1584
+ emptyText = "No matching commands."
1580
1585
  }) {
1581
1586
  const [query, setQuery] = React19.useState("");
1582
1587
  const [activeIndex, setActiveIndex] = React19.useState(0);
@@ -1663,7 +1668,7 @@ function CommandPalette({
1663
1668
  "aria-controls": listboxId,
1664
1669
  "aria-activedescendant": filtered.length > 0 ? optionId(activeIndex) : void 0,
1665
1670
  "aria-autocomplete": "list",
1666
- "aria-label": "Command palette",
1671
+ "aria-label": dialogLabel,
1667
1672
  placeholder,
1668
1673
  value: query,
1669
1674
  onChange: (event) => {
@@ -1679,12 +1684,12 @@ function CommandPalette({
1679
1684
  {
1680
1685
  id: listboxId,
1681
1686
  role: "listbox",
1682
- "aria-label": "Commands",
1687
+ "aria-label": listLabel,
1683
1688
  "aria-busy": loading || void 0,
1684
1689
  className: "max-h-72 overflow-y-auto py-1",
1685
1690
  children: [
1686
1691
  loading && filtered.length === 0 && /* @__PURE__ */ jsx19("li", { role: "presentation", className: "px-4 py-3 text-sm text-muted-foreground", children: loadingText }),
1687
- !loading && filtered.length === 0 && /* @__PURE__ */ jsx19("li", { role: "presentation", className: "px-4 py-3 text-sm text-muted-foreground", children: "No matching commands." }),
1692
+ !loading && filtered.length === 0 && /* @__PURE__ */ jsx19("li", { role: "presentation", className: "px-4 py-3 text-sm text-muted-foreground", children: emptyText }),
1688
1693
  filtered.map((command, index) => {
1689
1694
  const showSection = command.section && command.section !== lastSection;
1690
1695
  lastSection = command.section ?? lastSection;